paper_name
stringlengths
11
170
text
stringlengths
8.07k
307k
summary
stringlengths
152
6.16k
paper_id
stringlengths
43
43
BAFFLE: TOWARDS RESOLVING FEDERATED LEARNING’S DILEMMA - THWARTING BACKDOOR AND INFERENCE ATTACKS
1 INTRODUCTION . Federated learning ( FL ) is an emerging collaborative machine learning trend with many applications such as next word prediction for mobile keyboards ( McMahan & Ramage , 2017 ) , medical imaging ( Sheller et al. , 2018a ) , and intrusion detection for IoT ( Nguyen et al. , 2019 ) . In FL , clients locally train model updates using private data and provide these to a central aggregator who combines them to a global model that is sent back to clients for the next training iteration . FL offers efficiency and scalability as the training is distributed among many clients and executed in parallel ( Bonawitz et al. , 2019 ) . In particular , FL improves privacy by enabling clients to keep their training data locally ( McMahan et al. , 2017 ) . This is not only relevant for compliance to legal obligations such as the GDPR ( 2018 ) , but also in general when processing personal and sensitive data . Despite its benefits , FL is vulnerable to backdoor ( Bagdasaryan et al. , 2020 ; Nguyen et al. , 2020 ; Xie et al. , 2020 ) and inference attacks ( Pyrgelis et al. , 2018 ; Shokri et al. , 2017 ; Ganju et al. , 2018 ) . In the former , the adversary stealthily manipulates the global model so that attacker-chosen inputs result in wrong predictions chosen by the adversary . Existing backdoor defenses , e.g. , ( Shen et al. , 2016 ; Blanchard et al. , 2017 ) fail to effectively protect against state-of-the-art backdoor attacks , e.g. , constrain-and-scale ( Bagdasaryan et al. , 2020 ) and DBA ( Xie et al. , 2020 ) . In inference attacks , the adversary aims at learning information about the clients ’ local data by analyzing their model updates . Mitigating both attack types at the same time is highly challenging due to a dilemma : Backdoor defenses require access to the clients ’ model updates , whereas inference mitigation strategies prohibit this to avoid information leakage . No solution currently exists that defends against both attacks at the same time ( §6 ) . Our Goals and Contributions . In this paper , we provide the following contributions : 1 . BAFFLE , a novel generic FL defense system that simultaneously protects both the security and the data privacy of FL by effectively preventing backdoor and inference attacks . To the best of our knowledge , this is the first work that discusses and tackles this dilemma , i.e. , no existing defense against backdoor attacks preserves the privacy of the clients ’ data ( §4 ) . 2 . To the best of our knowledge , we are the first to point out that combining clustering , clipping , and noising can prevent the adversary to trade-off between attack impact and attack stealthiness . However , the naı̈ve combination of these two classes of defenses is not effective to defend against sophisticated backdoor attacks . Therefore , we introduce a novel backdoor defense ( cf . Alg . 1 ) that has three-folds of novelty : ( 1 ) a novel two-layer defense , ( 2 ) a new dynamic clustering approach ( §3.1 ) , and ( 3 ) a new adaptive threshold tuning scheme for clipping and noising ( §3.2 ) . The clustering component filters out malicious model updates with high attack impact while adaptive smoothing , clipping , and noising eliminate potentially remaining malicious model contributions . Moreover , BAFFLE is able to mitigate more complex attack scenarios like the simultaneous injection of different backdoors by several adversaries that can not be handled in existing defenses ( §3 ) . 3 . We design tailored efficient secure ( two-party ) computation protocols for BAFFLE resulting in private BAFFLE , the first privacy-preserving backdoor defense that also inhibits inference attacks ( §4 ) . To the best of our knowledge , no existing defense against backdoor attacks preserves the privacy of the clients ’ data ( §6 ) . 4 . We demonstrate BAFFLE ’ s effectiveness against backdoor attacks through an extensive evaluation on various datasets and applications ( §5 ) . Beyond mitigating state-of-the-art backdoor attacks , we also show that BAFFLE succeeds to thwart adaptive attacks that optimize the attack strategy to circumvent BAFFLE ( §5.1 ) . 5 . We evaluate the overhead of applying secure two-party computation to demonstrate the efficiency of private BAFFLE . A training iteration of private BAFFLE for a neural network with 2.7 million parameters and 50 clients on CIFAR-10 takes less than 13 minutes ( §5.3 ) . 2 BACKGROUND AND PROBLEM SETTING . Federated learning ( FL ) is a concept for distributed machine learning where K clients and an aggregator A collaboratively build a global model G ( McMahan et al. , 2017 ) . In training round t ∈ [ 1 , T ] , each client i ∈ [ 1 , K ] locally trains a local modelWi ( with p parameters/weightsw1i , . . . , w p i ) based on the previous global model Gt−1 using its local data Di and sends Wi to A . Then , A aggregates the received models Wi into the new global model Gt by averaging the local models ( weighted by the number of training samples used to train it ) : Gt = ΣKi=1 ni×Wi n , where ni = ‖Di‖ , n = ΣKi=1ni ( cf . Alg . 2 and Alg . 3 in §A for details ) . In practice , previous works employ equal weights ( ni = n/K ) for the contributions of all clients ( Bagdasaryan et al. , 2020 ; Xie et al. , 2020 ) . We adopt this approach , i.e. , we set Gt = ΣKi=1 Wi K . Adversary model : In typical FL settings , there are two adversaries : malicious clients that try to inject backdoors into the global model and honest-but-curious ( a.k.a . semi-honest ) aggregators that correctly compute and follow the training protocols , but aim at ( passively ) gaining information about the training data of the clients through inference attacks ( Bonawitz et al. , 2017 ) . The former type of adversary Ac has full control over K ′ ( K ′ < K2 ) clients and their training data , processes , and parameters ( Bagdasaryan et al. , 2020 ) . Ac also has full knowledge of the aggregator ’ s operations , including potentially applied backdooring defenses and can arbitrarily adapt its attack strategy at any time during the training like simultaneously injecting none , one , or several backdoors . However , Ac has no control over any processes executed at the aggregator nor over the honest clients . The second adversary type , the honest-but-curious aggregatorAs , has access to all local model updates Wi , and can thus perform model inference attacks on each local model Wi to extract information about the corresponding participant ’ s data Di used for training Wi . Backdoor attacks . The goals of Ac are two-fold : ( 1 ) Impact : Ac aims at manipulating the global model Gt such that the modified model G′t provides incorrect predictions G′t ( x ) = c ′ 6= Gt ( x ) , ∀x ∈ IAc , where IAc is a trigger set specific adversary-chosen inputs . ( 2 ) Stealthiness : In addition , Ac seeks to make poisoned models and benign models indistinguishable to avoid detection . Model G′t should therefore perform normally on all other inputs that are not in the trigger set , i.e. , G′t ( x ) = Gt ( x ) , ∀x 6∈ IAc , and the dissimilarity ( e.g. , Euclidean distance ) between a poisoned model W ′ and a benign model W must be smaller than a threshold ε : ‖W ′ −W‖ < ε . Inference Attacks . The honest-but-curious aggregator As attempts to infer sensitive information about clients ’ data Di from their model updates Wi ( Pyrgelis et al. , 2018 ; Shokri et al. , 2017 ; Ganju et al. , 2018 ; Carlini et al. , 2019 ; Melis et al. , 2019 ) by maximising the information φi = Infer ( Wi ) that As gains about the data Di of client i by inferring from its corresponding model Wi . 3 BACKDOOR-RESILIENT FEDERATED LEARNING . We introduce BAFFLE , a novel defense against backdoor attacks preventing adversary Ac from achieving attack stealthiness and impact ( cf . §2 ) . Ac can control the attack impact by , e.g. , adjusting the poisoned data rate PDR , i.e. , the fraction of poisoned data DAc in the training data D ( Eq . 3 ) , or , by tuning the loss-control parameter α that controls the trade-off between backdoor task learning and similarity with the global model ( Eq . 4 ) , see §D for details . On one hand , by increasing attack impact , poisoned models become more dissimilar to benign ones , i.e. , easier to be detected . One the other hand , if poisoned updates are not well trained on the backdoor to remain undetected , the backdoor can be eliminated more easily . BAFFLE exploits this conflict to realize a multilayer backdoor defense shown in Fig . 1 and Alg . 1 . The first layer , called Model Filtering ( §3.1 ) , uses dynamic clustering to identify and remove potentially poisoned model updates having high attack impact . The second layer , called Poison Elimination ( §3.2 ) , leverages an adaptive threshold tuning scheme to clip model weights in combination with appropriate noising to smooth out and remove the backdoor impact of potentially surviving poisoned model updates . 3.1 FILTERING POISONED MODELS . The Model Filtering layer utilizes a new dynamic clustering approach aiming at excluding models with high attack impact . It overcomes several limitations of existing defenses as ( 1 ) it can handle dynamic attack scenarios such as simultaneous injection of multiple backdoors , and ( 2 ) it minimizes false positives . Existing defenses ( Blanchard et al. , 2017 ; Shen et al. , 2016 ) cluster updates into two groups where the smaller group is always considered potentially malicious and removed , leading to false positives and reduced accuracy when no attack is taking place . More importantly , Ac may also split compromised clients into several groups injecting different backdoors . A fixed number of clusters bares the risk that poisoned and benign models end up in the same cluster , in particular , if models with different backdoors differ significantly . This is shown in Fig . 2 depicting different clusterings of model updates1 . Fig . 2a shows the ground truth where Ac uses two groups of clients : 20 clients inject a backdoor and five provide random models to fool the deployed clustering-based defense . Fig . 2b shows how K-means ( as used by Shen et al . ( 2016 ) ) fails to separate benign and poisoned models so that all poisoned ones end up in the same cluster with the benign models . 1The models were trained for an FL-based Network Intrusion Detection System ( NIDS ) , cf . §E . Algorithm 1 BAFFLE 1 : Input : K , G0 , T . K is the number of clients , G0 is the initial global model , T is the number of training iterations 2 : Output : GT . GT is the updated global model after T iterations 3 : for each training iteration t in [ 1 , T ] do 4 : for each client i in [ 1 , K ] do 5 : Wi ← CLIENTUPDATE ( Gt−1 ) . The aggregator sendsGt−1 to Client i who trainsGt−1 using its dataDi locally to achieve local modalWi and sendsWi back to the aggregator . 6 : ( c11 , . . . , cKK ) ← COSINEDISTANCE ( W1 , . . . , WK ) . ∀i , j ∈ ( 1 , . . . , K ) , cij is the Cosine distance betweenWi andWj 7 : ( b1 , . . . , bL ) ← CLUSTERING ( c11 , . . . , cKK ) . L is the number of admitted models , bl are the indices of the admitted models 8 : ( e1 , . . . , eK ) ← EUCLIDEANDISTISTANCES ( Gt−1 , ( W1 , . . . , WK ) ) . ei is the Euclidean distance betweenGt−1 andWi 9 : St ← MEDIAN ( e1 , . . . , eK ) . St is the adaptive clipping bound at round t 10 : for each client l in [ 1 , L ] do 11 : W∗bl ← Wbl ∗ MIN ( 1 , St/ebl ) . W ∗ bl is the admitted model after clipped by the adaptive clipping bound St 12 : G∗t ← ∑L l=1W ∗ bl /L . Aggregating , G∗t is the plain global model before adding noise 13 : σ ← λ ∗ St . Adaptive noising level 14 : Gt ← G∗t +N ( 0 , σ ) . Adaptive noising Dynamic Clustering . We overcome both challenges by calculating the pairwise Cosine distances measuring the angular differences between all model updates and applying the HDBSCAN clustering algorithm ( Campello et al. , 2013 ) . The Cosine distance is not affected by attacks that scale updates to boost their impact as this does not change the angle between the updates . While Ac can easily manipulate the L2-norms of updates , reducing the Cosine distances decreases the attack impact ( Fung et al. , 2018 ) . HDBSCAN clusters the models based on their density and dynamically determines the required number of clusters . This can also be a single cluster , preventing false positives in the absence of attacks . Additionally , HDBSCAN labels models as noise if they do not fit into any cluster . This allows BAFFLE to efficiently handle multiple poisoned models with different backdoors by labeling them as noise to be excluded . We select the minimum cluster size to be at least 50 % of the clients , i.e. , K2 + 1 , s.t . it contains the majority of the updates ( which we assume to be benign , cf . §2 ) . All remaining ( potentially poisoned ) models are marked as outliers . This behavior is depicted in Fig . 2d where the two benign clusters C and D from Fig . 2c are merged into one cluster while both malicious and random contributions are labeled as outliers . Hence , to the best of our knowledge , our clustering is the first FL backdoor defense for dynamic attacks where the number of injected backdoors varies . The clustering step is shown in Lines 6-7 of Alg . 1 where L models ( Wb1 , . . . , WbL ) are accepted .
This paper provides an interesting research direction for the cross-domain of federating learning and backdoor attacks. This direction has very limited work until the recent 2 years. The work being proposed in this manuscript is simple and straightforward to implement. The pipeline has been clearly demonstrated. The experiments have multiple aspects presented and show promising results in various metrics.
SP:aeb3b57c2e2f7f7dfba24ee77e4aab2f445b947f
Meta-k: Towards Unsupervised Prediction of Number of Clusters
1 INTRODUCTION . Clustering is an important task in machine learning , and it has a wide range of applications ( Lung et al . ( 2004 ) ; Aminzadeh & Chatterjee ( 1984 ) ; Gan et al . ( 2007 ) ) . Clustering often consists of two steps : the feature extraction step and the clustering step . There have been numerous works on clustering ( Xu & Tian ( 2015 ) ) , and among the proposed algorithms , K-Means ( Bock ( 2007 ) ) is renowned for its simplicity and performance . Despite its popularity , K-Means has several shortcomings discussed in ( Ortega et al . ( 2009 ) ; Shibao & Keyun ( 2007 ) ) . In particular , with an increase in the dimensionality of the input data , K-Means ’ performance decreases ( Prabhu & Anbazhagan ( 2011 ) ) . This phenomenon is called the curse of dimensionality ( Bellman ( 2015 ) ) . Dimensionality reduction and feature transformation methods have been used to minimize this effect . These methods map the original data into a new feature space , in which the new data-points are easier to be separated and clustered ( Min et al . ( 2018 ) ) . Some examples of existing data transformation methods are : PCA ( Wold et al . ( 1987 ) ) , kernel methods ( Hofmann et al . ( 2008 ) ) and spectral methods ( Ng et al . ( 2002 ) ) . Although these methods are effective , a highly complex latent structure of data can still challenge them ( ( Saul et al. , 2006 ; Min et al. , 2018 ) ) . Due to the recent enhancements in deep neural networks ( Liu et al . ( 2017 ) ) and because of their inherent property of non-linear transformations , these architectures have the potential to replace classical dimensionality reduction methods . In the research field of deep clustering , popularized by the seminal paper ” Unsupervised Deep Embedding for Clustering Analysis ” ( Xie et al . ( 2016 ) ) , deep neural networks are adopted as the feature extractor and are combined with a clustering algorithm to perform the clustering task . A unique loss function is defined which updates the model . Deep clustering methods typically take k , the number of clusters , as a hyper-parameter . In real-world scenarios , where datasets are not labeled , assigning a wrong value to this parameter can reduce the overall accuracy of the model . Meta-learning , a framework that allows a model to use information from its past tasks to learn a new task quickly or with little data , has been adopted by a handful of papers ( Ferrari & de Castro ( 2012 ) ; Ferrari & De Castro ( 2015 ) ; Garg & Kalai ( 2018 ) ; Kim et al . ( 2019 ) ; Jiang & Verma ( 2019 ) ) to improve the performance of clustering tasks . Closest to our work is the approach proposed by Garg & Kalai ( 2018 ) that tries to predict the number of clusters in K-Means clustering using meta-information . To solve the same issue , we propose Meta-k , a gradient-based method for finding the optimal number of clusters and an attempt to have a self-supervised approach for clustering . Our work is based on the observation that a network can take input points and learn parameters to predict the best number of clusters , k. The predicted k , along with the points in the dataset , are the inputs to the clustering algorithm K-Means . For the clusters created , the silhouette score ( Rousseeuw ( 1987 ) ) is calculated . Using this metric value as the reward signal , we can compute the policy gradient to update the controller . As a result , in the next iteration , the controller gives higher probabilities to the k that causes better ( closer to 1 ) silhouette scores to be calculated . To be able to perform optimized clustering on both low- and high-dimensional spaces , we augment our model with a feature extraction module , a deep auto-encoder . In this regard , our work is related to the idea of learning to learn or meta-learning , a general framework to use the information that is learned in one task for improving a future task . Figure 1 shows the diagram of our model for lowand high-dimensional data . We evaluate our method in multiple scenarios on different clustering tasks using synthetic and computer vision datasets , and we show that our approach can predict the number of clusters in most settings with an insignificant error . Our contributions are : • A novel self-supervised approach for predicting the number of clusters using policy gradient methods . • Extensive evaluation on synthetic scikit-learn ( Pedregosa et al . ( 2011 ) ) datasets and wellknown vision datasets MNIST ( LeCun et al . ( 2010 ) ) and Fashion-MNIST ( Xiao et al . ( 2017 ) ) . • Our results show that our approach is able to predict the number of clusters in most scenarios identical or very close to the real number of data clusters . • We plan to release the source code of this work upon its acceptance . 2 RELATED WORK . There is a vast amount of unlabeled data in many scientific fields that can be used for training neural networks . Unsupervised learning makes use of these data , and clustering is one of the most important tasks in unsupervised learning . For unsupervised clustering , the classical K-means algorithm ( Lloyd ( 1982 ) ) has been used extensively due to its simplicity and effectiveness . If the data is distributed compactly around distinctive centroids , then the K-Means algorithm works well , but in real life , such scenarios are rare . Therefore , research has focused on transforming the data into a lowerdimensional space in which K-Means can perform successfully . If our data points are small images , then PCA ( Wold et al . ( 1987 ) ) is commonly used for this transformation . Other methods include non-linear transformation such as kernel methods ( Hofmann et al . ( 2008 ) ) and spectral methods ( Ng et al . ( 2002 ) ) . Deep learning has also been used for unsupervised clustering specifically because it can process high dimensional data effectively by learning embedding spaces ( Schmidhuber ( 2015 ) ) . Deep clustering includes two phases : the feature extraction phase and the clustering phase . Although the extracted features can be fed directly to standard clustering algorithms , deep learning models usually optimize further over specific clustering losses . Xie et al . ( 2016 ) use a loss , based on student t-distribution and can accommodate for soft clustering . They train a stacked denoising auto-encoder as their feature extraction architecture . Caron et al . ( 2018 ) is an unsupervised training method that employs pseudo labels generated by the K-Means algorithm applied to the output of a convolutional network for the task of classification . Even though ( Xie et al. , 2016 ; Caron et al. , 2018 ) achieve promising results , the number of clusters in K-Means and the classifier architecture remain as hyper-parameters needed to be tuned . To optimize the task of clustering , we can leverage the meta-learning framework . According to Vanschoren ( 2018 ) , ” Meta-learning , or learning to learn , is the science of systematically observing how different machine learning approaches perform on a wide range of learning tasks , and then learning from this experience , or meta-data , to learn new tasks much faster than otherwise possible. ” Meta-learning is closely related to one-shot or few-shot learning , and it has shown promising results in supervised learning tasks . When data is limited or quick weight optimization is a must , meta-learning can benefit standard classification and also challenges in the area of Reinforcement Learning . To our knowledge , there are only a few works that focus on using a meta-learning framework for unsupervised learning tasks . Ferrari & de Castro ( 2012 ) ; Ferrari & De Castro ( 2015 ) estimate which of the pre-existing clustering algorithms works well for a new clustering task . Their approach is limited to the algorithms that the user must provide and the number of clusters in K-Means is a hyper-parameter . Garg & Kalai ( 2018 ) Focuses on the theoretical foundations for meta-clustering and uses meta-attributes for learning the best number of clusters . The 399 datasets provided for training a binary similarity function are all labeled , and this means that during training , the number of clusters for each dataset is known . Kim et al . ( 2019 ) proposes a novel meta-learner called MLCNet that mimics numerous clustering tasks during the training to learn an effective embedding space for new clustering tasks . In this regard , their work has a resemblance to metric-based meta-learning algorithms , and learning the best number of clusters is out of their focus . In Jiang & Verma ( 2019 ) , a framework is introduced , which finds the cluster structure directly without having to choose a specific cluster loss for each clustering problem . They propose a stacked-LSTM ( Hochreiter & Schmidhuber ( 1997 ) ) as their architecture , and the number of clusters is a hyper-parameter of this network . 3 META-K. Our proposed method , Meta-K , is an attempt to self-supervise the unsupervised clustering task by automating the process of finding the best number of clusters , k. We adopted the meta-learning framework and the policy gradient algorithm in Meta-K. Our pipeline has two phases , training and inference . During the training phase , given we have high dimensional input x , we train our feature extractor φ ( x ) using reconstruction loss as shown in Equation 1 : L ( x , x̂ ) = ‖x− x̂‖2 ( 1 ) When the auto-encoder is fully-trained , a low dimensional latent representation z is learned by the model . It is shown in previous research that the K-Means algorithm , in particular , performs better when the inputs are of lower dimensions ; therefore , we use this representation as input to the clustering algorithm . The extracted features from the encoder ( z ) or low dimensional input x′ are fed to both the K-Means algorithm ( with a randomly sampled k value from a predefined range with Gaussian distribution ) and the controller network θ ( x′ ) which has the job of predicting k. The controller network consists of multiple fully connected layers with a final layer , with fixed output length that shows the range of the k values predicted by the controller . The length of this vector is denoted by n. We update the parameters of θ ( x′ ) using the policy gradient method for the chosen k value . In a standard reinforcement learning setting , the gradient is considered 1 when a certain action is taken and it is set to 0 for the other actions . In our pipeline , we use the value of silhouette score s ( C ) for the gradients . In other words , the goal of the controller is to find the value of k which gives us the highest silhouette score . Silhouette score is a metric to evaluate the quality of clusters when we do not have access to the labels . Equation 2 shows the calculation of silhouette score . s ( C ) = 1 | ∪ C| ∑ x∈∪C b ( x ) − a ( x ) max { a ( x ) , b ( x ) } ( 2 ) Where b is the mean distance to the points in the nearest cluster , and a is the mean intra-cluster distance to all the points . C is the clustering output from K-Means and x is each data point belonging to an assigned cluster . The output of s ( C ) is in the range of ( −1 , 1 ) with 1 showing the perfect clustering . During the inference phase , the inputs are fed to the controller . The number of clusters is predicted by the network , and K-means clustering is performed using the predicted k value . Figure 1 shows the outline of our method . Over the next sections , we explain our approach in detail .
The reviewed paper presents a completely unsupervised framework Meta-K for predicting the number of clusters. The approach advocated in the paper comprises two main parts: autoencoder for feature extraction and multilayer perceptron (MLP) for predicting the number of clusters. Autoencoder is used if necessary to decrease the dimensionality of the input data. The MLP is trained using policy gradient optimization schema to predict the best (according to silhouette score) number of clusters k in the given dataset. Overall, the authors show that their approach achieves near-optimum results on both a number of synthetic datasets as well as on two well-known computer vision datasets: MNIST and FMNIST.
SP:9fe7211c656c5142368a867229540e5653a5edab
Meta-k: Towards Unsupervised Prediction of Number of Clusters
1 INTRODUCTION . Clustering is an important task in machine learning , and it has a wide range of applications ( Lung et al . ( 2004 ) ; Aminzadeh & Chatterjee ( 1984 ) ; Gan et al . ( 2007 ) ) . Clustering often consists of two steps : the feature extraction step and the clustering step . There have been numerous works on clustering ( Xu & Tian ( 2015 ) ) , and among the proposed algorithms , K-Means ( Bock ( 2007 ) ) is renowned for its simplicity and performance . Despite its popularity , K-Means has several shortcomings discussed in ( Ortega et al . ( 2009 ) ; Shibao & Keyun ( 2007 ) ) . In particular , with an increase in the dimensionality of the input data , K-Means ’ performance decreases ( Prabhu & Anbazhagan ( 2011 ) ) . This phenomenon is called the curse of dimensionality ( Bellman ( 2015 ) ) . Dimensionality reduction and feature transformation methods have been used to minimize this effect . These methods map the original data into a new feature space , in which the new data-points are easier to be separated and clustered ( Min et al . ( 2018 ) ) . Some examples of existing data transformation methods are : PCA ( Wold et al . ( 1987 ) ) , kernel methods ( Hofmann et al . ( 2008 ) ) and spectral methods ( Ng et al . ( 2002 ) ) . Although these methods are effective , a highly complex latent structure of data can still challenge them ( ( Saul et al. , 2006 ; Min et al. , 2018 ) ) . Due to the recent enhancements in deep neural networks ( Liu et al . ( 2017 ) ) and because of their inherent property of non-linear transformations , these architectures have the potential to replace classical dimensionality reduction methods . In the research field of deep clustering , popularized by the seminal paper ” Unsupervised Deep Embedding for Clustering Analysis ” ( Xie et al . ( 2016 ) ) , deep neural networks are adopted as the feature extractor and are combined with a clustering algorithm to perform the clustering task . A unique loss function is defined which updates the model . Deep clustering methods typically take k , the number of clusters , as a hyper-parameter . In real-world scenarios , where datasets are not labeled , assigning a wrong value to this parameter can reduce the overall accuracy of the model . Meta-learning , a framework that allows a model to use information from its past tasks to learn a new task quickly or with little data , has been adopted by a handful of papers ( Ferrari & de Castro ( 2012 ) ; Ferrari & De Castro ( 2015 ) ; Garg & Kalai ( 2018 ) ; Kim et al . ( 2019 ) ; Jiang & Verma ( 2019 ) ) to improve the performance of clustering tasks . Closest to our work is the approach proposed by Garg & Kalai ( 2018 ) that tries to predict the number of clusters in K-Means clustering using meta-information . To solve the same issue , we propose Meta-k , a gradient-based method for finding the optimal number of clusters and an attempt to have a self-supervised approach for clustering . Our work is based on the observation that a network can take input points and learn parameters to predict the best number of clusters , k. The predicted k , along with the points in the dataset , are the inputs to the clustering algorithm K-Means . For the clusters created , the silhouette score ( Rousseeuw ( 1987 ) ) is calculated . Using this metric value as the reward signal , we can compute the policy gradient to update the controller . As a result , in the next iteration , the controller gives higher probabilities to the k that causes better ( closer to 1 ) silhouette scores to be calculated . To be able to perform optimized clustering on both low- and high-dimensional spaces , we augment our model with a feature extraction module , a deep auto-encoder . In this regard , our work is related to the idea of learning to learn or meta-learning , a general framework to use the information that is learned in one task for improving a future task . Figure 1 shows the diagram of our model for lowand high-dimensional data . We evaluate our method in multiple scenarios on different clustering tasks using synthetic and computer vision datasets , and we show that our approach can predict the number of clusters in most settings with an insignificant error . Our contributions are : • A novel self-supervised approach for predicting the number of clusters using policy gradient methods . • Extensive evaluation on synthetic scikit-learn ( Pedregosa et al . ( 2011 ) ) datasets and wellknown vision datasets MNIST ( LeCun et al . ( 2010 ) ) and Fashion-MNIST ( Xiao et al . ( 2017 ) ) . • Our results show that our approach is able to predict the number of clusters in most scenarios identical or very close to the real number of data clusters . • We plan to release the source code of this work upon its acceptance . 2 RELATED WORK . There is a vast amount of unlabeled data in many scientific fields that can be used for training neural networks . Unsupervised learning makes use of these data , and clustering is one of the most important tasks in unsupervised learning . For unsupervised clustering , the classical K-means algorithm ( Lloyd ( 1982 ) ) has been used extensively due to its simplicity and effectiveness . If the data is distributed compactly around distinctive centroids , then the K-Means algorithm works well , but in real life , such scenarios are rare . Therefore , research has focused on transforming the data into a lowerdimensional space in which K-Means can perform successfully . If our data points are small images , then PCA ( Wold et al . ( 1987 ) ) is commonly used for this transformation . Other methods include non-linear transformation such as kernel methods ( Hofmann et al . ( 2008 ) ) and spectral methods ( Ng et al . ( 2002 ) ) . Deep learning has also been used for unsupervised clustering specifically because it can process high dimensional data effectively by learning embedding spaces ( Schmidhuber ( 2015 ) ) . Deep clustering includes two phases : the feature extraction phase and the clustering phase . Although the extracted features can be fed directly to standard clustering algorithms , deep learning models usually optimize further over specific clustering losses . Xie et al . ( 2016 ) use a loss , based on student t-distribution and can accommodate for soft clustering . They train a stacked denoising auto-encoder as their feature extraction architecture . Caron et al . ( 2018 ) is an unsupervised training method that employs pseudo labels generated by the K-Means algorithm applied to the output of a convolutional network for the task of classification . Even though ( Xie et al. , 2016 ; Caron et al. , 2018 ) achieve promising results , the number of clusters in K-Means and the classifier architecture remain as hyper-parameters needed to be tuned . To optimize the task of clustering , we can leverage the meta-learning framework . According to Vanschoren ( 2018 ) , ” Meta-learning , or learning to learn , is the science of systematically observing how different machine learning approaches perform on a wide range of learning tasks , and then learning from this experience , or meta-data , to learn new tasks much faster than otherwise possible. ” Meta-learning is closely related to one-shot or few-shot learning , and it has shown promising results in supervised learning tasks . When data is limited or quick weight optimization is a must , meta-learning can benefit standard classification and also challenges in the area of Reinforcement Learning . To our knowledge , there are only a few works that focus on using a meta-learning framework for unsupervised learning tasks . Ferrari & de Castro ( 2012 ) ; Ferrari & De Castro ( 2015 ) estimate which of the pre-existing clustering algorithms works well for a new clustering task . Their approach is limited to the algorithms that the user must provide and the number of clusters in K-Means is a hyper-parameter . Garg & Kalai ( 2018 ) Focuses on the theoretical foundations for meta-clustering and uses meta-attributes for learning the best number of clusters . The 399 datasets provided for training a binary similarity function are all labeled , and this means that during training , the number of clusters for each dataset is known . Kim et al . ( 2019 ) proposes a novel meta-learner called MLCNet that mimics numerous clustering tasks during the training to learn an effective embedding space for new clustering tasks . In this regard , their work has a resemblance to metric-based meta-learning algorithms , and learning the best number of clusters is out of their focus . In Jiang & Verma ( 2019 ) , a framework is introduced , which finds the cluster structure directly without having to choose a specific cluster loss for each clustering problem . They propose a stacked-LSTM ( Hochreiter & Schmidhuber ( 1997 ) ) as their architecture , and the number of clusters is a hyper-parameter of this network . 3 META-K. Our proposed method , Meta-K , is an attempt to self-supervise the unsupervised clustering task by automating the process of finding the best number of clusters , k. We adopted the meta-learning framework and the policy gradient algorithm in Meta-K. Our pipeline has two phases , training and inference . During the training phase , given we have high dimensional input x , we train our feature extractor φ ( x ) using reconstruction loss as shown in Equation 1 : L ( x , x̂ ) = ‖x− x̂‖2 ( 1 ) When the auto-encoder is fully-trained , a low dimensional latent representation z is learned by the model . It is shown in previous research that the K-Means algorithm , in particular , performs better when the inputs are of lower dimensions ; therefore , we use this representation as input to the clustering algorithm . The extracted features from the encoder ( z ) or low dimensional input x′ are fed to both the K-Means algorithm ( with a randomly sampled k value from a predefined range with Gaussian distribution ) and the controller network θ ( x′ ) which has the job of predicting k. The controller network consists of multiple fully connected layers with a final layer , with fixed output length that shows the range of the k values predicted by the controller . The length of this vector is denoted by n. We update the parameters of θ ( x′ ) using the policy gradient method for the chosen k value . In a standard reinforcement learning setting , the gradient is considered 1 when a certain action is taken and it is set to 0 for the other actions . In our pipeline , we use the value of silhouette score s ( C ) for the gradients . In other words , the goal of the controller is to find the value of k which gives us the highest silhouette score . Silhouette score is a metric to evaluate the quality of clusters when we do not have access to the labels . Equation 2 shows the calculation of silhouette score . s ( C ) = 1 | ∪ C| ∑ x∈∪C b ( x ) − a ( x ) max { a ( x ) , b ( x ) } ( 2 ) Where b is the mean distance to the points in the nearest cluster , and a is the mean intra-cluster distance to all the points . C is the clustering output from K-Means and x is each data point belonging to an assigned cluster . The output of s ( C ) is in the range of ( −1 , 1 ) with 1 showing the perfect clustering . During the inference phase , the inputs are fed to the controller . The number of clusters is predicted by the network , and K-means clustering is performed using the predicted k value . Figure 1 shows the outline of our method . Over the next sections , we explain our approach in detail .
The paper uses policy gradients in a bandit setting to learn the optimal number of clusters, k, in k-means clustering based on the silhouette score. Finding k that leads to the highest silhouette score is a more specific problem that what the paper title promises. The approach is well-described and supported by experiments on simulated and real-world data.
SP:9fe7211c656c5142368a867229540e5653a5edab
Self-supervised Representation Learning with Relative Predictive Coding
1 INTRODUCTION . Unsupervised learning has drawn tremendous attention recently because it can extract rich representations without label supervision . Self-supervised learning , a subset of unsupervised learning , learns representations by allowing the data to provide supervision ( Devlin et al. , 2018 ) . Among its mainstream strategies , self-supervised contrastive learning has been successful in visual object recognition ( He et al. , 2020 ; Tian et al. , 2019 ; Chen et al. , 2020c ) , speech recognition ( Oord et al. , 2018 ; Rivière et al. , 2020 ) , language modeling ( Kong et al. , 2019 ) , graph representation learning ( Velickovic et al. , 2019 ) and reinforcement learning ( Kipf et al. , 2019 ) . The idea of self-supervised contrastive learning is to learn latent representations such that related instances ( e.g. , patches from the same image ; defined as positive pairs ) will have representations within close distance , while unrelated instances ( e.g. , patches from two different images ; defined as negative pairs ) will have distant representations ( Arora et al. , 2019 ) . Prior work has formulated the contrastive learning objectives as maximizing the divergence between the distribution of related and unrelated instances . In this regard , different divergence measurement often leads to different loss function design . For example , variational mutual information ( MI ) estimation ( Poole et al. , 2019 ) inspires Contrastive Predictive Coding ( CPC ) ( Oord et al. , 2018 ) . Note that MI is also the KL-divergence between the distributions of related and unrelated instances ( Cover & Thomas , 2012 ) . While the choices of the contrastive learning objectives are abundant ( Hjelm et al. , 2018 ; Poole et al. , 2019 ; Ozair et al. , 2019 ) , we point out that there are three challenges faced by existing methods . The first challenge is the training stability , where an unstable training process with high variance may be problematic . For example , Hjelm et al . ( 2018 ) ; Tschannen et al . ( 2019 ) ; Tsai et al . ( 2020b ) show that the contrastive objectives with large variance cause numerical issues and have a poor downstream performance with their learned representations . The second challenge is the sensitivity to minibatch size , where the objectives requiring a huge minibatch size may restrict their practical usage . For instance , SimCLRv2 ( Chen et al. , 2020c ) utilizes CPC as its contrastive objective and reaches state-of-the-art performances on multiple self-supervised and semi-supervised benchmarks . Nonetheless , the objective is trained with a minibatch size of 8 , 192 , and this scale of training requires enormous computational power . The third challenge is the downstream task performance , which is the one that we would like to emphasize the most . For this reason , in most cases , CPC 1Project page : https : //github.com/martinmamql/relative_predictive_coding is the objective that we would adopt for contrastive representation learning , due to its favorable performance in downstream tasks ( Tschannen et al. , 2019 ; Baevski et al. , 2020 ) . This paper presents a new contrastive representation learning objective : the Relative Predictive Coding ( RPC ) , which attempts to achieve a good balance among these three challenges : training stability , sensitivity to minibatch size , and downstream task performance . At the core of RPC is the relative parameters , which are used to regularize RPC for its boundedness and low variance . From a modeling perspective , the relative parameters act as a ` 2 regularization for RPC . From a statistical perspective , the relative parameters prevent RPC from growing to extreme values , as well as upper bound its variance . In addition to the relative parameters , RPC contains no logarithm and exponential , which are the main cause of the training instability for prior contrastive learning objectives ( Song & Ermon , 2019 ) . To empirically verify the effectiveness of RPC , we consider benchmark self-supervised representation learning tasks , including visual object classification on CIFAR-10/-100 ( Krizhevsky et al. , 2009 ) , STL-10 ( Coates et al. , 2011 ) , and ImageNet ( Russakovsky et al. , 2015 ) and speech recognition on LibriSpeech ( Panayotov et al. , 2015 ) . Comparing RPC to prior contrastive learning objectives , we observe a lower variance during training , a lower minibatch size sensitivity , and consistent performance improvement . Lastly , we also relate RPC with MI estimation , empirically showing that RPC can estimate MI with low variance . 2 PROPOSED METHOD . This paper presents a new contrastive representation learning objective - the Relative Predictive Coding ( RPC ) . At a high level , RPC 1 ) introduces the relative parameters to regularize the objective for boundedness and low variance ; and 2 ) achieves a good balance among the three challenges in the contrastive representation learning objectives : training stability , sensitivity to minibatch size , and downstream task performance . We begin by describing prior contrastive objectives along with their limitations on the three challenges in Section 2.1 . Then , we detail our presented objective and its modeling benefits in Section 2.2 . An overview of different contrastive learning objectives is provided in Table 1 . We defer all the proofs in Appendix . Notation We use an uppercase letter to denote a random variable ( e.g. , X ) , a lower case letter to denote the outcome of this random variable ( e.g. , x ) , and a calligraphy letter to denote the sample space of this random variable ( e.g. , X ) . Next , if the samples ( x , y ) are related ( or positively-paired ) , we refer ( x , y ) ∼ PXY with PXY being the joint distribution of X × Y . If the samples ( x , y ) are unrelated ( negatively-paired ) , we refer ( x , y ) ∼ PXPY with PXPY being the product of marginal distributions overX×Y . Last , we define f ∈ F for F being any class of functions f : X ×Y → R . 2.1 PRELIMINARY . Contrastive representation learning encourages the contrastiveness between the positive and the negative pairs of the representations from the related data X and Y . Specifically , when sampling a pair of representations ( x , y ) from their joint distribution ( ( x , y ) ∼ PXY ) , this pair is defined as a positive pair ; when sampling from the product of marginals ( ( x , y ) ∼ PXPY ) , this pair is defined as a negative pair . Then , Tsai et al . ( 2020b ) formalizes this idea such that the contrastiveness of the representations can be measured by the divergence between PXY and PXPY , where higher divergence suggests better contrastiveness . To better understand prior contrastive learning objectives , we categorize them in terms of different divergence measurements between PXY and PXPY , with their detailed objectives presented in Table 1 . We instantiate the discussion using Contrastive Predictive Coding ( Oord et al. , 2018 , JCPC ) , which is a lower bound of DKL ( PXY ‖PXPY ) with DKL referring to the KL-divergence : JCPC ( X , Y ) : = sup f∈F E ( x , y1 ) ∼PXY , { yj } Nj=2∼PY [ log ef ( x , y1 ) 1 N ∑N j=1 e f ( x , yj ) ] . ( 1 ) Then , Oord et al . ( 2018 ) presents to maximize JCPC ( X , Y ) , so that the learned representations X and Y have high contrastiveness . We note that JCPC has been commonly used in many recent self-supervised representation learning frameworks ( He et al. , 2020 ; Chen et al. , 2020b ) , where they constrain the function to be f ( x , y ) = cosine ( x , y ) with cosine ( · ) being cosine similarity . Under this function design , maximizing JCPC leads the representations of related pairs to be close and representations of unrelated pairs to be distant . The category of modeling DKL ( PXY ‖PXPY ) also includes the Donsker-Varadhan objective ( JDV ( Donsker & Varadhan , 1975 ; Belghazi et al. , 2018 ) ) and the Nguyen-Wainright-Jordan objective ( JNWJ ( Nguyen et al. , 2010 ; Belghazi et al. , 2018 ) ) , where Belghazi et al . ( 2018 ) ; Tsai et al . ( 2020b ) show that JDV ( X , Y ) = JNWJ ( X , Y ) = DKL ( PXY ‖PXPY ) . The other divergence measurements considered in prior work are DJS ( PXY ‖PXPY ) ( with DJS referring to the Jenson-Shannon divergence ) and DWass ( PXY ‖PXPY ) ( with DWass referring to the Wassersteindivergence ) . The instance of modeling DJS ( PXY ‖PXPY ) is the Jensen-Shannon f-GAN objective ( JJS ( Nowozin et al. , 2016 ; Hjelm et al. , 2018 ) ) , where JJS ( X , Y ) = 2 ( DJS ( PXY ‖PXPY ) − log 2 ) .2 The instance of modeling DWass ( PXY ‖PXPY ) is the Wasserstein Predictive Coding ( JWPC ( Ozair et al. , 2019 ) ) , where JWPC ( X , Y ) modifies JCPC ( X , Y ) objective ( equation 1 ) by searching the function from F to FL . FL denotes any class of 1-Lipschitz continuous functions from ( X × Y ) to R , and thus FL ⊂ F . Ozair et al . ( 2019 ) shows that JWPC ( X , Y ) is the lower bound of bothDKL ( PXY ‖PXPY ) andDWass ( PXY ‖PXPY ) . See Table 1 for all the equations . To conclude , the contrastive representation learning objectives are unsupervised representation learning methods that maximize the distribution divergence between PXY and PXPY . The learned representations cause high contrastiveness , and recent work ( Arora et al. , 2019 ; Tsai et al. , 2020a ) theoretically show that highly-contrastive representations could improve the performance on downstream tasks . After discussing prior contrastive representation learning objectives , we point out three challenges in their practical deployments : training stability , sensitivity to minibatch training size , and downstream task performance . In particular , the three challenges can hardly be handled well at the same time , where we highlight the conclusions in Table 1 . Training Stability : The training stability highly relates to the variance of the objectives , where Song & Ermon ( 2019 ) shows that JDV and JNWJ exhibit inevitable high variance due to their inclusion of exponential function . As pointed out by Tsai et al . ( 2020b ) , JCPC , JWPC , and JJS have better training stability because JCPC and JWPC can be realized as a multi-class classification task and JJS can be realized as a binary classification task . The cross-entropy loss adopted in JCPC , JWPC , and JJS is highly-optimized and stable in existing optimization package ( Abadi et al. , 2016 ; Paszke et al. , 2019 ) . Sensitivity to minibatch training size : Among all the prior contrastive representation learning methods , JCPC is known to be sensitive to the minibatch training size ( Ozair et al. , 2019 ) . Taking a closer look at equation 1 , JCPC deploys an instance selection such that y1 should be selected from { y1 , y2 , · · · , yN } , with ( x , y1 ) ∼ PXY , ( x , yj > 1 ) ∼ PXPY with N being the minibatch size . Previous work ( Poole et al. , 2019 ; Song & Ermon , 2019 ; Chen et al. , 2020b ; Caron et al. , 2020 ) showed that a large N results in a more challenging instance selection and forces JCPC to have a better contrastiveness of y1 ( related instance for x ) against { yj } Nj=2 ( unrelated instance for x ) . JDV , JNWJ , and JJS do not consider 2JJS ( X , Y ) achieves its supreme value when f∗ ( x , y ) = log ( p ( x , y ) /p ( x ) p ( y ) ) ( Tsai et al. , 2020b ) . Plugin f∗ ( x , y ) into JJS ( X , Y ) , we can conclude JJS ( X , Y ) = 2 ( DJS ( PXY ‖PXPY ) − log 2 ) . the instance selection , and JWPC reduces the minibatch training size sensitivity by enforcing 1- Lipschitz constraint . Downstream Task Performance : The downstream task performance is what we care the most among all the three challenges . JCPC has been the most popular objective as it manifests superior performance over the other alternatives ( Tschannen et al. , 2019 ; Tsai et al. , 2020b ; a ) . We note that although JWPC shows better performance on Omniglot ( Lake et al. , 2015 ) and CelebA ( Liu et al. , 2015 ) datasets , we empirically find it not generalizing well to CIFAR-10/100 ( Krizhevsky et al. , 2009 ) and ImageNet ( Russakovsky et al. , 2015 ) .
This paper presents a new contrastive representation objective that has good training stability, minibatch size sensitivity, and downstream task performance. This objective is a generalization of Chi-square divergence, the optimal solution is the density ratio of joint distribution and product of marginal distributions, the estimation is consistent and its variance goes to 0 as sample size goes to infinite, so the paper is theoretical sound. The authors conduct comprehensive experiments to show that the training based on this objective is stable, not sensitive to batch size and leads to good downstream task performance in vision and phoneme and speaker classification.
SP:0783e842aa0246f8c1726f19d3f36e3abe6b3654
Self-supervised Representation Learning with Relative Predictive Coding
1 INTRODUCTION . Unsupervised learning has drawn tremendous attention recently because it can extract rich representations without label supervision . Self-supervised learning , a subset of unsupervised learning , learns representations by allowing the data to provide supervision ( Devlin et al. , 2018 ) . Among its mainstream strategies , self-supervised contrastive learning has been successful in visual object recognition ( He et al. , 2020 ; Tian et al. , 2019 ; Chen et al. , 2020c ) , speech recognition ( Oord et al. , 2018 ; Rivière et al. , 2020 ) , language modeling ( Kong et al. , 2019 ) , graph representation learning ( Velickovic et al. , 2019 ) and reinforcement learning ( Kipf et al. , 2019 ) . The idea of self-supervised contrastive learning is to learn latent representations such that related instances ( e.g. , patches from the same image ; defined as positive pairs ) will have representations within close distance , while unrelated instances ( e.g. , patches from two different images ; defined as negative pairs ) will have distant representations ( Arora et al. , 2019 ) . Prior work has formulated the contrastive learning objectives as maximizing the divergence between the distribution of related and unrelated instances . In this regard , different divergence measurement often leads to different loss function design . For example , variational mutual information ( MI ) estimation ( Poole et al. , 2019 ) inspires Contrastive Predictive Coding ( CPC ) ( Oord et al. , 2018 ) . Note that MI is also the KL-divergence between the distributions of related and unrelated instances ( Cover & Thomas , 2012 ) . While the choices of the contrastive learning objectives are abundant ( Hjelm et al. , 2018 ; Poole et al. , 2019 ; Ozair et al. , 2019 ) , we point out that there are three challenges faced by existing methods . The first challenge is the training stability , where an unstable training process with high variance may be problematic . For example , Hjelm et al . ( 2018 ) ; Tschannen et al . ( 2019 ) ; Tsai et al . ( 2020b ) show that the contrastive objectives with large variance cause numerical issues and have a poor downstream performance with their learned representations . The second challenge is the sensitivity to minibatch size , where the objectives requiring a huge minibatch size may restrict their practical usage . For instance , SimCLRv2 ( Chen et al. , 2020c ) utilizes CPC as its contrastive objective and reaches state-of-the-art performances on multiple self-supervised and semi-supervised benchmarks . Nonetheless , the objective is trained with a minibatch size of 8 , 192 , and this scale of training requires enormous computational power . The third challenge is the downstream task performance , which is the one that we would like to emphasize the most . For this reason , in most cases , CPC 1Project page : https : //github.com/martinmamql/relative_predictive_coding is the objective that we would adopt for contrastive representation learning , due to its favorable performance in downstream tasks ( Tschannen et al. , 2019 ; Baevski et al. , 2020 ) . This paper presents a new contrastive representation learning objective : the Relative Predictive Coding ( RPC ) , which attempts to achieve a good balance among these three challenges : training stability , sensitivity to minibatch size , and downstream task performance . At the core of RPC is the relative parameters , which are used to regularize RPC for its boundedness and low variance . From a modeling perspective , the relative parameters act as a ` 2 regularization for RPC . From a statistical perspective , the relative parameters prevent RPC from growing to extreme values , as well as upper bound its variance . In addition to the relative parameters , RPC contains no logarithm and exponential , which are the main cause of the training instability for prior contrastive learning objectives ( Song & Ermon , 2019 ) . To empirically verify the effectiveness of RPC , we consider benchmark self-supervised representation learning tasks , including visual object classification on CIFAR-10/-100 ( Krizhevsky et al. , 2009 ) , STL-10 ( Coates et al. , 2011 ) , and ImageNet ( Russakovsky et al. , 2015 ) and speech recognition on LibriSpeech ( Panayotov et al. , 2015 ) . Comparing RPC to prior contrastive learning objectives , we observe a lower variance during training , a lower minibatch size sensitivity , and consistent performance improvement . Lastly , we also relate RPC with MI estimation , empirically showing that RPC can estimate MI with low variance . 2 PROPOSED METHOD . This paper presents a new contrastive representation learning objective - the Relative Predictive Coding ( RPC ) . At a high level , RPC 1 ) introduces the relative parameters to regularize the objective for boundedness and low variance ; and 2 ) achieves a good balance among the three challenges in the contrastive representation learning objectives : training stability , sensitivity to minibatch size , and downstream task performance . We begin by describing prior contrastive objectives along with their limitations on the three challenges in Section 2.1 . Then , we detail our presented objective and its modeling benefits in Section 2.2 . An overview of different contrastive learning objectives is provided in Table 1 . We defer all the proofs in Appendix . Notation We use an uppercase letter to denote a random variable ( e.g. , X ) , a lower case letter to denote the outcome of this random variable ( e.g. , x ) , and a calligraphy letter to denote the sample space of this random variable ( e.g. , X ) . Next , if the samples ( x , y ) are related ( or positively-paired ) , we refer ( x , y ) ∼ PXY with PXY being the joint distribution of X × Y . If the samples ( x , y ) are unrelated ( negatively-paired ) , we refer ( x , y ) ∼ PXPY with PXPY being the product of marginal distributions overX×Y . Last , we define f ∈ F for F being any class of functions f : X ×Y → R . 2.1 PRELIMINARY . Contrastive representation learning encourages the contrastiveness between the positive and the negative pairs of the representations from the related data X and Y . Specifically , when sampling a pair of representations ( x , y ) from their joint distribution ( ( x , y ) ∼ PXY ) , this pair is defined as a positive pair ; when sampling from the product of marginals ( ( x , y ) ∼ PXPY ) , this pair is defined as a negative pair . Then , Tsai et al . ( 2020b ) formalizes this idea such that the contrastiveness of the representations can be measured by the divergence between PXY and PXPY , where higher divergence suggests better contrastiveness . To better understand prior contrastive learning objectives , we categorize them in terms of different divergence measurements between PXY and PXPY , with their detailed objectives presented in Table 1 . We instantiate the discussion using Contrastive Predictive Coding ( Oord et al. , 2018 , JCPC ) , which is a lower bound of DKL ( PXY ‖PXPY ) with DKL referring to the KL-divergence : JCPC ( X , Y ) : = sup f∈F E ( x , y1 ) ∼PXY , { yj } Nj=2∼PY [ log ef ( x , y1 ) 1 N ∑N j=1 e f ( x , yj ) ] . ( 1 ) Then , Oord et al . ( 2018 ) presents to maximize JCPC ( X , Y ) , so that the learned representations X and Y have high contrastiveness . We note that JCPC has been commonly used in many recent self-supervised representation learning frameworks ( He et al. , 2020 ; Chen et al. , 2020b ) , where they constrain the function to be f ( x , y ) = cosine ( x , y ) with cosine ( · ) being cosine similarity . Under this function design , maximizing JCPC leads the representations of related pairs to be close and representations of unrelated pairs to be distant . The category of modeling DKL ( PXY ‖PXPY ) also includes the Donsker-Varadhan objective ( JDV ( Donsker & Varadhan , 1975 ; Belghazi et al. , 2018 ) ) and the Nguyen-Wainright-Jordan objective ( JNWJ ( Nguyen et al. , 2010 ; Belghazi et al. , 2018 ) ) , where Belghazi et al . ( 2018 ) ; Tsai et al . ( 2020b ) show that JDV ( X , Y ) = JNWJ ( X , Y ) = DKL ( PXY ‖PXPY ) . The other divergence measurements considered in prior work are DJS ( PXY ‖PXPY ) ( with DJS referring to the Jenson-Shannon divergence ) and DWass ( PXY ‖PXPY ) ( with DWass referring to the Wassersteindivergence ) . The instance of modeling DJS ( PXY ‖PXPY ) is the Jensen-Shannon f-GAN objective ( JJS ( Nowozin et al. , 2016 ; Hjelm et al. , 2018 ) ) , where JJS ( X , Y ) = 2 ( DJS ( PXY ‖PXPY ) − log 2 ) .2 The instance of modeling DWass ( PXY ‖PXPY ) is the Wasserstein Predictive Coding ( JWPC ( Ozair et al. , 2019 ) ) , where JWPC ( X , Y ) modifies JCPC ( X , Y ) objective ( equation 1 ) by searching the function from F to FL . FL denotes any class of 1-Lipschitz continuous functions from ( X × Y ) to R , and thus FL ⊂ F . Ozair et al . ( 2019 ) shows that JWPC ( X , Y ) is the lower bound of bothDKL ( PXY ‖PXPY ) andDWass ( PXY ‖PXPY ) . See Table 1 for all the equations . To conclude , the contrastive representation learning objectives are unsupervised representation learning methods that maximize the distribution divergence between PXY and PXPY . The learned representations cause high contrastiveness , and recent work ( Arora et al. , 2019 ; Tsai et al. , 2020a ) theoretically show that highly-contrastive representations could improve the performance on downstream tasks . After discussing prior contrastive representation learning objectives , we point out three challenges in their practical deployments : training stability , sensitivity to minibatch training size , and downstream task performance . In particular , the three challenges can hardly be handled well at the same time , where we highlight the conclusions in Table 1 . Training Stability : The training stability highly relates to the variance of the objectives , where Song & Ermon ( 2019 ) shows that JDV and JNWJ exhibit inevitable high variance due to their inclusion of exponential function . As pointed out by Tsai et al . ( 2020b ) , JCPC , JWPC , and JJS have better training stability because JCPC and JWPC can be realized as a multi-class classification task and JJS can be realized as a binary classification task . The cross-entropy loss adopted in JCPC , JWPC , and JJS is highly-optimized and stable in existing optimization package ( Abadi et al. , 2016 ; Paszke et al. , 2019 ) . Sensitivity to minibatch training size : Among all the prior contrastive representation learning methods , JCPC is known to be sensitive to the minibatch training size ( Ozair et al. , 2019 ) . Taking a closer look at equation 1 , JCPC deploys an instance selection such that y1 should be selected from { y1 , y2 , · · · , yN } , with ( x , y1 ) ∼ PXY , ( x , yj > 1 ) ∼ PXPY with N being the minibatch size . Previous work ( Poole et al. , 2019 ; Song & Ermon , 2019 ; Chen et al. , 2020b ; Caron et al. , 2020 ) showed that a large N results in a more challenging instance selection and forces JCPC to have a better contrastiveness of y1 ( related instance for x ) against { yj } Nj=2 ( unrelated instance for x ) . JDV , JNWJ , and JJS do not consider 2JJS ( X , Y ) achieves its supreme value when f∗ ( x , y ) = log ( p ( x , y ) /p ( x ) p ( y ) ) ( Tsai et al. , 2020b ) . Plugin f∗ ( x , y ) into JJS ( X , Y ) , we can conclude JJS ( X , Y ) = 2 ( DJS ( PXY ‖PXPY ) − log 2 ) . the instance selection , and JWPC reduces the minibatch training size sensitivity by enforcing 1- Lipschitz constraint . Downstream Task Performance : The downstream task performance is what we care the most among all the three challenges . JCPC has been the most popular objective as it manifests superior performance over the other alternatives ( Tschannen et al. , 2019 ; Tsai et al. , 2020b ; a ) . We note that although JWPC shows better performance on Omniglot ( Lake et al. , 2015 ) and CelebA ( Liu et al. , 2015 ) datasets , we empirically find it not generalizing well to CIFAR-10/100 ( Krizhevsky et al. , 2009 ) and ImageNet ( Russakovsky et al. , 2015 ) .
This paper proposes a new objective for self-supervised contrastive learning. In the general framework proposed by Tsai et al. (2020b), the proposed method boils down to using a divergence related to $\chi^2$-divergence. Compared to other objectives for contrastive learning, the authors illustrate the advantages of the proposed one in training stability (or easiness to train), sensitivity to batch size, and downstream task performance. However, introducing three new hyperparameters is a cause of concern since they make it more difficult to select optimal hyperparameters. Also, some important details of the experiments are missing. For example, how many runs to obtain the results shown in Tables 2 & 3? What's the confidence interval on the results? Any test to establish the statistical significance? What are the settings for supervised training? When the authors compare the results among different methods, did they select the optimal hyperparameters (e.g., learning rate) separately for each method?
SP:0783e842aa0246f8c1726f19d3f36e3abe6b3654
ABS: Automatic Bit Sharing for Model Compression
1 INTRODUCTION . Deep neural networks ( DNNs ) have achieved great success in many challenging computer vision tasks , including image classification ( Krizhevsky et al. , 2012 ; He et al. , 2016 ) and object detection ( Lin et al. , 2017a ; b ) . However , a deep model usually has a large number of parameters and consumes huge amounts of computational resources , which remains great obstacles for many applications , especially on resource-limited devices with limited memory and computational resources , such as smartphones . To reduce the number of parameters and computational overhead , many methods ( He et al. , 2019 ; Zhou et al. , 2016 ) have been proposed to conduct model compression by removing the redundancy while maintaining the performance . In the last decades , we have witnessed a lot of model compression methods , such as network pruning ( He et al. , 2017 ; 2019 ) and quantization ( Zhou et al. , 2016 ; Hubara et al. , 2016 ) . Specifically , network pruning reduces the model size and computational costs by removing redundant modules while network quantization maps the full-precision values to low-precision ones . It has been shown that sequentially perform network pruning and quantization is able to get a compressed network with small model size and lower computational overhead ( Han et al. , 2016 ) . However , performing pruning and quantization in a separate step may lead to sub-optimal results . For example , the best quantization strategy for the uncompressed network is not necessarily the optimal one after network pruning . Therefore , we need to consider performing pruning and quantization simultaneously . Recently , many attempts have been made to automatically determine the compression configurations of each layer ( i.e. , pruning ratios , and/or bitwidths ) , either based on reinforcement learning ( RL ) ( Wang et al. , 2019 ) , evolutionary search ( ES ) ( Wang et al. , 2020 ) , Bayesian optimization ( BO ) ( Tung & Mori , 2018 ) or differentiable methods ( Wu et al. , 2018 ; Dong & Yang , 2019 ) . In particular , previous differentiable methods formulate model compression as a differentiable searching problem to explore the search space using gradient-based optimization . As shown in Figure 1 ( a ) , each candi- date operation is maintained as a separate path , which leads to a huge number of trainable parameters and high computational overhead when the search space becomes combinatorially large . Moreover , due to the non-differentiable quantizer and pruning process , the optimization of heavily compressed candidate networks can be more challenging than that in the conventional search problem . In this paper , we propose a simple yet effective model compression method named Automatic Bit Sharing ( ABS ) to reduce the search cost and ease the optimization for the compressed candidates . Inspired by recent single-path neural architecture search ( NAS ) methods ( Stamoulis et al. , 2019 ; Guo et al. , 2020 ) , the proposed ABS introduces a novel single-path super-bit to encode all effective bitwidths in the search space instead of formulating each candidate operation as a separate path , as shown in Figure 1 ( b ) . Specifically , we build upon the observation that the quantized values of a high bitwidth can share the ones of low bitwidths under some conditions . Therefore , we are able to decompose the quantized representation into the sum of the lowest bit quantization and a series of re-assignment offsets . We then introduce learnable binary gates to encode the choice of bitwidth , including filter-wise 0-bit for pruning . By jointly training the binary gates and network parameters , the compression ratio of each layer can be automatically determined . The proposed scheme has several advantages . First , we only need to solve the search problem as finding which subset of the super-bit to use for each layer ’ s weights and activations rather than selecting from different paths . Second , we enforce the candidate bitwidths to share the common quantized values . Hence , we are able to optimize them jointly instead of separately , which greatly reduces the optimization difficulty from the discontinuity of discretization . Our main contributions are summarized as follows : • We devise a novel super-bit scheme that encapsulates multiple compression configurations in a unified single-path framework . Relying on the super-bit scheme , we further introduce learnable binary gates to determine the optimal bitwidths ( including filter-wise 0-bit for pruning ) . The proposed ABS casts the search problem as subset selection problem , hence significantly reducing the search cost . • We formulate the quantized representation as a gated combination of the lowest bitwidth quantization and a series of re-assignment offsets , in which we explicitly share the quantized values between different bitwidths . In this way , we enable the candidate operations to learn jointly rather than separately , hence greatly easing the optimization , especially in the non-differentiable quantization scenario . • We evaluate our ABS on CIFAR-100 and ImageNet over various network architectures . Extensive experiments show that the proposed method achieves the state-of-the-art performance . For example , on ImageNet , our ABS compressed MobileNetV2 achieves 28.5× Bit-Operation ( BOP ) reduction with only 0.2 % performance drop on the Top-1 accuracy . 2 RELATED WORK . Network quantization . Network quantization represents the weights , activations and even gradients in low-precision to yield compact DNNs . With low-precision integers or power-of-two representations , the heavy matrix multiplications can be replaced by efficient bitwise operations , leading to much faster test-time inference and lower power consumption . To improve the quantization performance , current methods either focus on designing accurate quantizers by fitting the quantizer to the data ( Jung et al. , 2019 ; Zhang et al. , 2018 ; Choi et al. , 2018 ; Cai et al. , 2017 ) , or seek to approximate the gradients due to the non-differentiable discretization ( Ding et al. , 2019 ; Louizos et al. , 2019 ; Zhuang et al. , 2020 ) . Moreover , most previous works assign the same bitwidth for all layers ( Zhou et al. , 2016 ; Zhuang et al. , 2018a ; 2019 ; Jung et al. , 2019 ; Jin et al. , 2019 ; Li et al. , 2020 ; Esser et al. , 2020 ) . Though attractive for simplicity , setting a uniform precision places no guarantee on optimizing network performance since different layers have different redundancy and arithmetic intensity . Therefore , several studies proposed mixed-precision quantization ( Wang et al. , 2019 ; Dong et al. , 2019 ; Wu et al. , 2018 ; Uhlich et al. , 2020 ) to set different bitwidths according to the redundancy of each layer . In this paper , based on the proposed quantization decomposition , we devise an approach that can effectively learn appropriate bitwidths for each layer through gradient-based optimization . NAS and pruning . Neural architecture search ( NAS ) aims to automatically design efficient architectures with low model size and computational costs , either based on reinforcement learning ( Pham et al. , 2018 ; Guo et al. , 2019 ) , evolutionary search ( Real et al. , 2019 ) or gradient-based methods ( Liu et al. , 2019a ) . In particular , gradient-based NAS has gained increased popularity , where the search space can be divided into the multi-path design ( Liu et al. , 2019a ; Cai et al. , 2019 ) and single-path formulation ( Stamoulis et al. , 2019 ; Guo et al. , 2020 ) , depending on whether adding each operation as a separate path or not . While prevailing NAS methods optimize the network topology , the focus of this paper is to search optimal compression ratios for a given architecture . Moreover , network pruning can be treated as fine-grained NAS , which aims at removing redundant modules to accelerate the run-time inference speed , giving rise to methods based on unstructured weight pruning ( Han et al. , 2016 ; Guo et al. , 2016 ) or structured channel pruning ( He et al. , 2017 ; Zhuang et al. , 2018b ; Luo et al. , 2017 ) . Based on channel pruning , our paper further takes quantization into consideration to generate more compact networks . AutoML for model compression . Recently , much effort has been put into automatically determining either the optimal pruning rate ( Tung & Mori , 2018 ; Dong & Yang , 2019 ; He et al. , 2018 ) , or the bitwidth ( Lou et al. , 2019 ; Cai & Vasconcelos , 2020 ) of each layer via hyper-parameter search , without relying on heuristics . In particular , HAQ ( Wang et al. , 2019 ) employs reinforcement learning to search bitwidth strategies with the hardware accelerator ’ s feedback . Meta-pruning ( Liu et al. , 2019b ) uses meta-learning to generate the weight parameters of the pruned networks and then adopts an evolutionary search algorithm to find the layer-wise sparsity for channel pruning . More recently , several studies ( Wu et al. , 2018 ; Cai & Vasconcelos , 2020 ) have focused on using differentiable schemes via gradient-based optimization . Closely related methods . To further improve the compression ratio , several methods propose to jointly optimize pruning and quantization strategies . In particular , some works only support weight quantization ( Tung & Mori , 2018 ; Ye et al. , 2019 ) or use fine-grained pruning ( Yang et al. , 2020 ) . However , the resultant networks can not be implemented efficiently on edge devices . Recently , several methods ( Wu et al. , 2018 ; Wang et al. , 2020 ; Ying et al. , 2020 ) have been proposed to consider filter pruning , weight quantization , and activation quantization jointly . In contrast to these methods , we carefully design the compression search space by sharing the quantized values between different candidate configurations , which significantly reduces the search cost and eases the optimization . Compared with those methods that share the similarities of using quantized residual errors ( Chen et al. , 2010 ; Gong et al. , 2014 ; Li et al. , 2017b ; van Baalen et al. , 2020 ) , our proposed method recursively uses quantized residual errors to decompose a quantized representation as a set of candidate bitwidths and parameterize the selection of optimal bitwidth via binary gates . Our proposed ABS and Bayesian Bits ( van Baalen et al. , 2020 ) are developed concurrently that share a similar idea of quantization decomposition . Critically , our ABS differs from Bayesian Bits in several aspects : 1 ) The quantization decomposition in our methods can be extended to non-powerof-two bit widths ( i.e. , b1 can be set to arbitrary appropriate integer values ) , which is a general case of the one in Bayesian Bits . 2 ) The optimization problems are different . Specifically , we formulate model compression as a single-path subset selection problem while Bayesian Bits casts the optimization of the binary gates to a variational inference problem that requires more relaxations and hyperparameters . 3 ) Our compressed models with less or comparable BOPs outperform those of Bayesian Bits by a large margin on ImageNet ( See Table 2 ) . 3 PROPOSED METHOD . 3.1 PRELIMINARY : NORMALIZATION AND QUANTIZATION FUNCTION . Without loss of generality , given a convolutional layer , let x and w be the activations of the last layer and its weight parameters , respectively . First , for convenience , following ( Choi et al. , 2018 ; Bai et al. , 2019 ) , we can normalize x and w into scale [ 0 , 1 ] by Tx and Tw , respectively : zx = Tx ( x ) = clip ( x vx , 0 , 1 ) , ( 1 ) zw = Tw ( w ) = 1 2 ( clip ( w vw , −1 , 1 ) + 1 ) , ( 2 ) where the function clip ( v , vlow , vup ) = min ( max ( v , vlow ) , vup ) clips any number v into the range [ vlow , vup ] , and vx and vw are trainable quantization intervals which indicate the range of weights and activations to be quantized . Then , we can apply the following function to quantize the normalized activations and parameters , namely zx ∈ [ 0 , 1 ] and zw ∈ [ 0 , 1 ] , to discretized ones : D ( z , s ) = s · round ( z s ) , ( 3 ) where round ( · ) returns the nearest integer of a given value and s denotes the normalized step size . Typically , for k-bit quantization , the normalized step size s can be computed by s = 1 2k − 1 . ( 4 ) After doing the k-bit quantization , we shall have 2k − 1 quantized values . Specifically , we obtain the quantization Q ( w ) and Q ( x ) by Q ( w ) = T−1w ( D ( zw , s ) ) = vw · ( 2 ·D ( zw , s ) − 1 ) , ( 5 ) Q ( x ) = T−1x ( D ( zx , s ) ) = vx ·D ( zx , s ) , ( 6 ) where T−1w and T −1 x denote the inverse functions of Tw and Tx , respectively .
Inspired by gradient-based NAS of single-path formulation, the authors propose a super-bit model, a single-path method, to decide the optimal number of quantization bits and pruning of a group of filters. While it can be a time-consuming process to study the impact of quantization of certain filters (or layers) on model accuracy, the proposed scheme finds a particular compression configuration in a trainable manner. The experimental results show that the proposed method presents higher model accuracy or lower computational cost (measured as the bit-operation count).
SP:3e812bc034c95a7141296dd879217ce10d01065a
ABS: Automatic Bit Sharing for Model Compression
1 INTRODUCTION . Deep neural networks ( DNNs ) have achieved great success in many challenging computer vision tasks , including image classification ( Krizhevsky et al. , 2012 ; He et al. , 2016 ) and object detection ( Lin et al. , 2017a ; b ) . However , a deep model usually has a large number of parameters and consumes huge amounts of computational resources , which remains great obstacles for many applications , especially on resource-limited devices with limited memory and computational resources , such as smartphones . To reduce the number of parameters and computational overhead , many methods ( He et al. , 2019 ; Zhou et al. , 2016 ) have been proposed to conduct model compression by removing the redundancy while maintaining the performance . In the last decades , we have witnessed a lot of model compression methods , such as network pruning ( He et al. , 2017 ; 2019 ) and quantization ( Zhou et al. , 2016 ; Hubara et al. , 2016 ) . Specifically , network pruning reduces the model size and computational costs by removing redundant modules while network quantization maps the full-precision values to low-precision ones . It has been shown that sequentially perform network pruning and quantization is able to get a compressed network with small model size and lower computational overhead ( Han et al. , 2016 ) . However , performing pruning and quantization in a separate step may lead to sub-optimal results . For example , the best quantization strategy for the uncompressed network is not necessarily the optimal one after network pruning . Therefore , we need to consider performing pruning and quantization simultaneously . Recently , many attempts have been made to automatically determine the compression configurations of each layer ( i.e. , pruning ratios , and/or bitwidths ) , either based on reinforcement learning ( RL ) ( Wang et al. , 2019 ) , evolutionary search ( ES ) ( Wang et al. , 2020 ) , Bayesian optimization ( BO ) ( Tung & Mori , 2018 ) or differentiable methods ( Wu et al. , 2018 ; Dong & Yang , 2019 ) . In particular , previous differentiable methods formulate model compression as a differentiable searching problem to explore the search space using gradient-based optimization . As shown in Figure 1 ( a ) , each candi- date operation is maintained as a separate path , which leads to a huge number of trainable parameters and high computational overhead when the search space becomes combinatorially large . Moreover , due to the non-differentiable quantizer and pruning process , the optimization of heavily compressed candidate networks can be more challenging than that in the conventional search problem . In this paper , we propose a simple yet effective model compression method named Automatic Bit Sharing ( ABS ) to reduce the search cost and ease the optimization for the compressed candidates . Inspired by recent single-path neural architecture search ( NAS ) methods ( Stamoulis et al. , 2019 ; Guo et al. , 2020 ) , the proposed ABS introduces a novel single-path super-bit to encode all effective bitwidths in the search space instead of formulating each candidate operation as a separate path , as shown in Figure 1 ( b ) . Specifically , we build upon the observation that the quantized values of a high bitwidth can share the ones of low bitwidths under some conditions . Therefore , we are able to decompose the quantized representation into the sum of the lowest bit quantization and a series of re-assignment offsets . We then introduce learnable binary gates to encode the choice of bitwidth , including filter-wise 0-bit for pruning . By jointly training the binary gates and network parameters , the compression ratio of each layer can be automatically determined . The proposed scheme has several advantages . First , we only need to solve the search problem as finding which subset of the super-bit to use for each layer ’ s weights and activations rather than selecting from different paths . Second , we enforce the candidate bitwidths to share the common quantized values . Hence , we are able to optimize them jointly instead of separately , which greatly reduces the optimization difficulty from the discontinuity of discretization . Our main contributions are summarized as follows : • We devise a novel super-bit scheme that encapsulates multiple compression configurations in a unified single-path framework . Relying on the super-bit scheme , we further introduce learnable binary gates to determine the optimal bitwidths ( including filter-wise 0-bit for pruning ) . The proposed ABS casts the search problem as subset selection problem , hence significantly reducing the search cost . • We formulate the quantized representation as a gated combination of the lowest bitwidth quantization and a series of re-assignment offsets , in which we explicitly share the quantized values between different bitwidths . In this way , we enable the candidate operations to learn jointly rather than separately , hence greatly easing the optimization , especially in the non-differentiable quantization scenario . • We evaluate our ABS on CIFAR-100 and ImageNet over various network architectures . Extensive experiments show that the proposed method achieves the state-of-the-art performance . For example , on ImageNet , our ABS compressed MobileNetV2 achieves 28.5× Bit-Operation ( BOP ) reduction with only 0.2 % performance drop on the Top-1 accuracy . 2 RELATED WORK . Network quantization . Network quantization represents the weights , activations and even gradients in low-precision to yield compact DNNs . With low-precision integers or power-of-two representations , the heavy matrix multiplications can be replaced by efficient bitwise operations , leading to much faster test-time inference and lower power consumption . To improve the quantization performance , current methods either focus on designing accurate quantizers by fitting the quantizer to the data ( Jung et al. , 2019 ; Zhang et al. , 2018 ; Choi et al. , 2018 ; Cai et al. , 2017 ) , or seek to approximate the gradients due to the non-differentiable discretization ( Ding et al. , 2019 ; Louizos et al. , 2019 ; Zhuang et al. , 2020 ) . Moreover , most previous works assign the same bitwidth for all layers ( Zhou et al. , 2016 ; Zhuang et al. , 2018a ; 2019 ; Jung et al. , 2019 ; Jin et al. , 2019 ; Li et al. , 2020 ; Esser et al. , 2020 ) . Though attractive for simplicity , setting a uniform precision places no guarantee on optimizing network performance since different layers have different redundancy and arithmetic intensity . Therefore , several studies proposed mixed-precision quantization ( Wang et al. , 2019 ; Dong et al. , 2019 ; Wu et al. , 2018 ; Uhlich et al. , 2020 ) to set different bitwidths according to the redundancy of each layer . In this paper , based on the proposed quantization decomposition , we devise an approach that can effectively learn appropriate bitwidths for each layer through gradient-based optimization . NAS and pruning . Neural architecture search ( NAS ) aims to automatically design efficient architectures with low model size and computational costs , either based on reinforcement learning ( Pham et al. , 2018 ; Guo et al. , 2019 ) , evolutionary search ( Real et al. , 2019 ) or gradient-based methods ( Liu et al. , 2019a ) . In particular , gradient-based NAS has gained increased popularity , where the search space can be divided into the multi-path design ( Liu et al. , 2019a ; Cai et al. , 2019 ) and single-path formulation ( Stamoulis et al. , 2019 ; Guo et al. , 2020 ) , depending on whether adding each operation as a separate path or not . While prevailing NAS methods optimize the network topology , the focus of this paper is to search optimal compression ratios for a given architecture . Moreover , network pruning can be treated as fine-grained NAS , which aims at removing redundant modules to accelerate the run-time inference speed , giving rise to methods based on unstructured weight pruning ( Han et al. , 2016 ; Guo et al. , 2016 ) or structured channel pruning ( He et al. , 2017 ; Zhuang et al. , 2018b ; Luo et al. , 2017 ) . Based on channel pruning , our paper further takes quantization into consideration to generate more compact networks . AutoML for model compression . Recently , much effort has been put into automatically determining either the optimal pruning rate ( Tung & Mori , 2018 ; Dong & Yang , 2019 ; He et al. , 2018 ) , or the bitwidth ( Lou et al. , 2019 ; Cai & Vasconcelos , 2020 ) of each layer via hyper-parameter search , without relying on heuristics . In particular , HAQ ( Wang et al. , 2019 ) employs reinforcement learning to search bitwidth strategies with the hardware accelerator ’ s feedback . Meta-pruning ( Liu et al. , 2019b ) uses meta-learning to generate the weight parameters of the pruned networks and then adopts an evolutionary search algorithm to find the layer-wise sparsity for channel pruning . More recently , several studies ( Wu et al. , 2018 ; Cai & Vasconcelos , 2020 ) have focused on using differentiable schemes via gradient-based optimization . Closely related methods . To further improve the compression ratio , several methods propose to jointly optimize pruning and quantization strategies . In particular , some works only support weight quantization ( Tung & Mori , 2018 ; Ye et al. , 2019 ) or use fine-grained pruning ( Yang et al. , 2020 ) . However , the resultant networks can not be implemented efficiently on edge devices . Recently , several methods ( Wu et al. , 2018 ; Wang et al. , 2020 ; Ying et al. , 2020 ) have been proposed to consider filter pruning , weight quantization , and activation quantization jointly . In contrast to these methods , we carefully design the compression search space by sharing the quantized values between different candidate configurations , which significantly reduces the search cost and eases the optimization . Compared with those methods that share the similarities of using quantized residual errors ( Chen et al. , 2010 ; Gong et al. , 2014 ; Li et al. , 2017b ; van Baalen et al. , 2020 ) , our proposed method recursively uses quantized residual errors to decompose a quantized representation as a set of candidate bitwidths and parameterize the selection of optimal bitwidth via binary gates . Our proposed ABS and Bayesian Bits ( van Baalen et al. , 2020 ) are developed concurrently that share a similar idea of quantization decomposition . Critically , our ABS differs from Bayesian Bits in several aspects : 1 ) The quantization decomposition in our methods can be extended to non-powerof-two bit widths ( i.e. , b1 can be set to arbitrary appropriate integer values ) , which is a general case of the one in Bayesian Bits . 2 ) The optimization problems are different . Specifically , we formulate model compression as a single-path subset selection problem while Bayesian Bits casts the optimization of the binary gates to a variational inference problem that requires more relaxations and hyperparameters . 3 ) Our compressed models with less or comparable BOPs outperform those of Bayesian Bits by a large margin on ImageNet ( See Table 2 ) . 3 PROPOSED METHOD . 3.1 PRELIMINARY : NORMALIZATION AND QUANTIZATION FUNCTION . Without loss of generality , given a convolutional layer , let x and w be the activations of the last layer and its weight parameters , respectively . First , for convenience , following ( Choi et al. , 2018 ; Bai et al. , 2019 ) , we can normalize x and w into scale [ 0 , 1 ] by Tx and Tw , respectively : zx = Tx ( x ) = clip ( x vx , 0 , 1 ) , ( 1 ) zw = Tw ( w ) = 1 2 ( clip ( w vw , −1 , 1 ) + 1 ) , ( 2 ) where the function clip ( v , vlow , vup ) = min ( max ( v , vlow ) , vup ) clips any number v into the range [ vlow , vup ] , and vx and vw are trainable quantization intervals which indicate the range of weights and activations to be quantized . Then , we can apply the following function to quantize the normalized activations and parameters , namely zx ∈ [ 0 , 1 ] and zw ∈ [ 0 , 1 ] , to discretized ones : D ( z , s ) = s · round ( z s ) , ( 3 ) where round ( · ) returns the nearest integer of a given value and s denotes the normalized step size . Typically , for k-bit quantization , the normalized step size s can be computed by s = 1 2k − 1 . ( 4 ) After doing the k-bit quantization , we shall have 2k − 1 quantized values . Specifically , we obtain the quantization Q ( w ) and Q ( x ) by Q ( w ) = T−1w ( D ( zw , s ) ) = vw · ( 2 ·D ( zw , s ) − 1 ) , ( 5 ) Q ( x ) = T−1x ( D ( zx , s ) ) = vx ·D ( zx , s ) , ( 6 ) where T−1w and T −1 x denote the inverse functions of Tw and Tx , respectively .
The paper describes the method to determine optimal quantization bit-width and pruning configuration for the neural network compression. Different from other approaches, the proposed method integrates multiple bit configurations (including pruning) into a single architecture, which is named “Super-bit”. The architecture uses binary gates to automatically select bit resolution. In addition, the super-bit model is differentiable and jointly trainable with parameters.
SP:3e812bc034c95a7141296dd879217ce10d01065a
Teaching Temporal Logics to Neural Networks
1 INTRODUCTION . Machine learning has revolutionized several areas of computer science , such as image recognition ( He et al. , 2015 ) , face recognition ( Taigman et al. , 2014 ) , translation ( Wu et al. , 2016 ) , and board games ( Moravcı́k et al. , 2017 ; Silver et al. , 2017 ) . For complex tasks that involve symbolic reasoning , however , deep learning techniques are still considered as insufficient . Applications of deep learning in logical reasoning problems have therefore focused on sub-problems within larger logical frameworks , such as computing heuristics in solvers ( Lederman et al. , 2020 ; Balunovic et al. , 2018 ; Selsam & Bjørner , 2019 ) or predicting individual proof steps ( Loos et al. , 2017 ; Gauthier et al. , 2018 ; Bansal et al. , 2019 ; Huang et al. , 2018 ) . Recently , however , the assumption that deep learning is not yet ready to tackle hard logical questions was drawn into question . Lample & Charton ( 2020 ) demonstrated that Transformer models ( Vaswani et al. , 2017 ) perform surprisingly well on symbolic integration , Rabe et al . ( 2020 ) demonstrated that self-supervised training leads to mathematical reasoning abilities , and Brown et al . ( 2020 ) demonstrated that large-enough language models learn basic arithmetic despite being trained on mostly natural language sources . This poses the question if other problems that are thought to require symbolic reasoning lend themselves to a direct learning approach . We study the application of Transformer models to challenging ∗Partially supported by the European Research Council ( ERC ) Grant OSARES ( No . 683300 ) and the Collaborative Research Center “ Foundations of Perspicuous Software Systems ” ( TRR 248 , 389792660 ) . logical problems in verification . We thus consider linear-time temporal logic ( LTL ) ( Pnueli , 1977 ) , which is widely used in the academic verification community ( Dwyer et al. , 1998 ; Li et al. , 2013 ; Duret-Lutz et al. , 2016 ; Rozier & Vardi , 2007 ; Schuppan & Darmawan , 2011 ; Li et al. , 2013 ; 2014 ; Schwendimann , 1998 ) and is the basis for industrial hardware specification languages like the IEEE standard PSL ( IEEE-Commission et al. , 2005 ) . LTL specifies infinite sequences and is typically used to describe system behaviors . For example , LTL can specify that some proposition P must hold at every point in time ( P ) or that P must hold at some future point of time ( P ) . By combining these operators , one can specify that P must occur infinitely often ( P ) . In this work , we apply a direct learning approach to the fundamental problem of LTL to find a satisfying trace to a formula . In applications , solutions to LTL formulas can represent ( counter ) examples for a specified system behavior , and over the last decades , generations of advanced algorithms have been developed to solve this question automatically . We start from the standard benchmark distribution of LTL formulas , consisting of conjunctions of patterns typically encountered in practice ( Dwyer et al. , 1998 ) . We then use classical algorithms , notably spot by Duret-Lutz et al . ( 2016 ) , that implement a competitive classical algorithm , to generate solutions to formulas from this distribution and train a Transformer model to predict these solutions directly . Relatively small Transformers perform very well on this task and we predict correct solutions to 96.8 % of the formulas from a held-out test set ( see Figure 1 ) . Impressive enough , Transformers hold up pretty well and predict correct solutions in 83 % of the cases , even when we focus on formulas on which spot timed out . This means that , already today , direct machine learning approaches may be useful to augment classical algorithms in logical reasoning tasks . We also study two generalization properties of the Transformer architecture , important to logical problems : We present detailed analyses on the generalization to longer formulas . It turns out that transformers trained with tree-positional encodings ( Shiv & Quirk , 2019 ) generalize to much longer formulas than they were trained on , while Transformers trained with the standard positional encoding ( as expected ) do not generalize to longer formulas . The second generalization property studied here is the question whether Transformers learn to imitate the generator of the training data , or whether they learn to solve the formulas according to the semantics of the logics . This is possible , as for most formulas there are many possible satisfying traces . In Figure 1 we highlight the fact that our models often predicted traces that satisfy the formulas , but predict different traces than the one found by the classical algorithm with which we generated the data . Especially when testing the models out-of-distribution we observed that almost no predicted trace equals the solution proposed by the classical solver . To demonstrate that these generalization behaviors are not specific to the benchmark set of LTL formulas , we also present experimental results on random LTL formulas . Further , we exclude that spot , the tool with which we generate example traces , is responsible for these behaviors , by repeating the experiments on propositional formulas for which we generate the solutions by SAT solvers . The remainder of this paper is structured as follows . We give an overview over related work in Section 2 . We describe the problem definitions and present our data generation in Section 3 . Our experimental setup is described in Section 4 and our findings in Section 5 , before concluding in Section 6 . 2 RELATED WORK . Datasets for mathematical reasoning . While we focus on a classical task from verification , other works have studied datasets derived from automated theorem provers ( Blanchette et al. , 2016 ; Loos et al. , 2017 ; Gauthier et al. , 2018 ) , interactive theorem provers ( Kaliszyk et al. , 2017 ; Bansal et al. , 2019 ; Huang et al. , 2018 ; Yang & Deng , 2019 ; Polu & Sutskever , 2020 ; Wu et al. , 2020 ; Li et al. , 2020 ; Lee et al. , 2020 ; Urban & Jakubův , 2020 ; Rabe et al. , 2020 ) , symbolic mathematics ( Lample & Charton , 2020 ) , and mathematical problems in natural language ( Saxton et al. , 2019 ; Schlag et al. , 2019 ) . Probably the closest work to this paper are the applications of Transformers to directly solve differential equations ( Lample & Charton , 2020 ) and directly predict missing assumptions and types of formal mathematical statements ( Rabe et al. , 2020 ) . We focus on a different problem domain , verification , and demonstrate that Transformers are roughly competitive with classical algorithms in that domain on their dataset . Learning has been applied to mathematics long before the rise of deep learning . Earlier works focused on ranking premises or clauses Cairns ( 2004 ) ; Urban ( 2004 ; 2007 ) ; Urban et al . ( 2008 ) ; Meng & Paulson ( 2009 ) ; Schulz ( 2013 ) ; Kaliszyk & Urban ( 2014 ) . Neural architectures for logical reasoning . ( Paliwal et al. , 2020 ) demonstrate significant improvements in theorem proving through the use of graph neural networks to represent higher-order logic terms . Selsam et al . ( 2019 ) presented NeuroSAT , a graph neural network ( Scarselli et al. , 2008 ; Li et al. , 2017 ; Gilmer et al. , 2017 ; Wu et al. , 2019 ) for solving the propositional satisfiability problem . In contrast , we apply a generic sequence-to-sequence model to predict the solutions to formulas , not only whether there is a solution . This allows us to apply the approach to a wider set of logics ( logics without a CNF ) . A simplified NeuroSAT architecture was trained for unsat-core predictions ( Selsam & Bjørner , 2019 ) . Lederman et al . ( 2020 ) have used graph neural networks on CNF to learn better heuristics for a 2QBF solver . Evans et al . ( 2018 ) study the problem of logical entailment in propositional logic using tree-RNNs . Entailment is a subproblem of satisfiability and ( besides being a classification problem ) could be encoded in the same form as our propositional formulas . The formulas considered in their dataset are much smaller than in this work . Language models applied to programs . Transformers have also been applied to programs for tasks such as summarizing code ( Fernandes et al. , 2018 ) or variable naming and misuse ( Hellendoorn et al. , 2020 ) . Other works focused on recurrent neural networks or graph neural networks for code analysis , e.g . ( Piech et al. , 2015 ; Gupta et al. , 2017 ; Bhatia et al. , 2018 ; Wang et al. , 2018 ; Allamanis et al. , 2017 ) . Another area in the intersection of formal methods and machine learning is the verification of neural networks ( Seshia & Sadigh , 2016 ; Seshia et al. , 2018 ; Singh et al. , 2019 ; Gehr et al. , 2018 ; Huang et al. , 2017 ; Dreossi et al. , 2019 ) . 3 DATASETS . To demonstrate the generalization properties of the Transformer on logical tasks , we generated several datasets in three different fashions . We will describe the underlying logical problems and our data generation in the following . 3.1 TRACE GENERATION FOR LINEAR-TIME TEMPORAL LOGIC . Linear-time temporal logic ( LTL , Pnueli , 1977 ) combines propositional connectives with temporal operators such as the Next operator and the Until operator U . ϕ means that ϕ holds in the next position of a sequence ; ϕ1 U ϕ2 means that ϕ1 holds until ϕ2 holds . For example , the LTL formula ( bU a ) ∧ ( cU ¬a ) states that b has to hold along the trace until a holds and c has to hold until a does not hold anymore . There also exist derived operators . For example , consider the following specification of an arbiter : ( request → grant ) states that , at every point in time ( -operator ) , if there is a request signal , then a grant signal must follow at some future point in time ( -operator ) . The full semantics and an explanation of the operators can be found in Appendix A . We consider infinite sequences , that are finitely represented in the form of a “ lasso ” uvω , where u , called prefix , and v , called period , are finite sequences of propositional formulas . We call such sequences ( symbolic ) traces . For example , the symbolic trace ( a ∧ b ) ω defines the infinite sequence where a and b evaluate to true on every position . Symbolic traces allow us to underspecify propositions when they do not matter . For example , the LTL formula a is satisfied by the symbolic trace : true true ( a ) ω , which allow for any combination of propositions on the first two positions . Our datasets consist of pairs of satisfiable LTL formulas and satisfying symbolic traces generated with tools and automata constructions from the spot framework ( Duret-Lutz et al. , 2016 ) . We use a compact syntax for ultimately periodic symbolic traces : Each position in the trace is separated by the delimiter “ ; ” . True and False are represented by “ 1 ” and “ 0 ” , respectively . The beginning of the period v is signaled by the character “ { ” and analogously its end by “ } ” . For example , the ultimately periodic symbolic trace denoted by a ; a ; a ; { b } , describes all infinite traces where on the first 3 positions a must hold followed by an infinite period on which b must hold on every position . Given a satisfiable LTL formula ϕ , our trace generator constructs a Büchi automatonAϕ that accepts exactly the language defined by the LTL formula , i.e. , L ( Aϕ ) = L ( ϕ ) . From this automaton , we construct an arbitrary accepted symbolic trace , by searching for an accepting run in Aϕ .
The paper explores the application of modern learning techniques (transformers and tree positional encodings) to the task of producing valid traces for a given LTL specification. A series of experiments are conducted to explore the generalization power of the proposed approach, both in terms of formula size and style of constraint. The work follows a recent trend of the application of deep learning techniques to logic-based settings, and the authors present (to the best of my knowledge) the first attempt of applying deep learning techniques to this particular task.
SP:1dade549a14dc9c41f2d16be1e405be113c611fd
Teaching Temporal Logics to Neural Networks
1 INTRODUCTION . Machine learning has revolutionized several areas of computer science , such as image recognition ( He et al. , 2015 ) , face recognition ( Taigman et al. , 2014 ) , translation ( Wu et al. , 2016 ) , and board games ( Moravcı́k et al. , 2017 ; Silver et al. , 2017 ) . For complex tasks that involve symbolic reasoning , however , deep learning techniques are still considered as insufficient . Applications of deep learning in logical reasoning problems have therefore focused on sub-problems within larger logical frameworks , such as computing heuristics in solvers ( Lederman et al. , 2020 ; Balunovic et al. , 2018 ; Selsam & Bjørner , 2019 ) or predicting individual proof steps ( Loos et al. , 2017 ; Gauthier et al. , 2018 ; Bansal et al. , 2019 ; Huang et al. , 2018 ) . Recently , however , the assumption that deep learning is not yet ready to tackle hard logical questions was drawn into question . Lample & Charton ( 2020 ) demonstrated that Transformer models ( Vaswani et al. , 2017 ) perform surprisingly well on symbolic integration , Rabe et al . ( 2020 ) demonstrated that self-supervised training leads to mathematical reasoning abilities , and Brown et al . ( 2020 ) demonstrated that large-enough language models learn basic arithmetic despite being trained on mostly natural language sources . This poses the question if other problems that are thought to require symbolic reasoning lend themselves to a direct learning approach . We study the application of Transformer models to challenging ∗Partially supported by the European Research Council ( ERC ) Grant OSARES ( No . 683300 ) and the Collaborative Research Center “ Foundations of Perspicuous Software Systems ” ( TRR 248 , 389792660 ) . logical problems in verification . We thus consider linear-time temporal logic ( LTL ) ( Pnueli , 1977 ) , which is widely used in the academic verification community ( Dwyer et al. , 1998 ; Li et al. , 2013 ; Duret-Lutz et al. , 2016 ; Rozier & Vardi , 2007 ; Schuppan & Darmawan , 2011 ; Li et al. , 2013 ; 2014 ; Schwendimann , 1998 ) and is the basis for industrial hardware specification languages like the IEEE standard PSL ( IEEE-Commission et al. , 2005 ) . LTL specifies infinite sequences and is typically used to describe system behaviors . For example , LTL can specify that some proposition P must hold at every point in time ( P ) or that P must hold at some future point of time ( P ) . By combining these operators , one can specify that P must occur infinitely often ( P ) . In this work , we apply a direct learning approach to the fundamental problem of LTL to find a satisfying trace to a formula . In applications , solutions to LTL formulas can represent ( counter ) examples for a specified system behavior , and over the last decades , generations of advanced algorithms have been developed to solve this question automatically . We start from the standard benchmark distribution of LTL formulas , consisting of conjunctions of patterns typically encountered in practice ( Dwyer et al. , 1998 ) . We then use classical algorithms , notably spot by Duret-Lutz et al . ( 2016 ) , that implement a competitive classical algorithm , to generate solutions to formulas from this distribution and train a Transformer model to predict these solutions directly . Relatively small Transformers perform very well on this task and we predict correct solutions to 96.8 % of the formulas from a held-out test set ( see Figure 1 ) . Impressive enough , Transformers hold up pretty well and predict correct solutions in 83 % of the cases , even when we focus on formulas on which spot timed out . This means that , already today , direct machine learning approaches may be useful to augment classical algorithms in logical reasoning tasks . We also study two generalization properties of the Transformer architecture , important to logical problems : We present detailed analyses on the generalization to longer formulas . It turns out that transformers trained with tree-positional encodings ( Shiv & Quirk , 2019 ) generalize to much longer formulas than they were trained on , while Transformers trained with the standard positional encoding ( as expected ) do not generalize to longer formulas . The second generalization property studied here is the question whether Transformers learn to imitate the generator of the training data , or whether they learn to solve the formulas according to the semantics of the logics . This is possible , as for most formulas there are many possible satisfying traces . In Figure 1 we highlight the fact that our models often predicted traces that satisfy the formulas , but predict different traces than the one found by the classical algorithm with which we generated the data . Especially when testing the models out-of-distribution we observed that almost no predicted trace equals the solution proposed by the classical solver . To demonstrate that these generalization behaviors are not specific to the benchmark set of LTL formulas , we also present experimental results on random LTL formulas . Further , we exclude that spot , the tool with which we generate example traces , is responsible for these behaviors , by repeating the experiments on propositional formulas for which we generate the solutions by SAT solvers . The remainder of this paper is structured as follows . We give an overview over related work in Section 2 . We describe the problem definitions and present our data generation in Section 3 . Our experimental setup is described in Section 4 and our findings in Section 5 , before concluding in Section 6 . 2 RELATED WORK . Datasets for mathematical reasoning . While we focus on a classical task from verification , other works have studied datasets derived from automated theorem provers ( Blanchette et al. , 2016 ; Loos et al. , 2017 ; Gauthier et al. , 2018 ) , interactive theorem provers ( Kaliszyk et al. , 2017 ; Bansal et al. , 2019 ; Huang et al. , 2018 ; Yang & Deng , 2019 ; Polu & Sutskever , 2020 ; Wu et al. , 2020 ; Li et al. , 2020 ; Lee et al. , 2020 ; Urban & Jakubův , 2020 ; Rabe et al. , 2020 ) , symbolic mathematics ( Lample & Charton , 2020 ) , and mathematical problems in natural language ( Saxton et al. , 2019 ; Schlag et al. , 2019 ) . Probably the closest work to this paper are the applications of Transformers to directly solve differential equations ( Lample & Charton , 2020 ) and directly predict missing assumptions and types of formal mathematical statements ( Rabe et al. , 2020 ) . We focus on a different problem domain , verification , and demonstrate that Transformers are roughly competitive with classical algorithms in that domain on their dataset . Learning has been applied to mathematics long before the rise of deep learning . Earlier works focused on ranking premises or clauses Cairns ( 2004 ) ; Urban ( 2004 ; 2007 ) ; Urban et al . ( 2008 ) ; Meng & Paulson ( 2009 ) ; Schulz ( 2013 ) ; Kaliszyk & Urban ( 2014 ) . Neural architectures for logical reasoning . ( Paliwal et al. , 2020 ) demonstrate significant improvements in theorem proving through the use of graph neural networks to represent higher-order logic terms . Selsam et al . ( 2019 ) presented NeuroSAT , a graph neural network ( Scarselli et al. , 2008 ; Li et al. , 2017 ; Gilmer et al. , 2017 ; Wu et al. , 2019 ) for solving the propositional satisfiability problem . In contrast , we apply a generic sequence-to-sequence model to predict the solutions to formulas , not only whether there is a solution . This allows us to apply the approach to a wider set of logics ( logics without a CNF ) . A simplified NeuroSAT architecture was trained for unsat-core predictions ( Selsam & Bjørner , 2019 ) . Lederman et al . ( 2020 ) have used graph neural networks on CNF to learn better heuristics for a 2QBF solver . Evans et al . ( 2018 ) study the problem of logical entailment in propositional logic using tree-RNNs . Entailment is a subproblem of satisfiability and ( besides being a classification problem ) could be encoded in the same form as our propositional formulas . The formulas considered in their dataset are much smaller than in this work . Language models applied to programs . Transformers have also been applied to programs for tasks such as summarizing code ( Fernandes et al. , 2018 ) or variable naming and misuse ( Hellendoorn et al. , 2020 ) . Other works focused on recurrent neural networks or graph neural networks for code analysis , e.g . ( Piech et al. , 2015 ; Gupta et al. , 2017 ; Bhatia et al. , 2018 ; Wang et al. , 2018 ; Allamanis et al. , 2017 ) . Another area in the intersection of formal methods and machine learning is the verification of neural networks ( Seshia & Sadigh , 2016 ; Seshia et al. , 2018 ; Singh et al. , 2019 ; Gehr et al. , 2018 ; Huang et al. , 2017 ; Dreossi et al. , 2019 ) . 3 DATASETS . To demonstrate the generalization properties of the Transformer on logical tasks , we generated several datasets in three different fashions . We will describe the underlying logical problems and our data generation in the following . 3.1 TRACE GENERATION FOR LINEAR-TIME TEMPORAL LOGIC . Linear-time temporal logic ( LTL , Pnueli , 1977 ) combines propositional connectives with temporal operators such as the Next operator and the Until operator U . ϕ means that ϕ holds in the next position of a sequence ; ϕ1 U ϕ2 means that ϕ1 holds until ϕ2 holds . For example , the LTL formula ( bU a ) ∧ ( cU ¬a ) states that b has to hold along the trace until a holds and c has to hold until a does not hold anymore . There also exist derived operators . For example , consider the following specification of an arbiter : ( request → grant ) states that , at every point in time ( -operator ) , if there is a request signal , then a grant signal must follow at some future point in time ( -operator ) . The full semantics and an explanation of the operators can be found in Appendix A . We consider infinite sequences , that are finitely represented in the form of a “ lasso ” uvω , where u , called prefix , and v , called period , are finite sequences of propositional formulas . We call such sequences ( symbolic ) traces . For example , the symbolic trace ( a ∧ b ) ω defines the infinite sequence where a and b evaluate to true on every position . Symbolic traces allow us to underspecify propositions when they do not matter . For example , the LTL formula a is satisfied by the symbolic trace : true true ( a ) ω , which allow for any combination of propositions on the first two positions . Our datasets consist of pairs of satisfiable LTL formulas and satisfying symbolic traces generated with tools and automata constructions from the spot framework ( Duret-Lutz et al. , 2016 ) . We use a compact syntax for ultimately periodic symbolic traces : Each position in the trace is separated by the delimiter “ ; ” . True and False are represented by “ 1 ” and “ 0 ” , respectively . The beginning of the period v is signaled by the character “ { ” and analogously its end by “ } ” . For example , the ultimately periodic symbolic trace denoted by a ; a ; a ; { b } , describes all infinite traces where on the first 3 positions a must hold followed by an infinite period on which b must hold on every position . Given a satisfiable LTL formula ϕ , our trace generator constructs a Büchi automatonAϕ that accepts exactly the language defined by the LTL formula , i.e. , L ( Aϕ ) = L ( ϕ ) . From this automaton , we construct an arbitrary accepted symbolic trace , by searching for an accepting run in Aϕ .
The paper presents multiple dataset generation and testing procedures for linear temporal logic and propositional logic satisfiability. They are then used to train Transformers with tree positional encoding. The approach amounts to imitation learning based on existing solvers for satisfiability for the considered logics. In contrast to previous work, the approach supports logical formulas of arbitrary shape. The experiments demonstrate successful generalization for multiple approaches to dataset generation.
SP:1dade549a14dc9c41f2d16be1e405be113c611fd
Variational Deterministic Uncertainty Quantification
1 INTRODUCTION . Deploying machine learning algorithms as part of automated decision making systems , such as self driving cars and medical diagnostics , requires implementing fail-safes . Whenever the model is presented with a novel or ambiguous situation , it would not be wise to simply trust its prediction . Instead , the system should try to get more information or simply withhold or defer judgment . While significant progress has been made towards estimating predictive uncertainty reliably in deep learning ( Gal & Ghahramani , 2016 ; Lakshminarayanan et al. , 2017 ) , there is no single method that is shown to work on large datasets in classification and regression without significant computation overheads , such as multiple forward passes . We propose Variational Deterministic Uncertainty Quantification ( vDUQ ) , a method for obtaining predictive uncertainty in deep learning for both classification and regression problems in only a single forward pass . In previous work , van Amersfoort et al . ( 2020 ) show that combining a distance aware decision function with a regularized feature extractor in the form of a deep RBF network , leads to a model ( DUQ ) that matches a softmax model in accuracy , but is competitive with Deep Ensembles for uncertainty on large datasets . The feature extractor is regularized using a two-sided gradient penalty , which encourages the model to be sensitive to changes in the input , avoiding feature collapse , and encouraging generalization by controlling the Lipschitz constant . This model , however , has several limitations ; for example the uncertainty ( a distance in feature space ) can not be interpreted probabilistically and it is difficult to disentangle aleatoric and epistemic uncertainty . Additionally , the loss function and centroid update scheme are not principled and do not extend to regression tasks . A probabilistic and principled alternative to deep RBF networks are Gaussian Processes ( GPs ) in combination with Deep Kernel Learning ( DKL ) ( Hinton & Salakhutdinov , 2008 ; Wilson et al. , 2016b ) . DKL was introduced as a “ best of both worlds ” solution : apply a deep model on the training data and learn the GP in feature space , ideally getting the advantages of both models . In practice , however , DKL suffers from the same failure as Deep RBF networks : the deep model is free to map out of distribution data close to the feature representation of the training data , removing the attractive properties of GPs with distance sensitive kernels . Using insights from DUQ , we are able to mitigate the problems of uncertainty collapse in DKL . In particular , we use direct spectral normalization ( Gouk et al. , 2018 ; Miyato et al. , 2018 ) in combination with a ResNet ( He et al. , 2016 ) , a variation that was suggested in Liu et al . ( 2020 ) . The spectral normalization enforces smoothness , while the residual connections enforce sensitivity of the feature represenation to changes in the input , obtaining a similar effect as the gradient penalty of DUQ . We use an inter-domain inducing point variational approximation of the GP predictive distribution ( Lázaro-Gredilla & Figueiras-Vidal , 2009 ; Hensman et al. , 2015 ) , which places inducing points in feature space leading to needing fewer inducing points than previous work ( Wilson et al. , 2016a ) . These two techniques combined speed up inference in the GP model and decouple it from the dataset size . We release our code1 and hope that it will become a drop in alternative for softmax models with improved uncertainty . In Figure 1 , we show how vDUQ and Deep Ensembles ( Lakshminarayanan et al. , 2017 ) , the current state of the art for uncertainty quantification ( Ovadia et al. , 2019 ) , perform on simple 1D regression . This task is particularly hard for deep networks as shown in Foong et al . ( 2019 ) . vDUQ shows the desired behavior of reverting back to the prior away from the data , while the Deep Ensemble extrapolates arbitrarily and confidently . In between the two sinusoids , the Deep Ensemble is certain while vDUQ increases its uncertainty . In summary , our contributions are as follows : • We improve training a DKL model and for the first time match the accuracy and speed of training a deep network using regular softmax output on standard vision benchmarks . • We demonstrate excellent uncertainty quantification in classsification which matches or exceeds the state of the art on CIFAR-10 , including ensembling approaches . • We show state of the art performance on causal inference for personalized medicine , an exciting real world application . This task requires calibrated uncertainty in regression to be able to defer treatment to an expert when uncertainty is high . 2 BACKGROUND . Gaussian Processes ( GPs ) provide an interpretable , explainable and principled way to make predictions , and can work well even with little training data due to their use of Bayesian inference . In contrast to deep neural networks , GPs have high uncertainty away from the training data and on noisy inputs . There are however two main issues with the standard GP setup : poor performance on high dimensional inputs and inefficient computational scaling with large datasets . The poor performance on high dimensional inputs is due to the fact that most standard shift-invariant kernels are based on 1Available at : anonymized-for-review the Euclidean distance , which is a poor metric for highly structured data like images ( Theis et al. , 2016 ) . While kernels exist that better address this ( Van der Wilk et al. , 2017 ; Jacot et al. , 2018 ) , these are more computationally expensive and typically still underperform standard convolutional neural networks . Deep Kernel Learning ( Calandra et al. , 2016 ; Hinton & Salakhutdinov , 2008 ; Wilson et al. , 2016b ) is a way to combine the expressiveness of deep neural networks with the attractive properties of Gaussian Processes . The core idea is to use a deep neural network inside the kernel of a GP , k ( xi , xj ) → k ( fθ ( xi ) , fθ ( xj ) ) , where fθ ( · ) is a deep neural network , such as a Wide ResNet ( Zagoruyko & Komodakis , 2016 ) up to the last linear layer , parametrized by θ . The kernel k ( · , · ) can be any of the standard kernels , such as the RBF or Matérn kernel . With the deep network it becomes possible to train the GP on datasets that contain high dimensional points , such as images . As the deep network is unconstrained , uncertainty away from the data collapses ( Bradshaw et al. , 2017 ) , and the model can be arbitrarily confident while no data has been observed in that region during training . This has been a major drawback to using DKL in practice . In Section 3 we provide a detailed discussion of this effect and ways to mitigate it . While DKL is a potentially powerful solution to overcome the problem of inexpressive kernels , it does not address the other scaling problem of Gaussian Processes : large datasets . The poor computational scaling comes from the fact that making predictions with an exact GP requires solving a linear system the size of the training data , namely computing K ( X , X ) −1K ( X , x∗ ) where K ( X , X ) is the kernel matrix evaluated on the training dataset X and K ( X , x∗ ) the kernel between the training dataset and a test point x∗ . This is a significant computational problem in its own right . A powerful and principled alternative to exact GP inference is inducing point GP approximate inference , where only a small set of inducing points in the input space U are used to represent the entire training set , reducing the linear system to be solved to K ( u , u ) −1K ( u , x∗ ) . The new linear system is m by m , where m is the number of inducing points , rather than N by N . Finding the optimal set of points , which are not necessarily part of our training set , can be done by treating them as variational parameters and maximizing a lower bound on the marginal log-likelihood ( Titsias , 2009 ) . We follow the variational inducing point formulation of SVGPC ( Hensman et al. , 2015 ) as implemented in GPyTorch ( Gardner et al. , 2018 ) . 3 METHOD . vDUQ is an instance of Deep Kernel Learning , combining a constrained deep neural network with an inducing point GP . The model is learned end-to-end using variational inference by means of gradient Algorithm 1 Algorithm for training vDUQ Initialization : - Residual NN fθ : x → Rd with feature space dimensionality d and parameters θ initialized using He et al . ( 2015 ) . - Approximate GP with variational parameters φ and number of inducing points m. Using a random subset of k points of our training data , X init ⊂ X , compute : Initial inducing points : K-means on f ( X init ) with K = m. Use found centroids as initial inducing point locations in GP . Initial length scale : l = 1 ( k2 ) ∑k i=0 ∑k j=i+1 |f ( X initi ) − f ( X initj ) |2 . 1 : for minibatch Bx = { x1 , ... , xb } from X and By = { y1 , ... , yb } from Y do 2 : θ′ ← spectral normalization ( θ ) 3 : ψ ← fθ′ ( Bx ) . Compute feature representation 4 : p ( Y ′|Bx ) ← GPφ ( ψ ) . Compute posterior over labels , implemented in GPyTorch 5 : L← ELBOφ ( p ( Y ′|Bx ) , By ) . Compute loss , implemented in GPyTorch 6 : φ , θ ← φ , θ + η ∗ ∇φ , θL . η the learning rate , alternatively use ADAM 7 : end for descent . In this section we discuss how vDUQ overcomes previous problems with collapsing uncertainty in DKL ( Bradshaw et al. , 2017 ) and explain how to learn the model with no pre-training , few inducing points , and a standard minibatch size , avoiding some shortcomings of Wilson et al . ( 2016a ) . Without restrictions , the deep network inside the kernel is free to map input points that are far away from the training distribution to a feature representation that resembles those of data points in the training distribution . This behavior is also exhibited in standard neural networks ( Smith & Gal , 2018 ) and sometimes referred to as feature collapse . We visualize this in Figure 2 , where we map a 2D input space into feature space . With the feature space of the unconstrained model it is impossible to recover uncertainty : many points are collapsed on top of each other . In DUQ ( van Amersfoort et al. , 2020 ) , the authors show that it is possible to reduce feature collapse by enforcing two constraints on the model : sensitivity and smoothness . Sensitivity implies that when the input changes the feature representation also changes : this means the model can not simply collapse feature representations arbitrarily . Smoothness means small changes in the input can not cause massive shifts in the output . This appears to help optimization , and ensures the feature space accords with the implicit assumptions that for example RBF kernels make about the data . We discuss a connection between these two requirements , sensitivity and smoothness , and bi-Lipschitz functions in Section 6 . There is a number of methods proposed in the literature that attempt to satisfy these constraints and each comes with different trade-offs : • Two-sided gradient penalty : In DUQ ( van Amersfoort et al. , 2020 ) , the properties are achieved by regularizing using a two-sided gradient penalty , that penalizes the squared distance of the gradient from a fixed value at every input point . This approach is easy to implement , but is not guaranteed to work , and in practice both the stability of training and its effectiveness as a regularizer can be fairly sensitive to the weighting of this penalty . • Direct spectral normalization and residual connections : spectral normalization ( Miyato et al. , 2018 ; Gouk et al. , 2018 ) on the weights leads to smoothness and it is possible to combine this with an architecture that contains residual connections for the sensitivity constraint ( Liu et al. , 2020 ) . This method is faster than the gradient penalty , and in practice a more effective way of mitigating feature collapse . • Reversible model : A reversible model is constructed by using reversible layers and avoiding any down scaling operations ( Jacobsen et al. , 2018 ; Behrmann et al. , 2019 ) . This approach can guarantee that the overall function is bi-Lipschitz , but the resulting model consumes considerably more memory and can be difficult to train . In this work , we use direct spectral normalization and residual connections , as we find it to be more stable than a direct gradient penalty and significantly more computationally efficient than reversible models . In Figure 2 , we show that a constrained model is unable to collapse points on top of each other in feature space , enabling the GP to correctly quantify uncertainty . Using a stationary kernel , the model then reverts back to the prior away from the training data just like a standard GP . The regularized feature extractor allows us to offload computational complexity from the GP onto the deep model without sacrificing uncertainty . An expressive deep model is able to find a feature representation which generalizes across all intra class variation , and thus cluster inputs of the same class in feature space . We define the inducing points in feature space instead of input space ( also known as an interdomain approximation ) ( Lázaro-Gredilla & Figueiras-Vidal , 2009 ; Hensman et al. , 2017 ) , which takes advantage of this clustering to reduce the number of inducing points required . In practice , we find that only very few inducing points , the number of classes in the case of classification , are necessary to obtain a well performing GP and we found similarly low numbers ( in the 10 to 100 range ) work well for regression , which means that solving the linear system is fast and the GP has minimal overhead compared to a softmax output . The fact that we can use few inducing points is not true in general for DKL ( e.g . Wilson et al . ( 2016a ) use several hundred points in input space ) , but requires the extra restrictions we have placed on our feature extractor to avoid the pathological feature collapse . We also find we can train with standard minibatch sizes of 128 , while previous work used 5,000 on CIFAR-10 to combat gradient variance ( Wilson et al. , 2016a ) . It is important to note that in DKL and also in this paper we are not being Bayesian about our neural network parameters θ , so we only need a single pass through the feature extractor both when training and during inference .
This paper proposes variational deterministic uncertainty quantification (vDUQ), which adopts the stochastic (sparse) variational deep kernel learning (DKL) method to enable uncertainty estimations for deep models. To avoid uncertainty collapse, the deep neural network in the GP kernel is regularized with spectral normalization, which ensures a bi-Lipschitz constraint. Experiments show that vDUQ is effective in uncertainty quantification tasks.
SP:0fa6e1dfa434bfef4c0071572e60dbafa0d65d4e
Variational Deterministic Uncertainty Quantification
1 INTRODUCTION . Deploying machine learning algorithms as part of automated decision making systems , such as self driving cars and medical diagnostics , requires implementing fail-safes . Whenever the model is presented with a novel or ambiguous situation , it would not be wise to simply trust its prediction . Instead , the system should try to get more information or simply withhold or defer judgment . While significant progress has been made towards estimating predictive uncertainty reliably in deep learning ( Gal & Ghahramani , 2016 ; Lakshminarayanan et al. , 2017 ) , there is no single method that is shown to work on large datasets in classification and regression without significant computation overheads , such as multiple forward passes . We propose Variational Deterministic Uncertainty Quantification ( vDUQ ) , a method for obtaining predictive uncertainty in deep learning for both classification and regression problems in only a single forward pass . In previous work , van Amersfoort et al . ( 2020 ) show that combining a distance aware decision function with a regularized feature extractor in the form of a deep RBF network , leads to a model ( DUQ ) that matches a softmax model in accuracy , but is competitive with Deep Ensembles for uncertainty on large datasets . The feature extractor is regularized using a two-sided gradient penalty , which encourages the model to be sensitive to changes in the input , avoiding feature collapse , and encouraging generalization by controlling the Lipschitz constant . This model , however , has several limitations ; for example the uncertainty ( a distance in feature space ) can not be interpreted probabilistically and it is difficult to disentangle aleatoric and epistemic uncertainty . Additionally , the loss function and centroid update scheme are not principled and do not extend to regression tasks . A probabilistic and principled alternative to deep RBF networks are Gaussian Processes ( GPs ) in combination with Deep Kernel Learning ( DKL ) ( Hinton & Salakhutdinov , 2008 ; Wilson et al. , 2016b ) . DKL was introduced as a “ best of both worlds ” solution : apply a deep model on the training data and learn the GP in feature space , ideally getting the advantages of both models . In practice , however , DKL suffers from the same failure as Deep RBF networks : the deep model is free to map out of distribution data close to the feature representation of the training data , removing the attractive properties of GPs with distance sensitive kernels . Using insights from DUQ , we are able to mitigate the problems of uncertainty collapse in DKL . In particular , we use direct spectral normalization ( Gouk et al. , 2018 ; Miyato et al. , 2018 ) in combination with a ResNet ( He et al. , 2016 ) , a variation that was suggested in Liu et al . ( 2020 ) . The spectral normalization enforces smoothness , while the residual connections enforce sensitivity of the feature represenation to changes in the input , obtaining a similar effect as the gradient penalty of DUQ . We use an inter-domain inducing point variational approximation of the GP predictive distribution ( Lázaro-Gredilla & Figueiras-Vidal , 2009 ; Hensman et al. , 2015 ) , which places inducing points in feature space leading to needing fewer inducing points than previous work ( Wilson et al. , 2016a ) . These two techniques combined speed up inference in the GP model and decouple it from the dataset size . We release our code1 and hope that it will become a drop in alternative for softmax models with improved uncertainty . In Figure 1 , we show how vDUQ and Deep Ensembles ( Lakshminarayanan et al. , 2017 ) , the current state of the art for uncertainty quantification ( Ovadia et al. , 2019 ) , perform on simple 1D regression . This task is particularly hard for deep networks as shown in Foong et al . ( 2019 ) . vDUQ shows the desired behavior of reverting back to the prior away from the data , while the Deep Ensemble extrapolates arbitrarily and confidently . In between the two sinusoids , the Deep Ensemble is certain while vDUQ increases its uncertainty . In summary , our contributions are as follows : • We improve training a DKL model and for the first time match the accuracy and speed of training a deep network using regular softmax output on standard vision benchmarks . • We demonstrate excellent uncertainty quantification in classsification which matches or exceeds the state of the art on CIFAR-10 , including ensembling approaches . • We show state of the art performance on causal inference for personalized medicine , an exciting real world application . This task requires calibrated uncertainty in regression to be able to defer treatment to an expert when uncertainty is high . 2 BACKGROUND . Gaussian Processes ( GPs ) provide an interpretable , explainable and principled way to make predictions , and can work well even with little training data due to their use of Bayesian inference . In contrast to deep neural networks , GPs have high uncertainty away from the training data and on noisy inputs . There are however two main issues with the standard GP setup : poor performance on high dimensional inputs and inefficient computational scaling with large datasets . The poor performance on high dimensional inputs is due to the fact that most standard shift-invariant kernels are based on 1Available at : anonymized-for-review the Euclidean distance , which is a poor metric for highly structured data like images ( Theis et al. , 2016 ) . While kernels exist that better address this ( Van der Wilk et al. , 2017 ; Jacot et al. , 2018 ) , these are more computationally expensive and typically still underperform standard convolutional neural networks . Deep Kernel Learning ( Calandra et al. , 2016 ; Hinton & Salakhutdinov , 2008 ; Wilson et al. , 2016b ) is a way to combine the expressiveness of deep neural networks with the attractive properties of Gaussian Processes . The core idea is to use a deep neural network inside the kernel of a GP , k ( xi , xj ) → k ( fθ ( xi ) , fθ ( xj ) ) , where fθ ( · ) is a deep neural network , such as a Wide ResNet ( Zagoruyko & Komodakis , 2016 ) up to the last linear layer , parametrized by θ . The kernel k ( · , · ) can be any of the standard kernels , such as the RBF or Matérn kernel . With the deep network it becomes possible to train the GP on datasets that contain high dimensional points , such as images . As the deep network is unconstrained , uncertainty away from the data collapses ( Bradshaw et al. , 2017 ) , and the model can be arbitrarily confident while no data has been observed in that region during training . This has been a major drawback to using DKL in practice . In Section 3 we provide a detailed discussion of this effect and ways to mitigate it . While DKL is a potentially powerful solution to overcome the problem of inexpressive kernels , it does not address the other scaling problem of Gaussian Processes : large datasets . The poor computational scaling comes from the fact that making predictions with an exact GP requires solving a linear system the size of the training data , namely computing K ( X , X ) −1K ( X , x∗ ) where K ( X , X ) is the kernel matrix evaluated on the training dataset X and K ( X , x∗ ) the kernel between the training dataset and a test point x∗ . This is a significant computational problem in its own right . A powerful and principled alternative to exact GP inference is inducing point GP approximate inference , where only a small set of inducing points in the input space U are used to represent the entire training set , reducing the linear system to be solved to K ( u , u ) −1K ( u , x∗ ) . The new linear system is m by m , where m is the number of inducing points , rather than N by N . Finding the optimal set of points , which are not necessarily part of our training set , can be done by treating them as variational parameters and maximizing a lower bound on the marginal log-likelihood ( Titsias , 2009 ) . We follow the variational inducing point formulation of SVGPC ( Hensman et al. , 2015 ) as implemented in GPyTorch ( Gardner et al. , 2018 ) . 3 METHOD . vDUQ is an instance of Deep Kernel Learning , combining a constrained deep neural network with an inducing point GP . The model is learned end-to-end using variational inference by means of gradient Algorithm 1 Algorithm for training vDUQ Initialization : - Residual NN fθ : x → Rd with feature space dimensionality d and parameters θ initialized using He et al . ( 2015 ) . - Approximate GP with variational parameters φ and number of inducing points m. Using a random subset of k points of our training data , X init ⊂ X , compute : Initial inducing points : K-means on f ( X init ) with K = m. Use found centroids as initial inducing point locations in GP . Initial length scale : l = 1 ( k2 ) ∑k i=0 ∑k j=i+1 |f ( X initi ) − f ( X initj ) |2 . 1 : for minibatch Bx = { x1 , ... , xb } from X and By = { y1 , ... , yb } from Y do 2 : θ′ ← spectral normalization ( θ ) 3 : ψ ← fθ′ ( Bx ) . Compute feature representation 4 : p ( Y ′|Bx ) ← GPφ ( ψ ) . Compute posterior over labels , implemented in GPyTorch 5 : L← ELBOφ ( p ( Y ′|Bx ) , By ) . Compute loss , implemented in GPyTorch 6 : φ , θ ← φ , θ + η ∗ ∇φ , θL . η the learning rate , alternatively use ADAM 7 : end for descent . In this section we discuss how vDUQ overcomes previous problems with collapsing uncertainty in DKL ( Bradshaw et al. , 2017 ) and explain how to learn the model with no pre-training , few inducing points , and a standard minibatch size , avoiding some shortcomings of Wilson et al . ( 2016a ) . Without restrictions , the deep network inside the kernel is free to map input points that are far away from the training distribution to a feature representation that resembles those of data points in the training distribution . This behavior is also exhibited in standard neural networks ( Smith & Gal , 2018 ) and sometimes referred to as feature collapse . We visualize this in Figure 2 , where we map a 2D input space into feature space . With the feature space of the unconstrained model it is impossible to recover uncertainty : many points are collapsed on top of each other . In DUQ ( van Amersfoort et al. , 2020 ) , the authors show that it is possible to reduce feature collapse by enforcing two constraints on the model : sensitivity and smoothness . Sensitivity implies that when the input changes the feature representation also changes : this means the model can not simply collapse feature representations arbitrarily . Smoothness means small changes in the input can not cause massive shifts in the output . This appears to help optimization , and ensures the feature space accords with the implicit assumptions that for example RBF kernels make about the data . We discuss a connection between these two requirements , sensitivity and smoothness , and bi-Lipschitz functions in Section 6 . There is a number of methods proposed in the literature that attempt to satisfy these constraints and each comes with different trade-offs : • Two-sided gradient penalty : In DUQ ( van Amersfoort et al. , 2020 ) , the properties are achieved by regularizing using a two-sided gradient penalty , that penalizes the squared distance of the gradient from a fixed value at every input point . This approach is easy to implement , but is not guaranteed to work , and in practice both the stability of training and its effectiveness as a regularizer can be fairly sensitive to the weighting of this penalty . • Direct spectral normalization and residual connections : spectral normalization ( Miyato et al. , 2018 ; Gouk et al. , 2018 ) on the weights leads to smoothness and it is possible to combine this with an architecture that contains residual connections for the sensitivity constraint ( Liu et al. , 2020 ) . This method is faster than the gradient penalty , and in practice a more effective way of mitigating feature collapse . • Reversible model : A reversible model is constructed by using reversible layers and avoiding any down scaling operations ( Jacobsen et al. , 2018 ; Behrmann et al. , 2019 ) . This approach can guarantee that the overall function is bi-Lipschitz , but the resulting model consumes considerably more memory and can be difficult to train . In this work , we use direct spectral normalization and residual connections , as we find it to be more stable than a direct gradient penalty and significantly more computationally efficient than reversible models . In Figure 2 , we show that a constrained model is unable to collapse points on top of each other in feature space , enabling the GP to correctly quantify uncertainty . Using a stationary kernel , the model then reverts back to the prior away from the training data just like a standard GP . The regularized feature extractor allows us to offload computational complexity from the GP onto the deep model without sacrificing uncertainty . An expressive deep model is able to find a feature representation which generalizes across all intra class variation , and thus cluster inputs of the same class in feature space . We define the inducing points in feature space instead of input space ( also known as an interdomain approximation ) ( Lázaro-Gredilla & Figueiras-Vidal , 2009 ; Hensman et al. , 2017 ) , which takes advantage of this clustering to reduce the number of inducing points required . In practice , we find that only very few inducing points , the number of classes in the case of classification , are necessary to obtain a well performing GP and we found similarly low numbers ( in the 10 to 100 range ) work well for regression , which means that solving the linear system is fast and the GP has minimal overhead compared to a softmax output . The fact that we can use few inducing points is not true in general for DKL ( e.g . Wilson et al . ( 2016a ) use several hundred points in input space ) , but requires the extra restrictions we have placed on our feature extractor to avoid the pathological feature collapse . We also find we can train with standard minibatch sizes of 128 , while previous work used 5,000 on CIFAR-10 to combat gradient variance ( Wilson et al. , 2016a ) . It is important to note that in DKL and also in this paper we are not being Bayesian about our neural network parameters θ , so we only need a single pass through the feature extractor both when training and during inference .
1. In the introduction, the author separately pointed out the issues of DUQ and DKL. However, these issues are not convincing as no citations or theoretical proof is provided in this paper. The notations in the intro are also not well-defined. X, x, x* are used without difference, which however should be clearly defined as vectors or matrices.
SP:0fa6e1dfa434bfef4c0071572e60dbafa0d65d4e
Loss Landscape Matters: Training Certifiably Robust Models with Favorable Loss Landscape
1 INTRODUCTION . Despite the success of deep learning in many applications , the existence of adversarial example , an imperceptibly modified input that is designed to fool the neural network ( Szegedy et al. , 2013 ; Biggio et al. , 2013 ) , hinders the application of deep learning to safety-critical domains . There has been increasing interest in building a model that is robust to adversarial attacks ( Goodfellow et al. , 2014 ; Papernot et al. , 2016 ; Kurakin et al. , 2016 ; Madry et al. , 2018 ; Tramèr et al. , 2017 ; Zhang et al. , 2019a ; Xie et al. , 2019 ) . However , most defense methods evaluate their robustness with adversarial accuracy against predefined attacks such as PGD attack ( Madry et al. , 2018 ) or C & W attack ( Carlini & Wagner , 2017 ) . Thus , these defenses can be broken by new attacks ( Athalye et al. , 2018 ) . To this end , many training methods have been proposed to build a certifiably robust model that can be guaranteed to be robust to adversarial perturbations ( Hein & Andriushchenko , 2017 ; Raghunathan et al. , 2018b ; Wong & Kolter , 2018 ; Dvijotham et al. , 2018 ; Mirman et al. , 2018 ; Gowal et al. , 2018 ; Zhang et al. , 2019b ) . They develop an upper bound on the worst-case loss over valid adversarial perturbations and minimize it to train a certifiably robust model . These certifiable training methods can be mainly categorized into two types : linear relaxation-based methods and bound propagation methods . Linear relaxation-based methods use relatively tighter bounds , but are slow , hard to scale to large models , and memory-inefficient ( Wong & Kolter , 2018 ; Wong et al. , 2018 ; Dvijotham et al. , 2018 ) . On the other hand , bound propagation methods , represented by Interval Bound Propagation ( IBP ) , are fast and scalable due to the use of simple but much looser bounds ( Mirman et al. , 2018 ; Gowal et al. , 2018 ) . One would expect that training with tighter bounds would lead to better performance , but IBP outperforms linear relaxation-based methods in many cases , despite using much looser bounds . These observations on the performance of certifiable training methods raise the following questions : Why does training with tighter bounds not result in a better performance ? What other factors may influence the performance of certifiable training ? How can we improve the performance of certifiable training methods with tighter bounds ? In this paper , we provide empirical and theoretical analysis to answer these questions . First , we demonstrate that IBP ( Gowal et al. , 2018 ) has a more favorable loss landscape than other linear relaxation-based methods , and thus it often leads to better performance even with much looser bounds . To account for this difference , we present a unified view of IBP and linear relaxation-based methods and find that the relaxed gradient approximation ( which will be defined in Definition 1 ) of each method plays a crucial role in its optimization behavior . Based on the analysis of the loss landscape and the optimization behavior , we propose a new certifiable training method that has a favorable landscape with tighter bounds . The performance of the proposed method is comparable to that of state-of-the-art methods under a wide range of perturbations . We summarize the contributions of this study as follows : • We provide empirical and theoretical analysis of the loss landscape of certifiable training methods and find that smoothness of the loss landscape is important for building certifiably robust models . • We propose a certifiable training method with tighter bounds and a favorable loss landscape , obtaining comparable performance with state-of-the-art methods under a wide range of perturbations . 2 RELATED WORK . Earlier studies on training certifiably robust models were limited to 2-layered networks ( Hein & Andriushchenko , 2017 ; Raghunathan et al. , 2018a ) . To scale to larger networks , a line of work has proposed the use of linear relaxation of nonlinear activation to formulate a robust optimization . Then , a dual problem is considered and a dual feasible solution is used to simplify the computation further . By doing so , Wong & Kolter ( 2018 ) built a method that can scale to a 4-layered network , and later , Wong et al . ( 2018 ) used Cauchy random projections to scale to much larger networks . However , they are still slow and memory-inefficient . Dvijotham et al . ( 2018 ) proposed a method called predictorverifier training ( PVT ) , which uses a verifier network to optimize the dual solution . This is similar to our proposed method but we do not require any additional network . Xiao et al . ( 2018 ) proposed to add regularization technique with adversarial training for inducing ReLU stability , but it is less effective than other certified defenses . We also encourage our model to avoid unstable ReLUs , but we train the model with an upper bound of the worst-case loss and investigate ReLU stability from the loss landscape perspective . Mirman et al . ( 2018 ) proposed the propagation of a geometric bound ( called domain ) through the network to yield an outer approximation in logit space . This can be done with an efficient layerwise computation that exploits interval arithmetic . Over the outer domain , one can compute the worstcase loss to be minimized during training . Gowal et al . ( 2018 ) used a special case of the domain propagation called Interval Bound Propagation ( IBP ) using the simplest domain , the interval domain ( or interval bound ) . In IBP , the authors introduced a different objective function , heuristic scheduling on the hyperparameters , and elision of the last layer to stabilize the training and to improve the performance . Both approaches , linear relaxation-based methods and bound propagation methods , use an upper bound on the worst-case loss . Bound propagation methods exploit much looser upper bounds , but they enjoy an unexpected benefit in many cases : better robustness than linear relaxation-based methods . Balunovic & Vechev ( 2019 ) hypothesized that the complexity of the loss computation makes the optimization more difficult , which could be a reason why IBP outperforms linear relaxationbased methods . They proposed a new optimization procedure with the existing linear relaxation . In this paper , we further investigate the causes of the difficulties in the optimization . Recently , Zhang et al . ( 2019b ) proposed CROWN-IBP which uses linear relaxation in a verification method called CROWN ( Zhang et al. , 2018 ) in conjunction with IBP to train a certifiably robust model . Although beyond our focus here , there is another line of work on randomized smoothing ( Li et al. , 2018 ; Lecuyer et al. , 2019 ; Cohen et al. , 2019 ; Salman et al. , 2019 ) , which can probabilistically certify the robustness with arbitrarily high probability by using a smoothed classifier . However , it requires a large number of samples for inference . There are many other works on certifiable verification ( Weng et al. , 2018 ; Singh et al. , 2018a ; 2019 ; 2018b ; Zhang et al. , 2018 ; Boopathy et al. , 2019 ; Lyu et al. , 2020 ) . However , our work focuses on ” certifiable training ” . 3 BACKGROUND . First , we provide a brief overview of certifiable training methods . Then , we consider IBP ( Gowal et al. , 2018 ) as a special case of linear relaxation-based methods . This unified view on certifiable training methods helps us to comprehensively analyze the differences between the two approaches : bound propagation and linear relaxation . We present the details of the IBP in Appendix B . 3.1 NOTATIONS AND CERTIFIABLE TRAINING . We consider a c-class classification problem with a neural network f ( x ; θ ) with the layerwise operations z ( k ) = h ( k ) ( z ( k−1 ) ) ( k = 1 , · · · , K ) and the input z ( 0 ) = x in the input space X . The corresponding probability function is denoted by pf = softmax ◦ f : X → [ 0 , 1 ] c with subscript f . We denote a subnetwork with k operations as h [ k ] = h ( k ) ◦ · · · ◦h ( 1 ) . For a linear operation h ( k ) , we use W ( k ) and b ( k ) to denote the weight and the bias for the layer . We consider the robustness of the classifier against the norm-bounded perturbation set B ( x , ) = { x′ ∈ X : ||x′−x|| ≤ } with the perturbation level . Here , we mainly focus on the ` ∞-norm bounded set . To compute the margin between the true class y for the input x and the other classes , we define a c × c matrix C ( y ) = I − 1e ( y ) T with ( C ( y ) z ( K ) ) m = z ( K ) m −z ( K ) y ( m = 0 , · · · , c− 1 ) . For the last linear layer , the weightsW ( K ) and the bias b ( K ) are merged with C ( y ) , that is , W ( K ) ≡ C ( y ) W ( K ) and b ( K ) ≡ C ( y ) b ( K ) , yielding the margin score function s ( x , y ; θ ) = C ( y ) f ( x ; θ ) = f ( x ; θ ) − fy ( x ; θ ) 1 satisfying ps = pf . Then we can define the worst-case margin score s∗ ( x , y , ; θ ) = maxx′∈B ( x , ) s ( x′ , y ; θ ) where max is element-wise maximization . With an upper bound s on the worst-case margin score , s ≥ s∗ , we can provide an upper bound on the worst-case loss over valid adversarial perturbations as follows : L ( s ( x , y , ; θ ) , y ) ≥ max x′∈B ( x , ) L ( f ( x′ ; θ ) , y ) ( 1 ) for cross-entropy loss L ( Wong & Kolter , 2018 ) . Therefore , we can formulate certifiable training as a minimization of the upper bound , minθ L ( s ( x , y , ; θ ) , y ) , instead of directly solving minθ maxx′∈B ( x , ) L ( f ( x′ ; θ ) , y ) which is infeasible . Note that adversarial training ( Madry et al. , 2018 ) uses a strong iterative gradient-based attack ( PGD ) to provide a lower bound on the worst-case loss to be minimized , but it can not provide a certifiably robust model . Whenever possible , we will simplify the notations by omitting variables such as x , y , , and θ . 3.2 LINEAR RELAXATION-BASED METHODS . For a subnetwork h [ k ] , given with the pre-activation upper/lower bounds , u and l , for each nonlinear activation function h in h [ k ] , linear relaxation-based methods ( Wong & Kolter ( 2018 ) ; Wong et al . ( 2018 ) ; Zhang et al . ( 2019b ) ) use a relaxation of the activation function by two elementwise linear function bounds , h and h , that is , h ( z ) ≤ h ( z ) ≤ h ( z ) for l ≤ z ≤ u . We denote the function bounds as h ( z ) = a z + b and h ( z ) = a z + b for some a , b , a , and b , where denotes the elementwise ( Hadamard ) product . Using all the function bounds h ’ s and h ’ s for the nonlinear activations in conjunction with the linear operations in h [ k ] , an ith ( scalar ) activation h [ k ] i ( · ) ∈ R can be upper bounded by a linear function gT · +b over B ( x , ) as in Zhang et al . ( 2018 ) . This can be equivalently explained with the dual relaxation viewpoint in Wong & Kolter ( 2018 ) . Further details are provided in Appendix C. Now we are ready to upper bound the activation h [ k ] i over B ( x , ) . Definition 1 ( Linear Relaxation with Relaxed Gradient Approximation ) . For each neuron activation h [ k ] i , a linear relaxation method computes an upper approximation of the activation over B ( x , ) by using g ∈ Rd and b ∈ R as follows : max x′∈B ( x , ) h [ k ] i ( x ′ ) ≤ max x′∈B ( x , ) gTx′ + b = gTx+ ||g||∗ + b . ( 2 ) We call g the relaxed gradient approximation of h [ k ] i over B ( x , ) . Similarly , we can obtain the corresponding lower bound . Inductively using these upper/lower bounds on the output of the subnetwork , we can obtain the bounds for the next subnetwork h [ k+1 ] and then for the whole network s. The final bound s on the whole network s can then be used in the objective ( 1 ) . The tightness of the bounds s and L ( s , y ) highly depend on how the linear bounds h and h in each layer are chosen . Unified view of IBP and linear relaxation-based methods IBP can also be considered as a linear relaxation-based method using zero-slope ( a = a = 0 ) linear bounds , h ( z ) = u+ and h ( z ) = l+ , where v+ = max ( v,0 ) and v− = min ( v,0 ) . Thus , the bounds of a nonlinear activation depend only on the pre-activation bounds u and l for the activation layer , substantially reducing the feedforward/backpropagation computations . CROWN-IBP ( Zhang et al. , 2019b ) applies different linear relaxation schemes to the subnetworks and the whole network . It uses the same linear bounds as IBP for the subnetworks h [ k ] for k < K except for the network s = h [ K ] itself , and uses h ( z ) = u+ u+−l− ( z − l− ) and h ( z ) = 1 [ u+ + l− > 0 ] z for the whole network s. Moreover , CROWNIBP uses interpolations between two bounds with the mixing weight β , IBP bound and CROWN-IBP bound , with the following objective : L ( ( 1− β ) sIBP ( x , y , ; θ ) + βsCROWN-IBP ( x , y , ; θ ) , y ) . ( 3 ) Convex Adversarial Polytope ( CAP ) ( Wong & Kolter , 2018 ; Wong et al. , 2018 ) uses the linear bounds h ( z ) = u + u+−l− ( z − l− ) and h ( z ) = u + u+−l− z for all subnetworks h [ k ] and the entire network . As CAP utilizes the linear bounds for each neuron , it is slow and memory-inefficient . It can be easily shown that tighter relaxations on nonlinear activations yield a tighter bound on the worstcase margin score s∗ . To specify the linear relaxation variable φ ≡ { a , a , b , b } used in relaxation , we use the notation s ( x , y , ; θ , φ ) . CROWN-IBP and CAP generally yield a much tighter bound than IBP . These relaxation schemes are illustrated in Figure 6 in Appendix D .
This paper studies why training with looser bounds (IBP) can outperform tighter linear relaxation based methods in certified defense. The authors argue that this is because IBP has a smoother loss landscape compared to linear relaxation based methods. Then the paper proposes to optimize the lower bound in the CROWN relaxation for unstable ReLU neurons during training, for tighter bounds and a smoother loss landscape.
SP:012aea2b0a756ae1714eb20ac4fdb723a644ee8f
Loss Landscape Matters: Training Certifiably Robust Models with Favorable Loss Landscape
1 INTRODUCTION . Despite the success of deep learning in many applications , the existence of adversarial example , an imperceptibly modified input that is designed to fool the neural network ( Szegedy et al. , 2013 ; Biggio et al. , 2013 ) , hinders the application of deep learning to safety-critical domains . There has been increasing interest in building a model that is robust to adversarial attacks ( Goodfellow et al. , 2014 ; Papernot et al. , 2016 ; Kurakin et al. , 2016 ; Madry et al. , 2018 ; Tramèr et al. , 2017 ; Zhang et al. , 2019a ; Xie et al. , 2019 ) . However , most defense methods evaluate their robustness with adversarial accuracy against predefined attacks such as PGD attack ( Madry et al. , 2018 ) or C & W attack ( Carlini & Wagner , 2017 ) . Thus , these defenses can be broken by new attacks ( Athalye et al. , 2018 ) . To this end , many training methods have been proposed to build a certifiably robust model that can be guaranteed to be robust to adversarial perturbations ( Hein & Andriushchenko , 2017 ; Raghunathan et al. , 2018b ; Wong & Kolter , 2018 ; Dvijotham et al. , 2018 ; Mirman et al. , 2018 ; Gowal et al. , 2018 ; Zhang et al. , 2019b ) . They develop an upper bound on the worst-case loss over valid adversarial perturbations and minimize it to train a certifiably robust model . These certifiable training methods can be mainly categorized into two types : linear relaxation-based methods and bound propagation methods . Linear relaxation-based methods use relatively tighter bounds , but are slow , hard to scale to large models , and memory-inefficient ( Wong & Kolter , 2018 ; Wong et al. , 2018 ; Dvijotham et al. , 2018 ) . On the other hand , bound propagation methods , represented by Interval Bound Propagation ( IBP ) , are fast and scalable due to the use of simple but much looser bounds ( Mirman et al. , 2018 ; Gowal et al. , 2018 ) . One would expect that training with tighter bounds would lead to better performance , but IBP outperforms linear relaxation-based methods in many cases , despite using much looser bounds . These observations on the performance of certifiable training methods raise the following questions : Why does training with tighter bounds not result in a better performance ? What other factors may influence the performance of certifiable training ? How can we improve the performance of certifiable training methods with tighter bounds ? In this paper , we provide empirical and theoretical analysis to answer these questions . First , we demonstrate that IBP ( Gowal et al. , 2018 ) has a more favorable loss landscape than other linear relaxation-based methods , and thus it often leads to better performance even with much looser bounds . To account for this difference , we present a unified view of IBP and linear relaxation-based methods and find that the relaxed gradient approximation ( which will be defined in Definition 1 ) of each method plays a crucial role in its optimization behavior . Based on the analysis of the loss landscape and the optimization behavior , we propose a new certifiable training method that has a favorable landscape with tighter bounds . The performance of the proposed method is comparable to that of state-of-the-art methods under a wide range of perturbations . We summarize the contributions of this study as follows : • We provide empirical and theoretical analysis of the loss landscape of certifiable training methods and find that smoothness of the loss landscape is important for building certifiably robust models . • We propose a certifiable training method with tighter bounds and a favorable loss landscape , obtaining comparable performance with state-of-the-art methods under a wide range of perturbations . 2 RELATED WORK . Earlier studies on training certifiably robust models were limited to 2-layered networks ( Hein & Andriushchenko , 2017 ; Raghunathan et al. , 2018a ) . To scale to larger networks , a line of work has proposed the use of linear relaxation of nonlinear activation to formulate a robust optimization . Then , a dual problem is considered and a dual feasible solution is used to simplify the computation further . By doing so , Wong & Kolter ( 2018 ) built a method that can scale to a 4-layered network , and later , Wong et al . ( 2018 ) used Cauchy random projections to scale to much larger networks . However , they are still slow and memory-inefficient . Dvijotham et al . ( 2018 ) proposed a method called predictorverifier training ( PVT ) , which uses a verifier network to optimize the dual solution . This is similar to our proposed method but we do not require any additional network . Xiao et al . ( 2018 ) proposed to add regularization technique with adversarial training for inducing ReLU stability , but it is less effective than other certified defenses . We also encourage our model to avoid unstable ReLUs , but we train the model with an upper bound of the worst-case loss and investigate ReLU stability from the loss landscape perspective . Mirman et al . ( 2018 ) proposed the propagation of a geometric bound ( called domain ) through the network to yield an outer approximation in logit space . This can be done with an efficient layerwise computation that exploits interval arithmetic . Over the outer domain , one can compute the worstcase loss to be minimized during training . Gowal et al . ( 2018 ) used a special case of the domain propagation called Interval Bound Propagation ( IBP ) using the simplest domain , the interval domain ( or interval bound ) . In IBP , the authors introduced a different objective function , heuristic scheduling on the hyperparameters , and elision of the last layer to stabilize the training and to improve the performance . Both approaches , linear relaxation-based methods and bound propagation methods , use an upper bound on the worst-case loss . Bound propagation methods exploit much looser upper bounds , but they enjoy an unexpected benefit in many cases : better robustness than linear relaxation-based methods . Balunovic & Vechev ( 2019 ) hypothesized that the complexity of the loss computation makes the optimization more difficult , which could be a reason why IBP outperforms linear relaxationbased methods . They proposed a new optimization procedure with the existing linear relaxation . In this paper , we further investigate the causes of the difficulties in the optimization . Recently , Zhang et al . ( 2019b ) proposed CROWN-IBP which uses linear relaxation in a verification method called CROWN ( Zhang et al. , 2018 ) in conjunction with IBP to train a certifiably robust model . Although beyond our focus here , there is another line of work on randomized smoothing ( Li et al. , 2018 ; Lecuyer et al. , 2019 ; Cohen et al. , 2019 ; Salman et al. , 2019 ) , which can probabilistically certify the robustness with arbitrarily high probability by using a smoothed classifier . However , it requires a large number of samples for inference . There are many other works on certifiable verification ( Weng et al. , 2018 ; Singh et al. , 2018a ; 2019 ; 2018b ; Zhang et al. , 2018 ; Boopathy et al. , 2019 ; Lyu et al. , 2020 ) . However , our work focuses on ” certifiable training ” . 3 BACKGROUND . First , we provide a brief overview of certifiable training methods . Then , we consider IBP ( Gowal et al. , 2018 ) as a special case of linear relaxation-based methods . This unified view on certifiable training methods helps us to comprehensively analyze the differences between the two approaches : bound propagation and linear relaxation . We present the details of the IBP in Appendix B . 3.1 NOTATIONS AND CERTIFIABLE TRAINING . We consider a c-class classification problem with a neural network f ( x ; θ ) with the layerwise operations z ( k ) = h ( k ) ( z ( k−1 ) ) ( k = 1 , · · · , K ) and the input z ( 0 ) = x in the input space X . The corresponding probability function is denoted by pf = softmax ◦ f : X → [ 0 , 1 ] c with subscript f . We denote a subnetwork with k operations as h [ k ] = h ( k ) ◦ · · · ◦h ( 1 ) . For a linear operation h ( k ) , we use W ( k ) and b ( k ) to denote the weight and the bias for the layer . We consider the robustness of the classifier against the norm-bounded perturbation set B ( x , ) = { x′ ∈ X : ||x′−x|| ≤ } with the perturbation level . Here , we mainly focus on the ` ∞-norm bounded set . To compute the margin between the true class y for the input x and the other classes , we define a c × c matrix C ( y ) = I − 1e ( y ) T with ( C ( y ) z ( K ) ) m = z ( K ) m −z ( K ) y ( m = 0 , · · · , c− 1 ) . For the last linear layer , the weightsW ( K ) and the bias b ( K ) are merged with C ( y ) , that is , W ( K ) ≡ C ( y ) W ( K ) and b ( K ) ≡ C ( y ) b ( K ) , yielding the margin score function s ( x , y ; θ ) = C ( y ) f ( x ; θ ) = f ( x ; θ ) − fy ( x ; θ ) 1 satisfying ps = pf . Then we can define the worst-case margin score s∗ ( x , y , ; θ ) = maxx′∈B ( x , ) s ( x′ , y ; θ ) where max is element-wise maximization . With an upper bound s on the worst-case margin score , s ≥ s∗ , we can provide an upper bound on the worst-case loss over valid adversarial perturbations as follows : L ( s ( x , y , ; θ ) , y ) ≥ max x′∈B ( x , ) L ( f ( x′ ; θ ) , y ) ( 1 ) for cross-entropy loss L ( Wong & Kolter , 2018 ) . Therefore , we can formulate certifiable training as a minimization of the upper bound , minθ L ( s ( x , y , ; θ ) , y ) , instead of directly solving minθ maxx′∈B ( x , ) L ( f ( x′ ; θ ) , y ) which is infeasible . Note that adversarial training ( Madry et al. , 2018 ) uses a strong iterative gradient-based attack ( PGD ) to provide a lower bound on the worst-case loss to be minimized , but it can not provide a certifiably robust model . Whenever possible , we will simplify the notations by omitting variables such as x , y , , and θ . 3.2 LINEAR RELAXATION-BASED METHODS . For a subnetwork h [ k ] , given with the pre-activation upper/lower bounds , u and l , for each nonlinear activation function h in h [ k ] , linear relaxation-based methods ( Wong & Kolter ( 2018 ) ; Wong et al . ( 2018 ) ; Zhang et al . ( 2019b ) ) use a relaxation of the activation function by two elementwise linear function bounds , h and h , that is , h ( z ) ≤ h ( z ) ≤ h ( z ) for l ≤ z ≤ u . We denote the function bounds as h ( z ) = a z + b and h ( z ) = a z + b for some a , b , a , and b , where denotes the elementwise ( Hadamard ) product . Using all the function bounds h ’ s and h ’ s for the nonlinear activations in conjunction with the linear operations in h [ k ] , an ith ( scalar ) activation h [ k ] i ( · ) ∈ R can be upper bounded by a linear function gT · +b over B ( x , ) as in Zhang et al . ( 2018 ) . This can be equivalently explained with the dual relaxation viewpoint in Wong & Kolter ( 2018 ) . Further details are provided in Appendix C. Now we are ready to upper bound the activation h [ k ] i over B ( x , ) . Definition 1 ( Linear Relaxation with Relaxed Gradient Approximation ) . For each neuron activation h [ k ] i , a linear relaxation method computes an upper approximation of the activation over B ( x , ) by using g ∈ Rd and b ∈ R as follows : max x′∈B ( x , ) h [ k ] i ( x ′ ) ≤ max x′∈B ( x , ) gTx′ + b = gTx+ ||g||∗ + b . ( 2 ) We call g the relaxed gradient approximation of h [ k ] i over B ( x , ) . Similarly , we can obtain the corresponding lower bound . Inductively using these upper/lower bounds on the output of the subnetwork , we can obtain the bounds for the next subnetwork h [ k+1 ] and then for the whole network s. The final bound s on the whole network s can then be used in the objective ( 1 ) . The tightness of the bounds s and L ( s , y ) highly depend on how the linear bounds h and h in each layer are chosen . Unified view of IBP and linear relaxation-based methods IBP can also be considered as a linear relaxation-based method using zero-slope ( a = a = 0 ) linear bounds , h ( z ) = u+ and h ( z ) = l+ , where v+ = max ( v,0 ) and v− = min ( v,0 ) . Thus , the bounds of a nonlinear activation depend only on the pre-activation bounds u and l for the activation layer , substantially reducing the feedforward/backpropagation computations . CROWN-IBP ( Zhang et al. , 2019b ) applies different linear relaxation schemes to the subnetworks and the whole network . It uses the same linear bounds as IBP for the subnetworks h [ k ] for k < K except for the network s = h [ K ] itself , and uses h ( z ) = u+ u+−l− ( z − l− ) and h ( z ) = 1 [ u+ + l− > 0 ] z for the whole network s. Moreover , CROWNIBP uses interpolations between two bounds with the mixing weight β , IBP bound and CROWN-IBP bound , with the following objective : L ( ( 1− β ) sIBP ( x , y , ; θ ) + βsCROWN-IBP ( x , y , ; θ ) , y ) . ( 3 ) Convex Adversarial Polytope ( CAP ) ( Wong & Kolter , 2018 ; Wong et al. , 2018 ) uses the linear bounds h ( z ) = u + u+−l− ( z − l− ) and h ( z ) = u + u+−l− z for all subnetworks h [ k ] and the entire network . As CAP utilizes the linear bounds for each neuron , it is slow and memory-inefficient . It can be easily shown that tighter relaxations on nonlinear activations yield a tighter bound on the worstcase margin score s∗ . To specify the linear relaxation variable φ ≡ { a , a , b , b } used in relaxation , we use the notation s ( x , y , ; θ , φ ) . CROWN-IBP and CAP generally yield a much tighter bound than IBP . These relaxation schemes are illustrated in Figure 6 in Appendix D .
In this paper, the authors studied the role of loss landscape in training certifiable robust models. The authors reviewed linear relaxation based methods, and showed that Interval Bound Propagation (IBP) is a special case of linear relaxation based methods. Although linear relaxation based methods have a tighter bound on worst case loss with adversarial perturbations than IBP based method, the authors found in numerical studies that towards the end of training, IBP outperforms linear relaxation based methods. The authors hypothesized that this was because IBP loss landscape was more smooth, which helped optimization. The authors demonstrated in a theorem that IBP loss was indeed more smooth under certain assumptions. Based on this insight, the authors proposed a favorable landscape method. The authors showed in numerical studies that the sum over the worst-case margin for each class is lowest for their method. The loss of their method is also the most smooth among competing methods. Their method achieved a consistent performance in a range of perturbations, which is not achieved in competing methods.
SP:012aea2b0a756ae1714eb20ac4fdb723a644ee8f
High-Likelihood Area Matters --- Rewarding Correct,Rare Predictions Under Imbalanced Distributions
Learning from natural datasets poses significant challenges for traditional classification methods based on the cross-entropy objective due to imbalanced class distributions . It is intuitive to assume that the examples from rare classes are harder to learn so that the classifier is uncertain of the prediction , which establishes the low-likelihood area . Based on this , existing approaches drive the classifier actively to correctly predict those incorrect , rare examples . However , this assumption is one-sided and could be misleading . We find in practice that the high-likelihood area contains correct predictions for rare class examples and it plays a vital role in learning imbalanced class distributions . In light of this finding , we propose the Eureka Loss , which rewards the classifier when examples belong to rare classes in the high-likelihood area are correctly predicted . Experiments on the large-scale long-tailed iNaturalist 2018 classification dataset and the ImageNet-LT benchmark both validate the proposed approach . We further analyze the influence of the Eureka Loss in detail on diverse data distributions . 1 INTRODUCTION . Existing classification methods usually struggle in real-world applications , where the class distributions are inherently imbalanced and long-tailed ( Van Horn & Perona , 2017 ; Buda et al. , 2018 ; Liu et al. , 2019 ; Gupta et al. , 2019 ) , in which a few head classes occupy a large probability mass while most tail ( or rare ) classes only possess a few examples . The language generation task is a vivid example of the long-tailed classification . In this case , word types are considered as the classes and the model predicts probabilities over the vocabulary . Common words such as the , of , and and are the head classes , while tailed classes are rare words like Gobbledygook , Scrumptious , and Agastopia . Conventional classifiers based on deep neural networks require a large number of training examples to generalize and have been found to under-perform on rare classes with a few training examples in downstream applications ( Van Horn & Perona , 2017 ; Buda et al. , 2018 ; Cao et al. , 2019 ) . It is proposed that the traditional cross-entropy objective is unsuitable for learning imbalanced distributions since it treats each instance and each class equivalently ( Lin et al. , 2017 ; Tan et al. , 2020 ) . In contrast , the instances from tail classes should be paid more attention , indicated by two main approaches that have been recently investigated for class-imbalanced classification : the frequencybased methods and the likelihood-based methods . The former ( Cui et al. , 2019 ; Cao et al. , 2019 ) directly adjust the weights of the instances in terms of their class frequencies , so that the instances from the tail classes are learned with a higher priority no matter whether they are correctly predicted or not . The latter ( Lin et al. , 2017 ; Zhu et al. , 2018 ) instead penalize the inaccurate predictions more heavily , assuming that the well-classified instances , i.e. , the instances in the high-likelihood area , factor inconsequentially in learning imbalanced distributions . However , neither of these two approaches realistically depicts the likelihood landscape . In particular , the high-likelihood area , where the classifier makes the correct predictions for both common class examples and rare class ones , contributes significantly to generalization . However , this area is not well-shaped , as illustrated in Figure 1 . Specifically , the frequency-based methods imply an impaired learning of common class examples that are the principle part of the natural data , while the likelihood- based methods ignore the correctly-predicted rare class examples that can provide crucial insights into the underlying mechanism for predicting such examples . In this paper , we first demonstrate that existing practice of neglecting predictions in the high-likelihood area is harmful to learning imbalanced class distributions . Furthermore , we find that simply mixing the cross-entropy loss and the Focal Loss ( Lin et al. , 2017 ) can induce substantially superior performance , which validates our motivation . In turn , we propose to elevate the importance of high-likelihood predictions even further and design a novel objective called Eureka Loss . It progressively rewards the classifiers according to both the likelihood and the class frequency of an example such that the system is encouraged to be more confident in the correct prediction of examples from rare classes . Experimental results on the image classification and the language generation tasks demonstrate that the Eureka Loss outperforms strong baselines in learning imbalanced class distributions . Our contributions are twofold : • We challenge the common belief that learning for examples in low-likelihood area is more important for learning tail classes and reveal that the correctly-predicted rare class examples make important contribution to learning long-tailed class distributions . • We explore a new direction for learning imbalanced classification that focuses on rewarding correct predictions for tail classes examples , rather than penalizing incorrect ones . The proposed Eureka Loss rewards the classifier for its high-likelihood predictions progressively to the rarity of their class and achieves substantial improvements on various problems with long-tailed distributions . 2 RELATED WORK . Frequency-based Data and Loss Re-balancing Previous literature on learning with long-tailed distribution mainly focusing on re-balancing the data distribution and re-weighting the loss function . The former is based on a straightforward idea to manually create a pseudo-balanced data distribution to ease the learning problem , including up-sampling for rare class examples ( Chawla et al. , 2002 ) , down-sampling for head class examples ( Drummond & Holte , 2003 ) and a more concrete sampling strategy based on class frequency ( Shen et al. , 2016 ) . As for the latter , recent studies propose to assign different weights to different classes , and the weights can be calculated according to the class distribution . For example , Khan et al . ( 2018 ) design a cost-sensitive loss for major and minor class examples . An intuitive method is to down-weight the loss of frequent classes , while up-weight the contribution of rare class examples . However , frequency is not suitable to be directly treated as the the weight since there exists overlap among samples . An advancing alternative loss CB ( Cui et al. , 2019 ) proposes to calculate the effective number to substitute the frequency for loss re-weighting . However , since it assigns lower weight to head classes in the maximum likelihood training ( Cross Entropy objective ) , it seriously impairs the learning of head classes . Moreover , CB requires a delicate hyper-parameter tuning for every imbalanced distribution , leading to a lot of manul efforts . From the perspective of max-margin , a recent study LDAM ( Cao et al. , 2019 ) proposes to up-weight the loss of tail classes by a class-distribution based margin . Compared to the above methods , we choose to decrease the loss of tail classes by rewarding correct predictions rather than increasing the loss of tail classes through aggravated penalization . Deferring the Frequency-based Class-balanced Training Recent studies find that deferring the class-balanced training helps learn high-quality representations ( Liu et al. , 2019 ) , and propose deferred Class-balanced training ( deferred CB ) ( Cao et al. , 2019 ) , which chooses to adopt Cross Entropy objective at the beginning of training . Similarly , the Decoupling method ( Kang et al. , 2020 ) shows that the re-balancing strategies impair the quality of learned feature representations and demonstrate an improved performance learned with original data distribution , by training the model with Cross Entropy in the first phase and adopting class-balanced training in the second phase . This decoupling strategy can also be found in BBN ( Zhou et al. , 2019 ) , which includes both class imbalanced and balanced training , and the transition from the former to the latter is achieved through a curriculum learning schedule . These methods achieve state-of-the-art performance in long-tailed classification . To be comparable with these methods and to analyse whether Eureka Loss is complementary to this technique , we propose deferred Eureka Loss , in which rewarding for rare class prediction is introduced to encourage the model to learn rare patterns when learning is stalled . Likelihood-based Loss Another dominant method for imbalanced classification is the likelihoodbased method Focal Loss ( FL ) ( Lin et al. , 2017 ) , which proposes to down-weight the contribution of examples in the high-likelihood area . However , we argue that it is harmful for learning tail classes and choose an opposite direction by highlighting the high-likelihood area with a steeper loss . Transferring Representations Techniques for transferring information from sufficient head classes examples to under-represented rare classes examples belong to a parallel successful direction in this field . They include MBJ ( Liu et al. , 2020 ) , which utilizes external semantic feature memory and FSA ( Chu et al. , 2020 ) , which decomposes feature in to class-specific and class-generic components . These latest transfer learning based studies are less related to our paper but they also obtain good improvements in long-tailed classification , so we add them into comparison in the experiments . 3 ROLE OF THE HIGH-LIKELIHOOD AREA . The existing approaches to the long-tailed classification independently consider the class frequency and the example likelihood . However , we show that this one-sided reflection is problematic when dealing with the tail class examples that can be confidently classified . The tail class examples can be easily classified by the classifier , and the head class examples can also be hard for the classifier to recognize . The difficulty of classification depends on the inherent characteristic of the classes , rather than the sample size of the class . For example , in species classification , the Portuguese man o ’ war may be a rare class but can be easily classified due to its distinct features , compared to various kinds of moths which are common classes yet are hard to distinguish . However , the frequency-based methods continuously drive the classifier to fit the rare class examples , especially when they are difficult to predict , which may lead to overfitting . On the other hand , the likelihood-based methods relax the concentration in the high-likelihood area , which contains the tail class examples that are not hard to predict and provide insights to generalization . To verify our point of view , we analyze the problem by dissecting the influence of the high-likelihood area with respect to the class frequency and demonstrate that properly encouraging the learning of well-classified tail class examples induce substantial improvements , before which we first give a brief introduction of classification with long-tailed class distributions . 3.1 PREPARATION : CLASSIFICATION WITH LONG-TAILED CLASS DISTRIBUTIONS . Let ’ s consider the multi-class classification problem with the long-tailed class distribution . Given a class set C , n denotes the number of different classes in C and mi is the number of examples of the class Ci . For simplicity , we sort the class set C according to cardinal mi for Ci such that C0 is the class with the most examples and Cn−1 is the rarest class . Let p be a n-dim probability vector predicted by a classifier model f ( x ; θ ) based on the input x , where each element pi denotes the probability of the class Ci and y is a n-dim one-hot label vector with y being the ground-truth class . The probability vector can be calculated as p = σ ( f ( x ; θ ) ) , ( 1 ) where σ is the normalizing function , e.g. , softmax for multi-class classification . Typically , the parameters are estimated using maximum likelihood estimation ( MLE ) , which is equivalent to using the Cross-Entropy Loss ( CE ) function , where the scalar y · log p can be regarded as the ( log ) -likelihood : L = −E ( x , y ) ∈D log pmodel ( y|x ) = − 1 |D| ∑ ( x , y ) ∈D y · log p. ( 2 ) For deep neural network–based classifiers , due to the non-linearity of the loss function , the problem is typically solved by stochastic gradient descent , which requires the calculation of the gradient with respect to the parameters using the chain-rule , the process of which is called back-propagation : ∂L ∂θ = ∂L ∂p ∂p ∂θ = ∂L ∂p ∂σ ( f ( x ; θ ) ) ∂θ . ( 3 ) We introduce the term likelihood gradient to denote ∂L/∂p , which modulates how the probability mass should be shifted and is a characteristic of the loss function instead of the classifier . For learning imbalanced class distributions , the common methods aim to shape the likelihood gradient so the rare classes are learned with priority , i.e. , embodying a sharper loss and a larger likelihood gradient . Frequency-Based Methods Frequency-based methods alter the likelihood gradient according to the class frequencies , which are irrelevant to how well individual examples are classified . A simple form is using a n-dim weight vector w composed of the class weights based on their frequencies in the dataset to determine the importance of examples from each class : L = −wy · ( y · log p ) . ( 4 ) Note that whenw = 1 , it is identical to the cross-entropy objective . The weight vector is typically calculated as wi = m̄/mi , where m̄ is the average of mi . As we can see , the standard weight is taken as the average of the class size , so that the classes with more examples are down-weighted and the classes with fewer examples are up-weighted . For a natural long-tailed distribution , the average is larger than the median , which suggests more classes are up-weighted . Advanced frequency-based methods try to obtain a more meaningful measurement of the class size , e.g. , the Class-Balanced Loss ( CB ) proposed by Cui et al . ( 2019 ) utilizes an effective number 1−βmi/1−β for each class , where β ∈ [ 0.9 , 1 ) is a tunable class-balanced term . Likelihood-Based Methods Different from the frequency-based methods , likelihood-based methods adjust the likelihood gradient based on the instance-level difficulty as predicted by the classifier such that the examples in the low-likelihood area are more focused in training . For example , the well-known Focal Loss ( FL ) with a balanced factor α proposed by Lin et al . ( 2017 ) takes the following form : L = −α ( 1− py ) γf · ( y· log p ) , ( 5 ) where γf > 0 , which controls the convexness of the loss and higher γf indicates adjustment that are more significant . Note that when α = 1 and γf = 0 , it is identical to the cross-entropy objective . Following previous works ( Cao et al. , 2019 ; Liu et al. , 2019 ; Cui et al. , 2019 ) , the α is set to 1 in multi-class classification , and Class-Balanced Focal Loss ( FL+CB ) can be viewed Focal Loss with uneven alpha for each class in the multi-class setting . The key idea is to pay less attention to the well-classified examples and pay more attention to the badly-classified examples , because it is natural to assume the tail class examples are harder to learn and thus can not be well-classified . However , such methods neglect the correctly-predicted tail class examples , the practice of which we show is not constructive to the learning of long-tailed class distributions .
- This paper made a finding that weighting up correct predictions for rare class examples also can help to improve the performance of imbalanced classification. In light of this finding, it proposes the Eureka Loss to add additional gradients for examples belong to rare classes in the high-likelihood area when correctly predicted. Experiments on several large-scale benchmarks demonstrate its effectiveness.
SP:a89a7421e4d3b82156edcc03ff8b24fb4df8df41
High-Likelihood Area Matters --- Rewarding Correct,Rare Predictions Under Imbalanced Distributions
Learning from natural datasets poses significant challenges for traditional classification methods based on the cross-entropy objective due to imbalanced class distributions . It is intuitive to assume that the examples from rare classes are harder to learn so that the classifier is uncertain of the prediction , which establishes the low-likelihood area . Based on this , existing approaches drive the classifier actively to correctly predict those incorrect , rare examples . However , this assumption is one-sided and could be misleading . We find in practice that the high-likelihood area contains correct predictions for rare class examples and it plays a vital role in learning imbalanced class distributions . In light of this finding , we propose the Eureka Loss , which rewards the classifier when examples belong to rare classes in the high-likelihood area are correctly predicted . Experiments on the large-scale long-tailed iNaturalist 2018 classification dataset and the ImageNet-LT benchmark both validate the proposed approach . We further analyze the influence of the Eureka Loss in detail on diverse data distributions . 1 INTRODUCTION . Existing classification methods usually struggle in real-world applications , where the class distributions are inherently imbalanced and long-tailed ( Van Horn & Perona , 2017 ; Buda et al. , 2018 ; Liu et al. , 2019 ; Gupta et al. , 2019 ) , in which a few head classes occupy a large probability mass while most tail ( or rare ) classes only possess a few examples . The language generation task is a vivid example of the long-tailed classification . In this case , word types are considered as the classes and the model predicts probabilities over the vocabulary . Common words such as the , of , and and are the head classes , while tailed classes are rare words like Gobbledygook , Scrumptious , and Agastopia . Conventional classifiers based on deep neural networks require a large number of training examples to generalize and have been found to under-perform on rare classes with a few training examples in downstream applications ( Van Horn & Perona , 2017 ; Buda et al. , 2018 ; Cao et al. , 2019 ) . It is proposed that the traditional cross-entropy objective is unsuitable for learning imbalanced distributions since it treats each instance and each class equivalently ( Lin et al. , 2017 ; Tan et al. , 2020 ) . In contrast , the instances from tail classes should be paid more attention , indicated by two main approaches that have been recently investigated for class-imbalanced classification : the frequencybased methods and the likelihood-based methods . The former ( Cui et al. , 2019 ; Cao et al. , 2019 ) directly adjust the weights of the instances in terms of their class frequencies , so that the instances from the tail classes are learned with a higher priority no matter whether they are correctly predicted or not . The latter ( Lin et al. , 2017 ; Zhu et al. , 2018 ) instead penalize the inaccurate predictions more heavily , assuming that the well-classified instances , i.e. , the instances in the high-likelihood area , factor inconsequentially in learning imbalanced distributions . However , neither of these two approaches realistically depicts the likelihood landscape . In particular , the high-likelihood area , where the classifier makes the correct predictions for both common class examples and rare class ones , contributes significantly to generalization . However , this area is not well-shaped , as illustrated in Figure 1 . Specifically , the frequency-based methods imply an impaired learning of common class examples that are the principle part of the natural data , while the likelihood- based methods ignore the correctly-predicted rare class examples that can provide crucial insights into the underlying mechanism for predicting such examples . In this paper , we first demonstrate that existing practice of neglecting predictions in the high-likelihood area is harmful to learning imbalanced class distributions . Furthermore , we find that simply mixing the cross-entropy loss and the Focal Loss ( Lin et al. , 2017 ) can induce substantially superior performance , which validates our motivation . In turn , we propose to elevate the importance of high-likelihood predictions even further and design a novel objective called Eureka Loss . It progressively rewards the classifiers according to both the likelihood and the class frequency of an example such that the system is encouraged to be more confident in the correct prediction of examples from rare classes . Experimental results on the image classification and the language generation tasks demonstrate that the Eureka Loss outperforms strong baselines in learning imbalanced class distributions . Our contributions are twofold : • We challenge the common belief that learning for examples in low-likelihood area is more important for learning tail classes and reveal that the correctly-predicted rare class examples make important contribution to learning long-tailed class distributions . • We explore a new direction for learning imbalanced classification that focuses on rewarding correct predictions for tail classes examples , rather than penalizing incorrect ones . The proposed Eureka Loss rewards the classifier for its high-likelihood predictions progressively to the rarity of their class and achieves substantial improvements on various problems with long-tailed distributions . 2 RELATED WORK . Frequency-based Data and Loss Re-balancing Previous literature on learning with long-tailed distribution mainly focusing on re-balancing the data distribution and re-weighting the loss function . The former is based on a straightforward idea to manually create a pseudo-balanced data distribution to ease the learning problem , including up-sampling for rare class examples ( Chawla et al. , 2002 ) , down-sampling for head class examples ( Drummond & Holte , 2003 ) and a more concrete sampling strategy based on class frequency ( Shen et al. , 2016 ) . As for the latter , recent studies propose to assign different weights to different classes , and the weights can be calculated according to the class distribution . For example , Khan et al . ( 2018 ) design a cost-sensitive loss for major and minor class examples . An intuitive method is to down-weight the loss of frequent classes , while up-weight the contribution of rare class examples . However , frequency is not suitable to be directly treated as the the weight since there exists overlap among samples . An advancing alternative loss CB ( Cui et al. , 2019 ) proposes to calculate the effective number to substitute the frequency for loss re-weighting . However , since it assigns lower weight to head classes in the maximum likelihood training ( Cross Entropy objective ) , it seriously impairs the learning of head classes . Moreover , CB requires a delicate hyper-parameter tuning for every imbalanced distribution , leading to a lot of manul efforts . From the perspective of max-margin , a recent study LDAM ( Cao et al. , 2019 ) proposes to up-weight the loss of tail classes by a class-distribution based margin . Compared to the above methods , we choose to decrease the loss of tail classes by rewarding correct predictions rather than increasing the loss of tail classes through aggravated penalization . Deferring the Frequency-based Class-balanced Training Recent studies find that deferring the class-balanced training helps learn high-quality representations ( Liu et al. , 2019 ) , and propose deferred Class-balanced training ( deferred CB ) ( Cao et al. , 2019 ) , which chooses to adopt Cross Entropy objective at the beginning of training . Similarly , the Decoupling method ( Kang et al. , 2020 ) shows that the re-balancing strategies impair the quality of learned feature representations and demonstrate an improved performance learned with original data distribution , by training the model with Cross Entropy in the first phase and adopting class-balanced training in the second phase . This decoupling strategy can also be found in BBN ( Zhou et al. , 2019 ) , which includes both class imbalanced and balanced training , and the transition from the former to the latter is achieved through a curriculum learning schedule . These methods achieve state-of-the-art performance in long-tailed classification . To be comparable with these methods and to analyse whether Eureka Loss is complementary to this technique , we propose deferred Eureka Loss , in which rewarding for rare class prediction is introduced to encourage the model to learn rare patterns when learning is stalled . Likelihood-based Loss Another dominant method for imbalanced classification is the likelihoodbased method Focal Loss ( FL ) ( Lin et al. , 2017 ) , which proposes to down-weight the contribution of examples in the high-likelihood area . However , we argue that it is harmful for learning tail classes and choose an opposite direction by highlighting the high-likelihood area with a steeper loss . Transferring Representations Techniques for transferring information from sufficient head classes examples to under-represented rare classes examples belong to a parallel successful direction in this field . They include MBJ ( Liu et al. , 2020 ) , which utilizes external semantic feature memory and FSA ( Chu et al. , 2020 ) , which decomposes feature in to class-specific and class-generic components . These latest transfer learning based studies are less related to our paper but they also obtain good improvements in long-tailed classification , so we add them into comparison in the experiments . 3 ROLE OF THE HIGH-LIKELIHOOD AREA . The existing approaches to the long-tailed classification independently consider the class frequency and the example likelihood . However , we show that this one-sided reflection is problematic when dealing with the tail class examples that can be confidently classified . The tail class examples can be easily classified by the classifier , and the head class examples can also be hard for the classifier to recognize . The difficulty of classification depends on the inherent characteristic of the classes , rather than the sample size of the class . For example , in species classification , the Portuguese man o ’ war may be a rare class but can be easily classified due to its distinct features , compared to various kinds of moths which are common classes yet are hard to distinguish . However , the frequency-based methods continuously drive the classifier to fit the rare class examples , especially when they are difficult to predict , which may lead to overfitting . On the other hand , the likelihood-based methods relax the concentration in the high-likelihood area , which contains the tail class examples that are not hard to predict and provide insights to generalization . To verify our point of view , we analyze the problem by dissecting the influence of the high-likelihood area with respect to the class frequency and demonstrate that properly encouraging the learning of well-classified tail class examples induce substantial improvements , before which we first give a brief introduction of classification with long-tailed class distributions . 3.1 PREPARATION : CLASSIFICATION WITH LONG-TAILED CLASS DISTRIBUTIONS . Let ’ s consider the multi-class classification problem with the long-tailed class distribution . Given a class set C , n denotes the number of different classes in C and mi is the number of examples of the class Ci . For simplicity , we sort the class set C according to cardinal mi for Ci such that C0 is the class with the most examples and Cn−1 is the rarest class . Let p be a n-dim probability vector predicted by a classifier model f ( x ; θ ) based on the input x , where each element pi denotes the probability of the class Ci and y is a n-dim one-hot label vector with y being the ground-truth class . The probability vector can be calculated as p = σ ( f ( x ; θ ) ) , ( 1 ) where σ is the normalizing function , e.g. , softmax for multi-class classification . Typically , the parameters are estimated using maximum likelihood estimation ( MLE ) , which is equivalent to using the Cross-Entropy Loss ( CE ) function , where the scalar y · log p can be regarded as the ( log ) -likelihood : L = −E ( x , y ) ∈D log pmodel ( y|x ) = − 1 |D| ∑ ( x , y ) ∈D y · log p. ( 2 ) For deep neural network–based classifiers , due to the non-linearity of the loss function , the problem is typically solved by stochastic gradient descent , which requires the calculation of the gradient with respect to the parameters using the chain-rule , the process of which is called back-propagation : ∂L ∂θ = ∂L ∂p ∂p ∂θ = ∂L ∂p ∂σ ( f ( x ; θ ) ) ∂θ . ( 3 ) We introduce the term likelihood gradient to denote ∂L/∂p , which modulates how the probability mass should be shifted and is a characteristic of the loss function instead of the classifier . For learning imbalanced class distributions , the common methods aim to shape the likelihood gradient so the rare classes are learned with priority , i.e. , embodying a sharper loss and a larger likelihood gradient . Frequency-Based Methods Frequency-based methods alter the likelihood gradient according to the class frequencies , which are irrelevant to how well individual examples are classified . A simple form is using a n-dim weight vector w composed of the class weights based on their frequencies in the dataset to determine the importance of examples from each class : L = −wy · ( y · log p ) . ( 4 ) Note that whenw = 1 , it is identical to the cross-entropy objective . The weight vector is typically calculated as wi = m̄/mi , where m̄ is the average of mi . As we can see , the standard weight is taken as the average of the class size , so that the classes with more examples are down-weighted and the classes with fewer examples are up-weighted . For a natural long-tailed distribution , the average is larger than the median , which suggests more classes are up-weighted . Advanced frequency-based methods try to obtain a more meaningful measurement of the class size , e.g. , the Class-Balanced Loss ( CB ) proposed by Cui et al . ( 2019 ) utilizes an effective number 1−βmi/1−β for each class , where β ∈ [ 0.9 , 1 ) is a tunable class-balanced term . Likelihood-Based Methods Different from the frequency-based methods , likelihood-based methods adjust the likelihood gradient based on the instance-level difficulty as predicted by the classifier such that the examples in the low-likelihood area are more focused in training . For example , the well-known Focal Loss ( FL ) with a balanced factor α proposed by Lin et al . ( 2017 ) takes the following form : L = −α ( 1− py ) γf · ( y· log p ) , ( 5 ) where γf > 0 , which controls the convexness of the loss and higher γf indicates adjustment that are more significant . Note that when α = 1 and γf = 0 , it is identical to the cross-entropy objective . Following previous works ( Cao et al. , 2019 ; Liu et al. , 2019 ; Cui et al. , 2019 ) , the α is set to 1 in multi-class classification , and Class-Balanced Focal Loss ( FL+CB ) can be viewed Focal Loss with uneven alpha for each class in the multi-class setting . The key idea is to pay less attention to the well-classified examples and pay more attention to the badly-classified examples , because it is natural to assume the tail class examples are harder to learn and thus can not be well-classified . However , such methods neglect the correctly-predicted tail class examples , the practice of which we show is not constructive to the learning of long-tailed class distributions .
This paper deals with learning imbalanced class distributions. First, it empirically finds that the high-likelihood area for the rare classes benefits classification. Then, based on the findings, it proposes a new learning objective called Eureka Loss, which can be viewed as a combination of the frequency-based and likelihood-based methods to reward the classifier when examples belong to rare classes in the high-likelihood area are correctly predicted. Empirical results on two typical tasks (i.e. image classification and language generation tasks) illustrate its superiority compared with other baselines.
SP:a89a7421e4d3b82156edcc03ff8b24fb4df8df41
FLAG: Adversarial Data Augmentation for Graph Neural Networks
1 INTRODUCTION . Graph Neural Networks ( GNNs ) have emerged as powerful architectures for learning and analyzing graph representations . The Graph Convolutional Network ( GCN ) ( Kipf & Welling , 2016 ) and its variants have been applied to a wide range of tasks , including visual recognition ( Zhao et al. , 2019 ; Shen et al. , 2018 ) , meta-learning ( Garcia & Bruna , 2017 ) , social analysis ( Qiu et al. , 2018 ; Li & Goldwasser , 2019 ) , and recommender systems ( Ying et al. , 2018 ) . However , the training of GNNs on large-scale datasets usually suffers from overfitting , and realistic graph datasets often involve a high volume of out-of-distribution test nodes ( Hu et al. , 2020 ) , posing significant challenges for prediction problems . One promising solution to combat overfitting in deep neural networks is data augmentation ( Krizhevsky et al. , 2012 ) , which is commonplace in computer vision tasks . Data augmentations apply label-preserving transformations to images , such as translations and reflections . As a result , data augmentation effectively enlarges the training set while incurring negligible computational overhead . However , it remains an open problem how to effectively generalize the notion of data augmentation to GNNs . Transformations on images rely heavily on image structures , and it is challenging to design low-cost transformations that preserve semantic meaning for non-visual tasks like natural language processing ( Wei & Zou , 2019 ) and graph learning . Generally speaking , graph data for machine learning comes with graph structure ( or edge features ) and node features . In the limited cases where data augmentation can be done on graphs , it generally focuses exclusively on the graph structure by adding/removing edges ( Rong et al. , 2019 ) . To date , there is no study on how to manipulate graphs in node feature space for enhanced performance . In the meantime , adversarial data augmentation , which happens in the input feature space , is known to boost neural network robustness and promote resistance to adversarially chosen inputs ( Goodfellow et al. , 2014 ; Madry et al. , 2017 ) . Despite the wide belief that adversarial training harms standard generalization and leads to worse accuracy ( Tsipras et al. , 2018 ; Balaji et al. , 2019 ) , recently a growing amount of attention has been paid to using adversarial perturbations to augment datasets and ultimately alleviate overfitting . For example , Volpi et al . ( 2018 ) showed adversarial data augmentation is a data-dependent regularization that could help generalize to out-of-distribution samples , and its effectiveness has been verified in domains including computer vision ( Xie et al. , 2020 ) , language understanding ( Zhu et al. , 2019 ; Jiang et al. , 2019 ) , and visual question answering ( Gan et al. , 2020 ) . Despite the rich literature about adversarial training of GNNs for security purposes ( Zügner et al. , 2018 ; Dai et al. , 2018 ; Bojchevski & Günnemann , 2019 ; Zhang & Zitnik , 2020 ) , it remains unclear how to effectively and efficiently improve GNN ’ s clean accuracy using adversarial augmentation . Present work . We propose FLAG , Free Large-scale Adversarial Augmentation on Graphs , to tackle the overfitting problem . While existing literature focuses on modifying graph structures to augment datasets , FLAG works purely in the node feature space by adding gradient-based adversarial perturbations to the input node features with graph structures unchanged . FLAG leverages “ free ” methods ( Shafahi et al. , 2019 ) to conduct efficient adversarial training so that it is highly scalable on large-scale datasets . We verify the effectiveness of FLAG on the Open Graph Benchmark ( OGB ) ( Hu et al. , 2020 ) , which is a collection of large-scale , realistic , and diverse graph datasets for both node and graph property prediction tasks . We conduct extensive experiments across OGB datasets by applying FLAG to prestigious GNN models , which are GCN , GraphSAGE , GAT , and GIN ( Kipf & Welling , 2016 ; Hamilton et al. , 2017 ; Veličković et al. , 2017 ; Xu et al. , 2019 ) and show that FLAG brings consistent and significant improvements . For example , FLAG lifts the test accuracy of GAT on ogbn-products by an absolute value of 2.31 % . DeeperGCN ( Li et al. , 2020 ) is another strong baseline that achieves top performance on several OGB benchmarks . FLAG enables DeeperGCN to generalize further and reach new state-of-the-art performance on ogbg-molpcba and ogbg-ppa . FLAG is simple ( adding just a dozen lines of code ) , general ( can be directly applied to any GNN model ) , versatile ( works in both transductive and inductive settings ) , and efficient ( able to bring salient improvement at tractable or even no extra cost ) . Our main contributions are summarized as follows : • We propose adversarial perturbations as a data augmentation in the input node feature space to efficiently boost GNN performance . The resulting FLAG framework is a scalable and flexible augmentation scheme for GNN , which is easy to implement and applicable to any GNN architecture for both node and graph classification tasks . • We advance the state-of-the-art on a number of large-scale OGB datasets , often by large margins . • We provide a detailed analysis and deep insights on the effects adversarial augmentation has on GNNs . 2 PRELIMINARIES . Graph Neural Networks ( GNNs ) . We denote a graph as G ( V , E ) with initial node features xv for v ∈ V and edge features euv for ( u , v ) ∈ E . GNNs are built on graph structures to learn representation vectors hv for every node v ∈ V and a vector hG for the entire graph G. The k-th iteration of message passing , or the k-th layer of GNN forward computation is : h ( k ) v = COMBINE ( k ) ( h ( k−1 ) v , AGGREGATE ( k ) ( { ( h ( k−1 ) v , h ( k−1 ) u , euv ) : u ∈ N ( v ) } ) ) , ( 1 ) where h ( k ) v is the embedding of node v at the k-th layer , euv is the feature vector of the edge between node u and v , N ( v ) is node v ’ s neighbor set , and h ( 0 ) v = xv . COMBINE ( · ) and AGGREGATE ( · ) are functions parameterized by neural networks . To simplify , we view the holistic message passing pipeline as an end-to-end function fθ ( · ) built on graph G : H ( K ) = fθ ( X ; G ) , ( 2 ) whereX is the input node feature matrix . After K rounds of message passing we get the final-layer node matrix H ( K ) . To obtain the representation of the entire graph hG , the permutation-invariant READOUT ( · ) function pools node features from the final iteration K as : hG = READOUT ( { h ( K ) v | v ∈ V } ) , ( 3 ) Additionally from the spectral convolution point of view , the k-th layer of GCN is : I +D− 1 2AD− 1 2 → D̃− 12 ÃD̃− 12 , S = D̃− 12 ÃD̃− 12 , ( 4 ) H ( k+1 ) = σ ( SH ( k ) Θ ( k ) ) , ( 5 ) where H ( k ) is the node feature matrix of the k-th layer with H0 = X , Θk is the trainable weight matrix of layer k , and σ is the activation function . D and A denote the diagonal degree matrix and adjacency matrix , respectively . Here , we view S as a normalized adjacency matrix with self-loops added . Adversarial training . Standard adversarial training seeks to solve the min-max problem as : min θ E ( x , y ) ∼D [ max ‖δ‖p≤ L ( fθ ( x+ δ ) , y ) ] , ( 6 ) where D is the data distribution , y is the label , ‖ · ‖p is some ` p-norm distance metric , is the perturbation budget , and L is the objective function . Madry et al . ( 2017 ) showed that this saddlepoint optimization problem could be reliably tackled by Stochastic Gradient Descent ( SGD ) for the outer minimization and Projected Gradient Descent ( PGD ) for the inner maximization . In practice , the typical approximation of the inner maximization under an l∞-norm constraint is as follows , δt+1 = Π‖δ‖∞≤ ( δt + α · sign ( ∇δL ( fθ ( x+ δt ) , y ) ) ) , ( 7 ) where perturbation δ is updated iteratively , and Π‖δ‖∞≤ performs projection onto the -ball in the l∞-norm . For maximum robustness , this iterative updating procedure usually loops M times , which makes PGD computationally expensive . While there are M forward and backward steps within the process , θ gets updated just once using the final δM . 3 PROPOSED METHOD : FLAG . Adversarial training is a form of data augmentation . By hunting for and stamping out small perturbations that cause the classifier to fail , one may hope that adversarial training should be beneficial to standard accuracy ( Goodfellow et al. , 2014 ; Tsipras et al. , 2018 ; Miyato et al. , 2018 ) . With an increasing amount of attention paid to leverage adversarial training for better clean performance in varied domains ( Xie et al. , 2020 ; Zhu et al. , 2019 ; Gan et al. , 2020 ) , we conduct the first study on how to effectively generalize GNNs using adversarial data augmentation . Here we introduce FLAG , Free Large-scale Adversarial Augmentation on Graphs , to best exploit the power of adversarial augmentation . Note that our method differs from other augmentations for graphs in that it happens in the input node feature space . Augmentation for “ free ” . We leverage the “ free ” adversarial training method ( Shafahi et al. , 2019 ) to craft adversarial data augmentations . PGD is a strong but inefficient way to solve the inner maximization of ( 6 ) . While computing the gradient for the perturbation δ , free training simultaneously computes the model parameter θ ’ s gradient . This “ free ” parameter gradient is then used to compute the ascent step . The authors proposed to train on the same minibatch M times in a row to simulate the inner maximization in ( 6 ) , while compensating by performing M times fewer epochs of training . The resulting algorithm yields accuracy and robustness competitive with standard adversarial training , but with the same runtime as clean training . Gradient accumulation . When doing “ free ” adversarial training , the inner/adversarial loop is usually run M times , each time computing both the gradient for δt and θt−1 . Rather than updating the model parameters in each loop , Zhang et al . ( 2019 ) proposed to accumulate the gradients for θt−1 during the inner loop and applied them all at once during the outer/parameter update . The same idea was used by Zhu et al . ( 2019 ) , who proposed FreeLB to tackle this optimization issue on language understanding tasks . FreeLB ran multiple PGD steps to craft adversaries , and meanwhile accumulated the gradients ∇θL of model parameters . The gradient accumulation behavior can be approximated as optimizing the objective below : min θ E ( x , y ) ∼D [ 1 M M−1∑ t=0 max δt∈It L ( fθ ( x+ δt ) , y ) ] , ( 8 ) where It = Bx+δ0 ( αt ) ∩ Bx ( ) . The gradient accumulation algorithm largely empowers FLAG to further improve GNN with efficient gradient usage for optimization . Algorithm 1 FLAG : Free Large-scale Adversarial Augmentation on Graphs Require : Graph G = ( V , E ) ; input feature matrix X ; learning rate τ ; ascent steps M ; ascent step size α ; training epochs N ; forward function on graph fθ ( · ) denoted in ( 2 ) ; L ( · ) as objective function . We omit the READOUT ( · ) function in ( 3 ) for the inductive scenario here . 1 : Initialize θ 2 : for epoch = 1 . . . N do 3 : δ0 ← U ( −α , α ) . initialize from uniform distribution 4 : g0 ← 0 5 : for t = 1 . . .M do 6 : gt ← gt−1 + 1M · ∇θL ( fθ ( X + δt−1 ; G ) , y ) . θ gradient accumulation 7 : gδ ← ∇δL ( fθ ( X + δt−1 ; G ) , y ) 8 : δt ← δt−1 + α · gδ/ ‖gδ‖F . perturbation δ gradient ascent 9 : end for 10 : θ ← θ − τ · gM . model parameter θ gradient descent 11 : end for Unbounded attack . Usually on images , the inner maximization is a constrained optimization problem . The largest perturbation one can add is bounded by the hyperparameter , typically 8/255 under the l∞-norm . This encourages the visual imperceptibility of the perturbations , thus making defenses realistic and practical . However , graph node features or language word embeddings do not have such straightforward semantic meanings , which makes the selection of highly heuristic . In light of the positive effect of large perturbations on generalization ( Volpi et al. , 2018 ) , and also to simplify hyperparameter search , FLAG drops the projection step when performing the inner maximization . Note that , although the perturbation is not bounded by an explicit , it is still implicitly bounded in the furthest distance that δ can reach , i.e . the step size α times the number of ascending steps M . Biased perturbation for node classification . Conventional conv nets treat each test sample independently during inference , whereas this is not the case in transductive graph learning scenarios . When classifying one target node , messages from the whole k-hop neighborhood are aggregated and combined into its embedding . It is natural to believe that a further neighbor should have lower impact , i.e . higher smoothness , on the final decision of the target node , which can also be intuitively reflected by the message passing view of GNNs in ( 1 ) . To promote more invariance for furtheraway neighbors when doing node classification , we perturb unlabeled nodes with larger step sizes αu than αl for target nodes . We show the effectiveness of this biased perturbation in the ablation study section . The overall augmentation pipeline is presented in Algorithm 1 . Note that when doing transductive node classification , we use diverse step sizes αl and αu to craft adversarial augmentation for target and unlabeled nodes , respectively . In the following sections , we verify FLAG ’ s effectiveness through extensive experiments . In addition , we provide detailed discussions for a deep understanding of the effects of adversarial augmentation .
This paper proposes FLAG (Free Large-scale Adversarial Augmentation on Graphs), an adversarial data augmentation technique that can be applied to different GNN models in order to improve their generalization. The proposed technique consists on adding adversarial perturbations to the nodes’ features solving the standard min-max problem for adversarial training. In this setup, a noise vector is added to the input features which tries to maximize the loss by performing gradient ascent, while the classifier is trained to minimize the loss despite the added adversarial noise.
SP:d872c4d4c7d2495156ce9a1c30dd2696ce1173df
FLAG: Adversarial Data Augmentation for Graph Neural Networks
1 INTRODUCTION . Graph Neural Networks ( GNNs ) have emerged as powerful architectures for learning and analyzing graph representations . The Graph Convolutional Network ( GCN ) ( Kipf & Welling , 2016 ) and its variants have been applied to a wide range of tasks , including visual recognition ( Zhao et al. , 2019 ; Shen et al. , 2018 ) , meta-learning ( Garcia & Bruna , 2017 ) , social analysis ( Qiu et al. , 2018 ; Li & Goldwasser , 2019 ) , and recommender systems ( Ying et al. , 2018 ) . However , the training of GNNs on large-scale datasets usually suffers from overfitting , and realistic graph datasets often involve a high volume of out-of-distribution test nodes ( Hu et al. , 2020 ) , posing significant challenges for prediction problems . One promising solution to combat overfitting in deep neural networks is data augmentation ( Krizhevsky et al. , 2012 ) , which is commonplace in computer vision tasks . Data augmentations apply label-preserving transformations to images , such as translations and reflections . As a result , data augmentation effectively enlarges the training set while incurring negligible computational overhead . However , it remains an open problem how to effectively generalize the notion of data augmentation to GNNs . Transformations on images rely heavily on image structures , and it is challenging to design low-cost transformations that preserve semantic meaning for non-visual tasks like natural language processing ( Wei & Zou , 2019 ) and graph learning . Generally speaking , graph data for machine learning comes with graph structure ( or edge features ) and node features . In the limited cases where data augmentation can be done on graphs , it generally focuses exclusively on the graph structure by adding/removing edges ( Rong et al. , 2019 ) . To date , there is no study on how to manipulate graphs in node feature space for enhanced performance . In the meantime , adversarial data augmentation , which happens in the input feature space , is known to boost neural network robustness and promote resistance to adversarially chosen inputs ( Goodfellow et al. , 2014 ; Madry et al. , 2017 ) . Despite the wide belief that adversarial training harms standard generalization and leads to worse accuracy ( Tsipras et al. , 2018 ; Balaji et al. , 2019 ) , recently a growing amount of attention has been paid to using adversarial perturbations to augment datasets and ultimately alleviate overfitting . For example , Volpi et al . ( 2018 ) showed adversarial data augmentation is a data-dependent regularization that could help generalize to out-of-distribution samples , and its effectiveness has been verified in domains including computer vision ( Xie et al. , 2020 ) , language understanding ( Zhu et al. , 2019 ; Jiang et al. , 2019 ) , and visual question answering ( Gan et al. , 2020 ) . Despite the rich literature about adversarial training of GNNs for security purposes ( Zügner et al. , 2018 ; Dai et al. , 2018 ; Bojchevski & Günnemann , 2019 ; Zhang & Zitnik , 2020 ) , it remains unclear how to effectively and efficiently improve GNN ’ s clean accuracy using adversarial augmentation . Present work . We propose FLAG , Free Large-scale Adversarial Augmentation on Graphs , to tackle the overfitting problem . While existing literature focuses on modifying graph structures to augment datasets , FLAG works purely in the node feature space by adding gradient-based adversarial perturbations to the input node features with graph structures unchanged . FLAG leverages “ free ” methods ( Shafahi et al. , 2019 ) to conduct efficient adversarial training so that it is highly scalable on large-scale datasets . We verify the effectiveness of FLAG on the Open Graph Benchmark ( OGB ) ( Hu et al. , 2020 ) , which is a collection of large-scale , realistic , and diverse graph datasets for both node and graph property prediction tasks . We conduct extensive experiments across OGB datasets by applying FLAG to prestigious GNN models , which are GCN , GraphSAGE , GAT , and GIN ( Kipf & Welling , 2016 ; Hamilton et al. , 2017 ; Veličković et al. , 2017 ; Xu et al. , 2019 ) and show that FLAG brings consistent and significant improvements . For example , FLAG lifts the test accuracy of GAT on ogbn-products by an absolute value of 2.31 % . DeeperGCN ( Li et al. , 2020 ) is another strong baseline that achieves top performance on several OGB benchmarks . FLAG enables DeeperGCN to generalize further and reach new state-of-the-art performance on ogbg-molpcba and ogbg-ppa . FLAG is simple ( adding just a dozen lines of code ) , general ( can be directly applied to any GNN model ) , versatile ( works in both transductive and inductive settings ) , and efficient ( able to bring salient improvement at tractable or even no extra cost ) . Our main contributions are summarized as follows : • We propose adversarial perturbations as a data augmentation in the input node feature space to efficiently boost GNN performance . The resulting FLAG framework is a scalable and flexible augmentation scheme for GNN , which is easy to implement and applicable to any GNN architecture for both node and graph classification tasks . • We advance the state-of-the-art on a number of large-scale OGB datasets , often by large margins . • We provide a detailed analysis and deep insights on the effects adversarial augmentation has on GNNs . 2 PRELIMINARIES . Graph Neural Networks ( GNNs ) . We denote a graph as G ( V , E ) with initial node features xv for v ∈ V and edge features euv for ( u , v ) ∈ E . GNNs are built on graph structures to learn representation vectors hv for every node v ∈ V and a vector hG for the entire graph G. The k-th iteration of message passing , or the k-th layer of GNN forward computation is : h ( k ) v = COMBINE ( k ) ( h ( k−1 ) v , AGGREGATE ( k ) ( { ( h ( k−1 ) v , h ( k−1 ) u , euv ) : u ∈ N ( v ) } ) ) , ( 1 ) where h ( k ) v is the embedding of node v at the k-th layer , euv is the feature vector of the edge between node u and v , N ( v ) is node v ’ s neighbor set , and h ( 0 ) v = xv . COMBINE ( · ) and AGGREGATE ( · ) are functions parameterized by neural networks . To simplify , we view the holistic message passing pipeline as an end-to-end function fθ ( · ) built on graph G : H ( K ) = fθ ( X ; G ) , ( 2 ) whereX is the input node feature matrix . After K rounds of message passing we get the final-layer node matrix H ( K ) . To obtain the representation of the entire graph hG , the permutation-invariant READOUT ( · ) function pools node features from the final iteration K as : hG = READOUT ( { h ( K ) v | v ∈ V } ) , ( 3 ) Additionally from the spectral convolution point of view , the k-th layer of GCN is : I +D− 1 2AD− 1 2 → D̃− 12 ÃD̃− 12 , S = D̃− 12 ÃD̃− 12 , ( 4 ) H ( k+1 ) = σ ( SH ( k ) Θ ( k ) ) , ( 5 ) where H ( k ) is the node feature matrix of the k-th layer with H0 = X , Θk is the trainable weight matrix of layer k , and σ is the activation function . D and A denote the diagonal degree matrix and adjacency matrix , respectively . Here , we view S as a normalized adjacency matrix with self-loops added . Adversarial training . Standard adversarial training seeks to solve the min-max problem as : min θ E ( x , y ) ∼D [ max ‖δ‖p≤ L ( fθ ( x+ δ ) , y ) ] , ( 6 ) where D is the data distribution , y is the label , ‖ · ‖p is some ` p-norm distance metric , is the perturbation budget , and L is the objective function . Madry et al . ( 2017 ) showed that this saddlepoint optimization problem could be reliably tackled by Stochastic Gradient Descent ( SGD ) for the outer minimization and Projected Gradient Descent ( PGD ) for the inner maximization . In practice , the typical approximation of the inner maximization under an l∞-norm constraint is as follows , δt+1 = Π‖δ‖∞≤ ( δt + α · sign ( ∇δL ( fθ ( x+ δt ) , y ) ) ) , ( 7 ) where perturbation δ is updated iteratively , and Π‖δ‖∞≤ performs projection onto the -ball in the l∞-norm . For maximum robustness , this iterative updating procedure usually loops M times , which makes PGD computationally expensive . While there are M forward and backward steps within the process , θ gets updated just once using the final δM . 3 PROPOSED METHOD : FLAG . Adversarial training is a form of data augmentation . By hunting for and stamping out small perturbations that cause the classifier to fail , one may hope that adversarial training should be beneficial to standard accuracy ( Goodfellow et al. , 2014 ; Tsipras et al. , 2018 ; Miyato et al. , 2018 ) . With an increasing amount of attention paid to leverage adversarial training for better clean performance in varied domains ( Xie et al. , 2020 ; Zhu et al. , 2019 ; Gan et al. , 2020 ) , we conduct the first study on how to effectively generalize GNNs using adversarial data augmentation . Here we introduce FLAG , Free Large-scale Adversarial Augmentation on Graphs , to best exploit the power of adversarial augmentation . Note that our method differs from other augmentations for graphs in that it happens in the input node feature space . Augmentation for “ free ” . We leverage the “ free ” adversarial training method ( Shafahi et al. , 2019 ) to craft adversarial data augmentations . PGD is a strong but inefficient way to solve the inner maximization of ( 6 ) . While computing the gradient for the perturbation δ , free training simultaneously computes the model parameter θ ’ s gradient . This “ free ” parameter gradient is then used to compute the ascent step . The authors proposed to train on the same minibatch M times in a row to simulate the inner maximization in ( 6 ) , while compensating by performing M times fewer epochs of training . The resulting algorithm yields accuracy and robustness competitive with standard adversarial training , but with the same runtime as clean training . Gradient accumulation . When doing “ free ” adversarial training , the inner/adversarial loop is usually run M times , each time computing both the gradient for δt and θt−1 . Rather than updating the model parameters in each loop , Zhang et al . ( 2019 ) proposed to accumulate the gradients for θt−1 during the inner loop and applied them all at once during the outer/parameter update . The same idea was used by Zhu et al . ( 2019 ) , who proposed FreeLB to tackle this optimization issue on language understanding tasks . FreeLB ran multiple PGD steps to craft adversaries , and meanwhile accumulated the gradients ∇θL of model parameters . The gradient accumulation behavior can be approximated as optimizing the objective below : min θ E ( x , y ) ∼D [ 1 M M−1∑ t=0 max δt∈It L ( fθ ( x+ δt ) , y ) ] , ( 8 ) where It = Bx+δ0 ( αt ) ∩ Bx ( ) . The gradient accumulation algorithm largely empowers FLAG to further improve GNN with efficient gradient usage for optimization . Algorithm 1 FLAG : Free Large-scale Adversarial Augmentation on Graphs Require : Graph G = ( V , E ) ; input feature matrix X ; learning rate τ ; ascent steps M ; ascent step size α ; training epochs N ; forward function on graph fθ ( · ) denoted in ( 2 ) ; L ( · ) as objective function . We omit the READOUT ( · ) function in ( 3 ) for the inductive scenario here . 1 : Initialize θ 2 : for epoch = 1 . . . N do 3 : δ0 ← U ( −α , α ) . initialize from uniform distribution 4 : g0 ← 0 5 : for t = 1 . . .M do 6 : gt ← gt−1 + 1M · ∇θL ( fθ ( X + δt−1 ; G ) , y ) . θ gradient accumulation 7 : gδ ← ∇δL ( fθ ( X + δt−1 ; G ) , y ) 8 : δt ← δt−1 + α · gδ/ ‖gδ‖F . perturbation δ gradient ascent 9 : end for 10 : θ ← θ − τ · gM . model parameter θ gradient descent 11 : end for Unbounded attack . Usually on images , the inner maximization is a constrained optimization problem . The largest perturbation one can add is bounded by the hyperparameter , typically 8/255 under the l∞-norm . This encourages the visual imperceptibility of the perturbations , thus making defenses realistic and practical . However , graph node features or language word embeddings do not have such straightforward semantic meanings , which makes the selection of highly heuristic . In light of the positive effect of large perturbations on generalization ( Volpi et al. , 2018 ) , and also to simplify hyperparameter search , FLAG drops the projection step when performing the inner maximization . Note that , although the perturbation is not bounded by an explicit , it is still implicitly bounded in the furthest distance that δ can reach , i.e . the step size α times the number of ascending steps M . Biased perturbation for node classification . Conventional conv nets treat each test sample independently during inference , whereas this is not the case in transductive graph learning scenarios . When classifying one target node , messages from the whole k-hop neighborhood are aggregated and combined into its embedding . It is natural to believe that a further neighbor should have lower impact , i.e . higher smoothness , on the final decision of the target node , which can also be intuitively reflected by the message passing view of GNNs in ( 1 ) . To promote more invariance for furtheraway neighbors when doing node classification , we perturb unlabeled nodes with larger step sizes αu than αl for target nodes . We show the effectiveness of this biased perturbation in the ablation study section . The overall augmentation pipeline is presented in Algorithm 1 . Note that when doing transductive node classification , we use diverse step sizes αl and αu to craft adversarial augmentation for target and unlabeled nodes , respectively . In the following sections , we verify FLAG ’ s effectiveness through extensive experiments . In addition , we provide detailed discussions for a deep understanding of the effects of adversarial augmentation .
This paper investigates adversarial feature augmentation for improving the generalizability of graph neural networks. The authors adopt an existing augmentation algorithm and apply on the nodes of each training graph, and use the perturbed graphs for training. The focus of the paper is extensive experimentation in various tasks and settings to illustrate the effectiveness of adversarial augmentation in graph-based tasks. The experiments provide new, non-trivial insights, such as the effect of the number of network layers on the effectiveness of augmentation. The paper is well-written and easy to read.
SP:d872c4d4c7d2495156ce9a1c30dd2696ce1173df
Class-Weighted Evaluation Metrics for Imbalanced Data Classification
1 INTRODUCTION . For a broad range of machine learning ( ML ) tasks , predictive modeling in the presence of imbalanced datasets – those with severe distribution skews – has been a long-standing problem ( He & Garcia , 2009 ; Sun et al. , 2009 ; He & Ma , 2013 ; Branco et al. , 2016 ; Hilario et al. , 2018 ; Johnson & Khoshgoftaar , 2019 ) . Imbalanced training datasets lead to models with prediction bias towards majority classes , which in turn results in misclassification of the underrepresented ones . Yet , those minority classes often are the ones that correspond to the most important events of interest ( e.g. , errors in system logs ( Zhu et al. , 2019 ) , infected patients in medical diagnosis ( Cohen et al. , 2006 ) , fraud in financial transactions ( Makki et al. , 2019 ) ) . While there is often an inverse correlation between the class cardinalities and their importance ( i.e. , rare classes are more important than others ) , the core problem here is the mismatch between the way these two distributions are skewed : the ith most common class is not necessarily the ith most important class ( see Figure 1a for an illustration ) . In fact , rarity is one of many potential criteria that can determine the importance of a class , which is usually positively correlated with the costs or risks involved in its misprediction . Ignoring these criteria when dealing with imbalanced data classification may have detrimental consequences . Consider automatic classification of messages in system event logs as an example ( Zhu et al. , 2019 ) . An event log is a temporal sequence of messages that have transpired for a given software system ( e.g. , operating systems , cyber-physical systems ) over a certain time period . Event logs are particularly useful after a system has been deployed , as they can provide the DevOps teams with insights about errors outside of the testing environment , thereby enabling them to debug and improve the system quality . There is typically an inverse correlation between the stability/maturity of a system and the frequency of the errors it produces in its event logs . Furthermore , the message types that appear least frequently in an event log are usually the ones with the greatest importance . A concrete example of this was a rare anomaly in Uber ’ s self-driving car that led to the death of a pedestrian , since the system flagged it as a false positive in its logs ( Efrati , 2018 ) . If this event had not been misclassified and dismissed by the system , the pedestrian death in Arizona may have been avoided . A plethora of approaches have been proposed for building balanced classifiers ( Sun et al. , 2009 ; Branco et al. , 2016 ) . A fundamental issue that still remains an open challenge is the lack of a generally-accepted methodology for measuring classification performance . The traditional metrics , which are designed to evaluate average case performance ( e.g. , Accuracy ) are not capable of correctly assessing the results in presence of arbitrary skew mismatches between class cardinalities and importances . On the other hand , metrics specifically proposed for imbalanced learning are either domain-specific , do not easily generalize beyond two classes , or can not support varying class importance ( e.g. , Balanced Accuracy ) ( Japkowicz , 2013 ) . Let us illustrate the problem with the simple example in Figure 1b . The test dataset consists of 100 data items from 3 classes ( A , B , C ) . The greatest majority of the items belong to class C ( 70 ) , but class B ( 20 ) has the greatest importance ( 0.7 ) . In other words , Cardinality and Importance are both non-uniform and in favor of different classes ( i.e. , representing the top-right quadrant of Figure 1a ) . The confusion matrix on the right shows the results from a classifier run against this test dataset . Unsurprisingly , the classifier performed the best for the majority class C ( 60/70 correct predictions ) . When evaluated using the traditional Accuracy metric , neither Class Cardinality nor Class Importance is taken into account . If Balanced Accuracy is used instead , we observe the degrading impact of the Class Cardinality skew ( 0.38 < 0.65 ) , but Class Importance is still not accounted for . This example demonstrates the need for a new evaluation approach that is sensitive to both Cardinality and Importance skew , as well as any arbitrary correlations between them . This is especially critical for ensuring a fair comparative assessment across multiple classifiers or problem instances . Our goal in this paper is to design an evaluation framework for imbalanced data classification , which can be reliably used to measure , compare , train , and tune classifier performance in a way that is sensitive to non-uniform class importance . We identify two key design principles for such a framework : • Simplicity : It should be intuitive and easy to use and interpret . • Generality : It should be general-purpose , i.e. , ( i ) extensible to an arbitrary number of classes and ( ii ) customizable to any application domain . To meet the first goal , we focus on scalar metrics such as Accuracy ( as opposed to graphical metrics such as ROC curves ) , as they are simpler , more commonly used , and scale well with increasing numbers of classes and models . To meet the second goal , we target the more general n-ary classification problems ( as opposed to binary ) , as well as providing the capability to flexibly adjust class weights to capture non-uniform importance criteria that may vary across application domains . Note that we primarily focus on Accuracy as our base scalar metric in this paper , as it is seen as the de facto metric for classification problems ( Sci ) . However , our framework is general enough to be extended to other scalar metrics , such as Precision and Recall . Similarly , while we deeply examine three use cases ( log parsing , sentiment analysis , URL classification ) , our framework in principle is generally applicable to any domain with imbalanced class and importance distributions . We first provide a brief overview of related work in Section 2 . Section 3 presents our new , classweighted evaluation framework . In Section 4 , we show the practical utility of our framework by applying it over : ( i ) three log parsing systems ( Drain ( He et al. , 2017 ) , MoLFI ( Messaoudi et al. , 2018 ) , Spell ( Du & Li , 2016 ; 2018 ) ) using four real-world benchmarks ( Zhu et al. , 2019 ) ; ( ii ) a variety of deep learning models developed for sentiment analysis on a customer reviews dataset from Amazon ( Ni et al. , 2019 ) ; and ( iii ) an industrial use case for URL classification with real classifiers and datasets from four cyber-security companies . Finally , we conclude in Section 5 . 2 RELATED WORK . Imbalanced Data Classification . Imbalanced data is prevalent in almost every domain ( Cohen et al. , 2006 ; Batuwita & Palade , 2012 ; Makki et al. , 2019 ) . The growing adoption of ML models in diverse application domains has led to a surge in imbalanced data classification research ( He & Garcia , 2009 ; Sun et al. , 2009 ; He & Ma , 2013 ; Branco et al. , 2016 ; Hilario et al. , 2018 ; Johnson & Khoshgoftaar , 2019 ) . While the techniques widely vary , they fall under four basic categories : pre-processing training data to establish balance via sampling techniques ( Estabrooks et al. , 2004 ; Blaszczynski & Stefanowski , 2015 ) , building custom learning techniques for imbalanced training data ( Joshi et al. , 2001 ; Castro & de Pádua Braga , 2013 ) , post-processing predictions from an imbalanced model ( Maloof , 2003 ) , and their hybrids ( Estabrooks & Japkowicz , 2001 ) . In this paper , we do not propose a new imbalanced learning technique , but a general-purpose performance evaluation framework that could be used in the training and/or testing of models for any technique . Section 4 demonstrates the practical utility of our framework for a variety of real ML use cases . Evaluation Metrics . Traditional metrics for evaluating prediction performance such as Accuracy , Sensitivity/Specificity ( and their combination G-mean ) , Precision/Recall ( and their combination FScore ) were not designed with imbalanced data issues in mind ( Japkowicz , 2013 ) . In fact , most of these were originally intended for binary classification problems . To extend them to more than 2 classes , macro-averaging ( i.e. , arithmetic mean over individual class measurements ) is used . Macroaveraging treats classes equally ( Branco et al. , 2016 ) . Balanced Accuracy is a popular averagingbased approach . There are also probabilistic evaluation approaches that extend Balanced Accuracy with Bayesian inference techniques for both binary and multi-class problems ( Brodersen et al. , 2010 ; Carrillo et al. , 2014 ) . Close to our work , Cohen et al . ( 2006 ) introduced the notion of class weights , yet in the specific context of Sensitivity/Specificity for binary classification in the medical domain . Similarly , Batuwita & Palade ( 2012 ) proposed extensions to G-mean for the bio-informatics domain . In addition to these scalar ( a.k.a. , threshold ) metrics , graphical ( a.k.a. , ranking ) evaluation methods such as Receiver Operating Characteristic ( ROC ) curves or Precision-Recall ( PR ) curves ( and the Area Under the Curve ( AUC ) for such curves ) as well as their extensions to imbalanced data / multiclass problems were also investigated ( Weng & Poon , 2008 ; Japkowicz , 2013 ) . While these methods provide more detailed insights into the operational space of classifiers as a whole , they do not easily scale with use in problems with a large number of classes ( Branco et al. , 2016 ) . 3 CLASS-WEIGHTED EVALUATION FRAMEWORK . In this section , we present our new evaluation framework for multi-class learning problems in presence of arbitrary skews among class distributions and/or importances . Our framework builds on and extends commonly used scalar / threshold metrics such as Accuracy . These metrics were originally designed for binary classification problems , where there is typically more emphasis on one class ( the positive class , e.g. , anomalies ) . To adopt them to multi-class problems where there is no such single-class emphasis , each class ’ metric can be computed separately and then an overall aggregation ( i.e. , arithmetic mean ) can be performed . For example , Accuracy has been extended to BalancedAccuracy by following this approach . In our framework , we follow a similar aggregation strategy , however , we do it in a more generalized way that allows custom class weights to capture class importance . Furthermore , these class weights can be based on any importance criteria such as rarity , cost , risk , expected benefits , and possibly a hybrid of multiple such criteria . Therefore , it is critical to provide a flexible formulation that allows users or domain experts to adjust the weights as needed by their problem instance . In what follows , we present our new class-weighted evaluation framework in a top-down fashion . Using the basic notation summarized in Table 1 , we first formulate the general framework , and then we describe how this framework can be customized to different importance criteria scenarios by specializing the weights in a principled manner . For ease of exposition , we first focus on Accuracy as the underlying performance metric , and then we discuss how our approach can be adopted to other similar metrics . Finally , we end this section with a brief discussion of how our framework can be used in model training .
The paper presents a simple addition to the Balanced Accuracy approach - which the authors refer to as ‘importance’. However, there is nothing in the formulation of this concept which requires that this is an importance and could in fact be any form of weighting. The paper evaluates the new metric - but only agains the Balanced Accuracy metric (which seems quite restrictive).
SP:98450ef54b363e5e68b19b7bc1327490d69825fa
Class-Weighted Evaluation Metrics for Imbalanced Data Classification
1 INTRODUCTION . For a broad range of machine learning ( ML ) tasks , predictive modeling in the presence of imbalanced datasets – those with severe distribution skews – has been a long-standing problem ( He & Garcia , 2009 ; Sun et al. , 2009 ; He & Ma , 2013 ; Branco et al. , 2016 ; Hilario et al. , 2018 ; Johnson & Khoshgoftaar , 2019 ) . Imbalanced training datasets lead to models with prediction bias towards majority classes , which in turn results in misclassification of the underrepresented ones . Yet , those minority classes often are the ones that correspond to the most important events of interest ( e.g. , errors in system logs ( Zhu et al. , 2019 ) , infected patients in medical diagnosis ( Cohen et al. , 2006 ) , fraud in financial transactions ( Makki et al. , 2019 ) ) . While there is often an inverse correlation between the class cardinalities and their importance ( i.e. , rare classes are more important than others ) , the core problem here is the mismatch between the way these two distributions are skewed : the ith most common class is not necessarily the ith most important class ( see Figure 1a for an illustration ) . In fact , rarity is one of many potential criteria that can determine the importance of a class , which is usually positively correlated with the costs or risks involved in its misprediction . Ignoring these criteria when dealing with imbalanced data classification may have detrimental consequences . Consider automatic classification of messages in system event logs as an example ( Zhu et al. , 2019 ) . An event log is a temporal sequence of messages that have transpired for a given software system ( e.g. , operating systems , cyber-physical systems ) over a certain time period . Event logs are particularly useful after a system has been deployed , as they can provide the DevOps teams with insights about errors outside of the testing environment , thereby enabling them to debug and improve the system quality . There is typically an inverse correlation between the stability/maturity of a system and the frequency of the errors it produces in its event logs . Furthermore , the message types that appear least frequently in an event log are usually the ones with the greatest importance . A concrete example of this was a rare anomaly in Uber ’ s self-driving car that led to the death of a pedestrian , since the system flagged it as a false positive in its logs ( Efrati , 2018 ) . If this event had not been misclassified and dismissed by the system , the pedestrian death in Arizona may have been avoided . A plethora of approaches have been proposed for building balanced classifiers ( Sun et al. , 2009 ; Branco et al. , 2016 ) . A fundamental issue that still remains an open challenge is the lack of a generally-accepted methodology for measuring classification performance . The traditional metrics , which are designed to evaluate average case performance ( e.g. , Accuracy ) are not capable of correctly assessing the results in presence of arbitrary skew mismatches between class cardinalities and importances . On the other hand , metrics specifically proposed for imbalanced learning are either domain-specific , do not easily generalize beyond two classes , or can not support varying class importance ( e.g. , Balanced Accuracy ) ( Japkowicz , 2013 ) . Let us illustrate the problem with the simple example in Figure 1b . The test dataset consists of 100 data items from 3 classes ( A , B , C ) . The greatest majority of the items belong to class C ( 70 ) , but class B ( 20 ) has the greatest importance ( 0.7 ) . In other words , Cardinality and Importance are both non-uniform and in favor of different classes ( i.e. , representing the top-right quadrant of Figure 1a ) . The confusion matrix on the right shows the results from a classifier run against this test dataset . Unsurprisingly , the classifier performed the best for the majority class C ( 60/70 correct predictions ) . When evaluated using the traditional Accuracy metric , neither Class Cardinality nor Class Importance is taken into account . If Balanced Accuracy is used instead , we observe the degrading impact of the Class Cardinality skew ( 0.38 < 0.65 ) , but Class Importance is still not accounted for . This example demonstrates the need for a new evaluation approach that is sensitive to both Cardinality and Importance skew , as well as any arbitrary correlations between them . This is especially critical for ensuring a fair comparative assessment across multiple classifiers or problem instances . Our goal in this paper is to design an evaluation framework for imbalanced data classification , which can be reliably used to measure , compare , train , and tune classifier performance in a way that is sensitive to non-uniform class importance . We identify two key design principles for such a framework : • Simplicity : It should be intuitive and easy to use and interpret . • Generality : It should be general-purpose , i.e. , ( i ) extensible to an arbitrary number of classes and ( ii ) customizable to any application domain . To meet the first goal , we focus on scalar metrics such as Accuracy ( as opposed to graphical metrics such as ROC curves ) , as they are simpler , more commonly used , and scale well with increasing numbers of classes and models . To meet the second goal , we target the more general n-ary classification problems ( as opposed to binary ) , as well as providing the capability to flexibly adjust class weights to capture non-uniform importance criteria that may vary across application domains . Note that we primarily focus on Accuracy as our base scalar metric in this paper , as it is seen as the de facto metric for classification problems ( Sci ) . However , our framework is general enough to be extended to other scalar metrics , such as Precision and Recall . Similarly , while we deeply examine three use cases ( log parsing , sentiment analysis , URL classification ) , our framework in principle is generally applicable to any domain with imbalanced class and importance distributions . We first provide a brief overview of related work in Section 2 . Section 3 presents our new , classweighted evaluation framework . In Section 4 , we show the practical utility of our framework by applying it over : ( i ) three log parsing systems ( Drain ( He et al. , 2017 ) , MoLFI ( Messaoudi et al. , 2018 ) , Spell ( Du & Li , 2016 ; 2018 ) ) using four real-world benchmarks ( Zhu et al. , 2019 ) ; ( ii ) a variety of deep learning models developed for sentiment analysis on a customer reviews dataset from Amazon ( Ni et al. , 2019 ) ; and ( iii ) an industrial use case for URL classification with real classifiers and datasets from four cyber-security companies . Finally , we conclude in Section 5 . 2 RELATED WORK . Imbalanced Data Classification . Imbalanced data is prevalent in almost every domain ( Cohen et al. , 2006 ; Batuwita & Palade , 2012 ; Makki et al. , 2019 ) . The growing adoption of ML models in diverse application domains has led to a surge in imbalanced data classification research ( He & Garcia , 2009 ; Sun et al. , 2009 ; He & Ma , 2013 ; Branco et al. , 2016 ; Hilario et al. , 2018 ; Johnson & Khoshgoftaar , 2019 ) . While the techniques widely vary , they fall under four basic categories : pre-processing training data to establish balance via sampling techniques ( Estabrooks et al. , 2004 ; Blaszczynski & Stefanowski , 2015 ) , building custom learning techniques for imbalanced training data ( Joshi et al. , 2001 ; Castro & de Pádua Braga , 2013 ) , post-processing predictions from an imbalanced model ( Maloof , 2003 ) , and their hybrids ( Estabrooks & Japkowicz , 2001 ) . In this paper , we do not propose a new imbalanced learning technique , but a general-purpose performance evaluation framework that could be used in the training and/or testing of models for any technique . Section 4 demonstrates the practical utility of our framework for a variety of real ML use cases . Evaluation Metrics . Traditional metrics for evaluating prediction performance such as Accuracy , Sensitivity/Specificity ( and their combination G-mean ) , Precision/Recall ( and their combination FScore ) were not designed with imbalanced data issues in mind ( Japkowicz , 2013 ) . In fact , most of these were originally intended for binary classification problems . To extend them to more than 2 classes , macro-averaging ( i.e. , arithmetic mean over individual class measurements ) is used . Macroaveraging treats classes equally ( Branco et al. , 2016 ) . Balanced Accuracy is a popular averagingbased approach . There are also probabilistic evaluation approaches that extend Balanced Accuracy with Bayesian inference techniques for both binary and multi-class problems ( Brodersen et al. , 2010 ; Carrillo et al. , 2014 ) . Close to our work , Cohen et al . ( 2006 ) introduced the notion of class weights , yet in the specific context of Sensitivity/Specificity for binary classification in the medical domain . Similarly , Batuwita & Palade ( 2012 ) proposed extensions to G-mean for the bio-informatics domain . In addition to these scalar ( a.k.a. , threshold ) metrics , graphical ( a.k.a. , ranking ) evaluation methods such as Receiver Operating Characteristic ( ROC ) curves or Precision-Recall ( PR ) curves ( and the Area Under the Curve ( AUC ) for such curves ) as well as their extensions to imbalanced data / multiclass problems were also investigated ( Weng & Poon , 2008 ; Japkowicz , 2013 ) . While these methods provide more detailed insights into the operational space of classifiers as a whole , they do not easily scale with use in problems with a large number of classes ( Branco et al. , 2016 ) . 3 CLASS-WEIGHTED EVALUATION FRAMEWORK . In this section , we present our new evaluation framework for multi-class learning problems in presence of arbitrary skews among class distributions and/or importances . Our framework builds on and extends commonly used scalar / threshold metrics such as Accuracy . These metrics were originally designed for binary classification problems , where there is typically more emphasis on one class ( the positive class , e.g. , anomalies ) . To adopt them to multi-class problems where there is no such single-class emphasis , each class ’ metric can be computed separately and then an overall aggregation ( i.e. , arithmetic mean ) can be performed . For example , Accuracy has been extended to BalancedAccuracy by following this approach . In our framework , we follow a similar aggregation strategy , however , we do it in a more generalized way that allows custom class weights to capture class importance . Furthermore , these class weights can be based on any importance criteria such as rarity , cost , risk , expected benefits , and possibly a hybrid of multiple such criteria . Therefore , it is critical to provide a flexible formulation that allows users or domain experts to adjust the weights as needed by their problem instance . In what follows , we present our new class-weighted evaluation framework in a top-down fashion . Using the basic notation summarized in Table 1 , we first formulate the general framework , and then we describe how this framework can be customized to different importance criteria scenarios by specializing the weights in a principled manner . For ease of exposition , we first focus on Accuracy as the underlying performance metric , and then we discuss how our approach can be adopted to other similar metrics . Finally , we end this section with a brief discussion of how our framework can be used in model training .
This paper presents a weighted balanced accuracy to evaulate the performance of multi-class classification. Basically, the performance for a multi-class problem can be evaluated by decomposing the original multi-class problem into a number of binary ones based on one-against-rest manner, and then evaulating the performance scores for each of the binary ones using any well-known metric for binary classification, and then, aggregating the performance scores. The main aim of this paper is to present a weighting scheme when aggregating the scores.
SP:98450ef54b363e5e68b19b7bc1327490d69825fa
On the Transfer of Disentangled Representations in Realistic Settings
Learning meaningful representations that disentangle the underlying structure of the data generating process is considered to be of key importance in machine learning . While disentangled representations were found to be useful for diverse tasks such as abstract reasoning and fair classification , their scalability and real-world impact remain questionable . We introduce a new high-resolution dataset with 1M simulated images and over 1,800 annotated real-world images of the same setup . In contrast to previous work , this new dataset exhibits correlations , a complex underlying structure , and allows to evaluate transfer to unseen simulated and realworld settings where the encoder i ) remains in distribution or ii ) is out of distribution . We propose new architectures in order to scale disentangled representation learning to realistic high-resolution settings and conduct a large-scale empirical study of disentangled representations on this dataset . We observe that disentanglement is a good predictor for out-of-distribution ( OOD ) task performance . 1 INTRODUCTION Disentangled representations hold the promise of generalization to unseen scenarios ( Higgins et al. , 2017b ) , increased interpretability ( Adel et al. , 2018 ; Higgins et al. , 2018 ) and faster learning on downstream tasks ( van Steenkiste et al. , 2019 ; Locatello et al. , 2019a ) . However , most of the focus in learning disentangled representations has been on small synthetic datasets whose ground truth factors exhibit perfect independence by design . More realistic settings remain largely unexplored . We hypothesize that this is because real-world scenarios present several challenges that have not been extensively studied to date . Important challenges are scaling ( much higher resolution in observations and factors ) , occlusions , and correlation between factors . Consider , for instance , a robotic arm moving a cube : Here , the robot arm can occlude parts of the cube , and its end-effector position exhibits correlations with the cube ’ s position and orientation , which might be problematic for common disentanglement learners ( Träuble et al. , 2020 ) . Another difficulty is that we typically have only limited access to ground truth labels in the real world , which requires robust frameworks for model selection when no or only weak labels are available . ∗Equal contribution . Correspondence to : < adit @ dtu.dk > , < frederik.traeuble @ tuebingen.mpg.de > . †Work done during an internship at the Max Planck Institute for Intelligent Systems . The goal of this work is to provide a path towards disentangled representation learning in realistic settings . First , we argue that this requires a new dataset that captures the challenges mentioned above . We propose a dataset consisting of simulated observations from a scene where a robotic arm interacts with a cube in a stage ( see Fig . 1 ) . This setting exhibits correlations and occlusions that are typical in real-world robotics . Second , we show how to scale the architecture of disentanglement methods to perform well on this dataset . Third , we extensively analyze the usefulness of disentangled representations in terms of out-of-distribution downstream generalization , both in terms of held-out factors of variation and sim2real transfer . In fact , our dataset is based on the TriFinger robot from Wüthrich et al . ( 2020 ) , which can be built to test the deployment of models in the real world . While the analysis in this paper focuses on the transfer and generalization of predictive models , we hope that our dataset may serve as a benchmark to explore the usefulness of disentangled representations in real-world control tasks . The contributions of this paper can be summarized as follows : • We propose a new dataset for disentangled representation learning , containing 1M simulated high-resolution images from a robotic setup , with seven partly correlated factors of variation . Additionally , we provide a dataset of over 1,800 annotated images from the corresponding real-world setup that can be used for challenging sim2real transfer tasks . These datasets are made publicly available.1 • We propose a new neural architecture to successfully scale VAE-based disentanglement learning approaches to complex datasets . • We conduct a large-scale empirical study on generalization to various transfer scenarios on this challenging dataset . We train 1,080 models using state-of-the-art disentanglement methods and discover that disentanglement is a good predictor for out-of-distribution ( OOD ) performance of downstream tasks . 2 RELATED WORK . Disentanglement methods . Most state-of-the-art disentangled representation learning approaches are based on the framework of variational autoencoders ( VAEs ) ( Kingma & Welling , 2014 ; Rezende et al. , 2014 ) . A ( high-dimensional ) observation x is assumed to be generated according to the latent variable model pθ ( x|z ) p ( z ) where the latent variables z have a fixed prior p ( z ) . The generative model pθ ( x|z ) and the approximate posterior distribution qφ ( z|x ) are typically parameterized by neural networks , which are optimized by maximizing the evidence lower bound ( ELBO ) : LV AE = Eqφ ( z|x ) [ log pθ ( x|z ) ] −DKL ( qφ ( z|x ) ‖p ( z ) ) ≤ log p ( x ) ( 1 ) As the above objective does not enforce any structure on the latent space except for some similarity to p ( z ) , different regularization strategies have been proposed , along with evaluation metrics to gauge the disentanglement of the learned representations ( Higgins et al. , 2017a ; Kim & Mnih , 2018 ; Burgess et al. , 2018 ; Kumar et al. , 2018 ; Chen et al. , 2018 ; Eastwood & Williams , 2018 ) . Recently , Locatello et al . ( 2019b , Theorem 1 ) showed that the purely unsupervised learning of disentangled representations is impossible . This limitation can be overcome without the need for explicitly labeled data by introducing weak labels ( Locatello et al. , 2020 ; Shu et al. , 2019 ) . Ideas related to disentangling the factors of variation date back to the non-linear ICA literature ( Comon , 1994 ; Hyvärinen & Pajunen , 1999 ; Bach & Jordan , 2002 ; Jutten & Karhunen , 2003 ; Hyvarinen & Morioka , 2016 ; Hyvarinen et al. , 2019 ; Gresele et al. , 2019 ) . Recent work combines non-linear ICA with disentanglement ( Khemakhem et al. , 2020 ; Sorrenson et al. , 2020 ; Klindt et al. , 2020 ) . Evaluating disentangled representations . The BetaVAE ( Higgins et al. , 2017a ) and FactorVAE ( Kim & Mnih , 2018 ) scores measure disentanglement by performing an intervention on the factors of variation and predicting which factor was intervened on . The Mutual Information Gap ( MIG ) ( Chen et al. , 2018 ) , Modularity ( Ridgeway & Mozer , 2018 ) , DCI Disentanglement ( Eastwood & Williams , 2018 ) and SAP scores ( Kumar et al. , 2018 ) are based on matrices relating factors of variation and codes ( e.g . pairwise mutual information , feature importance and predictability ) . 1http : //people.tuebingen.mpg.de/ei-datasets/iclr_transfer_paper/robot_ finger_datasets.tar ( 6.18 GB ) Datasets for disentanglement learning . dSprites ( Higgins et al. , 2017a ) , which consists of binary low-resolution 2D images of basic shapes , is one of the most commonly used synthetic datasets for disentanglement learning . Color-dSprites , Noisy-dSprites , and Scream-dSprites are slightly more challenging variants of dSprites . The SmallNORB dataset contains toy images rendered under different lighting conditions , elevations and azimuths ( LeCun et al. , 2004 ) . Cars3D ( Reed et al. , 2015 ) exhibits different car models from Fidler et al . ( 2012 ) under different camera viewpoints . 3dshapes is a popular dataset of simple shapes in a 3D scene ( Kim & Mnih , 2018 ) . Finally , Gondal et al . ( 2019 ) proposed MPI3D , containing images of physical 3D objects with seven factors of variation , such as object color , shape , size and position available in a simulated , simulated and highly realistic rendered simulated variant . Except MPI3D which has over 1M images , the size of the other datasets is limited with only 17 , 568 to 737 , 280 images . All of the above datasets exhibit perfect independence of all factors , the number of possible states is on the order of 1M or less , and due to their static setting they do not allow for dynamic downstream tasks such as reinforcement learning . In addition , except for SmallNORB , the image resolution is limited to 64x64 and there are no occlusions . Other related work . Locatello et al . ( 2020 ) probed the out-of-distribution generalization of downstream tasks trained on disentangled representations . However , these representations are trained on the entire dataset . Generalization and transfer performance especially for representation learning has likewise been studied in Dayan ( 1993 ) ; Muandet et al . ( 2013 ) ; Heinze-Deml & Meinshausen ( 2017 ) ; Rojas-Carulla et al . ( 2018 ) ; Suter et al . ( 2019 ) ; Li et al . ( 2018 ) ; Arjovsky et al . ( 2019 ) ; Krueger et al . ( 2020 ) ; Gowal et al . ( 2020 ) . For the role of disentanglement in causal representation learning we refer to the recent overview by Schölkopf et al . ( 2021 ) . Träuble et al . ( 2020 ) systematically investigated the effects of correlations between factors of variation on disentangled representation learners . Transfer of learned disentangled representations from simulation to the real world has been recently investigated by Gondal et al . ( 2019 ) on the MPI3D dataset , and previously by Higgins et al . ( 2017b ) in the context of reinforcement learning . Sim2real transfer is of major interest in the robotic learning community , because of limited data and supervision in the real world ( Tobin et al. , 2017 ; Rusu et al. , 2017 ; Peng et al. , 2018 ; James et al. , 2019 ; Yan et al. , 2020 ; Andrychowicz et al. , 2020 ) . 3 SCALING DISENTANGLED REPRESENTATIONS TO COMPLEX SCENARIOS . A new challenging dataset . Simulated images in our dataset are derived from the trifinger robot platform introduced by Wüthrich et al . ( 2020 ) . The motivation for choosing this setting is that ( 1 ) it is challenging due to occlusions , correlations , and other difficulties encountered in robotic settings , ( 2 ) it requires modeling of fine details such as tip links at high resolutions , and ( 3 ) it corresponds to a robotic setup , so that learned representations can be used for control and reinforcement learning in simulation and in the real world . The scene comprises a robot finger with three joints that can be controlled to manipulate a cube in a bowl-shaped stage . Fig . 1 shows examples of scenes from our dataset . The data is generated from 7 different factors of variation ( FoV ) listed in Table 1 . Unlike in previous datasets , not all FoVs are independent : The end-effector ( the tip of the finger ) can collide with the floor or the cube , resulting in infeasible combinations of the factors ( see Appendix B.1 ) . We argue that such correlations are a key feature in real-world data that is not present in existing datasets . The high FoV resolution results in approximately 1.52 billion feasible states , but the dataset itself only contains one million of them ( approximately 0.065 % of all possible FoV combinations ) , realistically rendered into 128 × 128 images . Additionally , we recorded an annotated dataset under the same conditions in the real-world setup : we acquired 1,809 camera images from the same viewpoint and recorded the labels of the 7 underlying factors of variation . This dataset can be used for out-of-distribution evaluations , few-shot learning , and testing other sim2real aspects . Model architecture . When scaling disentangled representation learning to more complex datasets , such as the one proposed here , one of the main bottlenecks in current VAE-based approaches is the flexibility of the encoder and decoder networks . In particular , using the architecture from Locatello et al . ( 2019b ) , none of the models we trained correctly captured all factors of variation or yielded high-quality reconstructions . While the increased image resolution already presents a challenge , the main practical issue in our new dataset is the level of detail that needs to be modeled . In particular , we identified the cube rotation and the lower joint position to be the factors of variation that were the hardest to capture . This is likely because these factors only produce relatively small changes in the image and hence the reconstruction error . To overcome these issues , we propose a deeper and wider neural architecture than those commonly used in the disentangled representation learning literature , where the encoder and decoder typically have 4 convolutional and 2 fully-connected layers . Our encoder consists of a convolutional layer , 10 residual blocks , and 2 fully-connected layers . Some residual blocks are followed by 1x1 convolutions that change the number of channels , or by average pooling that downsamples the tensors by a factor of 2 along the spatial dimensions . Each residual block consists of two 3x3 convolutions with a leaky ReLU nonlinearity , and a learnable scalar gating mechanism ( Bachlechner et al. , 2020 ) . Overall , the encoder has 23 convolutional layers and 2 fully connected layers . The decoder mirrors this architecture , with average pooling replaced by bilinear interpolation for upsampling . The total number of parameters is approximately 16.3M . See Appendix A for further implementation details . Experimental setup . We perform a large-scale empirical study on the simulated dataset introduced above by training 1,080 β-VAE models.2 For further experimental details we refer the reader to Appendix A . The hyperparameter sweep is defined as follows : • We train the models using either unsupervised learning or weakly supervised learning ( Locatello et al. , 2020 ) . In the weakly supervised case , a model is trained with pairs of images that differ in k factors of variation . Here we fix k = 1 as it was shown to lead to higher disentanglement by Locatello et al . ( 2020 ) . The dataset therefore consists of 500k pairs of images that differ in only one FoV . • We vary the parameter β in { 1 , 2 , 4 } , and use linear deterministic warm-up ( Bowman et al. , 2015 ; Sønderby et al. , 2016 ) over the first { 0 , 10000 , 50000 } training steps . • The latent space dimensionality is in { 10 , 25 , 50 } . • Half of the models are trained with additive noise in the input image . This choice is mo- tivated by the fact that adding noise to the input of neural networks has been shown to be beneficial for out-of-distribution generalization ( Sietsma & Dow , 1991 ; Bishop , 1995 ) . • Each of the 108 resulting configurations is trained with 10 random seeds . Can we scale up disentanglement learning ? Most of the trained VAEs in our empirical study fully capture all the elements of a scene , correctly model heavy occlusions , and generate detailed , 2Training these models requires approximately 2.8 GPU years on NVIDIA Tesla V100 PCIe . high-quality samples and reconstructions ( see Appendix B.2 ) . From visual inspections such as the latent traversals in Fig . 2 , we observe that many trained models fully disentangle the ground-truth factors of variation . This , however , appears to only be possible in the weakly supervised scenario . The fact that models trained without supervision learn entangled representations is in line with the impossibility result for the unsupervised learning of disentangled representations from Locatello et al . ( 2019b ) . Latent traversals from a selection of models with different degrees of disentanglement are presented in Appendix B.3 . Interestingly , the high-disentanglement models seem to correct for correlations and interpolate infeasible states , i.e . the fingertip traverses through the cube or the floor . Summary : The proposed architecture can scale disentanglement learning to more realistic settings , but a form of weak supervision is necessary to achieve high disentanglement . How useful are common disentanglement metrics in realistic scenarios ? The violin plot in Fig . 3 ( left ) shows that DCI and MIG measure high disentanglement under weak supervision and lower disentanglement in the unsupervised setting . This is consistent with our qualitative conclusion from visual inspection of the models ( Appendix B.3 ) and with the aforementioned impossibility result . Many of the models trained with weak supervision exhibit a very high DCI score ( 29 % of them have > 99 % DCI , some of them up to 99.89 % ) . SAP and Modularity appear to be ineffective at capturing disentanglement in this setting , as also observed by Locatello et al . ( 2019b ) . Finally , note that the BetaVAE and FactorVAE metrics are not straightforward to be evaluated on datasets that do not contain all possible combinations of factor values . According to Fig . 3 ( right ) , DCI and MIG strongly correlate with test accuracy of GBT classifiers predicting the FoVs . In the weakly supervised setting , these metrics are strongly correlated with the ELBO ( positively ) and with the reconstruction loss ( negatively ) . We illustrate these relationships in more detail in Appendix B.4 . Such correlations were also observed by Locatello et al . ( 2020 ) on significantly less complex datasets , and can be exploited for unsupervised model selection : these unsupervised metrics can be used as proxies for disentanglement metrics , which would require fully labeled data . Summary : DCI and MIG appear to be useful disentanglement metrics in realistic scenarios , whereas other metrics seem to fall short of capturing disentanglement or can be difficult to compute . When using weak supervision , we can select disentangled models with unsupervised metrics .
The paper presents a new, more complex, dataset for the use of disentangled representation learning. The dataset is based on real and simulated images of the trifinger robot platform. There are 7 factors of variation with high-resolution measurements of these factors. The dataset contains over 1 million simulated images and another ~1000 annotated images of a real trifinger robot arm.
SP:9da1f7bd8d52bdd28891ec3e0c7eef7d367a5eea
On the Transfer of Disentangled Representations in Realistic Settings
Learning meaningful representations that disentangle the underlying structure of the data generating process is considered to be of key importance in machine learning . While disentangled representations were found to be useful for diverse tasks such as abstract reasoning and fair classification , their scalability and real-world impact remain questionable . We introduce a new high-resolution dataset with 1M simulated images and over 1,800 annotated real-world images of the same setup . In contrast to previous work , this new dataset exhibits correlations , a complex underlying structure , and allows to evaluate transfer to unseen simulated and realworld settings where the encoder i ) remains in distribution or ii ) is out of distribution . We propose new architectures in order to scale disentangled representation learning to realistic high-resolution settings and conduct a large-scale empirical study of disentangled representations on this dataset . We observe that disentanglement is a good predictor for out-of-distribution ( OOD ) task performance . 1 INTRODUCTION Disentangled representations hold the promise of generalization to unseen scenarios ( Higgins et al. , 2017b ) , increased interpretability ( Adel et al. , 2018 ; Higgins et al. , 2018 ) and faster learning on downstream tasks ( van Steenkiste et al. , 2019 ; Locatello et al. , 2019a ) . However , most of the focus in learning disentangled representations has been on small synthetic datasets whose ground truth factors exhibit perfect independence by design . More realistic settings remain largely unexplored . We hypothesize that this is because real-world scenarios present several challenges that have not been extensively studied to date . Important challenges are scaling ( much higher resolution in observations and factors ) , occlusions , and correlation between factors . Consider , for instance , a robotic arm moving a cube : Here , the robot arm can occlude parts of the cube , and its end-effector position exhibits correlations with the cube ’ s position and orientation , which might be problematic for common disentanglement learners ( Träuble et al. , 2020 ) . Another difficulty is that we typically have only limited access to ground truth labels in the real world , which requires robust frameworks for model selection when no or only weak labels are available . ∗Equal contribution . Correspondence to : < adit @ dtu.dk > , < frederik.traeuble @ tuebingen.mpg.de > . †Work done during an internship at the Max Planck Institute for Intelligent Systems . The goal of this work is to provide a path towards disentangled representation learning in realistic settings . First , we argue that this requires a new dataset that captures the challenges mentioned above . We propose a dataset consisting of simulated observations from a scene where a robotic arm interacts with a cube in a stage ( see Fig . 1 ) . This setting exhibits correlations and occlusions that are typical in real-world robotics . Second , we show how to scale the architecture of disentanglement methods to perform well on this dataset . Third , we extensively analyze the usefulness of disentangled representations in terms of out-of-distribution downstream generalization , both in terms of held-out factors of variation and sim2real transfer . In fact , our dataset is based on the TriFinger robot from Wüthrich et al . ( 2020 ) , which can be built to test the deployment of models in the real world . While the analysis in this paper focuses on the transfer and generalization of predictive models , we hope that our dataset may serve as a benchmark to explore the usefulness of disentangled representations in real-world control tasks . The contributions of this paper can be summarized as follows : • We propose a new dataset for disentangled representation learning , containing 1M simulated high-resolution images from a robotic setup , with seven partly correlated factors of variation . Additionally , we provide a dataset of over 1,800 annotated images from the corresponding real-world setup that can be used for challenging sim2real transfer tasks . These datasets are made publicly available.1 • We propose a new neural architecture to successfully scale VAE-based disentanglement learning approaches to complex datasets . • We conduct a large-scale empirical study on generalization to various transfer scenarios on this challenging dataset . We train 1,080 models using state-of-the-art disentanglement methods and discover that disentanglement is a good predictor for out-of-distribution ( OOD ) performance of downstream tasks . 2 RELATED WORK . Disentanglement methods . Most state-of-the-art disentangled representation learning approaches are based on the framework of variational autoencoders ( VAEs ) ( Kingma & Welling , 2014 ; Rezende et al. , 2014 ) . A ( high-dimensional ) observation x is assumed to be generated according to the latent variable model pθ ( x|z ) p ( z ) where the latent variables z have a fixed prior p ( z ) . The generative model pθ ( x|z ) and the approximate posterior distribution qφ ( z|x ) are typically parameterized by neural networks , which are optimized by maximizing the evidence lower bound ( ELBO ) : LV AE = Eqφ ( z|x ) [ log pθ ( x|z ) ] −DKL ( qφ ( z|x ) ‖p ( z ) ) ≤ log p ( x ) ( 1 ) As the above objective does not enforce any structure on the latent space except for some similarity to p ( z ) , different regularization strategies have been proposed , along with evaluation metrics to gauge the disentanglement of the learned representations ( Higgins et al. , 2017a ; Kim & Mnih , 2018 ; Burgess et al. , 2018 ; Kumar et al. , 2018 ; Chen et al. , 2018 ; Eastwood & Williams , 2018 ) . Recently , Locatello et al . ( 2019b , Theorem 1 ) showed that the purely unsupervised learning of disentangled representations is impossible . This limitation can be overcome without the need for explicitly labeled data by introducing weak labels ( Locatello et al. , 2020 ; Shu et al. , 2019 ) . Ideas related to disentangling the factors of variation date back to the non-linear ICA literature ( Comon , 1994 ; Hyvärinen & Pajunen , 1999 ; Bach & Jordan , 2002 ; Jutten & Karhunen , 2003 ; Hyvarinen & Morioka , 2016 ; Hyvarinen et al. , 2019 ; Gresele et al. , 2019 ) . Recent work combines non-linear ICA with disentanglement ( Khemakhem et al. , 2020 ; Sorrenson et al. , 2020 ; Klindt et al. , 2020 ) . Evaluating disentangled representations . The BetaVAE ( Higgins et al. , 2017a ) and FactorVAE ( Kim & Mnih , 2018 ) scores measure disentanglement by performing an intervention on the factors of variation and predicting which factor was intervened on . The Mutual Information Gap ( MIG ) ( Chen et al. , 2018 ) , Modularity ( Ridgeway & Mozer , 2018 ) , DCI Disentanglement ( Eastwood & Williams , 2018 ) and SAP scores ( Kumar et al. , 2018 ) are based on matrices relating factors of variation and codes ( e.g . pairwise mutual information , feature importance and predictability ) . 1http : //people.tuebingen.mpg.de/ei-datasets/iclr_transfer_paper/robot_ finger_datasets.tar ( 6.18 GB ) Datasets for disentanglement learning . dSprites ( Higgins et al. , 2017a ) , which consists of binary low-resolution 2D images of basic shapes , is one of the most commonly used synthetic datasets for disentanglement learning . Color-dSprites , Noisy-dSprites , and Scream-dSprites are slightly more challenging variants of dSprites . The SmallNORB dataset contains toy images rendered under different lighting conditions , elevations and azimuths ( LeCun et al. , 2004 ) . Cars3D ( Reed et al. , 2015 ) exhibits different car models from Fidler et al . ( 2012 ) under different camera viewpoints . 3dshapes is a popular dataset of simple shapes in a 3D scene ( Kim & Mnih , 2018 ) . Finally , Gondal et al . ( 2019 ) proposed MPI3D , containing images of physical 3D objects with seven factors of variation , such as object color , shape , size and position available in a simulated , simulated and highly realistic rendered simulated variant . Except MPI3D which has over 1M images , the size of the other datasets is limited with only 17 , 568 to 737 , 280 images . All of the above datasets exhibit perfect independence of all factors , the number of possible states is on the order of 1M or less , and due to their static setting they do not allow for dynamic downstream tasks such as reinforcement learning . In addition , except for SmallNORB , the image resolution is limited to 64x64 and there are no occlusions . Other related work . Locatello et al . ( 2020 ) probed the out-of-distribution generalization of downstream tasks trained on disentangled representations . However , these representations are trained on the entire dataset . Generalization and transfer performance especially for representation learning has likewise been studied in Dayan ( 1993 ) ; Muandet et al . ( 2013 ) ; Heinze-Deml & Meinshausen ( 2017 ) ; Rojas-Carulla et al . ( 2018 ) ; Suter et al . ( 2019 ) ; Li et al . ( 2018 ) ; Arjovsky et al . ( 2019 ) ; Krueger et al . ( 2020 ) ; Gowal et al . ( 2020 ) . For the role of disentanglement in causal representation learning we refer to the recent overview by Schölkopf et al . ( 2021 ) . Träuble et al . ( 2020 ) systematically investigated the effects of correlations between factors of variation on disentangled representation learners . Transfer of learned disentangled representations from simulation to the real world has been recently investigated by Gondal et al . ( 2019 ) on the MPI3D dataset , and previously by Higgins et al . ( 2017b ) in the context of reinforcement learning . Sim2real transfer is of major interest in the robotic learning community , because of limited data and supervision in the real world ( Tobin et al. , 2017 ; Rusu et al. , 2017 ; Peng et al. , 2018 ; James et al. , 2019 ; Yan et al. , 2020 ; Andrychowicz et al. , 2020 ) . 3 SCALING DISENTANGLED REPRESENTATIONS TO COMPLEX SCENARIOS . A new challenging dataset . Simulated images in our dataset are derived from the trifinger robot platform introduced by Wüthrich et al . ( 2020 ) . The motivation for choosing this setting is that ( 1 ) it is challenging due to occlusions , correlations , and other difficulties encountered in robotic settings , ( 2 ) it requires modeling of fine details such as tip links at high resolutions , and ( 3 ) it corresponds to a robotic setup , so that learned representations can be used for control and reinforcement learning in simulation and in the real world . The scene comprises a robot finger with three joints that can be controlled to manipulate a cube in a bowl-shaped stage . Fig . 1 shows examples of scenes from our dataset . The data is generated from 7 different factors of variation ( FoV ) listed in Table 1 . Unlike in previous datasets , not all FoVs are independent : The end-effector ( the tip of the finger ) can collide with the floor or the cube , resulting in infeasible combinations of the factors ( see Appendix B.1 ) . We argue that such correlations are a key feature in real-world data that is not present in existing datasets . The high FoV resolution results in approximately 1.52 billion feasible states , but the dataset itself only contains one million of them ( approximately 0.065 % of all possible FoV combinations ) , realistically rendered into 128 × 128 images . Additionally , we recorded an annotated dataset under the same conditions in the real-world setup : we acquired 1,809 camera images from the same viewpoint and recorded the labels of the 7 underlying factors of variation . This dataset can be used for out-of-distribution evaluations , few-shot learning , and testing other sim2real aspects . Model architecture . When scaling disentangled representation learning to more complex datasets , such as the one proposed here , one of the main bottlenecks in current VAE-based approaches is the flexibility of the encoder and decoder networks . In particular , using the architecture from Locatello et al . ( 2019b ) , none of the models we trained correctly captured all factors of variation or yielded high-quality reconstructions . While the increased image resolution already presents a challenge , the main practical issue in our new dataset is the level of detail that needs to be modeled . In particular , we identified the cube rotation and the lower joint position to be the factors of variation that were the hardest to capture . This is likely because these factors only produce relatively small changes in the image and hence the reconstruction error . To overcome these issues , we propose a deeper and wider neural architecture than those commonly used in the disentangled representation learning literature , where the encoder and decoder typically have 4 convolutional and 2 fully-connected layers . Our encoder consists of a convolutional layer , 10 residual blocks , and 2 fully-connected layers . Some residual blocks are followed by 1x1 convolutions that change the number of channels , or by average pooling that downsamples the tensors by a factor of 2 along the spatial dimensions . Each residual block consists of two 3x3 convolutions with a leaky ReLU nonlinearity , and a learnable scalar gating mechanism ( Bachlechner et al. , 2020 ) . Overall , the encoder has 23 convolutional layers and 2 fully connected layers . The decoder mirrors this architecture , with average pooling replaced by bilinear interpolation for upsampling . The total number of parameters is approximately 16.3M . See Appendix A for further implementation details . Experimental setup . We perform a large-scale empirical study on the simulated dataset introduced above by training 1,080 β-VAE models.2 For further experimental details we refer the reader to Appendix A . The hyperparameter sweep is defined as follows : • We train the models using either unsupervised learning or weakly supervised learning ( Locatello et al. , 2020 ) . In the weakly supervised case , a model is trained with pairs of images that differ in k factors of variation . Here we fix k = 1 as it was shown to lead to higher disentanglement by Locatello et al . ( 2020 ) . The dataset therefore consists of 500k pairs of images that differ in only one FoV . • We vary the parameter β in { 1 , 2 , 4 } , and use linear deterministic warm-up ( Bowman et al. , 2015 ; Sønderby et al. , 2016 ) over the first { 0 , 10000 , 50000 } training steps . • The latent space dimensionality is in { 10 , 25 , 50 } . • Half of the models are trained with additive noise in the input image . This choice is mo- tivated by the fact that adding noise to the input of neural networks has been shown to be beneficial for out-of-distribution generalization ( Sietsma & Dow , 1991 ; Bishop , 1995 ) . • Each of the 108 resulting configurations is trained with 10 random seeds . Can we scale up disentanglement learning ? Most of the trained VAEs in our empirical study fully capture all the elements of a scene , correctly model heavy occlusions , and generate detailed , 2Training these models requires approximately 2.8 GPU years on NVIDIA Tesla V100 PCIe . high-quality samples and reconstructions ( see Appendix B.2 ) . From visual inspections such as the latent traversals in Fig . 2 , we observe that many trained models fully disentangle the ground-truth factors of variation . This , however , appears to only be possible in the weakly supervised scenario . The fact that models trained without supervision learn entangled representations is in line with the impossibility result for the unsupervised learning of disentangled representations from Locatello et al . ( 2019b ) . Latent traversals from a selection of models with different degrees of disentanglement are presented in Appendix B.3 . Interestingly , the high-disentanglement models seem to correct for correlations and interpolate infeasible states , i.e . the fingertip traverses through the cube or the floor . Summary : The proposed architecture can scale disentanglement learning to more realistic settings , but a form of weak supervision is necessary to achieve high disentanglement . How useful are common disentanglement metrics in realistic scenarios ? The violin plot in Fig . 3 ( left ) shows that DCI and MIG measure high disentanglement under weak supervision and lower disentanglement in the unsupervised setting . This is consistent with our qualitative conclusion from visual inspection of the models ( Appendix B.3 ) and with the aforementioned impossibility result . Many of the models trained with weak supervision exhibit a very high DCI score ( 29 % of them have > 99 % DCI , some of them up to 99.89 % ) . SAP and Modularity appear to be ineffective at capturing disentanglement in this setting , as also observed by Locatello et al . ( 2019b ) . Finally , note that the BetaVAE and FactorVAE metrics are not straightforward to be evaluated on datasets that do not contain all possible combinations of factor values . According to Fig . 3 ( right ) , DCI and MIG strongly correlate with test accuracy of GBT classifiers predicting the FoVs . In the weakly supervised setting , these metrics are strongly correlated with the ELBO ( positively ) and with the reconstruction loss ( negatively ) . We illustrate these relationships in more detail in Appendix B.4 . Such correlations were also observed by Locatello et al . ( 2020 ) on significantly less complex datasets , and can be exploited for unsupervised model selection : these unsupervised metrics can be used as proxies for disentanglement metrics , which would require fully labeled data . Summary : DCI and MIG appear to be useful disentanglement metrics in realistic scenarios , whereas other metrics seem to fall short of capturing disentanglement or can be difficult to compute . When using weak supervision , we can select disentangled models with unsupervised metrics .
The authors proposed a unique learning scheme for representation disentanglement. However, unlike infoGAN or ACGAN which explicitly learn disjoint feature representations for describing the attributes of interest (via unsupervised and supervised settings, respectively), the authors chose to address this task in a questionable "weakly supervised setting". More specifically, the authors chose to train AE-like model using pairwise images, which the difference between each pair of the inputs is only associated with one attribute of interest (e.g., angle, position, etc.).
SP:9da1f7bd8d52bdd28891ec3e0c7eef7d367a5eea
Zero-shot Transfer Learning for Gray-box Hyper-parameter Optimization
1 INTRODUCTION . Within the research community , the concentration of efforts towards solving the problem of hyperparameter optimization ( HPO ) has been mainly through sequential model-based optimization ( SMBO ) , i.e . iteratively fitting a probabilistic response model , typically a Gaussian process ( Rasmussen ( 2003 ) ) , to a history of observations of losses of the target response , and suggesting the next hyper-parameters via a policy , acquisition function , that balances exploration and exploitation by leveraging the uncertainty in the posterior distribution ( Jones et al . ( 1998 ) ; Wistuba et al . ( 2018 ) ; Snoek et al . ( 2012 ) ) . However , even when solutions are defined in conjunction with transfer learning techniques ( Bardenet et al . ( 2013 ) ; Wistuba et al . ( 2016 ) ; Feurer et al . ( 2015 ) ) , the performance of SMBO is heavily affected by the choice of the initial hyper-parameters . Furthermore , SMBO is sequential by design and additional acceleration by parallelization is not possible . In this paper , we present the problem of zero-shot hyper-parameter optimization as a meta-learning objective that exploits dataset information as part of the surrogate model . Instead of treating HPO as a black-box function , operating blindly on the response of the hyper-parameters alone , we treat it as a gray-box function ( Whitley et al . ( 2016 ) ) , by capturing the relationship among the dataset meta-features and hyper-parameters to approximate the response model . In this paper , we propose a novel formulation of HPO as a conditional gray-box function optimization problem , Section 4 , that allows us to regress from the dataset/hyper-parameter pair directly onto the response . Driven by the assumption that similar datasets should have similar response approximations , we introduce an additional data-driven similarity regularization objective to penalize the difference between the predicted response of similar datasets . In Section 5 , we perform an extensive battery of experiments that highlight the capacity of our universal model to serve as a solution for : ( 1 ) zero-shot HPO as a stand-alone task , ( 2 ) zero-shot as an initialization strategy for Bayesian Optimization ( BO ) , ( 3 ) transferable sequential model-based optimization . A summary of our contributions is : • a formulation of the zero-shot hyper-parameter optimization problem in which our response model predicts upfront the full set of hyper-parameter configurations to try , without access to observations of losses of the target response ; • a novel multi-task optimization objective that models the inherent similarity between datasets and their respective responses ; • three new meta-datasets with different search spaces and cardinalities to facilitate the experiments and serve as a benchmark for future work ; • an empirical demonstration of the performance of our approach through a battery of experiments that address the aforementioned research aspects , and a comparison against state-of-the-art HPO solutions for transfer-learning . 2 RELATED WORK . The straightforward zero-shot approaches for HPO consist of random search ( Bergstra & Bengio ( 2012 ) ) , or simply selecting hyper-parameters that perform well on general tasks ( Brazdil et al . ( 2003 ) ) . Some recent work has also shown that simply selecting random hyper-parameters from a restricted search space significantly outperforms existing solutions , and improves the performance of conventional SMBO approaches ( Perrone et al . ( 2019 ) ) . The restricted search space is created by eliminating regions that are further away from the best hyper-parameters of the training tasks . Another prominent direction for zero-shot HPO depends heavily on engineered meta-features , i.e . dataset characteristics ( Vanschoren ( 2018 ) ) , to measure the similarity of datasets . Following the assumption that the responses of similar datasets behave similarly to the hyper-parameters , it has been shown that even the simplest of meta-features ( Bardenet et al . ( 2013 ) ) improve the performance of single task BO algorithms ( Feurer et al . ( 2014 ; 2015 ) ) . The target response is initialized with the top-performing hyper-parameters of the dataset nearest neighbor in the meta-feature space . The shortcomings of using engineered meta-features are that they are hard to define ( Leite & Brazdil ( 2005 ) ) , and are often selected through trial-and-error or expert domain knowledge . As a remedy , replacing engineered meta-features with learned meta-features ( Jomaa et al . ( 2019 ) ) compensates for such limitations , by producing expressive meta-features agnostic to any meta-task , such as HPO . Zero-shot HPO is also posed as an optimization problem that aims to minimize the meta-loss over a collection of datasets ( Wistuba et al . ( 2015a ) ) by replacing the discrete minimum function with a differentiable softmin function as an approximation . The initial configurations boost the single task BO without any meta-features . In ( Wistuba et al . ( 2015b ) ) , hyper-parameter combinations are assigned a static ranking based on the cumulative average normalized error , and dataset similarity is estimated based on the relative ranking of these combinations . Winkelmolen et al . ( 2020 ) introduce a Bayesian Optimization solution for zero-shot HPO by iteratively fitting a surrogate model over the observed responses of different tasks , and selecting the next hyper-parameters and datasets that minimize the aggregated observed loss . Aside from zero-shot HPO , transfer learning is employed by learning better response models ( Wistuba et al . ( 2016 ) ) based on the similarity of the response . Feurer et al . ( 2018 ) propose an ensemble model for BO by building the target response model as a weighted sum of the predictions of base models as well as the target model . In addition to the transferable response models , Volpp et al . ( 2019 ) design a transferable acquisition function as a policy for hyper-parameter optimization defined in a reinforcement learning framework . As a replacement to the standard Gaussian process , Perrone et al . ( 2018 ) train a multi-task adaptive Bayesian linear regression model with a shared feature extractor that provides context information for each independent task . In contrast to the literature , we formulate the problem of zero-shot HPO as a gray-box function optimization problem , by designing a universal response model defined over the combined domain of datasets and hyper-parameters . We rely on the embeddings to estimate the similarities across datasets and design a novel multi-task optimization objective to regress directly on the response . This allows us to delineate from the complexity paired with Bayesian uncertainty , as well as the trouble of engineering similarity measures . 3 HYPER-PARAMETER OPTIMIZATION . Consider a dataset D = { ( x ( Train ) , y ( Train ) ) , ( x ( Val ) , y ( Val ) ) , ( x ( Test ) , y ( Test ) ) } for a supervised learning task , with training , validation and test splits of predictors x ∈ X and targets y ∈ Y . We aim at training a parametric approximation of the target using ŷ : = f ( θ , λ ) : X → Y , where θ ∈ Θ denotes the parameters and λ ∈ Λ its hyper-parameters , by minimizing a loss function L : Y × Y → R as : λ∗ = arg min λ∈Λ L ( y ( Val ) , f ( x ( Val ) ; θ∗ , λ ) ) s.t . θ∗ = arg min θ∈Θ L ( y ( Train ) , f ( x ( Train ) ; θ , λ ) ) ( 1 ) We hereafter denote the validation error as the response ` ( λ ) : = L ( y ( Val ) , f ( x ( Val ) ; θ∗ , λ ) ) . Unfortunately , a direct optimization of the response ` ( λ ) in terms of λ is not trivial , because θ∗ is the result of the minimization problem and its gradients with respect to λ are not easy to compute . Instead , in order to learn the optimal hyper-parameters λ we train a probabilistic surrogate ˆ̀ ( λ ; β ) : Λ× B → R parameterized by β ∈ B , with B as the space of response model parameters , that minimizes the log-likelihood of approximating the response ` ( λ ) over a set of K evaluations S : = { ( λ1 , ` ( λ1 ) ) , . . . , ( λK , ` ( λK ) ) } . We denote P as the probability of estimating the response given a surrogate model . Given the surrogate , the next hyper-parameter to be evaluated λ ( next ) is computed by maximizing an acquisition function A ( e.g . EI ( Močkus ( 1975 ) ) as : λ ( next ) : = arg max λ∈Λ A ( ˆ̀ ( λ ; β∗ ) ) s.t . β∗ : = arg min β∈B K∑ k=1 lnP ( ` ( λk ) , ˆ̀ ( λk ; β ) ) ( 2 ) 4 META-LEARNING OF CONDITIONAL GRAY-BOX SURROGATES . Let us define a collection of T datasets as { D ( 1 ) , . . . , D ( T ) } and let ` ( t ) ( λ ) measure the response of the hyper-parameter λ on the t-th dataset D ( t ) . Furthermore , assume we have previously evaluated K ( t ) many hyper-parameters λ ( t ) k , k ∈ { 1 , . . . , K ( t ) } on that particular dataset . We condition the surrogate ˆ̀ to capture the characteristics of the t-th dataset , by taking as input the meta-features representation of the dataset as φ ( t ) . Therefore , a dataset-aware surrogate can be trained using meta-learning over a cumulative objective function O ( β ) as : O ( β ) : = T∑ t=1 K ( t ) ∑ k=1 ( ` ( t ) ( λ ( t ) k ) − ˆ̀ ( λ ( t ) k , φ ( t ) ; β ) ) 2 ( 3 ) 4.1 THE META-FEATURE EXTRACTOR . Introducing engineered meta-features has had a significant impact on hyper-parameter optimization . However , learning meta-features across datasets of varying schema in a task-agnostic setting provides more representative characteristics than to rely on hard-to-tune empirical estimates . The meta-feature extractor is a set-based function ( Zaheer et al . ( 2017 ) ) that presents itself as an extended derivation of the Kolmogorov-Arnold representation theorem ( Krková ( 1992 ) ) , which states that a multi-variate function φ can be defined as an aggregation of univariate functions over single variables , Appendix B . Each supervised ( tabular ) dataset D ( t ) : = ( x ( t ) , y ( t ) ) consists of instances x ( t ) ∈ X ∈ RN×M and targets y ( t ) ∈ Y ∈ RN×C such that N , M and C represent the number of instances , predictors and targets respectively . The dataset can be further represented as a set of smaller components , set of sets , D ( t ) = { ( x ( t ) i , m , y ( t ) i , c ) | m ∈ { 1 , . . . , M } , i ∈ { 1 , . . . , N } , c ∈ { 1 , . . . , C } } . A tabular dataset composed of columns ( predictors , targets ) and rows ( instances ) is reduced to single predictor-target pairs instead of an instance-target pairs . Based on this representation , a meta-feature extractor parameterized as a neural network ( Jomaa et al . ( 2019 ) ) , is formulated in Equation 4 . For simplicity of notation , we drop the superscript ( t ) unless needed . φ ( D ) = h ( 1 MC M∑ m=1 C∑ c=1 g ( 1 N N∑ i=1 f ( xi , m , yi , c ) ) ) ( 4 ) with f : R2 → RKf , g : RKf → RKg and h : RKg → RK represented by neural networks with Kf , Kg , and K output units , respectively . This set-based formulation captures the correlation between each variable ( predictor ) and its assigned target and is permutation-invariant , i.e . the output is unaffected by the ordering of the pairs in the set . Other set-based functions such as ( Edwards & Storkey ( 2016 ) ; Lee et al . ( 2019 ) ) can also be used for meta-feature extraction , however , we focus on this deep-set formulation ( Jomaa et al . ( 2019 ) ) because it is proven to work properly for hyper-parameter optimization .
The authors propose a new zero-shot hyper-parameter optimization method based-on the meta-learning framework. The proposed method incorporates two ideas from the meta-learning framework namely the task similarity based on the meta-features and the dataset identification. The former idea is used to achieve the requirement that responses to similar data sets should be similar.The latter idea has the role of preventing data of dissimilar tasks from being embedded in close proximity in the meta-feature space.
SP:201c4028ac02743edfeb90aca191850f67d61445
Zero-shot Transfer Learning for Gray-box Hyper-parameter Optimization
1 INTRODUCTION . Within the research community , the concentration of efforts towards solving the problem of hyperparameter optimization ( HPO ) has been mainly through sequential model-based optimization ( SMBO ) , i.e . iteratively fitting a probabilistic response model , typically a Gaussian process ( Rasmussen ( 2003 ) ) , to a history of observations of losses of the target response , and suggesting the next hyper-parameters via a policy , acquisition function , that balances exploration and exploitation by leveraging the uncertainty in the posterior distribution ( Jones et al . ( 1998 ) ; Wistuba et al . ( 2018 ) ; Snoek et al . ( 2012 ) ) . However , even when solutions are defined in conjunction with transfer learning techniques ( Bardenet et al . ( 2013 ) ; Wistuba et al . ( 2016 ) ; Feurer et al . ( 2015 ) ) , the performance of SMBO is heavily affected by the choice of the initial hyper-parameters . Furthermore , SMBO is sequential by design and additional acceleration by parallelization is not possible . In this paper , we present the problem of zero-shot hyper-parameter optimization as a meta-learning objective that exploits dataset information as part of the surrogate model . Instead of treating HPO as a black-box function , operating blindly on the response of the hyper-parameters alone , we treat it as a gray-box function ( Whitley et al . ( 2016 ) ) , by capturing the relationship among the dataset meta-features and hyper-parameters to approximate the response model . In this paper , we propose a novel formulation of HPO as a conditional gray-box function optimization problem , Section 4 , that allows us to regress from the dataset/hyper-parameter pair directly onto the response . Driven by the assumption that similar datasets should have similar response approximations , we introduce an additional data-driven similarity regularization objective to penalize the difference between the predicted response of similar datasets . In Section 5 , we perform an extensive battery of experiments that highlight the capacity of our universal model to serve as a solution for : ( 1 ) zero-shot HPO as a stand-alone task , ( 2 ) zero-shot as an initialization strategy for Bayesian Optimization ( BO ) , ( 3 ) transferable sequential model-based optimization . A summary of our contributions is : • a formulation of the zero-shot hyper-parameter optimization problem in which our response model predicts upfront the full set of hyper-parameter configurations to try , without access to observations of losses of the target response ; • a novel multi-task optimization objective that models the inherent similarity between datasets and their respective responses ; • three new meta-datasets with different search spaces and cardinalities to facilitate the experiments and serve as a benchmark for future work ; • an empirical demonstration of the performance of our approach through a battery of experiments that address the aforementioned research aspects , and a comparison against state-of-the-art HPO solutions for transfer-learning . 2 RELATED WORK . The straightforward zero-shot approaches for HPO consist of random search ( Bergstra & Bengio ( 2012 ) ) , or simply selecting hyper-parameters that perform well on general tasks ( Brazdil et al . ( 2003 ) ) . Some recent work has also shown that simply selecting random hyper-parameters from a restricted search space significantly outperforms existing solutions , and improves the performance of conventional SMBO approaches ( Perrone et al . ( 2019 ) ) . The restricted search space is created by eliminating regions that are further away from the best hyper-parameters of the training tasks . Another prominent direction for zero-shot HPO depends heavily on engineered meta-features , i.e . dataset characteristics ( Vanschoren ( 2018 ) ) , to measure the similarity of datasets . Following the assumption that the responses of similar datasets behave similarly to the hyper-parameters , it has been shown that even the simplest of meta-features ( Bardenet et al . ( 2013 ) ) improve the performance of single task BO algorithms ( Feurer et al . ( 2014 ; 2015 ) ) . The target response is initialized with the top-performing hyper-parameters of the dataset nearest neighbor in the meta-feature space . The shortcomings of using engineered meta-features are that they are hard to define ( Leite & Brazdil ( 2005 ) ) , and are often selected through trial-and-error or expert domain knowledge . As a remedy , replacing engineered meta-features with learned meta-features ( Jomaa et al . ( 2019 ) ) compensates for such limitations , by producing expressive meta-features agnostic to any meta-task , such as HPO . Zero-shot HPO is also posed as an optimization problem that aims to minimize the meta-loss over a collection of datasets ( Wistuba et al . ( 2015a ) ) by replacing the discrete minimum function with a differentiable softmin function as an approximation . The initial configurations boost the single task BO without any meta-features . In ( Wistuba et al . ( 2015b ) ) , hyper-parameter combinations are assigned a static ranking based on the cumulative average normalized error , and dataset similarity is estimated based on the relative ranking of these combinations . Winkelmolen et al . ( 2020 ) introduce a Bayesian Optimization solution for zero-shot HPO by iteratively fitting a surrogate model over the observed responses of different tasks , and selecting the next hyper-parameters and datasets that minimize the aggregated observed loss . Aside from zero-shot HPO , transfer learning is employed by learning better response models ( Wistuba et al . ( 2016 ) ) based on the similarity of the response . Feurer et al . ( 2018 ) propose an ensemble model for BO by building the target response model as a weighted sum of the predictions of base models as well as the target model . In addition to the transferable response models , Volpp et al . ( 2019 ) design a transferable acquisition function as a policy for hyper-parameter optimization defined in a reinforcement learning framework . As a replacement to the standard Gaussian process , Perrone et al . ( 2018 ) train a multi-task adaptive Bayesian linear regression model with a shared feature extractor that provides context information for each independent task . In contrast to the literature , we formulate the problem of zero-shot HPO as a gray-box function optimization problem , by designing a universal response model defined over the combined domain of datasets and hyper-parameters . We rely on the embeddings to estimate the similarities across datasets and design a novel multi-task optimization objective to regress directly on the response . This allows us to delineate from the complexity paired with Bayesian uncertainty , as well as the trouble of engineering similarity measures . 3 HYPER-PARAMETER OPTIMIZATION . Consider a dataset D = { ( x ( Train ) , y ( Train ) ) , ( x ( Val ) , y ( Val ) ) , ( x ( Test ) , y ( Test ) ) } for a supervised learning task , with training , validation and test splits of predictors x ∈ X and targets y ∈ Y . We aim at training a parametric approximation of the target using ŷ : = f ( θ , λ ) : X → Y , where θ ∈ Θ denotes the parameters and λ ∈ Λ its hyper-parameters , by minimizing a loss function L : Y × Y → R as : λ∗ = arg min λ∈Λ L ( y ( Val ) , f ( x ( Val ) ; θ∗ , λ ) ) s.t . θ∗ = arg min θ∈Θ L ( y ( Train ) , f ( x ( Train ) ; θ , λ ) ) ( 1 ) We hereafter denote the validation error as the response ` ( λ ) : = L ( y ( Val ) , f ( x ( Val ) ; θ∗ , λ ) ) . Unfortunately , a direct optimization of the response ` ( λ ) in terms of λ is not trivial , because θ∗ is the result of the minimization problem and its gradients with respect to λ are not easy to compute . Instead , in order to learn the optimal hyper-parameters λ we train a probabilistic surrogate ˆ̀ ( λ ; β ) : Λ× B → R parameterized by β ∈ B , with B as the space of response model parameters , that minimizes the log-likelihood of approximating the response ` ( λ ) over a set of K evaluations S : = { ( λ1 , ` ( λ1 ) ) , . . . , ( λK , ` ( λK ) ) } . We denote P as the probability of estimating the response given a surrogate model . Given the surrogate , the next hyper-parameter to be evaluated λ ( next ) is computed by maximizing an acquisition function A ( e.g . EI ( Močkus ( 1975 ) ) as : λ ( next ) : = arg max λ∈Λ A ( ˆ̀ ( λ ; β∗ ) ) s.t . β∗ : = arg min β∈B K∑ k=1 lnP ( ` ( λk ) , ˆ̀ ( λk ; β ) ) ( 2 ) 4 META-LEARNING OF CONDITIONAL GRAY-BOX SURROGATES . Let us define a collection of T datasets as { D ( 1 ) , . . . , D ( T ) } and let ` ( t ) ( λ ) measure the response of the hyper-parameter λ on the t-th dataset D ( t ) . Furthermore , assume we have previously evaluated K ( t ) many hyper-parameters λ ( t ) k , k ∈ { 1 , . . . , K ( t ) } on that particular dataset . We condition the surrogate ˆ̀ to capture the characteristics of the t-th dataset , by taking as input the meta-features representation of the dataset as φ ( t ) . Therefore , a dataset-aware surrogate can be trained using meta-learning over a cumulative objective function O ( β ) as : O ( β ) : = T∑ t=1 K ( t ) ∑ k=1 ( ` ( t ) ( λ ( t ) k ) − ˆ̀ ( λ ( t ) k , φ ( t ) ; β ) ) 2 ( 3 ) 4.1 THE META-FEATURE EXTRACTOR . Introducing engineered meta-features has had a significant impact on hyper-parameter optimization . However , learning meta-features across datasets of varying schema in a task-agnostic setting provides more representative characteristics than to rely on hard-to-tune empirical estimates . The meta-feature extractor is a set-based function ( Zaheer et al . ( 2017 ) ) that presents itself as an extended derivation of the Kolmogorov-Arnold representation theorem ( Krková ( 1992 ) ) , which states that a multi-variate function φ can be defined as an aggregation of univariate functions over single variables , Appendix B . Each supervised ( tabular ) dataset D ( t ) : = ( x ( t ) , y ( t ) ) consists of instances x ( t ) ∈ X ∈ RN×M and targets y ( t ) ∈ Y ∈ RN×C such that N , M and C represent the number of instances , predictors and targets respectively . The dataset can be further represented as a set of smaller components , set of sets , D ( t ) = { ( x ( t ) i , m , y ( t ) i , c ) | m ∈ { 1 , . . . , M } , i ∈ { 1 , . . . , N } , c ∈ { 1 , . . . , C } } . A tabular dataset composed of columns ( predictors , targets ) and rows ( instances ) is reduced to single predictor-target pairs instead of an instance-target pairs . Based on this representation , a meta-feature extractor parameterized as a neural network ( Jomaa et al . ( 2019 ) ) , is formulated in Equation 4 . For simplicity of notation , we drop the superscript ( t ) unless needed . φ ( D ) = h ( 1 MC M∑ m=1 C∑ c=1 g ( 1 N N∑ i=1 f ( xi , m , yi , c ) ) ) ( 4 ) with f : R2 → RKf , g : RKf → RKg and h : RKg → RK represented by neural networks with Kf , Kg , and K output units , respectively . This set-based formulation captures the correlation between each variable ( predictor ) and its assigned target and is permutation-invariant , i.e . the output is unaffected by the ordering of the pairs in the set . Other set-based functions such as ( Edwards & Storkey ( 2016 ) ; Lee et al . ( 2019 ) ) can also be used for meta-feature extraction , however , we focus on this deep-set formulation ( Jomaa et al . ( 2019 ) ) because it is proven to work properly for hyper-parameter optimization .
In this papar, the authors formulated a new objective function for HBO, which included an additional regularization term based on the dataset similarity. The authors used the distance between the meta-features of selected datasets to measure this dataset similarity and assumpted that similar datasets should have similar hyper-paprameters. The experiments are complete and demonstrate the advantages of using this new optimization formulation.
SP:201c4028ac02743edfeb90aca191850f67d61445
Learning Representation in Colour Conversion
1 INTRODUCTION . Colour is an inseparable component of our conscious visual perception and its objective utility spans over a large set of tasks such as object recognition and scene segmentation ( Chirimuuta et al. , 2015 ; Gegenfurtner & Rieger , 2000 ; Wichmann et al. , 2002 ) . Consequently , colour is an ubiquitous feature in many applications : colour transfer ( Reinhard et al. , 2001 ) , colour constancy ( Chakrabarti , 2015 ) , style transfer ( Luan et al. , 2017 ) , computer graphics ( Bratkova et al. , 2009 ) , image denoising ( Dabov et al. , 2007 ) , quality assessment ( Preiss et al. , 2014 ) , to name a few . Progress in these lines requires a better understanding of colour representation and its neural encoding in deep networks . To this end , we present a novel unsupervised task : colour conversion . In our proposed framework the input-output colour space is imposed on deep autoencoders ( referred to as ColourConvNets ) that learn to efficiently compress the visual information ( Kramer , 1991 ) while transforming the input to output . Essentially , the output y for input image x is generated on the fly by a transformation y = T ( x ) , where T maps input to output colour space . This task offers a fair comparison of different colour spaces within a system that learns to minimise a loss function in the context of information bottleneck principle ( Tishby & Zaslavsky , 2015 ) . The quality of output images demonstrates whether the representation of input-output colour spaces impacts networks ’ encoding power . Furthermore , the structure of internal representation provides insights on how colour transformation is performed within a neural network . In this work , we focused on Vector Quantised Variational Autoencoder ( VQ-VAE ) ( van den Oord et al. , 2017 ) due to the discrete nature of its latent space that facilitates the analysis and interpretability of the learnt features . We thoroughly studied five commonly used colour spaces by training ColourConvNets for all combinations of input-output spaces . First , we show that ColourConvNets with a decorrelated output colour space ( e.g . CIE L * a * b ) convey information more efficiently in their compressing bottleneck , in line with the presence of colour opponency in the human visual system . This is evident qualitatively ( Figures 1 and A.1 ) and quantitatively ( evaluated with three low-level and two high-level metrics ) . Next , we present the interpretation of ColourConvNets ’ latent space by means of three methods reaching a consensus interpretation : ( i ) the colour representation in the VQ-VAEs ’ latent space is determined by the output colour space , suggesting the transformation T occurs at the encoder , ( ii ) each embedding vector in VQ-VAEs encodes a specific part of the colour space , e.g . the luminance or chromatic information , which can be modelled by a parsimonious linear transformation . 1.1 RELATED WORK . The effectiveness of different colour spaces have been investigated in a few empirical studies of deep neural networks ( DNNs ) . Information fusion over several colour spaces improved retinal medical imaging ( Fu et al. , 2019 ) . A similar strategy enhanced the robustness of face ( Li et al. , 2014 ; Larbi et al. , 2018 ) and traffic light recognition ( Cireşan et al. , 2012 ; Kim et al. , 2018 ) . This was also effective in predicting eye fixation ( Shen et al. , 2015 ) . Opponent colour spaces have been explored for applications such as style transfer ( Luan et al. , 2017 ; Gatys et al. , 2017 ) and picture colourisation ( Cheng et al. , 2015 ; Larsson et al. , 2016 ) . Most of these works are within the domain of supervised learning . The most similar approach to our proposed ColourConvNets is image colourisation as a pretext task for unsupervised visual feature learning ( Larsson et al. , 2017 ) . Initial works on colour representation in DNNs revealed object classification networks learn to decorrelate their input images ( Rafegas & Vanrell , 2018 ; Flachot & Gegenfurtner , 2018 ; Harris et al. , 2019 ) . This is a reminiscence of horizontal and ganglion cells that decorrelate retinal signal into colour-opponency before transmitting it to the visual cortex ( Schiller & Malpeli , 1977 ; Derrington et al. , 1984 ; Gegenfurtner & Kiper , 2003 ) . Another set of works reported existence of hue-sensitive units ( Engilberge et al. , 2017 ) that mainly emerge in early layers ( Bau et al. , 2017 ) . Representation of colours in deep networks at intermediate and higher layers is rather understudied . In this article , we specifically focus on the intermediate representation that emerges at the latent space of autoencoders , which to the best of our knowledge has not been reported in the literature . 2 COLOUR CONVERSION AUTOENCODERS . In this article , we propose a novel unsupervised task of colour conversion : the network ’ s output colour space is independent of its input ( see Figure 2 ) . A colour space is an arbitrary definition of colours ’ organisation in the space ( Koenderink & van Doorn , 2003 ) . Thus , the choice of transfor- mation matrix T in ColourConvNets is perfectly flexible to model any desired space , Cin T−−−−−→ Cout , ( 1 ) where Cin and Cout are the input and output colour spaces . This framework offers a controlled environment to compare colour spaces within a complex visual system . Here , we studied their effectiveness in information encoding constrained to a bottleneck . This can be extended to encompass other constraints ( such as entropy , energy , wiring , etc . ) relevant to understanding colour representation in complex visual systems . We further used this structure to compare autoencoder ’ s latent space across colour spaces aiming to decipher the intermediate colour representation within these networks . The proposed framework can also be employed in applications , e.g. , as an add-on optimisation capsule to any computer vision application ( Mosleh et al. , 2020 ) , or as a proxy task for visual understanding ( Larsson et al. , 2017 ) . 2.1 NETWORKS . We studied a particular class of VAEs—Vector Quantised Variational Autoencoder ( VQ-VAE ) ( van den Oord et al. , 2017 ) —due to the discrete nature of its latent embedding space that facilitates the analysis and interpretability of the learnt features , which distinguishes it from others ( Kingma & Welling , 2013 ) . VQ-VAE consists of three main blocks : 1 ) an encoder that processes the input data x to ze ( x ) ; 2 ) a latent embedding space { e } ∈ RK×D , with K vectors of dimensionality D , that maps ze ( x ) onto zq ( x ) by estimating the nearest vector ei to ze ( x ) ; 3 ) a decoder that reconstructs the final output x′ with a distribution p ( x|zq ( x ) ) over the input data ( see the right panel in Figure 2 ) . The loss function is defined as follows , L = log p ( x|zq ( x ) ) + ‖sg [ ze ( x ) ] − e‖22 + β‖ze ( x ) − sg [ e ] ‖22 , ( 2 ) where sg denotes the stop gradient computation that is defined as the identity during the forwardpropagation , and with zero partial derivatives during the back-propagation to refrain its update . The first term in Eq . 2 corresponds to the reconstruction loss incorporating both encoder and decoder ; the second term updates the embedding vectors ; and the third term harmonies the encoder and embedding vectors . The parameter β ∈ R is set to 0.5 in all our experiments . 2.2 COLOUR SPACES . We explored five colour spaces : RGB , LMS , CIE L * a * b * , DKL and HSV . The standard space in electronic imaging is RGB that represents colours by three additive primaries in a cubic shape . The LMS colour space corresponds to the response of human cones ( long- , middle- , and shortwavelengths ) ( Gegenfurtner & Sharpe , 1999 ) . The CIE L * a * b * colour space ( luminance , red-green and yellow-blue axes ) is designed to be perceptually uniform ( CIE , 1978 ) . The DKL colour space ( Derrington-Krauskopf-Lennie ) models the opponent responses of rhesus monkeys in the early visual system ( Derrington et al. , 1984 ) . The HSV colour space ( hue , saturation , value ) is a cylindrical representation of RGB cube designed by computer graphics . The input-output to our networks can be in any combination of these colour spaces . Effectively , our VQ-VAE models , in addition to learning efficient representation , must learn the transformation function from their input to output colour space . It is worth considering that the original images in explored datasets are in the RGB format . Therefore , one might expect a slight positive bias towards this colour space given its gamut defines the limits of other colour spaces . 3 EXPERIMENTS . We trained several instances of VQ-VAEs with distinct sizes of embedding space { e } ∈ RK×D . The training procedure was identical for all networks : trained with Adam optimiser ( Kingma & Ba , 2014 ) ( lr = 2 × 10−4 ) for 90 epochs . To isolate the influence of random variables , all networks were initialised with the same set of weights and an identical random seed was used throughout all experiments . We used ImageNet dataset ( Deng et al. , 2009 ) for training . This is a visual database of object recognition in real-world images , divided into one thousand categories . The training set contains 1.3 million images . At every epoch , we exposed the network to 100K images of size 224 × 224 of three colour channels . Figure B.1 reports the progress of loss function for various ColourConvNets . A similar pattern of convergence can be observed for all trained networks . To increase the generalisation power of our findings , we evaluated all networks on the validationset of three benchmark datasets : ImageNet ( 50K images ) , COCO ( 5K images ) , and CelebA ( ~20K images ) . COCO is a large-scale object detection and segmentation dataset ( Lin et al. , 2014 ) . CelebA contain facial attributes of celebrities ( Liu et al. , 2015 ) . We relied on two classes of evaluation1 : low-level ( Theis et al. , 2015 ) , capturing the local statistics of an image ; high-level ( Borji , 2019 ) , assessing the global content of an image . Low-level evaluation – We computed three commonly used metrics to measure the pixel-wise performance of networks : ( i ) the colour difference CIE ∆E-2000 ( Sharma et al. , 2005 ) , ( ii ) peak signalto-noise ratio ( PSNR ) , and ( iii ) structural similarity index measure ( SSIM ) ( Wang et al. , 2004 ) . High-level evaluation – Pixel-wise measures are unable to capture the global content of an image and whether semantic information remains perceptually intact . To account for this limitation , we performed a procedure similar to the standard Inception Score ( Salimans et al. , 2016 ; Borji , 2019 ) by feeding the reconstructed images to two pretrained networks ( without fine-tuning ) that perform the task of object classification , ResNet50 ( He et al. , 2016 ) , and scene segmentation , Feature Pyramid Network—FPN ( Kirillov et al. , 2019 ) . ResNet50 and FPN expect RGB inputs , thus non-RGB reconstructions were converted to RGB . The evaluation for ResNet50 is the classification accuracy on ImageNet dataset . The evaluation for FPN is the intersection over union ( IoU ) on COCO dataset .
The motivation for this paper is quite hard to understand. A VQ-VAE is directly applied to convert an image from one colour space to another one. However, the colour space transform is human-defined, usually involving linear and a few non-linear (like selecting the maximum value is HSV) procedures. In this case, the latent space of VQ-VAE should be collapsed into this simple equation easily. The analysis of this paper does not teach us any additional knowledge.
SP:9dbd1488470372dae1baf3d391124e2abac8ea53
Learning Representation in Colour Conversion
1 INTRODUCTION . Colour is an inseparable component of our conscious visual perception and its objective utility spans over a large set of tasks such as object recognition and scene segmentation ( Chirimuuta et al. , 2015 ; Gegenfurtner & Rieger , 2000 ; Wichmann et al. , 2002 ) . Consequently , colour is an ubiquitous feature in many applications : colour transfer ( Reinhard et al. , 2001 ) , colour constancy ( Chakrabarti , 2015 ) , style transfer ( Luan et al. , 2017 ) , computer graphics ( Bratkova et al. , 2009 ) , image denoising ( Dabov et al. , 2007 ) , quality assessment ( Preiss et al. , 2014 ) , to name a few . Progress in these lines requires a better understanding of colour representation and its neural encoding in deep networks . To this end , we present a novel unsupervised task : colour conversion . In our proposed framework the input-output colour space is imposed on deep autoencoders ( referred to as ColourConvNets ) that learn to efficiently compress the visual information ( Kramer , 1991 ) while transforming the input to output . Essentially , the output y for input image x is generated on the fly by a transformation y = T ( x ) , where T maps input to output colour space . This task offers a fair comparison of different colour spaces within a system that learns to minimise a loss function in the context of information bottleneck principle ( Tishby & Zaslavsky , 2015 ) . The quality of output images demonstrates whether the representation of input-output colour spaces impacts networks ’ encoding power . Furthermore , the structure of internal representation provides insights on how colour transformation is performed within a neural network . In this work , we focused on Vector Quantised Variational Autoencoder ( VQ-VAE ) ( van den Oord et al. , 2017 ) due to the discrete nature of its latent space that facilitates the analysis and interpretability of the learnt features . We thoroughly studied five commonly used colour spaces by training ColourConvNets for all combinations of input-output spaces . First , we show that ColourConvNets with a decorrelated output colour space ( e.g . CIE L * a * b ) convey information more efficiently in their compressing bottleneck , in line with the presence of colour opponency in the human visual system . This is evident qualitatively ( Figures 1 and A.1 ) and quantitatively ( evaluated with three low-level and two high-level metrics ) . Next , we present the interpretation of ColourConvNets ’ latent space by means of three methods reaching a consensus interpretation : ( i ) the colour representation in the VQ-VAEs ’ latent space is determined by the output colour space , suggesting the transformation T occurs at the encoder , ( ii ) each embedding vector in VQ-VAEs encodes a specific part of the colour space , e.g . the luminance or chromatic information , which can be modelled by a parsimonious linear transformation . 1.1 RELATED WORK . The effectiveness of different colour spaces have been investigated in a few empirical studies of deep neural networks ( DNNs ) . Information fusion over several colour spaces improved retinal medical imaging ( Fu et al. , 2019 ) . A similar strategy enhanced the robustness of face ( Li et al. , 2014 ; Larbi et al. , 2018 ) and traffic light recognition ( Cireşan et al. , 2012 ; Kim et al. , 2018 ) . This was also effective in predicting eye fixation ( Shen et al. , 2015 ) . Opponent colour spaces have been explored for applications such as style transfer ( Luan et al. , 2017 ; Gatys et al. , 2017 ) and picture colourisation ( Cheng et al. , 2015 ; Larsson et al. , 2016 ) . Most of these works are within the domain of supervised learning . The most similar approach to our proposed ColourConvNets is image colourisation as a pretext task for unsupervised visual feature learning ( Larsson et al. , 2017 ) . Initial works on colour representation in DNNs revealed object classification networks learn to decorrelate their input images ( Rafegas & Vanrell , 2018 ; Flachot & Gegenfurtner , 2018 ; Harris et al. , 2019 ) . This is a reminiscence of horizontal and ganglion cells that decorrelate retinal signal into colour-opponency before transmitting it to the visual cortex ( Schiller & Malpeli , 1977 ; Derrington et al. , 1984 ; Gegenfurtner & Kiper , 2003 ) . Another set of works reported existence of hue-sensitive units ( Engilberge et al. , 2017 ) that mainly emerge in early layers ( Bau et al. , 2017 ) . Representation of colours in deep networks at intermediate and higher layers is rather understudied . In this article , we specifically focus on the intermediate representation that emerges at the latent space of autoencoders , which to the best of our knowledge has not been reported in the literature . 2 COLOUR CONVERSION AUTOENCODERS . In this article , we propose a novel unsupervised task of colour conversion : the network ’ s output colour space is independent of its input ( see Figure 2 ) . A colour space is an arbitrary definition of colours ’ organisation in the space ( Koenderink & van Doorn , 2003 ) . Thus , the choice of transfor- mation matrix T in ColourConvNets is perfectly flexible to model any desired space , Cin T−−−−−→ Cout , ( 1 ) where Cin and Cout are the input and output colour spaces . This framework offers a controlled environment to compare colour spaces within a complex visual system . Here , we studied their effectiveness in information encoding constrained to a bottleneck . This can be extended to encompass other constraints ( such as entropy , energy , wiring , etc . ) relevant to understanding colour representation in complex visual systems . We further used this structure to compare autoencoder ’ s latent space across colour spaces aiming to decipher the intermediate colour representation within these networks . The proposed framework can also be employed in applications , e.g. , as an add-on optimisation capsule to any computer vision application ( Mosleh et al. , 2020 ) , or as a proxy task for visual understanding ( Larsson et al. , 2017 ) . 2.1 NETWORKS . We studied a particular class of VAEs—Vector Quantised Variational Autoencoder ( VQ-VAE ) ( van den Oord et al. , 2017 ) —due to the discrete nature of its latent embedding space that facilitates the analysis and interpretability of the learnt features , which distinguishes it from others ( Kingma & Welling , 2013 ) . VQ-VAE consists of three main blocks : 1 ) an encoder that processes the input data x to ze ( x ) ; 2 ) a latent embedding space { e } ∈ RK×D , with K vectors of dimensionality D , that maps ze ( x ) onto zq ( x ) by estimating the nearest vector ei to ze ( x ) ; 3 ) a decoder that reconstructs the final output x′ with a distribution p ( x|zq ( x ) ) over the input data ( see the right panel in Figure 2 ) . The loss function is defined as follows , L = log p ( x|zq ( x ) ) + ‖sg [ ze ( x ) ] − e‖22 + β‖ze ( x ) − sg [ e ] ‖22 , ( 2 ) where sg denotes the stop gradient computation that is defined as the identity during the forwardpropagation , and with zero partial derivatives during the back-propagation to refrain its update . The first term in Eq . 2 corresponds to the reconstruction loss incorporating both encoder and decoder ; the second term updates the embedding vectors ; and the third term harmonies the encoder and embedding vectors . The parameter β ∈ R is set to 0.5 in all our experiments . 2.2 COLOUR SPACES . We explored five colour spaces : RGB , LMS , CIE L * a * b * , DKL and HSV . The standard space in electronic imaging is RGB that represents colours by three additive primaries in a cubic shape . The LMS colour space corresponds to the response of human cones ( long- , middle- , and shortwavelengths ) ( Gegenfurtner & Sharpe , 1999 ) . The CIE L * a * b * colour space ( luminance , red-green and yellow-blue axes ) is designed to be perceptually uniform ( CIE , 1978 ) . The DKL colour space ( Derrington-Krauskopf-Lennie ) models the opponent responses of rhesus monkeys in the early visual system ( Derrington et al. , 1984 ) . The HSV colour space ( hue , saturation , value ) is a cylindrical representation of RGB cube designed by computer graphics . The input-output to our networks can be in any combination of these colour spaces . Effectively , our VQ-VAE models , in addition to learning efficient representation , must learn the transformation function from their input to output colour space . It is worth considering that the original images in explored datasets are in the RGB format . Therefore , one might expect a slight positive bias towards this colour space given its gamut defines the limits of other colour spaces . 3 EXPERIMENTS . We trained several instances of VQ-VAEs with distinct sizes of embedding space { e } ∈ RK×D . The training procedure was identical for all networks : trained with Adam optimiser ( Kingma & Ba , 2014 ) ( lr = 2 × 10−4 ) for 90 epochs . To isolate the influence of random variables , all networks were initialised with the same set of weights and an identical random seed was used throughout all experiments . We used ImageNet dataset ( Deng et al. , 2009 ) for training . This is a visual database of object recognition in real-world images , divided into one thousand categories . The training set contains 1.3 million images . At every epoch , we exposed the network to 100K images of size 224 × 224 of three colour channels . Figure B.1 reports the progress of loss function for various ColourConvNets . A similar pattern of convergence can be observed for all trained networks . To increase the generalisation power of our findings , we evaluated all networks on the validationset of three benchmark datasets : ImageNet ( 50K images ) , COCO ( 5K images ) , and CelebA ( ~20K images ) . COCO is a large-scale object detection and segmentation dataset ( Lin et al. , 2014 ) . CelebA contain facial attributes of celebrities ( Liu et al. , 2015 ) . We relied on two classes of evaluation1 : low-level ( Theis et al. , 2015 ) , capturing the local statistics of an image ; high-level ( Borji , 2019 ) , assessing the global content of an image . Low-level evaluation – We computed three commonly used metrics to measure the pixel-wise performance of networks : ( i ) the colour difference CIE ∆E-2000 ( Sharma et al. , 2005 ) , ( ii ) peak signalto-noise ratio ( PSNR ) , and ( iii ) structural similarity index measure ( SSIM ) ( Wang et al. , 2004 ) . High-level evaluation – Pixel-wise measures are unable to capture the global content of an image and whether semantic information remains perceptually intact . To account for this limitation , we performed a procedure similar to the standard Inception Score ( Salimans et al. , 2016 ; Borji , 2019 ) by feeding the reconstructed images to two pretrained networks ( without fine-tuning ) that perform the task of object classification , ResNet50 ( He et al. , 2016 ) , and scene segmentation , Feature Pyramid Network—FPN ( Kirillov et al. , 2019 ) . ResNet50 and FPN expect RGB inputs , thus non-RGB reconstructions were converted to RGB . The evaluation for ResNet50 is the classification accuracy on ImageNet dataset . The evaluation for FPN is the intersection over union ( IoU ) on COCO dataset .
This paper proposes to study an interesting problem of how color informaiton is structured in the variational autoencoders (VAEs). Several instances of VAEs are trained in an unsupervised manner to perform color space conversion. Both low-level and high-level evaluations are performed to study the local statistics and global content of converted images. Several interesting conclusions are drawn from the experiments that help interpret the encoding process of autoencoders.
SP:9dbd1488470372dae1baf3d391124e2abac8ea53
An empirical study of a pruning mechanism
1 INTRODUCTION . Deep learning is currently one of the most powerful machine learning methods . It requires neural network to train , which usually takes a few to hundreds times more weights than training data ( He et al. , 2016 ; Zagoruyko & Komodakis , 2016 ; Huang et al. , 2017 ; Karen & Andrew , 2015 ) . Usually , in common regimes , a greater number of weights leads to better performance ( Zagoruyko & Komodakis , 2016 ) . However , paradoxically , neural networks are also compressible . Many of the recent pruning methods aim to maximally compress the networks ( Han et al. , 2015 ; Liu et al. , 2017 ; He et al. , 2019 ; You et al. , 2019 ) , however , there are few works that investigate why and how the pruning mechanism works ( Frankle et al. , 2019 ; Elesedy et al. , 2020 ) . In this work , we empirically investigate a standard framework for network pruning : pretraining a large network and then pruning and retraining it . The framework has been commonly used based on heuristics , i.e . finding a good minima with a larger network and retaining it with careful pruning and retraining ( Han et al. , 2015 ; Liu et al. , 2017 ) . We investigate the heuristic in two parts , i.e. , one for the pretraining phase and the other for the pruning and retraining phase . For the pretraining phase , the reason for training the large network to obtain a good minima is investigated . Since the neural network is generally compressible , the pretrained large network can be pruned to a smaller one . However , a network with the same number of weights as that of the pruned network can not achieve similar performance when trained from scratch ( Frankle & Carbin , 2018 ) . We conjecture that this comes from the networks not utilizing all of their weights . Thus we hypothesize : if trained from scratch , there is a utility imbalance among the weights in neural network . For investigation , the measures for the weight utility and the utility imbalance are proposed . Thereafter , the cause of the utility imbalance and the characteristics of the weight utility in various conditions are examined . For the pruning and retraining phase , we verify the heuristic that once a good minima is obtained with the large network , it can be retained by careful pruning and retraining ( Han et al. , 2015 ; Renda et al. , 2020 ) . Our investigation is based on the loss surface visualization on a two dimensional plane formed by three points in the weight space where each point represents the pretrained network , the pruned network , and the pruned and retrained network . We examine ( 1 ) the dynamics of the network on the loss surface throughout pruning and ( 2 ) the validation accuracy of the networks over varying pruning methods and retraining methods . Contributions .. • The utility imbalance among the weights increases during optimization . • The neural networks utilize the weights in proportion to their size . • If a pretrained network is carefully pruned and retrained , then the pruned-and-retrained network shares the same loss basin with the pretrained network . 2 WEIGHT UTILITY ANALYSIS FOR THE PRETRAIN MECHANISM . Then why do we have to train a large network and then prune to a smaller one ? Why not just train the smaller one to get the performance we need ? Why is it difficult ? The investigation about the questions starts with a hypothesis : let Nlarge be a large network that does not utilize all of its weights , and thus can be easily compressed into a smaller network Npruned with minimal loss change . And let Nsmall be a network trained from scratch , whose number of weights is comparable to that ofNpruned , which is sufficient to achieve a similar level of loss to those ofNlarge orNpruned . However , Nsmall generally performs worse , because Nsmall does not utilize all of its weights either . Therefore , we hypothesize that the neural network does not utilize all of its weights when trained from scratch in general . And we refer to the phenomenon which the neural network utilize the weights unevenly as utility imbalance . Thus , Main Hypothesis . If trained from scratch , there is utility imbalance among the weights in a neural network . And we empirically measure the utility of weights as : Definition 1 ( Utility measure ) . LetW be a set of total weights in a networkN , Ws be a subset ofW , and X be a dataset . Suppose fW ( x ) and fW\Ws ( x ) are probability mass functions resulting from a softmax layer , where x ∼ X is an input and fW\Ws ( x ) is obtained by zeroing out the weights in Ws . Then , the utility of Ws can be measured as U ( Ws ) = E x∼X [ dKL ( fW ( x ) , fW\Ws ( x ) ) ] , where dKL is KL-divergence . For reference , the way of the measurement , i.e. , network ablation , was similarly done in ( Casper et al. , 2019 ; 2020 ; Meyes et al. , 2019 ; Cheney et al. , 2017 ) . We also define the utility imbalance as : . Definition 2 ( Utility imbalance ) . For Wi ⊂ W and Wj ⊂ W , we say there is δ utility imbalance between the subsets of weights when |U ( Wi ) − U ( Wj ) | > δ . Where we empirically measure the utility imbalance by : Definition 3 ( Utility imbalance measure ) . For a set of the randomly drawn subsets of W , i.e. , { Wi } Ni=1 , Wi ⊂W , which we refer to as a sample set , we empirically measure the utility imbalance of the set by the standard deviation of { U ( Wi ) } Ni=1 . We empirically show that the utility imbalance among the weights exists in Figure 1 . Hereafter , the cause of the utility imbalance and the characteristics of the weight utility are discussed in Section 2.1 and 2.2 , respectively . 2.1 THE CAUSE OF THE UTILITY IMBALANCE . In this section , we investigate the cause of the utility imbalance among the weights . The cause driven from initialization and optimization is discussed in Section 2.1.1 and 2.1.2 , respectively . 2.1.1 FROM INITIALIZATION . The utility imbalance among the weights can be given by initialization . The Lottery Ticket Hypothesis ( Frankle & Carbin , 2018 ) showed that there is a fortuitous subset of weights at initialization , namely winning tickets , which achieves the commensurate accuracy with the original network within the commensurate training time when trained in isolation . Since they uncovered the winning tickets by pruning the weights with the smallest magnitude after pretraining the whole network , we can say that the weights in the winning ticket are the ones that become the largest when trained as a whole . And since the weights with the larger magnitude tend to be more utilized than the others ( Han et al. , 2015 ) , it can be inferred that the weights in the winning ticket are the well-initialized ones that can become the most utilized ones after trained as a whole . However , the winning tickets become less effective when the subnetworks are trained to be far apart from the initialization , e.g. , trained with a larger learning rate or using ResNet ( He et al. , 2016 ) or Batch Normalization ( Ioffe & Szegedy , 2015 ; Hoffer et al. , 2018 ) , where the gradients flowing through the network are larger ( Frankle & Carbin , 2018 ) . 2.1.2 DURING OPTIMIZATION . The utility imbalance among the weights can also be intensified during optimization . Although Frankle & Carbin ( 2018 ) conjectured that SGD may seek out and train the winning tickets , they did not give further evidence . Here , we conduct an experiment to measure the utility imbalance during training . We classified CIFAR10 dataset ( Krizhevsky , 2009 ) using a vanilla convolutional neural network ( vanilla CNN ) ( the architecture of the network is specified in Section A.2.1 ) , trained by SGD with zero momentum and weight decay . The network was trained for 200 epochs with initial learning rate of 0.1 , which is reduced by 10× at 50 % and 75 % of the training epochs . When we measured the utility of a subset ( refer to Definition 1 ) , the weights in the subset were zeroed out for the exclusion , and KL-divergence was used to measure the distance between the probability outputs of the original network and the ablated network . For each subset , the distance was measured by averaging over the total dataset . To measure the utility statistics , e.g. , utility imbalance , we used a set of 500 randomly selected subsets ( N = 500 in Definition 3 ) which we refer to as sample set . We only used the training data in the experiment for two reasons : ( 1 ) it is more straightforward to interpret and ( 2 ) in our experiments , the validation accuracy was higher when the training loss was lower , thus we regarded that the probability output of the training data represented the validation accuracy to some degree . From the left figure in Figure 2 , we can see that the utility imbalance , i.e. , the standard deviation of the utility of the subsets in the sample set , increases during training . Additionally , the mean of the utility increases ( Figure 2 , middle ) , which implies that the network is utilizing the weights more effectively and is becoming sensitive to the ablation as training proceeds . Because the utility given the amount of ablation ( |δ| ) can be interpreted as |∆f ( W+δ ) ∆δ | , it is also inferred that the loss surface is becoming sharper . It corresponds with the previous work ( refer to Ghorbani et al. , 2019 , Figure 3 ) , where the scale of the eigenvalues of the Hessian with respect to the weights grows significantly over training . The increase in the average utility can be the reason for the increase in the utility imbalance – if statistically analyzed , the standard deviation of data grows larger when the data is scaled to be larger ; or if intuitively interpreted , the network outputs with respect to the different ablation sets differ to a greater extent as the loss surface becomes sharper . Moreover , we can see that the minimum of the utility in the sample set also increases ( Figure 2 , right ) , which infers that each of the weights is struggling to be utilized more , rather than SGD purposely differ the utility among the weights . This still holds when we trained the network much longer , i.e. , 5000 epochs , where we put the result in Figure 11 . We also conducted the experiments with the most popular architecture for classification , i.e. , ResNet20 ( He et al. , 2016 ) and Batch Normalization ( Ioffe & Szegedy , 2015 ) ; and more advanced optimization techniques , i.e. , momentum and weight decay . Please refer to Figure 12 and Figure 13 for the results . The results also hold for the above statements .
The paper proposes to answer the question why "a network with the same number of weights as that of the pruned network cannot achieve similar performance when trained from scratch". Then it proposes an hypothesis that the small model "does not utilize all of its weights either". To prove this hypothesis, it goes on to define and study the "utility imbalance" of the weights and its changing with the pretraining, pruning, etc. Some visualization analysis was provided too.
SP:e1ced25c8b1fc9745e6f43c1be529e418d9325f9
An empirical study of a pruning mechanism
1 INTRODUCTION . Deep learning is currently one of the most powerful machine learning methods . It requires neural network to train , which usually takes a few to hundreds times more weights than training data ( He et al. , 2016 ; Zagoruyko & Komodakis , 2016 ; Huang et al. , 2017 ; Karen & Andrew , 2015 ) . Usually , in common regimes , a greater number of weights leads to better performance ( Zagoruyko & Komodakis , 2016 ) . However , paradoxically , neural networks are also compressible . Many of the recent pruning methods aim to maximally compress the networks ( Han et al. , 2015 ; Liu et al. , 2017 ; He et al. , 2019 ; You et al. , 2019 ) , however , there are few works that investigate why and how the pruning mechanism works ( Frankle et al. , 2019 ; Elesedy et al. , 2020 ) . In this work , we empirically investigate a standard framework for network pruning : pretraining a large network and then pruning and retraining it . The framework has been commonly used based on heuristics , i.e . finding a good minima with a larger network and retaining it with careful pruning and retraining ( Han et al. , 2015 ; Liu et al. , 2017 ) . We investigate the heuristic in two parts , i.e. , one for the pretraining phase and the other for the pruning and retraining phase . For the pretraining phase , the reason for training the large network to obtain a good minima is investigated . Since the neural network is generally compressible , the pretrained large network can be pruned to a smaller one . However , a network with the same number of weights as that of the pruned network can not achieve similar performance when trained from scratch ( Frankle & Carbin , 2018 ) . We conjecture that this comes from the networks not utilizing all of their weights . Thus we hypothesize : if trained from scratch , there is a utility imbalance among the weights in neural network . For investigation , the measures for the weight utility and the utility imbalance are proposed . Thereafter , the cause of the utility imbalance and the characteristics of the weight utility in various conditions are examined . For the pruning and retraining phase , we verify the heuristic that once a good minima is obtained with the large network , it can be retained by careful pruning and retraining ( Han et al. , 2015 ; Renda et al. , 2020 ) . Our investigation is based on the loss surface visualization on a two dimensional plane formed by three points in the weight space where each point represents the pretrained network , the pruned network , and the pruned and retrained network . We examine ( 1 ) the dynamics of the network on the loss surface throughout pruning and ( 2 ) the validation accuracy of the networks over varying pruning methods and retraining methods . Contributions .. • The utility imbalance among the weights increases during optimization . • The neural networks utilize the weights in proportion to their size . • If a pretrained network is carefully pruned and retrained , then the pruned-and-retrained network shares the same loss basin with the pretrained network . 2 WEIGHT UTILITY ANALYSIS FOR THE PRETRAIN MECHANISM . Then why do we have to train a large network and then prune to a smaller one ? Why not just train the smaller one to get the performance we need ? Why is it difficult ? The investigation about the questions starts with a hypothesis : let Nlarge be a large network that does not utilize all of its weights , and thus can be easily compressed into a smaller network Npruned with minimal loss change . And let Nsmall be a network trained from scratch , whose number of weights is comparable to that ofNpruned , which is sufficient to achieve a similar level of loss to those ofNlarge orNpruned . However , Nsmall generally performs worse , because Nsmall does not utilize all of its weights either . Therefore , we hypothesize that the neural network does not utilize all of its weights when trained from scratch in general . And we refer to the phenomenon which the neural network utilize the weights unevenly as utility imbalance . Thus , Main Hypothesis . If trained from scratch , there is utility imbalance among the weights in a neural network . And we empirically measure the utility of weights as : Definition 1 ( Utility measure ) . LetW be a set of total weights in a networkN , Ws be a subset ofW , and X be a dataset . Suppose fW ( x ) and fW\Ws ( x ) are probability mass functions resulting from a softmax layer , where x ∼ X is an input and fW\Ws ( x ) is obtained by zeroing out the weights in Ws . Then , the utility of Ws can be measured as U ( Ws ) = E x∼X [ dKL ( fW ( x ) , fW\Ws ( x ) ) ] , where dKL is KL-divergence . For reference , the way of the measurement , i.e. , network ablation , was similarly done in ( Casper et al. , 2019 ; 2020 ; Meyes et al. , 2019 ; Cheney et al. , 2017 ) . We also define the utility imbalance as : . Definition 2 ( Utility imbalance ) . For Wi ⊂ W and Wj ⊂ W , we say there is δ utility imbalance between the subsets of weights when |U ( Wi ) − U ( Wj ) | > δ . Where we empirically measure the utility imbalance by : Definition 3 ( Utility imbalance measure ) . For a set of the randomly drawn subsets of W , i.e. , { Wi } Ni=1 , Wi ⊂W , which we refer to as a sample set , we empirically measure the utility imbalance of the set by the standard deviation of { U ( Wi ) } Ni=1 . We empirically show that the utility imbalance among the weights exists in Figure 1 . Hereafter , the cause of the utility imbalance and the characteristics of the weight utility are discussed in Section 2.1 and 2.2 , respectively . 2.1 THE CAUSE OF THE UTILITY IMBALANCE . In this section , we investigate the cause of the utility imbalance among the weights . The cause driven from initialization and optimization is discussed in Section 2.1.1 and 2.1.2 , respectively . 2.1.1 FROM INITIALIZATION . The utility imbalance among the weights can be given by initialization . The Lottery Ticket Hypothesis ( Frankle & Carbin , 2018 ) showed that there is a fortuitous subset of weights at initialization , namely winning tickets , which achieves the commensurate accuracy with the original network within the commensurate training time when trained in isolation . Since they uncovered the winning tickets by pruning the weights with the smallest magnitude after pretraining the whole network , we can say that the weights in the winning ticket are the ones that become the largest when trained as a whole . And since the weights with the larger magnitude tend to be more utilized than the others ( Han et al. , 2015 ) , it can be inferred that the weights in the winning ticket are the well-initialized ones that can become the most utilized ones after trained as a whole . However , the winning tickets become less effective when the subnetworks are trained to be far apart from the initialization , e.g. , trained with a larger learning rate or using ResNet ( He et al. , 2016 ) or Batch Normalization ( Ioffe & Szegedy , 2015 ; Hoffer et al. , 2018 ) , where the gradients flowing through the network are larger ( Frankle & Carbin , 2018 ) . 2.1.2 DURING OPTIMIZATION . The utility imbalance among the weights can also be intensified during optimization . Although Frankle & Carbin ( 2018 ) conjectured that SGD may seek out and train the winning tickets , they did not give further evidence . Here , we conduct an experiment to measure the utility imbalance during training . We classified CIFAR10 dataset ( Krizhevsky , 2009 ) using a vanilla convolutional neural network ( vanilla CNN ) ( the architecture of the network is specified in Section A.2.1 ) , trained by SGD with zero momentum and weight decay . The network was trained for 200 epochs with initial learning rate of 0.1 , which is reduced by 10× at 50 % and 75 % of the training epochs . When we measured the utility of a subset ( refer to Definition 1 ) , the weights in the subset were zeroed out for the exclusion , and KL-divergence was used to measure the distance between the probability outputs of the original network and the ablated network . For each subset , the distance was measured by averaging over the total dataset . To measure the utility statistics , e.g. , utility imbalance , we used a set of 500 randomly selected subsets ( N = 500 in Definition 3 ) which we refer to as sample set . We only used the training data in the experiment for two reasons : ( 1 ) it is more straightforward to interpret and ( 2 ) in our experiments , the validation accuracy was higher when the training loss was lower , thus we regarded that the probability output of the training data represented the validation accuracy to some degree . From the left figure in Figure 2 , we can see that the utility imbalance , i.e. , the standard deviation of the utility of the subsets in the sample set , increases during training . Additionally , the mean of the utility increases ( Figure 2 , middle ) , which implies that the network is utilizing the weights more effectively and is becoming sensitive to the ablation as training proceeds . Because the utility given the amount of ablation ( |δ| ) can be interpreted as |∆f ( W+δ ) ∆δ | , it is also inferred that the loss surface is becoming sharper . It corresponds with the previous work ( refer to Ghorbani et al. , 2019 , Figure 3 ) , where the scale of the eigenvalues of the Hessian with respect to the weights grows significantly over training . The increase in the average utility can be the reason for the increase in the utility imbalance – if statistically analyzed , the standard deviation of data grows larger when the data is scaled to be larger ; or if intuitively interpreted , the network outputs with respect to the different ablation sets differ to a greater extent as the loss surface becomes sharper . Moreover , we can see that the minimum of the utility in the sample set also increases ( Figure 2 , right ) , which infers that each of the weights is struggling to be utilized more , rather than SGD purposely differ the utility among the weights . This still holds when we trained the network much longer , i.e. , 5000 epochs , where we put the result in Figure 11 . We also conducted the experiments with the most popular architecture for classification , i.e. , ResNet20 ( He et al. , 2016 ) and Batch Normalization ( Ioffe & Szegedy , 2015 ) ; and more advanced optimization techniques , i.e. , momentum and weight decay . Please refer to Figure 12 and Figure 13 for the results . The results also hold for the above statements .
This paper dives into why small pruned networks don’t train as well as large networks. They come up with a measure of weight utilization and claim that networks of all sizes only use a portion of their weights during training, and the imbalance increases during optimization. Additionally, they visualize the accuracy surface on the plane defined by the pretrained, pruned, and retrained networks and find that the retrained networks end up in the same basin as the pretrained networks.
SP:e1ced25c8b1fc9745e6f43c1be529e418d9325f9
MixKD: Towards Efficient Distillation of Large-scale Language Models
1 INTRODUCTION . Recent language models ( LM ) pre-trained on large-scale unlabeled text corpora in a self-supervised manner have significantly advanced the state of the art across a wide variety of natural language processing ( NLP ) tasks ( Devlin et al. , 2018 ; Liu et al. , 2019c ; Yang et al. , 2019 ; Joshi et al. , 2020 ; Sun et al. , 2019b ; Clark et al. , 2020 ; Lewis et al. , 2019 ; Bao et al. , 2020 ) . After the LM pretraining stage , the resulting parameters can be fine-tuned to different downstream tasks . While these models have yielded impressive results , they typically have millions , if not billions , of parameters , and thus can be very expensive from storage and computational standpoints . Additionally , during deployment , such large models can require a lot of time to process even a single sample . In settings where computation may be limited ( e.g . mobile , edge devices ) , such characteristics may preclude such powerful models from deployment entirely . One promising strategy to compress and accelerate large-scale language models is knowledge distillation ( Zhao et al. , 2019 ; Tang et al. , 2019 ; Sun et al. , 2020 ) . The key idea is to train a smaller model ( a “ student ” ) to mimic the behavior of the larger , stronger-performing , but perhaps less practical model ( the “ teacher ” ) , thus achieving similar performance with a faster , lighter-weight model . A simple but powerful method of achieving this is to use the output probability logits produced by the teacher model as soft labels for training the student ( Hinton et al. , 2015 ) . With higher entropy than one-hot labels , these soft labels contain more information for the student model to learn from . ∗Equal contribution Previous efforts on distilling large-scale LMs mainly focus on designing better training objectives , such as matching intermediate representations ( Sun et al. , 2019a ; Mukherjee & Awadallah , 2019 ) , learning multiple tasks together ( Liu et al. , 2019a ) , or leveraging the distillation objective during the pre-training stage ( Jiao et al. , 2019 ; Sanh et al. , 2019 ) . However , much less effort has been made to enrich task-specific data , a potentially vital component of the knowledge distillation procedure . In particular , tasks with fewer data samples provide less opportunity for the student model to learn from the teacher . Even with a well-designed training objective , the student model is still prone to overfitting , despite effectively mimicking the teacher network on the available data . In response to these limitations , we propose improving the value of knowledge distillation by using data augmentation to generate additional samples from the available task-specific data . These augmented samples are further processed by the teacher network to produce additional soft labels , providing the student model more data to learn from a large-scale LM . Intuitively , this is akin to a student learning more from a teacher by asking more questions to further probe the teacher ’ s answers and thoughts . In particular , we demonstrate that mixup ( Zhang et al. , 2018 ) can significantly improve knowledge distillation ’ s effectiveness , and we show with a theoretical framework why this is the case . We call our framework MixKD . We conduct experiments on 6 GLUE datasets ( Wang et al. , 2019 ) across a variety of task types , demonstrating that MixKD significantly outperforms knowledge distillation ( Hinton et al. , 2015 ) and other previous methods that compress large-scale language models . In particular , we show that our method is especially effective when the number of available task data samples is small , substantially improving the potency of knowledge distillation . We also visualize representations learned with and without MixKD to show the value of interpolated distillation samples , perform a series of ablation and hyperparameter sensitivity studies , and demonstrate the superiority of MixKD over other BERT data augmentation strategies . 2 RELATED WORK . 2.1 MODEL COMPRESSION . Compressing large-scale language models , such as BERT , has attracted significant attention recently . Knowledge distillation has been demonstrated as an effective approach , which can be leveraged during both the pre-training and task-specific fine-tuning stages . Prior research efforts mainly focus on improving the training objectives to benefit the distillation process . Specifically , Turc et al . ( 2019 ) advocate that task-specific knowledge distillation can be improved by first pre-training the student model . It is shown by Clark et al . ( 2019 ) that a multi-task BERT model can be learned by distilling from multiple single-task teachers . Liu et al . ( 2019b ) propose learning a stronger student model by distilling knowledge from an ensemble of BERT models . Patient knowledge distillation ( PKD ) , introduced by Sun et al . ( 2019a ) , encourages the student model to mimic the teacher ’ s intermediate layers in addition to output logits . DistilBERT ( Sanh et al. , 2019 ) reduces the depth of BERT model by a factor of 2 via knowledge distillation during the pre-training stage . In this work , we evaluate MixKD on the case of task-specific knowledge distillation . Notably , it can be extended to the pre-training stage as well , which we leave for future work . Moreover , our method can be flexibly integrated with different KD training objectives ( described above ) to obtain even better results . However , we utilize the BERT-base model as the testbed in this paper without loss of generality . 2.2 DATA AUGMENTATION IN NLP . Data augmentation ( DA ) has been studied extensively in computer vision as a powerful technique to incorporate prior knowledge of invariances and improve the robustness of learned models ( Simard et al. , 1998 ; 2003 ; Krizhevsky et al. , 2012 ) . Recently , it has also been applied and shown effective on natural language data . Many approaches can be categorized as label-preserving transformations , which essentially produce neighbors around a training example that maintain its original label . For example , EDA ( Wei & Zou , 2019 ) propose using various rule-based operations such as synonym replacement , word insertion , swap or deletion to obtain augmented samples . Back-translation ( Yu et al. , 2018 ; Xie et al. , 2019 ) is another popular approach belonging to this type , which relies on pre-trained translation models . Additionally , methods based on paraphrase generation have also been leveraged from the data augmentation perspective ( Kumar et al. , 2019 ) . On the other hand , label-altering techniques like mixup ( Zhang et al. , 2018 ) have also been proposed for language ( Guo et al. , 2019 ; Chen et al. , 2020 ) , producing interpolated inputs and labels for the models predict . The proposed MixKD framework leverages the ability of mixup to facilitate the student learning more information from the teacher . It is worth noting that MixKD can be combined with arbitrary labelpreserving DA modules . Back-translation is employed as a special case here , and we believe other advanced label-preserving transformations developed in the future can benefit the MixKD approach as well . 2.3 MIXUP . Mixup ( Zhang et al. , 2018 ) is a popular data augmentation strategy to increase model generalizability and robustness by training on convex combinations of pairs of inputs and labels ( xi , yi ) and ( xj , yj ) : x′ = λxi + ( 1− λ ) xj ( 1 ) y′ = λyi + ( 1− λ ) yj ( 2 ) with λ ∈ [ 0 , 1 ] and ( x′ , y′ ) being the resulting virtual training example . This concept of interpolating samples was later generalized with Manifold mixup ( Verma et al. , 2019a ) and also found to be effective in semi-supervised learning settings ( Verma et al. , 2019b ; c ; Berthelot et al. , 2019b ; a ) . Other strategies include mixing together samples resulting from chaining together other augmentation techniques ( Hendrycks et al. , 2020 ) , or replacing linear interpolation with the cutting and pasting of patches ( Yun et al. , 2019 ) . 3 METHODOLOGY . 3.1 PRELIMINARIES . In NLP , an input sample i is often represented as a vector of tokens wi = { wi,1 , wi,2 , ... , wi , T } , with each token wi , t ∈ RV a one-hot vector often representing words ( but also possibly subwords , punctuation , or special tokens ) and V being the vocabulary size . These discrete tokens are then mapped to word embeddings xi = { xi,1 , xi,2 , ... , xi , T } , which serve as input to the machine learning model f . For supervised classification problems , a one-hot label yi ∈ RC indicates the ground-truth class of xi out of C possible classes . The parameters θ of f are optimized with some form of stochastic gradient descent so that the output of the model f ( xi ) ∈ RC is as close to yi as possible , with cross-entropy as the most common loss function : LMLE = − 1 n n∑ i yi · log ( f ( xi ) ) ( 3 ) where n is the number of samples , and · is the dot product . 3.2 KNOWLEDGE DISTILLATION FOR BERT . Consider two models f and g parameterized by θT and θS , respectively , with |θT | |θS | . Given enough training data and sufficient optimization , f is likely to yield better accuracy than g , due to higher modeling capacity , but may be too bulky or slow for certain applications . Being smaller in size , g is more likely to satisfy operational constraints , but its weaker performance can be seen as a disadvantage . To improve g , we can use the output prediction f ( xi ) on input xi as extra supervision for g to learn from , seeking to match g ( xi ) with f ( xi ) . Given these roles , we refer to g as the student model and f as the teacher model . While there are a number of recent large-scale language models driving the state of the art , we focus here on BERT ( Devlin et al. , 2018 ) models . Following Sun et al . ( 2019a ) , we use the notation BERTk to indicate a BERT model with k Transformer ( Vaswani et al. , 2017 ) layers . While powerful , BERT models also tend to be quite large ; for example , the default bert-base-uncased ( BERT12 ) has∼110M parameters . Reducing the number of layers ( e.g . using BERT3 ) makes such models significantly more portable and efficient , but at the expense of accuracy . With a knowledge distillation set-up , however , we aim to reduce this loss in performance . 3.3 MIXUP DATA AUGMENTATION FOR KNOWLEDGE DISTILLATION . While knowledge distillation can be a powerful technique , if the size of the available data is small , then the student has only limited opportunities to learn from the teacher . This may make it much harder for knowledge distillation to close the gap between student and teacher model performance . To correct this , we propose using data augmentation for knowledge distillation . While data augmentation ( Yu et al. , 2018 ; Xie et al. , 2019 ; Yun et al. , 2019 ; Kumar et al. , 2019 ; Hendrycks et al. , 2020 ; Shen et al. , 2020 ; Qu et al. , 2020 ) is a commonly used technique across machine learning for increasing training samples , robustness , and overall performance , a limited modeling capacity constrains the representations the student is capable of learning on its own . Instead , we propose using the augmented samples to further query the teacher model , whose large size often allows it to learn more powerful features . While many different data augmentation strategies have been proposed for NLP , we focus on mixup ( Zhang et al. , 2018 ) for generating additional samples to learn from the teacher . Mixup ’ s vicinal risk minimization tends to result in smoother decision boundaries and better generalization , while also being cheaper to compute than methods such as backtranslation ( Yu et al. , 2018 ; Xie et al. , 2019 ) . Mixup was initially proposed for continuous data , where interpolations between data points remain in-domain ; its efficacy was demonstrated primarily on image data , but examples in speech recognition and tabular data were also shown to demonstrate generality . Directly applying mixup to NLP is not quite as straightforward as it is for images , as language commonly consists of sentences of variable length , each comprised of discrete word tokens . Since performing mixup directly on the word tokens doesn ’ t result in valid language inputs , we instead perform mixup on the word embeddings at each time step xi , t ( Guo et al. , 2019 ) . This can be interpreted as a special case of Manifold mixup Verma et al . ( 2019a ) , where the mixing layer is set to the embedding layer . In other words , mixup samples are generated as : x′i , t = λxi , t + ( 1− λ ) xj , t ∀t ( 4 ) y′i = λyi + ( 1− λ ) yj ( 5 ) with λ ∈ [ 0 , 1 ] ; random sampling of λ from a Uniform or Beta distribution are common choices . Note that we index the augmented sample with i regardless of the value of λ . Sentence length variability can be mitigated by grouping mixup pairs by length . Alternatively , padding is a common technique for setting a consistent input length across samples ; thus , if x ( i ) contains more word tokens than x ( j ) , then the extra word embeddings are mixed up with zero paddings . We find this approach to be effective , while also being much simpler to implement . We query the teacher model with the generated mixup sample x′i , producing output prediction f ( x ′ i ) . The student is encouraged to imitate this prediction on the same input , by minimizing the objective : LTMKD = d ( f ( x′i ) , g ( x′i ) ) ( 6 ) where d ( · , · ) is a distance metric for distillation , with temperature-adjusted cross-entropy and mean square error ( MSE ) being common choices . Since we have the mixup samples already generated ( with an easy-to-generate interpolated pseudolabel y′i ) , we can also train the student model on these augmented data samples in the usual way , with a cross-entropy objective : LSM = − 1 n n∑ i y′i · log ( g ( x′i ) ) ( 7 ) Our final objective for MixKD is a sum of the original data cross-entropy loss , student cross-entropy loss on the mixup samples , and knowledge distillation from the teacher on the mixup samples : L = LMLE + αSMLSM + αTMKDLTMKD ( 8 ) where αSM and αTMKD are hyperparameters weighting the loss terms .
This paper applies mixup (Zhang et al., 2018) to augment training data to improve knowledge distillation in NLP tasks . Mixup was originally proposed to augment data for continuous data. To apply mixup to textual data, this paper applies mixup to the word/token embeddings instead of the tokens themselves. Some theoretical analysis has been done, and the experimental results show improved metrics over baseline methods such as DistillBERT.
SP:a1269282da0327aa083fa21ef352a5451667f925
MixKD: Towards Efficient Distillation of Large-scale Language Models
1 INTRODUCTION . Recent language models ( LM ) pre-trained on large-scale unlabeled text corpora in a self-supervised manner have significantly advanced the state of the art across a wide variety of natural language processing ( NLP ) tasks ( Devlin et al. , 2018 ; Liu et al. , 2019c ; Yang et al. , 2019 ; Joshi et al. , 2020 ; Sun et al. , 2019b ; Clark et al. , 2020 ; Lewis et al. , 2019 ; Bao et al. , 2020 ) . After the LM pretraining stage , the resulting parameters can be fine-tuned to different downstream tasks . While these models have yielded impressive results , they typically have millions , if not billions , of parameters , and thus can be very expensive from storage and computational standpoints . Additionally , during deployment , such large models can require a lot of time to process even a single sample . In settings where computation may be limited ( e.g . mobile , edge devices ) , such characteristics may preclude such powerful models from deployment entirely . One promising strategy to compress and accelerate large-scale language models is knowledge distillation ( Zhao et al. , 2019 ; Tang et al. , 2019 ; Sun et al. , 2020 ) . The key idea is to train a smaller model ( a “ student ” ) to mimic the behavior of the larger , stronger-performing , but perhaps less practical model ( the “ teacher ” ) , thus achieving similar performance with a faster , lighter-weight model . A simple but powerful method of achieving this is to use the output probability logits produced by the teacher model as soft labels for training the student ( Hinton et al. , 2015 ) . With higher entropy than one-hot labels , these soft labels contain more information for the student model to learn from . ∗Equal contribution Previous efforts on distilling large-scale LMs mainly focus on designing better training objectives , such as matching intermediate representations ( Sun et al. , 2019a ; Mukherjee & Awadallah , 2019 ) , learning multiple tasks together ( Liu et al. , 2019a ) , or leveraging the distillation objective during the pre-training stage ( Jiao et al. , 2019 ; Sanh et al. , 2019 ) . However , much less effort has been made to enrich task-specific data , a potentially vital component of the knowledge distillation procedure . In particular , tasks with fewer data samples provide less opportunity for the student model to learn from the teacher . Even with a well-designed training objective , the student model is still prone to overfitting , despite effectively mimicking the teacher network on the available data . In response to these limitations , we propose improving the value of knowledge distillation by using data augmentation to generate additional samples from the available task-specific data . These augmented samples are further processed by the teacher network to produce additional soft labels , providing the student model more data to learn from a large-scale LM . Intuitively , this is akin to a student learning more from a teacher by asking more questions to further probe the teacher ’ s answers and thoughts . In particular , we demonstrate that mixup ( Zhang et al. , 2018 ) can significantly improve knowledge distillation ’ s effectiveness , and we show with a theoretical framework why this is the case . We call our framework MixKD . We conduct experiments on 6 GLUE datasets ( Wang et al. , 2019 ) across a variety of task types , demonstrating that MixKD significantly outperforms knowledge distillation ( Hinton et al. , 2015 ) and other previous methods that compress large-scale language models . In particular , we show that our method is especially effective when the number of available task data samples is small , substantially improving the potency of knowledge distillation . We also visualize representations learned with and without MixKD to show the value of interpolated distillation samples , perform a series of ablation and hyperparameter sensitivity studies , and demonstrate the superiority of MixKD over other BERT data augmentation strategies . 2 RELATED WORK . 2.1 MODEL COMPRESSION . Compressing large-scale language models , such as BERT , has attracted significant attention recently . Knowledge distillation has been demonstrated as an effective approach , which can be leveraged during both the pre-training and task-specific fine-tuning stages . Prior research efforts mainly focus on improving the training objectives to benefit the distillation process . Specifically , Turc et al . ( 2019 ) advocate that task-specific knowledge distillation can be improved by first pre-training the student model . It is shown by Clark et al . ( 2019 ) that a multi-task BERT model can be learned by distilling from multiple single-task teachers . Liu et al . ( 2019b ) propose learning a stronger student model by distilling knowledge from an ensemble of BERT models . Patient knowledge distillation ( PKD ) , introduced by Sun et al . ( 2019a ) , encourages the student model to mimic the teacher ’ s intermediate layers in addition to output logits . DistilBERT ( Sanh et al. , 2019 ) reduces the depth of BERT model by a factor of 2 via knowledge distillation during the pre-training stage . In this work , we evaluate MixKD on the case of task-specific knowledge distillation . Notably , it can be extended to the pre-training stage as well , which we leave for future work . Moreover , our method can be flexibly integrated with different KD training objectives ( described above ) to obtain even better results . However , we utilize the BERT-base model as the testbed in this paper without loss of generality . 2.2 DATA AUGMENTATION IN NLP . Data augmentation ( DA ) has been studied extensively in computer vision as a powerful technique to incorporate prior knowledge of invariances and improve the robustness of learned models ( Simard et al. , 1998 ; 2003 ; Krizhevsky et al. , 2012 ) . Recently , it has also been applied and shown effective on natural language data . Many approaches can be categorized as label-preserving transformations , which essentially produce neighbors around a training example that maintain its original label . For example , EDA ( Wei & Zou , 2019 ) propose using various rule-based operations such as synonym replacement , word insertion , swap or deletion to obtain augmented samples . Back-translation ( Yu et al. , 2018 ; Xie et al. , 2019 ) is another popular approach belonging to this type , which relies on pre-trained translation models . Additionally , methods based on paraphrase generation have also been leveraged from the data augmentation perspective ( Kumar et al. , 2019 ) . On the other hand , label-altering techniques like mixup ( Zhang et al. , 2018 ) have also been proposed for language ( Guo et al. , 2019 ; Chen et al. , 2020 ) , producing interpolated inputs and labels for the models predict . The proposed MixKD framework leverages the ability of mixup to facilitate the student learning more information from the teacher . It is worth noting that MixKD can be combined with arbitrary labelpreserving DA modules . Back-translation is employed as a special case here , and we believe other advanced label-preserving transformations developed in the future can benefit the MixKD approach as well . 2.3 MIXUP . Mixup ( Zhang et al. , 2018 ) is a popular data augmentation strategy to increase model generalizability and robustness by training on convex combinations of pairs of inputs and labels ( xi , yi ) and ( xj , yj ) : x′ = λxi + ( 1− λ ) xj ( 1 ) y′ = λyi + ( 1− λ ) yj ( 2 ) with λ ∈ [ 0 , 1 ] and ( x′ , y′ ) being the resulting virtual training example . This concept of interpolating samples was later generalized with Manifold mixup ( Verma et al. , 2019a ) and also found to be effective in semi-supervised learning settings ( Verma et al. , 2019b ; c ; Berthelot et al. , 2019b ; a ) . Other strategies include mixing together samples resulting from chaining together other augmentation techniques ( Hendrycks et al. , 2020 ) , or replacing linear interpolation with the cutting and pasting of patches ( Yun et al. , 2019 ) . 3 METHODOLOGY . 3.1 PRELIMINARIES . In NLP , an input sample i is often represented as a vector of tokens wi = { wi,1 , wi,2 , ... , wi , T } , with each token wi , t ∈ RV a one-hot vector often representing words ( but also possibly subwords , punctuation , or special tokens ) and V being the vocabulary size . These discrete tokens are then mapped to word embeddings xi = { xi,1 , xi,2 , ... , xi , T } , which serve as input to the machine learning model f . For supervised classification problems , a one-hot label yi ∈ RC indicates the ground-truth class of xi out of C possible classes . The parameters θ of f are optimized with some form of stochastic gradient descent so that the output of the model f ( xi ) ∈ RC is as close to yi as possible , with cross-entropy as the most common loss function : LMLE = − 1 n n∑ i yi · log ( f ( xi ) ) ( 3 ) where n is the number of samples , and · is the dot product . 3.2 KNOWLEDGE DISTILLATION FOR BERT . Consider two models f and g parameterized by θT and θS , respectively , with |θT | |θS | . Given enough training data and sufficient optimization , f is likely to yield better accuracy than g , due to higher modeling capacity , but may be too bulky or slow for certain applications . Being smaller in size , g is more likely to satisfy operational constraints , but its weaker performance can be seen as a disadvantage . To improve g , we can use the output prediction f ( xi ) on input xi as extra supervision for g to learn from , seeking to match g ( xi ) with f ( xi ) . Given these roles , we refer to g as the student model and f as the teacher model . While there are a number of recent large-scale language models driving the state of the art , we focus here on BERT ( Devlin et al. , 2018 ) models . Following Sun et al . ( 2019a ) , we use the notation BERTk to indicate a BERT model with k Transformer ( Vaswani et al. , 2017 ) layers . While powerful , BERT models also tend to be quite large ; for example , the default bert-base-uncased ( BERT12 ) has∼110M parameters . Reducing the number of layers ( e.g . using BERT3 ) makes such models significantly more portable and efficient , but at the expense of accuracy . With a knowledge distillation set-up , however , we aim to reduce this loss in performance . 3.3 MIXUP DATA AUGMENTATION FOR KNOWLEDGE DISTILLATION . While knowledge distillation can be a powerful technique , if the size of the available data is small , then the student has only limited opportunities to learn from the teacher . This may make it much harder for knowledge distillation to close the gap between student and teacher model performance . To correct this , we propose using data augmentation for knowledge distillation . While data augmentation ( Yu et al. , 2018 ; Xie et al. , 2019 ; Yun et al. , 2019 ; Kumar et al. , 2019 ; Hendrycks et al. , 2020 ; Shen et al. , 2020 ; Qu et al. , 2020 ) is a commonly used technique across machine learning for increasing training samples , robustness , and overall performance , a limited modeling capacity constrains the representations the student is capable of learning on its own . Instead , we propose using the augmented samples to further query the teacher model , whose large size often allows it to learn more powerful features . While many different data augmentation strategies have been proposed for NLP , we focus on mixup ( Zhang et al. , 2018 ) for generating additional samples to learn from the teacher . Mixup ’ s vicinal risk minimization tends to result in smoother decision boundaries and better generalization , while also being cheaper to compute than methods such as backtranslation ( Yu et al. , 2018 ; Xie et al. , 2019 ) . Mixup was initially proposed for continuous data , where interpolations between data points remain in-domain ; its efficacy was demonstrated primarily on image data , but examples in speech recognition and tabular data were also shown to demonstrate generality . Directly applying mixup to NLP is not quite as straightforward as it is for images , as language commonly consists of sentences of variable length , each comprised of discrete word tokens . Since performing mixup directly on the word tokens doesn ’ t result in valid language inputs , we instead perform mixup on the word embeddings at each time step xi , t ( Guo et al. , 2019 ) . This can be interpreted as a special case of Manifold mixup Verma et al . ( 2019a ) , where the mixing layer is set to the embedding layer . In other words , mixup samples are generated as : x′i , t = λxi , t + ( 1− λ ) xj , t ∀t ( 4 ) y′i = λyi + ( 1− λ ) yj ( 5 ) with λ ∈ [ 0 , 1 ] ; random sampling of λ from a Uniform or Beta distribution are common choices . Note that we index the augmented sample with i regardless of the value of λ . Sentence length variability can be mitigated by grouping mixup pairs by length . Alternatively , padding is a common technique for setting a consistent input length across samples ; thus , if x ( i ) contains more word tokens than x ( j ) , then the extra word embeddings are mixed up with zero paddings . We find this approach to be effective , while also being much simpler to implement . We query the teacher model with the generated mixup sample x′i , producing output prediction f ( x ′ i ) . The student is encouraged to imitate this prediction on the same input , by minimizing the objective : LTMKD = d ( f ( x′i ) , g ( x′i ) ) ( 6 ) where d ( · , · ) is a distance metric for distillation , with temperature-adjusted cross-entropy and mean square error ( MSE ) being common choices . Since we have the mixup samples already generated ( with an easy-to-generate interpolated pseudolabel y′i ) , we can also train the student model on these augmented data samples in the usual way , with a cross-entropy objective : LSM = − 1 n n∑ i y′i · log ( g ( x′i ) ) ( 7 ) Our final objective for MixKD is a sum of the original data cross-entropy loss , student cross-entropy loss on the mixup samples , and knowledge distillation from the teacher on the mixup samples : L = LMLE + αSMLSM + αTMKDLTMKD ( 8 ) where αSM and αTMKD are hyperparameters weighting the loss terms .
The paper proposes combining the MixUp data augmentation method with teacher-student distillation to improve the fine-tuned performance of BERT on benchmark NLP tasks (GLUE). The problem is important, well-motivated and of interest to a broad base of NLP researchers and practitioners. The paper is clear, and generally well-written, although the idea itself is not surprisingly novel (somewhat of a low-hanging fruit), from the experimental results, the method improves upon baselines, and so the real-world impact could be high, especially given its simple implementation.
SP:a1269282da0327aa083fa21ef352a5451667f925
Temporal Difference Uncertainties as a Signal for Exploration
An effective approach to exploration in reinforcement learning is to rely on an agent ’ s uncertainty over the optimal policy , which can yield near-optimal exploration strategies in tabular settings . However , in non-tabular settings that involve function approximators , obtaining accurate uncertainty estimates is almost as challenging as the exploration problem itself . In this paper , we highlight that value estimates are easily biased and temporally inconsistent . In light of this , we propose a novel method for estimating uncertainty over the value function that relies on inducing a distribution over temporal difference errors . This exploration signal controls for state-action transitions so as to isolate uncertainty in value that is due to uncertainty over the agent ’ s parameters . Because our measure of uncertainty conditions on state-action transitions , we can not act on this measure directly . Instead , we incorporate it as an intrinsic reward and treat exploration as a separate learning problem , induced by the agent ’ s temporal difference uncertainties . We introduce a distinct exploration policy that learns to collect data with high estimated uncertainty , which gives rise to a “ curriculum ” that smoothly changes throughout learning and vanishes in the limit of perfect value estimates . We evaluate our method on hardexploration tasks , including Deep Sea and Atari 2600 environments and find that our proposed form of exploration facilitates efficient exploration . 1 INTRODUCTION . Striking the right balance between exploration and exploitation is fundamental to the reinforcement learning problem . A common approach is to derive exploration from the policy being learned . Dithering strategies , such as -greedy exploration , render a reward-maximising policy stochastic around its reward maximising behaviour ( Williams & Peng , 1991 ) . Other methods encourage higher entropy in the policy ( Ziebart et al. , 2008 ) , introduce an intrinsic reward ( Singh et al. , 2005 ) , or drive exploration by sampling from the agent ’ s belief over the MDP ( Strens , 2000 ) . While greedy or entropy-maximising policies can not facilitate temporally extended exploration ( Osband et al. , 2013 ; 2016a ) , the efficacy of intrinsic rewards depends crucially on how they relate to the extrinsic reward that comes from the environment ( Burda et al. , 2018a ) . Typically , intrinsic rewards for exploration provide a bonus for visiting novel states ( e.g Bellemare et al. , 2016 ) or visiting states where the agent can not predict future transitions ( e.g Pathak et al. , 2017 ; Burda et al. , 2018a ) . Such approaches can facilitate learning an optimal policy , but they can also fail entirely in large environments as they prioritise novelty over rewards ( Burda et al. , 2018b ) . Methods based on the agent ’ s uncertainty over the optimal policy explicitly trade off exploration and exploitation ( Kearns & Singh , 2002 ) . Posterior Sampling for Reinforcement Learning ( PSRL ; Strens , 2000 ; Osband et al. , 2013 ) is one such approach , which models a distribution over Markov Decision Processes ( MDPs ) . While PSRL is near-optimal in tabular settings ( Osband et al. , 2013 ; 2016b ) , it can not be easily scaled to complex problems that require function approximators . Prior work has attempted to overcome this by instead directly estimating the agent ’ s uncertainty over the policy ’ s value function ( Osband et al. , 2016a ; Moerland et al. , 2017 ; Osband et al. , 2019 ; O ’ Donoghue et al. , 2018 ; Janz et al. , 2019 ) . While these approaches can scale posterior sampling to complex problems and nonlinear function approximators , estimating uncertainty over value functions introduces issues that can cause a bias in the posterior distribution ( Janz et al. , 2019 ) . In response to these challenges , we introduce Temporal Difference Uncertainties ( TDU ) , which derives an intrinsic reward from the agent ’ s uncertainty over the value function . Concretely , TDU relies on the Bootstrapped DQN ( Osband et al. , 2016a ) and separates exploration and reward-maximising behaviour into two separate policies that bootstrap from a shared replay buffer . This separation allows us to derive an exploration signal for the exploratory policy from estimates of uncertainty of the reward-maximising policy . Thus , TDU encourages exploration to collect data with high model uncertainty over reward-maximising behaviour , which is made possible by treating exploration as a separate learning problem . In contrast to prior works that directly estimate value function uncertainty , we estimate uncertainty over temporal difference ( TD ) errors . By conditioning on observed stateaction transitions , TDU controls for environment uncertainty and provides an exploration signal only insofar as there is model uncertainty . We demonstrate that TDU can facilitate efficient exploration in challenging exploration problems such as Deep Sea and Montezuma ’ s Revenge . 2 ESTIMATING VALUE FUNCTION UNCERTAINTY IS HARD . We begin by highlighting that estimating uncertainty over the value function can suffer from bias that is very hard to overcome with typical approaches ( see also Janz et al. , 2019 ) . Our analysis shows that biased estimates arise because uncertainty estimates require an integration over unknown future state visitations . This requires tremendous model capacity and is in general infeasible . Our results show that we can not escape a bias in general , but we can take steps to mitigate it by conditioning on an observed trajectory . Doing so removes some uncertainty over future state-visitations and we show in Section 3 that it can result in a substantially smaller bias . We consider a Markov Decision Process ( S , A , P , R , γ ) for some given state space ( S ) , action space ( A ) , transition dynamics ( P ) , reward function ( R ) and discount factor ( γ ) . For a given ( deterministic ) policy π : S 7→ A , the action value function is defined as the expected cumulative reward under the policy starting from state s with action a : Qπ ( s , a ) : = Eπ [ ∞∑ t=0 γtrt+1 ∣∣∣∣∣ s0 = s , a0 = a ] = Er∼R ( s , a ) s′∼P ( s , a ) [ r + γQπ ( s ′ , π ( s′ ) ) ] , ( 1 ) where t index time and the expectation Eπ is with respect to realised rewards r sampled under the policy π ; the right-hand side characterises Q recursively under the Bellman equation . The actionvalue function Qπ is estimated under a function approximator Qθ parameterised by θ . Uncertainty over Qπ is expressed by placing a distribution over the parameters of the function approximator , p ( θ ) . We overload notation slightly and write p ( θ ) to denote the probability density function pθ over a random variable θ . Further , we denote by θ ∼ p ( θ ) a random sample θ from the distribution defined by pθ . Methods that rely on posterior sampling under function approximators assume that the induced distribution , p ( Qθ ) , is an accurate estimate of the agent ’ s uncertainty over its value function , p ( Qπ ) , so that sampling Qθ ∼ p ( Qθ ) is approximately equivalent to sampling from Qπ ∼ p ( Qπ ) . For this to hold , the moments of p ( Qθ ) at each state-action pair ( s , a ) must correspond to the expected moments in future states . In particular , moments of p ( Qπ ) must satisfy a Bellman Equation akin to Eq . 1 ( O ’ Donoghue et al. , 2018 ) . We focus on the mean ( E ) and variance ( V ) : Eθ [ Qθ ( s , a ) ] = Eθ [ Er , s′ [ r + γQθ ( s′ , π ( s′ ) ) ] ] , ( 2 ) Vθ [ Qθ ( s , a ) ] = Vθ [ Er , s′ [ r + γQθ ( s′ , π ( s′ ) ) ] ] . ( 3 ) If Eθ [ Qθ ] and Vθ [ Qθ ] fail to satisfy these conditions , the estimates of E [ Qπ ] and V [ Qπ ] are biased , causing a bias in exploration under posterior sampling from p ( Qθ ) . Formally , the agent ’ s uncertainty over p ( Q ) implies uncertainty over the MDP ( Strens , 2000 ) . Given a belief over the MDP , i.e. , a distribution p ( M ) , we can associate each M ∼ p ( M ) with a distinct value function QMπ . Lemma 1 below shows that , for p ( θ ) to be interpreted as representing some p ( M ) by push-forward to p ( Qθ ) , the induced moments must match under the Bellman Equation . Lemma 1 . If Eθ [ Qθ ] and Vθ [ Qθ ] fail to satisfy Eqs . 2 and 3 , respectively , they are biased estimators of EM [ QMπ ] and VM [ QMπ ] for any choice of p ( M ) . All proofs are deferred to Appendix B. Lemma 1 highlights why estimating uncertainty over value functions is so challenging ; while the left-hand sides of Eqs . 2 and 3 are stochastic in θ only , the right-hand sides depend on marginalising over the MDP . This requires the function approximator to generalise to unseen future trajectories . Lemma 1 is therefore a statement about scale ; the harder it is to generalise , the more likely we are to observe a bias—even in deterministic environments . This requirement of “ strong generalisation ” poses a particular problem for neural networks that tend to interpolate over the training data ( e.g . Li et al. , 2020 ; Liu et al. , 2020 ; Belkin et al. , 2019 ) , but the issue is more general . In particular , we show that factorising the posterior p ( θ ) will typically cause estimation bias for all but tabular MDPs . This is problematic because it is often computationally infeasible to maintain a full posterior ; previous work either maintains a full posterior over the final layer of the function approximator ( Osband et al. , 2016a ; O ’ Donoghue et al. , 2018 ; Janz et al. , 2019 ) or maintains a diagonal posterior over all parameters ( Fortunato et al. , 2018 ; Plappert et al. , 2018 ) of the neural network . Either method limits how expressive the function approximator can be with respect to future states , thereby causing an estimation bias . To establish this formally , letQθ : = w◦φϑ , where θ = ( w1 , . . . , wn , ϑ1 , . . . , ϑv ) , withw ∈ Rn a linear projection and φ : S ×A → Rn a feature extractor with parameters ϑ ∈ Rv . Proposition 1 . If the number of state-action pairs where Eθ [ Qθ ( s , a ) ] 6= Eθ [ Qθ ( s′ , a′ ) ] is greater than n , where w ∈ Rn , then Eθ [ Qθ ] and Vθ [ Qθ ] are biased estimators of EM [ QMπ ] and VM [ QMπ ] for any choice of p ( M ) . This result is a consequence of the feature extractor ψ mapping into a co-domain that is larger than the space spanned by w ; a bias results from having more unique state-action representations ψ ( s , a ) than degrees of freedom in w. The implication is that function approximators under factorised posteriors can not generalise uncertainty estimates across states ( a similar observation in tabular settings was made by Janz et al. , 2019 ) —they can only produce temporally consistent uncertainty estimates if they have the capacity to memorise point-wise uncertainty estimates for each ( s , a ) , which defeats the purpose of a function approximator . This is a statement about the structure of p ( θ ) and holds for any estimation method . Thus , common approaches to uncertainty estimation with neural networks generally fail to provide unbiased uncertainty estimates over the value function in non-trivial MDPs . Proposition 1 shows that to accurately capture value function uncertainty , we need a full posterior over parameters , which is often infeasible . It also underscores that the main issue is the dependence on future state visitation . This motivates Temporal Difference Uncertainties as an estimate of uncertainty conditioned on observed state-action transitions .
This paper proposes to use an intrinsic reward based on uncertainties calculated from temporal difference errors. The approach, called Temporal Difference Uncertainties (TDU), estimates the variance of td errors across multiple (bootstrapped) parameters, for a given state, action, next state and reward, where variability is due only to variance in parameters. The other addition is to learn a separate set of action-values that use this intrinsic reward, from the bootstrap set. Actions are then taken by randomly sampling an action-value function from the combined set.
SP:5a114af6b868ac0f8923205ea5257590967110c0
Temporal Difference Uncertainties as a Signal for Exploration
An effective approach to exploration in reinforcement learning is to rely on an agent ’ s uncertainty over the optimal policy , which can yield near-optimal exploration strategies in tabular settings . However , in non-tabular settings that involve function approximators , obtaining accurate uncertainty estimates is almost as challenging as the exploration problem itself . In this paper , we highlight that value estimates are easily biased and temporally inconsistent . In light of this , we propose a novel method for estimating uncertainty over the value function that relies on inducing a distribution over temporal difference errors . This exploration signal controls for state-action transitions so as to isolate uncertainty in value that is due to uncertainty over the agent ’ s parameters . Because our measure of uncertainty conditions on state-action transitions , we can not act on this measure directly . Instead , we incorporate it as an intrinsic reward and treat exploration as a separate learning problem , induced by the agent ’ s temporal difference uncertainties . We introduce a distinct exploration policy that learns to collect data with high estimated uncertainty , which gives rise to a “ curriculum ” that smoothly changes throughout learning and vanishes in the limit of perfect value estimates . We evaluate our method on hardexploration tasks , including Deep Sea and Atari 2600 environments and find that our proposed form of exploration facilitates efficient exploration . 1 INTRODUCTION . Striking the right balance between exploration and exploitation is fundamental to the reinforcement learning problem . A common approach is to derive exploration from the policy being learned . Dithering strategies , such as -greedy exploration , render a reward-maximising policy stochastic around its reward maximising behaviour ( Williams & Peng , 1991 ) . Other methods encourage higher entropy in the policy ( Ziebart et al. , 2008 ) , introduce an intrinsic reward ( Singh et al. , 2005 ) , or drive exploration by sampling from the agent ’ s belief over the MDP ( Strens , 2000 ) . While greedy or entropy-maximising policies can not facilitate temporally extended exploration ( Osband et al. , 2013 ; 2016a ) , the efficacy of intrinsic rewards depends crucially on how they relate to the extrinsic reward that comes from the environment ( Burda et al. , 2018a ) . Typically , intrinsic rewards for exploration provide a bonus for visiting novel states ( e.g Bellemare et al. , 2016 ) or visiting states where the agent can not predict future transitions ( e.g Pathak et al. , 2017 ; Burda et al. , 2018a ) . Such approaches can facilitate learning an optimal policy , but they can also fail entirely in large environments as they prioritise novelty over rewards ( Burda et al. , 2018b ) . Methods based on the agent ’ s uncertainty over the optimal policy explicitly trade off exploration and exploitation ( Kearns & Singh , 2002 ) . Posterior Sampling for Reinforcement Learning ( PSRL ; Strens , 2000 ; Osband et al. , 2013 ) is one such approach , which models a distribution over Markov Decision Processes ( MDPs ) . While PSRL is near-optimal in tabular settings ( Osband et al. , 2013 ; 2016b ) , it can not be easily scaled to complex problems that require function approximators . Prior work has attempted to overcome this by instead directly estimating the agent ’ s uncertainty over the policy ’ s value function ( Osband et al. , 2016a ; Moerland et al. , 2017 ; Osband et al. , 2019 ; O ’ Donoghue et al. , 2018 ; Janz et al. , 2019 ) . While these approaches can scale posterior sampling to complex problems and nonlinear function approximators , estimating uncertainty over value functions introduces issues that can cause a bias in the posterior distribution ( Janz et al. , 2019 ) . In response to these challenges , we introduce Temporal Difference Uncertainties ( TDU ) , which derives an intrinsic reward from the agent ’ s uncertainty over the value function . Concretely , TDU relies on the Bootstrapped DQN ( Osband et al. , 2016a ) and separates exploration and reward-maximising behaviour into two separate policies that bootstrap from a shared replay buffer . This separation allows us to derive an exploration signal for the exploratory policy from estimates of uncertainty of the reward-maximising policy . Thus , TDU encourages exploration to collect data with high model uncertainty over reward-maximising behaviour , which is made possible by treating exploration as a separate learning problem . In contrast to prior works that directly estimate value function uncertainty , we estimate uncertainty over temporal difference ( TD ) errors . By conditioning on observed stateaction transitions , TDU controls for environment uncertainty and provides an exploration signal only insofar as there is model uncertainty . We demonstrate that TDU can facilitate efficient exploration in challenging exploration problems such as Deep Sea and Montezuma ’ s Revenge . 2 ESTIMATING VALUE FUNCTION UNCERTAINTY IS HARD . We begin by highlighting that estimating uncertainty over the value function can suffer from bias that is very hard to overcome with typical approaches ( see also Janz et al. , 2019 ) . Our analysis shows that biased estimates arise because uncertainty estimates require an integration over unknown future state visitations . This requires tremendous model capacity and is in general infeasible . Our results show that we can not escape a bias in general , but we can take steps to mitigate it by conditioning on an observed trajectory . Doing so removes some uncertainty over future state-visitations and we show in Section 3 that it can result in a substantially smaller bias . We consider a Markov Decision Process ( S , A , P , R , γ ) for some given state space ( S ) , action space ( A ) , transition dynamics ( P ) , reward function ( R ) and discount factor ( γ ) . For a given ( deterministic ) policy π : S 7→ A , the action value function is defined as the expected cumulative reward under the policy starting from state s with action a : Qπ ( s , a ) : = Eπ [ ∞∑ t=0 γtrt+1 ∣∣∣∣∣ s0 = s , a0 = a ] = Er∼R ( s , a ) s′∼P ( s , a ) [ r + γQπ ( s ′ , π ( s′ ) ) ] , ( 1 ) where t index time and the expectation Eπ is with respect to realised rewards r sampled under the policy π ; the right-hand side characterises Q recursively under the Bellman equation . The actionvalue function Qπ is estimated under a function approximator Qθ parameterised by θ . Uncertainty over Qπ is expressed by placing a distribution over the parameters of the function approximator , p ( θ ) . We overload notation slightly and write p ( θ ) to denote the probability density function pθ over a random variable θ . Further , we denote by θ ∼ p ( θ ) a random sample θ from the distribution defined by pθ . Methods that rely on posterior sampling under function approximators assume that the induced distribution , p ( Qθ ) , is an accurate estimate of the agent ’ s uncertainty over its value function , p ( Qπ ) , so that sampling Qθ ∼ p ( Qθ ) is approximately equivalent to sampling from Qπ ∼ p ( Qπ ) . For this to hold , the moments of p ( Qθ ) at each state-action pair ( s , a ) must correspond to the expected moments in future states . In particular , moments of p ( Qπ ) must satisfy a Bellman Equation akin to Eq . 1 ( O ’ Donoghue et al. , 2018 ) . We focus on the mean ( E ) and variance ( V ) : Eθ [ Qθ ( s , a ) ] = Eθ [ Er , s′ [ r + γQθ ( s′ , π ( s′ ) ) ] ] , ( 2 ) Vθ [ Qθ ( s , a ) ] = Vθ [ Er , s′ [ r + γQθ ( s′ , π ( s′ ) ) ] ] . ( 3 ) If Eθ [ Qθ ] and Vθ [ Qθ ] fail to satisfy these conditions , the estimates of E [ Qπ ] and V [ Qπ ] are biased , causing a bias in exploration under posterior sampling from p ( Qθ ) . Formally , the agent ’ s uncertainty over p ( Q ) implies uncertainty over the MDP ( Strens , 2000 ) . Given a belief over the MDP , i.e. , a distribution p ( M ) , we can associate each M ∼ p ( M ) with a distinct value function QMπ . Lemma 1 below shows that , for p ( θ ) to be interpreted as representing some p ( M ) by push-forward to p ( Qθ ) , the induced moments must match under the Bellman Equation . Lemma 1 . If Eθ [ Qθ ] and Vθ [ Qθ ] fail to satisfy Eqs . 2 and 3 , respectively , they are biased estimators of EM [ QMπ ] and VM [ QMπ ] for any choice of p ( M ) . All proofs are deferred to Appendix B. Lemma 1 highlights why estimating uncertainty over value functions is so challenging ; while the left-hand sides of Eqs . 2 and 3 are stochastic in θ only , the right-hand sides depend on marginalising over the MDP . This requires the function approximator to generalise to unseen future trajectories . Lemma 1 is therefore a statement about scale ; the harder it is to generalise , the more likely we are to observe a bias—even in deterministic environments . This requirement of “ strong generalisation ” poses a particular problem for neural networks that tend to interpolate over the training data ( e.g . Li et al. , 2020 ; Liu et al. , 2020 ; Belkin et al. , 2019 ) , but the issue is more general . In particular , we show that factorising the posterior p ( θ ) will typically cause estimation bias for all but tabular MDPs . This is problematic because it is often computationally infeasible to maintain a full posterior ; previous work either maintains a full posterior over the final layer of the function approximator ( Osband et al. , 2016a ; O ’ Donoghue et al. , 2018 ; Janz et al. , 2019 ) or maintains a diagonal posterior over all parameters ( Fortunato et al. , 2018 ; Plappert et al. , 2018 ) of the neural network . Either method limits how expressive the function approximator can be with respect to future states , thereby causing an estimation bias . To establish this formally , letQθ : = w◦φϑ , where θ = ( w1 , . . . , wn , ϑ1 , . . . , ϑv ) , withw ∈ Rn a linear projection and φ : S ×A → Rn a feature extractor with parameters ϑ ∈ Rv . Proposition 1 . If the number of state-action pairs where Eθ [ Qθ ( s , a ) ] 6= Eθ [ Qθ ( s′ , a′ ) ] is greater than n , where w ∈ Rn , then Eθ [ Qθ ] and Vθ [ Qθ ] are biased estimators of EM [ QMπ ] and VM [ QMπ ] for any choice of p ( M ) . This result is a consequence of the feature extractor ψ mapping into a co-domain that is larger than the space spanned by w ; a bias results from having more unique state-action representations ψ ( s , a ) than degrees of freedom in w. The implication is that function approximators under factorised posteriors can not generalise uncertainty estimates across states ( a similar observation in tabular settings was made by Janz et al. , 2019 ) —they can only produce temporally consistent uncertainty estimates if they have the capacity to memorise point-wise uncertainty estimates for each ( s , a ) , which defeats the purpose of a function approximator . This is a statement about the structure of p ( θ ) and holds for any estimation method . Thus , common approaches to uncertainty estimation with neural networks generally fail to provide unbiased uncertainty estimates over the value function in non-trivial MDPs . Proposition 1 shows that to accurately capture value function uncertainty , we need a full posterior over parameters , which is often infeasible . It also underscores that the main issue is the dependence on future state visitation . This motivates Temporal Difference Uncertainties as an estimate of uncertainty conditioned on observed state-action transitions .
The authors introduce the use of value function variance (conditioned on state transition) as auxiliary reward promoting exploration during training. The variance is estimated using the bootstrap DQN approach. The main difference with similar methods is that the value uncertainty is not used in a Thompson sampling scheme but it is instead use to provide exploration reward.
SP:5a114af6b868ac0f8923205ea5257590967110c0
IOT: Instance-wise Layer Reordering for Transformer Structures
1 INTRODUCTION . Transformer ( Vaswani et al. , 2017 ) has been the dominant architecture in deep learning models ( Hassan et al. , 2018 ; Ng et al. , 2019 ; Carion et al. , 2020 ; Radford et al. , 2019 ; Dai et al. , 2019 ; Lee et al. , 2019 ; Devlin et al. , 2018 ; Yang et al. , 2019 ; Cai & Lam , 2019 ) . A Transformer model is stacked by several identical blocks , and each block consists of sequentially ordered layers : the self-attention ( SA ) , encoder-decoder attention ( ED ) ( decoder only ) and feed-forward ( FF ) layer . Recently , various modifications have been proposed , where the focus is on replacing or inserting some components ( e.g. , attention layer/layer norm/position encoding ) in standard Transformer ( Wu et al. , 2019 ; Lu et al. , 2019 ; Shaw et al. , 2018 ; So et al. , 2019 ; Ahmed et al. , 2017 ) . Despite these Transformer alternatives have achieved improved performances , one critical element is almost neglected in current models , which is how to arrange the components within a Transformer network , i.e. , the layer order also matters . As pointed by He et al . ( 2016b ) , different orders of ReLU , batch normalization and residual connection significantly affect the performance of ResNet ( He et al. , 2016a ) . Therefore , we ask : What if we reorder the sequential layers in Transformer ( e.g. , SA→FF or FF→SA of encoder , SA→FF→ED or FF→ED→SA of decoder ) ? What is the best order for these different layers ? ∗Equal contribution and corresponding authors . 1https : //github.com/instance-wise-ordered-transformer/IOT We first conduct preliminary experiments . We vary the three layers in decoder with all six variants ( each with a unique order of the three layers ) and train these models . Results on IWSLT14 German→English translation are reported in Table 1 . As we can see , their performances are similar and no one is outstanding . The corpus BLEU variance is only 0.0045 , which means that simply reordering the layers and training over the whole corpus impacts little . Press et al . ( 2019 ) also reported this for machine translation , but they stopped here . This seems to be a negative answer . However , we take a further step and ask one more question : Does different data favor different ordered layers ? That is , we investigate whether each specific data has its own preference for one particular order . Intuitively , putting various data patterns in one order should not be the best choice . For example , harder samples may favor a particular order while easier ones favor another one . Thus , for each order , we count the ratio of samples that achieve the best score with that order . In Table 1 , we find they almost lie on a uniform distribution ( e.g. , 17.9 % samples achieve the best BLEU with order SA→ED→FF ) . Besides , we calculate the BLEU variance for each sample , and average all these variances , the result is 114.76 , which is much larger than above corpus variance ( 0.0045 ) . These both mean the data indeed has its own preference to different orders . In Table 2 , we present translations from all decoders for on example with BLEU and TER score to give an evidence . Motivated by above observations , in this work , we present Instance-wise Ordered Transformer ( IOT ) , in which the layer order is determined by the specific data through instance-wise learning . To achieve this , we utilize a light predictor to predict the confidence for each order , given the corresponding classification losses as training signals . However , directly training the predictor with conventional ( i.e. , NMT ) loss tends to quickly converge to a bad order , and ignore explorations on others . Thus , we introduce an exploration loss and an exploitation loss to make an effective training while keeping an unambiguous prediction for each data so that the best order can be decided during inference . We evaluate our approach on 3 sequence generation tasks , including neural machine translation ( NMT ) , abstractive summarization ( ABS ) and code generation ( CG ) . For NMT , we work on 8 IWSLT and 2 WMT tasks , both on low-resource and rich-resource scenarios . Our method can consistently obtain 1.0 BELU score improvements over Transformer . For ABS , IOT also outperforms Transformer and other baselines on Gigaword dataset . For CG tasks , the results on 2 large-scale real-world code datasets ( Java and Python ) collected from Github surpass the state-of-the-art performances . These all demonstrate the effectiveness of our IOT . Furthermore , we provide detailed studies to verify that the instance-wise learning and order selection make a reasonable and necessary modeling . The contributions of this work can be summarized as follows : • We are the first to leverage instance-wise learning for layer order selection in a Transformer model ( with shared parameters ) , and we demonstrate the instance-wise learning is critical . • We demonstrate our learning approach can be universally applied to other structures beside Transformer ( e.g. , Dynamic Convolutions ) , as long as there are multiple different layers . • Experiments on 3 sequence generation tasks and 9 datasets verify the effectiveness of IOT with consistent performance improvements . 2 RELATED WORK . Architecture Exploration Inventing novel architectures by human designing or automatic searching plays an important role in deep learning . Specific to Transformer structures , various modifications have been proposed . For example , human knowledge powered designs include DynamicConv ( Wu et al. , 2019 ) , Macaron Network ( Lu et al. , 2019 ) , Reformer ( Kitaev et al. , 2020 ) and others ( Fonollosa et al. , 2019 ; Ahmed et al. , 2017 ; Shaw et al. , 2018 ) . As for automatic searching , neural architecture Feed Forward 𝑋 ! 𝑋 '' 𝑋 # 𝑌 '' 𝑌 # 𝑌 ! L x Pred L x Weight Tying Encoder DecoderInput Output Self Attention Self Attention Enc-Dec Attention Feed Forward Self Attention Enc-Dec Attention Feed Forward Feed Forward Self Attention Pred Weight Tying Figure 1 : The IOT framework . Pred means the light predictor introduced in 3.1 for order selection . We show two ordered encoders/decoders here . After taking X1 , X2 , X3 , the selected order for Y2 , Y3 is the lower encoder and upper decoder , while for Y1 is the upper encoder and lower decoder . search can discover networks with state-of-the-art performances but always with complicated computation , i.e. , Evolved Transformer ( So et al. , 2019 ) . The underlying principle is to add or replace some components of Transformer . For instance , Wu et al . ( 2019 ) replace self-attention with dynamic convolution , So et al . ( 2019 ) add a separate convolution layer in a new branch . Different from them , we , instead , only focus on the selection of layer orders for each data sample so as to improve the model performance , without a heavy modification . Besides , our approach is structure agnostic , which can be universally applied to other structures , only if multiple different layers exist . Instance-wise Learning Deep learning models are trained over large-scale datasets , and data samples are often treated equally without modeling the difference between them . Some works attempt to weight each data with different importance ( Ren et al. , 2018 ; Hu et al. , 2019 ; Chang et al. , 2017 ) or feed data with curriculum learning according to its difficulty ( Bengio et al. , 2009 ; Fan et al. , 2018 ) . However , they often explicitly manipulate the data during training only , while no distinction exists in inference , and under one fixed model . Elbayad et al . ( 2020 ) take a step further and propose the depth-adaptive Transformer , which can forecast different depths of the network by predicting the required computation for a particular data . Similarly , Liu et al . ( 2020 ) propose a sample-wise adaptive mechanism to dynamically calculate the number of required layers . They both aim at reducing the computation cost and speed up the inference . Schwartz et al . ( 2020 ) , Bapna et al . ( 2020 ) and Shazeer et al . ( 2017 ) all leverage conditional computation for each sample to control the computation and accuracy tradeoff during inference . Instead , we pay attention to the variant modeling functions and perform instance-wise order selection in order to boost the Transformer performance . The most related work is Press et al . ( 2019 ) , which manually generates randomly ordered Transformer encoders and finds the Sandwich Transformer can slightly reduce the perplexity of language modeling . However , they find that Sandwich Transformer pattern has no effect on NMT task . Besides , it still performs over the whole corpus without considering each specific data . We , instead , investigate on various sequence-to-sequence generation tasks and greatly improve the task performances through instance-wise learning , so as to discover the optimal ordered Transformer for each particular data . 3 INSTANCE-WISE ORDERED TRANSFORMER . The overall framework of IOT is presented in Figure 1 . In comparison with the standard Transformer , IOT only incorporates light-weighted predictors and reorders the encoder/decoder with weight tying , under the constraint of almost same number of parameters and exempt from heavy modifications . In this section , we introduce the details of IOT , including training , inference and discussions . Notations Sequence-to-sequence learning aims to map one sequence x = [ x1 , x2 , ... , xTx ] into another sequence y = [ y1 , y2 , ... , yTy ] , where xi , yj denotes the i-th and j-th token of x and y , Tx and Ty are the corresponding lengths . Given one sentence pair ( x , y ) and a learning modelM , we can define the training objective as minimizing the cross-entropy loss LM = − ∑Ty j=1 logP ( yj |y < j , x ) . Besides , DKL ( P‖Q ) denotes the Kullback-Leibler ( KL ) divergence between distributions P and Q . 3.1 INSTANCE-WISE ENCODER/DECODER . IOT intends to break the fixed order of layers in Transformer . As shown in introduction , simply reordering the layers w.r.t the whole corpus impacts little , while each data has its own preference to orders . Therefore , IOT incorporates instance-wise learning to adjust the favorable order for each data . As shown in Figure 1 , both encoder and decoder in IOT consist of several blocks of SA , ED , FF layer with dynamic order , and we assume there are M ( e.g. , M = 2 ) ordered encoders and N ( e.g. , N = 6 ) ordered decoders ( with shared weights ) . Inspired by the fact that lower training loss implies the higher proficiency confidence for candidate orders , we utilize the cross-entropy loss as signals to learn the confidence . That is , we calculate confidence γm and λn for each encoder encm , decoder decn ( resulted modelMm , n ) , and use them to weight the training loss LMm , n . To calculate the confidence , we add a simple and light predictor to help distinguish the orders . Training Given one source sequence x = [ x1 , x2 , ... , xTx ] , we first map each token into word embedding e = [ e1 , e2 , ... , eTx ] , where ei ∈ Rd , and then apply one light encoder predictor πenc to predict the confidence of encoder orders using sentence embedding se = 1Tx ∑Tx i=1 ei . Concretely , πenc takes se as input and predicts γm for encm by Gumbel-softmax ( Jang et al. , 2016 ) : γm = exp ( ( log ( πencm ) + gm ) /τe ) ∑M k=1 exp ( ( log ( πenck ) + gk ) /τe ) , πenc = softmax ( seWe ) , ( 1 ) where gm is sampled from Gumbel distribution : gm = − log ( − logUm ) , Um ∼ Uniform ( 0 , 1 ) , We ∈ Rd×M is the weight matrix , τe is a constant temperature to control the distribution to be identical approximation with categorical distribution . Simultaneously , the token embeddings e will feed to the encoders to get hidden states h = [ h1 , h2 , ... , hTx ] , then we can calculate decoder order confidence λn by one predictor πdec in the same way as πenc : λn = exp ( ( log ( πdecn ) + gn ) /τd ) ∑N k=1 exp ( ( log ( πdeck ) + gk ) /τd ) , πdec = softmax ( sdWd ) , ( 2 ) where sd = 1Tx ∑Tx i=1 hi and Wd is the weight matrix . For each ordered path through encm and decn , we can obtain the training loss LMm , n , and the final cross-entropy loss is weighted by confidence γm and λn with LMm , n , formulately as : LC = M∑ m=1 N∑ n=1 ( γm · λn ) LMm , n . ( 3 ) Inference During inference , we directly replace the Gumbel-softmax used in training with argmax , in order to choose the most capable encoder and decoder for each sequence x : enc = argmax ( seWe ) , dec = argmax ( sdWd ) . ( 4 ) Discussion The decoding process is almost the same as standard Transformer , with only little overhead for order predictions . One may concern the training cost is increased through our training . As we present in Section 5.1 , the cost is actually affordable with a fast convergence . Currently , we reorder the layers of the encoder/decoder block and stack the same ordered block L times ( see Figure 1 ) . A complex extension is to reorder all L blocks of encoder/decoder and we take it as future work .
This work explores instance-wise layer re-ordering in transformers. The key idea is to incorporate classifiers that predict the ordering of sub-layers (self-attention, cross-attention, feed-forward) from the averaged input sequence representation, one classifier each for the encoder and the decoder. During training the model uses a soft Gumbel-noised output of the classifier to combine the outputs from stacks with differently ordered sub-layers. During inference the argmax of the classifier prediction is used to generate the output sequence. The model is trained with two auxiliary losses: (i) A loss to ensure the expected output of the classifiers is uniform and (ii) A loss to ensure the classifier output for each individual sample is distant from uniform.
SP:73630ddbe2f83647f099f921abb79b2c0f937aa9
IOT: Instance-wise Layer Reordering for Transformer Structures
1 INTRODUCTION . Transformer ( Vaswani et al. , 2017 ) has been the dominant architecture in deep learning models ( Hassan et al. , 2018 ; Ng et al. , 2019 ; Carion et al. , 2020 ; Radford et al. , 2019 ; Dai et al. , 2019 ; Lee et al. , 2019 ; Devlin et al. , 2018 ; Yang et al. , 2019 ; Cai & Lam , 2019 ) . A Transformer model is stacked by several identical blocks , and each block consists of sequentially ordered layers : the self-attention ( SA ) , encoder-decoder attention ( ED ) ( decoder only ) and feed-forward ( FF ) layer . Recently , various modifications have been proposed , where the focus is on replacing or inserting some components ( e.g. , attention layer/layer norm/position encoding ) in standard Transformer ( Wu et al. , 2019 ; Lu et al. , 2019 ; Shaw et al. , 2018 ; So et al. , 2019 ; Ahmed et al. , 2017 ) . Despite these Transformer alternatives have achieved improved performances , one critical element is almost neglected in current models , which is how to arrange the components within a Transformer network , i.e. , the layer order also matters . As pointed by He et al . ( 2016b ) , different orders of ReLU , batch normalization and residual connection significantly affect the performance of ResNet ( He et al. , 2016a ) . Therefore , we ask : What if we reorder the sequential layers in Transformer ( e.g. , SA→FF or FF→SA of encoder , SA→FF→ED or FF→ED→SA of decoder ) ? What is the best order for these different layers ? ∗Equal contribution and corresponding authors . 1https : //github.com/instance-wise-ordered-transformer/IOT We first conduct preliminary experiments . We vary the three layers in decoder with all six variants ( each with a unique order of the three layers ) and train these models . Results on IWSLT14 German→English translation are reported in Table 1 . As we can see , their performances are similar and no one is outstanding . The corpus BLEU variance is only 0.0045 , which means that simply reordering the layers and training over the whole corpus impacts little . Press et al . ( 2019 ) also reported this for machine translation , but they stopped here . This seems to be a negative answer . However , we take a further step and ask one more question : Does different data favor different ordered layers ? That is , we investigate whether each specific data has its own preference for one particular order . Intuitively , putting various data patterns in one order should not be the best choice . For example , harder samples may favor a particular order while easier ones favor another one . Thus , for each order , we count the ratio of samples that achieve the best score with that order . In Table 1 , we find they almost lie on a uniform distribution ( e.g. , 17.9 % samples achieve the best BLEU with order SA→ED→FF ) . Besides , we calculate the BLEU variance for each sample , and average all these variances , the result is 114.76 , which is much larger than above corpus variance ( 0.0045 ) . These both mean the data indeed has its own preference to different orders . In Table 2 , we present translations from all decoders for on example with BLEU and TER score to give an evidence . Motivated by above observations , in this work , we present Instance-wise Ordered Transformer ( IOT ) , in which the layer order is determined by the specific data through instance-wise learning . To achieve this , we utilize a light predictor to predict the confidence for each order , given the corresponding classification losses as training signals . However , directly training the predictor with conventional ( i.e. , NMT ) loss tends to quickly converge to a bad order , and ignore explorations on others . Thus , we introduce an exploration loss and an exploitation loss to make an effective training while keeping an unambiguous prediction for each data so that the best order can be decided during inference . We evaluate our approach on 3 sequence generation tasks , including neural machine translation ( NMT ) , abstractive summarization ( ABS ) and code generation ( CG ) . For NMT , we work on 8 IWSLT and 2 WMT tasks , both on low-resource and rich-resource scenarios . Our method can consistently obtain 1.0 BELU score improvements over Transformer . For ABS , IOT also outperforms Transformer and other baselines on Gigaword dataset . For CG tasks , the results on 2 large-scale real-world code datasets ( Java and Python ) collected from Github surpass the state-of-the-art performances . These all demonstrate the effectiveness of our IOT . Furthermore , we provide detailed studies to verify that the instance-wise learning and order selection make a reasonable and necessary modeling . The contributions of this work can be summarized as follows : • We are the first to leverage instance-wise learning for layer order selection in a Transformer model ( with shared parameters ) , and we demonstrate the instance-wise learning is critical . • We demonstrate our learning approach can be universally applied to other structures beside Transformer ( e.g. , Dynamic Convolutions ) , as long as there are multiple different layers . • Experiments on 3 sequence generation tasks and 9 datasets verify the effectiveness of IOT with consistent performance improvements . 2 RELATED WORK . Architecture Exploration Inventing novel architectures by human designing or automatic searching plays an important role in deep learning . Specific to Transformer structures , various modifications have been proposed . For example , human knowledge powered designs include DynamicConv ( Wu et al. , 2019 ) , Macaron Network ( Lu et al. , 2019 ) , Reformer ( Kitaev et al. , 2020 ) and others ( Fonollosa et al. , 2019 ; Ahmed et al. , 2017 ; Shaw et al. , 2018 ) . As for automatic searching , neural architecture Feed Forward 𝑋 ! 𝑋 '' 𝑋 # 𝑌 '' 𝑌 # 𝑌 ! L x Pred L x Weight Tying Encoder DecoderInput Output Self Attention Self Attention Enc-Dec Attention Feed Forward Self Attention Enc-Dec Attention Feed Forward Feed Forward Self Attention Pred Weight Tying Figure 1 : The IOT framework . Pred means the light predictor introduced in 3.1 for order selection . We show two ordered encoders/decoders here . After taking X1 , X2 , X3 , the selected order for Y2 , Y3 is the lower encoder and upper decoder , while for Y1 is the upper encoder and lower decoder . search can discover networks with state-of-the-art performances but always with complicated computation , i.e. , Evolved Transformer ( So et al. , 2019 ) . The underlying principle is to add or replace some components of Transformer . For instance , Wu et al . ( 2019 ) replace self-attention with dynamic convolution , So et al . ( 2019 ) add a separate convolution layer in a new branch . Different from them , we , instead , only focus on the selection of layer orders for each data sample so as to improve the model performance , without a heavy modification . Besides , our approach is structure agnostic , which can be universally applied to other structures , only if multiple different layers exist . Instance-wise Learning Deep learning models are trained over large-scale datasets , and data samples are often treated equally without modeling the difference between them . Some works attempt to weight each data with different importance ( Ren et al. , 2018 ; Hu et al. , 2019 ; Chang et al. , 2017 ) or feed data with curriculum learning according to its difficulty ( Bengio et al. , 2009 ; Fan et al. , 2018 ) . However , they often explicitly manipulate the data during training only , while no distinction exists in inference , and under one fixed model . Elbayad et al . ( 2020 ) take a step further and propose the depth-adaptive Transformer , which can forecast different depths of the network by predicting the required computation for a particular data . Similarly , Liu et al . ( 2020 ) propose a sample-wise adaptive mechanism to dynamically calculate the number of required layers . They both aim at reducing the computation cost and speed up the inference . Schwartz et al . ( 2020 ) , Bapna et al . ( 2020 ) and Shazeer et al . ( 2017 ) all leverage conditional computation for each sample to control the computation and accuracy tradeoff during inference . Instead , we pay attention to the variant modeling functions and perform instance-wise order selection in order to boost the Transformer performance . The most related work is Press et al . ( 2019 ) , which manually generates randomly ordered Transformer encoders and finds the Sandwich Transformer can slightly reduce the perplexity of language modeling . However , they find that Sandwich Transformer pattern has no effect on NMT task . Besides , it still performs over the whole corpus without considering each specific data . We , instead , investigate on various sequence-to-sequence generation tasks and greatly improve the task performances through instance-wise learning , so as to discover the optimal ordered Transformer for each particular data . 3 INSTANCE-WISE ORDERED TRANSFORMER . The overall framework of IOT is presented in Figure 1 . In comparison with the standard Transformer , IOT only incorporates light-weighted predictors and reorders the encoder/decoder with weight tying , under the constraint of almost same number of parameters and exempt from heavy modifications . In this section , we introduce the details of IOT , including training , inference and discussions . Notations Sequence-to-sequence learning aims to map one sequence x = [ x1 , x2 , ... , xTx ] into another sequence y = [ y1 , y2 , ... , yTy ] , where xi , yj denotes the i-th and j-th token of x and y , Tx and Ty are the corresponding lengths . Given one sentence pair ( x , y ) and a learning modelM , we can define the training objective as minimizing the cross-entropy loss LM = − ∑Ty j=1 logP ( yj |y < j , x ) . Besides , DKL ( P‖Q ) denotes the Kullback-Leibler ( KL ) divergence between distributions P and Q . 3.1 INSTANCE-WISE ENCODER/DECODER . IOT intends to break the fixed order of layers in Transformer . As shown in introduction , simply reordering the layers w.r.t the whole corpus impacts little , while each data has its own preference to orders . Therefore , IOT incorporates instance-wise learning to adjust the favorable order for each data . As shown in Figure 1 , both encoder and decoder in IOT consist of several blocks of SA , ED , FF layer with dynamic order , and we assume there are M ( e.g. , M = 2 ) ordered encoders and N ( e.g. , N = 6 ) ordered decoders ( with shared weights ) . Inspired by the fact that lower training loss implies the higher proficiency confidence for candidate orders , we utilize the cross-entropy loss as signals to learn the confidence . That is , we calculate confidence γm and λn for each encoder encm , decoder decn ( resulted modelMm , n ) , and use them to weight the training loss LMm , n . To calculate the confidence , we add a simple and light predictor to help distinguish the orders . Training Given one source sequence x = [ x1 , x2 , ... , xTx ] , we first map each token into word embedding e = [ e1 , e2 , ... , eTx ] , where ei ∈ Rd , and then apply one light encoder predictor πenc to predict the confidence of encoder orders using sentence embedding se = 1Tx ∑Tx i=1 ei . Concretely , πenc takes se as input and predicts γm for encm by Gumbel-softmax ( Jang et al. , 2016 ) : γm = exp ( ( log ( πencm ) + gm ) /τe ) ∑M k=1 exp ( ( log ( πenck ) + gk ) /τe ) , πenc = softmax ( seWe ) , ( 1 ) where gm is sampled from Gumbel distribution : gm = − log ( − logUm ) , Um ∼ Uniform ( 0 , 1 ) , We ∈ Rd×M is the weight matrix , τe is a constant temperature to control the distribution to be identical approximation with categorical distribution . Simultaneously , the token embeddings e will feed to the encoders to get hidden states h = [ h1 , h2 , ... , hTx ] , then we can calculate decoder order confidence λn by one predictor πdec in the same way as πenc : λn = exp ( ( log ( πdecn ) + gn ) /τd ) ∑N k=1 exp ( ( log ( πdeck ) + gk ) /τd ) , πdec = softmax ( sdWd ) , ( 2 ) where sd = 1Tx ∑Tx i=1 hi and Wd is the weight matrix . For each ordered path through encm and decn , we can obtain the training loss LMm , n , and the final cross-entropy loss is weighted by confidence γm and λn with LMm , n , formulately as : LC = M∑ m=1 N∑ n=1 ( γm · λn ) LMm , n . ( 3 ) Inference During inference , we directly replace the Gumbel-softmax used in training with argmax , in order to choose the most capable encoder and decoder for each sequence x : enc = argmax ( seWe ) , dec = argmax ( sdWd ) . ( 4 ) Discussion The decoding process is almost the same as standard Transformer , with only little overhead for order predictions . One may concern the training cost is increased through our training . As we present in Section 5.1 , the cost is actually affordable with a fast convergence . Currently , we reorder the layers of the encoder/decoder block and stack the same ordered block L times ( see Figure 1 ) . A complex extension is to reorder all L blocks of encoder/decoder and we take it as future work .
This paper studies the influence of the arrangement order for the internal structure in a single-layer Transformer (they named it as layer order) on the performance. It makes a hypothesis that different layer order has an impact on the performance of the model, and the hypothesis is verified by experiments. Based on this hypothesis, a lightweight layer order predictor is designed to predict an input-related layer order, and through reinforcement learning with two auxiliary loss, the model can not only be trained by diverse layer order, but also make unambiguous layer order prediction as far as possible. The IOT structure proposed in this paper has been evaluated on several datasets of machine translation, abstract summarization and code generation. Compared with the traditional transformer structure, it has been improved consistently, which shows the effectiveness of the proposed structure.
SP:73630ddbe2f83647f099f921abb79b2c0f937aa9
Gauge Equivariant Mesh CNNs: Anisotropic convolutions on geometric graphs
A common approach to define convolutions on meshes is to interpret them as a graph and apply graph convolutional networks ( GCNs ) . Such GCNs utilize isotropic kernels and are therefore insensitive to the relative orientation of vertices and thus to the geometry of the mesh as a whole . We propose Gauge Equivariant Mesh CNNs which generalize GCNs to apply anisotropic gauge equivariant kernels . Since the resulting features carry orientation information , we introduce a geometric message passing scheme defined by parallel transporting features over mesh edges . Our experiments validate the significantly improved expressivity of the proposed model over conventional GCNs and other methods . 1 INTRODUCTION . Convolutional neural networks ( CNNs ) have been established as the default method for many machine learning tasks like speech recognition or planar and volumetric image classification and segmentation . Most CNNs are restricted to flat or spherical geometries , where convolutions are easily defined and optimized implementations are available . The empirical success of CNNs on such spaces has generated interest to generalize convolutions to more general spaces like graphs or Riemannian manifolds , creating a field now known as geometric deep learning ( Bronstein et al. , 2017 ) . A case of specific interest is convolution on meshes , the discrete analog of 2-dimensional embedded Riemannian manifolds . Mesh CNNs can be applied to tasks such as detecting shapes , registering different poses of the same shape and shape segmentation . If we forget the positions of vertices , and which vertices form faces , a mesh M can be represented by a graph G. This allows for the application of graph convolutional networks ( GCNs ) to processing signals on meshes . ∗Equal Contribution †Qualcomm AI Research is an initiative of Qualcomm Technologies , Inc . However , when representing a mesh by a graph , we lose important geometrical information . In particular , in a graph there is no notion of angle between or ordering of two of a node ’ s incident edges ( see figure 1 ) . Hence , a GCNs output at a node p is designed to be independent of relative angles and invariant to any permutation of its neighbours qi ∈ N ( p ) . A graph convolution on a mesh graph therefore corresponds to applying an isotropic convolution kernel . Isotropic filters are insensitive to the orientation of input patterns , so their features are strictly less expressive than those of orientation aware anisotropic filters . To address this limitation of graph networks we propose Gauge Equivariant Mesh CNNs ( GEM-CNN ) , which minimally modify GCNs such that they are able to use anisotropic filters while sharing weights across different positions and respecting the local geometry . One obstacle in sharing anisotropic kernels , which are functions of the angle θpq of neighbour q with respect to vertex p , over multiple vertices of a mesh is that there is no unique way of selecting a reference neighbour q0 , which has the direction θpq0 = 0 . The reference neighbour , and hence the orientation of the neighbours , needs to be chosen arbitrarily . In order to guarantee the equivalence of the features resulting from different choices of orientations , we adapt Gauge Equivariant CNNs ( Cohen et al. , 2019b ) to general meshes . The kernels of our model are thus designed to be equivariant under gauge transformations , that is , to guarantee that the responses for different kernel orientations are related by a prespecified transformation law . Such features are identified as geometric objects like scalars , vectors , tensors , etc. , depending on the specific choice of transformation law . In order to compare such geometric features at neighbouring vertices , they need to be parallel transported along the connecting edge . In our implementation we first specify the transformation laws of the feature spaces and compute a space of gauge equivariant kernels . Then we pick arbitrary reference orientations at each node , relative to which we compute neighbour orientations and compute the corresponding edge transporters . Given these quantities , we define the forward pass as a message passing step via edge transporters followed by a contraction with the equivariant kernels evaluated at the neighbour orientations . Algorithmically , Gauge Equivariant Mesh CNNs are therefore just GCNs with anisotropic , gauge equivariant kernels and message passing via parallel transporters . Conventional GCNs are covered in this framework for the specific choice of isotropic kernels and trivial edge transporters , given by identity maps . In Sec . 2 , we will give an outline of our method , deferring details to Secs . 3 and 4 . In Sec . 3.2 , we describe how to compute general geometric quantities , not specific to our method , used for the computation of the convolution . In our experiments in Sec . 6.1 , we find that the enhanced expressiveness of Gauge Equivariant Mesh CNNs enables them to outperform conventional GCNs and other prior work in a shape correspondence task . 2 CONVOLUTIONS ON GRAPHS WITH GEOMETRY . We consider the problem of processing signals on discrete 2-dimensional manifolds , or meshes M . Such meshes are described by a set V of vertices in R3 together with a set F of tuples , each consisting of the vertices at the corners of a face . For a mesh to describe a proper manifold , each edge needs to be connected to two faces , and the neighbourhood of each vertex needs to be homeomorphic to a disk . Mesh M induces a graph G by forgetting the coordinates of the vertices while preserving the edges . A conventional graph convolution between kernel K and signal f , evaluated at a vertex p , can be defined by ( K ? f ) p = Kselffp + ∑ q∈Np Kneighfq , ( 1 ) where Np is the set of neighbours of p in G , and Kself ∈ RCin×Cout and Kneigh ∈ RCin×Cout are two linear maps which model a self interaction and the neighbour contribution , respectively . Importantly , graph convolution does not distinguish different neighbours , because each feature vector fq is multiplied by the same matrix Kneigh and then summed . For this reason we say the kernel is isotropic . Consider the example in figure 1 , where on the left and right , the neighbourhood of one vertex p , containing neighbours q ∈ Np , is visualized . An isotropic kernel would propagate the signal from the neighbours to p in exactly the same way in both neighbourhoods , even though the neighbourhoods are geometrically distinct . For this reason , our method uses direction sensitive ( anisotropic ) kernels instead of isotropic kernels . Anisotropic kernels are inherently more expressive than isotropic ones which is why they are used universally in conventional planar CNNs . Algorithm 1 Gauge Equivariant Mesh CNN layer Input : mesh M , input/output feature types ρin , ρout , reference neighbours ( qp0 ∈ Np ) p∈M . Compute basis kernels Kiself , K i neigh ( θ ) B Sec . 3 Initialise weights wiself and w i neigh . For each neighbour pair , p ∈M , q ∈ Np : B App . A. compute neighbor angles θpq relative to reference neighbor compute parallel transporters gq→p Forward ( input features ( fp ) p∈M , weights wiself , w i neigh ) : f ′p ← ∑ i w i selfK i selffp + ∑ i , q∈Npw i neighK i neigh ( θpq ) ρin ( gq→p ) fq We propose the Gauge Equivariant Mesh Convolution , a minimal modification of graph convolution that allows for anisotropic kernels K ( θ ) whose value depends on an orientation θ ∈ [ 0 , 2π ) .1 To define the orientations θpq of neighbouring vertices q ∈ Np of p , we first map them to the tangent plane TpM at p , as visualized in figure 1 . We then pick an arbitrary reference neighbour q p 0 to determine a reference orientation2 θpqp0 : = 0 , marked orange in figure 1 . This induces a basis on the tangent plane , which , when expressed in polar coordinates , defines the angles θpq of the other neighbours . As we will motivate in the next section , features in a Gauge Equivariant CNN are coefficients of geometric quantities . For example , a tangent vector at vertex p can be described either geometrically by a 3 dimensional vector orthogonal to the normal at p or by two coefficients in the basis on the tangent plane . In order to perform convolution , geometric features at different vertices need to be linearly combined , for which it is required to first “ parallel transport ” the features to the same vertex . This is done by applying a matrix ρ ( gq→p ) ∈ RCin×Cin to the coefficients of the feature at q , in order to obtain the coefficients of the feature vector transported to p , which can be used for the convolution at p. The transporter depends on the geometric type ( group representation ) of the feature , denoted by ρ and described in more detail below . Details of how the tangent space is defined , how to compute the map to the tangent space , angles θpq , and the parallel transporter are given in Appendix A . In combination , this leads to the GEM-CNN convolution ( K ? f ) p = Kselffp + ∑ q∈Np Kneigh ( θpq ) ρ ( gq→p ) fq ( 2 ) which differs from the conventional graph convolution , defined in Eq . 1 only by the use of an anisotropic kernel and the parallel transport message passing . We require the outcome of the convolution to be equivalent for any choice of reference orientation . This is not the case for any anisotropic kernel but only for those which are equivariant under changes of reference orientations ( gauge transformations ) . Equivariance imposes a linear constraint on the kernels . We therefore solve for complete sets of “ basis-kernels ” Kiself and K i neigh satisfying this constraint and linearly combine them with parameters wiself and w i neigh such that Kself = ∑ i w i selfK i self and Kneigh = ∑ i w i neighK i neigh . Details on the computation of basis kernels are given in section 3 . The full algorithm for initialisation and forward pass , which is of time and space complexity linear in the number of vertices , for a GEM-CNN layer are listed in algorithm 1 . Gradients can be computed by automatic differentiation . The GEM-CNN is gauge equivariant , but furthermore satisfies two important properties . Firstly , it depends only on the intrinsic shape of the 2D mesh , not on the embedding of the mesh in R3 . Secondly , whenever a map from the mesh to itself exists that preserves distances and orientation , the convolution is equivariant to moving the signal along such transformations . These properties are proven in Appendix D and empirically shown in Appendix F.2 . 1In principle , the kernel could be made dependent on the radial distance of neighboring nodes , by Kneigh ( r , θ ) = F ( r ) Kneigh ( θ ) , where F ( r ) is unconstrained and Kneigh ( θ ) as presented in this paper . As this dependency did not improve the performance in our empirical evaluation , we omit it . 2Mathematically , this corresponds to a choice of local reference frame or gauge . 3 GAUGE EQUIVARIANCE & GEOMETRIC FEATURES . On a general mesh , the choice of the reference neighbour , or gauge , which defines the orientation of the kernel , can only be made arbitrarily . However , this choice should not arbitrarily affect the outcome of the convolution , as this would impede the generalization between different locations and different meshes . Instead , Gauge Equivariant Mesh CNNs have the property that their output transforms according to a known rule as the gauge changes . Consider the left hand side of figure 2 ( a ) . Given a neighbourhood of vertex p , we want to express each neighbour q in terms of its polar coordinates ( rq , θq ) on the tangent plane , so that the kernel value at that neighbour Kneigh ( θq ) is well defined . This requires choosing a basis on the tangent plane , determined by picking a neighbour as reference neighbour ( denoted q0 ) , which has the zero angle θq0 = 0 . In the top path , we pick qA as reference neighbour . Let us call this gauge A , in which neighbours have angles θAq . In the bottom path , we instead pick neighbour qB as reference point and are in gauge B . We get a different basis for the tangent plane and different angles θBq for each neighbour . Comparing the two gauges , we see that they are related by a rotation , so that θBq = θ A q − θAqB . This change of gauge is called a gauge transformation of angle g : = θ A qB . In figure 2 ( a ) , we illustrate a gauge equivariant convolution that takes input and output features such as gray scale image values on the mesh , which are called scalar features . The top path represents the convolution in gauge A , the bottom path in gauge B . In either case , the convolution can be interpreted as consisting of three steps . First , for each vertex p , the value of the scalar features on the mesh at each neighbouring vertex q , represented by colors , is mapped to the tangent plane at p at angle θq defined by the gauge . Subsequently , the convolutional kernel sums for each neighbour q , the product of the feature at q and kernel K ( θq ) . Finally the output is mapped back to the mesh . These three steps can be composed into a single step , which we could call a geometric convolution , mapping from input features on the mesh to output features on the mesh . The convolution is gauge equivariant if this geometric convolution does not depend on the gauge we pick in the interim , so in figure 2 ( a ) , if the convolution in the top path in gauge A has same result the convolution in the bottom path in gauge B , making the diagram commute . In this case , however , we see that the convolution output needs to be the same in both gauges , for the convolution to be equivariant . Hence , we must have that K ( θq ) = K ( θq − g ) , as the orientations of the neighbours differ by some angle g , and the kernel must be isotropic . As we aim to design an anisotropic convolution , the output feature of the convolution at p can , instead of a scalar , be two numbers v ∈ R2 , which can be interpreted as coefficients of a tangent feature vector in the tangent space at p , visualized in figure 2 ( b ) . As shown on the right hand side , different gauges induce a different basis of the tangent plane , so that the same tangent vector ( shown on the middle right on the mesh ) , is represented by different coefficients in the gauge ( shown on the top and bottom on the right ) . This gauge equivariant convolution must be anisotropic : going from the top row to the bottom row , if we change orientations of the neighbours by −g , the coefficients of the output vector v ∈ R2 of the kernel must be also rotated by −g . This is written as R ( −g ) v , where R ( −g ) ∈ R2×2 is the matrix that rotates by angle −g . Vectors and scalars are not the only type of geometric features that can be inputs and outputs of a GEM-CNN layer . In general , the coefficients of a geometric feature of C dimensions changes by an invertible linear transformation ρ ( −g ) ∈ RC×C if the gauge is rotated by angle g. The map ρ : [ 0 , 2π ) → RC×C is called the type of the geometric quantity and is formally known as a group representation of the planar rotation group SO ( 2 ) . Group representations have the property that ρ ( g + h ) = ρ ( g ) ρ ( h ) ( they are group homomorphisms ) , which implies in particular that ρ ( 0 ) = 1 and ρ ( −g ) = ρ ( g ) −1 . For more background on group representation theory , we refer the reader to ( Serre , 1977 ) and , specifically in the context of equivariant deep learning , to ( Lang & Weiler , 2020 ) . From the theory of group representations , we know that any feature type can be composed from “ irreducible representations ” ( irreps ) . For SO ( 2 ) , these are the one dimensional invariant scalar representation ρ0 and for all n ∈ N > 0 , a two dimensional representation ρn , ρ0 ( g ) = 1 , ρn ( g ) = ( cosng 9 sinng sinng cosng ) . where we write , for example , ρ = ρ0 ⊕ ρ1 ⊕ ρ1 to denote that representation ρ ( g ) is the direct sum ( i.e . block-diagonal stacking ) of the matrices ρ0 ( g ) , ρ1 ( g ) , ρ1 ( g ) . Scalars and tangent vector features correspond to ρ0 and ρ1 respectively and we have R ( g ) = ρ1 ( g ) . The type of the feature at each layer in the network can thus be fully specified ( up to a change of basis ) by the number of copies of each irrep . Similar to the dimensionality in a conventional CNN , the choice of type is a hyperparameter that can be freely chosen to optimize performance .
Although a mesh embedded in 3D space may be treated as a graph, a graph convolution network uses the same weights for each neighbor and is thus permutation invariant, which is the incorrect inductive bias for a mesh: the neighbors of a node are spatially related and may not be arbitrarily permuted. CNNs, GCNs, and G-CNNs demonstrate the value of a weight sharing scheme which correctly reflects the symmetry of the underlying space of the data. The authors argue convincingly that for a signal on a mesh, the appropriate bias is symmetry to local change-of-gauge. In short, the weights should depend on the relative orientation of a node’s neighbors. They design a network GEM-CNN which is equivariant to change of gauge. The design is similar to a GCN but incorporates parallel transport to account for underlying geometry and uses kernels similar to those of $SO(2)$-equivariant $E(2)$-CNN (Weiler & Cesa 2019). The experiments show the network is able to adapt to different mesh geometries and obtain very high accuracy in the shape correspondence task.
SP:fa852f6d762a09e601ec0d78694c23155548b214
Gauge Equivariant Mesh CNNs: Anisotropic convolutions on geometric graphs
A common approach to define convolutions on meshes is to interpret them as a graph and apply graph convolutional networks ( GCNs ) . Such GCNs utilize isotropic kernels and are therefore insensitive to the relative orientation of vertices and thus to the geometry of the mesh as a whole . We propose Gauge Equivariant Mesh CNNs which generalize GCNs to apply anisotropic gauge equivariant kernels . Since the resulting features carry orientation information , we introduce a geometric message passing scheme defined by parallel transporting features over mesh edges . Our experiments validate the significantly improved expressivity of the proposed model over conventional GCNs and other methods . 1 INTRODUCTION . Convolutional neural networks ( CNNs ) have been established as the default method for many machine learning tasks like speech recognition or planar and volumetric image classification and segmentation . Most CNNs are restricted to flat or spherical geometries , where convolutions are easily defined and optimized implementations are available . The empirical success of CNNs on such spaces has generated interest to generalize convolutions to more general spaces like graphs or Riemannian manifolds , creating a field now known as geometric deep learning ( Bronstein et al. , 2017 ) . A case of specific interest is convolution on meshes , the discrete analog of 2-dimensional embedded Riemannian manifolds . Mesh CNNs can be applied to tasks such as detecting shapes , registering different poses of the same shape and shape segmentation . If we forget the positions of vertices , and which vertices form faces , a mesh M can be represented by a graph G. This allows for the application of graph convolutional networks ( GCNs ) to processing signals on meshes . ∗Equal Contribution †Qualcomm AI Research is an initiative of Qualcomm Technologies , Inc . However , when representing a mesh by a graph , we lose important geometrical information . In particular , in a graph there is no notion of angle between or ordering of two of a node ’ s incident edges ( see figure 1 ) . Hence , a GCNs output at a node p is designed to be independent of relative angles and invariant to any permutation of its neighbours qi ∈ N ( p ) . A graph convolution on a mesh graph therefore corresponds to applying an isotropic convolution kernel . Isotropic filters are insensitive to the orientation of input patterns , so their features are strictly less expressive than those of orientation aware anisotropic filters . To address this limitation of graph networks we propose Gauge Equivariant Mesh CNNs ( GEM-CNN ) , which minimally modify GCNs such that they are able to use anisotropic filters while sharing weights across different positions and respecting the local geometry . One obstacle in sharing anisotropic kernels , which are functions of the angle θpq of neighbour q with respect to vertex p , over multiple vertices of a mesh is that there is no unique way of selecting a reference neighbour q0 , which has the direction θpq0 = 0 . The reference neighbour , and hence the orientation of the neighbours , needs to be chosen arbitrarily . In order to guarantee the equivalence of the features resulting from different choices of orientations , we adapt Gauge Equivariant CNNs ( Cohen et al. , 2019b ) to general meshes . The kernels of our model are thus designed to be equivariant under gauge transformations , that is , to guarantee that the responses for different kernel orientations are related by a prespecified transformation law . Such features are identified as geometric objects like scalars , vectors , tensors , etc. , depending on the specific choice of transformation law . In order to compare such geometric features at neighbouring vertices , they need to be parallel transported along the connecting edge . In our implementation we first specify the transformation laws of the feature spaces and compute a space of gauge equivariant kernels . Then we pick arbitrary reference orientations at each node , relative to which we compute neighbour orientations and compute the corresponding edge transporters . Given these quantities , we define the forward pass as a message passing step via edge transporters followed by a contraction with the equivariant kernels evaluated at the neighbour orientations . Algorithmically , Gauge Equivariant Mesh CNNs are therefore just GCNs with anisotropic , gauge equivariant kernels and message passing via parallel transporters . Conventional GCNs are covered in this framework for the specific choice of isotropic kernels and trivial edge transporters , given by identity maps . In Sec . 2 , we will give an outline of our method , deferring details to Secs . 3 and 4 . In Sec . 3.2 , we describe how to compute general geometric quantities , not specific to our method , used for the computation of the convolution . In our experiments in Sec . 6.1 , we find that the enhanced expressiveness of Gauge Equivariant Mesh CNNs enables them to outperform conventional GCNs and other prior work in a shape correspondence task . 2 CONVOLUTIONS ON GRAPHS WITH GEOMETRY . We consider the problem of processing signals on discrete 2-dimensional manifolds , or meshes M . Such meshes are described by a set V of vertices in R3 together with a set F of tuples , each consisting of the vertices at the corners of a face . For a mesh to describe a proper manifold , each edge needs to be connected to two faces , and the neighbourhood of each vertex needs to be homeomorphic to a disk . Mesh M induces a graph G by forgetting the coordinates of the vertices while preserving the edges . A conventional graph convolution between kernel K and signal f , evaluated at a vertex p , can be defined by ( K ? f ) p = Kselffp + ∑ q∈Np Kneighfq , ( 1 ) where Np is the set of neighbours of p in G , and Kself ∈ RCin×Cout and Kneigh ∈ RCin×Cout are two linear maps which model a self interaction and the neighbour contribution , respectively . Importantly , graph convolution does not distinguish different neighbours , because each feature vector fq is multiplied by the same matrix Kneigh and then summed . For this reason we say the kernel is isotropic . Consider the example in figure 1 , where on the left and right , the neighbourhood of one vertex p , containing neighbours q ∈ Np , is visualized . An isotropic kernel would propagate the signal from the neighbours to p in exactly the same way in both neighbourhoods , even though the neighbourhoods are geometrically distinct . For this reason , our method uses direction sensitive ( anisotropic ) kernels instead of isotropic kernels . Anisotropic kernels are inherently more expressive than isotropic ones which is why they are used universally in conventional planar CNNs . Algorithm 1 Gauge Equivariant Mesh CNN layer Input : mesh M , input/output feature types ρin , ρout , reference neighbours ( qp0 ∈ Np ) p∈M . Compute basis kernels Kiself , K i neigh ( θ ) B Sec . 3 Initialise weights wiself and w i neigh . For each neighbour pair , p ∈M , q ∈ Np : B App . A. compute neighbor angles θpq relative to reference neighbor compute parallel transporters gq→p Forward ( input features ( fp ) p∈M , weights wiself , w i neigh ) : f ′p ← ∑ i w i selfK i selffp + ∑ i , q∈Npw i neighK i neigh ( θpq ) ρin ( gq→p ) fq We propose the Gauge Equivariant Mesh Convolution , a minimal modification of graph convolution that allows for anisotropic kernels K ( θ ) whose value depends on an orientation θ ∈ [ 0 , 2π ) .1 To define the orientations θpq of neighbouring vertices q ∈ Np of p , we first map them to the tangent plane TpM at p , as visualized in figure 1 . We then pick an arbitrary reference neighbour q p 0 to determine a reference orientation2 θpqp0 : = 0 , marked orange in figure 1 . This induces a basis on the tangent plane , which , when expressed in polar coordinates , defines the angles θpq of the other neighbours . As we will motivate in the next section , features in a Gauge Equivariant CNN are coefficients of geometric quantities . For example , a tangent vector at vertex p can be described either geometrically by a 3 dimensional vector orthogonal to the normal at p or by two coefficients in the basis on the tangent plane . In order to perform convolution , geometric features at different vertices need to be linearly combined , for which it is required to first “ parallel transport ” the features to the same vertex . This is done by applying a matrix ρ ( gq→p ) ∈ RCin×Cin to the coefficients of the feature at q , in order to obtain the coefficients of the feature vector transported to p , which can be used for the convolution at p. The transporter depends on the geometric type ( group representation ) of the feature , denoted by ρ and described in more detail below . Details of how the tangent space is defined , how to compute the map to the tangent space , angles θpq , and the parallel transporter are given in Appendix A . In combination , this leads to the GEM-CNN convolution ( K ? f ) p = Kselffp + ∑ q∈Np Kneigh ( θpq ) ρ ( gq→p ) fq ( 2 ) which differs from the conventional graph convolution , defined in Eq . 1 only by the use of an anisotropic kernel and the parallel transport message passing . We require the outcome of the convolution to be equivalent for any choice of reference orientation . This is not the case for any anisotropic kernel but only for those which are equivariant under changes of reference orientations ( gauge transformations ) . Equivariance imposes a linear constraint on the kernels . We therefore solve for complete sets of “ basis-kernels ” Kiself and K i neigh satisfying this constraint and linearly combine them with parameters wiself and w i neigh such that Kself = ∑ i w i selfK i self and Kneigh = ∑ i w i neighK i neigh . Details on the computation of basis kernels are given in section 3 . The full algorithm for initialisation and forward pass , which is of time and space complexity linear in the number of vertices , for a GEM-CNN layer are listed in algorithm 1 . Gradients can be computed by automatic differentiation . The GEM-CNN is gauge equivariant , but furthermore satisfies two important properties . Firstly , it depends only on the intrinsic shape of the 2D mesh , not on the embedding of the mesh in R3 . Secondly , whenever a map from the mesh to itself exists that preserves distances and orientation , the convolution is equivariant to moving the signal along such transformations . These properties are proven in Appendix D and empirically shown in Appendix F.2 . 1In principle , the kernel could be made dependent on the radial distance of neighboring nodes , by Kneigh ( r , θ ) = F ( r ) Kneigh ( θ ) , where F ( r ) is unconstrained and Kneigh ( θ ) as presented in this paper . As this dependency did not improve the performance in our empirical evaluation , we omit it . 2Mathematically , this corresponds to a choice of local reference frame or gauge . 3 GAUGE EQUIVARIANCE & GEOMETRIC FEATURES . On a general mesh , the choice of the reference neighbour , or gauge , which defines the orientation of the kernel , can only be made arbitrarily . However , this choice should not arbitrarily affect the outcome of the convolution , as this would impede the generalization between different locations and different meshes . Instead , Gauge Equivariant Mesh CNNs have the property that their output transforms according to a known rule as the gauge changes . Consider the left hand side of figure 2 ( a ) . Given a neighbourhood of vertex p , we want to express each neighbour q in terms of its polar coordinates ( rq , θq ) on the tangent plane , so that the kernel value at that neighbour Kneigh ( θq ) is well defined . This requires choosing a basis on the tangent plane , determined by picking a neighbour as reference neighbour ( denoted q0 ) , which has the zero angle θq0 = 0 . In the top path , we pick qA as reference neighbour . Let us call this gauge A , in which neighbours have angles θAq . In the bottom path , we instead pick neighbour qB as reference point and are in gauge B . We get a different basis for the tangent plane and different angles θBq for each neighbour . Comparing the two gauges , we see that they are related by a rotation , so that θBq = θ A q − θAqB . This change of gauge is called a gauge transformation of angle g : = θ A qB . In figure 2 ( a ) , we illustrate a gauge equivariant convolution that takes input and output features such as gray scale image values on the mesh , which are called scalar features . The top path represents the convolution in gauge A , the bottom path in gauge B . In either case , the convolution can be interpreted as consisting of three steps . First , for each vertex p , the value of the scalar features on the mesh at each neighbouring vertex q , represented by colors , is mapped to the tangent plane at p at angle θq defined by the gauge . Subsequently , the convolutional kernel sums for each neighbour q , the product of the feature at q and kernel K ( θq ) . Finally the output is mapped back to the mesh . These three steps can be composed into a single step , which we could call a geometric convolution , mapping from input features on the mesh to output features on the mesh . The convolution is gauge equivariant if this geometric convolution does not depend on the gauge we pick in the interim , so in figure 2 ( a ) , if the convolution in the top path in gauge A has same result the convolution in the bottom path in gauge B , making the diagram commute . In this case , however , we see that the convolution output needs to be the same in both gauges , for the convolution to be equivariant . Hence , we must have that K ( θq ) = K ( θq − g ) , as the orientations of the neighbours differ by some angle g , and the kernel must be isotropic . As we aim to design an anisotropic convolution , the output feature of the convolution at p can , instead of a scalar , be two numbers v ∈ R2 , which can be interpreted as coefficients of a tangent feature vector in the tangent space at p , visualized in figure 2 ( b ) . As shown on the right hand side , different gauges induce a different basis of the tangent plane , so that the same tangent vector ( shown on the middle right on the mesh ) , is represented by different coefficients in the gauge ( shown on the top and bottom on the right ) . This gauge equivariant convolution must be anisotropic : going from the top row to the bottom row , if we change orientations of the neighbours by −g , the coefficients of the output vector v ∈ R2 of the kernel must be also rotated by −g . This is written as R ( −g ) v , where R ( −g ) ∈ R2×2 is the matrix that rotates by angle −g . Vectors and scalars are not the only type of geometric features that can be inputs and outputs of a GEM-CNN layer . In general , the coefficients of a geometric feature of C dimensions changes by an invertible linear transformation ρ ( −g ) ∈ RC×C if the gauge is rotated by angle g. The map ρ : [ 0 , 2π ) → RC×C is called the type of the geometric quantity and is formally known as a group representation of the planar rotation group SO ( 2 ) . Group representations have the property that ρ ( g + h ) = ρ ( g ) ρ ( h ) ( they are group homomorphisms ) , which implies in particular that ρ ( 0 ) = 1 and ρ ( −g ) = ρ ( g ) −1 . For more background on group representation theory , we refer the reader to ( Serre , 1977 ) and , specifically in the context of equivariant deep learning , to ( Lang & Weiler , 2020 ) . From the theory of group representations , we know that any feature type can be composed from “ irreducible representations ” ( irreps ) . For SO ( 2 ) , these are the one dimensional invariant scalar representation ρ0 and for all n ∈ N > 0 , a two dimensional representation ρn , ρ0 ( g ) = 1 , ρn ( g ) = ( cosng 9 sinng sinng cosng ) . where we write , for example , ρ = ρ0 ⊕ ρ1 ⊕ ρ1 to denote that representation ρ ( g ) is the direct sum ( i.e . block-diagonal stacking ) of the matrices ρ0 ( g ) , ρ1 ( g ) , ρ1 ( g ) . Scalars and tangent vector features correspond to ρ0 and ρ1 respectively and we have R ( g ) = ρ1 ( g ) . The type of the feature at each layer in the network can thus be fully specified ( up to a change of basis ) by the number of copies of each irrep . Similar to the dimensionality in a conventional CNN , the choice of type is a hyperparameter that can be freely chosen to optimize performance .
The work presents a novel message passing GNN operator for meshes that is equivariant under gauge transformations. It achieves that by parallel transporting features along edges and spanning a space of gauge equivariant kernels. Further, a DFT-based non-linearity is proposed, which preserves the equivariance in the limit of sampling density. The method is evaluated on an MNIST toy experiment and the Faust shape correspondence task.
SP:fa852f6d762a09e601ec0d78694c23155548b214
Voting-based Approaches For Differentially Private Federated Learning
1 INTRODUCTION . With increasing ethical and legal concerns on leveraging private data , federated learning ( McMahan et al. , 2017 ) ( FL ) has emerged as a paradigm that allows agents to collaboratively train a centralized model without sharing local data . In this work , we consider two typical settings of federated learning : ( 1 ) Local agents are in large number , i.e. , learning user behavior over many mobile devices ( Hard et al. , 2018 ) . ( 2 ) Local agents are in small number with sufficient instances , i.e. , learning a health related model across multiple hospitals without sharing patients ’ data ( Huang et al. , 2019 ) . When implemented using secure multi-party computation ( SMC ) ( Bonawitz et al. , 2017 ) , federated learning eliminates the need for any agent to share its local data . However , it does not protect the agents or their users from inference attacks that combine the learned model with side information . Extensive studies have established that these attacks could lead to blatant reconstruction of the proprietary datasets ( Dinur & Nissim , 2003 ) and identification of individuals ( a legal liability for the participating agents ) ( Shokri et al. , 2017 ) . Motivated by this challenge , there had been a number of recent efforts ( Truex et al. , 2019b ; Geyer et al. , 2017 ; McMahan et al. , 2018 ) in developing federated learning methods with differential privacy ( DP ) , which is a well-established definition of privacy that provably prevents such attacks . Among the efforts , DP-FedAvg ( Geyer et al. , 2017 ; McMahan et al. , 2018 ) extends the NoisySGD method ( Song et al. , 2013 ; Abadi et al. , 2016 ) to the federated learning setting by adding Gaussian noise to the clipped accumulated gradient . The recent state-of-the-art DP-FedSGD ( Truex et al. , 2019b ) is under the same framework but with per-sample gradient clipping . A notable limitation for these gradient-based methods is that they require clipping the magnitude of gradients to τ and adding noise proportional to τ to every coordinate of the shared global model with d parameters . The clipping and perturbation steps introduce either large bias ( when τ is small ) or large variance ( when τ is large ) , which interferes the SGD convergence and makes it hard to scale up to largecapacity models . In Sec . 3 , we concretely demonstrate these limitations with examples and theory . Particularly , we show that the FedAvg may fail to decrease the loss function together with gradient clipping , and DP-FedAvg requires many outer-loop iterations ( i.e. , many rounds of communication to synchronize model parameters ) to converge under differential privacy . To avoid the gradient clipping , we propose to conduct the aggregation over the label space , as shown to be an effective approach in standard ( non-federated ) learning settings , i.e. , voting-based modelagnostic approaches ( Papernot et al. , 2017 ; 2018 ; Zhu et al. , 2020 ) . To achieve it , we relax the traditional federated learning setting to allow unlabeled public data at the server side . We also consider a more complete scenario for federated learning , where there are a large number of local agents or a limited number of local agents . The agent-level privacy as introduced in DP-FedAvg , works seamlessly with our setting having many agents . However , when there are few agents , hiding each data belonging to one specific agent becomes burdensome or unnecessary . To this end , we provide a more complete privacy notion , i.e. , agent-level and instance-level . Under each of the setting , we theoretically and empirically show that the proposed label aggregation method effectively removes the sensitivity issue caused by gradient clipping or noise addition , and achieves favorable privacy-utility trade-off compared to other DPFL algorithms . Our contributions are summarized as the following : 1 . We propose two voting-based DPFL algorithms via label aggregation ( PATE-FL and PrivateKNN-FL ) and demonstrate their clear advantages over gradient aggregation based DPFL methods ( e.g. , DP-FedAvg ) in terms of communication cost and scalability to high-capacity models . 2 . We provide provable differential privacy guarantees under two levels of granularity : agentlevel DP and instance-level DP . Each is natural in a particular regime of FL depending on the number of agents and the size of their data . 3 . Extensive evaluation demonstrates that our method improves the privacy-utility trade-off over randomized gradient-based approaches in both agent-level and instance-level cases . A remark of our novelty . Though PATE-FL and Private-kNN-FL are algorithmically similar to the original PATE ( Papernot et al. , 2018 ) and Private-KNN ( Zhu et al. , 2020 ) , they are not the same and we are adapting them to a new problem — federated learning . The adaptation itself is nontrivial and requires substantial technical innovations . We highlight three challenges below . • Several key DP techniques that contributed to the success of PATE and Private-KNN in the standard setting are no longer applicable ( e.g. , Privacy amplification by Sampling and Noisy Screening ) . This is partly due to that in standard private learning , the attacker only sees the final models ; but in FL , the attacker can eavesdrop in all network traffic . • Moreover , PATE and Private-kNN only provide instance-level DP . We show PATE-FL and Private-kNN-FL also satisfy the stronger agent-level DP . PATE-FL ’ s agent-level DP parameter is , surprisingly , a factor of 2 better than its instance-level DP parameter . And PrivatekNN-FL in addition enjoys a factor of k amplification for the instance-level DP . • A key challenge of FL is the data heterogeneity of individual agents , while PATE randomly splits the dataset so each teacher is identically distributed . The heterogeneity does not affect our privacy analysis but does make it unclear whether PATE would work . We are the first to report strong empirical evidence that the PATE-style DP algorithms remain highly effective in the non-iid case . 2 PRELIMINARY . In this section , we start with introducing the typical notations of federated learning and differential privacy . Then , two randomized gradient-based baselines , DP-FedAvg and DP-FedSGD , are introduced as the DPFL background . 2.1 FEDERATED LEARNING . Federated learning ( McMahan et al. , 2017 ; Bonawitz et al. , 2017 ; Mohassel & Zhang , 2017 ; Smith et al. , 2017 ) is a distributed machine learning framework that allows clients to collaboratively train a global model without sharing local data . We considerN agents , each agent i has ni data kept locally and privately from a party-specific domain distributionDi . C is the number of classes . The objective is to output a global model that performs well on the target ( server ) distribution . Most prior works consider the target distribution as a uniform distribution over the union of all local data , which is restrictive in practice . Here we consider an agnostic federated learning scenario ( Mohri et al. , 2019 ; Peng et al. , 2019c ) , where the server distributionDG can be different from all agent distributions . In light of this , we assume each agent has access to part of unlabeled server data drawn from the target distribution DG . FedAvg ( McMahan et al. , 2017 ) is a vanilla federated learning algorithm that we consider as a non-DP baseline . In this algorithm , a fraction of agents is sampled at each communication round with a probability q . Each selected agent downloads the shared global model and improves it by learning from local data using E iterations of stochastic gradient descent ( SGD ) . We denote this local update process as an inner loop . Only the gradient is sent to the server , where it is averaged with other selected agents ’ gradient to improve the global model . The global model is learned after T communication rounds , where each communication round is denoted as one outer loop . 2.2 DIFFERENTIAL PRIVACY FOR FEDERATED LEARNING . Differential privacy ( Dwork et al. , 2006 ) is a quantifiable and composable definition of privacy that provides provable guarantees against identification of individuals in a private dataset . Definition 1 . A randomized mechanism M : D → R with a domain D and range R satisfies ( , δ ) -differential privacy , if for any two adjacent datasets D , D′ ∈ D and for any subset of outputs S ⊆ R , it holds that Pr [ M ( D ) ∈ S ] ≤ e Pr [ M ( D′ ) ∈ S ] + δ . The definition applies to a variety of different granularity , depending on how the adjacent datasets are defined , i.e. , if we are to protect whether one agent participates into training , the neighboring datasets are defined by adding or removing the entire local data within that agent . It is known as agent-level ( user-level ) differential privacy , which has been investigated in DP-FedAvg ( Geyer et al. , 2017 ; McMahan et al. , 2018 ) . Compared to FedAvg , DP-FedAvg ( Figure 1 ) enforces clipping of peragent model gradient to a threshold S and adds noise to the scaled gradient before it is averaged at the server . Note that this DP notion is favored when data samples within one agent reveal the same sensitive information , e.g. , cell phone agents send the same message . However , when there are only a few agents , hiding the entire dataset from one agent becomes difficult and inappropriate . We then consider the instance-level DP , where the adjacent dataset is defined by differing one single training example . This definition is consistent with the standard non-federated learning differential privacy ( Abadi et al. , 2016 ; Bassily et al. , 2014 ; Chaudhuri et al. , 2011 ) . Model training with instance-level DP restricts the adversary ’ s power in detecting a specific training instance ’ s presence or absence . DP-FedSGD ( Truex et al. , 2019a ; Peterson et al. , 2019 ) , one such state-of-the-art for the instance-level DP , performs NoisySGD ( Abadi et al. , 2016 ) for a fixed number of iterations at each agent . The gradient updates are averaged on each communication round at the server , as shown in Figure 1 . SMC is a cryptographic technique that securely aggregates local updates before the server receives it . While SMC does not have a differential privacy guarantee , it can be combined with DP to amplify the privacy guarantee ( Bhowmick et al. , 2018 ; Agarwal et al. , 2018 ; Truex et al. , 2019b ) against attackers that eavesdrop what sent out by each agent . In our experiment , we assume that the aggregation is conducted by SMC for all privacy-preserving algorithms that we consider . 3 CHALLENGES FOR GRADIENT-BASED FEDERATED LEARNING . In this section , we highlight the main challenges of the conventional DPFL frameworks in terms of accuracy , convergence and communication cost . For other challenges , we refer the readers to a survey ( Kairouz et al. , 2019 ) . The details of DP-FedAvg are summarized in appendix algorithm section . 3.1 CHALLENGE 1 : BIASED GRADIENT ESTIMATION . Recent works ( Li et al. , 2018 ) have shown that the FedAvg may not converge well under heterogeneity ( e.g. , non-identical distributions ) . Here , we provide a simple example to show that the clipping step of DP-FedAvg may raise additional challenge . Example 2 ( clipping ) . Let N = 2 , each agent i ’ s local update is 4i ( E iterations of SGD ) . We enforce clipping of per-agent update4i by performing4i/max ( 1 , ||4i||2τ ) , where τ is the clipping threshold . Consider the special case when ||41||2 = τ+α and ||42||2 ≤ τ . Then the global update will be 12 ( τ41 ||41||2 +42 ) , which is biased . The unbiased global update shall be 12 ( 41 +42 ) . Such a simple example can be embedded in more realistic problems , causing substantial bias that leads to non-convergence .
The paper proposes two approaches (i.e., PATE-FL and Private-kNN-FL) to train a differentially private global model in a federated setting based on [1] and [2]. In PATE-FL, each client first trains a teacher model using their local dataset. The teacher models are used to make noisy predictions on a public dataset. Then, the public dataset with predicted labels is used to train a final model. In Private-kNN-FL, instead of training a teacher model, the prediction depends on the labels of the nearest neighbors. The experiments show that PATE-FL and Private-kNN-FL can outperform DP-FedAvg in terms of agent-level DP and instance-level DP, respectively.
SP:996e66b927181eb325cadb345bb51e96b8d46923
Voting-based Approaches For Differentially Private Federated Learning
1 INTRODUCTION . With increasing ethical and legal concerns on leveraging private data , federated learning ( McMahan et al. , 2017 ) ( FL ) has emerged as a paradigm that allows agents to collaboratively train a centralized model without sharing local data . In this work , we consider two typical settings of federated learning : ( 1 ) Local agents are in large number , i.e. , learning user behavior over many mobile devices ( Hard et al. , 2018 ) . ( 2 ) Local agents are in small number with sufficient instances , i.e. , learning a health related model across multiple hospitals without sharing patients ’ data ( Huang et al. , 2019 ) . When implemented using secure multi-party computation ( SMC ) ( Bonawitz et al. , 2017 ) , federated learning eliminates the need for any agent to share its local data . However , it does not protect the agents or their users from inference attacks that combine the learned model with side information . Extensive studies have established that these attacks could lead to blatant reconstruction of the proprietary datasets ( Dinur & Nissim , 2003 ) and identification of individuals ( a legal liability for the participating agents ) ( Shokri et al. , 2017 ) . Motivated by this challenge , there had been a number of recent efforts ( Truex et al. , 2019b ; Geyer et al. , 2017 ; McMahan et al. , 2018 ) in developing federated learning methods with differential privacy ( DP ) , which is a well-established definition of privacy that provably prevents such attacks . Among the efforts , DP-FedAvg ( Geyer et al. , 2017 ; McMahan et al. , 2018 ) extends the NoisySGD method ( Song et al. , 2013 ; Abadi et al. , 2016 ) to the federated learning setting by adding Gaussian noise to the clipped accumulated gradient . The recent state-of-the-art DP-FedSGD ( Truex et al. , 2019b ) is under the same framework but with per-sample gradient clipping . A notable limitation for these gradient-based methods is that they require clipping the magnitude of gradients to τ and adding noise proportional to τ to every coordinate of the shared global model with d parameters . The clipping and perturbation steps introduce either large bias ( when τ is small ) or large variance ( when τ is large ) , which interferes the SGD convergence and makes it hard to scale up to largecapacity models . In Sec . 3 , we concretely demonstrate these limitations with examples and theory . Particularly , we show that the FedAvg may fail to decrease the loss function together with gradient clipping , and DP-FedAvg requires many outer-loop iterations ( i.e. , many rounds of communication to synchronize model parameters ) to converge under differential privacy . To avoid the gradient clipping , we propose to conduct the aggregation over the label space , as shown to be an effective approach in standard ( non-federated ) learning settings , i.e. , voting-based modelagnostic approaches ( Papernot et al. , 2017 ; 2018 ; Zhu et al. , 2020 ) . To achieve it , we relax the traditional federated learning setting to allow unlabeled public data at the server side . We also consider a more complete scenario for federated learning , where there are a large number of local agents or a limited number of local agents . The agent-level privacy as introduced in DP-FedAvg , works seamlessly with our setting having many agents . However , when there are few agents , hiding each data belonging to one specific agent becomes burdensome or unnecessary . To this end , we provide a more complete privacy notion , i.e. , agent-level and instance-level . Under each of the setting , we theoretically and empirically show that the proposed label aggregation method effectively removes the sensitivity issue caused by gradient clipping or noise addition , and achieves favorable privacy-utility trade-off compared to other DPFL algorithms . Our contributions are summarized as the following : 1 . We propose two voting-based DPFL algorithms via label aggregation ( PATE-FL and PrivateKNN-FL ) and demonstrate their clear advantages over gradient aggregation based DPFL methods ( e.g. , DP-FedAvg ) in terms of communication cost and scalability to high-capacity models . 2 . We provide provable differential privacy guarantees under two levels of granularity : agentlevel DP and instance-level DP . Each is natural in a particular regime of FL depending on the number of agents and the size of their data . 3 . Extensive evaluation demonstrates that our method improves the privacy-utility trade-off over randomized gradient-based approaches in both agent-level and instance-level cases . A remark of our novelty . Though PATE-FL and Private-kNN-FL are algorithmically similar to the original PATE ( Papernot et al. , 2018 ) and Private-KNN ( Zhu et al. , 2020 ) , they are not the same and we are adapting them to a new problem — federated learning . The adaptation itself is nontrivial and requires substantial technical innovations . We highlight three challenges below . • Several key DP techniques that contributed to the success of PATE and Private-KNN in the standard setting are no longer applicable ( e.g. , Privacy amplification by Sampling and Noisy Screening ) . This is partly due to that in standard private learning , the attacker only sees the final models ; but in FL , the attacker can eavesdrop in all network traffic . • Moreover , PATE and Private-kNN only provide instance-level DP . We show PATE-FL and Private-kNN-FL also satisfy the stronger agent-level DP . PATE-FL ’ s agent-level DP parameter is , surprisingly , a factor of 2 better than its instance-level DP parameter . And PrivatekNN-FL in addition enjoys a factor of k amplification for the instance-level DP . • A key challenge of FL is the data heterogeneity of individual agents , while PATE randomly splits the dataset so each teacher is identically distributed . The heterogeneity does not affect our privacy analysis but does make it unclear whether PATE would work . We are the first to report strong empirical evidence that the PATE-style DP algorithms remain highly effective in the non-iid case . 2 PRELIMINARY . In this section , we start with introducing the typical notations of federated learning and differential privacy . Then , two randomized gradient-based baselines , DP-FedAvg and DP-FedSGD , are introduced as the DPFL background . 2.1 FEDERATED LEARNING . Federated learning ( McMahan et al. , 2017 ; Bonawitz et al. , 2017 ; Mohassel & Zhang , 2017 ; Smith et al. , 2017 ) is a distributed machine learning framework that allows clients to collaboratively train a global model without sharing local data . We considerN agents , each agent i has ni data kept locally and privately from a party-specific domain distributionDi . C is the number of classes . The objective is to output a global model that performs well on the target ( server ) distribution . Most prior works consider the target distribution as a uniform distribution over the union of all local data , which is restrictive in practice . Here we consider an agnostic federated learning scenario ( Mohri et al. , 2019 ; Peng et al. , 2019c ) , where the server distributionDG can be different from all agent distributions . In light of this , we assume each agent has access to part of unlabeled server data drawn from the target distribution DG . FedAvg ( McMahan et al. , 2017 ) is a vanilla federated learning algorithm that we consider as a non-DP baseline . In this algorithm , a fraction of agents is sampled at each communication round with a probability q . Each selected agent downloads the shared global model and improves it by learning from local data using E iterations of stochastic gradient descent ( SGD ) . We denote this local update process as an inner loop . Only the gradient is sent to the server , where it is averaged with other selected agents ’ gradient to improve the global model . The global model is learned after T communication rounds , where each communication round is denoted as one outer loop . 2.2 DIFFERENTIAL PRIVACY FOR FEDERATED LEARNING . Differential privacy ( Dwork et al. , 2006 ) is a quantifiable and composable definition of privacy that provides provable guarantees against identification of individuals in a private dataset . Definition 1 . A randomized mechanism M : D → R with a domain D and range R satisfies ( , δ ) -differential privacy , if for any two adjacent datasets D , D′ ∈ D and for any subset of outputs S ⊆ R , it holds that Pr [ M ( D ) ∈ S ] ≤ e Pr [ M ( D′ ) ∈ S ] + δ . The definition applies to a variety of different granularity , depending on how the adjacent datasets are defined , i.e. , if we are to protect whether one agent participates into training , the neighboring datasets are defined by adding or removing the entire local data within that agent . It is known as agent-level ( user-level ) differential privacy , which has been investigated in DP-FedAvg ( Geyer et al. , 2017 ; McMahan et al. , 2018 ) . Compared to FedAvg , DP-FedAvg ( Figure 1 ) enforces clipping of peragent model gradient to a threshold S and adds noise to the scaled gradient before it is averaged at the server . Note that this DP notion is favored when data samples within one agent reveal the same sensitive information , e.g. , cell phone agents send the same message . However , when there are only a few agents , hiding the entire dataset from one agent becomes difficult and inappropriate . We then consider the instance-level DP , where the adjacent dataset is defined by differing one single training example . This definition is consistent with the standard non-federated learning differential privacy ( Abadi et al. , 2016 ; Bassily et al. , 2014 ; Chaudhuri et al. , 2011 ) . Model training with instance-level DP restricts the adversary ’ s power in detecting a specific training instance ’ s presence or absence . DP-FedSGD ( Truex et al. , 2019a ; Peterson et al. , 2019 ) , one such state-of-the-art for the instance-level DP , performs NoisySGD ( Abadi et al. , 2016 ) for a fixed number of iterations at each agent . The gradient updates are averaged on each communication round at the server , as shown in Figure 1 . SMC is a cryptographic technique that securely aggregates local updates before the server receives it . While SMC does not have a differential privacy guarantee , it can be combined with DP to amplify the privacy guarantee ( Bhowmick et al. , 2018 ; Agarwal et al. , 2018 ; Truex et al. , 2019b ) against attackers that eavesdrop what sent out by each agent . In our experiment , we assume that the aggregation is conducted by SMC for all privacy-preserving algorithms that we consider . 3 CHALLENGES FOR GRADIENT-BASED FEDERATED LEARNING . In this section , we highlight the main challenges of the conventional DPFL frameworks in terms of accuracy , convergence and communication cost . For other challenges , we refer the readers to a survey ( Kairouz et al. , 2019 ) . The details of DP-FedAvg are summarized in appendix algorithm section . 3.1 CHALLENGE 1 : BIASED GRADIENT ESTIMATION . Recent works ( Li et al. , 2018 ) have shown that the FedAvg may not converge well under heterogeneity ( e.g. , non-identical distributions ) . Here , we provide a simple example to show that the clipping step of DP-FedAvg may raise additional challenge . Example 2 ( clipping ) . Let N = 2 , each agent i ’ s local update is 4i ( E iterations of SGD ) . We enforce clipping of per-agent update4i by performing4i/max ( 1 , ||4i||2τ ) , where τ is the clipping threshold . Consider the special case when ||41||2 = τ+α and ||42||2 ≤ τ . Then the global update will be 12 ( τ41 ||41||2 +42 ) , which is biased . The unbiased global update shall be 12 ( 41 +42 ) . Such a simple example can be embedded in more realistic problems , causing substantial bias that leads to non-convergence .
Federated learning enables distributed clients to train a model without sharing the data with each other. This is typically achieved by a gradient descent type algorithm such as federated averaging. The paper argues that federated learning via gradient updates has issues and proposes to use a voting based method for training machine learning models using unlabeled global data.
SP:996e66b927181eb325cadb345bb51e96b8d46923
Neuro-algorithmic Policies for Discrete Planning
1 INTRODUCTION . One of the central topics in machine learning research is learning control policies for autonomous agents . Many different problem settings exist within this area . On one end of the spectrum are imitation learning approaches , where prior expert data is available and the problem becomes a supervised learning problem . On the other end of the spectrum lie approaches that require interaction with the environment to obtain data for policy extraction problem , also known as the problem of exploration . Most Reinforcement Learning ( RL ) algorithms fall into the latter category . In this work , we concern ourselves primarily with the setting where limited expert data is available , and a policy needs to be extracted by imitation learning . Independently of how a policy is extracted , a central question of interest is : how well will it generalize to variations in the environment and the task ? Recent studies have shown that standard deep RL algorithms require exhaustive amounts of exposure to environmental variability before starting to generalize Cobbe et al . ( 2019 ) . There exist several approaches addressing the problem of generalization in control . One option is to employ model-based approaches that learn a transition model from data and use planning algorithms at runtime . This has been argued to be the best strategy in the presence of an accurate model and sufficient computation time ( Daw et al. , 2005 ) . However , learning a precise transition model is often harder than learning a policy . This , in turn , makes them more general , but comes at a cost of increasing the problem dimensionality . The transition model has a much larger dimensionality and it needs to model aspects of the environmental dynamics that are perhaps irrelevant for the task . This is particularly true for learning in problems with high-dimensional inputs , such as raw images . In order to alleviate this problem , learning specialized or partial models has shown to be a viable alternative , e.g . in MuZero Schrittwieser et al . ( 2019 ) . We propose to use recent advances in making combinatorial algorithms differentiable in a blackbox fashion as proposed by Vlastelica et al . ( 2020 ) to train neuro-algorithmic policies with embedded planners end-to-end . More specifically , we use a time-dependent shortest path planner acting on a temporally evolving graph generated by a deep network from the inputs . This enables us to learn the time-evolving costs of the graph and relates us to model-based approaches . We demonstrate the effectiveness of this approach in an offline imitation learning setting , where a few expert trajectories are provided . Due to the combinatorial generalization capabilities of planners , our learned policy is able to generalize to new variations in the environment out of the box and orders of magnitude faster than naive learners . Using neuro-algorithmic architectures facilitates generalization by shifting the combinatorial aspect of the problem to efficient algorithms , while using neural networks to extract a good representation for the problem at hand . They have potential to endow artificial agents with the main component of intelligence , the ability to reason . Our contributions can be summarized as follows : • We identify that poor generalization is caused by lack of structural and combinatorial inductive biases and can be alleviated by introducing the correct inductive biases through neuro-algorithmic policies . • We show that architectures embedding TDSP solvers are applicable beyond goal-reaching environments . • We demonstrate learning neuro-algorithmic policies in dynamic game environments from images . 2 RELATED WORK . Planning There exist multiple lines of work aiming to improve classical planning algorithms such as improving sampling strategies of Rapidly-exploring Random Trees ( Gammell et al. , 2014 ; Burget et al. , 2016 ; Kuo et al. , 2018 ) . Similarly , along this direction , Kumar et al . ( 2019 ) propose a conditional VAE architecture for sampling candidate waypoints . Orthogonal to this are approaches that learn representations such that planning is applicable in the latent space . Hafner et al . ( 2019 ) employ a latent multi-step transition model . Savinov et al . ( 2018 ) propose a semi-parametric method for mapping observations to graph nodes and then applying a shortest path algorithm . Asai & Fukunaga ( 2017 ) ; Asai & Kajino ( 2019 ) use an autoencoder architecture in order to learn a discrete transition model suitable for classical planning algorithms . Li et al . ( 2020 ) learn compositional Koopman operators with graph neural networks mapping to a linear dynamics latent space , which allows for fast planning . Chen et al . ( 2018 ) ; Amos et al . ( 2017 ) perform efficient planning by using a convex model formulation and convex optimization . Alternatively , the replay buffer can be used as a non-parametric model in order to select waypoints ( Eysenbach et al. , 2019 ) or in an MPC fashion ( Blundell et al. , 2016 ) . None of these methods perform differentiation through the planning algorithm in order to learn better latent representations . Differentiation through planning Embedding differentiable planners has been proposed in previous works , e.g . in the continuous case with CEM ( Amos & Yarats , 2020 ; Bharadhwaj et al. , 2020 ) . Wu et al . ( 2020 ) use a ( differentiable ) recurrent neural network as a planner . Tamar et al . ( 2016 ) use a differentiable approximation of the value iteration algorithm to embed it in a neural network . Silver et al . ( 2017b ) differentiate through a few steps of value prediction in a learned MDP to match the externally observed rewards . Srinivas et al . ( 2018 ) use a differentiable forward dynamics model in latent space . Karkus et al . ( 2019 ) suggest a neural network architecture embedding MDP and POMDP solvers and during the backward pass , they substitute the algorithms by learned approximations . In comparison , we do not perform any relaxation or approximation of the planner itself and we learn interpretable time-dependent costs of the latent planning graph based on expert demonstrations by differentiating through the planner . Similarly to our work , Yonetani et al . ( 2020 ) embed an A∗ algorithm into a neural network , but in comparison , their method does not operate with time-dependent costs , subgoal selection and does not provide a policy for closed-loop control . Inverse reinforcement learning and imitation learning Uncovering the expert objective function from demonstrations has been a central topic in reinforcement learning ( Ng & Russell , 2000 ) . Our method is connected to inverse reinforcement learning in the sense that we learn the objective function that the expert optimizes to extract an optimal policy , also called apprenticeship learning ( Abbeel & Ng , 2004 ; Neu & Szepesvári , 2012 ; Aghasadeghi & Bretl , 2011 ) . What separates our approach is that the inferred costs are inherently part of the learned neuro-algorithmic policy in conjunction with the applied planner on the costs . Our method is an offline imitation learning method , but since we propose an end-to-end trainable policy , it is naturally extendable to the online case with a method such as DAgger ( Ross et al. , 2011 ) or other online reinforcement learning methods augmented with expert datasets ( Reddy et al. , 2019 ; Ho & Ermon , 2016 ) . Offline model-based reinforcement learning Model-based methods have shown promise by facilitating better generalization ( Janner et al. , 2019 ) . Approaches employing models fall into two camps : using models to extract a policy in a Dyna-style approach ( Sutton , 1991 ; Janner et al. , 2019 ; Sutton et al. , 2008 ; Yao et al. , 2009 ; Kaiser et al. , 2019 ) , or incorporating the model in a planning loop , i.e . model-predictive control ( Finn & Levine , 2017 ; Racanière et al. , 2017 ; Oh et al. , 2017 ; Silver et al. , 2017a ) . In this work , we consider the latter case where an implicit transition model is “ hidden ” within the predicted time-dependent costs . Combinatorial algorithms in end-to-end trainable networks We suggest a hybrid policy consisting of a neural network and an accompanying expert ( shortest path ) discrete solver that is trainable end-to-end . Incorporating expert discrete solvers into end-to-end trainable architectures is a topic with exciting recent developments . For the simpler setup of comparing to ground-truth values on the solver output , numerous frameworks have been suggested such as the “ predict-and-optimize ” framework and its variants ( Elmachtoub & Grigas , 2017 ; Demirovic et al. , 2019 ; Mandi et al. , 2019 ) . Also , specializations for concrete cases such as sparse structured inference ( Niculae et al. , 2018 ) , logical satisfiability ( Wang et al. , 2019 ) , submodular optimization ( Djolonga & Krause , 2017 ) or mixed integer programming ( Ferber et al. , 2020 ) have been proposed . We are interested in the harder case of providing an entirely hybrid architecture which may use the solver at intermediate levels and is trainable end-to-end . For this case , two approaches have recently emerged ( Vlastelica et al. , 2020 ; Berthet et al. , 2020 ) . Vlastelica et al . ( 2020 ) introduce an efficient implicit piece-wise linear interpolation scheme , while Berthet et al . ( 2020 ) introduce Monte Carlo technique for estimating the Jacobian of a Gaussian smoothing of the piecewise constant function . The approach from Vlastelica et al . ( 2020 ) is especially appealing , since it allows for uses in which the solver is the computational bottleneck . Therefore , we follow it in this work . By formulating the control problem as a time-dependent shortest path problem ( TDSP ) , we show that the framework from Vlastelica et al . ( 2020 ) is applicable in specific control settings . 3 MARKOV DECISION PROCESSES AND SHORTEST PATHS . We follow the MDP framework Puterman ( 2014 ) in a goal-conditioned setting Schaul et al . ( 2015 ) . This is used in sequential decision making problems where a specific terminal state has to be reached . Definition 1 A goal-conditioned Markov Decision Process ( gcMDP ) , M is defined by the tuple ( S , A , p , g , r ) , where S is the state space , A the action space , p ( s′ | a , s ) the probability of making the transition s → s′ when taking the action a , g is the goal , r ( s , a , s′ , g ) the reward obtained when transitioning from state s to s′ while taking action a and aiming for goal g. Concretely , we concern ourselves with fully observable discrete MDPs , in which the Markov assumption for the state holds and where the state and action-space are discrete . The goal of reinforcement learning is to maximize the return G = ∑T t=0 rt of such a process . In gcMDPs the reward is such that the maximal return can be achieved by reaching the goal state g. Given access to the transition probabilities and rewards , an optimal policy can be extracted by dynamic programming Bertsekas et al . ( 1995 ) . In a graph representation of an gcMDP , the set of vertices V corresponds to the set of states S , traversing an edge corresponds to making a transition between states . We assume a deterministic process , such that the optimal policy can be extracted by standard shortest path algorithms , such as Dijkstra ’ s algorithm . In this work , we imitate expert trajectories by training a policy with an embedded time-dependent shortest path solver end-to-end . Although the actual gcMDP solved by the expert may be stochastic , we learn a deterministic latent approximate gcMDP , M̂ . Assuming that we have access to the topology of the gcMDP , by applying blackbox-differentiation theory Vlastelica et al . ( 2020 ) we are able to learn the underlying costs ( instead of rewards ) of M̂ such that the optimal policy on M̂ is also optimal inM . Although the MDP Definition 1 yields itself nicely towards learning the time-dependent edge costs cet , this can increase the problem dimensionality considerably with the out-degree of the vertices ( here |A| ) . Thus , we consider cases where the reward function only depends on the current state and the goal : r ( s , a , s′ , g ) = r ( s , g ) . In this case , vertex costs cvt are sufficient for finding the optimal solution to the gcMDP . Accordingly , we rely on a vertex-based version of the shortest path algorithm .
This work proposes a novel neuro-algorithmic policy architecture for solving discrete planning tasks. It takes a high-dimensional image input and processes it through modified ResNet encoders to obtain a graph cost map and a start/goal heatmap. This is fed into a differentiable Dijkstra algorithm to obtain the shortest trajectory prediction which is trained using an expert-annotated trajectory via a Hamming distance loss. This module is evaluated in two dynamic game environments demonstrating generalization to unseen scenes.
SP:2003bbcbbf2f16f6e54353a8b6f58c613343ecc0
Neuro-algorithmic Policies for Discrete Planning
1 INTRODUCTION . One of the central topics in machine learning research is learning control policies for autonomous agents . Many different problem settings exist within this area . On one end of the spectrum are imitation learning approaches , where prior expert data is available and the problem becomes a supervised learning problem . On the other end of the spectrum lie approaches that require interaction with the environment to obtain data for policy extraction problem , also known as the problem of exploration . Most Reinforcement Learning ( RL ) algorithms fall into the latter category . In this work , we concern ourselves primarily with the setting where limited expert data is available , and a policy needs to be extracted by imitation learning . Independently of how a policy is extracted , a central question of interest is : how well will it generalize to variations in the environment and the task ? Recent studies have shown that standard deep RL algorithms require exhaustive amounts of exposure to environmental variability before starting to generalize Cobbe et al . ( 2019 ) . There exist several approaches addressing the problem of generalization in control . One option is to employ model-based approaches that learn a transition model from data and use planning algorithms at runtime . This has been argued to be the best strategy in the presence of an accurate model and sufficient computation time ( Daw et al. , 2005 ) . However , learning a precise transition model is often harder than learning a policy . This , in turn , makes them more general , but comes at a cost of increasing the problem dimensionality . The transition model has a much larger dimensionality and it needs to model aspects of the environmental dynamics that are perhaps irrelevant for the task . This is particularly true for learning in problems with high-dimensional inputs , such as raw images . In order to alleviate this problem , learning specialized or partial models has shown to be a viable alternative , e.g . in MuZero Schrittwieser et al . ( 2019 ) . We propose to use recent advances in making combinatorial algorithms differentiable in a blackbox fashion as proposed by Vlastelica et al . ( 2020 ) to train neuro-algorithmic policies with embedded planners end-to-end . More specifically , we use a time-dependent shortest path planner acting on a temporally evolving graph generated by a deep network from the inputs . This enables us to learn the time-evolving costs of the graph and relates us to model-based approaches . We demonstrate the effectiveness of this approach in an offline imitation learning setting , where a few expert trajectories are provided . Due to the combinatorial generalization capabilities of planners , our learned policy is able to generalize to new variations in the environment out of the box and orders of magnitude faster than naive learners . Using neuro-algorithmic architectures facilitates generalization by shifting the combinatorial aspect of the problem to efficient algorithms , while using neural networks to extract a good representation for the problem at hand . They have potential to endow artificial agents with the main component of intelligence , the ability to reason . Our contributions can be summarized as follows : • We identify that poor generalization is caused by lack of structural and combinatorial inductive biases and can be alleviated by introducing the correct inductive biases through neuro-algorithmic policies . • We show that architectures embedding TDSP solvers are applicable beyond goal-reaching environments . • We demonstrate learning neuro-algorithmic policies in dynamic game environments from images . 2 RELATED WORK . Planning There exist multiple lines of work aiming to improve classical planning algorithms such as improving sampling strategies of Rapidly-exploring Random Trees ( Gammell et al. , 2014 ; Burget et al. , 2016 ; Kuo et al. , 2018 ) . Similarly , along this direction , Kumar et al . ( 2019 ) propose a conditional VAE architecture for sampling candidate waypoints . Orthogonal to this are approaches that learn representations such that planning is applicable in the latent space . Hafner et al . ( 2019 ) employ a latent multi-step transition model . Savinov et al . ( 2018 ) propose a semi-parametric method for mapping observations to graph nodes and then applying a shortest path algorithm . Asai & Fukunaga ( 2017 ) ; Asai & Kajino ( 2019 ) use an autoencoder architecture in order to learn a discrete transition model suitable for classical planning algorithms . Li et al . ( 2020 ) learn compositional Koopman operators with graph neural networks mapping to a linear dynamics latent space , which allows for fast planning . Chen et al . ( 2018 ) ; Amos et al . ( 2017 ) perform efficient planning by using a convex model formulation and convex optimization . Alternatively , the replay buffer can be used as a non-parametric model in order to select waypoints ( Eysenbach et al. , 2019 ) or in an MPC fashion ( Blundell et al. , 2016 ) . None of these methods perform differentiation through the planning algorithm in order to learn better latent representations . Differentiation through planning Embedding differentiable planners has been proposed in previous works , e.g . in the continuous case with CEM ( Amos & Yarats , 2020 ; Bharadhwaj et al. , 2020 ) . Wu et al . ( 2020 ) use a ( differentiable ) recurrent neural network as a planner . Tamar et al . ( 2016 ) use a differentiable approximation of the value iteration algorithm to embed it in a neural network . Silver et al . ( 2017b ) differentiate through a few steps of value prediction in a learned MDP to match the externally observed rewards . Srinivas et al . ( 2018 ) use a differentiable forward dynamics model in latent space . Karkus et al . ( 2019 ) suggest a neural network architecture embedding MDP and POMDP solvers and during the backward pass , they substitute the algorithms by learned approximations . In comparison , we do not perform any relaxation or approximation of the planner itself and we learn interpretable time-dependent costs of the latent planning graph based on expert demonstrations by differentiating through the planner . Similarly to our work , Yonetani et al . ( 2020 ) embed an A∗ algorithm into a neural network , but in comparison , their method does not operate with time-dependent costs , subgoal selection and does not provide a policy for closed-loop control . Inverse reinforcement learning and imitation learning Uncovering the expert objective function from demonstrations has been a central topic in reinforcement learning ( Ng & Russell , 2000 ) . Our method is connected to inverse reinforcement learning in the sense that we learn the objective function that the expert optimizes to extract an optimal policy , also called apprenticeship learning ( Abbeel & Ng , 2004 ; Neu & Szepesvári , 2012 ; Aghasadeghi & Bretl , 2011 ) . What separates our approach is that the inferred costs are inherently part of the learned neuro-algorithmic policy in conjunction with the applied planner on the costs . Our method is an offline imitation learning method , but since we propose an end-to-end trainable policy , it is naturally extendable to the online case with a method such as DAgger ( Ross et al. , 2011 ) or other online reinforcement learning methods augmented with expert datasets ( Reddy et al. , 2019 ; Ho & Ermon , 2016 ) . Offline model-based reinforcement learning Model-based methods have shown promise by facilitating better generalization ( Janner et al. , 2019 ) . Approaches employing models fall into two camps : using models to extract a policy in a Dyna-style approach ( Sutton , 1991 ; Janner et al. , 2019 ; Sutton et al. , 2008 ; Yao et al. , 2009 ; Kaiser et al. , 2019 ) , or incorporating the model in a planning loop , i.e . model-predictive control ( Finn & Levine , 2017 ; Racanière et al. , 2017 ; Oh et al. , 2017 ; Silver et al. , 2017a ) . In this work , we consider the latter case where an implicit transition model is “ hidden ” within the predicted time-dependent costs . Combinatorial algorithms in end-to-end trainable networks We suggest a hybrid policy consisting of a neural network and an accompanying expert ( shortest path ) discrete solver that is trainable end-to-end . Incorporating expert discrete solvers into end-to-end trainable architectures is a topic with exciting recent developments . For the simpler setup of comparing to ground-truth values on the solver output , numerous frameworks have been suggested such as the “ predict-and-optimize ” framework and its variants ( Elmachtoub & Grigas , 2017 ; Demirovic et al. , 2019 ; Mandi et al. , 2019 ) . Also , specializations for concrete cases such as sparse structured inference ( Niculae et al. , 2018 ) , logical satisfiability ( Wang et al. , 2019 ) , submodular optimization ( Djolonga & Krause , 2017 ) or mixed integer programming ( Ferber et al. , 2020 ) have been proposed . We are interested in the harder case of providing an entirely hybrid architecture which may use the solver at intermediate levels and is trainable end-to-end . For this case , two approaches have recently emerged ( Vlastelica et al. , 2020 ; Berthet et al. , 2020 ) . Vlastelica et al . ( 2020 ) introduce an efficient implicit piece-wise linear interpolation scheme , while Berthet et al . ( 2020 ) introduce Monte Carlo technique for estimating the Jacobian of a Gaussian smoothing of the piecewise constant function . The approach from Vlastelica et al . ( 2020 ) is especially appealing , since it allows for uses in which the solver is the computational bottleneck . Therefore , we follow it in this work . By formulating the control problem as a time-dependent shortest path problem ( TDSP ) , we show that the framework from Vlastelica et al . ( 2020 ) is applicable in specific control settings . 3 MARKOV DECISION PROCESSES AND SHORTEST PATHS . We follow the MDP framework Puterman ( 2014 ) in a goal-conditioned setting Schaul et al . ( 2015 ) . This is used in sequential decision making problems where a specific terminal state has to be reached . Definition 1 A goal-conditioned Markov Decision Process ( gcMDP ) , M is defined by the tuple ( S , A , p , g , r ) , where S is the state space , A the action space , p ( s′ | a , s ) the probability of making the transition s → s′ when taking the action a , g is the goal , r ( s , a , s′ , g ) the reward obtained when transitioning from state s to s′ while taking action a and aiming for goal g. Concretely , we concern ourselves with fully observable discrete MDPs , in which the Markov assumption for the state holds and where the state and action-space are discrete . The goal of reinforcement learning is to maximize the return G = ∑T t=0 rt of such a process . In gcMDPs the reward is such that the maximal return can be achieved by reaching the goal state g. Given access to the transition probabilities and rewards , an optimal policy can be extracted by dynamic programming Bertsekas et al . ( 1995 ) . In a graph representation of an gcMDP , the set of vertices V corresponds to the set of states S , traversing an edge corresponds to making a transition between states . We assume a deterministic process , such that the optimal policy can be extracted by standard shortest path algorithms , such as Dijkstra ’ s algorithm . In this work , we imitate expert trajectories by training a policy with an embedded time-dependent shortest path solver end-to-end . Although the actual gcMDP solved by the expert may be stochastic , we learn a deterministic latent approximate gcMDP , M̂ . Assuming that we have access to the topology of the gcMDP , by applying blackbox-differentiation theory Vlastelica et al . ( 2020 ) we are able to learn the underlying costs ( instead of rewards ) of M̂ such that the optimal policy on M̂ is also optimal inM . Although the MDP Definition 1 yields itself nicely towards learning the time-dependent edge costs cet , this can increase the problem dimensionality considerably with the out-degree of the vertices ( here |A| ) . Thus , we consider cases where the reward function only depends on the current state and the goal : r ( s , a , s′ , g ) = r ( s , g ) . In this case , vertex costs cvt are sufficient for finding the optimal solution to the gcMDP . Accordingly , we rely on a vertex-based version of the shortest path algorithm .
This paper presents a method to train a neural network to predict the time-dependent costs, and start and goal states needed to run time-dependent shortest-path planning in a dynamic 2-D environment. The non-differentiability of the path planning is handled by recent work on differentiating through blackbox combinatorial solvers from [1]. The method is trained in a supervised manner from expert trajectories. Evaluations are presented on 2-D time-varying games where the addition of the path-planner is shown to improve performance over an imitation learning and PPO baseline.
SP:2003bbcbbf2f16f6e54353a8b6f58c613343ecc0
Contrastive Learning of Medical Visual Representations from Paired Images and Text
1 INTRODUCTION Medical image understanding has the potential to transform healthcare and has seen rapid progress with the use of deep neural architectures ( Gulshan et al. , 2016 ; Esteva et al. , 2017 ; De Fauw et al. , 2018 ; Rajpurkar et al. , 2018b ) . Yet , with expert-level performance achieved only in some specialties and under some circumstances , medical image understanding remains a difficult task for the majority of specialties , mainly due to its challenging nature and the extreme scarcity of annotated data . Existing work has followed two general approaches to obtain annotations for medical imaging tasks . The first approach has been using high-quality annotations created by medical experts ( Abràmoff et al. , 2016 ; Gulshan et al. , 2016 ; Shih et al. , 2019 ; Wang & Wong , 2020 ) . However , the high cost of this approach has resulted in datasets that are mostly orders of magnitude smaller than natural image datasets such as ImageNet ( Russakovsky et al. , 2015 ) . To remedy this , existing work has relied heavily on trans- ferring model weights from ImageNet pretraining ( Wang et al. , 2017 ; Esteva et al. , 2017 ; Irvin et al. , 2019 ) . This approach is suboptimal because , as shown in Figure 1 , medical image understanding often requires representations of very fine-grained visual features that are drastically different from those required for identifying objects in natural images . As a result , Raghu et al . ( 2019 ) found that ImageNet pretraining often provides little to no benefit compared to simple random initialization . A second popular approach is to use expert-crafted rules to extract labels from the textual reports accompanying the medical images . This approach has led to datasets of larger scale , since the text data paired with medical images are often produced naturally by medical experts in their routine work- flow and abundant in a typical hospital ’ s IT systems . Nevertheless , this rule-based label extraction approach has two limitations : 1 ) the rules are often inaccurate and limited to a few major categories ( Wang et al. , 2017 ) , leading to very inefficient use of the textual report data ; 2 ) these rules are often domain-specific and sensitive to the style of the text , making cross-domain and cross-institution generalization difficult ( Irvin et al. , 2019 ) . In efforts to make more efficient use of unlabeled image data , several recent studies have shown promising results from contrastive representation learning from natural images ( Chen et al. , 2020a ; He et al. , 2020 ; Grill et al. , 2020 ) . However , as we will show , applying these image view-based contrastive methods to medical images provides only marginal benefits compared to ImageNet pretraining , a result mostly due to the high inter-class similarity of the medical images as in Figure 1 . In this work , we aim to improve visual representations of medical images by combining the benefits of both learning from abundant textual data and unsupervised statistical approaches . We present Contrastive VIsual Representation Learning from Text ( ConVIRT ) , a framework for learning visual representations by exploiting the naturally occurring pairing of images and textual data . ConVIRT improves visual representations by maximizing the agreement between true image-text pairs versus random pairs via a bidirectional contrastive objective between the image and text modalities . We apply ConVIRT to the pretraining of medical image encoders , and show that it leads to higherquality in-domain image representations that capture the subtlety of visual features required for medical image understanding tasks . Compared to existing methods , ConVIRT has the advantages of utilizing the paired text data in a way agnostic to the medical specialty and requiring no additional expert input . This allows us to evaluate ConVIRT by transferring our pretrained weights to 4 different medical image classification tasks covering 2 different specialties . We find that the resulting models outperform all baseline initialization approaches , including the standard ImageNet pretraining and several strong baselines that also utilize the paired text data . Most notably , in all 4 tasks , ConVIRT requires only 10 % as much labeled training data as an ImageNet initialized counterpart to achieve better or comparable performance . We further evaluate ConVIRT on two new zero-shot retrieval tasks , an image-image and a text-image retrieval task , and also find it superior to all baselines . To facilitate future research , we will make our code and the collected retrieval datasets available . 2 METHOD . 2.1 TASK DEFINITION . We start by giving a formal description of our representation learning setting . We assume paired input ( xv , xu ) where xv represents one or a group of images , and xu represents a text sequence which describes the imaging information in xv . Our goal is to learn a parameterized image encoder function fv , which maps an image to a fixed-dimensional vector . We are then interested in transferring the learned image encoder function fv into downstream tasks , such as classification or image retrieval . In this work , we model the encoder function fv as a convolutional neural network ( CNN ) . We note that paired image-text data ( xv , xu ) naturally exists for many medical domains . Medical experts such as radiologists produce textual descriptions of images as part of their routine workflow , some of which are also made publicly available ( Demner-Fushman et al. , 2016 ; Johnson et al. , 2019 ) . 2.2 CONTRASTIVE VISUAL REPRESENTATION LEARNING FROM TEXT . An overview of our method , ConVIRT , for learning fv is shown in Figure 2 . At a high level , our method converts each input image xv and text xu into d-dimensional vector representations v and u respectively , following a similar processing pipeline . For each input image xv , our method starts by drawing a random view x̃v from xv with a sampled transformation function tv ∼ T , where T represents a family of stochastic image transformation functions described later . Next , the encoder function fv transforms x̃v into a fixed-dimensional vector hv , followed by a non-linear projection function gv which further transforms hv into vector v : v = gv ( fv ( x̃v ) ) , ( 1 ) where v ∈ Rd . Similarly , for each text input xu , we obtain a span x̃u from it following a sampling function tu , and then a text representation u with : u = gu ( fu ( x̃u ) ) , where fu is a text encoder , gu a projection , and u ∈ Rd . The projection functions gv and gu project representations for both modalities from their encoder space to the same d-dimensional space for contrastive learning . At training time , we sample a minibatch of N input pairs ( xv , xu ) from training data , and calculate their representation pairs ( v , u ) . We use ( vi , ui ) to denote the i-th pair . The training objective of ConVIRT involves two loss functions . The first loss function is an image-to-text contrastive loss for the i-th pair : ` ( v→u ) i = − log exp ( 〈vi , ui〉/τ ) ∑N k=1 exp ( 〈vi , uk〉/τ ) , ( 2 ) where 〈vi , ui〉 represents the cosine similarity , i.e. , 〈v , u〉 = v > u/‖v‖‖u‖ ; and τ ∈ R+ represents a temperature parameter . This loss takes the same form as the InfoNCE loss ( Oord et al. , 2018 ) , and minimizing it leads to encoders that maximally preserve the mutual information between the true pairs under the representation functions . Intuitively , it is the log loss of an N -way classifier that tries to predict ( vi , ui ) as the true pair . Note that unlike previous work which use a contrastive loss between inputs of the same modality ( Chen et al. , 2020a ; He et al. , 2020 ) , our image-to-text contrastive loss is asymmetric for each input modality . We therefore define a similar text-to-image contrastive loss as : ` ( u→v ) i = − log exp ( 〈ui , vi〉/τ ) ∑N k=1 exp ( 〈ui , vk〉/τ ) . ( 3 ) Our final training loss is then computed as a weighted combination of the two losses averaged over all positive image-text pairs in each minibatch : L = 1 N N∑ i=1 ( λ ` ( v→u ) i + ( 1− λ ) ` ( u→v ) i ) , ( 4 ) where λ ∈ [ 0 , 1 ] is a scalar weight . 2.3 REALIZATION . We note that our ConVIRT framework defined above is agnostic to the specific choice of image and text encoders , transformations and projection functions . In this work , following previous work ( Chen et al. , 2020a ) , we model gv and gu as separate learnable single-hidden-layer neural networks , i.e. , gv ( · ) = W ( 2 ) σ ( W ( 1 ) ( · ) ) where σ is a ReLU non-linearity , and similarly for gu . For the image encoder fv , we use the ResNet50 architecture ( He et al. , 2016 ) for all experiments , as it is the architecture of choice for much medical imaging work and is shown to achieve competitive performance . For the text encoder fu , we use a BERT encoder ( Devlin et al. , 2019 ) followed by a max-pooling layer over all output vectors . We initialize our BERT encoder with the ClinicalBERT model ( Alsentzer et al. , 2019 ) pretrained on the MIMIC clinical notes , which achieved state-of-theart performance on a suite of clinical NLP tasks . At training time we allow the encoder to adapt to our contrastive task by freezing the embeddings and the first 6 layers of this BERT encoder and fine-tuning the last 6 layers . For the image transformation family T where tv is sampled from , we use sequential applications of five random transformations : cropping , horizontal flipping , affine transformation , color jittering and Gaussian blur . Different from recent work on contrastive visual representation learning ( Chen et al. , 2020a ; b ) , we only apply brightness and contrast adjustments in color jittering , due to the monochrome nature of the medical images . For the text transformation function tu , we apply a simple uniform sampling of a sentence from the input document xu ( i.e. , x̃u is a randomly sampled sentence from xu for each minibatch ) . We did not use a more aggressive transformation mainly because sampling at the sentence level can preserve the semantic meaning of the sampled spans . 3 EXPERIMENTS . 3.1 DATA FOR PRETRAINING . We test our ConVIRT framework by pretraining two separate image encoders covering different medical specialties using two separate paired image-text datasets : • Chest image encoder : We use version 2 of the public MIMIC-CXR database ( Johnson et al. , 2019 ) , which is a collection of chest radiograph images paired with their textual reports , and since its release has become a standard resource for studying multi-modal modeling of medical images . After preprocessing , this dataset contains a total of about 217k image-text pairs , with each pair containing an average of 1.7 images and 6.0 sentences . • Bony image encoder : We obtain a collection of musculoskeletal image-text pairs from the Rhode Island Hospital system . Following chest images , musculoskeletal images constitute the second most common type of radiograph images in a typical hospital . This dataset contains a total of 48k image-text pairs , with each pair containing an average of 2.5 images and 8.0 sentences . We include model implementation and pretraining details in Appendix A .
1. This paper tackles the medical image understanding problem. The aim of this paper is to learn a generic feature representation for medical image that could benefits downstream tasks like medical image classification, zero-shot classification. The main contribution of this paper is proposing a contrastive loss that the matched pair of image and text should have a higher corresponding score than the mis-matched pairs.
SP:92d7b00137258b40bcaf13fd19e032cf4c40b3d8
Contrastive Learning of Medical Visual Representations from Paired Images and Text
1 INTRODUCTION Medical image understanding has the potential to transform healthcare and has seen rapid progress with the use of deep neural architectures ( Gulshan et al. , 2016 ; Esteva et al. , 2017 ; De Fauw et al. , 2018 ; Rajpurkar et al. , 2018b ) . Yet , with expert-level performance achieved only in some specialties and under some circumstances , medical image understanding remains a difficult task for the majority of specialties , mainly due to its challenging nature and the extreme scarcity of annotated data . Existing work has followed two general approaches to obtain annotations for medical imaging tasks . The first approach has been using high-quality annotations created by medical experts ( Abràmoff et al. , 2016 ; Gulshan et al. , 2016 ; Shih et al. , 2019 ; Wang & Wong , 2020 ) . However , the high cost of this approach has resulted in datasets that are mostly orders of magnitude smaller than natural image datasets such as ImageNet ( Russakovsky et al. , 2015 ) . To remedy this , existing work has relied heavily on trans- ferring model weights from ImageNet pretraining ( Wang et al. , 2017 ; Esteva et al. , 2017 ; Irvin et al. , 2019 ) . This approach is suboptimal because , as shown in Figure 1 , medical image understanding often requires representations of very fine-grained visual features that are drastically different from those required for identifying objects in natural images . As a result , Raghu et al . ( 2019 ) found that ImageNet pretraining often provides little to no benefit compared to simple random initialization . A second popular approach is to use expert-crafted rules to extract labels from the textual reports accompanying the medical images . This approach has led to datasets of larger scale , since the text data paired with medical images are often produced naturally by medical experts in their routine work- flow and abundant in a typical hospital ’ s IT systems . Nevertheless , this rule-based label extraction approach has two limitations : 1 ) the rules are often inaccurate and limited to a few major categories ( Wang et al. , 2017 ) , leading to very inefficient use of the textual report data ; 2 ) these rules are often domain-specific and sensitive to the style of the text , making cross-domain and cross-institution generalization difficult ( Irvin et al. , 2019 ) . In efforts to make more efficient use of unlabeled image data , several recent studies have shown promising results from contrastive representation learning from natural images ( Chen et al. , 2020a ; He et al. , 2020 ; Grill et al. , 2020 ) . However , as we will show , applying these image view-based contrastive methods to medical images provides only marginal benefits compared to ImageNet pretraining , a result mostly due to the high inter-class similarity of the medical images as in Figure 1 . In this work , we aim to improve visual representations of medical images by combining the benefits of both learning from abundant textual data and unsupervised statistical approaches . We present Contrastive VIsual Representation Learning from Text ( ConVIRT ) , a framework for learning visual representations by exploiting the naturally occurring pairing of images and textual data . ConVIRT improves visual representations by maximizing the agreement between true image-text pairs versus random pairs via a bidirectional contrastive objective between the image and text modalities . We apply ConVIRT to the pretraining of medical image encoders , and show that it leads to higherquality in-domain image representations that capture the subtlety of visual features required for medical image understanding tasks . Compared to existing methods , ConVIRT has the advantages of utilizing the paired text data in a way agnostic to the medical specialty and requiring no additional expert input . This allows us to evaluate ConVIRT by transferring our pretrained weights to 4 different medical image classification tasks covering 2 different specialties . We find that the resulting models outperform all baseline initialization approaches , including the standard ImageNet pretraining and several strong baselines that also utilize the paired text data . Most notably , in all 4 tasks , ConVIRT requires only 10 % as much labeled training data as an ImageNet initialized counterpart to achieve better or comparable performance . We further evaluate ConVIRT on two new zero-shot retrieval tasks , an image-image and a text-image retrieval task , and also find it superior to all baselines . To facilitate future research , we will make our code and the collected retrieval datasets available . 2 METHOD . 2.1 TASK DEFINITION . We start by giving a formal description of our representation learning setting . We assume paired input ( xv , xu ) where xv represents one or a group of images , and xu represents a text sequence which describes the imaging information in xv . Our goal is to learn a parameterized image encoder function fv , which maps an image to a fixed-dimensional vector . We are then interested in transferring the learned image encoder function fv into downstream tasks , such as classification or image retrieval . In this work , we model the encoder function fv as a convolutional neural network ( CNN ) . We note that paired image-text data ( xv , xu ) naturally exists for many medical domains . Medical experts such as radiologists produce textual descriptions of images as part of their routine workflow , some of which are also made publicly available ( Demner-Fushman et al. , 2016 ; Johnson et al. , 2019 ) . 2.2 CONTRASTIVE VISUAL REPRESENTATION LEARNING FROM TEXT . An overview of our method , ConVIRT , for learning fv is shown in Figure 2 . At a high level , our method converts each input image xv and text xu into d-dimensional vector representations v and u respectively , following a similar processing pipeline . For each input image xv , our method starts by drawing a random view x̃v from xv with a sampled transformation function tv ∼ T , where T represents a family of stochastic image transformation functions described later . Next , the encoder function fv transforms x̃v into a fixed-dimensional vector hv , followed by a non-linear projection function gv which further transforms hv into vector v : v = gv ( fv ( x̃v ) ) , ( 1 ) where v ∈ Rd . Similarly , for each text input xu , we obtain a span x̃u from it following a sampling function tu , and then a text representation u with : u = gu ( fu ( x̃u ) ) , where fu is a text encoder , gu a projection , and u ∈ Rd . The projection functions gv and gu project representations for both modalities from their encoder space to the same d-dimensional space for contrastive learning . At training time , we sample a minibatch of N input pairs ( xv , xu ) from training data , and calculate their representation pairs ( v , u ) . We use ( vi , ui ) to denote the i-th pair . The training objective of ConVIRT involves two loss functions . The first loss function is an image-to-text contrastive loss for the i-th pair : ` ( v→u ) i = − log exp ( 〈vi , ui〉/τ ) ∑N k=1 exp ( 〈vi , uk〉/τ ) , ( 2 ) where 〈vi , ui〉 represents the cosine similarity , i.e. , 〈v , u〉 = v > u/‖v‖‖u‖ ; and τ ∈ R+ represents a temperature parameter . This loss takes the same form as the InfoNCE loss ( Oord et al. , 2018 ) , and minimizing it leads to encoders that maximally preserve the mutual information between the true pairs under the representation functions . Intuitively , it is the log loss of an N -way classifier that tries to predict ( vi , ui ) as the true pair . Note that unlike previous work which use a contrastive loss between inputs of the same modality ( Chen et al. , 2020a ; He et al. , 2020 ) , our image-to-text contrastive loss is asymmetric for each input modality . We therefore define a similar text-to-image contrastive loss as : ` ( u→v ) i = − log exp ( 〈ui , vi〉/τ ) ∑N k=1 exp ( 〈ui , vk〉/τ ) . ( 3 ) Our final training loss is then computed as a weighted combination of the two losses averaged over all positive image-text pairs in each minibatch : L = 1 N N∑ i=1 ( λ ` ( v→u ) i + ( 1− λ ) ` ( u→v ) i ) , ( 4 ) where λ ∈ [ 0 , 1 ] is a scalar weight . 2.3 REALIZATION . We note that our ConVIRT framework defined above is agnostic to the specific choice of image and text encoders , transformations and projection functions . In this work , following previous work ( Chen et al. , 2020a ) , we model gv and gu as separate learnable single-hidden-layer neural networks , i.e. , gv ( · ) = W ( 2 ) σ ( W ( 1 ) ( · ) ) where σ is a ReLU non-linearity , and similarly for gu . For the image encoder fv , we use the ResNet50 architecture ( He et al. , 2016 ) for all experiments , as it is the architecture of choice for much medical imaging work and is shown to achieve competitive performance . For the text encoder fu , we use a BERT encoder ( Devlin et al. , 2019 ) followed by a max-pooling layer over all output vectors . We initialize our BERT encoder with the ClinicalBERT model ( Alsentzer et al. , 2019 ) pretrained on the MIMIC clinical notes , which achieved state-of-theart performance on a suite of clinical NLP tasks . At training time we allow the encoder to adapt to our contrastive task by freezing the embeddings and the first 6 layers of this BERT encoder and fine-tuning the last 6 layers . For the image transformation family T where tv is sampled from , we use sequential applications of five random transformations : cropping , horizontal flipping , affine transformation , color jittering and Gaussian blur . Different from recent work on contrastive visual representation learning ( Chen et al. , 2020a ; b ) , we only apply brightness and contrast adjustments in color jittering , due to the monochrome nature of the medical images . For the text transformation function tu , we apply a simple uniform sampling of a sentence from the input document xu ( i.e. , x̃u is a randomly sampled sentence from xu for each minibatch ) . We did not use a more aggressive transformation mainly because sampling at the sentence level can preserve the semantic meaning of the sampled spans . 3 EXPERIMENTS . 3.1 DATA FOR PRETRAINING . We test our ConVIRT framework by pretraining two separate image encoders covering different medical specialties using two separate paired image-text datasets : • Chest image encoder : We use version 2 of the public MIMIC-CXR database ( Johnson et al. , 2019 ) , which is a collection of chest radiograph images paired with their textual reports , and since its release has become a standard resource for studying multi-modal modeling of medical images . After preprocessing , this dataset contains a total of about 217k image-text pairs , with each pair containing an average of 1.7 images and 6.0 sentences . • Bony image encoder : We obtain a collection of musculoskeletal image-text pairs from the Rhode Island Hospital system . Following chest images , musculoskeletal images constitute the second most common type of radiograph images in a typical hospital . This dataset contains a total of 48k image-text pairs , with each pair containing an average of 2.5 images and 8.0 sentences . We include model implementation and pretraining details in Appendix A .
In this work, the authors propose a new model, named ConVIRT to learn the medical visual representation from paired image and textual data in an unsupervised strategy. In ConVIRT, they mainly use a contrastive loss with two modalities (images and texts) as inputs to learn the representation. The experimental results show their proposed model achieve higher performance than other methods in image classification and zero-shot retrieval tasks.
SP:92d7b00137258b40bcaf13fd19e032cf4c40b3d8
Asynchronous Modeling: A Dual-phase Perspective for Long-Tailed Recognition
1 INTRODUCTION . Past years have witnessed huge progress in visual recognition with the successful application of deep convolutional neural networks ( CNNs ) on large-scale datasets , e.g. , ImageNet ILSVRC 2012 ( Russakovsky et al. , 2015 ) , Places ( Zhou et al. , 2017 ) . Such datasets are usually artificially collected and exhibit approximately uniform distribution concerning the number of samples in each class . Real-world datasets , however , are always long-tailed that only a few classes occupy the majority of instances in the dataset ( data-rich ) and most classes have rarely few samples ( data-poor ) ( Reed , 2001 ; Van Horn & Perona , 2017 ) . When modeling such datasets , many standard methods suffer from severe degradation of overall performance . More specifically , the recognition ability on classes with rarely few instances are significantly impaired ( Liu et al. , 2019 ) . One prominent direction is to apply class re-sampling or loss re-weighting to balance the influence of different classes ( Byrd & Lipton , 2019 ; Shu et al. , 2019 ) and another alternative is to conduct transferring ( Wang et al. , 2017 ; Liu et al. , 2019 ) by the assumption that knowledge obtained on the data-rich classes should benefit the recognition of data-poor classes . Recently , more sophisticated models are designed to train the model either base on some new findings ( Zhou et al. , 2020 ; Kang et al. , 2020 ) or combine all available techniques ( Zhu & Yang , 2020 ) . However , the property of longtailed setting makes it remain to be difficult to achieve large gains compared to balanced datasets . In contrast to the aforementioned strategies , we approach the long-tailed recognition problem by analyzing gradient distortion in long-tailed data , attributing to the interaction between gradients generated by data-rich and data-poor classes , i.e. , the direction of overall gradient is shifted to be closer to the gradient on data-rich classes and its norm variance is increased due to the dramatic variation in the gradient generated by data-poor classes . The degenerated performance when comparing with balanced datasets indicates the gradient distortion is negative during model training . Motivated by this , we hypothesize that the combined analysis for gradients generated by data-rich and data-poor classes could be improper in long-tailed data and attempt to disentangle these two gradients . We thus propose the conception of asynchronous modeling and split the original network to promote a dual-phase learning , along with the partition of the given dataset . In phase I , data-rich classes keeps the bulk of the original dataset . It facilitates better local representation learning and more precise classifier boundary determination by eliminating the negative gradient interaction produced by datapoor classes . Based on the model learned in phase I , we involve the rest data to do new boundary exploration in the second phase . While transiting from the first phase to the second , it is hoped to reserve the knowledge learned in the first phase . Specifically , we design an exemplar memory bank and introduce a memory-retentive loss . The memory bank reserves a few most prominent examples from classes in the first phase and collaborates with data in the second phase for classification . Also , the collaborated data , together with the new memory-retentive loss , tries to preserve old knowledge when the model adapts to new classes in the second phase . In the experiments , we evaluate the proposed asynchronous modeling strategy by comparing to typical strategies , which include the re-balancing based methods ( Cao et al. , 2019 ) and transferring based methods ( Liu et al. , 2019 ) . Furthermore , we also consider the latest , more sophisticated works , like BBN ( Zhou et al. , 2020 ) , IEM ( Zhu & Yang , 2020 ) . The comprehensive study and comparison across four commonly used long-tailed benchmarks , including CIFAR100-LT , Places-LT , ImageNetLT and iNaturalist 2018 validate the efficacy of our method . 2 RELATED WORK . Class re-sampling . Most works along with this line can be categorized as over-sampling of tail classes ( Chawla et al. , 2002 ; Han et al. , 2005 ; Byrd & Lipton , 2019 ) or under-sampling over head classes ( Drummond et al. , 2003 ) . While the idea of re-sampling makes the overall distribution more balanced , it may encounter the problem of over-fitting on rare data and the missing of critical information on dominant classes ( Chawla et al. , 2002 ; Cui et al. , 2019 ) , thus hurting the overall generalization . Beyond that , Ouyang et al . ( 2016 ) ; Liu et al . ( 2019 ) also involve a more refined idea of fine-tuning after representation extraction to adjust the final decision boundary . Loss re-weighting . Methods based on loss re-weighting generally allocate larger weights for tail classes to increase their importance ( Lin et al. , 2017 ; Ren et al. , 2018 ; Shu et al. , 2019 ; Cui et al. , 2019 ; Khan et al. , 2017 ; 2019 ; Huang et al. , 2019 ) . However , direct re-weighting method is difficult to be optimized when tackling a large-scale dataset ( Mikolov et al. , 2013 ) . Recently , Cao et al . ( 2019 ) considers the margins of the training set and introduces a label-distribution-aware loss to enlarge the margins of tail classes . Hayat et al . ( 2019 ) proposes the first hybrid loss function to jointly cluster and classify feature vectors in the Euclidean space and to ensure uniformly spaced and equidistant class prototypes . Knowledge transfer . Along this line , methods based on knowledge transfer handle the challenge of imbalanced dataset by transferring the information learned on head classes to assist tail classes . While Wang et al . ( 2017 ) proposes to transfer meta-knowledge from the head in a progressive manner , recent strategies take consideration of intra-class variance ( Yin et al. , 2019 ) , semantic feature ( Liu et al. , 2019 ; Chu et al. , 2020 ) or domain adaptation ( Jamal et al. , 2020 ) . Recently , BBN ( Zhou et al. , 2020 ) and LWS ( Kang et al. , 2020 ) boost the landscape of long-tailed problem based on some insightful findings . The former asserts that prominent class re-balancing methods can impair the representation learning and the latter claims that data imbalance might not be an issue in learning high-quality representations . IEM ( Zhu & Yang , 2020 ) designs a more complex model that tries to concern available techniques , like feature transferring and attention . In this paper , we are motivated by gradient distortion in long-tailed data , which is caused by the gradient interaction between data-rich classes and data-poor classes . We thus propose to split the learning stage into two phases . We demonstrate that this separation allows straightforward approaches to achieve high recognition performance , without introducing extra parameters . 3 OUR METHOD . Let X = { xi , yi } , i ∈ { 1 , ... , n } be the training set , where xi is the training data and yi is its corresponding label . The number of instances in class j is denoted as nj and the total number of training samples is denoted as n = ∑C j=1 nj , where C is the number of classes . Without loss of generality , we assume that the classes are sorted in decreasing order , that is , if i > j , ni ≤ nj . We define the whole network as f ( x ; [ Wr ; Wc ] ) , where f is the implemented deep learning model with parameters Wr for representation learning and parameters Wc for classification , and x is the input . 3.1 GRADIENT DISTORTION IN LONG TAIL . Given a long-tailed dataset , our goal is to achieve better overall performance across all classes . In contrast to previous common heuristics ( e.g. , resampling , reweighting and feature transfer ) , we revisit the problem of long-tailed classification from the perspective of gradient distortion . The overall gradient for updating is modulated by the gradients generated by data-rich classes in the head and data-poor classes in the tail . To state the details , we visualize the associated metrics in the training process of vanilla CIFAR100 and long-tailed CIFAR100 ( CIFAR100-LT ) in Fig . 1 . Specifically , the cosine similarity between the gradients is visualized in Fig . 1 ( a ) ( CIFAR100-LT ) and Fig . 1 ( b ) ( vanilla CIFAR100 ) . Similarly , the norm of each gradient is recorded in Fig . 1 ( c ) ( CIFAR100-LT ) and Fig . 1 ( d ) ( vanilla CIFAR100 ) . The higher similarity between the overall gradient and the datarich gradient indicates that the overall gradient is shifted to the direction of the data-rich gradient . Meanwhile , the norm variance of overall gradient is enlarged due to more dramatic fluctuation of the gradient on data-poor classes . Motivated by the degenerated performance in long-tailed dataset , it is hypothesized that synchronous application of two distinctive gradients could impair the overall performance . 3.2 ASYNCHRONOUS MODELING . Rather than directly regulating the overall gradient as previous methods , we begin with the disentanglement of two gradients and propose a dual-phase asynchronous modeling strategy . The data from data-rich classes is first considered in model training and then the rest classes are involved . Such asynchronous operation not only reduces the potential disturbance between two gradients , but also ensures the benefits of each gradient to be exploited . Mathematically , the original dataset is X with C classes . Suppose C1 classes are considered in phase I , we then write X1 as the set of data from C1 classes . The data in rest C2 classes is denoted as X2 , where C2 = C − C1 . Accordingly , the parameters Wc for C classes in f ( x ; [ Wr , Wc ] ) are truncated as W 1c for C1 classes in the first phase . 3.2.1 LEARNING IN THE FIRST PHASE . In model learning from data X1 , the consideration of gradient on data-poor categories is avoided , which keeps the truncated model f ( x ; [ Wr ; W 1c ] ) to be more concentrated . In optimization , the cross-entropy loss over the classes in X1 is minimized with respect to parameters Wr and W 1c . L1 = − ∑ ( x , y ) ∈X1 y log f ( x ; [ Wr ; W 1 c ] ) . ( 1 ) For further improvement in the training , some balanced sampling strategies could be incorporated in this phase . For example , the progressively-balanced strategy in ( Kang et al. , 2020 ) combines instance-balanced sampling and class-balanced sampling , that is , pj ( t ) = ( 1 − tT ) nj∑C i=1 ni + tT 1 C , where pj ( t ) denotes the sampling probability for class j in training epoch t. It is computed with linear combination for instances-based probability nj∑C i=1 ni and class-based probability 1C . T is the total epoch number . 3.2.2 JOINT PREDICTION IN THE SECOND PHASE . We wish to involve the data in X2 to obtain a complete model across all C classes for overall evaluation . To do so , on the basis of parameters Wr obtained in phase I , we introduce the classifier parameters W 2c for the recognition of new classes in X2 . Similar to phase I , the standard crossentropy loss across all data in X2 is considered . However , considering solely on data X2 tends to forget the knowledge learned in the first phase . To tackle with the obstacle , we thus design a memory bank and memory-retentive loss to realize the seamless connection between two data splits . First , representative samples in X1 are retained in an augmented memory module to enable the joint prediction over all classes . Second , the examples reserved in the memory are combined with X2 , which are collaboratively trained with a unified memory-retentive loss . Exemplar memory bank . In maintaining the knowledge obtained in the first phase , we design an exemplar memory bank that selects only a few most representative samples from classes in X1 . For simplicity , the number of selected samples from each class is set to be equal . We denote the reserved data in the memory bank as M . Ideally , the most representative examples are samples that are closest to the center of each class . However , a precise class center is not always accessible . Thus in practice , the center is progressively estimated by accessing over the entries generated in previous steps to infer new entry in the memory bank . Without loss of generalization , we consider class j in dataset X1 to demonstrate the detailed operation . We first compute the average feature from all examples in class j in original training set X1 to serve as a class prototype cj , which is thus the initial estimation of class center . We return the instance which is closest to cj in X1 and set it as the first selected sample for the memory bank , m1 = arg max xi∈X1 { s ( cj , X1 ) } , ( 2 ) where s is a vector space similarity metric , like cosine similarity . m1 is used to denote the returned sample xi . Before selecting the rest instances from X1 , we need to update the estimated center cj . Without loss of generality , suppose we have selected k samples from X1 and denote the feature map of data in memory bank as Mj = [ m1 , m2 , .. , mk ] ∈ Rk×d , where d is the dimension of each feature map . Each sample in Mj serves as a guided hypothesis and its correlation with cj can then be computed for the new state zk+1 , that is , pi = exp ( s ( cj , mi ) ) ∑ i exp ( s ( cj , mi ) ) , ( 3 ) zk+1 = k∑ i=1 pimi = pMj , ( 4 ) where s is the same similarity metric as above . pi is computed by the distances between the selected data and the center prototype and it serves as weights to update state zk+1 . zk+1 is the weighted average of all feature maps in Mj . New samples can then be returned for k + 1 step by performing mk+1 = arg max xi∈X1 { s ( cj + ∆ , X1 ) } , ( 5 ) where ∆ is the residual between cj and zk+1 , i.e. , ∆ = cj − zk+1 . mk+1 is used to denote the returned sample xi . Memory-retentive loss . Based on the memory bank , we obtain a combined data setD by extending X2 with examples in the memory bank M , i.e. , D = M ⋃ X2 . Similarly , the joint prediction with a cross-entropy loss is first considered . When the model is adapted to fit data X2 , the knowledge learned in X1 tends to be forgotten . We thus introduce a new memory-retentive loss LGdis based on graph matching , which provides a strong constraint in memorizing previous knowledge . Specifically , the feature map of each data in the training set D is a node in a graph . Based on the model learned in the first stage and the new model to be trained in the second phase , two graphs Gold and Gnew can thus be constructed . That is , we not only consider feature similarity of a single example on the old model and the new model , but also compute the global matching similarity on the whole training set D. Suppose the feature map of one node in Gold is zi and in Gold is ẑi , thus the similarity between old graph Gold and new graph Gnew is measured by computing the change between any node zi in Gold and any node zj in Gnew , that is , aji = exp ( s ( zi , ẑj ) ) ∑ j′ exp ( s ( zi , ẑj′ ) ) , zi ∈ Gold , ẑj , ẑj′ ∈ Gnew , ( 6 ) µi = ∑ j aji‖zi − ẑj‖ , zi ∈ Gold , ẑj ∈ Gnew , ( 7 ) LGdis = ∑ i µi , zi ∈ Gold , ( 8 ) where s is the vector similarity metric . aji represents the distance between node i in graph Gold and node j in graph Gnew , µi thus ntuitively measures the difference between zj and its closest neighbor in graph Gnew . Consider all nodes in graph Gold together , we obtain the memory-retentive loss LGdis , which describe graph similarity between two graphs . Overall loss . Combined the above analysis together , the overall loss in phase II is thus as below : L = 1 |D| ∑ x∈D ( Lcls ( x ) + Lintra ( x ) ) + λL G dis , ( 9 ) where the first term is for classification and the second is the designed loss which constrains the knowledge in old model through graph matching , λ is a hyperparameter to balance the two terms . Notice that , apart from the standard cross-entropy loss Lcls ( x ) for input x in the first term , we also consider an intra-classification loss Lintra ( x ) to avoid memory data in M being dominated by new classes in X2 . When we consider cosine linear classifier , one of the instantiations could be Lintra ( x ) = ∑K k=1 max ( 0 , m− 〈w̄ , z̄ ( x ) 〉+ 〈w̄k , z̄ ( x ) 〉 , in which , w̄ is the ground-truth class embedding and w̄k denotes the other class embedding , z̄ ( x ) is the normalized feature map of x , m is a margin value . 〈w̄ , z̄ ( x ) 〉 denotes a positive score between w̄ and z̄ ( x ) , while 〈w̄k , z̄ ( x ) 〉 denotes the negative score between w̄k and z̄ ( x ) . Lintra optimizes the network to maintain a margin of m between the positive score and the highest negative score . Finally , for a comprehensive overview of the asynchronous modeling structure , we can find it in Algorithm 1 in Appendix B .
This paper works on long-tailed classification. The authors conducted an analysis and claimed that the difference of gradients computed on the head and tail classes plays an important role in the performance drop. The authors then proposed a two-stage approach to first train on the head classes and then train on the tail classes in an incremental learning fashion. The proposed algorithm achieved better performance than existing methods on benchmark datasets.
SP:4514e92c7a02cd2765a9cc4b35392594b022fa3e
Asynchronous Modeling: A Dual-phase Perspective for Long-Tailed Recognition
1 INTRODUCTION . Past years have witnessed huge progress in visual recognition with the successful application of deep convolutional neural networks ( CNNs ) on large-scale datasets , e.g. , ImageNet ILSVRC 2012 ( Russakovsky et al. , 2015 ) , Places ( Zhou et al. , 2017 ) . Such datasets are usually artificially collected and exhibit approximately uniform distribution concerning the number of samples in each class . Real-world datasets , however , are always long-tailed that only a few classes occupy the majority of instances in the dataset ( data-rich ) and most classes have rarely few samples ( data-poor ) ( Reed , 2001 ; Van Horn & Perona , 2017 ) . When modeling such datasets , many standard methods suffer from severe degradation of overall performance . More specifically , the recognition ability on classes with rarely few instances are significantly impaired ( Liu et al. , 2019 ) . One prominent direction is to apply class re-sampling or loss re-weighting to balance the influence of different classes ( Byrd & Lipton , 2019 ; Shu et al. , 2019 ) and another alternative is to conduct transferring ( Wang et al. , 2017 ; Liu et al. , 2019 ) by the assumption that knowledge obtained on the data-rich classes should benefit the recognition of data-poor classes . Recently , more sophisticated models are designed to train the model either base on some new findings ( Zhou et al. , 2020 ; Kang et al. , 2020 ) or combine all available techniques ( Zhu & Yang , 2020 ) . However , the property of longtailed setting makes it remain to be difficult to achieve large gains compared to balanced datasets . In contrast to the aforementioned strategies , we approach the long-tailed recognition problem by analyzing gradient distortion in long-tailed data , attributing to the interaction between gradients generated by data-rich and data-poor classes , i.e. , the direction of overall gradient is shifted to be closer to the gradient on data-rich classes and its norm variance is increased due to the dramatic variation in the gradient generated by data-poor classes . The degenerated performance when comparing with balanced datasets indicates the gradient distortion is negative during model training . Motivated by this , we hypothesize that the combined analysis for gradients generated by data-rich and data-poor classes could be improper in long-tailed data and attempt to disentangle these two gradients . We thus propose the conception of asynchronous modeling and split the original network to promote a dual-phase learning , along with the partition of the given dataset . In phase I , data-rich classes keeps the bulk of the original dataset . It facilitates better local representation learning and more precise classifier boundary determination by eliminating the negative gradient interaction produced by datapoor classes . Based on the model learned in phase I , we involve the rest data to do new boundary exploration in the second phase . While transiting from the first phase to the second , it is hoped to reserve the knowledge learned in the first phase . Specifically , we design an exemplar memory bank and introduce a memory-retentive loss . The memory bank reserves a few most prominent examples from classes in the first phase and collaborates with data in the second phase for classification . Also , the collaborated data , together with the new memory-retentive loss , tries to preserve old knowledge when the model adapts to new classes in the second phase . In the experiments , we evaluate the proposed asynchronous modeling strategy by comparing to typical strategies , which include the re-balancing based methods ( Cao et al. , 2019 ) and transferring based methods ( Liu et al. , 2019 ) . Furthermore , we also consider the latest , more sophisticated works , like BBN ( Zhou et al. , 2020 ) , IEM ( Zhu & Yang , 2020 ) . The comprehensive study and comparison across four commonly used long-tailed benchmarks , including CIFAR100-LT , Places-LT , ImageNetLT and iNaturalist 2018 validate the efficacy of our method . 2 RELATED WORK . Class re-sampling . Most works along with this line can be categorized as over-sampling of tail classes ( Chawla et al. , 2002 ; Han et al. , 2005 ; Byrd & Lipton , 2019 ) or under-sampling over head classes ( Drummond et al. , 2003 ) . While the idea of re-sampling makes the overall distribution more balanced , it may encounter the problem of over-fitting on rare data and the missing of critical information on dominant classes ( Chawla et al. , 2002 ; Cui et al. , 2019 ) , thus hurting the overall generalization . Beyond that , Ouyang et al . ( 2016 ) ; Liu et al . ( 2019 ) also involve a more refined idea of fine-tuning after representation extraction to adjust the final decision boundary . Loss re-weighting . Methods based on loss re-weighting generally allocate larger weights for tail classes to increase their importance ( Lin et al. , 2017 ; Ren et al. , 2018 ; Shu et al. , 2019 ; Cui et al. , 2019 ; Khan et al. , 2017 ; 2019 ; Huang et al. , 2019 ) . However , direct re-weighting method is difficult to be optimized when tackling a large-scale dataset ( Mikolov et al. , 2013 ) . Recently , Cao et al . ( 2019 ) considers the margins of the training set and introduces a label-distribution-aware loss to enlarge the margins of tail classes . Hayat et al . ( 2019 ) proposes the first hybrid loss function to jointly cluster and classify feature vectors in the Euclidean space and to ensure uniformly spaced and equidistant class prototypes . Knowledge transfer . Along this line , methods based on knowledge transfer handle the challenge of imbalanced dataset by transferring the information learned on head classes to assist tail classes . While Wang et al . ( 2017 ) proposes to transfer meta-knowledge from the head in a progressive manner , recent strategies take consideration of intra-class variance ( Yin et al. , 2019 ) , semantic feature ( Liu et al. , 2019 ; Chu et al. , 2020 ) or domain adaptation ( Jamal et al. , 2020 ) . Recently , BBN ( Zhou et al. , 2020 ) and LWS ( Kang et al. , 2020 ) boost the landscape of long-tailed problem based on some insightful findings . The former asserts that prominent class re-balancing methods can impair the representation learning and the latter claims that data imbalance might not be an issue in learning high-quality representations . IEM ( Zhu & Yang , 2020 ) designs a more complex model that tries to concern available techniques , like feature transferring and attention . In this paper , we are motivated by gradient distortion in long-tailed data , which is caused by the gradient interaction between data-rich classes and data-poor classes . We thus propose to split the learning stage into two phases . We demonstrate that this separation allows straightforward approaches to achieve high recognition performance , without introducing extra parameters . 3 OUR METHOD . Let X = { xi , yi } , i ∈ { 1 , ... , n } be the training set , where xi is the training data and yi is its corresponding label . The number of instances in class j is denoted as nj and the total number of training samples is denoted as n = ∑C j=1 nj , where C is the number of classes . Without loss of generality , we assume that the classes are sorted in decreasing order , that is , if i > j , ni ≤ nj . We define the whole network as f ( x ; [ Wr ; Wc ] ) , where f is the implemented deep learning model with parameters Wr for representation learning and parameters Wc for classification , and x is the input . 3.1 GRADIENT DISTORTION IN LONG TAIL . Given a long-tailed dataset , our goal is to achieve better overall performance across all classes . In contrast to previous common heuristics ( e.g. , resampling , reweighting and feature transfer ) , we revisit the problem of long-tailed classification from the perspective of gradient distortion . The overall gradient for updating is modulated by the gradients generated by data-rich classes in the head and data-poor classes in the tail . To state the details , we visualize the associated metrics in the training process of vanilla CIFAR100 and long-tailed CIFAR100 ( CIFAR100-LT ) in Fig . 1 . Specifically , the cosine similarity between the gradients is visualized in Fig . 1 ( a ) ( CIFAR100-LT ) and Fig . 1 ( b ) ( vanilla CIFAR100 ) . Similarly , the norm of each gradient is recorded in Fig . 1 ( c ) ( CIFAR100-LT ) and Fig . 1 ( d ) ( vanilla CIFAR100 ) . The higher similarity between the overall gradient and the datarich gradient indicates that the overall gradient is shifted to the direction of the data-rich gradient . Meanwhile , the norm variance of overall gradient is enlarged due to more dramatic fluctuation of the gradient on data-poor classes . Motivated by the degenerated performance in long-tailed dataset , it is hypothesized that synchronous application of two distinctive gradients could impair the overall performance . 3.2 ASYNCHRONOUS MODELING . Rather than directly regulating the overall gradient as previous methods , we begin with the disentanglement of two gradients and propose a dual-phase asynchronous modeling strategy . The data from data-rich classes is first considered in model training and then the rest classes are involved . Such asynchronous operation not only reduces the potential disturbance between two gradients , but also ensures the benefits of each gradient to be exploited . Mathematically , the original dataset is X with C classes . Suppose C1 classes are considered in phase I , we then write X1 as the set of data from C1 classes . The data in rest C2 classes is denoted as X2 , where C2 = C − C1 . Accordingly , the parameters Wc for C classes in f ( x ; [ Wr , Wc ] ) are truncated as W 1c for C1 classes in the first phase . 3.2.1 LEARNING IN THE FIRST PHASE . In model learning from data X1 , the consideration of gradient on data-poor categories is avoided , which keeps the truncated model f ( x ; [ Wr ; W 1c ] ) to be more concentrated . In optimization , the cross-entropy loss over the classes in X1 is minimized with respect to parameters Wr and W 1c . L1 = − ∑ ( x , y ) ∈X1 y log f ( x ; [ Wr ; W 1 c ] ) . ( 1 ) For further improvement in the training , some balanced sampling strategies could be incorporated in this phase . For example , the progressively-balanced strategy in ( Kang et al. , 2020 ) combines instance-balanced sampling and class-balanced sampling , that is , pj ( t ) = ( 1 − tT ) nj∑C i=1 ni + tT 1 C , where pj ( t ) denotes the sampling probability for class j in training epoch t. It is computed with linear combination for instances-based probability nj∑C i=1 ni and class-based probability 1C . T is the total epoch number . 3.2.2 JOINT PREDICTION IN THE SECOND PHASE . We wish to involve the data in X2 to obtain a complete model across all C classes for overall evaluation . To do so , on the basis of parameters Wr obtained in phase I , we introduce the classifier parameters W 2c for the recognition of new classes in X2 . Similar to phase I , the standard crossentropy loss across all data in X2 is considered . However , considering solely on data X2 tends to forget the knowledge learned in the first phase . To tackle with the obstacle , we thus design a memory bank and memory-retentive loss to realize the seamless connection between two data splits . First , representative samples in X1 are retained in an augmented memory module to enable the joint prediction over all classes . Second , the examples reserved in the memory are combined with X2 , which are collaboratively trained with a unified memory-retentive loss . Exemplar memory bank . In maintaining the knowledge obtained in the first phase , we design an exemplar memory bank that selects only a few most representative samples from classes in X1 . For simplicity , the number of selected samples from each class is set to be equal . We denote the reserved data in the memory bank as M . Ideally , the most representative examples are samples that are closest to the center of each class . However , a precise class center is not always accessible . Thus in practice , the center is progressively estimated by accessing over the entries generated in previous steps to infer new entry in the memory bank . Without loss of generalization , we consider class j in dataset X1 to demonstrate the detailed operation . We first compute the average feature from all examples in class j in original training set X1 to serve as a class prototype cj , which is thus the initial estimation of class center . We return the instance which is closest to cj in X1 and set it as the first selected sample for the memory bank , m1 = arg max xi∈X1 { s ( cj , X1 ) } , ( 2 ) where s is a vector space similarity metric , like cosine similarity . m1 is used to denote the returned sample xi . Before selecting the rest instances from X1 , we need to update the estimated center cj . Without loss of generality , suppose we have selected k samples from X1 and denote the feature map of data in memory bank as Mj = [ m1 , m2 , .. , mk ] ∈ Rk×d , where d is the dimension of each feature map . Each sample in Mj serves as a guided hypothesis and its correlation with cj can then be computed for the new state zk+1 , that is , pi = exp ( s ( cj , mi ) ) ∑ i exp ( s ( cj , mi ) ) , ( 3 ) zk+1 = k∑ i=1 pimi = pMj , ( 4 ) where s is the same similarity metric as above . pi is computed by the distances between the selected data and the center prototype and it serves as weights to update state zk+1 . zk+1 is the weighted average of all feature maps in Mj . New samples can then be returned for k + 1 step by performing mk+1 = arg max xi∈X1 { s ( cj + ∆ , X1 ) } , ( 5 ) where ∆ is the residual between cj and zk+1 , i.e. , ∆ = cj − zk+1 . mk+1 is used to denote the returned sample xi . Memory-retentive loss . Based on the memory bank , we obtain a combined data setD by extending X2 with examples in the memory bank M , i.e. , D = M ⋃ X2 . Similarly , the joint prediction with a cross-entropy loss is first considered . When the model is adapted to fit data X2 , the knowledge learned in X1 tends to be forgotten . We thus introduce a new memory-retentive loss LGdis based on graph matching , which provides a strong constraint in memorizing previous knowledge . Specifically , the feature map of each data in the training set D is a node in a graph . Based on the model learned in the first stage and the new model to be trained in the second phase , two graphs Gold and Gnew can thus be constructed . That is , we not only consider feature similarity of a single example on the old model and the new model , but also compute the global matching similarity on the whole training set D. Suppose the feature map of one node in Gold is zi and in Gold is ẑi , thus the similarity between old graph Gold and new graph Gnew is measured by computing the change between any node zi in Gold and any node zj in Gnew , that is , aji = exp ( s ( zi , ẑj ) ) ∑ j′ exp ( s ( zi , ẑj′ ) ) , zi ∈ Gold , ẑj , ẑj′ ∈ Gnew , ( 6 ) µi = ∑ j aji‖zi − ẑj‖ , zi ∈ Gold , ẑj ∈ Gnew , ( 7 ) LGdis = ∑ i µi , zi ∈ Gold , ( 8 ) where s is the vector similarity metric . aji represents the distance between node i in graph Gold and node j in graph Gnew , µi thus ntuitively measures the difference between zj and its closest neighbor in graph Gnew . Consider all nodes in graph Gold together , we obtain the memory-retentive loss LGdis , which describe graph similarity between two graphs . Overall loss . Combined the above analysis together , the overall loss in phase II is thus as below : L = 1 |D| ∑ x∈D ( Lcls ( x ) + Lintra ( x ) ) + λL G dis , ( 9 ) where the first term is for classification and the second is the designed loss which constrains the knowledge in old model through graph matching , λ is a hyperparameter to balance the two terms . Notice that , apart from the standard cross-entropy loss Lcls ( x ) for input x in the first term , we also consider an intra-classification loss Lintra ( x ) to avoid memory data in M being dominated by new classes in X2 . When we consider cosine linear classifier , one of the instantiations could be Lintra ( x ) = ∑K k=1 max ( 0 , m− 〈w̄ , z̄ ( x ) 〉+ 〈w̄k , z̄ ( x ) 〉 , in which , w̄ is the ground-truth class embedding and w̄k denotes the other class embedding , z̄ ( x ) is the normalized feature map of x , m is a margin value . 〈w̄ , z̄ ( x ) 〉 denotes a positive score between w̄ and z̄ ( x ) , while 〈w̄k , z̄ ( x ) 〉 denotes the negative score between w̄k and z̄ ( x ) . Lintra optimizes the network to maintain a margin of m between the positive score and the highest negative score . Finally , for a comprehensive overview of the asynchronous modeling structure , we can find it in Algorithm 1 in Appendix B .
This paper proposes an interesting view to analyze the long-tailed problem. It states that the gradients are dominated by the head classes so that the tail classes perform poorly. From this observation, the authors propose a dual-phase approach that first train $W_r, W_c^1$ with only head-class data, and extend to train $W_r, W_c$ with tail-class data and the constructed exemplar memory bank for head classes with a newly proposed memory retentive loss.
SP:4514e92c7a02cd2765a9cc4b35392594b022fa3e
Learning Flexible Classifiers with Shot-CONditional Episodic (SCONE) Training
1 INTRODUCTION . Few-shot classification is the problem of learning a classifier using only a few examples . Specifically , the aim is to utilize a training dataset towards obtaining a flexible model that has the ability to ‘ quickly ’ learn about new classes from few examples . Success is evaluated on a number of test episodes , each posing a classification task between previously-unseen test classes . In each such episode , we are given a few examples , or “ shots ” , of each new class that can be used to adapt this model to the task at hand , and the objective is to correctly classify a held-out set of examples of the new classes . A simple approach to this problem is to learn a classifier over the training classes , parameterized as a neural network feature extractor followed by a classification layer . While the classification layer is not useful at test time due to the class shift , the embedding weights that are learned during this “ pre-training ” phase evidently constitute a strong representation that can be used to tackle test tasks when paired with a simple “ inference algorithm ” ( e.g . nearest-neighbour , logistic regression ) to make predictions for each example in the test episode given the episode ’ s small training set . Alternatively , early influential works on few-shot classification ( Vinyals et al. , 2016 ) advocate for episodic training , a regime where the training objective is expressed in terms of performance on a number of training episodes of the same structure as the test episodes , but with the classes sampled from the training set . It was hypothesized that this episodic approach captures a more appropriate inductive bias for the problem of few-shot classification and would thus lead to better generalization . However , there is an ongoing debate about whether episodic training is in fact required for obtaining the best few-shot classification performance . Notably , recent work ( Chen et al. , 2019 ; Dhillon et al. , 2020 ) proposed strong “ pre-training ” baselines that leverage common best practices for supervised training ( e.g . normalization schemes , data augmentation ) to obtain a powerful representation that works well for this task . Interestingly , other recent work combines the pre-training of a single classifier with episodic fine-tuning by removing the classification head and continuing to train the embedding network using the episodic inference algorithm that will be applied at test time ( Triantafillou et al. , 2020 ; Chen et al. , 2020 ) . The success of this hybrid approach suggests that perhaps the two regimes have complementary strengths , but the role of this episodic fine-tuning is poorly understood : what is the nature of the modification it induces into the pre-trained solution ? Under which conditions is it required in order to achieve the best performance ? As a step towards answering those questions , we investigate the effect of the shot used during episodic fine-tuning on the resulting model ’ s performance on test tasks of a range of shots . We are particularly interested in understanding whether the shot of the training episodes constitutes a source of information that the model can leverage to improve its few-shot classification performance on episodes of that shot at test time . Our analysis reveals that indeed a particular functionality that this fine-tuning phase may serve is to specialize a pre-trained model to solving tasks of a particular shot ; accomplished by performing the fine-tuning on episodes of that shot . However , perhaps unsurprisingly , we find that specializing to a given shot comes at the expense of hurting performance for other shots , in agreement with ( Cao et al. , 2020 ) ’ s theoretical finding in the context of Prototypical Networks ( Snell et al. , 2017 ) where inferior performance was reported when the shot at training time did not match the shot at test time . Given those trade-offs , how can our newfound understanding of episodic fine-tuning as shotspecialization help us in practice ? It is unrealistic to assume that we will always have the same number of labeled examples for every new class we hope to learn at test time , so we are interested in approaches that operate well on tasks of a range of shots . However , it is impractical to fine-tune a separate episodic model for every shot , and intuitively that seems wasteful as we expect that tasks of similar shots should require similar models . Motivated by this , we propose to train a single shot-conditional model for specializing the pre-trained solution to a wide spectrum of shots without suffering trade-offs . This leads to a compact but flexible model that can be conditioned to be made appropriate for the shot appearing in each test episode . In what follows we provide some background on few-shot classification and episodic models and then introduce our proposed shot-conditioning approach and related work . We then present our experimental analysis on the effect of the shot chosen for episodic fine-tuning , and we observe that our shot-conditional training approach is beneficial for obtaining a general flexible model that does not suffer the trade-offs inherent in naively specializing to any particular shot . Finally , we experiment with our proposed shot-conditional approach in the large-scale Meta-Dataset benchmark for few-shot classification , and demonstrate its effectiveness in that challenging environment . 2 BACKGROUND . Problem definition Few-shot classification aims to classify test examples of unseen classes from a small labeled training set . The standard evaluation procedure involves sampling classification episodes by picking N classes at random from a test set of classes Ctest and sampling two disjoint sets of examples from the N chosen classes : a support set ( or training set ) of k labeled examples per class , and a query set ( or test set ) of unlabeled examples , forming N -way , k-shot episodes . The model is allowed to use the support set , in addition to knowledge acquired while training on a disjoint set of classes Ctrain , to make a prediction for examples in the query set , and is evaluated on its query set accuracy averaged over multiple test episodes . Episodic training Early few-shot classification approaches ( Vinyals et al. , 2016 ) operate under the assumption that obtaining a model capable of few-shot classification requires training it on ( mini-batches of ) learning episodes , instead of ( mini-batches of ) individual examples as in standard supervised learning . These learning episodes are sampled in the same way as described above for test episodes , but with classes sampled from Ctrain this time . In other words , the model is trained to minimize a loss of the form : ES , Q∼PN , ktrain 1 |Q| ∑ ( x∗ , y∗ ) ∈Q − log pθ ( y∗ | x∗ , S ) ( 1 ) where S and Q are support and query sets sampled from the distribution PN , ktrain of N -way , k-shot training episodes induced by Ctrain , and θ represents the model ’ s parameters . This training regime is often characterized as meta-learning or learning to learn , i.e . learning over many episodes how to learn within an episode ( from few labeled examples ) . Episodic models differ by their “ inference algorithm ” , i.e . the manner in which pθ ( y∗ | x∗ , S ) is computed to classify query examples based on the support set . Prototypical Networks Prototypical Networks ( Snell et al. , 2017 ) is a simple but effective episodic model which constructs a prototype φc for each class c in an episode as φc = 1 |Sc| ∑ x∈Sc fθ ( x ) , ( 2 ) where f is an embedding function parametrized by θ and Sc represents the set of support examples belonging to class c , and classifies a given query example as p ( y∗ = c | x∗ , S ) = exp ( −||x ∗ − φc||22 ) ∑ c′ exp ( −||x∗ − φc′ ||22 ) . ( 3 ) 3 SHOT CONDITIONAL EPISODIC ( SCONE ) TRAINING . In this section we introduce Shot CONditional Episodic ( SCONE ) training for the purpose of specializing a strong pre-trained model to solving few-shot classification tasks of a range of different shots , without suffering disproportionately for any shot . Training objective Training episodically involves minimizing the objective shown in Equation 1 . We first sample an episode from P k , Ntrain and compute a prediction pθ ( y ∗ | x∗ , S ) for each query example x∗ . We then compute the cross-entropy loss on the query set using those predictions and perform a parameter update by backpropagating its gradient with respect to θ into the inference algorithm . In this work we concern ourselves with models that use an embedding function fθ to obtain a representation for the support and query examples of each episode on top of which the inference algorithm is applied . In Prototypical Networks , for instance , fθ contains all of the model ’ s learnable parameters . SCONE trains on episodes of varying shots and conditions the model on each episode ’ s shot distribution . ( Figure 1 ) by minimizing Ek∼Pk ES , Q∼PN , ktrain 1 |Q| ∑ ( x∗ , y∗ ) ∈Q − log pθk ( y∗ | x∗ , S ) , ( 4 ) where Pk is the distribution over shots at training time and θk depends on an episode ’ s sampled shots . In the Appendix , we include an algorithm box outlining SCONE fine-tuning . Conditioning mechanism Rather than learning a separate set of model parameters for each shot setting , we modulate a subset of its parameters using FiLM ( Perez et al. , 2018 ) , a simple conditioning mechanism which performs an affine feature-wise transformation of its input x based on conditioning information k ( in our case , the episode ’ s number of shots ) : FiLM ( x ) = γ ( k ) x+ β ( k ) . ( 5 ) The dependency of γ and β on k is handled by maintaining distinct values for each shot setting and selecting the appropriate γ and β based on an episode ’ s shot . Equivalently , we can think of our approach as a compact representation of many shot-specific feature extractors which share all but their FiLM layer parameters . More concretely , we maintain a set of FiLM parameters for each shot in the [ 1 , MAX-SHOT ] range ( where MAX-SHOT is a hyperparameter ) and let all shots settings greater than or equal to MAXSHOT share the same FiLM parametrization . As is often the case in practice , instead of inserting FiLM layers in the network ’ s architecture , we modulate the scaling and shifting parameter values of existing batch normalization layers ( Dumoulin et al. , 2017 ; De Vries et al. , 2017 ) . When performing episodic fine-tuning , we initialize all sets of FiLM parameters to those learned during pre-training ( i.e . the learned batch normalization scaling and shifting coefficients ) . These different sets of FiLM parameters are then free to deviate from each other as a result of fine-tuning . We found it beneficial to penalize the L2-norm of β ( regularizing the offset towards 0 ) and the L2 norm of γ − 1 ( regularizing the scaling towards 1 ) . For this purpose , we introduce a hyperparameter that controls the strength of this FiLM weight decay . Handling class-imbalanced episodes SCONE can also be used on imbalanced episodes , where different classes have different shots . In that case , instead of selecting a single set of FiLM parameters , we compute the FiLM parameters for an episode as the convex combination of the FiLM parameters associated with all shots found in the episode , where the weights of that combination are determined based on the frequency with which each shot appears in the episode . Concretely , the episode ’ s “ shot distribution ” s ( a vector of length MAX-SHOT ) is obtained by averaging the one-hot representations of the shots of the classes appearing in an episode . In the special case of a class-balanced episode , the resulting average will be exactly a one-hot vector . This shot distribution is then used for the purpose of selecting the episode ’ s FiLM parameters . This can be thought of as an embedding lookup sTF in a matrix F of FiLM parameters using a shot distribution s. Smoothing the shot distribution We expect similar shot values to require similar FiLM parameters , which we incorporate as an inductive bias by smoothing the shot distribution . We outline our SMOOTHSHOT procedure in the Appendix in Algorithm 1 , which receives the shot s of a class ( an integer ) , and a smoothing hyperparameter m ( a float in [ 0 , 1 ] ) and returns the smoothed shot for that class , which is a vector of length MAX-SHOT . Essentially , the result of smoothing is that the returned vector representation of s is not strictly one-hot with only the position corresponding to the observed shot s being ‘ on ’ . Instead , some entries surrounding that position are also non-zero . Specifically , the entries that are directly adjacent to s receive the value m , the entries two spots away from s the value m2 , and so on , with entries further away from s receiving exponentially-decaying values .
The paper proposes a solution to few-shot meta learning approaches overfitting to the number of shots they are finetuned on, and not generalizing as well as expected to novel shots. In order to mitigate this problem, the paper suggests a parameterization of the meta learner which also conditions on the number of shots the model trains on. In practice, this is done via manipulation of the batch normalization parameters based on the number of shots. With this conditioning, the paper shows that the models perform better across a range of shots that they are evaluated on, compared to various sensible baselines.
SP:447a69bbd183f33b2950448c3d2bd50b7400410e
Learning Flexible Classifiers with Shot-CONditional Episodic (SCONE) Training
1 INTRODUCTION . Few-shot classification is the problem of learning a classifier using only a few examples . Specifically , the aim is to utilize a training dataset towards obtaining a flexible model that has the ability to ‘ quickly ’ learn about new classes from few examples . Success is evaluated on a number of test episodes , each posing a classification task between previously-unseen test classes . In each such episode , we are given a few examples , or “ shots ” , of each new class that can be used to adapt this model to the task at hand , and the objective is to correctly classify a held-out set of examples of the new classes . A simple approach to this problem is to learn a classifier over the training classes , parameterized as a neural network feature extractor followed by a classification layer . While the classification layer is not useful at test time due to the class shift , the embedding weights that are learned during this “ pre-training ” phase evidently constitute a strong representation that can be used to tackle test tasks when paired with a simple “ inference algorithm ” ( e.g . nearest-neighbour , logistic regression ) to make predictions for each example in the test episode given the episode ’ s small training set . Alternatively , early influential works on few-shot classification ( Vinyals et al. , 2016 ) advocate for episodic training , a regime where the training objective is expressed in terms of performance on a number of training episodes of the same structure as the test episodes , but with the classes sampled from the training set . It was hypothesized that this episodic approach captures a more appropriate inductive bias for the problem of few-shot classification and would thus lead to better generalization . However , there is an ongoing debate about whether episodic training is in fact required for obtaining the best few-shot classification performance . Notably , recent work ( Chen et al. , 2019 ; Dhillon et al. , 2020 ) proposed strong “ pre-training ” baselines that leverage common best practices for supervised training ( e.g . normalization schemes , data augmentation ) to obtain a powerful representation that works well for this task . Interestingly , other recent work combines the pre-training of a single classifier with episodic fine-tuning by removing the classification head and continuing to train the embedding network using the episodic inference algorithm that will be applied at test time ( Triantafillou et al. , 2020 ; Chen et al. , 2020 ) . The success of this hybrid approach suggests that perhaps the two regimes have complementary strengths , but the role of this episodic fine-tuning is poorly understood : what is the nature of the modification it induces into the pre-trained solution ? Under which conditions is it required in order to achieve the best performance ? As a step towards answering those questions , we investigate the effect of the shot used during episodic fine-tuning on the resulting model ’ s performance on test tasks of a range of shots . We are particularly interested in understanding whether the shot of the training episodes constitutes a source of information that the model can leverage to improve its few-shot classification performance on episodes of that shot at test time . Our analysis reveals that indeed a particular functionality that this fine-tuning phase may serve is to specialize a pre-trained model to solving tasks of a particular shot ; accomplished by performing the fine-tuning on episodes of that shot . However , perhaps unsurprisingly , we find that specializing to a given shot comes at the expense of hurting performance for other shots , in agreement with ( Cao et al. , 2020 ) ’ s theoretical finding in the context of Prototypical Networks ( Snell et al. , 2017 ) where inferior performance was reported when the shot at training time did not match the shot at test time . Given those trade-offs , how can our newfound understanding of episodic fine-tuning as shotspecialization help us in practice ? It is unrealistic to assume that we will always have the same number of labeled examples for every new class we hope to learn at test time , so we are interested in approaches that operate well on tasks of a range of shots . However , it is impractical to fine-tune a separate episodic model for every shot , and intuitively that seems wasteful as we expect that tasks of similar shots should require similar models . Motivated by this , we propose to train a single shot-conditional model for specializing the pre-trained solution to a wide spectrum of shots without suffering trade-offs . This leads to a compact but flexible model that can be conditioned to be made appropriate for the shot appearing in each test episode . In what follows we provide some background on few-shot classification and episodic models and then introduce our proposed shot-conditioning approach and related work . We then present our experimental analysis on the effect of the shot chosen for episodic fine-tuning , and we observe that our shot-conditional training approach is beneficial for obtaining a general flexible model that does not suffer the trade-offs inherent in naively specializing to any particular shot . Finally , we experiment with our proposed shot-conditional approach in the large-scale Meta-Dataset benchmark for few-shot classification , and demonstrate its effectiveness in that challenging environment . 2 BACKGROUND . Problem definition Few-shot classification aims to classify test examples of unseen classes from a small labeled training set . The standard evaluation procedure involves sampling classification episodes by picking N classes at random from a test set of classes Ctest and sampling two disjoint sets of examples from the N chosen classes : a support set ( or training set ) of k labeled examples per class , and a query set ( or test set ) of unlabeled examples , forming N -way , k-shot episodes . The model is allowed to use the support set , in addition to knowledge acquired while training on a disjoint set of classes Ctrain , to make a prediction for examples in the query set , and is evaluated on its query set accuracy averaged over multiple test episodes . Episodic training Early few-shot classification approaches ( Vinyals et al. , 2016 ) operate under the assumption that obtaining a model capable of few-shot classification requires training it on ( mini-batches of ) learning episodes , instead of ( mini-batches of ) individual examples as in standard supervised learning . These learning episodes are sampled in the same way as described above for test episodes , but with classes sampled from Ctrain this time . In other words , the model is trained to minimize a loss of the form : ES , Q∼PN , ktrain 1 |Q| ∑ ( x∗ , y∗ ) ∈Q − log pθ ( y∗ | x∗ , S ) ( 1 ) where S and Q are support and query sets sampled from the distribution PN , ktrain of N -way , k-shot training episodes induced by Ctrain , and θ represents the model ’ s parameters . This training regime is often characterized as meta-learning or learning to learn , i.e . learning over many episodes how to learn within an episode ( from few labeled examples ) . Episodic models differ by their “ inference algorithm ” , i.e . the manner in which pθ ( y∗ | x∗ , S ) is computed to classify query examples based on the support set . Prototypical Networks Prototypical Networks ( Snell et al. , 2017 ) is a simple but effective episodic model which constructs a prototype φc for each class c in an episode as φc = 1 |Sc| ∑ x∈Sc fθ ( x ) , ( 2 ) where f is an embedding function parametrized by θ and Sc represents the set of support examples belonging to class c , and classifies a given query example as p ( y∗ = c | x∗ , S ) = exp ( −||x ∗ − φc||22 ) ∑ c′ exp ( −||x∗ − φc′ ||22 ) . ( 3 ) 3 SHOT CONDITIONAL EPISODIC ( SCONE ) TRAINING . In this section we introduce Shot CONditional Episodic ( SCONE ) training for the purpose of specializing a strong pre-trained model to solving few-shot classification tasks of a range of different shots , without suffering disproportionately for any shot . Training objective Training episodically involves minimizing the objective shown in Equation 1 . We first sample an episode from P k , Ntrain and compute a prediction pθ ( y ∗ | x∗ , S ) for each query example x∗ . We then compute the cross-entropy loss on the query set using those predictions and perform a parameter update by backpropagating its gradient with respect to θ into the inference algorithm . In this work we concern ourselves with models that use an embedding function fθ to obtain a representation for the support and query examples of each episode on top of which the inference algorithm is applied . In Prototypical Networks , for instance , fθ contains all of the model ’ s learnable parameters . SCONE trains on episodes of varying shots and conditions the model on each episode ’ s shot distribution . ( Figure 1 ) by minimizing Ek∼Pk ES , Q∼PN , ktrain 1 |Q| ∑ ( x∗ , y∗ ) ∈Q − log pθk ( y∗ | x∗ , S ) , ( 4 ) where Pk is the distribution over shots at training time and θk depends on an episode ’ s sampled shots . In the Appendix , we include an algorithm box outlining SCONE fine-tuning . Conditioning mechanism Rather than learning a separate set of model parameters for each shot setting , we modulate a subset of its parameters using FiLM ( Perez et al. , 2018 ) , a simple conditioning mechanism which performs an affine feature-wise transformation of its input x based on conditioning information k ( in our case , the episode ’ s number of shots ) : FiLM ( x ) = γ ( k ) x+ β ( k ) . ( 5 ) The dependency of γ and β on k is handled by maintaining distinct values for each shot setting and selecting the appropriate γ and β based on an episode ’ s shot . Equivalently , we can think of our approach as a compact representation of many shot-specific feature extractors which share all but their FiLM layer parameters . More concretely , we maintain a set of FiLM parameters for each shot in the [ 1 , MAX-SHOT ] range ( where MAX-SHOT is a hyperparameter ) and let all shots settings greater than or equal to MAXSHOT share the same FiLM parametrization . As is often the case in practice , instead of inserting FiLM layers in the network ’ s architecture , we modulate the scaling and shifting parameter values of existing batch normalization layers ( Dumoulin et al. , 2017 ; De Vries et al. , 2017 ) . When performing episodic fine-tuning , we initialize all sets of FiLM parameters to those learned during pre-training ( i.e . the learned batch normalization scaling and shifting coefficients ) . These different sets of FiLM parameters are then free to deviate from each other as a result of fine-tuning . We found it beneficial to penalize the L2-norm of β ( regularizing the offset towards 0 ) and the L2 norm of γ − 1 ( regularizing the scaling towards 1 ) . For this purpose , we introduce a hyperparameter that controls the strength of this FiLM weight decay . Handling class-imbalanced episodes SCONE can also be used on imbalanced episodes , where different classes have different shots . In that case , instead of selecting a single set of FiLM parameters , we compute the FiLM parameters for an episode as the convex combination of the FiLM parameters associated with all shots found in the episode , where the weights of that combination are determined based on the frequency with which each shot appears in the episode . Concretely , the episode ’ s “ shot distribution ” s ( a vector of length MAX-SHOT ) is obtained by averaging the one-hot representations of the shots of the classes appearing in an episode . In the special case of a class-balanced episode , the resulting average will be exactly a one-hot vector . This shot distribution is then used for the purpose of selecting the episode ’ s FiLM parameters . This can be thought of as an embedding lookup sTF in a matrix F of FiLM parameters using a shot distribution s. Smoothing the shot distribution We expect similar shot values to require similar FiLM parameters , which we incorporate as an inductive bias by smoothing the shot distribution . We outline our SMOOTHSHOT procedure in the Appendix in Algorithm 1 , which receives the shot s of a class ( an integer ) , and a smoothing hyperparameter m ( a float in [ 0 , 1 ] ) and returns the smoothed shot for that class , which is a vector of length MAX-SHOT . Essentially , the result of smoothing is that the returned vector representation of s is not strictly one-hot with only the position corresponding to the observed shot s being ‘ on ’ . Instead , some entries surrounding that position are also non-zero . Specifically , the entries that are directly adjacent to s receive the value m , the entries two spots away from s the value m2 , and so on , with entries further away from s receiving exponentially-decaying values .
This paper proposed an implementation method of using different numbers of shots of data for few-shot learning such as to mitigate the negative effect of "different shots". It optimized the FiLM parameters using meta gradient descent during episodic meta-training with different-shot learning tasks. It conducted the experiments on quite a set of "meta-dataset benchmarks".
SP:447a69bbd183f33b2950448c3d2bd50b7400410e
Constructing Multiple High-Quality Deep Neural Networks: A TRUST-TECH Based Approach
1 INTRODUCTION . Due to the high redundancy on parameters of deep neural networks ( DNN ) , the number of local optima is huge and can grow exponentially with the dimensionality of the parameter space ( Auer et al . ( 1996 ) ; Choromanska et al . ( 2015 ) ; Dauphin et al . ( 2014b ) ) . It still remains a challenging task to locate high-quality optimal solutions in the parameter space , where the model performs satisfying on both training and testing data . A popular metric for the quality of a local solution is to measure its generalization capability , which is commonly defined as the gap between the training and testing performances ( LeCun et al . ( 2015 ) ) . For deep neural networks with high expressivity , the training error is near zero , so that it suffices to use the test error to represent the generalization gap . Generally , local solvers do not have the global vision of the parameter space , so there is no guarantee that starting from a random initialization can locate a high-quality local optimal solution . On the other hand , one can apply a non-local solver in the parameter space to find multiple optimal solutions and select the high-quality ones . Furthermore , one can improve the DNN performance by ensembling these high-quality solutions with high diversity . TRUST-TECH plays an important role in achieving the above goal . In general , it computes highquality optimal solutions for general nonlinear optimization problems , and the theoretical foundations can be bound in ( Chiang & Chu ( 1996 ) ; Lee & Chiang ( 2004 ) ) . It helps local solvers escape from one local optimal solution ( LOS ) and search for other LOSs . It has been successfully applied in guiding the Expectation Maximization method to achieve higher performance ( Reddy et al . ( 2008 ) ) , training ANNs ( Chiang & Reddy ( 2007 ) ; Wang & Chiang ( 2011 ) ) , estimating finite mixture models ( Reddy et al . ( 2008 ) ) , and solving optimal power flow problems ( Chiang et al . ( 2009 ) ; Zhang & Chiang ( 2020 ) ) . Additionally , it does not interfere with existing local or global solvers , but cooperates with them . TRUST-TECH efficiently searches the neighboring subspace of the promising candidates for new LOSs in a tier-by-tier manner . Eventually , a set of high-quality LOSs can be found . The idea of TRUST-TECH method is the following : for a given loss surface of an op- timization problem , each LOS has its own stability region . If one start from one local optimum , and track the loss values along a given direction , we will find an exit point where loss start to decrease steadily , which means another stability region corresponding to a nearby LOS is found . By following a trajectory in the stability region , another LOS is computed . We propose an optima exploring algorithm designed for DNNs that is able to find high-quality local optima in a systematic way , and thereby form optimal and robust ensembles . Normally for a deep neural network , exit points can hardly be found by original TRUST-TECH due to the huge dimensionality . So , in this work we introduce the Dynamic Searching Paths ( DSP ) method instead of fixed directions . We set the search directions to be trainable parameters . After an exploration step forward along the current direction , we calibrate the direction using the current gradient . By doing so , the method can benefit from not only the mature Stochastic Gradient Descent ( SGD ) training paradigm with powerful GPU acceleration capability , but also exit points can be easily found . The overall DSP-TT method consists of four stages . First , we train the network using local solvers to get a tier-0 local optimal solution . Second , our proposed Dynamic Search Path TRUST-TECH ( DSP-TT ) method is called to find nearby solutions in a tier-by-tier manner . Third , a selection process is performed so that candidates with high quality are chosen . Finally , ensembles are built with necessary fine-tunings on selected member networks . To the best of our knowledge , this paper is the first one to search for multiple solutions on deep neural networks in a systematical way . Our major contributions and highlights are summarized as follows : • We propose the Dynamic Searching Path ( DSP ) method that enables exploration on highdimensional parameter space efficiently . • We show that combining TRUST-TECH method with DSP ( DSP-TT ) is effective in finding multiple optimal solutions on deep neural networks systematically . • We design and implement the algorithm efficiently that it obtains multiple local solutions within one training session with minor GPU memory overhead . • We develop the DSP-TT Ensembles of solutions found by DSP-TT with high quality and diversity for further improving the DNN performance . 2 RELATED WORK . The synergy between massive numbers of parameters and nonlinear activations in deep neural networks leads to the existence of multiple LOSs trained on a specific dataset . Experiments show that different initializations lead to different solutions with various qualities ( Dauphin et al . ( 2014a ) ) . Even with the same initialization , the network can converge to different solutions depending on the loss function and the solver ( Im et al . ( 2016 ) ) . Many regularization techniques are therefore proposed to force the network to converge to a better solution , some of which are proven to be useful and popular ( Kingma & Ba ( 2015 ) ; Srivastava et al . ( 2014 ) ; Ioffe & Szegedy ( 2015 ) ) . However , it is still mysterious how these regularized solutions are compared to the global optimum . There are researchers that focus on characterizing different local optima and investigating the internal relations among them . It is claimed in ( Hochreiter & Schmidhuber ( 1997 ) ; Keskar et al . ( 2016 ) ) that sharp minima prevent deep neural networks from generalizing well on the testing dataset . Later , Dinh et al . ( 2017 ) argued that the definition of flatness in ( Keskar et al . ( 2016 ) ) is problematic and came up with an example where solutions with different geometries can have similar test time performances . Li et al . ( 2018 ) designed a new visualization method that rebuilt the correspondence between the sharpness of the minimizer and the generalization capability . On the other hand , some researchers apply meta-heuristic algorithms to obtain a better local minimizer ( Gudise & Venayagamoorthy ( 2003 ) ; Zhang et al . ( 2007 ) ; Juang ( 2004 ) ; Leung et al . ( 2003 ) ) . However , these methods were either designed for obsolete toy models or on explicit benchmark objective functions where there are analytical forms for global optimum , and therefore the effectiveness of these algorithms on deep architectures and large datasets seems unconvincing . Moreover , the advantage of the global searching ability seems to be crippled when it comes to deep neural networks , and the minimizers they found are still local . Recently , Garipov et al . ( 2018 ) reveal the relation among local optima by building pathways , called Mode Connectivities , as simple as polygonal chains or Bezier curves that connect any two local optima . Draxler et al . ( 2018 ) also found similar results at the same time , although they used the Nudged Elastic Band ( Jonsson et al . ( 1998 ) ) method from quantum chemistry . To address the issue of converging to suboptimal solutions , a great deal of research efforts were directed to ensembles . Xie et al . ( 2013 ) proposed horizontal and vertical ensembles that combine the output of networks at different training epochs . Laine & Aila ( 2016 ) used a group of models with different regularization and augmentation conditions to create variety . Moghimi et al . ( 2016 ) borrowed the concept of boosting to create a strong ensemble of CNNs . Izmailov et al . ( 2018 ) found that averaging weights from different iterations leads to flatter solutions than from SGD and helps in generalization . Huang et al . ( 2017a ) proposed a method that obtains ensembles by collecting several local minima along a single training process using a cyclical learning rate schedule . Zhang et al . ( 2020 ) used similar approach , but with the sampling capability that fully exploits each mode . Garipov et al . ( 2018 ) developed the Fast Geometric Ensembling based on Mode Connectivity . Although the methods in these papers obtain multiple networks within one training session , these ensembles are still largely dependent on initialization . While these ensemble methods performs better than a single network , naive randomly initialized ensemble is still the best choice when training budget is unconstrained . Fort et al . ( 2020 ) explained this phenomenon as they explore different modes in function space compared to weight averaging . Shen et al . ( 2019 ) improved the ensemble inference efficiency via a teacher-student paradigm distilling the knowledge of an ensemble into one single network . Yang et al . ( 2020 ) built ensembles by randomly initialize on a subparameter space , aiming to alleviate the exponentially growing number of local minima on deep networks . Wang & Chiang ( 2011 ) used the TRUST-TECH ( Chiang & Chu ( 1996 ) ; Lee & Chiang ( 2004 ) ; Chiang & Alberto ( 2015 ) ) method to perform a systematic search for diversified minimizers to obtain their ensembles . They implemented TRUST-TECH for training and constructing high-quality ensembles of artificial neural networks and showed that their method consistently outperforms other training methods . We generalize this method and tailor it for deep architectures and to work efficiently with popular local solvers in deep learning . 3 TRUST-TECH METHOD FOR MULTIPLE OPTIMAL SOLUTIONS 3.1 TRUST-TECH METHODOLOGY Another category of methods has been developed in recent years for systematically computing a set of local optimal solutions in a deterministic manner . This family of methods is termed TRUST-TECH methodology , standing for Transformation Under Stability-reTaining Equilibria Characterization . It is based on the following transformations : ( i ) the transformation of a local optimal solution ( LOS ) of a nonlinear optimization problem into a stable equilibrium point ( SEP , Chiang & Chu ( 1996 ) ) of a continuous nonlinear dynamical system . ( ii ) the transformation of the search space of nonlinear optimization problems into the union of the closure of stability regions of SEPs . Hence , the optimization problem ( i.e . the problem of finding LOSs ) is transformed into the problem of finding SEPs , and therefore we use the terms LOS and SEP interchangeably in the following discussion . It will become clear that the stability regions of SEPs play an important role in finding these local optimal solutions . We note that , given a LOS , its corresponding first-tier LOSs are defined as those optimal solutions whose corresponding stability boundaries have a non-empty intersection with the stability boundary of the LOS ( Chiang & Chu ( 1996 ) ; Lee & Chiang ( 2004 ) ) . The definition of the stability boundary and its characterization can be found in Chiang & Fekih-Ahmed ( 1996 ) . Similarly , its second-tier LOSs are defined as those optimal solutions whose corresponding stability boundaries have a non-empty intersection with the stability boundary of first-tier LOSs ( Chiang & Chu ( 1996 ) ; Lee & Chiang ( 2004 ) ) . See fig . 1 for an illustration . We consider a general nonlinear unconstrained optimization problem defined as follows : min x c ( x ) ( 1 ) where c : D ⊂ Rn → R is assumed to be continuously differentiable and D the set of feasible points ( or search space ) . A point x∗ ∈ D is called a local minimum if c ( x∗ ) ≤ c ( x ) for all x ∈ D with ‖x− x∗‖ < σ for σ > 0 . To systematically search for multiple LOSs , a generalized negative gradient system based on the objective eq . ( 1 ) is constructed and is described by dx dt = −gradR c ( x ) = −R ( x ) −1 · ∇c ( x ) = f ( x ( t ) ) ( 2 ) where the state vector x ( t ) of this dynamic system belongs to the Euclidean space Rn and the function f : Rn → Rn satisfies the sufficient condition for the existence and the uniqueness of the solutions . R ( x ) is a positive definite symmetric matrix ( also known as the Riemannian metric ) that generalizes various training algorithms . For example , if R ( x ) = I ( identity ) , it is a naive gradient descent algorithm . If R ( x ) = J ( x ) > J ( x ) ( J is the Jacobian matrix ) , then it is the Gauss-Newton method . If R ( x ) = J ( x ) > J ( x ) + µI , it becomes the Levenberg-Marquardt ( LM ) algorithm . The Theorem of the Equilibrium Points and Local Optima ( Lee & Chiang ( 2004 ) ) shows one nice property of the gradient system ( 2 ) , which is the critical point of the optimization problem ( 1 ) is a ( asymptotically ) SEP of the dynamic system ( 2 ) . i.e . x̄ is a SEP of ( 2 ) if and only if x̄ is an isolated local minimum for ( 1 ) . Hence , the task of finding the LOSs of ( 1 ) can be achieved by finding the corresponding SEPs of ( 2 ) . In short , TRUST-TECH is a dynamical method designed to systematically compute multiple LOSs with the following features : ( i ) it is a systematic and deterministic method to escape from a LOS towards another LOS , ( ii ) it finds multiple LOSs in a tier-by-tier manner ( see fig . 1 ) , and ( iii ) has a solid theoretical foundation ( Chiang & Chu ( 1996 ) ; Lee & Chiang ( 2004 ) ; Chiang & Alberto ( 2015 ) ; Zhang & Chiang ( 2020 ) ) . Another distinguishing feature of TRUST-TECH is its ability to guide a local method and/or a metaheuristic method for effective computation of a set of LOSs or even the global optimal solution .
The paper describes a technique based on the modified generalized gradient descent for finding multiple high-quality local optima of deep neural networks. The search method does not require re-initialization of the model parameters and can be carried out in a single training session. Identified local optima are then used to build model ensembles which appear to outperform several other ensembling approaches.
SP:0a87278c0da53a0b1989fad7932566b8ddd8634b
Constructing Multiple High-Quality Deep Neural Networks: A TRUST-TECH Based Approach
1 INTRODUCTION . Due to the high redundancy on parameters of deep neural networks ( DNN ) , the number of local optima is huge and can grow exponentially with the dimensionality of the parameter space ( Auer et al . ( 1996 ) ; Choromanska et al . ( 2015 ) ; Dauphin et al . ( 2014b ) ) . It still remains a challenging task to locate high-quality optimal solutions in the parameter space , where the model performs satisfying on both training and testing data . A popular metric for the quality of a local solution is to measure its generalization capability , which is commonly defined as the gap between the training and testing performances ( LeCun et al . ( 2015 ) ) . For deep neural networks with high expressivity , the training error is near zero , so that it suffices to use the test error to represent the generalization gap . Generally , local solvers do not have the global vision of the parameter space , so there is no guarantee that starting from a random initialization can locate a high-quality local optimal solution . On the other hand , one can apply a non-local solver in the parameter space to find multiple optimal solutions and select the high-quality ones . Furthermore , one can improve the DNN performance by ensembling these high-quality solutions with high diversity . TRUST-TECH plays an important role in achieving the above goal . In general , it computes highquality optimal solutions for general nonlinear optimization problems , and the theoretical foundations can be bound in ( Chiang & Chu ( 1996 ) ; Lee & Chiang ( 2004 ) ) . It helps local solvers escape from one local optimal solution ( LOS ) and search for other LOSs . It has been successfully applied in guiding the Expectation Maximization method to achieve higher performance ( Reddy et al . ( 2008 ) ) , training ANNs ( Chiang & Reddy ( 2007 ) ; Wang & Chiang ( 2011 ) ) , estimating finite mixture models ( Reddy et al . ( 2008 ) ) , and solving optimal power flow problems ( Chiang et al . ( 2009 ) ; Zhang & Chiang ( 2020 ) ) . Additionally , it does not interfere with existing local or global solvers , but cooperates with them . TRUST-TECH efficiently searches the neighboring subspace of the promising candidates for new LOSs in a tier-by-tier manner . Eventually , a set of high-quality LOSs can be found . The idea of TRUST-TECH method is the following : for a given loss surface of an op- timization problem , each LOS has its own stability region . If one start from one local optimum , and track the loss values along a given direction , we will find an exit point where loss start to decrease steadily , which means another stability region corresponding to a nearby LOS is found . By following a trajectory in the stability region , another LOS is computed . We propose an optima exploring algorithm designed for DNNs that is able to find high-quality local optima in a systematic way , and thereby form optimal and robust ensembles . Normally for a deep neural network , exit points can hardly be found by original TRUST-TECH due to the huge dimensionality . So , in this work we introduce the Dynamic Searching Paths ( DSP ) method instead of fixed directions . We set the search directions to be trainable parameters . After an exploration step forward along the current direction , we calibrate the direction using the current gradient . By doing so , the method can benefit from not only the mature Stochastic Gradient Descent ( SGD ) training paradigm with powerful GPU acceleration capability , but also exit points can be easily found . The overall DSP-TT method consists of four stages . First , we train the network using local solvers to get a tier-0 local optimal solution . Second , our proposed Dynamic Search Path TRUST-TECH ( DSP-TT ) method is called to find nearby solutions in a tier-by-tier manner . Third , a selection process is performed so that candidates with high quality are chosen . Finally , ensembles are built with necessary fine-tunings on selected member networks . To the best of our knowledge , this paper is the first one to search for multiple solutions on deep neural networks in a systematical way . Our major contributions and highlights are summarized as follows : • We propose the Dynamic Searching Path ( DSP ) method that enables exploration on highdimensional parameter space efficiently . • We show that combining TRUST-TECH method with DSP ( DSP-TT ) is effective in finding multiple optimal solutions on deep neural networks systematically . • We design and implement the algorithm efficiently that it obtains multiple local solutions within one training session with minor GPU memory overhead . • We develop the DSP-TT Ensembles of solutions found by DSP-TT with high quality and diversity for further improving the DNN performance . 2 RELATED WORK . The synergy between massive numbers of parameters and nonlinear activations in deep neural networks leads to the existence of multiple LOSs trained on a specific dataset . Experiments show that different initializations lead to different solutions with various qualities ( Dauphin et al . ( 2014a ) ) . Even with the same initialization , the network can converge to different solutions depending on the loss function and the solver ( Im et al . ( 2016 ) ) . Many regularization techniques are therefore proposed to force the network to converge to a better solution , some of which are proven to be useful and popular ( Kingma & Ba ( 2015 ) ; Srivastava et al . ( 2014 ) ; Ioffe & Szegedy ( 2015 ) ) . However , it is still mysterious how these regularized solutions are compared to the global optimum . There are researchers that focus on characterizing different local optima and investigating the internal relations among them . It is claimed in ( Hochreiter & Schmidhuber ( 1997 ) ; Keskar et al . ( 2016 ) ) that sharp minima prevent deep neural networks from generalizing well on the testing dataset . Later , Dinh et al . ( 2017 ) argued that the definition of flatness in ( Keskar et al . ( 2016 ) ) is problematic and came up with an example where solutions with different geometries can have similar test time performances . Li et al . ( 2018 ) designed a new visualization method that rebuilt the correspondence between the sharpness of the minimizer and the generalization capability . On the other hand , some researchers apply meta-heuristic algorithms to obtain a better local minimizer ( Gudise & Venayagamoorthy ( 2003 ) ; Zhang et al . ( 2007 ) ; Juang ( 2004 ) ; Leung et al . ( 2003 ) ) . However , these methods were either designed for obsolete toy models or on explicit benchmark objective functions where there are analytical forms for global optimum , and therefore the effectiveness of these algorithms on deep architectures and large datasets seems unconvincing . Moreover , the advantage of the global searching ability seems to be crippled when it comes to deep neural networks , and the minimizers they found are still local . Recently , Garipov et al . ( 2018 ) reveal the relation among local optima by building pathways , called Mode Connectivities , as simple as polygonal chains or Bezier curves that connect any two local optima . Draxler et al . ( 2018 ) also found similar results at the same time , although they used the Nudged Elastic Band ( Jonsson et al . ( 1998 ) ) method from quantum chemistry . To address the issue of converging to suboptimal solutions , a great deal of research efforts were directed to ensembles . Xie et al . ( 2013 ) proposed horizontal and vertical ensembles that combine the output of networks at different training epochs . Laine & Aila ( 2016 ) used a group of models with different regularization and augmentation conditions to create variety . Moghimi et al . ( 2016 ) borrowed the concept of boosting to create a strong ensemble of CNNs . Izmailov et al . ( 2018 ) found that averaging weights from different iterations leads to flatter solutions than from SGD and helps in generalization . Huang et al . ( 2017a ) proposed a method that obtains ensembles by collecting several local minima along a single training process using a cyclical learning rate schedule . Zhang et al . ( 2020 ) used similar approach , but with the sampling capability that fully exploits each mode . Garipov et al . ( 2018 ) developed the Fast Geometric Ensembling based on Mode Connectivity . Although the methods in these papers obtain multiple networks within one training session , these ensembles are still largely dependent on initialization . While these ensemble methods performs better than a single network , naive randomly initialized ensemble is still the best choice when training budget is unconstrained . Fort et al . ( 2020 ) explained this phenomenon as they explore different modes in function space compared to weight averaging . Shen et al . ( 2019 ) improved the ensemble inference efficiency via a teacher-student paradigm distilling the knowledge of an ensemble into one single network . Yang et al . ( 2020 ) built ensembles by randomly initialize on a subparameter space , aiming to alleviate the exponentially growing number of local minima on deep networks . Wang & Chiang ( 2011 ) used the TRUST-TECH ( Chiang & Chu ( 1996 ) ; Lee & Chiang ( 2004 ) ; Chiang & Alberto ( 2015 ) ) method to perform a systematic search for diversified minimizers to obtain their ensembles . They implemented TRUST-TECH for training and constructing high-quality ensembles of artificial neural networks and showed that their method consistently outperforms other training methods . We generalize this method and tailor it for deep architectures and to work efficiently with popular local solvers in deep learning . 3 TRUST-TECH METHOD FOR MULTIPLE OPTIMAL SOLUTIONS 3.1 TRUST-TECH METHODOLOGY Another category of methods has been developed in recent years for systematically computing a set of local optimal solutions in a deterministic manner . This family of methods is termed TRUST-TECH methodology , standing for Transformation Under Stability-reTaining Equilibria Characterization . It is based on the following transformations : ( i ) the transformation of a local optimal solution ( LOS ) of a nonlinear optimization problem into a stable equilibrium point ( SEP , Chiang & Chu ( 1996 ) ) of a continuous nonlinear dynamical system . ( ii ) the transformation of the search space of nonlinear optimization problems into the union of the closure of stability regions of SEPs . Hence , the optimization problem ( i.e . the problem of finding LOSs ) is transformed into the problem of finding SEPs , and therefore we use the terms LOS and SEP interchangeably in the following discussion . It will become clear that the stability regions of SEPs play an important role in finding these local optimal solutions . We note that , given a LOS , its corresponding first-tier LOSs are defined as those optimal solutions whose corresponding stability boundaries have a non-empty intersection with the stability boundary of the LOS ( Chiang & Chu ( 1996 ) ; Lee & Chiang ( 2004 ) ) . The definition of the stability boundary and its characterization can be found in Chiang & Fekih-Ahmed ( 1996 ) . Similarly , its second-tier LOSs are defined as those optimal solutions whose corresponding stability boundaries have a non-empty intersection with the stability boundary of first-tier LOSs ( Chiang & Chu ( 1996 ) ; Lee & Chiang ( 2004 ) ) . See fig . 1 for an illustration . We consider a general nonlinear unconstrained optimization problem defined as follows : min x c ( x ) ( 1 ) where c : D ⊂ Rn → R is assumed to be continuously differentiable and D the set of feasible points ( or search space ) . A point x∗ ∈ D is called a local minimum if c ( x∗ ) ≤ c ( x ) for all x ∈ D with ‖x− x∗‖ < σ for σ > 0 . To systematically search for multiple LOSs , a generalized negative gradient system based on the objective eq . ( 1 ) is constructed and is described by dx dt = −gradR c ( x ) = −R ( x ) −1 · ∇c ( x ) = f ( x ( t ) ) ( 2 ) where the state vector x ( t ) of this dynamic system belongs to the Euclidean space Rn and the function f : Rn → Rn satisfies the sufficient condition for the existence and the uniqueness of the solutions . R ( x ) is a positive definite symmetric matrix ( also known as the Riemannian metric ) that generalizes various training algorithms . For example , if R ( x ) = I ( identity ) , it is a naive gradient descent algorithm . If R ( x ) = J ( x ) > J ( x ) ( J is the Jacobian matrix ) , then it is the Gauss-Newton method . If R ( x ) = J ( x ) > J ( x ) + µI , it becomes the Levenberg-Marquardt ( LM ) algorithm . The Theorem of the Equilibrium Points and Local Optima ( Lee & Chiang ( 2004 ) ) shows one nice property of the gradient system ( 2 ) , which is the critical point of the optimization problem ( 1 ) is a ( asymptotically ) SEP of the dynamic system ( 2 ) . i.e . x̄ is a SEP of ( 2 ) if and only if x̄ is an isolated local minimum for ( 1 ) . Hence , the task of finding the LOSs of ( 1 ) can be achieved by finding the corresponding SEPs of ( 2 ) . In short , TRUST-TECH is a dynamical method designed to systematically compute multiple LOSs with the following features : ( i ) it is a systematic and deterministic method to escape from a LOS towards another LOS , ( ii ) it finds multiple LOSs in a tier-by-tier manner ( see fig . 1 ) , and ( iii ) has a solid theoretical foundation ( Chiang & Chu ( 1996 ) ; Lee & Chiang ( 2004 ) ; Chiang & Alberto ( 2015 ) ; Zhang & Chiang ( 2020 ) ) . Another distinguishing feature of TRUST-TECH is its ability to guide a local method and/or a metaheuristic method for effective computation of a set of LOSs or even the global optimal solution .
This paper proposes a new method for applying the TRUST-TECH method to the ensemble of deep neural networks (DNNs). When applying TRUST-TECH to a deep neural network, it is difficult to determine the direction and exit point. This paper introduces Dynamic Searching Paths (DSP) to solve these problems. The proposed method can apply TRUST-TECH method to DNNs using Stochastic Gradient Descent (SGD) with minor memory overhead.
SP:0a87278c0da53a0b1989fad7932566b8ddd8634b
Learning disentangled representations with the Wasserstein Autoencoder
1 INTRODUCTION . Learning representations of data is at the heart of deep learning ; the ability to interpret those representations empowers practitioners to improve the performance and robustness of their models ( Bengio et al. , 2013 ; van Steenkiste et al. , 2019 ) . In the case where the data is underpinned by independent latent generative factors , a good representation should encode information about the data in a semantically meaningful manner with statistically independent latent variables encoding for each factor . Bengio et al . ( 2013 ) define a disentangled representation as having the property that a change in one dimension corresponds to a change in one factor of variation , while being relatively invariant to changes in other factors . While many attempts to formalize this concept have been proposed ( Higgins et al. , 2018 ; Eastwood & Williams , 2018 ; Do & Tran , 2019 ) , finding a principled and reproducible approach to assess disentanglement is still an open problem ( Locatello et al. , 2019 ) . Recent successful unsupervised learning methods have shown how simply modifying the ELBO objective , either re-weighting the latent regularization terms or directly regularizing the statistical dependencies in the latent , can be effective in learning disentangled representation . Higgins et al . ( 2017 ) and Burgess et al . ( 2018 ) control the information bottleneck capacity of Variational Autoencoders ( VAEs , ( Kingma & Welling , 2014 ; Rezende et al. , 2014 ) ) by heavily penalizing the latent regularization term . Chen et al . ( 2018 ) perform ELBO surgery to isolate the terms at the origin of disentanglement in β-VAE , improving the reconstruction-disentanglement trade off . Esmaeili et al . ( 2018 ) further improve the reconstruction capacity of β-TCVAE by introducing structural dependencies both between groups of variables and between variables within each group . Alternatively , directly regularizing the aggregated posterior to the prior with density-free divergences ( Zhao et al. , 2019 ) or moments matching ( Kumar et al. , 2018 ) , or simply penalizing a high Total Correlation ( TC , ( Watanabe , 1960 ) ) in the latent ( Kim & Mnih , 2018 ) has shown good disentanglement performances . In fact , information theory has been a fertile ground to tackle representation learning . Achille & Soatto ( 2018 ) re-interpret VAEs from an Information Bottleneck view ( Tishby et al. , 1999 ) , re-phrasing it as a trade off between sufficiency and minimality of the representation , regularizing a pseudo TC between the aggregated posterior and the true conditional posterior . Similarly , Gao et al . ( 2019 ) use the principle of total Correlation Explanation ( CorEX ) ( Ver Steeg & Galstyan , 2014 ) and maximize the mutual information between the observation and a subset of anchor latent points . Maximizing the mutual information ( MI ) between the observation and the latent has been broadly used ( van den Oord et al. , 2018 ; Hjelm et al. , 2019 ; Bachman et al. , 2019 ; Tschannen et al. , 2020 ) , showing encouraging results in representation learning . However , Tschannen et al . ( 2020 ) argued that MI maximization alone can not explain the disentanglement performances of these methods . Building on the Optimal Transport ( OT ) problem ( Villani , 2008 ) , Tolstikhin et al . ( 2018 ) introduced the Wasserstein Autoencoder ( WAE ) , an alternative to VAE for learning generative models . Similarly to VAE , WAE maps the data into a ( low-dimensional ) latent space while regularizing the averaged encoding distribution . This is in contrast with VAEs where the posterior is regularized at each data point , and allows the encoding distribution to capture significant information about the data while still matching the prior when averaged over the whole data set . Interestingly , by directly regularizing the aggregated posterior , WAE hints at more explicit control on the way the information is encoded , and thus better disentanglement . The reconstruction term of the WAE allows for any cost function on the observation space , opening the door to better suited reconstruction terms , for example when working with continuous RGB data sets where the Euclidean distance or any metric on the observation space can result in more accurate reconstructions of the data . In this work , following the success of regularizing the TC in disentanglement , we propose to use the Kullback-Leibler ( KL ) divergence as the latent regularization function in the WAE . We introduce the Total Correlation WAE ( TCWAE ) with an explicit dependency on the TC of the aggregated posterior . Using two different estimators for the KL terms , we perform extensive comparison with succesful methods on a number of data sets . Our results show that TCWAEs achieve competitive disentanglement performances while improving modelling performance by allowing flexibility in the choice of reconstruction cost . 2 IMPORTANCE OF TOTAL CORRELATION IN DISENTANGLEMENT . 2.1 TOTAL CORRELATION . The TC of a random vector Z ∈ Z under P is defined by TC ( Z ) , dZ∑ d=1 Hpd ( Zd ) −Hp ( Z ) ( 1 ) where pd ( zd ) is the marginal density over only zd and Hp ( Z ) , −Ep log p ( Z ) is the Shannon differential entropy , which encodes the information contained in Z under P . Since dZ∑ d=1 Hpd ( Zd ) ≤ Hp ( Z ) ( 2 ) with equality when the marginals Zd are mutually independent , the TC can be interpreted as the loss of information when assuming mutual independence of the Zd ; namely , it measures the mutual dependence of the marginals . Thus , in the context of disentanglement learning , we seek a low TC of the aggregated posterior , p ( z ) = ∫ X p ( z|x ) p ( x ) dx , which forces the model to encode the data into statistically independent latent codes . High MI between the data and the latent is then obtained when the posterior , p ( z|x ) , manages to capture relevant information from the data . 2.2 TOTAL CORRELATION IN ELBO . We consider latent generative models pθ ( x ) = ∫ Z pθ ( x|z ) p ( z ) dz with prior p ( z ) and decoder network , pθ ( x|z ) , parametrized by θ. VAEs approximate the intractable posterior p ( z|x ) by introducing an encoding distribution ( the encoder ) , qφ ( z|x ) , and learning simultaneously θ and φwhen optimizing the variational lower bound , or ELBO , defined in Eq . 3 : LELBO ( θ , φ ) , E pdata ( X ) [ E qφ ( Z|X ) [ log pθ ( X|Z ) ] −KL ( qφ ( Z|X ) ‖ p ( Z ) ) ] ≤ E pdata ( X ) log pθ ( X ) ( 3 ) Following Hoffman & Johnson ( 2016 ) , we can decompose the KL term in Eq . 3 as : 1 Nbatch N∑ n=1 KL ( qφ ( Z|xn ) ‖ p ( Z ) ) = KL ( q ( Z , N ) ‖ q ( Z ) p ( N ) ) ︸ ︷︷ ︸ i index-code MI + KL ( q ( Z ) ‖ p ( Z ) ) ︸ ︷︷ ︸ ii marginal KL ( 4 ) where p ( n ) = 1N , q ( z|n ) = q ( z|xn ) , q ( z , n ) = q ( z|n ) p ( n ) and q ( z ) = ∑N n=1 q ( z|n ) p ( n ) . i refers to the index-code mutual information and represents the MI between the data and the latent under the join distribution q ( z , n ) , and ii to the marginal KL matching the aggregated posterior to the prior . While discussion on the impact of a high index-code MI on disentanglement learning is still open , the marginal KL term plays an important role in disentanglement . Indeed , it pushes the encoder network to match the prior when averaged , as opposed to matching the prior for each data point . Combined with a factorized prior p ( z ) = ∏ d pd ( zd ) , as it is often the case , the aggregated posterior is forced to factorize and align with the axis of the prior . More specifically , the marginal KL term in Eq . 4 can be decomposed the as sum of a TC term and a dimensionwise-KL term : KL ( q ( Z ) ‖ p ( Z ) ) = TC ( q ( Z ) ) + dZ∑ d=1 KL ( qd ( Zd ) ‖ pd ( Zd ) ) ( 5 ) Thus maximizing the ELBO implicitly minimizes the TC of the aggregated posterior , enforcing the aggregated posterior to disentangle as Higgins et al . ( 2017 ) and Burgess et al . ( 2018 ) observed when strongly penalizing the KL term in Eq . 3 . Chen et al . ( 2018 ) leverage the KL decomposition in Eq . 5 by refining the heavy latent penalization to the TC only . However , the index-code MI term in Eq . 4 seems to have little to no role in disentanglement ( see ablation study of Chen et al . ( 2018 ) ) , potentially arming the reconstruction performances ( Hoffman & Johnson , 2016 ) . 3 WAE NATURALLY GOOD AT DISENTANGLING ? . In this section we introduce the OT problem and the WAE objective , and discuss the compelling properties of WAEs for representation learning . Mirroring β-TCVAE decomposition , we derive the TCWAE objective . 3.1 WAE . The Kantorovich formulation of the OT between the true-but-unknown data distribution PD and the model distribution Pθ , for a given cost function c , is defined by : OTc ( PD , Pθ ) = inf Γ∈P ( PD , Pθ ) ∫ X×X c ( x , x̃ ) γ ( x , x̃ ) dxdx̃ ( 6 ) where P ( PD , Pθ ) is the space of all couplings of PD and Pθ ; namely , the space of joint distributions Γ on X × X whose densities γ have marginals pD and pθ . Tolstikhin et al . ( 2018 ) derive the WAE objective by restraining this space and relaxing the hard constraint on the marginal using a soft constraint with a Lagrange multiplier ( see Appendix A for more details ) : WD , c ( θ , φ ) , E pD ( x ) E qφ ( z|x ) E pθ ( x̃|z ) c ( x , x̃ ) + λD ( q ( Z ) ‖ p ( Z ) ) ( 7 ) where D is any divergence function and λ a relaxation parameter . The decoder , pθ ( x̃|z ) , and the encoder , qφ ( z|x ) , are optimized simultaneously by dropping the closed-form minimization over the encoder network , with standard stochastic gradient descent methods . Similarly to the ELBO , objective 7 consists of a reconstruction cost term and a latent regularization term , preventing the latent codes to drift away from the prior . However , WAE explicitly penalizes the aggregate posterior . This motivates , following Section 2.2 , the use of WAE in disentanglement learning . Rubenstein et al . ( 2018 ) have shown promising disentanglement performances without modifying the objective 7 . Another important difference lies in the functional form of the reconstruction cost in the reconstruction term . Indeed , WAE allows for more flexibility in the reconstruction term with any cost function allowed , and in particular , it allows for cost functions better suited to the data at hand and for the use of deterministic decoder networks ( Tolstikhin et al. , 2018 ; Frogner et al. , 2015 ) . This can potentially result in an improved reconstruction-disentanglement trade off as we empirically find in Sections 4.2 and 4.1 .
This paper addresses disentanglement in the latent space of autoencoders. To this end, it combines ideas from four existing papers, namely the reconstruction loss of the Wasserstein autoencoder, the regularization term decomposition from the total correlation autoencoder, and entropy estimation using minibatch-weighted sampling or the density-ratio trick. This combination certainly makes sense, as it brings together methods that have previously been shown to work well in isolation.
SP:8b35f7c054e1ac74e0ad260add9723766df8613d
Learning disentangled representations with the Wasserstein Autoencoder
1 INTRODUCTION . Learning representations of data is at the heart of deep learning ; the ability to interpret those representations empowers practitioners to improve the performance and robustness of their models ( Bengio et al. , 2013 ; van Steenkiste et al. , 2019 ) . In the case where the data is underpinned by independent latent generative factors , a good representation should encode information about the data in a semantically meaningful manner with statistically independent latent variables encoding for each factor . Bengio et al . ( 2013 ) define a disentangled representation as having the property that a change in one dimension corresponds to a change in one factor of variation , while being relatively invariant to changes in other factors . While many attempts to formalize this concept have been proposed ( Higgins et al. , 2018 ; Eastwood & Williams , 2018 ; Do & Tran , 2019 ) , finding a principled and reproducible approach to assess disentanglement is still an open problem ( Locatello et al. , 2019 ) . Recent successful unsupervised learning methods have shown how simply modifying the ELBO objective , either re-weighting the latent regularization terms or directly regularizing the statistical dependencies in the latent , can be effective in learning disentangled representation . Higgins et al . ( 2017 ) and Burgess et al . ( 2018 ) control the information bottleneck capacity of Variational Autoencoders ( VAEs , ( Kingma & Welling , 2014 ; Rezende et al. , 2014 ) ) by heavily penalizing the latent regularization term . Chen et al . ( 2018 ) perform ELBO surgery to isolate the terms at the origin of disentanglement in β-VAE , improving the reconstruction-disentanglement trade off . Esmaeili et al . ( 2018 ) further improve the reconstruction capacity of β-TCVAE by introducing structural dependencies both between groups of variables and between variables within each group . Alternatively , directly regularizing the aggregated posterior to the prior with density-free divergences ( Zhao et al. , 2019 ) or moments matching ( Kumar et al. , 2018 ) , or simply penalizing a high Total Correlation ( TC , ( Watanabe , 1960 ) ) in the latent ( Kim & Mnih , 2018 ) has shown good disentanglement performances . In fact , information theory has been a fertile ground to tackle representation learning . Achille & Soatto ( 2018 ) re-interpret VAEs from an Information Bottleneck view ( Tishby et al. , 1999 ) , re-phrasing it as a trade off between sufficiency and minimality of the representation , regularizing a pseudo TC between the aggregated posterior and the true conditional posterior . Similarly , Gao et al . ( 2019 ) use the principle of total Correlation Explanation ( CorEX ) ( Ver Steeg & Galstyan , 2014 ) and maximize the mutual information between the observation and a subset of anchor latent points . Maximizing the mutual information ( MI ) between the observation and the latent has been broadly used ( van den Oord et al. , 2018 ; Hjelm et al. , 2019 ; Bachman et al. , 2019 ; Tschannen et al. , 2020 ) , showing encouraging results in representation learning . However , Tschannen et al . ( 2020 ) argued that MI maximization alone can not explain the disentanglement performances of these methods . Building on the Optimal Transport ( OT ) problem ( Villani , 2008 ) , Tolstikhin et al . ( 2018 ) introduced the Wasserstein Autoencoder ( WAE ) , an alternative to VAE for learning generative models . Similarly to VAE , WAE maps the data into a ( low-dimensional ) latent space while regularizing the averaged encoding distribution . This is in contrast with VAEs where the posterior is regularized at each data point , and allows the encoding distribution to capture significant information about the data while still matching the prior when averaged over the whole data set . Interestingly , by directly regularizing the aggregated posterior , WAE hints at more explicit control on the way the information is encoded , and thus better disentanglement . The reconstruction term of the WAE allows for any cost function on the observation space , opening the door to better suited reconstruction terms , for example when working with continuous RGB data sets where the Euclidean distance or any metric on the observation space can result in more accurate reconstructions of the data . In this work , following the success of regularizing the TC in disentanglement , we propose to use the Kullback-Leibler ( KL ) divergence as the latent regularization function in the WAE . We introduce the Total Correlation WAE ( TCWAE ) with an explicit dependency on the TC of the aggregated posterior . Using two different estimators for the KL terms , we perform extensive comparison with succesful methods on a number of data sets . Our results show that TCWAEs achieve competitive disentanglement performances while improving modelling performance by allowing flexibility in the choice of reconstruction cost . 2 IMPORTANCE OF TOTAL CORRELATION IN DISENTANGLEMENT . 2.1 TOTAL CORRELATION . The TC of a random vector Z ∈ Z under P is defined by TC ( Z ) , dZ∑ d=1 Hpd ( Zd ) −Hp ( Z ) ( 1 ) where pd ( zd ) is the marginal density over only zd and Hp ( Z ) , −Ep log p ( Z ) is the Shannon differential entropy , which encodes the information contained in Z under P . Since dZ∑ d=1 Hpd ( Zd ) ≤ Hp ( Z ) ( 2 ) with equality when the marginals Zd are mutually independent , the TC can be interpreted as the loss of information when assuming mutual independence of the Zd ; namely , it measures the mutual dependence of the marginals . Thus , in the context of disentanglement learning , we seek a low TC of the aggregated posterior , p ( z ) = ∫ X p ( z|x ) p ( x ) dx , which forces the model to encode the data into statistically independent latent codes . High MI between the data and the latent is then obtained when the posterior , p ( z|x ) , manages to capture relevant information from the data . 2.2 TOTAL CORRELATION IN ELBO . We consider latent generative models pθ ( x ) = ∫ Z pθ ( x|z ) p ( z ) dz with prior p ( z ) and decoder network , pθ ( x|z ) , parametrized by θ. VAEs approximate the intractable posterior p ( z|x ) by introducing an encoding distribution ( the encoder ) , qφ ( z|x ) , and learning simultaneously θ and φwhen optimizing the variational lower bound , or ELBO , defined in Eq . 3 : LELBO ( θ , φ ) , E pdata ( X ) [ E qφ ( Z|X ) [ log pθ ( X|Z ) ] −KL ( qφ ( Z|X ) ‖ p ( Z ) ) ] ≤ E pdata ( X ) log pθ ( X ) ( 3 ) Following Hoffman & Johnson ( 2016 ) , we can decompose the KL term in Eq . 3 as : 1 Nbatch N∑ n=1 KL ( qφ ( Z|xn ) ‖ p ( Z ) ) = KL ( q ( Z , N ) ‖ q ( Z ) p ( N ) ) ︸ ︷︷ ︸ i index-code MI + KL ( q ( Z ) ‖ p ( Z ) ) ︸ ︷︷ ︸ ii marginal KL ( 4 ) where p ( n ) = 1N , q ( z|n ) = q ( z|xn ) , q ( z , n ) = q ( z|n ) p ( n ) and q ( z ) = ∑N n=1 q ( z|n ) p ( n ) . i refers to the index-code mutual information and represents the MI between the data and the latent under the join distribution q ( z , n ) , and ii to the marginal KL matching the aggregated posterior to the prior . While discussion on the impact of a high index-code MI on disentanglement learning is still open , the marginal KL term plays an important role in disentanglement . Indeed , it pushes the encoder network to match the prior when averaged , as opposed to matching the prior for each data point . Combined with a factorized prior p ( z ) = ∏ d pd ( zd ) , as it is often the case , the aggregated posterior is forced to factorize and align with the axis of the prior . More specifically , the marginal KL term in Eq . 4 can be decomposed the as sum of a TC term and a dimensionwise-KL term : KL ( q ( Z ) ‖ p ( Z ) ) = TC ( q ( Z ) ) + dZ∑ d=1 KL ( qd ( Zd ) ‖ pd ( Zd ) ) ( 5 ) Thus maximizing the ELBO implicitly minimizes the TC of the aggregated posterior , enforcing the aggregated posterior to disentangle as Higgins et al . ( 2017 ) and Burgess et al . ( 2018 ) observed when strongly penalizing the KL term in Eq . 3 . Chen et al . ( 2018 ) leverage the KL decomposition in Eq . 5 by refining the heavy latent penalization to the TC only . However , the index-code MI term in Eq . 4 seems to have little to no role in disentanglement ( see ablation study of Chen et al . ( 2018 ) ) , potentially arming the reconstruction performances ( Hoffman & Johnson , 2016 ) . 3 WAE NATURALLY GOOD AT DISENTANGLING ? . In this section we introduce the OT problem and the WAE objective , and discuss the compelling properties of WAEs for representation learning . Mirroring β-TCVAE decomposition , we derive the TCWAE objective . 3.1 WAE . The Kantorovich formulation of the OT between the true-but-unknown data distribution PD and the model distribution Pθ , for a given cost function c , is defined by : OTc ( PD , Pθ ) = inf Γ∈P ( PD , Pθ ) ∫ X×X c ( x , x̃ ) γ ( x , x̃ ) dxdx̃ ( 6 ) where P ( PD , Pθ ) is the space of all couplings of PD and Pθ ; namely , the space of joint distributions Γ on X × X whose densities γ have marginals pD and pθ . Tolstikhin et al . ( 2018 ) derive the WAE objective by restraining this space and relaxing the hard constraint on the marginal using a soft constraint with a Lagrange multiplier ( see Appendix A for more details ) : WD , c ( θ , φ ) , E pD ( x ) E qφ ( z|x ) E pθ ( x̃|z ) c ( x , x̃ ) + λD ( q ( Z ) ‖ p ( Z ) ) ( 7 ) where D is any divergence function and λ a relaxation parameter . The decoder , pθ ( x̃|z ) , and the encoder , qφ ( z|x ) , are optimized simultaneously by dropping the closed-form minimization over the encoder network , with standard stochastic gradient descent methods . Similarly to the ELBO , objective 7 consists of a reconstruction cost term and a latent regularization term , preventing the latent codes to drift away from the prior . However , WAE explicitly penalizes the aggregate posterior . This motivates , following Section 2.2 , the use of WAE in disentanglement learning . Rubenstein et al . ( 2018 ) have shown promising disentanglement performances without modifying the objective 7 . Another important difference lies in the functional form of the reconstruction cost in the reconstruction term . Indeed , WAE allows for more flexibility in the reconstruction term with any cost function allowed , and in particular , it allows for cost functions better suited to the data at hand and for the use of deterministic decoder networks ( Tolstikhin et al. , 2018 ; Frogner et al. , 2015 ) . This can potentially result in an improved reconstruction-disentanglement trade off as we empirically find in Sections 4.2 and 4.1 .
This paper extends the Wasserstein Autoencoder (WAE) work by splitting the divergence on the variational marginal into 2 terms, akin to what was done in TC-VAE. This enables directly controlling the explicit contribution of the total correlation term, which is likely to contribute to disentanglement more directly. They explore 2 variations of their model, based on different estimators of the TC term (TCWAE-MWS, using minibatch-weighted sampling; TCWAE-GAN, using a density ratio trick).
SP:8b35f7c054e1ac74e0ad260add9723766df8613d
Improving Post Training Neural Quantization: Layer-wise Calibration and Integer Programming
1 INTRODUCTION . The pursuit of advanced Deep Neural Networks ( DNNs ) causes researchers to construct deeper and wider networks , making them expensive to use in terms of power and time . This increases the need for efficient implementations of these networks . Efficient networks reduce cloud-vendor costs and make it possible to run them on low-power devices such as smartphones and wearable devices . The most common off-the-shelf approach to improving network efficiency is quantization , which reduces the numerical precision of the network and its complexity and memory footprint . DNN quantization techniques can be classified as either post-training or quantization-aware training ( QAT ) techniques ( Han et al. , 2015 ; Courbariaux et al. , 2015 ; Hubara et al. , 2017 ; Zhou et al. , 2016 ) . Although QAT techniques , in general , achieve better results , there are important real-world scenarios in which they are not applicable . These are the cases where the training data is sensitive or simply unavailable at the time of deployment . For instance , when off-the-shelf or legacy models are being used , or when medical records are involved . Therefore , much attention has recently been dedicated to post-training quantization methods ( Nagel et al. , 2019 ; Banner et al. , 2018 ; Zhao et al. , 2019 ) , which can be more easily applied in practice . These methods allow for network quantization to happen seamlessly when deployed , without requiring additional information from the user except a small unlabeled calibration set . Unfortunately , post-training quantization below 8-bit always incurs significant accuracy degradation and in some cases even higher numerical precision is required . In this paper , our goal is to break this barrier by distilling all the information the pre-trained model and calibration set encode . Our goal is to find an optimal scheme for current state of the art hardware which usually support 16,8,4 bits data types with per-channel quantization of the weights . To that end , we suggest a three-stage pipeline that consists of methods applied solely on a small calibration set to reduce the local error introduced during the quantization process ( e.g. , round-off errors ) followed by integer programming to determine the bit-width of different layers so that the overall accuracy degradation is minimized . Even without using mixed-precision , the suggested method is much less prone to over-fitting than current methods and yields best in class results for 8-bits Mobilenet-V2 and BERT-base trained on ImageNet and SQuAD1.1 datasets , respectively . Our paper suggests several contributions for mixed-precision post-training quantization : 1 . AdaQuant : A layer-by-layer optimization method that minimizes the error between the quantized layer output and the full-precision layer output . This method can consume only a small calibration dataset from training data without overfitting . In a comprehensive study , we show that AdaQuant defines a new state-of-the-art for post-training quantization on several networks and tasks , including vision models ( Resnet18 , Resnet50 , MobilenetV2 ) and language ( BERT ) . 2 . Integer programming : As some parts of the network may allow lower precision compared to other layers , we suggest an integer-linear programming based approach for determining the precision level of different layers . This method aims at maximizing either the expected speedup or savings in power consumption without violating a predefined constraint on network accuracy degradation or compression . 3 . Batch-norm tuning : Following quantization we observe an inherent bias in the mean and the variance of batch norm statistics . We show that by employing the re-estimated statistics in batch normalization , much of the quantized network degradation can be recovered . 4 . Light and Advanced pipelines : We analyze the advantages and disadvantages of each of the given methods and suggest two pipelines : ( 1 ) light pipeline that does not require a backward pass , thus can be invoked even on inference-only hardware ; and ( 2 ) Advanced pipeline that includes also AdaQuant and bias tuning . 2 RELATED WORK . There has been a significant effort to accelerate inference via quantization ( Courbariaux et al. , 2015 ; Han et al. , 2015 ; Rastegari et al. , 2016 ; Zhou et al. , 2017 ) . These works involve re-training in order to compensate for the degradation due to the quantization process . Post-training quantization , on the other hand is applied to a model after it was trained . Thus , it avoids re-training and as such it is much simpler to use . However , naively quantizing a full-precision model to INT4 or lower to accelerate computation usually incurs significant accuracy degradation ( Krishnamoorthi , 2018 ; Jacob et al. , 2018 ) . AdaQuant : A recent post-training quantization method ( Nagel et al. , 2020 ) , termed AdaRound , suggested optimizing the rounding policy . Instead of using the predominant rounding-to-nearest approach , they suggest formulating a per-layer quadratic optimization problem to optimize the roundoff error . Our proposed method , AdaQuant , takes another step and relaxes AdaRound ’ s implicit constraint which forces the quantized weights to be within ±1 of their round-to-nearest value . This is done by optimizing the weights and quantization parameters of each layer separately , over the calibration set , to minimize the MSE between the layer ’ s original and quantized outputs . As oppose to AdaRound we apply AdaQuant to find optimal quantization not only to weights but also to activations . In addtion we suggest two flavors for AdaQuant : ( 1 ) parallel-AdaQuant suited for mixed precision setting ; ( b ) sequential-adaquant which suited for fixed configuration . Integer programming : Early work by Lin et al . ( 2016 ) used a convex optimization formulation which results in a simple greedy compression scheme . Aflalo et al . ( 2020 ) used a combinatorial optimization approach for network pruning . Their problem was formulated as a Knapsack problem that optimizes the trade-off between the channels importance and their associated computational cost . Cai et al . ( 2020 ) finds a mixed-precision configuration with a guaranteed Pareto efficient allocation with respect to model size and accuracy degradation . While this provides a ” best-effort ” standard ( e.g. , the configuration can not be further compressed without hurting accuracy ) , it does not suggest which of all possible outcomes is best . To the best of our knowledge , this work is the first to formalize a generic integer program , which can easily be adapted to various types of models and requirements with a clear objective and constraints . Batch norm tuning : Finkelstein et al . ( 2019 ) were the first to recognize that a significant source of degradation is a shift in the mean activation value . They show a simple method to compensate for this bias by updating the bias terms . Nagel et al . ( 2019 ) suggest to equalize the weight ranges in the network and correct biases in the error that are introduced during quantization .Recently Sun et al . ( 2019 ) suggested batch norm tuning for FP8 models . Here we detail how to perform this procedure on a per-channel quantized ( PCQ ) model with fused batch-norm layers . The procedure is light as it only requires to invoke the quantized model few times ( on the calibration set ) and adjust the quantization parameters.Moreover after retuning the BN layers can be reabsorbed which reduces the inference complexity . To the best of our knowledge we are the first to suggest it . 3 OPTIMIZING THE QUANTIZATION PIPELINE . In most post-training quantization settings , a model and a small unlabeled calibration set are given . To avoid overfitting the calibration set , most studies utilize it only to extract the network ’ s internal statistics , which is later used to set the quantization parameters . Here we suggest using the calibration set much more extensively to tune the model while avoiding over-fitting the data . In the following subsections , we detail three different optimization methods over the calibration set : ( 1 ) AdaQuant , a layerwise optimization of weights and quantization parameters ; ( 2 ) an integer programming formulation for a mixed-precision setting ; and ( 3 ) Batch Normalization Tuning ( BNT ) , for tuning the model ’ s internal statistics to match the numerical precision setting . We discuss the strengths and weaknesses of each method and suggest an optimization flow that exploits all the additive merits and leads to state-of-the-art results . 3.1 ADAQUANT - LAYERWISE OPTIMIZATION OVER THE CALIBRATION SET . Several researchers suggested per-tensor optimization to reduce quantization error by minimizing some form of MSE objective between the quantized and the full-precision tensor X ( either weights or activations ) . They look for an optimized quantization step size ∆̂ obtained by ∆̂ = arg min ∆ ||X −Q∆ ( X ) ||2 ; Q∆ ( X ) = ∆ · ⌊ X ∆ ⌉ , ( 1 ) where Q ( · ) is the quantization function . Although these methods are fast and easy to use , they often result in an inferior solution — the loss in eq . 1 is sub-optimal , as it penalizes all the quantization errors equally . However , the loss should penalize more quantization errors which affect the classification . Accordingly , researchers suggested Quantization-Aware-Training ( QAT ) methods to fix this error by training the entire model at once . However , those methods have three limitations : ( a ) they require the large training set to avoid over-fitting , ( b ) they approximate the back-propagation gradients through discrete function ( the quantizer ) and ( c ) they have high computational and memory footprints . We suggest a modified objective for per-layer joint optimization of the weights and quantization parameters . ( ∆̂w , ∆̂x , V̂ ) = arg min ∆w , ∆x , V ||WX −Q∆w ( W + V ) ·Q∆x ( X ) ||2 , ( 2 ) where V is a continuous variable added to W and the quantized network weights are defined as Wq = Q∆̂w ( W + V̂ ) . In this new objective the quantized tensor is not required to be ” close ” to the original tensor , as in eq . 1 , thus benefiting from the flexibility that Quantization-Aware-Training methods have . Yet , it can be executed in parallel over all layers and is much less prone to over-fitting . Moreover , under a fixed configuration we can optimize the model globally and infer the error between layers . Thus , instead of running AdaQuant on all layers in parallel we can run it sequentially and fix the error induced by quantaizing former layers . Thus , Eq . 2 changes to : ( ∆̂wl , ∆̂xl , V̂l ) = arg min ∆wl , ∆xl , Vl ||WlXl −Q∆wl ( Wl + Vl ) ·Q∆xl ( X q l ) || 2 , ( 3 ) Xq = σ ( Q∆wl−1 ( Wl−1 + Vl−1 ) ·Q∆xl ( X q l−1 ) ) ( 4 ) where σ ( · ) is some activation function . Note , that sequential AdaQuant should not be applied before the bit allocation was set as it optimize over noisy input obtain from predecessor quantized layers . We evaluate both flavors of adaquant ( named , AdQuant and sequential-AdaQuant and detail our finding in section 5.1 . We note that AdaQuant also optimizes over biases and offsets and optimized fused conv-bn-relu layers when present ; these were removed from the formulation in Equation 2 for simplicity . Size of calibration set Perhaps surprisingly , although we experiment with a very small calibration set , no over-fitting is observed . Let us examine a simple fully connected layer W ∈ RM×N . The input and output are of sizes N and M , respectively . For each output we have B equations and N separate parameters ( i.e. , with no overlap in parameters between different outputs ) . Therefore if B N we generically have an infinite amount of solutions and we can overfit the data . If B N then we might underfit the data . Thus , the size of the calibration set required for AdaQuant should roughly be O ( N ) . A similar derivation for convolution layers reveals that the calibration size should have B ≥ Ci·k 2 HW samples to avoid over-fitting , where B is the number of unique samples , k is the convolution ’ s kernel size , Ci and Co is the number of input and output channels respectively and H , W represent height and width . In fig . 1 we compare AdaQuant to current state-ofthe-art methods including QAT with knowledge distillation ( QAT-KLD ) ( Kim et al. , 2019 ) and AdaRound ( Nagel et al. , 2020 ) . For each method , we measured the top-1 accuracy with respect to the number of samples in the calibration set over five runs and present the mean and standard deviation . As can be seen , AdaQuant is superior to previous methods and specifically excels on small calibration sets . Remarkably , AdaQuant does not overfit even when optimized on a single image . Additional details can be found in section A and D of the Appendix .
The paper studies the problem of Post-Training Quantization of NNs, where no fine-tuning is performed to quantize the model. In particular, the authors focus on sub-8 bit quantization and propose a novel integer linear programming formulation to find the optimal bit width for a given model size. Additional approaches are proposed to minimize accuracy degradation after quantization. These include
SP:d9a70ada6ed2324c5b430e0a7a6785b1eb49d3ef
Improving Post Training Neural Quantization: Layer-wise Calibration and Integer Programming
1 INTRODUCTION . The pursuit of advanced Deep Neural Networks ( DNNs ) causes researchers to construct deeper and wider networks , making them expensive to use in terms of power and time . This increases the need for efficient implementations of these networks . Efficient networks reduce cloud-vendor costs and make it possible to run them on low-power devices such as smartphones and wearable devices . The most common off-the-shelf approach to improving network efficiency is quantization , which reduces the numerical precision of the network and its complexity and memory footprint . DNN quantization techniques can be classified as either post-training or quantization-aware training ( QAT ) techniques ( Han et al. , 2015 ; Courbariaux et al. , 2015 ; Hubara et al. , 2017 ; Zhou et al. , 2016 ) . Although QAT techniques , in general , achieve better results , there are important real-world scenarios in which they are not applicable . These are the cases where the training data is sensitive or simply unavailable at the time of deployment . For instance , when off-the-shelf or legacy models are being used , or when medical records are involved . Therefore , much attention has recently been dedicated to post-training quantization methods ( Nagel et al. , 2019 ; Banner et al. , 2018 ; Zhao et al. , 2019 ) , which can be more easily applied in practice . These methods allow for network quantization to happen seamlessly when deployed , without requiring additional information from the user except a small unlabeled calibration set . Unfortunately , post-training quantization below 8-bit always incurs significant accuracy degradation and in some cases even higher numerical precision is required . In this paper , our goal is to break this barrier by distilling all the information the pre-trained model and calibration set encode . Our goal is to find an optimal scheme for current state of the art hardware which usually support 16,8,4 bits data types with per-channel quantization of the weights . To that end , we suggest a three-stage pipeline that consists of methods applied solely on a small calibration set to reduce the local error introduced during the quantization process ( e.g. , round-off errors ) followed by integer programming to determine the bit-width of different layers so that the overall accuracy degradation is minimized . Even without using mixed-precision , the suggested method is much less prone to over-fitting than current methods and yields best in class results for 8-bits Mobilenet-V2 and BERT-base trained on ImageNet and SQuAD1.1 datasets , respectively . Our paper suggests several contributions for mixed-precision post-training quantization : 1 . AdaQuant : A layer-by-layer optimization method that minimizes the error between the quantized layer output and the full-precision layer output . This method can consume only a small calibration dataset from training data without overfitting . In a comprehensive study , we show that AdaQuant defines a new state-of-the-art for post-training quantization on several networks and tasks , including vision models ( Resnet18 , Resnet50 , MobilenetV2 ) and language ( BERT ) . 2 . Integer programming : As some parts of the network may allow lower precision compared to other layers , we suggest an integer-linear programming based approach for determining the precision level of different layers . This method aims at maximizing either the expected speedup or savings in power consumption without violating a predefined constraint on network accuracy degradation or compression . 3 . Batch-norm tuning : Following quantization we observe an inherent bias in the mean and the variance of batch norm statistics . We show that by employing the re-estimated statistics in batch normalization , much of the quantized network degradation can be recovered . 4 . Light and Advanced pipelines : We analyze the advantages and disadvantages of each of the given methods and suggest two pipelines : ( 1 ) light pipeline that does not require a backward pass , thus can be invoked even on inference-only hardware ; and ( 2 ) Advanced pipeline that includes also AdaQuant and bias tuning . 2 RELATED WORK . There has been a significant effort to accelerate inference via quantization ( Courbariaux et al. , 2015 ; Han et al. , 2015 ; Rastegari et al. , 2016 ; Zhou et al. , 2017 ) . These works involve re-training in order to compensate for the degradation due to the quantization process . Post-training quantization , on the other hand is applied to a model after it was trained . Thus , it avoids re-training and as such it is much simpler to use . However , naively quantizing a full-precision model to INT4 or lower to accelerate computation usually incurs significant accuracy degradation ( Krishnamoorthi , 2018 ; Jacob et al. , 2018 ) . AdaQuant : A recent post-training quantization method ( Nagel et al. , 2020 ) , termed AdaRound , suggested optimizing the rounding policy . Instead of using the predominant rounding-to-nearest approach , they suggest formulating a per-layer quadratic optimization problem to optimize the roundoff error . Our proposed method , AdaQuant , takes another step and relaxes AdaRound ’ s implicit constraint which forces the quantized weights to be within ±1 of their round-to-nearest value . This is done by optimizing the weights and quantization parameters of each layer separately , over the calibration set , to minimize the MSE between the layer ’ s original and quantized outputs . As oppose to AdaRound we apply AdaQuant to find optimal quantization not only to weights but also to activations . In addtion we suggest two flavors for AdaQuant : ( 1 ) parallel-AdaQuant suited for mixed precision setting ; ( b ) sequential-adaquant which suited for fixed configuration . Integer programming : Early work by Lin et al . ( 2016 ) used a convex optimization formulation which results in a simple greedy compression scheme . Aflalo et al . ( 2020 ) used a combinatorial optimization approach for network pruning . Their problem was formulated as a Knapsack problem that optimizes the trade-off between the channels importance and their associated computational cost . Cai et al . ( 2020 ) finds a mixed-precision configuration with a guaranteed Pareto efficient allocation with respect to model size and accuracy degradation . While this provides a ” best-effort ” standard ( e.g. , the configuration can not be further compressed without hurting accuracy ) , it does not suggest which of all possible outcomes is best . To the best of our knowledge , this work is the first to formalize a generic integer program , which can easily be adapted to various types of models and requirements with a clear objective and constraints . Batch norm tuning : Finkelstein et al . ( 2019 ) were the first to recognize that a significant source of degradation is a shift in the mean activation value . They show a simple method to compensate for this bias by updating the bias terms . Nagel et al . ( 2019 ) suggest to equalize the weight ranges in the network and correct biases in the error that are introduced during quantization .Recently Sun et al . ( 2019 ) suggested batch norm tuning for FP8 models . Here we detail how to perform this procedure on a per-channel quantized ( PCQ ) model with fused batch-norm layers . The procedure is light as it only requires to invoke the quantized model few times ( on the calibration set ) and adjust the quantization parameters.Moreover after retuning the BN layers can be reabsorbed which reduces the inference complexity . To the best of our knowledge we are the first to suggest it . 3 OPTIMIZING THE QUANTIZATION PIPELINE . In most post-training quantization settings , a model and a small unlabeled calibration set are given . To avoid overfitting the calibration set , most studies utilize it only to extract the network ’ s internal statistics , which is later used to set the quantization parameters . Here we suggest using the calibration set much more extensively to tune the model while avoiding over-fitting the data . In the following subsections , we detail three different optimization methods over the calibration set : ( 1 ) AdaQuant , a layerwise optimization of weights and quantization parameters ; ( 2 ) an integer programming formulation for a mixed-precision setting ; and ( 3 ) Batch Normalization Tuning ( BNT ) , for tuning the model ’ s internal statistics to match the numerical precision setting . We discuss the strengths and weaknesses of each method and suggest an optimization flow that exploits all the additive merits and leads to state-of-the-art results . 3.1 ADAQUANT - LAYERWISE OPTIMIZATION OVER THE CALIBRATION SET . Several researchers suggested per-tensor optimization to reduce quantization error by minimizing some form of MSE objective between the quantized and the full-precision tensor X ( either weights or activations ) . They look for an optimized quantization step size ∆̂ obtained by ∆̂ = arg min ∆ ||X −Q∆ ( X ) ||2 ; Q∆ ( X ) = ∆ · ⌊ X ∆ ⌉ , ( 1 ) where Q ( · ) is the quantization function . Although these methods are fast and easy to use , they often result in an inferior solution — the loss in eq . 1 is sub-optimal , as it penalizes all the quantization errors equally . However , the loss should penalize more quantization errors which affect the classification . Accordingly , researchers suggested Quantization-Aware-Training ( QAT ) methods to fix this error by training the entire model at once . However , those methods have three limitations : ( a ) they require the large training set to avoid over-fitting , ( b ) they approximate the back-propagation gradients through discrete function ( the quantizer ) and ( c ) they have high computational and memory footprints . We suggest a modified objective for per-layer joint optimization of the weights and quantization parameters . ( ∆̂w , ∆̂x , V̂ ) = arg min ∆w , ∆x , V ||WX −Q∆w ( W + V ) ·Q∆x ( X ) ||2 , ( 2 ) where V is a continuous variable added to W and the quantized network weights are defined as Wq = Q∆̂w ( W + V̂ ) . In this new objective the quantized tensor is not required to be ” close ” to the original tensor , as in eq . 1 , thus benefiting from the flexibility that Quantization-Aware-Training methods have . Yet , it can be executed in parallel over all layers and is much less prone to over-fitting . Moreover , under a fixed configuration we can optimize the model globally and infer the error between layers . Thus , instead of running AdaQuant on all layers in parallel we can run it sequentially and fix the error induced by quantaizing former layers . Thus , Eq . 2 changes to : ( ∆̂wl , ∆̂xl , V̂l ) = arg min ∆wl , ∆xl , Vl ||WlXl −Q∆wl ( Wl + Vl ) ·Q∆xl ( X q l ) || 2 , ( 3 ) Xq = σ ( Q∆wl−1 ( Wl−1 + Vl−1 ) ·Q∆xl ( X q l−1 ) ) ( 4 ) where σ ( · ) is some activation function . Note , that sequential AdaQuant should not be applied before the bit allocation was set as it optimize over noisy input obtain from predecessor quantized layers . We evaluate both flavors of adaquant ( named , AdQuant and sequential-AdaQuant and detail our finding in section 5.1 . We note that AdaQuant also optimizes over biases and offsets and optimized fused conv-bn-relu layers when present ; these were removed from the formulation in Equation 2 for simplicity . Size of calibration set Perhaps surprisingly , although we experiment with a very small calibration set , no over-fitting is observed . Let us examine a simple fully connected layer W ∈ RM×N . The input and output are of sizes N and M , respectively . For each output we have B equations and N separate parameters ( i.e. , with no overlap in parameters between different outputs ) . Therefore if B N we generically have an infinite amount of solutions and we can overfit the data . If B N then we might underfit the data . Thus , the size of the calibration set required for AdaQuant should roughly be O ( N ) . A similar derivation for convolution layers reveals that the calibration size should have B ≥ Ci·k 2 HW samples to avoid over-fitting , where B is the number of unique samples , k is the convolution ’ s kernel size , Ci and Co is the number of input and output channels respectively and H , W represent height and width . In fig . 1 we compare AdaQuant to current state-ofthe-art methods including QAT with knowledge distillation ( QAT-KLD ) ( Kim et al. , 2019 ) and AdaRound ( Nagel et al. , 2020 ) . For each method , we measured the top-1 accuracy with respect to the number of samples in the calibration set over five runs and present the mean and standard deviation . As can be seen , AdaQuant is superior to previous methods and specifically excels on small calibration sets . Remarkably , AdaQuant does not overfit even when optimized on a single image . Additional details can be found in section A and D of the Appendix .
This paper proposed a set of methods for post-training quantization of dnns. The methods include AdaQuant (which jointly optimizes quantization steps for weight and activation per output activation of each layer), Integer Programming (which determines bit-precision for all the layers), and the batchnorm tuning. The authors presented promising experimental results on various neural networks to support the proposed methods.
SP:d9a70ada6ed2324c5b430e0a7a6785b1eb49d3ef
PGPS : Coupling Policy Gradient with Population-based Search
1 INTRODUCTION In Reinforcement Learning ( RL ) , an agent interacts with the environment , and its goal is to find the policy that maximizes the objective function , which is generally defined as a cumulative discounted reward . Recently , many researchers have worked on combining deep neural networks and a gradient-based RL algorithm , generally known as Deep Reinforcement Learning ( DRL ) . This approach has achieved great success not only in the discrete action domain , such as in Go ( Silver et al. , 2017 ) and Atari games ( Mnih et al. , 2015 ; 2016 ) , but also in the continuous action domain , such as in Robot control ( Fujimoto et al. , 2018 ; Lillicrap et al. , 2015 ; Schulman et al. , 2015 ) . However , it is difficult to use the gradient-based method for the objective function ( J ) , which includes “ many wide flat regions ” since the gradient ( ∇θJ ) is near zero at a flat point . Figure 1 is an extreme case consisting of only flat regions , which is called a piece-wise constant function . This problem remains an unsolved issue in gradient-based DRL with continuous control domains ( Colas et al. , 2018 ) . The Swimmer in a MuJoCo environment ( Todorov et al. , 2012 ) has already been reported to be hard to use the gradient-based method ( Jung et al. , 2020 ; Liu et al. , 2019 ) . Our experiment shows that the objective function of Swimmer includes wide flat regions ( Appendix A ) . The population-based Evolutionary Approach ( EA ) , which is an alternative to the gradient-based method , has also shown successful results in various control tasks ( Conti et al. , 2018 ; Liu et al. , 2019 ; Salimans et al. , 2017 ; Such et al. , 2017 ) . As a population-based search , the EA generates a population of agents to explore policy , and the population is regenerated with improvement in each generation . The EA is also known as a direct policy search ( Schmidhuber & Zhao , 1998 ) because it directly searches by perturbing the parameter of policy . In Figure 1 , the Cross-Entropy Method ( CEM ) as a kind of population-based search is simply described , where the current population sampled from the target distribution is evaluated . Then the distribution is updated to the direction for generating a more promising population . Not depending on the gradient , these approaches are robust to flat or deceptive gradients ( Staines & Barber , 2013 ; Liu et al. , 2019 ) . However , the EA is sample inefficient because it requires a Monte-Carlo evaluation , and the previous results and data generally can not be reused . The off-policy Policy Gradient ( PG ) algorithm uses the data from arbitrary policies to train its actor and critic functions . It generates exciting potential by combining the EA and PG , where the data which is discarded in a standard EA is directly used to train the PG ’ s functions . Khadka & Tumer ( 2018 ) and Pourchot & Sigaud ( 2018 ) introduced a framework combining the EA and off-policy PG . However , the framework of ( Khadka & Tumer , 2018 ) is less efficient to train the policy for general tasks than the PG algorithm alone , and the framework of ( Pourchot & Sigaud , 2018 ) is unsuitable to train the policy for a task providing a deceptive gradient . In this paper , we propose another hybrid algorithm , called Policy Gradient with Population-based Search ( PGPS ) in which the CEM and Twin Delayed Deep Deterministic Policy Gradient ( TD3 ) ( Fujimoto et al. , 2018 ) are combined . It is as robust to a deceptive gradient as the CEM and more efficient to train the policy for general tasks than TD3 . To be robust to a deceptive gradient , the proposed algorithm is constructed in a way similar to the one in ( Khadka & Tumer , 2018 ) , where the TD3 is trained using data from the CEM and periodically participates in the CEM population as an individual ( PG guides EA ) . However , in this basic framework , the TD3 sometimes falls into the inferior solution and inefficiently searches . To get the TD3 out of the inferior solution , we let the EA guide the TD3 by guided policy learning ( Jung et al. , 2020 ) ( EA guides PG ) . Furthermore , the TD3 critic contributes to generating a more promising population by filtering the set of actors sampled from CEM ( Q-critic filtering ) . Lastly , to control the trade-off between the frequency of search and stable estimation , we used evaluation step scheduling in the process of population evaluation ( Increasing evaluation steps ) . It carries out frequent searches when searching far from the optimal , whereas it carries out stable estimation when searching close to the optimal . These approaches bring out more synergies between the CEM and the TD3 while maintaining both the population-based search and the gradient-based search . Consequently , the proposed algorithm is not only robust to a deceptive gradient , but also produces outstanding performances with a low additional computational cost . 2 RELATED WORKS . Recently , beyond the view of an alternative approach , few attempts have been proposed in the form of A supporting B . An attempt is to use EA to fill a replay buffer with diverse samples . In Colas et al . ( 2018 ) , a Goal Exploration Process ( GEP ) , a kind of EA , is firstly applied to search the policy and to fill a replay buffer with the diverse samples , and then the off-policy PG algorithm is sequentially used for fine tuning the parameters of the policy . Another attempt is to combine a population-based approach and PG for efficiently searching a good policy or the good hyper-parameters of an algorithm in parallel multi-learners setting . These applications generally consist of periodically evaluating the population , followed by distributing good knowledge to the other learners . To find the best architecture and hyper-parameters , Jaderberg et al . ( 2017 ) proposed a Population-Based Training ( PBT ) method in which the current best knowledge is periodically transferred to PG learners . Gangwani & Peng ( 2017 ) developed the distilled crossover using imitation learning and mutation based on the PG . Proposed operators transfer the information on current good policies into the next population without destructive change to the neural network . Jung et al . ( 2020 ) introduced a soft-manner guided policy learning to fuse the knowledge of the best policy with other identical multiple learners while maintaining a more extensive search area for the exploration . The idea of combining the population-based EA and off-policy PG was recently introduced by Khadka & Tumer ( 2018 ) . Their approach was called Evolutionary-Guided Reinforcement Learning ( ERL ) in which the Genetic Algorithm ( GA ) and the Deep Deterministic Policy Gradient ( DDPG ) ( Lillicrap et al. , 2015 ) are combined . In ERL frameworks , the GA transfers the experience from evaluation into the DDPG through a replay buffer , and the DDPG transfers the knowledge learned from the policy gradient into the GA by periodically injecting a PG actor into the GA population . Khadka et al . ( 2019 ) expanded the PG algorithm of ERL from a single DDPG learner to multiple TD3 learners with a resource manager . Bodnar et al . ( 2019 ) revised the GA ’ s crossover and mutation to the distilled crossover and proximal mutation inspired by ( Gangwani & Peng , 2017 ) and ( Lehman et al. , 2018 ) to prevent the destruction of neural networks . Pourchot & Sigaud ( 2018 ) introduced another framework , which combines the CEM and the TD3 . In this framework , the TD3 algorithm has only a critic function trained using the experience from the CEM . In order to propagate the knowledge learned by policy gradient to the CEM , half of the population is updated to the direction indicated by the TD3 critic for a fixed number of steps , followed by the evaluation . The policy gradient for half of the population not only enhances the gradient-based learning , but also deteriorate the CEM ’ s robustness over a deceptive gradient . In this paper , we introduce another hybrid algorithm , in which the CEM and the TD3 are combined as in CEMRL ( Pourchot & Sigaud , 2018 ) . However , the TD3 has both actor and critic , which are trained by a gradient from experiences generated by CEM . And then , the TD3 actor periodically participates in CEM population as in ERL ( Khadka & Tumer , 2018 ) . This structure is an effective way to maintain a direct policy search of CEM . To enhance the performance , we introduced new interactions processes between the CEM and TD3 instead of carrying out a policy gradient for numerous individual actors . 3 BACKGROUNDS . Twin Delayed Deep Deterministic Policy Gradient ( TD3 ) RL framework has an agent interacting with an environment generally defined by a Markov Decision Process ( MDP ) . At each timestep t , an agent receives the state st , and takes an action at according to the policy π , and then receives a reward rt and the next state st+1 at next time step t + 1 . The goal of RL is to find the policy that maximizes the discounted cumulative return Rt = ∑∞ k=t γ k−trk where γ is a discounted factor . Off-policy RL can use the data from arbitrary policies to train its actor and critic functions repeatedly , which is a key point for improving recent gradient-based RL . Silver et al . ( 2014 ) introduced the off-policy Deterministic Policy Gradient ( DPG ) , which has an advantage for high-dimensional action spaces . The DDPG ( Lillicrap et al. , 2015 ) was extended from the DPG to apply it to a deep neural network . TD3 ( Fujimoto et al. , 2018 ) is an advanced version of the DDPG , which suffers from the overestimation bias of the critic . To correct this bias , two critics are introduced , and then the critic with the lowest state-action value is taken during the critic update as in the Double Deep Q-Network ( DDQN ) ( Van Hasselt et al. , 2016 ) . Figure 2 ( a ) represents the architecture of the TD3 . Cross Entropy Method ( CEM ) The Evolutionary Approach ( EA ) is a heuristic search method inspired by nature , where the current population is evaluated , and the next population is regenerated using the current evaluation result in order to produce a higher Return , which is also known as Fitness and defined as a cumulative sum of immediate reward for a fixed number of steps . The Estimation of Distribution Algorithm ( EDA ) is a class of the EA : It updates the target distribution to generate a better population . Depending on the update method for the distribution , EDAs are classified as a CEM ( De Boer et al. , 2005 ) , a Covariance Matrix Adaptation Evolutionary Strategy ( Hansen , 2016 ) , an Evolutionary Strategy ( Salimans et al. , 2017 ) , and a Natural Evolutionary Strategy ( Wierstra et al. , 2014 ) . We used the CEM as one part of our proposed algorithm . As shown in Figure 2 ( b ) , the CEM procedures are as follows : The population is sampled from the multivariate Gaussian N ( µ , Σ ) and evaluated , and for the top K , which is smaller than the population size ( N ) , high performing actors are used to update a new mean ( µ ) and covariance ( Σ ) of the target distribution . The weight can be given to each actor according to the rank of the Return ( Hansen , 2016 ) . The elite actor can be passed to the next population , which is known as elitism . The more detailed procedure is reported in ( De Boer et al. , 2005 ) . In this paper , we used a diagonal covariance to reduce the parameters . Population-guided Parallel Policy Search ( P3S ) The Guided Policy Learning ( GPL ) is commonly used when the elite policy leads some sub-policies to a better solution in multiple policies setting . Teh et al . ( 2017 ) introduced GPL for joint learning of numerous tasks in which a common policy encourages local policies to act better . Jung et al . ( 2020 ) proposed a soft-manner GPL , called the Population-guided Parallel Policy Search , for multiple identical learners with the same objective , where a population is evaluated periodically . Then sub-policies are trained to maximize their critic value and to concurrently minimize the distance from the elite policy for the next period . For this purpose , Augmented Loss ( 2 ) is used to train the sub-policies instead of Original Loss ( 1 ) . Original Loss : LO ( π ) = Es∼SS [ −Qπ ( s , π ( s ) ) ] ( 1 ) Augmented Loss : LA ( π , πelite , β ) = Es∼SS [ −Qπ ( s , π ( s ) ) + β||π ( s ) − πelite ( s ) ||22 ] ( 2 ) where π is a trained policy , Qπ is a critic function depending on π , πelite is the elite policy , SS is the set of states , and ||π ( s ) − πelite ( s ) ||22 is the Euclidean distance measure between the trained policy and the elite policy . β is a distance weight and is controlled adaptively . In this paper , we used a revised GPL inspired by P3S so that the CEM elite actor guides the TD3 to better space .
Recently, several researchers have been trying to combine the goodnesses of direct policy search approaches (mostly based on evolutionary computation approaches) and those of policy gradient approaches in control tasks. This paper proposes a novel combination of an evolutionary direct policy search and an actor-critic approach. The authors combines a cross-entropy method, which directly samples parameters of actor network (policy) from a Gaussian distribution that is trained during the search process, and the twin delayed deep deterministic policy gradient (TD3), which is an off-policy actor-critic approach.
SP:c4662d0c24d1744837443315de5f92042cada40b
PGPS : Coupling Policy Gradient with Population-based Search
1 INTRODUCTION In Reinforcement Learning ( RL ) , an agent interacts with the environment , and its goal is to find the policy that maximizes the objective function , which is generally defined as a cumulative discounted reward . Recently , many researchers have worked on combining deep neural networks and a gradient-based RL algorithm , generally known as Deep Reinforcement Learning ( DRL ) . This approach has achieved great success not only in the discrete action domain , such as in Go ( Silver et al. , 2017 ) and Atari games ( Mnih et al. , 2015 ; 2016 ) , but also in the continuous action domain , such as in Robot control ( Fujimoto et al. , 2018 ; Lillicrap et al. , 2015 ; Schulman et al. , 2015 ) . However , it is difficult to use the gradient-based method for the objective function ( J ) , which includes “ many wide flat regions ” since the gradient ( ∇θJ ) is near zero at a flat point . Figure 1 is an extreme case consisting of only flat regions , which is called a piece-wise constant function . This problem remains an unsolved issue in gradient-based DRL with continuous control domains ( Colas et al. , 2018 ) . The Swimmer in a MuJoCo environment ( Todorov et al. , 2012 ) has already been reported to be hard to use the gradient-based method ( Jung et al. , 2020 ; Liu et al. , 2019 ) . Our experiment shows that the objective function of Swimmer includes wide flat regions ( Appendix A ) . The population-based Evolutionary Approach ( EA ) , which is an alternative to the gradient-based method , has also shown successful results in various control tasks ( Conti et al. , 2018 ; Liu et al. , 2019 ; Salimans et al. , 2017 ; Such et al. , 2017 ) . As a population-based search , the EA generates a population of agents to explore policy , and the population is regenerated with improvement in each generation . The EA is also known as a direct policy search ( Schmidhuber & Zhao , 1998 ) because it directly searches by perturbing the parameter of policy . In Figure 1 , the Cross-Entropy Method ( CEM ) as a kind of population-based search is simply described , where the current population sampled from the target distribution is evaluated . Then the distribution is updated to the direction for generating a more promising population . Not depending on the gradient , these approaches are robust to flat or deceptive gradients ( Staines & Barber , 2013 ; Liu et al. , 2019 ) . However , the EA is sample inefficient because it requires a Monte-Carlo evaluation , and the previous results and data generally can not be reused . The off-policy Policy Gradient ( PG ) algorithm uses the data from arbitrary policies to train its actor and critic functions . It generates exciting potential by combining the EA and PG , where the data which is discarded in a standard EA is directly used to train the PG ’ s functions . Khadka & Tumer ( 2018 ) and Pourchot & Sigaud ( 2018 ) introduced a framework combining the EA and off-policy PG . However , the framework of ( Khadka & Tumer , 2018 ) is less efficient to train the policy for general tasks than the PG algorithm alone , and the framework of ( Pourchot & Sigaud , 2018 ) is unsuitable to train the policy for a task providing a deceptive gradient . In this paper , we propose another hybrid algorithm , called Policy Gradient with Population-based Search ( PGPS ) in which the CEM and Twin Delayed Deep Deterministic Policy Gradient ( TD3 ) ( Fujimoto et al. , 2018 ) are combined . It is as robust to a deceptive gradient as the CEM and more efficient to train the policy for general tasks than TD3 . To be robust to a deceptive gradient , the proposed algorithm is constructed in a way similar to the one in ( Khadka & Tumer , 2018 ) , where the TD3 is trained using data from the CEM and periodically participates in the CEM population as an individual ( PG guides EA ) . However , in this basic framework , the TD3 sometimes falls into the inferior solution and inefficiently searches . To get the TD3 out of the inferior solution , we let the EA guide the TD3 by guided policy learning ( Jung et al. , 2020 ) ( EA guides PG ) . Furthermore , the TD3 critic contributes to generating a more promising population by filtering the set of actors sampled from CEM ( Q-critic filtering ) . Lastly , to control the trade-off between the frequency of search and stable estimation , we used evaluation step scheduling in the process of population evaluation ( Increasing evaluation steps ) . It carries out frequent searches when searching far from the optimal , whereas it carries out stable estimation when searching close to the optimal . These approaches bring out more synergies between the CEM and the TD3 while maintaining both the population-based search and the gradient-based search . Consequently , the proposed algorithm is not only robust to a deceptive gradient , but also produces outstanding performances with a low additional computational cost . 2 RELATED WORKS . Recently , beyond the view of an alternative approach , few attempts have been proposed in the form of A supporting B . An attempt is to use EA to fill a replay buffer with diverse samples . In Colas et al . ( 2018 ) , a Goal Exploration Process ( GEP ) , a kind of EA , is firstly applied to search the policy and to fill a replay buffer with the diverse samples , and then the off-policy PG algorithm is sequentially used for fine tuning the parameters of the policy . Another attempt is to combine a population-based approach and PG for efficiently searching a good policy or the good hyper-parameters of an algorithm in parallel multi-learners setting . These applications generally consist of periodically evaluating the population , followed by distributing good knowledge to the other learners . To find the best architecture and hyper-parameters , Jaderberg et al . ( 2017 ) proposed a Population-Based Training ( PBT ) method in which the current best knowledge is periodically transferred to PG learners . Gangwani & Peng ( 2017 ) developed the distilled crossover using imitation learning and mutation based on the PG . Proposed operators transfer the information on current good policies into the next population without destructive change to the neural network . Jung et al . ( 2020 ) introduced a soft-manner guided policy learning to fuse the knowledge of the best policy with other identical multiple learners while maintaining a more extensive search area for the exploration . The idea of combining the population-based EA and off-policy PG was recently introduced by Khadka & Tumer ( 2018 ) . Their approach was called Evolutionary-Guided Reinforcement Learning ( ERL ) in which the Genetic Algorithm ( GA ) and the Deep Deterministic Policy Gradient ( DDPG ) ( Lillicrap et al. , 2015 ) are combined . In ERL frameworks , the GA transfers the experience from evaluation into the DDPG through a replay buffer , and the DDPG transfers the knowledge learned from the policy gradient into the GA by periodically injecting a PG actor into the GA population . Khadka et al . ( 2019 ) expanded the PG algorithm of ERL from a single DDPG learner to multiple TD3 learners with a resource manager . Bodnar et al . ( 2019 ) revised the GA ’ s crossover and mutation to the distilled crossover and proximal mutation inspired by ( Gangwani & Peng , 2017 ) and ( Lehman et al. , 2018 ) to prevent the destruction of neural networks . Pourchot & Sigaud ( 2018 ) introduced another framework , which combines the CEM and the TD3 . In this framework , the TD3 algorithm has only a critic function trained using the experience from the CEM . In order to propagate the knowledge learned by policy gradient to the CEM , half of the population is updated to the direction indicated by the TD3 critic for a fixed number of steps , followed by the evaluation . The policy gradient for half of the population not only enhances the gradient-based learning , but also deteriorate the CEM ’ s robustness over a deceptive gradient . In this paper , we introduce another hybrid algorithm , in which the CEM and the TD3 are combined as in CEMRL ( Pourchot & Sigaud , 2018 ) . However , the TD3 has both actor and critic , which are trained by a gradient from experiences generated by CEM . And then , the TD3 actor periodically participates in CEM population as in ERL ( Khadka & Tumer , 2018 ) . This structure is an effective way to maintain a direct policy search of CEM . To enhance the performance , we introduced new interactions processes between the CEM and TD3 instead of carrying out a policy gradient for numerous individual actors . 3 BACKGROUNDS . Twin Delayed Deep Deterministic Policy Gradient ( TD3 ) RL framework has an agent interacting with an environment generally defined by a Markov Decision Process ( MDP ) . At each timestep t , an agent receives the state st , and takes an action at according to the policy π , and then receives a reward rt and the next state st+1 at next time step t + 1 . The goal of RL is to find the policy that maximizes the discounted cumulative return Rt = ∑∞ k=t γ k−trk where γ is a discounted factor . Off-policy RL can use the data from arbitrary policies to train its actor and critic functions repeatedly , which is a key point for improving recent gradient-based RL . Silver et al . ( 2014 ) introduced the off-policy Deterministic Policy Gradient ( DPG ) , which has an advantage for high-dimensional action spaces . The DDPG ( Lillicrap et al. , 2015 ) was extended from the DPG to apply it to a deep neural network . TD3 ( Fujimoto et al. , 2018 ) is an advanced version of the DDPG , which suffers from the overestimation bias of the critic . To correct this bias , two critics are introduced , and then the critic with the lowest state-action value is taken during the critic update as in the Double Deep Q-Network ( DDQN ) ( Van Hasselt et al. , 2016 ) . Figure 2 ( a ) represents the architecture of the TD3 . Cross Entropy Method ( CEM ) The Evolutionary Approach ( EA ) is a heuristic search method inspired by nature , where the current population is evaluated , and the next population is regenerated using the current evaluation result in order to produce a higher Return , which is also known as Fitness and defined as a cumulative sum of immediate reward for a fixed number of steps . The Estimation of Distribution Algorithm ( EDA ) is a class of the EA : It updates the target distribution to generate a better population . Depending on the update method for the distribution , EDAs are classified as a CEM ( De Boer et al. , 2005 ) , a Covariance Matrix Adaptation Evolutionary Strategy ( Hansen , 2016 ) , an Evolutionary Strategy ( Salimans et al. , 2017 ) , and a Natural Evolutionary Strategy ( Wierstra et al. , 2014 ) . We used the CEM as one part of our proposed algorithm . As shown in Figure 2 ( b ) , the CEM procedures are as follows : The population is sampled from the multivariate Gaussian N ( µ , Σ ) and evaluated , and for the top K , which is smaller than the population size ( N ) , high performing actors are used to update a new mean ( µ ) and covariance ( Σ ) of the target distribution . The weight can be given to each actor according to the rank of the Return ( Hansen , 2016 ) . The elite actor can be passed to the next population , which is known as elitism . The more detailed procedure is reported in ( De Boer et al. , 2005 ) . In this paper , we used a diagonal covariance to reduce the parameters . Population-guided Parallel Policy Search ( P3S ) The Guided Policy Learning ( GPL ) is commonly used when the elite policy leads some sub-policies to a better solution in multiple policies setting . Teh et al . ( 2017 ) introduced GPL for joint learning of numerous tasks in which a common policy encourages local policies to act better . Jung et al . ( 2020 ) proposed a soft-manner GPL , called the Population-guided Parallel Policy Search , for multiple identical learners with the same objective , where a population is evaluated periodically . Then sub-policies are trained to maximize their critic value and to concurrently minimize the distance from the elite policy for the next period . For this purpose , Augmented Loss ( 2 ) is used to train the sub-policies instead of Original Loss ( 1 ) . Original Loss : LO ( π ) = Es∼SS [ −Qπ ( s , π ( s ) ) ] ( 1 ) Augmented Loss : LA ( π , πelite , β ) = Es∼SS [ −Qπ ( s , π ( s ) ) + β||π ( s ) − πelite ( s ) ||22 ] ( 2 ) where π is a trained policy , Qπ is a critic function depending on π , πelite is the elite policy , SS is the set of states , and ||π ( s ) − πelite ( s ) ||22 is the Euclidean distance measure between the trained policy and the elite policy . β is a distance weight and is controlled adaptively . In this paper , we used a revised GPL inspired by P3S so that the CEM elite actor guides the TD3 to better space .
The paper proposes a new method combining evolutionary methods and RL. In particular, the authors combine CEM and TD3 in PGPS. PGPS maintains a population of policies, which interact with the environment to collect data filling the replay buffer. The data in replay buffer is then used to train TD3. PGPS enables information flow in both directions: when the TD3 policy performs poorly, the elite policy from the population is used to guide TD3 by an imitation learning loss; The TD3 critic helps select top policies in the population and the TD3 actor is also included in the population. The experiments on simple Mujoco domains demonstrate the utility of PGPS and the ablation study analyzes the utility of each part of PGPS.
SP:c4662d0c24d1744837443315de5f92042cada40b
Differentially Private Learning Needs Better Features (or Much More Data)
1 INTRODUCTION . Machine learning ( ML ) models have been successfully applied to the analysis of sensitive user data such as medical images ( Lundervold & Lundervold , 2019 ) , text messages ( Chen et al. , 2019 ) or social media posts ( Wu et al. , 2016 ) . Training these ML models under the framework of differential privacy ( DP ) ( Dwork et al. , 2006b ; Chaudhuri et al. , 2011 ; Shokri & Shmatikov , 2015 ; Abadi et al. , 2016 ) can protect deployed classifiers against unintentional leakage of private training data ( Shokri et al. , 2017 ; Song et al. , 2017 ; Carlini et al. , 2019 ; 2020 ) . Yet , training deep neural networks with strong DP guarantees comes at a significant cost in utility ( Abadi et al. , 2016 ; Yu et al. , 2020 ; Bagdasaryan et al. , 2019 ; Feldman , 2020 ) . In fact , on many ML benchmarks the reported accuracy of private deep learning still falls short of “ shallow ” ( non-private ) techniques . For example , on CIFAR-10 , Papernot et al . ( 2020b ) train a neural network to 66.2 % accuracy for a large DP budget of ε = 7.53 , the highest accuracy we are aware of for this privacy budget . Yet , without privacy , higher accuracy is achievable with linear models and non-learned “ handcrafted ” features , e.g. , ( Coates & Ng , 2012 ; Oyallon & Mallat , 2015 ) . This leads to the central question of our work : Can differentially private learning benefit from handcrafted features ? We answer this question affirmatively by introducing simple and strong handcrafted baselines for differentially private learning , that significantly improve the privacy-utility guarantees on canonical vision benchmarks . Our contributions . We leverage the Scattering Network ( ScatterNet ) of Oyallon & Mallat ( 2015 ) — a non-learned SIFT-like feature extractor ( Lowe , 1999 ) —to train linear models that improve upon the privacy-utility guarantees of deep learning on MNIST , Fashion-MNIST and CIFAR-10 ( see Table 1 ) . For example , on CIFAR-10 we exceed the accuracy reported by Papernot et al . ( 2020b ) while simultaneously improving the provable DP-guarantee by 130× . On MNIST , we match the privacy-utility guarantees obtained with PATE ( Papernot et al. , 2018 ) without requiring access to any public data . We find that privately training deeper neural networks on handcrafted features also significantly improves over end-to-end deep learning , and even slightly exceeds the simpler linear models on CIFAR-10 . Our results show that private deep learning remains outperformed by handcrafted priors on many tasks , and thus has yet to reach its “ AlexNet moment ” ( Krizhevsky et al. , 2012 ) . We find that models with handcrafted features outperform end-to-end deep models , despite having more trainable parameters . This is counter-intuitive , as the guarantees of private learning degrade with dimensionality in the worst case ( Bassily et al. , 2014 ) .1 We explain the benefits of handcrafted features by analyzing the convergence rate of non-private gradient descent . First , we observe that with low enough learning rates , training converges similarly with or without privacy ( both for models with and without handcrafted features ) . Second , we show that handcrafted features significantly boost the convergence rate of non-private learning at low learning rates . As a result , when training with privacy , handcrafted features lead to more accurate models for a fixed privacy budget . Considering these results , we ask : what is the cost of private learning ’ s “ AlexNet moment ” ? That is , which additional resources do we need in order to outperform our private handcrafted baselines ? Following McMahan et al . ( 2018 ) , we first consider the data complexity of private end-to-end learning . On CIFAR-10 , we use an additional 500,000 labeled Tiny Images from Carmon et al . ( 2019 ) to show that about an order of magnitude more private training data is needed for end-to-end deep models to outperform our handcrafted features baselines . The high sample-complexity of private deep learning could be detrimental for tasks that can not leverage “ internet-scale ” data collection ( e.g. , most medical applications ) . We further consider private learning with access to public data from a similar domain . In this setting , handcrafted features can be replaced by features learned from public data via transfer learning ( Razavian et al. , 2014 ) . While differentially private transfer learning has been studied in prior work ( Abadi et al. , 2016 ; Papernot et al. , 2020a ) , we find that its privacy-utility guarantees have been underestimated . We revisit these results and show that with transfer learning , strong privacy comes at only a minor cost in accuracy . For example , given public unlabeled ImageNet data , we train a CIFAR-10 model to 92.7 % accuracy for a DP budget of ε = 2 . Our work demonstrates that higher quality features—whether handcrafted or transferred from public data—are of paramount importance for improving the performance of private classifiers in low ( private ) data regimes . Code to reproduce our experiments is available at https : //github.com/ftramer/ Handcrafted-DP . 2 STRONG SHALLOW BASELINES FOR DIFFERENTIALLY PRIVATE LEARNING . We consider the standard central model of differential privacy ( DP ) : a trusted party trains an ML model f on a private dataset D ∈ D , and publicly releases the model . The learning algorithm A 1A number of recent works have attempted to circumvent this worst-case dimensionality dependence by leveraging the empirical observation that model gradients lie in a low-dimensional subspace ( Kairouz et al. , 2020 ; Zhou et al. , 2020b ) . satisfies ( ε , δ ) -differential privacy ( Dwork et al. , 2006a ) , if for any datasets D , D′ that differ in one record , and any set of models S : Pr [ A ( D ) ∈ S ] ≤ eε Pr [ A ( D′ ) ∈ S ] + δ. DP bounds an adversary ’ s ability to infer information about any individual training point from the model . Cryptography can split the trust in a central party across users ( Jayaraman et al. , 2018 ; Bonawitz et al. , 2017 ) . Prior work has trained private deep neural networks “ end-to-end ” ( e.g. , from image pixels ) , with large losses in utility ( Shokri & Shmatikov , 2015 ; Abadi et al. , 2016 ; Papernot et al. , 2020b ) . In contrast , we study the benefits of handcrafted features that encode priors on the learning task ’ s public domain ( e.g. , edge detectors for images ) . Although end-to-end neural networks outperform such features in the non-private setting , our thesis is that handcrafted features result in an easier learning task that is more amenable to privacy . We focus on computer vision , a canonical domain for private deep learning ( Abadi et al. , 2016 ; Yu et al. , 2019b ; Papernot et al. , 2020b ; Nasr et al. , 2020 ) ) , with a rich literature on handcrafted features ( Lowe , 1999 ; Dalal & Triggs , 2005 ; Bruna & Mallat , 2013 ) . Our approach can be extended to handcrafted features in other domains , e.g. , text or speech . 2.1 SCATTERING NETWORKS . We use the Scattering Network ( ScatterNet ) of Oyallon & Mallat ( 2015 ) , a feature extractor that encodes natural image priors ( e.g. , invariance to small rotations and translations ) using a cascade of wavelet transforms ( Bruna & Mallat , 2013 ) . As this cascade of transforms is data independent , we can obtain a differentially private classifier by privately fine-tuning a ( linear ) model on top of locally extracted features . In Appendix A , we discuss other candidate “ non-deep ” approaches that we believe to be less suitable for differentially private learning . We use the default parameters in ( Oyallon & Mallat , 2015 ) , a ScatterNet S ( x ) of depth two with wavelets rotated along eight angles . For images of size H ×W , this network extracts features of dimension ( K , H/4 , W/4 ) , with K = 81 for grayscale images , and K = 243 for RGB images . Note that the transform is thus expansive . More details on ScatterNets are in Appendix C.1 . 2.2 DIFFERENTIALLY PRIVATE SCATTERNET CLASSIFIERS . To train private classifiers , we use the DP-SGD algorithm2 of Abadi et al . ( 2016 ) ( see Appendix B ) . DP-SGD works as follows : ( 1 ) batches of expected size B are sampled at random ; 3 ( 2 ) gradients are clipped to norm C ; ( 3 ) Gaussian noise of variance σ2C2/B2 is added to the mean gradient . DP-SGD guarantees privacy for gradients , and is thus oblivious to preprocessing applied independently to each data sample , such as the ScatterNet transform . When training a supervised classifier on top of ScatterNet features with gradient descent , we find that normalizing the features is crucial to obtain strong performance . We consider two approaches : • Group Normalization ( Wu & He , 2018 ) : the channels of S ( x ) are split into G groups , and each is normalized to zero mean and unit variance . Data points are normalized independently so this step incurs no privacy cost . • Data Normalization : the channels of S ( x ) are normalized by their mean and variance across the training data . This step incurs a privacy cost as the per-channel means and variances need to be privately estimated . Table 2 shows that normalization significantly accelerates convergence of non-private linear models trained on ScatterNet features , for MNIST , Fashion-MNIST and CIFAR-10 . For CIFAR-10 , Data 2Yu et al . ( 2019a ) show that DP-SGD outperforms other algorithms for private convex optimization , e.g. , logistic regression with output or objective perturbation ( Chaudhuri et al. , 2011 ; Bassily et al. , 2014 ; Kifer et al. , 2012 ) . In Appendix D.3 , we show that DP-SGD also outperforms Privacy Amplification by Iteration ( Feldman et al. , 2018 ) in our setting . 3Existing DP-SGD implementations ( tensorflow/privacy , 2019 ; pytorch/opacus , 2020 ) and many prior works ( e.g. , ( Abadi et al. , 2016 ; Papernot et al. , 2020b ) ) heuristically split the data into random batches of size exactly B . We use the same heuristic and show in Appendix D.4 that using the correct batch sampling does not affect our results . Normalization performs significantly better than Group Normalization , so the small privacy cost of estimating channel statistics is warranted . While the maximal test accuracy of these models falls short of state-of-the-art CNNs , it exceeds all previously reported results for differentially private neural networks ( even for large privacy budgets ) . 3 EVALUATING PRIVATE SCATTERNET CLASSIFIERS . We compare differentially private ScatterNet classifiers and deep learning models on MNIST ( LeCun et al. , 2010 ) , Fashion-MNIST ( Xiao et al. , 2017 ) and CIFAR-10 ( Krizhevsky , 2009 ) . Many prior works have reported improvements over the DP-SGD procedure of Abadi et al . ( 2016 ) for these datasets . As we will show , ScatterNet classifiers outperform all prior approaches while making no algorithmic changes to DP-SGD . ScatterNet classifiers can thus serve as a strong canonical baseline for evaluating proposed improvements over DP-SGD in the future .
The paper presents an analysis of differential privacy in machine learning, with a focus on neural networks trained via differentially private stochastic gradient descent (DPSGD). The main focus and the message in the paper is that the handcrafted features work better compared to learned features during training of NNs and having more training data results in better outcomes (i.e. a better privacy-utility trade-off).
SP:4e5cbc8389be556e7f0bc008d19d635e6736622f
Differentially Private Learning Needs Better Features (or Much More Data)
1 INTRODUCTION . Machine learning ( ML ) models have been successfully applied to the analysis of sensitive user data such as medical images ( Lundervold & Lundervold , 2019 ) , text messages ( Chen et al. , 2019 ) or social media posts ( Wu et al. , 2016 ) . Training these ML models under the framework of differential privacy ( DP ) ( Dwork et al. , 2006b ; Chaudhuri et al. , 2011 ; Shokri & Shmatikov , 2015 ; Abadi et al. , 2016 ) can protect deployed classifiers against unintentional leakage of private training data ( Shokri et al. , 2017 ; Song et al. , 2017 ; Carlini et al. , 2019 ; 2020 ) . Yet , training deep neural networks with strong DP guarantees comes at a significant cost in utility ( Abadi et al. , 2016 ; Yu et al. , 2020 ; Bagdasaryan et al. , 2019 ; Feldman , 2020 ) . In fact , on many ML benchmarks the reported accuracy of private deep learning still falls short of “ shallow ” ( non-private ) techniques . For example , on CIFAR-10 , Papernot et al . ( 2020b ) train a neural network to 66.2 % accuracy for a large DP budget of ε = 7.53 , the highest accuracy we are aware of for this privacy budget . Yet , without privacy , higher accuracy is achievable with linear models and non-learned “ handcrafted ” features , e.g. , ( Coates & Ng , 2012 ; Oyallon & Mallat , 2015 ) . This leads to the central question of our work : Can differentially private learning benefit from handcrafted features ? We answer this question affirmatively by introducing simple and strong handcrafted baselines for differentially private learning , that significantly improve the privacy-utility guarantees on canonical vision benchmarks . Our contributions . We leverage the Scattering Network ( ScatterNet ) of Oyallon & Mallat ( 2015 ) — a non-learned SIFT-like feature extractor ( Lowe , 1999 ) —to train linear models that improve upon the privacy-utility guarantees of deep learning on MNIST , Fashion-MNIST and CIFAR-10 ( see Table 1 ) . For example , on CIFAR-10 we exceed the accuracy reported by Papernot et al . ( 2020b ) while simultaneously improving the provable DP-guarantee by 130× . On MNIST , we match the privacy-utility guarantees obtained with PATE ( Papernot et al. , 2018 ) without requiring access to any public data . We find that privately training deeper neural networks on handcrafted features also significantly improves over end-to-end deep learning , and even slightly exceeds the simpler linear models on CIFAR-10 . Our results show that private deep learning remains outperformed by handcrafted priors on many tasks , and thus has yet to reach its “ AlexNet moment ” ( Krizhevsky et al. , 2012 ) . We find that models with handcrafted features outperform end-to-end deep models , despite having more trainable parameters . This is counter-intuitive , as the guarantees of private learning degrade with dimensionality in the worst case ( Bassily et al. , 2014 ) .1 We explain the benefits of handcrafted features by analyzing the convergence rate of non-private gradient descent . First , we observe that with low enough learning rates , training converges similarly with or without privacy ( both for models with and without handcrafted features ) . Second , we show that handcrafted features significantly boost the convergence rate of non-private learning at low learning rates . As a result , when training with privacy , handcrafted features lead to more accurate models for a fixed privacy budget . Considering these results , we ask : what is the cost of private learning ’ s “ AlexNet moment ” ? That is , which additional resources do we need in order to outperform our private handcrafted baselines ? Following McMahan et al . ( 2018 ) , we first consider the data complexity of private end-to-end learning . On CIFAR-10 , we use an additional 500,000 labeled Tiny Images from Carmon et al . ( 2019 ) to show that about an order of magnitude more private training data is needed for end-to-end deep models to outperform our handcrafted features baselines . The high sample-complexity of private deep learning could be detrimental for tasks that can not leverage “ internet-scale ” data collection ( e.g. , most medical applications ) . We further consider private learning with access to public data from a similar domain . In this setting , handcrafted features can be replaced by features learned from public data via transfer learning ( Razavian et al. , 2014 ) . While differentially private transfer learning has been studied in prior work ( Abadi et al. , 2016 ; Papernot et al. , 2020a ) , we find that its privacy-utility guarantees have been underestimated . We revisit these results and show that with transfer learning , strong privacy comes at only a minor cost in accuracy . For example , given public unlabeled ImageNet data , we train a CIFAR-10 model to 92.7 % accuracy for a DP budget of ε = 2 . Our work demonstrates that higher quality features—whether handcrafted or transferred from public data—are of paramount importance for improving the performance of private classifiers in low ( private ) data regimes . Code to reproduce our experiments is available at https : //github.com/ftramer/ Handcrafted-DP . 2 STRONG SHALLOW BASELINES FOR DIFFERENTIALLY PRIVATE LEARNING . We consider the standard central model of differential privacy ( DP ) : a trusted party trains an ML model f on a private dataset D ∈ D , and publicly releases the model . The learning algorithm A 1A number of recent works have attempted to circumvent this worst-case dimensionality dependence by leveraging the empirical observation that model gradients lie in a low-dimensional subspace ( Kairouz et al. , 2020 ; Zhou et al. , 2020b ) . satisfies ( ε , δ ) -differential privacy ( Dwork et al. , 2006a ) , if for any datasets D , D′ that differ in one record , and any set of models S : Pr [ A ( D ) ∈ S ] ≤ eε Pr [ A ( D′ ) ∈ S ] + δ. DP bounds an adversary ’ s ability to infer information about any individual training point from the model . Cryptography can split the trust in a central party across users ( Jayaraman et al. , 2018 ; Bonawitz et al. , 2017 ) . Prior work has trained private deep neural networks “ end-to-end ” ( e.g. , from image pixels ) , with large losses in utility ( Shokri & Shmatikov , 2015 ; Abadi et al. , 2016 ; Papernot et al. , 2020b ) . In contrast , we study the benefits of handcrafted features that encode priors on the learning task ’ s public domain ( e.g. , edge detectors for images ) . Although end-to-end neural networks outperform such features in the non-private setting , our thesis is that handcrafted features result in an easier learning task that is more amenable to privacy . We focus on computer vision , a canonical domain for private deep learning ( Abadi et al. , 2016 ; Yu et al. , 2019b ; Papernot et al. , 2020b ; Nasr et al. , 2020 ) ) , with a rich literature on handcrafted features ( Lowe , 1999 ; Dalal & Triggs , 2005 ; Bruna & Mallat , 2013 ) . Our approach can be extended to handcrafted features in other domains , e.g. , text or speech . 2.1 SCATTERING NETWORKS . We use the Scattering Network ( ScatterNet ) of Oyallon & Mallat ( 2015 ) , a feature extractor that encodes natural image priors ( e.g. , invariance to small rotations and translations ) using a cascade of wavelet transforms ( Bruna & Mallat , 2013 ) . As this cascade of transforms is data independent , we can obtain a differentially private classifier by privately fine-tuning a ( linear ) model on top of locally extracted features . In Appendix A , we discuss other candidate “ non-deep ” approaches that we believe to be less suitable for differentially private learning . We use the default parameters in ( Oyallon & Mallat , 2015 ) , a ScatterNet S ( x ) of depth two with wavelets rotated along eight angles . For images of size H ×W , this network extracts features of dimension ( K , H/4 , W/4 ) , with K = 81 for grayscale images , and K = 243 for RGB images . Note that the transform is thus expansive . More details on ScatterNets are in Appendix C.1 . 2.2 DIFFERENTIALLY PRIVATE SCATTERNET CLASSIFIERS . To train private classifiers , we use the DP-SGD algorithm2 of Abadi et al . ( 2016 ) ( see Appendix B ) . DP-SGD works as follows : ( 1 ) batches of expected size B are sampled at random ; 3 ( 2 ) gradients are clipped to norm C ; ( 3 ) Gaussian noise of variance σ2C2/B2 is added to the mean gradient . DP-SGD guarantees privacy for gradients , and is thus oblivious to preprocessing applied independently to each data sample , such as the ScatterNet transform . When training a supervised classifier on top of ScatterNet features with gradient descent , we find that normalizing the features is crucial to obtain strong performance . We consider two approaches : • Group Normalization ( Wu & He , 2018 ) : the channels of S ( x ) are split into G groups , and each is normalized to zero mean and unit variance . Data points are normalized independently so this step incurs no privacy cost . • Data Normalization : the channels of S ( x ) are normalized by their mean and variance across the training data . This step incurs a privacy cost as the per-channel means and variances need to be privately estimated . Table 2 shows that normalization significantly accelerates convergence of non-private linear models trained on ScatterNet features , for MNIST , Fashion-MNIST and CIFAR-10 . For CIFAR-10 , Data 2Yu et al . ( 2019a ) show that DP-SGD outperforms other algorithms for private convex optimization , e.g. , logistic regression with output or objective perturbation ( Chaudhuri et al. , 2011 ; Bassily et al. , 2014 ; Kifer et al. , 2012 ) . In Appendix D.3 , we show that DP-SGD also outperforms Privacy Amplification by Iteration ( Feldman et al. , 2018 ) in our setting . 3Existing DP-SGD implementations ( tensorflow/privacy , 2019 ; pytorch/opacus , 2020 ) and many prior works ( e.g. , ( Abadi et al. , 2016 ; Papernot et al. , 2020b ) ) heuristically split the data into random batches of size exactly B . We use the same heuristic and show in Appendix D.4 that using the correct batch sampling does not affect our results . Normalization performs significantly better than Group Normalization , so the small privacy cost of estimating channel statistics is warranted . While the maximal test accuracy of these models falls short of state-of-the-art CNNs , it exceeds all previously reported results for differentially private neural networks ( even for large privacy budgets ) . 3 EVALUATING PRIVATE SCATTERNET CLASSIFIERS . We compare differentially private ScatterNet classifiers and deep learning models on MNIST ( LeCun et al. , 2010 ) , Fashion-MNIST ( Xiao et al. , 2017 ) and CIFAR-10 ( Krizhevsky , 2009 ) . Many prior works have reported improvements over the DP-SGD procedure of Abadi et al . ( 2016 ) for these datasets . As we will show , ScatterNet classifiers outperform all prior approaches while making no algorithmic changes to DP-SGD . ScatterNet classifiers can thus serve as a strong canonical baseline for evaluating proposed improvements over DP-SGD in the future .
The paper considers ways of improving private versions of SGD in the context of image classification. The main finding is that providing "hand crafted" features can significantly improve the privacy/accuracy trade-off. In some cases, even a linear model built on top of such features (like those produced by ScatterNet), can improve over differentially private SGD. A plausible explanation for this phenomenon is that extra features can reduce the number of iterations required in SGD, resulting in better privacy and/or less noise. (It is also argued that having much more data similarly improves the trade-off, but this is unsurprising and, it seems, has been observed before by McMahan et al.)
SP:4e5cbc8389be556e7f0bc008d19d635e6736622f
Better Fine-Tuning by Reducing Representational Collapse
1 INTRODUCTION . Pre-trained language models ( Radford et al. , 2019 ; Devlin et al. , 2018 ; Liu et al. , 2019 ; Lewis et al. , 2019 ; 2020 ) have been shown to capture a wide array of semantic , syntactic , and world knowledge ( Clark et al. , 2019 ) , and provide the defacto initialization for modeling most existing NLP tasks . However , fine-tuning them for each task is a highly unstable process , with many hyperparameter settings producing failed fine-tuning runs , unstable results ( considerable variation between random seeds ) , over-fitting , and other unwanted consequences ( Zhang et al. , 2020 ; Dodge et al. , 2020 ) . Recently , trust region or adversarial based approaches , including SMART ( Jiang et al. , 2019 ) and FreeLB ( Zhu et al. , 2019 ) , have been shown to increase the stability and accuracy of fine-tuning by adding additional constraints limiting how much the fine-tuning changes the initial parameters . However , these methods are significantly more computationally and memory intensive than the more commonly adopted simple-gradient-based approaches . This paper presents a lightweight fine-tuning strategy that matches or improves performance relative to SMART and FreeLB while needing just a fraction of the computational and memory overhead and no additional backward passes . Our approach is motivated by trust region theory while also reducing to simply regularizing the model relative to parametric noise applied to the original pre-trained representations . We show uniformly better performance , setting a new state of the art for RoBERTa fine-tuning on GLUE and reaching state of the art on XNLI using no novel pre-training approaches ( Liu et al. , 2019 ; Wang et al. , 2018 ; Conneau et al. , 2018 ) . Furthermore , the low overhead of our family of fine-tuning methods allows our method to be applied to generation tasks where we consistently outperform standard fine-tuning , setting state of the art on summarization tasks . We also introduce a new analysis to motivate the use of trust-region-style methods more generally , by defining a new notion of representational collapse and introducing a new methodology for measuring it during fine-tuning . Representational collapse is the degradation of generalizable representations of pre-trained models during the fine-tuning stage . We empirically show that standard fine-tuning degrades generalizable representations through a series of probing experiments on GLUE tasks . Furthermore , we attribute this phenomenon to using standard gradient descent algorithms for the fine-tuning stage . We also find that ( 1 ) recently proposed fine-tuning methods rooted in trust region , i.e. , SMART , can alleviate representation collapse , and ( 2 ) our methods alleviate representational collapse to an even greater degree , manifesting in better performance across almost all datasets and models . Our contributions in this paper are the following . • We propose a novel approach to fine-tuning rooted in trust-region theory , which we show directly alleviates representational collapse at a fraction of the cost of other recently proposed fine-tuning methods . • Through extensive experimentation , we show that our method outperforms standard finetuning methodology following recently proposed best practices from Zhang et al . ( 2020 ) . We improve various SOTA models from sentence prediction to summarization , from monolingual to cross-lingual . • We further define and explore the phenomena of representational collapse in fine-tuning and directly correlate it with generalization in tasks of interest . 2 LEARNING ROBUST REPRESENTATIONS THROUGH REGULARIZED FINE-TUNING . We are interested in deriving methods for fine-tuning representations that provide guarantees on the movement of representations , in the sense that they do not forget the original pre-trained representations when they are fine-tuned for new tasks ( see Section 4 for more details ) . We introduce a new fine-tuning method rooted in an approximation to trust region , which provides guarantees for stochastic gradient descent algorithms by bounding some divergence between model at update t and t+ 1 ( Pascanu & Bengio , 2013 ; Schulman et al. , 2015b ; Jiang et al. , 2019 ) . Let f : Rm×n → Rp be a function which returns some pre-trained representation parameterized by θf from m tokens embedded into a fixed vector of size n. Let the learned classification head g : Rp → Rq be a function which takes an input from f and outputs a valid probability distribution parameterized by θg in q dimensions and let X be our dataset . In the case of generation , we can assume the classification head is simply an identity function or softmax depending on the loss function . Let L ( θ ) denote a loss function given by θ = [ θf , θg ] . We are interested in minimizing L with respect to θ such that each update step is constrained by movement in the representational density space p ( f ) . More formally given an arbitrary arg min ∆θ L ( θ + ∆θ ) s.t . KL ( p ( f ( · ; θf ) ) ||p ( f ( · ; θf + ∆θf ) ) ) = ( 1 ) This constrained optimization problem is equivalent to doing natural gradient descent directly over the representations ( Pascanu & Bengio , 2013 ) . Unfortunately , we do not have direct access to the density of representations ; therefore , it is not trivial to directly bound this quantity . Instead , we propose to do natural gradient over g · f with an additional constraint that g is at most 1-Lipschitz ( which naturally constrains change of representations , see Section A.1 in the Appendix ) . Traditional computation of natural gradient is computationally prohibitive due to the need for inverting the Hessian . An alternative formulation of natural gradient can be stated through mirror descent , using Bregmann divergences ( Raskutti & Mukherjee , 2015 ; Jiang et al. , 2019 ) . This method primarily serves as a robust regularizer by preventing large updates in the model ’ s probability space . This family of methods is classically known as trust-region methods ( Pascanu & Bengio , 2013 ; Schulman et al. , 2015a ) . LSMART ( θ , f , g ) = L ( θ ) + λEx∼X [ sup x∼ : |x∼−x|≤ KLS ( g · f ( x ) ‖ g · f ( x∼ ) ) ] ( 2 ) However , the supremum is computationally intractable . An approximation is possible by doing gradient ascent steps , similar to finding adversarial examples . This was first proposed by SMART with a symmetrical KLS ( X , Y ) = KL ( X||Y ) +KL ( Y ||X ) term ( Jiang et al. , 2019 ) . We propose an even simpler approximation which does not require extra backward computations and empirically works as well as or better than SMART . We altogether remove the adversarial nature from SMART and instead optimize for a smoothness parameterized by KLS . Furthermore , we optionally also add a constraint on the smoothness of g by making it at most 1-Lipschitz , the intuition being if we can bound the volume of change in g we can more effectively bound f . LR3 ( f , g , θ ) = L ( θ ) + λEx∼X [ KLS ( g · f ( x ) ‖ g · f ( x+ z ) ) ] R3F Method ( 3 ) s.t . z ∼ N ( 0 , σ2I ) or z ∼ U ( −σ , σ ) ( 4 ) s.t . Lip { g } ≤ 1 Optional R4F Method ( 5 ) where KLS is the symmetric KL divergence and z is a sample from a parametric distribution . In our work we test against two distributions , normal and uniform centered around 0 . We denote this as the Robust Representations through Regularized Finetuning ( R3F ) method . Additionally we propose an extension to R3F ( R4F ; Robust Representations through Regularized and Reparameterized Finetuning , which reparameterizes g to be at most 1-Lipschitz via Spectral Normalization ( Miyato et al. , 2018 ) . By constraining g to be at most 1-Lipschitz , we can more directly bound the change in representation ( Appendix Section A.1 ) . Specifically we scale all the weight matrices of g by the inverse of their largest singular values WSN : = W/σ ( W ) . Given that spectral radius σ ( WSN ) = 1 we can bound Lip { g } ≤ 1 . In the case of generation , g does not have any weights therefore we can only apply the R3F method . 2.1 RELATIONSHIP TO SMART AND FREELB . Our method is most closely related to the SMART algorithm , which utilizes an auxiliary smoothness inducing regularization term , which directly optimizes the Bregmann divergence mentioned above in Equation 2 ( Jiang et al. , 2019 ) . SMART solves the supremum by using an adversarial methodology to ascent to the largest KL divergence with an −ball . We instead propose to remove the ascent step completely , optionally fixing the smoothness of the classification head g. This completely removes SMART ’ s adversarial nature and is more akin to optimizing the smoothness of g · f directly . Another recently proposed adversarial method for fine-tuning , FreeLB optimizes a direct adversarial loss LFreeLB ( θ ) = sup∆θ : |∆θ|≤ L ( θ + ∆θ ) through iterative gradient ascent steps . This is similar to SMART in the sense that both are adversarial and require gradient ascent steps . Unfortunately , the need for extra forward-backward passes can be prohibitively expensive when fine-tuning large pre-trained models ( Zhu et al. , 2019 ) . Our method is significantly more computationally efficient than adversarial based fine-tuning methods , as seen in Table 1 . We show that this efficiency does not hurt performance ; we can match or exceed FreeLB and SMART on a large number of tasks . In addition , the relatively low costs of our methods allow us to improve over fine-tuning on an array of generation tasks . 3 EXPERIMENTS . We will first measure performance by fine-tuning on a range of tasks and languages . The next sections report why methods rooted in trust region , including ours , outperform standard fine-tuning . We aimed for fair comparisons throughout all of our experiments by using fixed budget hyperparameters searches across all methods . Furthermore , for computationally tractable tasks , we report median/max numbers as well as show distributions across a large number of runs . 3.1 SENTENCE PREDICTION . GLUE . We will first test R3F and R4F on sentence classification tasks from the GLUE benchmark ( Wang et al. , 2018 ) . We select the same subset of GLUE tasks that have been reported by prior work in this space ( Jiang et al. , 2019 ) : MNLI ( Williams et al. , 2018 ) , QQP ( Iyer et al. , 2017 ) , RTE ( Bentivogli et al. , 2009 ) , QNLI ( Rajpurkar et al. , 2016 ) , MRPC ( Dolan & Brockett , 2005 ) , CoLA ( Warstadt et al. , 2018 ) , SST-2 ( Socher et al. , 2013 ) .1 Consistent with prior work ( Jiang et al. , 2019 ; Zhu et al. , 2019 ) , we focus on improving the performance of RoBERTa-Large based models in the single-task setting ( Liu et al. , 2019 ) . We report the performance of all models on the GLUE development set . Method 5000 6000 7000 8000 9000 Se co nd s SST-2 Walltime Analysis Finetuning Method Standard++ SMART R3F R3F R4F R4F ods across ten seeds to demonstrate the stability properties of individual methods in Figure 2 . R3F and R4F unanimously improve over Standard and Standard++ fine-tuning . Furthermore , our methods match or exceed adversarial methods such as SMART/FreeLB at a fraction of the computational cost when comparing median runs . We show computational cost in Figure 1 for a single task , but the relative behavior of wall times is consistent across all other GLUE tasks . We note that we could not find a discernable difference in the experimental setting , which would make the selection between R3F vs. R4F trivial . 1We do not test against STS-B because it is a regression task where our KL divergence is not defined ( Cer et al. , 2017 ) .
- This paper presents a simple but effective method rooted in trust region theory for fine-tuning pre-trained models without 'representational collapse'. Compared to previous methods (such as SMART by Jiang et al. (2019)), the newly proposed methods (R3F and R4F) are computationally simple while achieving more strong performance on several NLP tasks including GLUE, XNLI and summarization. The authors also introduce the concept of 'representational collapse', which means the degradation of generalizable representations of pre-trained models during the fine-tuning stage. Moreover, they empirically demonstrated that SMART and their proposed methods are effective in relieving representational collapse, compared to typical fine-tuning based on normal gradient descent (i.e., one without constraints).
SP:88108abfa920eda1a0766301bdfd70113f61f8b3
Better Fine-Tuning by Reducing Representational Collapse
1 INTRODUCTION . Pre-trained language models ( Radford et al. , 2019 ; Devlin et al. , 2018 ; Liu et al. , 2019 ; Lewis et al. , 2019 ; 2020 ) have been shown to capture a wide array of semantic , syntactic , and world knowledge ( Clark et al. , 2019 ) , and provide the defacto initialization for modeling most existing NLP tasks . However , fine-tuning them for each task is a highly unstable process , with many hyperparameter settings producing failed fine-tuning runs , unstable results ( considerable variation between random seeds ) , over-fitting , and other unwanted consequences ( Zhang et al. , 2020 ; Dodge et al. , 2020 ) . Recently , trust region or adversarial based approaches , including SMART ( Jiang et al. , 2019 ) and FreeLB ( Zhu et al. , 2019 ) , have been shown to increase the stability and accuracy of fine-tuning by adding additional constraints limiting how much the fine-tuning changes the initial parameters . However , these methods are significantly more computationally and memory intensive than the more commonly adopted simple-gradient-based approaches . This paper presents a lightweight fine-tuning strategy that matches or improves performance relative to SMART and FreeLB while needing just a fraction of the computational and memory overhead and no additional backward passes . Our approach is motivated by trust region theory while also reducing to simply regularizing the model relative to parametric noise applied to the original pre-trained representations . We show uniformly better performance , setting a new state of the art for RoBERTa fine-tuning on GLUE and reaching state of the art on XNLI using no novel pre-training approaches ( Liu et al. , 2019 ; Wang et al. , 2018 ; Conneau et al. , 2018 ) . Furthermore , the low overhead of our family of fine-tuning methods allows our method to be applied to generation tasks where we consistently outperform standard fine-tuning , setting state of the art on summarization tasks . We also introduce a new analysis to motivate the use of trust-region-style methods more generally , by defining a new notion of representational collapse and introducing a new methodology for measuring it during fine-tuning . Representational collapse is the degradation of generalizable representations of pre-trained models during the fine-tuning stage . We empirically show that standard fine-tuning degrades generalizable representations through a series of probing experiments on GLUE tasks . Furthermore , we attribute this phenomenon to using standard gradient descent algorithms for the fine-tuning stage . We also find that ( 1 ) recently proposed fine-tuning methods rooted in trust region , i.e. , SMART , can alleviate representation collapse , and ( 2 ) our methods alleviate representational collapse to an even greater degree , manifesting in better performance across almost all datasets and models . Our contributions in this paper are the following . • We propose a novel approach to fine-tuning rooted in trust-region theory , which we show directly alleviates representational collapse at a fraction of the cost of other recently proposed fine-tuning methods . • Through extensive experimentation , we show that our method outperforms standard finetuning methodology following recently proposed best practices from Zhang et al . ( 2020 ) . We improve various SOTA models from sentence prediction to summarization , from monolingual to cross-lingual . • We further define and explore the phenomena of representational collapse in fine-tuning and directly correlate it with generalization in tasks of interest . 2 LEARNING ROBUST REPRESENTATIONS THROUGH REGULARIZED FINE-TUNING . We are interested in deriving methods for fine-tuning representations that provide guarantees on the movement of representations , in the sense that they do not forget the original pre-trained representations when they are fine-tuned for new tasks ( see Section 4 for more details ) . We introduce a new fine-tuning method rooted in an approximation to trust region , which provides guarantees for stochastic gradient descent algorithms by bounding some divergence between model at update t and t+ 1 ( Pascanu & Bengio , 2013 ; Schulman et al. , 2015b ; Jiang et al. , 2019 ) . Let f : Rm×n → Rp be a function which returns some pre-trained representation parameterized by θf from m tokens embedded into a fixed vector of size n. Let the learned classification head g : Rp → Rq be a function which takes an input from f and outputs a valid probability distribution parameterized by θg in q dimensions and let X be our dataset . In the case of generation , we can assume the classification head is simply an identity function or softmax depending on the loss function . Let L ( θ ) denote a loss function given by θ = [ θf , θg ] . We are interested in minimizing L with respect to θ such that each update step is constrained by movement in the representational density space p ( f ) . More formally given an arbitrary arg min ∆θ L ( θ + ∆θ ) s.t . KL ( p ( f ( · ; θf ) ) ||p ( f ( · ; θf + ∆θf ) ) ) = ( 1 ) This constrained optimization problem is equivalent to doing natural gradient descent directly over the representations ( Pascanu & Bengio , 2013 ) . Unfortunately , we do not have direct access to the density of representations ; therefore , it is not trivial to directly bound this quantity . Instead , we propose to do natural gradient over g · f with an additional constraint that g is at most 1-Lipschitz ( which naturally constrains change of representations , see Section A.1 in the Appendix ) . Traditional computation of natural gradient is computationally prohibitive due to the need for inverting the Hessian . An alternative formulation of natural gradient can be stated through mirror descent , using Bregmann divergences ( Raskutti & Mukherjee , 2015 ; Jiang et al. , 2019 ) . This method primarily serves as a robust regularizer by preventing large updates in the model ’ s probability space . This family of methods is classically known as trust-region methods ( Pascanu & Bengio , 2013 ; Schulman et al. , 2015a ) . LSMART ( θ , f , g ) = L ( θ ) + λEx∼X [ sup x∼ : |x∼−x|≤ KLS ( g · f ( x ) ‖ g · f ( x∼ ) ) ] ( 2 ) However , the supremum is computationally intractable . An approximation is possible by doing gradient ascent steps , similar to finding adversarial examples . This was first proposed by SMART with a symmetrical KLS ( X , Y ) = KL ( X||Y ) +KL ( Y ||X ) term ( Jiang et al. , 2019 ) . We propose an even simpler approximation which does not require extra backward computations and empirically works as well as or better than SMART . We altogether remove the adversarial nature from SMART and instead optimize for a smoothness parameterized by KLS . Furthermore , we optionally also add a constraint on the smoothness of g by making it at most 1-Lipschitz , the intuition being if we can bound the volume of change in g we can more effectively bound f . LR3 ( f , g , θ ) = L ( θ ) + λEx∼X [ KLS ( g · f ( x ) ‖ g · f ( x+ z ) ) ] R3F Method ( 3 ) s.t . z ∼ N ( 0 , σ2I ) or z ∼ U ( −σ , σ ) ( 4 ) s.t . Lip { g } ≤ 1 Optional R4F Method ( 5 ) where KLS is the symmetric KL divergence and z is a sample from a parametric distribution . In our work we test against two distributions , normal and uniform centered around 0 . We denote this as the Robust Representations through Regularized Finetuning ( R3F ) method . Additionally we propose an extension to R3F ( R4F ; Robust Representations through Regularized and Reparameterized Finetuning , which reparameterizes g to be at most 1-Lipschitz via Spectral Normalization ( Miyato et al. , 2018 ) . By constraining g to be at most 1-Lipschitz , we can more directly bound the change in representation ( Appendix Section A.1 ) . Specifically we scale all the weight matrices of g by the inverse of their largest singular values WSN : = W/σ ( W ) . Given that spectral radius σ ( WSN ) = 1 we can bound Lip { g } ≤ 1 . In the case of generation , g does not have any weights therefore we can only apply the R3F method . 2.1 RELATIONSHIP TO SMART AND FREELB . Our method is most closely related to the SMART algorithm , which utilizes an auxiliary smoothness inducing regularization term , which directly optimizes the Bregmann divergence mentioned above in Equation 2 ( Jiang et al. , 2019 ) . SMART solves the supremum by using an adversarial methodology to ascent to the largest KL divergence with an −ball . We instead propose to remove the ascent step completely , optionally fixing the smoothness of the classification head g. This completely removes SMART ’ s adversarial nature and is more akin to optimizing the smoothness of g · f directly . Another recently proposed adversarial method for fine-tuning , FreeLB optimizes a direct adversarial loss LFreeLB ( θ ) = sup∆θ : |∆θ|≤ L ( θ + ∆θ ) through iterative gradient ascent steps . This is similar to SMART in the sense that both are adversarial and require gradient ascent steps . Unfortunately , the need for extra forward-backward passes can be prohibitively expensive when fine-tuning large pre-trained models ( Zhu et al. , 2019 ) . Our method is significantly more computationally efficient than adversarial based fine-tuning methods , as seen in Table 1 . We show that this efficiency does not hurt performance ; we can match or exceed FreeLB and SMART on a large number of tasks . In addition , the relatively low costs of our methods allow us to improve over fine-tuning on an array of generation tasks . 3 EXPERIMENTS . We will first measure performance by fine-tuning on a range of tasks and languages . The next sections report why methods rooted in trust region , including ours , outperform standard fine-tuning . We aimed for fair comparisons throughout all of our experiments by using fixed budget hyperparameters searches across all methods . Furthermore , for computationally tractable tasks , we report median/max numbers as well as show distributions across a large number of runs . 3.1 SENTENCE PREDICTION . GLUE . We will first test R3F and R4F on sentence classification tasks from the GLUE benchmark ( Wang et al. , 2018 ) . We select the same subset of GLUE tasks that have been reported by prior work in this space ( Jiang et al. , 2019 ) : MNLI ( Williams et al. , 2018 ) , QQP ( Iyer et al. , 2017 ) , RTE ( Bentivogli et al. , 2009 ) , QNLI ( Rajpurkar et al. , 2016 ) , MRPC ( Dolan & Brockett , 2005 ) , CoLA ( Warstadt et al. , 2018 ) , SST-2 ( Socher et al. , 2013 ) .1 Consistent with prior work ( Jiang et al. , 2019 ; Zhu et al. , 2019 ) , we focus on improving the performance of RoBERTa-Large based models in the single-task setting ( Liu et al. , 2019 ) . We report the performance of all models on the GLUE development set . Method 5000 6000 7000 8000 9000 Se co nd s SST-2 Walltime Analysis Finetuning Method Standard++ SMART R3F R3F R4F R4F ods across ten seeds to demonstrate the stability properties of individual methods in Figure 2 . R3F and R4F unanimously improve over Standard and Standard++ fine-tuning . Furthermore , our methods match or exceed adversarial methods such as SMART/FreeLB at a fraction of the computational cost when comparing median runs . We show computational cost in Figure 1 for a single task , but the relative behavior of wall times is consistent across all other GLUE tasks . We note that we could not find a discernable difference in the experimental setting , which would make the selection between R3F vs. R4F trivial . 1We do not test against STS-B because it is a regression task where our KL divergence is not defined ( Cer et al. , 2017 ) .
The paper proposes a method for finetuning pre-trained models that ensures the generalization ability of the representation is maintained. The key innovation is that the computationally expensive ascent step in the mirror descent method of SMART can be replaced by simply injecting noise. The results support the hypothesis that this works well for keeping the generalization-ability of the model. The authors also define the degradation of the generalizability of the representation during finetuning as “representational collapse”.
SP:88108abfa920eda1a0766301bdfd70113f61f8b3
Disentangling Action Sequences: Discovering Correlated Samples
1 INTRODUCTION . The basis of artificial intelligence is to understand and reason about the world based on a limited set of observations . Unsupervised disentanglement learning is highly desirable due to its similarity with the way we as human think . For instance , we can infer the movement of a running ball based on a single glance . This is because the human brain is capable of disentangling the positions from a set of images . It has been suggested that a disentangled representation is helpful for a large variety of downstream tasks ( Schölkopf et al. , 2012 ; Peters et al. , 2017 ) . According to Kim & Mnih ( 2018 ) , a disentangled representation promotes interpretable semantic information . That brings substantial advancement , including but not limited to reducing the performance gap between humans and AI approaches ( Lake et al. , 2017 ; Higgins et al. , 2018 ) . Other instances of disentangled representation include semantic image understanding and generation ( Lample et al. , 2017 ; Zhu et al. , 2018 ; Elgammal et al. , 2017 ) , zero-shot learning ( Zhu et al. , 2019 ) , and reinforcement learning ( Higgins et al. , 2017b ) . Despite the advantageous of the disentangling representation approaches , there are still two issues to be addressed including the abstract notion and the weak explanations . Notion The conception of disentangling factors of variation is first proposed in 2013 . It is claimed in Bengio et al . ( 2013 ) that for observations the considered factors should be explanatory and independent of each other . The explanatory factors are however hard to formalize and measure . An alternative way is to disentangle the ground-truth factors ( Ridgeway , 2016 ; Do & Tran , 2020 ) . However , if we consider the uniqueness of the ground-truth factors , a question which arises here is how to discover it from multiple equivalent representations ? As a proverb “ one can not make bricks without straw ” , Locatello et al . ( 2019 ) prove the impossibility of disentangling factors without the help of inductive biases in the unsupervised setting . Explanation There are mainly two types of explanations for unsupervised disentanglement : information bottleneck , and independence assumption . The ground-truth factors affect the data independently , therefore , the disentangled representations must follow the same structure . The approaches , holding the independence assumption , encourage independence between the latent variables ( Schmidhuber , 1992 ; Chen et al. , 2018 ; Kim & Mnih , 2018 ; Kumar et al. , 2018 ; Lopez et al. , 2018 ) . However , the real-world problems have no strict constraint on the independence assumption , and the factors may be correlative . The other explanation incorporates information theory into disentanglement . Burgess et al . ; Higgins et al . ; Insu Jeon et al . ; Saxe et al . suggest that a limit on the capacity of the latent information channel promotes disentanglement by enforcing the model to acquire the most significant latent representation . They further hypothesize that the information bottleneck enforces the model to find the significant improvement . In this paper , we first demonstrate that instead of the ground-truth factors the disentangling approaches learn actions of translating based on the orientation of the images . We then propose the concept of disentangling actions which discover the commonalities between the images and categorizes them into sequences . We treat disentangling action sequences as a necessary step toward disentangling factors , which can capture the internal relationships between the data , and make it possible to analyze the inductive biases from the data perspective . Furthermore , the results on a toy example show that the significance of actions is positively correlated with the threshold of latent information . Then , we promote that conclusion to complex problems . Our contributions are summarized in the following : • We show that the significance of action is related to the capacity of learned latent information , resulting in the different thresholds of factors . • We propose a novel framework , fractional variational autoencoder ( FVAE ) to extracts explanatory action sequences step-by-step , and at each step , it learns specific actions by blocking others ’ information . We organize the rest of this paper as follows . Sec.2 describes the development of unsupervised disentanglement learning and the proposed methods based on VAEs . In Sec.3 , through an example , we show that the disentangled representations are relative to the data itself and further introduce a novel concept , i.e. , disentangling action sequences . Then , we investigate the inductive biases on the data and find that the significant action has a high threshold of latent information . In Sec.4 , we propose a step-bystep disentangling framework , namely fractional VAE ( FVAE ) , to disentangle action sequences . For the labelled and unlabelled tasks , we respectively introduce two methods to measure their thresholds . We then evaluate FVAE on a labelled dataset ( dSprites , Matthey et al . ( 2017 ) ) and an unlabelled dataset ( 3D Chairs , Aubry et al . ( 2014 ) ) . Finally , we conclude the paper and discuss the future work in Sec.5 2 UNSUPERVISED DISENTANGLEMENT LEARNING . We first introduce the abstract concepts and the basic definitions , followed by the explanations based on information theory and other related works . This article focuses on the explanation of information theory and the proposed models based on VAEs . 2.1 THE CONCEPT . Disentanglement learning is fascinating and challenging because of its intrinsic similarity to human intelligence . As depicted in the seminal paper by Bengio et al. , humans can understand and reason from a complex observation to the explanatory factors . A common modeling assumption of disentanglement learning is that the observed data is generated by a set of ground-truth factors . Usually , the data has a high number of dimensions ; hence it is hard to understand , whereas the factors have a low number of dimensions , thus simpler and easier to be understood . The task of disentanglement learning is to uncover the ground-truth factors . Such factors are invisible to the training process in an unsupervised setting . The invisibility of factors makes it hard to define and measure disentanglement ( Do & Tran , 2020 ) . Furthermore , it is shown in Locatello et al . ( 2019 ) that it is impossible to unsupervised disentangle the underlying factors for the arbitrary generative models without inductive biases . In particular , they suggest that the inductive biases on the models and the data should be exploited . However , they do not provide a formal definition of the inductive bias and such a definition is still unavailable . 2.2 INFORMATION BOTTLENECK . Most of the dominant disentangling approaches are the variants of variational autoencoder ( VAE ) . The variational autoencoder ( VAE ) is a popular generative model , assuming that the latent variables obey a specific prior ( normal distribution in practice ) . The key idea of VAE is maximizing the likelihood objective by the following approximation : L ( θ , φ ; x , z ) =Eqφ ( z|x ) [ logpθ ( x|z ) ] −DKL ( qφ ( z|x ) ||p ( z ) ) , ( 1 ) which is known as the evidence lower bound ( ELBO ) ; where the conditional probabilityP ( x|z ) , Q ( z|x ) are parameterized with deep neural networks . Higgins et al . find that the KL term of VAEs encourages disentanglement and introduce a hyperparameter β in front of the KL term . They propose the β-VAE maximizing the following expression : L ( θ , φ ; x , z ) =Eqφ ( z|x ) [ logpθ ( x|z ) ] −βDKL ( qφ ( z|x ) ||p ( z ) ) . ( 2 ) β controls the pressure for the posterior Qφ ( z|x ) to match the factorized unit Gaussian prior p ( z ) . Higher values of β lead to lower implicit capacity of the latent information and ambiguous reconstructions . Burgess et al . propose the Annealed-VAE that progressively increases the information capacity of the latent code while training : L ( θ , φ ; x , z , C ) =Eqφ ( z|x ) [ logpθ ( x|z ) ] −γ|DKL ( qφ ( z|x ) ||p ( z ) ) −C| ( 3 ) where γ is a large enough constant to constrain the latent information , C is a value gradually increased from zero to a large number to produce high reconstruction quality . As the total information bottleneck gradually increasing , they hypothesize that the model will allocate the capacity of the most improvement of the reconstruction log-likelihood to the encoding axes of the corresponding factor . However , they did not exploit why each factor makes different contributions to the reconstruction log-likelihood . 2.3 OTHER RELATED WORK . The other dominant direction initiates from the prior of factors . They assume that the ground-truth factors are independent of each other , and a series of methods enforce the latent variables have the same structure as the factors . FactorVAE ( Kim & Mnih , 2018 ) applies a discriminator to approximately calculate the total correlation ( TC , Watanabe ( 1960 ) ) ; β-TCVAE ( Chen et al. , 2018 ) promotes the TC penelty by decomposing the KL term ; DIP-VAE ( Kumar et al. , 2018 ) identifies the covariance matrix of q ( z ) . 3 DISENTANGLING ACTION SEQUENCES . For machines and humans , disentangling the underlying factors is a challenging task . For instance , there are more than 1,400 breeds of dogs in the world , and it seems impossible for an ordinary person to distinguish all of them just by looking at their pictures . The challenge in disentangling the underlying factors is mainly due to the complexity of establishing relationships without supervision , where the corresponding models should contain some level of prior knowledge or inductive biases . However , it is possible to determine the differences without having extensive knowledge . For example , one may mistakenly identify the breed of a dog by looking at a picture but is almost impossible to misrecognize a dog as a cat . Therefore , in practice , discovering the differences or similarities is often a much easier task than that of uncovering the underlying factors , and it does not also need much prior knowledge . One may conclude that discovering the commonalities between things is an important step toward disentanglement . 3.1 ACTION SEQUENCES . Action The continuous set of images over a certain direction . The observed data consists of a set of actions such as rotation , translation , and scaling . Such actions are meaningful and underlying . Therefore , the goal of disentanglement learning is to separate the underlying actions of observation . Usually , the continuous actions are infeasible for the machine learning system , and we have to convert them into some discrete and consistent sequences . Given a dataset S , we assume it consists of parameterized action sequences , and each action sequence is a subset of the dataset . We can model a parameterized action sequence as : Si ( mj , j 6=i ) =Tmj , j 6=i ( { t } ) , ( 4 ) where Si∈S denotes an action sequence , i denotes the type of actions , m denotes a parameter vector , T denotes a transformation , t denotes the step of the action . The procedure is similar to the latent traversal in Higgins et al . ( 2017a ) . Differently , action sequences describe both the real observed data and the reconstructed data : For the real observed data , m is the ground-truth factor vector , and T is the generating function ; For the reconstructed data , m is the latent variable vector , andT is a neural network . For clarity , we denote generating actions as sequences of images controlled by the ground-truth factors and action sequences as the approximation of these actions generated by a neural network . However , the neural networks are flexible enough to approximate any actions , and it ’ s tricky to infer and learn the generating actions . The marvelous thing about disentanglement learning is that the models seem to learn these actions unsupervisedly . A popular view of disentanglement believes the ground-truth factors should be separated into independent latent variables Locatello et al . ( 2019 ) ; Chen et al . ( 2018 ) . That means the learned action sequences have to match the generating actions precisely . However , ( Rolinek et al. , 2019 ) shows that the VAEs conduct a PCA-like behavior , and the models prefer to extract the principal component . Hence , the models may select some action sequences having more considerable variations and learn the significant action sequences rather than the generating actions . Using VAEs , minimizing the objective increases the overlap between the posterior distributions across the dataset Burgess et al . ( 2018 ) , and it then leads to the learned action sequences showing some internal relationships . Although ( Locatello et al. , 2019 ) suggest that the inductive biases on the models and the data should be exploited , the current researches focus on the role of the models on disentanglement Burgess et al . ( 2018 ) ; Chen et al . ( 2018 ) ; Rolinek et al . ( 2019 ) .
In this submission, a common modelling assumption for unsupervised disentanglement is challenged: that the disentangled representation follows the independence structure of the underlying (data generating) factors. Instead, the paper proposes to consider *action sequences* which describe how datapoints are interrelated. The paper provides evidence that the capacity of the latent representation (controlled by Lagrange parameter beta in beta-VAE related models) is related to the significance of particular action sequence for disentanglement. To leverage this insight, the fractional VAE (FVAE) is proposed, consisting of several sub-encoders and different training stages. The disentangling properties of the FVAE is demonstrated on the dSprites and 3D chairs datasets, with the FVAE performing favourably to the beta-VAE w.r.t. the Mutual Information Gap (MIG) disentanglement metric on dSprites.
SP:be719de25d3d60635a9508fd610f2da3f4fd164d
Disentangling Action Sequences: Discovering Correlated Samples
1 INTRODUCTION . The basis of artificial intelligence is to understand and reason about the world based on a limited set of observations . Unsupervised disentanglement learning is highly desirable due to its similarity with the way we as human think . For instance , we can infer the movement of a running ball based on a single glance . This is because the human brain is capable of disentangling the positions from a set of images . It has been suggested that a disentangled representation is helpful for a large variety of downstream tasks ( Schölkopf et al. , 2012 ; Peters et al. , 2017 ) . According to Kim & Mnih ( 2018 ) , a disentangled representation promotes interpretable semantic information . That brings substantial advancement , including but not limited to reducing the performance gap between humans and AI approaches ( Lake et al. , 2017 ; Higgins et al. , 2018 ) . Other instances of disentangled representation include semantic image understanding and generation ( Lample et al. , 2017 ; Zhu et al. , 2018 ; Elgammal et al. , 2017 ) , zero-shot learning ( Zhu et al. , 2019 ) , and reinforcement learning ( Higgins et al. , 2017b ) . Despite the advantageous of the disentangling representation approaches , there are still two issues to be addressed including the abstract notion and the weak explanations . Notion The conception of disentangling factors of variation is first proposed in 2013 . It is claimed in Bengio et al . ( 2013 ) that for observations the considered factors should be explanatory and independent of each other . The explanatory factors are however hard to formalize and measure . An alternative way is to disentangle the ground-truth factors ( Ridgeway , 2016 ; Do & Tran , 2020 ) . However , if we consider the uniqueness of the ground-truth factors , a question which arises here is how to discover it from multiple equivalent representations ? As a proverb “ one can not make bricks without straw ” , Locatello et al . ( 2019 ) prove the impossibility of disentangling factors without the help of inductive biases in the unsupervised setting . Explanation There are mainly two types of explanations for unsupervised disentanglement : information bottleneck , and independence assumption . The ground-truth factors affect the data independently , therefore , the disentangled representations must follow the same structure . The approaches , holding the independence assumption , encourage independence between the latent variables ( Schmidhuber , 1992 ; Chen et al. , 2018 ; Kim & Mnih , 2018 ; Kumar et al. , 2018 ; Lopez et al. , 2018 ) . However , the real-world problems have no strict constraint on the independence assumption , and the factors may be correlative . The other explanation incorporates information theory into disentanglement . Burgess et al . ; Higgins et al . ; Insu Jeon et al . ; Saxe et al . suggest that a limit on the capacity of the latent information channel promotes disentanglement by enforcing the model to acquire the most significant latent representation . They further hypothesize that the information bottleneck enforces the model to find the significant improvement . In this paper , we first demonstrate that instead of the ground-truth factors the disentangling approaches learn actions of translating based on the orientation of the images . We then propose the concept of disentangling actions which discover the commonalities between the images and categorizes them into sequences . We treat disentangling action sequences as a necessary step toward disentangling factors , which can capture the internal relationships between the data , and make it possible to analyze the inductive biases from the data perspective . Furthermore , the results on a toy example show that the significance of actions is positively correlated with the threshold of latent information . Then , we promote that conclusion to complex problems . Our contributions are summarized in the following : • We show that the significance of action is related to the capacity of learned latent information , resulting in the different thresholds of factors . • We propose a novel framework , fractional variational autoencoder ( FVAE ) to extracts explanatory action sequences step-by-step , and at each step , it learns specific actions by blocking others ’ information . We organize the rest of this paper as follows . Sec.2 describes the development of unsupervised disentanglement learning and the proposed methods based on VAEs . In Sec.3 , through an example , we show that the disentangled representations are relative to the data itself and further introduce a novel concept , i.e. , disentangling action sequences . Then , we investigate the inductive biases on the data and find that the significant action has a high threshold of latent information . In Sec.4 , we propose a step-bystep disentangling framework , namely fractional VAE ( FVAE ) , to disentangle action sequences . For the labelled and unlabelled tasks , we respectively introduce two methods to measure their thresholds . We then evaluate FVAE on a labelled dataset ( dSprites , Matthey et al . ( 2017 ) ) and an unlabelled dataset ( 3D Chairs , Aubry et al . ( 2014 ) ) . Finally , we conclude the paper and discuss the future work in Sec.5 2 UNSUPERVISED DISENTANGLEMENT LEARNING . We first introduce the abstract concepts and the basic definitions , followed by the explanations based on information theory and other related works . This article focuses on the explanation of information theory and the proposed models based on VAEs . 2.1 THE CONCEPT . Disentanglement learning is fascinating and challenging because of its intrinsic similarity to human intelligence . As depicted in the seminal paper by Bengio et al. , humans can understand and reason from a complex observation to the explanatory factors . A common modeling assumption of disentanglement learning is that the observed data is generated by a set of ground-truth factors . Usually , the data has a high number of dimensions ; hence it is hard to understand , whereas the factors have a low number of dimensions , thus simpler and easier to be understood . The task of disentanglement learning is to uncover the ground-truth factors . Such factors are invisible to the training process in an unsupervised setting . The invisibility of factors makes it hard to define and measure disentanglement ( Do & Tran , 2020 ) . Furthermore , it is shown in Locatello et al . ( 2019 ) that it is impossible to unsupervised disentangle the underlying factors for the arbitrary generative models without inductive biases . In particular , they suggest that the inductive biases on the models and the data should be exploited . However , they do not provide a formal definition of the inductive bias and such a definition is still unavailable . 2.2 INFORMATION BOTTLENECK . Most of the dominant disentangling approaches are the variants of variational autoencoder ( VAE ) . The variational autoencoder ( VAE ) is a popular generative model , assuming that the latent variables obey a specific prior ( normal distribution in practice ) . The key idea of VAE is maximizing the likelihood objective by the following approximation : L ( θ , φ ; x , z ) =Eqφ ( z|x ) [ logpθ ( x|z ) ] −DKL ( qφ ( z|x ) ||p ( z ) ) , ( 1 ) which is known as the evidence lower bound ( ELBO ) ; where the conditional probabilityP ( x|z ) , Q ( z|x ) are parameterized with deep neural networks . Higgins et al . find that the KL term of VAEs encourages disentanglement and introduce a hyperparameter β in front of the KL term . They propose the β-VAE maximizing the following expression : L ( θ , φ ; x , z ) =Eqφ ( z|x ) [ logpθ ( x|z ) ] −βDKL ( qφ ( z|x ) ||p ( z ) ) . ( 2 ) β controls the pressure for the posterior Qφ ( z|x ) to match the factorized unit Gaussian prior p ( z ) . Higher values of β lead to lower implicit capacity of the latent information and ambiguous reconstructions . Burgess et al . propose the Annealed-VAE that progressively increases the information capacity of the latent code while training : L ( θ , φ ; x , z , C ) =Eqφ ( z|x ) [ logpθ ( x|z ) ] −γ|DKL ( qφ ( z|x ) ||p ( z ) ) −C| ( 3 ) where γ is a large enough constant to constrain the latent information , C is a value gradually increased from zero to a large number to produce high reconstruction quality . As the total information bottleneck gradually increasing , they hypothesize that the model will allocate the capacity of the most improvement of the reconstruction log-likelihood to the encoding axes of the corresponding factor . However , they did not exploit why each factor makes different contributions to the reconstruction log-likelihood . 2.3 OTHER RELATED WORK . The other dominant direction initiates from the prior of factors . They assume that the ground-truth factors are independent of each other , and a series of methods enforce the latent variables have the same structure as the factors . FactorVAE ( Kim & Mnih , 2018 ) applies a discriminator to approximately calculate the total correlation ( TC , Watanabe ( 1960 ) ) ; β-TCVAE ( Chen et al. , 2018 ) promotes the TC penelty by decomposing the KL term ; DIP-VAE ( Kumar et al. , 2018 ) identifies the covariance matrix of q ( z ) . 3 DISENTANGLING ACTION SEQUENCES . For machines and humans , disentangling the underlying factors is a challenging task . For instance , there are more than 1,400 breeds of dogs in the world , and it seems impossible for an ordinary person to distinguish all of them just by looking at their pictures . The challenge in disentangling the underlying factors is mainly due to the complexity of establishing relationships without supervision , where the corresponding models should contain some level of prior knowledge or inductive biases . However , it is possible to determine the differences without having extensive knowledge . For example , one may mistakenly identify the breed of a dog by looking at a picture but is almost impossible to misrecognize a dog as a cat . Therefore , in practice , discovering the differences or similarities is often a much easier task than that of uncovering the underlying factors , and it does not also need much prior knowledge . One may conclude that discovering the commonalities between things is an important step toward disentanglement . 3.1 ACTION SEQUENCES . Action The continuous set of images over a certain direction . The observed data consists of a set of actions such as rotation , translation , and scaling . Such actions are meaningful and underlying . Therefore , the goal of disentanglement learning is to separate the underlying actions of observation . Usually , the continuous actions are infeasible for the machine learning system , and we have to convert them into some discrete and consistent sequences . Given a dataset S , we assume it consists of parameterized action sequences , and each action sequence is a subset of the dataset . We can model a parameterized action sequence as : Si ( mj , j 6=i ) =Tmj , j 6=i ( { t } ) , ( 4 ) where Si∈S denotes an action sequence , i denotes the type of actions , m denotes a parameter vector , T denotes a transformation , t denotes the step of the action . The procedure is similar to the latent traversal in Higgins et al . ( 2017a ) . Differently , action sequences describe both the real observed data and the reconstructed data : For the real observed data , m is the ground-truth factor vector , and T is the generating function ; For the reconstructed data , m is the latent variable vector , andT is a neural network . For clarity , we denote generating actions as sequences of images controlled by the ground-truth factors and action sequences as the approximation of these actions generated by a neural network . However , the neural networks are flexible enough to approximate any actions , and it ’ s tricky to infer and learn the generating actions . The marvelous thing about disentanglement learning is that the models seem to learn these actions unsupervisedly . A popular view of disentanglement believes the ground-truth factors should be separated into independent latent variables Locatello et al . ( 2019 ) ; Chen et al . ( 2018 ) . That means the learned action sequences have to match the generating actions precisely . However , ( Rolinek et al. , 2019 ) shows that the VAEs conduct a PCA-like behavior , and the models prefer to extract the principal component . Hence , the models may select some action sequences having more considerable variations and learn the significant action sequences rather than the generating actions . Using VAEs , minimizing the objective increases the overlap between the posterior distributions across the dataset Burgess et al . ( 2018 ) , and it then leads to the learned action sequences showing some internal relationships . Although ( Locatello et al. , 2019 ) suggest that the inductive biases on the models and the data should be exploited , the current researches focus on the role of the models on disentanglement Burgess et al . ( 2018 ) ; Chen et al . ( 2018 ) ; Rolinek et al . ( 2019 ) .
This paper addresses the problem of disentangling representations using Variational Autoencoders. In particular, the authors introduce the concept of disentangling action sequences and propose the fractional variational autoencoder framework to disentangle them step-by-step. To this end, they analyze the inductive biases on the data and define latent information thresholds which are correlated with the significance of the actions.
SP:be719de25d3d60635a9508fd610f2da3f4fd164d
Meta-Model-Based Meta-Policy Optimization
Model-based reinforcement learning ( MBRL ) has been applied to meta-learning settings and has demonstrated its high sample efficiency . However , in previous MBRL for meta-learning settings , policies are optimized via rollouts that fully rely on a predictive model of an environment . Thus , its performance in a real environment tends to degrade when the predictive model is inaccurate . In this paper , we prove that performance degradation can be suppressed by using branched meta-rollouts . On the basis of this theoretical analysis , we propose Meta-Modelbased Meta-Policy Optimization ( M3PO ) , in which the branched meta-rollouts are used for policy optimization . We demonstrate that M3PO outperforms existing meta reinforcement learning methods in continuous-control benchmarks . 1 INTRODUCTION . Reinforcement learning ( RL ) methods have achieved remarkable success in many decision-making tasks , such as playing video games or controlling robots ( e.g. , Gu et al . ( 2017 ) ; Mnih et al . ( 2015 ) ) . In conventional RL methods , when multiple tasks are to be solved , a policy is independently learned for individual tasks . In general , each learning requires millions of training samples from the environment . This independent learning with a large number of samples prevents conventional RL methods from being applied to practical multi-task problems ( e.g. , robotic manipulation problems involving grasping or moving different types of objects ( Yu et al. , 2019 ) ) . Meta-learning methods ( Schmidhuber et al. , 1996 ; Thrun & Pratt , 1998 ) have recently gained much attention as a promising solution to this problem ( Finn et al. , 2017 ) . They learn a structure shared in the tasks by using a large number of samples collected across the parts of the tasks . Once learned , these methods can adapt quickly to new ( or the rest of the ) tasks with a small number of samples given . Meta-RL methods have previously been introduced into both model-free and model-based settings . For model-free settings , there are two main types of approaches proposed so far , recurrent-based policy adaptation ( Duan et al. , 2017 ; Mishra et al. , 2018 ; Rakelly et al. , 2019 ; Wang et al. , 2016 ) and gradient-based policy adaptation ( Al-Shedivat et al. , 2018 ; Finn & Levine , 2018 ; Finn et al. , 2017 ; Gupta et al. , 2018 ; Rothfuss et al. , 2019 ; Stadie et al. , 2018 ) . In these approaches , policies adapt to a new task by leveraging the history of past trajectories . Following previous work ( Clavera et al. , 2018 ) , we refer to these adaptive policies as meta-policies in our paper . In these modelfree meta-RL methods , in addition to learning control policies , the learning of policy adaptation is also required ( Mendonca et al. , 2019 ) . Thus , these methods require more training samples than conventional RL methods . For model-based settings , there have been relatively few approaches proposed so far . Sæmundsson et al . ( 2018 ) and Perez et al . ( 2020 ) use a predictive model ( i.e. , a transition model ) conditioned by a latent variable for model predictive control . Nagabandi et al . ( 2019a ; b ) introduced both recurrentbased and gradient-based meta-learning methods into model-based RL . In these approaches , the predictive models adapt to a new task by leveraging the history of past trajectories . In analogy to the meta-policy , we refer to these adaptive predictive models as meta-models in our paper . Generally , these model-based meta-RL approaches are more sample efficient than the model-free approaches . However , in these approaches , the meta-policy ( or the course of actions ) is optimized via rollouts relying fully on the meta-model . Thus , its performance in a real environment tends to degrade when the meta-model is inaccurate . In this paper , we address this performance degradation problem in model-based meta-RL . After reviewing related work ( Section 2 ) and preliminaries ( Section 3 ) , we present our work by first formulating model-based meta-RL ( Section 4 ) . Model-based ( and model-free ) meta-RL settings have typically been formulated as special cases of solving partially observable Markov decision processes ( POMDPs ) ( e.g. , Duan et al . ( 2017 ) ; Killian et al . ( 2017 ) ; Perez et al . ( 2020 ) ) . In these special cases , specific assumptions , such as intra-episode task invariance , are additionally introduced . However , there are model-based meta-RL settings where such assumptions do not hold ( e.g. , Nagabandi et al . ( 2019a ; b ) ) . To include these settings into our scope , we formulate model-based meta-RL settings as solving POMDPs without introducing such additional assumptions . Then , we conduct theoretical analysis on its performance guarantee ( Section 5 ) . We first analyse the performance guarantee in full meta-model-based rollouts , which most of the previous model-based metaRL methods hold . We then introduce the notion of branched meta-rollouts . Branched meta-rollouts are Dyna-style rollouts ( Sutton , 1991 ) in which we can adjust the reliance on the meta-model and real environment data . We show that the performance degradation due to the meta-model error in the branched meta-rollouts is smaller than that in the full meta-model-based rollouts . On the basis of this theoretical analysis , we propose a practical model-based meta-RL method called Meta-Model-based Meta-Policy Optimization ( M3PO ) where the meta-model is used in the branched rollout manner ( Section 6 ) . Finally , we experimentally demonstrate that M3PO outperforms existing methods in continuous-control benchmarks ( Section 7 ) . We make the following contributions in both theoretical and empirical frontiers . Theoretical frontier : 1 . Our work is the first attempt to provide a theoretical relation between learning the metamodel and the real environment performance . In the aforementioned model-based meta-RL literature , it has not been clear how learning the meta-model relates to real environment performance . Our theoretical analysis provides relations between them ( Theorems 1 , 2 and 3 ) . This result theoretically justifies meta-training a good transition model to improve overall performance in the real environment . 2 . Our analysis also reveals that the use of branched meta-rollouts can suppress performance degradation due to meta-model errors . 3 . We refine previous fundamental theories proposed by Janner et al . ( 2019 ) to consider important premises more properly ( Theorems 4 and 5 ) . This modification is important to strictly guarantee the performance especially when the model-rollout length is long . Empirical frontier : We propose and show the effectiveness of M3PO . Notably , we show that M3PO achieves better sample efficiency than existing meta-RL methods in complex tasks , such as controlling humanoids . 2 RELATED WORK . In this section , we review related work on POMDPs and theoretical analysis in model-based RL . Partially observable Markov decision processes 1 : In our paper , we formulate model-based metaRL as solving POMDPs , and provide its performance guarantee under the branched meta-rollout scheme . POMDPs are a long-studied problem ( e.g. , ( Ghavamzadeh et al. , 2015 ; Sun , 2019 ; Sun et al. , 2019 ) ) , and many works have discussed a performance guarantee of RL methods to solve POMDPs . However , the performance guarantee of the RL methods based on branched meta-rollouts has not been discussed in the literature . On the other hand , a number of researchers ( Igl et al. , 2018 ; Lee et al. , 2019 ; Zintgraf et al. , 2020 ) have proposed model-free RL methods to solve a POMDP without prior knowledge of the accurate model . However , they do not provide theoretical analyses of performance . In this work , by contrast , we propose a model-based meta-RL method and provide theoretical analyses on its performance guarantee . Theoretical analysis on the performance of model-based RL : Several theoretical analyses on the performance of model-based RL have been provided in previous work ( Feinberg et al. , 2018 ; Henaff , 2019 ; Janner et al. , 2019 ; Luo et al. , 2018 ; Rajeswaran et al. , 2020 ) . In these theoretical analyses , standard Markov decision processes ( MDPs ) are assumed , and the meta-learning ( or POMDP ) setting is not discussed . In contrast , our work provides a theoretical analysis on the meta-learning ( and POMDP ) setting , by substantially extending the work of Janner et al . ( 2019 ) . Specifically , Janner et al . ( 2019 ) analysed the performance guarantee of branched rollouts on MDPs , and introduced branched rollouts into a model-based RL algorithm . We extend their analysis and algorithm to a meta-learning ( POMDP ) case . In addition , we modify their theorems so that important premises 1We include works on Bayes-adaptive MDPs ( Ghavamzadeh et al. , 2015 ; Zintgraf et al. , 2020 ) because they are a special case of POMDPs . ( e.g. , the effect of multiple-model rollout factors ) are more properly considered . See A.1 in the appendix for a more detailed discussion of our contribution . 3 PRELIMINARIES . Meta reinforcement learning : We assume online adaptation situations ( Nagabandi et al. , 2019a ; b ) where the agent can leverage a few samples to adapt to a new task . Here , a task specifies the transition probability and the reward function . Information about task identity can not be observed by the agent , and the task may change at any step in an episode . A meta-RL process is composed of meta-training and meta-testing . In meta-training , a policy and a predictive model that are prepared for efficient adaptation are learned with a meta-training task set . In meta-testing , on the basis of the meta-training result , the policy and the predictive model adapt to a new task . For the adaptation , the trajectory observed from the beginning of the episode to the current time step is leveraged . As we noted earlier , we call an adaptive policy and a predictive model of this sort a meta-policy and a meta-model , respectively . Partially observable Markov decision processes : We formalize our problem with a POMDP , which is defined as a tuple 〈O , S , A , pob , r , γ , pst〉 . Here , O is a set of observations , S is a set of hidden states , A is a set of actions , pob : = O × S × A → [ 0 , 1 ] is the observation probability , pst : = S × S × A → [ 0 , 1 ] is the state transition probability , r : S × A → R is a reward function and γ ∈ [ 0 , 1 ) is a discount factor . At time step t , these functions are used as pst ( st|st−1 , at−1 ) , pob ( ot|st , at−1 ) 2 and rt = r ( st , at ) . The agent can not directly observe the hidden state , but receives the observation instead . The agent selects an action on the basis of a policy π : = p ( at+1|ht ) . Here , ht is a history ( the past trajectories ) defined as ht : = { a0 , o0 , ... , at , ot } . We denote the set of the histories by H. Given the definition of the history , the history transition probability can be defined as p ( ht+1|at+1 , ht ) : = p ( ot+1|ht ) . Here , p ( ot+1|ht ) : = ∑ st+1 ∑ st p ( st|ht ) p ( st+1|st , at ) p ( ot+1|st+1 , at ) , where p ( st|ht ) is the belief about the hidden state . The goal of RL in the POMDP is to find the optimal policy π∗ that maximizes the expected return R : = ∑∞ t=0 γ trt ( i.e. , π∗ = arg max π Ea∼π , h∼p [ R ] ) .
The paper concerns model-based meta-RL. It exploits the fact that meta-RL can be formulated as POMDP in which the task indicator is part of the (unobserved) hidden state. Thus, the paper effectively analyzes and proposes model-based algorithms for POMDPs. The paper bounds the gap between the expected reward of a policy in the actual POMDP and the estimated model and then theoretically shows that this gap can be reduced when using dyna-style / branched rollouts instead of full rollouts under the learned model. Motivated by this finding, the paper proposes a Dyna-like algorithm for POMDPs. In the experimental evaluation, the paper compares its proposed method, M3PO, to two recent meta-RL approaches in a range of meta-RL environments for continuous control.
SP:ad4ab0f3fa32fd60cf01ee69259206d6d6f4ed22
Meta-Model-Based Meta-Policy Optimization
Model-based reinforcement learning ( MBRL ) has been applied to meta-learning settings and has demonstrated its high sample efficiency . However , in previous MBRL for meta-learning settings , policies are optimized via rollouts that fully rely on a predictive model of an environment . Thus , its performance in a real environment tends to degrade when the predictive model is inaccurate . In this paper , we prove that performance degradation can be suppressed by using branched meta-rollouts . On the basis of this theoretical analysis , we propose Meta-Modelbased Meta-Policy Optimization ( M3PO ) , in which the branched meta-rollouts are used for policy optimization . We demonstrate that M3PO outperforms existing meta reinforcement learning methods in continuous-control benchmarks . 1 INTRODUCTION . Reinforcement learning ( RL ) methods have achieved remarkable success in many decision-making tasks , such as playing video games or controlling robots ( e.g. , Gu et al . ( 2017 ) ; Mnih et al . ( 2015 ) ) . In conventional RL methods , when multiple tasks are to be solved , a policy is independently learned for individual tasks . In general , each learning requires millions of training samples from the environment . This independent learning with a large number of samples prevents conventional RL methods from being applied to practical multi-task problems ( e.g. , robotic manipulation problems involving grasping or moving different types of objects ( Yu et al. , 2019 ) ) . Meta-learning methods ( Schmidhuber et al. , 1996 ; Thrun & Pratt , 1998 ) have recently gained much attention as a promising solution to this problem ( Finn et al. , 2017 ) . They learn a structure shared in the tasks by using a large number of samples collected across the parts of the tasks . Once learned , these methods can adapt quickly to new ( or the rest of the ) tasks with a small number of samples given . Meta-RL methods have previously been introduced into both model-free and model-based settings . For model-free settings , there are two main types of approaches proposed so far , recurrent-based policy adaptation ( Duan et al. , 2017 ; Mishra et al. , 2018 ; Rakelly et al. , 2019 ; Wang et al. , 2016 ) and gradient-based policy adaptation ( Al-Shedivat et al. , 2018 ; Finn & Levine , 2018 ; Finn et al. , 2017 ; Gupta et al. , 2018 ; Rothfuss et al. , 2019 ; Stadie et al. , 2018 ) . In these approaches , policies adapt to a new task by leveraging the history of past trajectories . Following previous work ( Clavera et al. , 2018 ) , we refer to these adaptive policies as meta-policies in our paper . In these modelfree meta-RL methods , in addition to learning control policies , the learning of policy adaptation is also required ( Mendonca et al. , 2019 ) . Thus , these methods require more training samples than conventional RL methods . For model-based settings , there have been relatively few approaches proposed so far . Sæmundsson et al . ( 2018 ) and Perez et al . ( 2020 ) use a predictive model ( i.e. , a transition model ) conditioned by a latent variable for model predictive control . Nagabandi et al . ( 2019a ; b ) introduced both recurrentbased and gradient-based meta-learning methods into model-based RL . In these approaches , the predictive models adapt to a new task by leveraging the history of past trajectories . In analogy to the meta-policy , we refer to these adaptive predictive models as meta-models in our paper . Generally , these model-based meta-RL approaches are more sample efficient than the model-free approaches . However , in these approaches , the meta-policy ( or the course of actions ) is optimized via rollouts relying fully on the meta-model . Thus , its performance in a real environment tends to degrade when the meta-model is inaccurate . In this paper , we address this performance degradation problem in model-based meta-RL . After reviewing related work ( Section 2 ) and preliminaries ( Section 3 ) , we present our work by first formulating model-based meta-RL ( Section 4 ) . Model-based ( and model-free ) meta-RL settings have typically been formulated as special cases of solving partially observable Markov decision processes ( POMDPs ) ( e.g. , Duan et al . ( 2017 ) ; Killian et al . ( 2017 ) ; Perez et al . ( 2020 ) ) . In these special cases , specific assumptions , such as intra-episode task invariance , are additionally introduced . However , there are model-based meta-RL settings where such assumptions do not hold ( e.g. , Nagabandi et al . ( 2019a ; b ) ) . To include these settings into our scope , we formulate model-based meta-RL settings as solving POMDPs without introducing such additional assumptions . Then , we conduct theoretical analysis on its performance guarantee ( Section 5 ) . We first analyse the performance guarantee in full meta-model-based rollouts , which most of the previous model-based metaRL methods hold . We then introduce the notion of branched meta-rollouts . Branched meta-rollouts are Dyna-style rollouts ( Sutton , 1991 ) in which we can adjust the reliance on the meta-model and real environment data . We show that the performance degradation due to the meta-model error in the branched meta-rollouts is smaller than that in the full meta-model-based rollouts . On the basis of this theoretical analysis , we propose a practical model-based meta-RL method called Meta-Model-based Meta-Policy Optimization ( M3PO ) where the meta-model is used in the branched rollout manner ( Section 6 ) . Finally , we experimentally demonstrate that M3PO outperforms existing methods in continuous-control benchmarks ( Section 7 ) . We make the following contributions in both theoretical and empirical frontiers . Theoretical frontier : 1 . Our work is the first attempt to provide a theoretical relation between learning the metamodel and the real environment performance . In the aforementioned model-based meta-RL literature , it has not been clear how learning the meta-model relates to real environment performance . Our theoretical analysis provides relations between them ( Theorems 1 , 2 and 3 ) . This result theoretically justifies meta-training a good transition model to improve overall performance in the real environment . 2 . Our analysis also reveals that the use of branched meta-rollouts can suppress performance degradation due to meta-model errors . 3 . We refine previous fundamental theories proposed by Janner et al . ( 2019 ) to consider important premises more properly ( Theorems 4 and 5 ) . This modification is important to strictly guarantee the performance especially when the model-rollout length is long . Empirical frontier : We propose and show the effectiveness of M3PO . Notably , we show that M3PO achieves better sample efficiency than existing meta-RL methods in complex tasks , such as controlling humanoids . 2 RELATED WORK . In this section , we review related work on POMDPs and theoretical analysis in model-based RL . Partially observable Markov decision processes 1 : In our paper , we formulate model-based metaRL as solving POMDPs , and provide its performance guarantee under the branched meta-rollout scheme . POMDPs are a long-studied problem ( e.g. , ( Ghavamzadeh et al. , 2015 ; Sun , 2019 ; Sun et al. , 2019 ) ) , and many works have discussed a performance guarantee of RL methods to solve POMDPs . However , the performance guarantee of the RL methods based on branched meta-rollouts has not been discussed in the literature . On the other hand , a number of researchers ( Igl et al. , 2018 ; Lee et al. , 2019 ; Zintgraf et al. , 2020 ) have proposed model-free RL methods to solve a POMDP without prior knowledge of the accurate model . However , they do not provide theoretical analyses of performance . In this work , by contrast , we propose a model-based meta-RL method and provide theoretical analyses on its performance guarantee . Theoretical analysis on the performance of model-based RL : Several theoretical analyses on the performance of model-based RL have been provided in previous work ( Feinberg et al. , 2018 ; Henaff , 2019 ; Janner et al. , 2019 ; Luo et al. , 2018 ; Rajeswaran et al. , 2020 ) . In these theoretical analyses , standard Markov decision processes ( MDPs ) are assumed , and the meta-learning ( or POMDP ) setting is not discussed . In contrast , our work provides a theoretical analysis on the meta-learning ( and POMDP ) setting , by substantially extending the work of Janner et al . ( 2019 ) . Specifically , Janner et al . ( 2019 ) analysed the performance guarantee of branched rollouts on MDPs , and introduced branched rollouts into a model-based RL algorithm . We extend their analysis and algorithm to a meta-learning ( POMDP ) case . In addition , we modify their theorems so that important premises 1We include works on Bayes-adaptive MDPs ( Ghavamzadeh et al. , 2015 ; Zintgraf et al. , 2020 ) because they are a special case of POMDPs . ( e.g. , the effect of multiple-model rollout factors ) are more properly considered . See A.1 in the appendix for a more detailed discussion of our contribution . 3 PRELIMINARIES . Meta reinforcement learning : We assume online adaptation situations ( Nagabandi et al. , 2019a ; b ) where the agent can leverage a few samples to adapt to a new task . Here , a task specifies the transition probability and the reward function . Information about task identity can not be observed by the agent , and the task may change at any step in an episode . A meta-RL process is composed of meta-training and meta-testing . In meta-training , a policy and a predictive model that are prepared for efficient adaptation are learned with a meta-training task set . In meta-testing , on the basis of the meta-training result , the policy and the predictive model adapt to a new task . For the adaptation , the trajectory observed from the beginning of the episode to the current time step is leveraged . As we noted earlier , we call an adaptive policy and a predictive model of this sort a meta-policy and a meta-model , respectively . Partially observable Markov decision processes : We formalize our problem with a POMDP , which is defined as a tuple 〈O , S , A , pob , r , γ , pst〉 . Here , O is a set of observations , S is a set of hidden states , A is a set of actions , pob : = O × S × A → [ 0 , 1 ] is the observation probability , pst : = S × S × A → [ 0 , 1 ] is the state transition probability , r : S × A → R is a reward function and γ ∈ [ 0 , 1 ) is a discount factor . At time step t , these functions are used as pst ( st|st−1 , at−1 ) , pob ( ot|st , at−1 ) 2 and rt = r ( st , at ) . The agent can not directly observe the hidden state , but receives the observation instead . The agent selects an action on the basis of a policy π : = p ( at+1|ht ) . Here , ht is a history ( the past trajectories ) defined as ht : = { a0 , o0 , ... , at , ot } . We denote the set of the histories by H. Given the definition of the history , the history transition probability can be defined as p ( ht+1|at+1 , ht ) : = p ( ot+1|ht ) . Here , p ( ot+1|ht ) : = ∑ st+1 ∑ st p ( st|ht ) p ( st+1|st , at ) p ( ot+1|st+1 , at ) , where p ( st|ht ) is the belief about the hidden state . The goal of RL in the POMDP is to find the optimal policy π∗ that maximizes the expected return R : = ∑∞ t=0 γ trt ( i.e. , π∗ = arg max π Ea∼π , h∼p [ R ] ) .
This paper focus on model-based RL on a POMDP setting (they call it "meta RL"), where the policy and model need to infer the current hidden state according to history. It provides a theoretical relation between true environment returns and the returns from learned models in a POMDP setting. And it also provides a practical algorithm called M3PO and shows this algorithm is more sample efficient than some meta-RL baselines in some continuous control tasks.
SP:ad4ab0f3fa32fd60cf01ee69259206d6d6f4ed22
Does enhanced shape bias improve neural network robustness to common corruptions?
1 INTRODUCTION . As deep learning is increasingly applied to open-world perception problems in safety-critical domains such as robotics and autonomous driving , its robustness properties become of paramount importance . Generally , a lack of robustness against adversarial examples has been observed ( Szegedy et al. , 2014 ; Goodfellow et al. , 2015 ) , making physical-world adversarial attacks on perception systems feasible ( Kurakin et al. , 2017 ; Eykholt et al. , 2018 ; Lee & Kolter , 2019 ) . In this work , we focus on a different kind of robustness : namely , robustness against naturally occurring common image corruptions . Robustness of image classifiers against such corruptions can be evaluated using the ImageNet-C benchmark ( Hendrycks & Dietterich , 2019 ) , in which corruptions such as noise , blur , weather effects , and digital image transformations are simulated . Hendrycks & Dietterich ( 2019 ) observed that recent advances in neural architectures increased performance on undistorted data without significant increase in relative corruption robustness . One hypothesis for the lack of robustness is an over-reliance on non-robust features that generalize well within the distribution used for training but fail to generalize to out-of-distribution data . Ilyas ∗Equal contribution . et al . ( 2019 ) provide evidence for this hypothesis on adversarial examples . Similarly , it has been hypothesized that models which rely strongly on texture information are more vulnerable to common corruptions than models based on features encoding shape information ( Geirhos et al. , 2019 ; Hendrycks & Dietterich , 2019 ) . Alternative methods for increasing corruption robustness not motivated by enhancing shape bias use more ( potentially unlabeled ) training data ( Xie et al. , 2019 ) or use stronger data augmentation ( Lopes et al. , 2019 ; Hendrycks * et al. , 2020 ) . Note that our meaning of “ shape ” & “ texture ” is built on the definitions by Geirhos et al . ( 2019 ) . In this paper , we re-examine the question of whether increasing the shape bias of a model actually helps in terms of corruption robustness . While prior work has found that there are training methods that increase both shape bias and corruption robustness ( Geirhos et al. , 2019 ; Hendrycks & Dietterich , 2019 ) , this only establishes a correlation and not a causal relationship . To increase the shape bias , Geirhos et al . ( 2019 ) “ stylize ” images by imposing the style of a painting onto the image , leaving the shape-related structure of the image mostly unchanged while modifying texture cues so that they get largely uninformative of the class . Note that image stylization can be interpreted as a specific form of data augmentation , providing an alternative hypothesis for increased corruption robustness which would leave the enhanced shape bias as a mostly unrelated byproduct . In this work , we investigate the role of the shape bias for corruption robustness in more detail . We propose two novel methods for increasing the shape bias : • Similar to Geirhos et al . ( 2019 ) , we pre-train the CNN on an auxiliary dataset which encourages learning shape features . In contrast to Geirhos et al . ( 2019 ) that use stylized images , this dataset consists of the edge maps for the training images that are generated using the pre-trained neural network of Liu et al . ( 2017 ) for edge detection . This method maintains global object shapes but removes texture-related information , thereby encouraging learning shape-based representations . • In addition to pre-training on edge maps , we also propose style randomization to further enhance the shape bias . Style randomization is based upon sampling parameters of the affine transformations of normalization layers for each input from a uniform distribution . Our key finding is summarized in Figure 1 . While pre-training on stylized images increases both shape bias and corruption robustness , these two quantities are not necessarily correlated : pre-training on edge maps increases the shape bias without consistently helping in terms of corruption robustness . In order to explain this finding , we conduct a systematic study in which we create inputs based on natural images , explicit edge information , and different ways of stylization ( see Figure 2 for an illustration ) . We find that the shape bias gets maximized when combining edge information with stylization without including any texture information ( Stylized Edges ) . However , for maximal corruption robustness , superimposing the image ( and thus its textures ) on these stylized edges is required . This , however , strongly reduces shape bias . In summary , corruption robustness seems to benefit most from style variation in the vicinity of the image manifold , while shape bias is mostly unrelated . Thus , image stylization is best interpreted as a strong data augmentation technique that encourages robust representations , regardless whether these representations are shape-based or not . Moreover , we present results for a setting where we fine-tune only parameters of the affine transformation of a normalization layer on the target distribution ( stylized or corrupted images , respectively ) for a CNN trained on regular images . Surprisingly , this is already sufficient for increasing the shape bias/corruption robustness considerably . We conclude that CNNs trained on normal images do learn shape-based features and features robust to corruptions but assign little weight to them . It may thus be sufficient to perform augmentation in feature space ( extending Nam et al . ( 2019 ) ; Li et al . ( 2020 ) ) so that higher weights are assigned to features that are robust to relevant domain shifts . 2 RELATED WORK . Texture-vs-Shape Bias Geirhos et al . ( 2019 ) and Baker et al . ( 2018 ) hypothesized that CNNs tend to be biased towards textural cues rather than shape cues . This line of research is further supported by Brendel & Bethge ( 2019 ) , where the authors show that BagNets , Deep Neural Networks ( DNN ) trained and evaluated only on small restricted local image patches , already perform reasonably well on ImageNet . Similarly , Yin et al . ( 2019 ) and Jo & Bengio ( 2017 ) showed using a Fourier space analysis that DNNs rely on surface statistical regularities and high-frequency components . The texture-vs-shape bias can be quantified by evaluating a network either on images with texture-shape cue conflict ( Geirhos et al. , 2019 ) or on images which were patch-wise shuffled ( Luo et al. , 2019 ) . Robustness Against Common Corruptions Common corruptions are potentially stochastic image transformations motivated by real-world effects that can be used for evaluating model robustness . Hendrycks & Dietterich ( 2019 ) proposed the ImageNet-C dataset that contains simulated corruptions such as noise , blur , weather effects and digital image transformations . Geirhos et al . ( 2018 ) showed that humans are more robust to image corruptions than CNNs . Approaches to improve corruption robustness include data augmentation ( Lopes et al. , 2019 ; Yun et al. , 2019 ; Hendrycks * et al. , 2020 ; Cubuk et al. , 2019 ) , self-training with more training data ( Xie et al. , 2019 ) , novel architectures and building blocks ( Zhang , 2019 ; Hu et al. , 2018 ) , and changes in the training procedure ( Hendrycks et al. , 2019 ; Rusak et al. , 2020 ; Wang et al. , 2019 ) . Motivated by the texture-vs-shape hypothesis , Geirhos et al . ( 2019 ) and Michaelis et al . ( 2019 ) train their network on a stylized version of ImageNet . The idea is that style transfer removes textural cues and models trained on stylized data thus have to rely more on shape information . The observed increase in corruption robustness on this stylized data was attributed to the shape bias . In this work , we provide evidence that contradicts this claim . Similar to training on stylized images , Style Blending ( Nam et al. , 2019 ) employs style transfer in latent space by interpolating between feature statistics of different samples in a batch . Li et al . ( 2020 ) extend this idea and use feature space blending along with label interpolation . Hendrycks et al . ( 2019 ) considers self-supervised training with the prediction of image rotations as an auxiliary task . The authors argue that predicting rotation requires shape information and thus improves robustness . Similarly , Shi et al . ( 2020 ) proposes Dropout-like algorithm to reduce the texture bias and thereby increase the shape bias to improve model robustness . However , the authors also discuss that a “ sweet spot ” between shape and texture is needed for the model to be robust for domain generalization . With Patch-wise Adversarial Regularization , Wang et al . ( 2019 ) try to penalize reliance on local predictive representations in early layers and encourage the network to learn global concepts . Other augmentation techniques that aim to improve common corruption robustness are PatchGaussian ( Lopes et al. , 2019 ) , CutMix ( Yun et al. , 2019 ) , AugMix ( Hendrycks * et al. , 2020 ) , and RandAugment ( Cubuk et al. , 2019 ) . At this point , it remains unclear whether the increase in robustness caused by these augmentations is due to learning fundamentally different representations such as more shapebiased ones or to more incremental improvements in feature quality . Edge-based Representations A classical method for extracting edge maps is the Canny edge extractor Canny ( 1986 ) . More recent approaches use DNNs ( Xie & Tu , 2015 ; Liu et al. , 2017 ) ( see Figure A1 ) . Geirhos et al . ( 2019 ) evaluate their shape-biased models on edge maps obtained with a Canny edge detector . ImageNet-Sketch ( Wang et al. , 2019 ) is a newly collected sketch-like dataset matching the ImageNet validation dataset in shape and size . It is used to evaluate generalization to domain shifts . In contrast to these works , we generate the edge-based representations with an edge detector using Richer Convolutional Features ( RCF ) ( Liu et al. , 2017 ) ( see Figure A1 ) and use them explicitly for training . We provide evidence that edge-based representations enhance the shape bias , through an evaluation on images with induced texture-shape cue conflict and patch-shuffled images . 3 LEARNING SHAPE-BASED REPRESENTATIONS . Similar to Geirhos et al . ( 2019 ) , we aim to enhance the shape bias of a network so that it bases its decision more on shape details than on the style of objects encoded in textures . While Geirhos et al . ( 2019 ) augment training data with different styles ( stylization ) , thereby making texture cues less predictive , we extract edge information ( edge maps ) from the training images to maintain explicit shape details and remove texture-related information completely . Here , we consider grayscale intensity edge maps rather than separate edge maps for each color channel . We propose to train CNNs using the edge maps in addition to the standard training data to learn shape-based representations for more effective shape-based decision-making . Besides training on the dataset with explicit shape cues , high capacity networks learn different feature representations when trained jointly on datasets from different distributions . Despite edge maps encouraging CNNs to learn shape-based representations , we observe that the network learns to encode features with texture details when introduced to the standard image data during training . We propose here to further restrain the network from learning texture details on standard image data . We discuss below the extraction of edge details from images to create the edge map dataset and explain the technique to reduce the texture bias of the CNN . Edge dataset Given a standard image dataset , we construct a new dataset with edge maps ( named the Edge dataset ) by extracting the edge details of each image . The edge details are extracted by the CNN-based edge detector using richer convolutional features ( RCF ) proposed in Liu et al . ( 2017 ) . RCF network produces a single-channel edge map that contains the pixel values between [ 0 , 255 ] . We convert the non-binary edge map into a binary map with values in { 0 , 255 } using a threshold of 128 and transform it into a 3-channel RGB edge map by duplicating the channels , so we can use the edge maps as a direct input to train the CNNs . The edge maps from the Edge dataset are used as input and can be independently used to train or evaluate CNNs without necessarily being combined with the standard image data . Please refer to Section A.1 for the details of RCF network . Style Randomization ( SR ) While using a dataset with explicit shape cues enhances shape-based representations , we propose to further reduce the texture bias of the network when training on standard images . It is shown in the literature of style transfer ( Dumoulin et al. , 2016 ; Huang & Belongie , 2017 ) that the statistics of feature maps ( e.g. , mean and standard deviation ) of a CNN effectively capture the style of an image and changing these statistics would correspond to a change in the style of an image . SIN dataset is generated using such style transfer technique and shown to reduce the texture bias of the networks . Inspired by this observation , we propose a simple technique to effectively reduce the texture bias using the feature statistics when being trained on standard training data . We modify the style of an image in the feature space so that the network becomes style-invariant . In particular , we randomize the style details , i.e . feature statistics , of an image during training such that the network can not rely on the texture cues . A similar approach named Style Blending ( SB ) is proposed in Nam et al . ( 2019 ) which randomizes the style information by interpolating the feature statistics between different samples in a mini-batch . We propose here a slightly different approach to make the network invariant to style information . Instead of interpolating the statistics of similar distribution of data i.e , training samples , we completely randomize the feature statistics ( mean and standard deviation ) by randomly sampling them from an uniform distribution . Considering Xi as the ith feature map of an intermediate layer in CNN , and µi & σi as the feature statistics of Xi , the style randomized feature map X̂i is defined as : X̂i : = σ̂i ∗ ( Xi − µi σi ) + µ̂i ( 1 ) where σ̂i ∼ Uniform ( 0.1 , 1 ) and µ̂i ∼ Uniform ( −1 , 1 ) . These specific choices of sampling for σ̂i and µ̂i were found to perform best on our evaluations . The style transfer technique described in Huang & Belongie ( 2017 ) replaces the feature statistics of content image with the statistics of a desired style image to change the style . Similarly , we replace the statistics of content image with random statistics to change the style information . Training the network with SR reduces the texture bias and improves shape-based decision making . An advantage of SR over SB is that the feature statistics are sampled from a different distribution than the training data , that encourages learning representations to generalize better to out-of-distribution data . We show in Section 5 that SR outperforms SB and aids the network to induce stronger shape-based representations .
This paper delves deeper into understanding shape-based representation of CNNs in an empirical way. Based on the stylized images, it proposes to use edge maps to more explicitly feed shape information to learning models. Besides, the common way to let models learn the shape-based representation is to train on the dataset contained the shape information while the texture information is severely distorted. The paper takes the point of changing the statistics of feature maps would result in style changes and proposed style-randomization to help CNNs better focus on shape information. Also, it connects the biasing degree on shape information of models with the defensive performance against common corruptions, like Gaussian additive noise, blur, and etc. An intuitive conclusion was drawn that there is no clear correlation between shape bias and robustness against common corruptions, and justified by extensive experiments.
SP:da04daf3c2ef194dd3e9460acf3c967bb0222062
Does enhanced shape bias improve neural network robustness to common corruptions?
1 INTRODUCTION . As deep learning is increasingly applied to open-world perception problems in safety-critical domains such as robotics and autonomous driving , its robustness properties become of paramount importance . Generally , a lack of robustness against adversarial examples has been observed ( Szegedy et al. , 2014 ; Goodfellow et al. , 2015 ) , making physical-world adversarial attacks on perception systems feasible ( Kurakin et al. , 2017 ; Eykholt et al. , 2018 ; Lee & Kolter , 2019 ) . In this work , we focus on a different kind of robustness : namely , robustness against naturally occurring common image corruptions . Robustness of image classifiers against such corruptions can be evaluated using the ImageNet-C benchmark ( Hendrycks & Dietterich , 2019 ) , in which corruptions such as noise , blur , weather effects , and digital image transformations are simulated . Hendrycks & Dietterich ( 2019 ) observed that recent advances in neural architectures increased performance on undistorted data without significant increase in relative corruption robustness . One hypothesis for the lack of robustness is an over-reliance on non-robust features that generalize well within the distribution used for training but fail to generalize to out-of-distribution data . Ilyas ∗Equal contribution . et al . ( 2019 ) provide evidence for this hypothesis on adversarial examples . Similarly , it has been hypothesized that models which rely strongly on texture information are more vulnerable to common corruptions than models based on features encoding shape information ( Geirhos et al. , 2019 ; Hendrycks & Dietterich , 2019 ) . Alternative methods for increasing corruption robustness not motivated by enhancing shape bias use more ( potentially unlabeled ) training data ( Xie et al. , 2019 ) or use stronger data augmentation ( Lopes et al. , 2019 ; Hendrycks * et al. , 2020 ) . Note that our meaning of “ shape ” & “ texture ” is built on the definitions by Geirhos et al . ( 2019 ) . In this paper , we re-examine the question of whether increasing the shape bias of a model actually helps in terms of corruption robustness . While prior work has found that there are training methods that increase both shape bias and corruption robustness ( Geirhos et al. , 2019 ; Hendrycks & Dietterich , 2019 ) , this only establishes a correlation and not a causal relationship . To increase the shape bias , Geirhos et al . ( 2019 ) “ stylize ” images by imposing the style of a painting onto the image , leaving the shape-related structure of the image mostly unchanged while modifying texture cues so that they get largely uninformative of the class . Note that image stylization can be interpreted as a specific form of data augmentation , providing an alternative hypothesis for increased corruption robustness which would leave the enhanced shape bias as a mostly unrelated byproduct . In this work , we investigate the role of the shape bias for corruption robustness in more detail . We propose two novel methods for increasing the shape bias : • Similar to Geirhos et al . ( 2019 ) , we pre-train the CNN on an auxiliary dataset which encourages learning shape features . In contrast to Geirhos et al . ( 2019 ) that use stylized images , this dataset consists of the edge maps for the training images that are generated using the pre-trained neural network of Liu et al . ( 2017 ) for edge detection . This method maintains global object shapes but removes texture-related information , thereby encouraging learning shape-based representations . • In addition to pre-training on edge maps , we also propose style randomization to further enhance the shape bias . Style randomization is based upon sampling parameters of the affine transformations of normalization layers for each input from a uniform distribution . Our key finding is summarized in Figure 1 . While pre-training on stylized images increases both shape bias and corruption robustness , these two quantities are not necessarily correlated : pre-training on edge maps increases the shape bias without consistently helping in terms of corruption robustness . In order to explain this finding , we conduct a systematic study in which we create inputs based on natural images , explicit edge information , and different ways of stylization ( see Figure 2 for an illustration ) . We find that the shape bias gets maximized when combining edge information with stylization without including any texture information ( Stylized Edges ) . However , for maximal corruption robustness , superimposing the image ( and thus its textures ) on these stylized edges is required . This , however , strongly reduces shape bias . In summary , corruption robustness seems to benefit most from style variation in the vicinity of the image manifold , while shape bias is mostly unrelated . Thus , image stylization is best interpreted as a strong data augmentation technique that encourages robust representations , regardless whether these representations are shape-based or not . Moreover , we present results for a setting where we fine-tune only parameters of the affine transformation of a normalization layer on the target distribution ( stylized or corrupted images , respectively ) for a CNN trained on regular images . Surprisingly , this is already sufficient for increasing the shape bias/corruption robustness considerably . We conclude that CNNs trained on normal images do learn shape-based features and features robust to corruptions but assign little weight to them . It may thus be sufficient to perform augmentation in feature space ( extending Nam et al . ( 2019 ) ; Li et al . ( 2020 ) ) so that higher weights are assigned to features that are robust to relevant domain shifts . 2 RELATED WORK . Texture-vs-Shape Bias Geirhos et al . ( 2019 ) and Baker et al . ( 2018 ) hypothesized that CNNs tend to be biased towards textural cues rather than shape cues . This line of research is further supported by Brendel & Bethge ( 2019 ) , where the authors show that BagNets , Deep Neural Networks ( DNN ) trained and evaluated only on small restricted local image patches , already perform reasonably well on ImageNet . Similarly , Yin et al . ( 2019 ) and Jo & Bengio ( 2017 ) showed using a Fourier space analysis that DNNs rely on surface statistical regularities and high-frequency components . The texture-vs-shape bias can be quantified by evaluating a network either on images with texture-shape cue conflict ( Geirhos et al. , 2019 ) or on images which were patch-wise shuffled ( Luo et al. , 2019 ) . Robustness Against Common Corruptions Common corruptions are potentially stochastic image transformations motivated by real-world effects that can be used for evaluating model robustness . Hendrycks & Dietterich ( 2019 ) proposed the ImageNet-C dataset that contains simulated corruptions such as noise , blur , weather effects and digital image transformations . Geirhos et al . ( 2018 ) showed that humans are more robust to image corruptions than CNNs . Approaches to improve corruption robustness include data augmentation ( Lopes et al. , 2019 ; Yun et al. , 2019 ; Hendrycks * et al. , 2020 ; Cubuk et al. , 2019 ) , self-training with more training data ( Xie et al. , 2019 ) , novel architectures and building blocks ( Zhang , 2019 ; Hu et al. , 2018 ) , and changes in the training procedure ( Hendrycks et al. , 2019 ; Rusak et al. , 2020 ; Wang et al. , 2019 ) . Motivated by the texture-vs-shape hypothesis , Geirhos et al . ( 2019 ) and Michaelis et al . ( 2019 ) train their network on a stylized version of ImageNet . The idea is that style transfer removes textural cues and models trained on stylized data thus have to rely more on shape information . The observed increase in corruption robustness on this stylized data was attributed to the shape bias . In this work , we provide evidence that contradicts this claim . Similar to training on stylized images , Style Blending ( Nam et al. , 2019 ) employs style transfer in latent space by interpolating between feature statistics of different samples in a batch . Li et al . ( 2020 ) extend this idea and use feature space blending along with label interpolation . Hendrycks et al . ( 2019 ) considers self-supervised training with the prediction of image rotations as an auxiliary task . The authors argue that predicting rotation requires shape information and thus improves robustness . Similarly , Shi et al . ( 2020 ) proposes Dropout-like algorithm to reduce the texture bias and thereby increase the shape bias to improve model robustness . However , the authors also discuss that a “ sweet spot ” between shape and texture is needed for the model to be robust for domain generalization . With Patch-wise Adversarial Regularization , Wang et al . ( 2019 ) try to penalize reliance on local predictive representations in early layers and encourage the network to learn global concepts . Other augmentation techniques that aim to improve common corruption robustness are PatchGaussian ( Lopes et al. , 2019 ) , CutMix ( Yun et al. , 2019 ) , AugMix ( Hendrycks * et al. , 2020 ) , and RandAugment ( Cubuk et al. , 2019 ) . At this point , it remains unclear whether the increase in robustness caused by these augmentations is due to learning fundamentally different representations such as more shapebiased ones or to more incremental improvements in feature quality . Edge-based Representations A classical method for extracting edge maps is the Canny edge extractor Canny ( 1986 ) . More recent approaches use DNNs ( Xie & Tu , 2015 ; Liu et al. , 2017 ) ( see Figure A1 ) . Geirhos et al . ( 2019 ) evaluate their shape-biased models on edge maps obtained with a Canny edge detector . ImageNet-Sketch ( Wang et al. , 2019 ) is a newly collected sketch-like dataset matching the ImageNet validation dataset in shape and size . It is used to evaluate generalization to domain shifts . In contrast to these works , we generate the edge-based representations with an edge detector using Richer Convolutional Features ( RCF ) ( Liu et al. , 2017 ) ( see Figure A1 ) and use them explicitly for training . We provide evidence that edge-based representations enhance the shape bias , through an evaluation on images with induced texture-shape cue conflict and patch-shuffled images . 3 LEARNING SHAPE-BASED REPRESENTATIONS . Similar to Geirhos et al . ( 2019 ) , we aim to enhance the shape bias of a network so that it bases its decision more on shape details than on the style of objects encoded in textures . While Geirhos et al . ( 2019 ) augment training data with different styles ( stylization ) , thereby making texture cues less predictive , we extract edge information ( edge maps ) from the training images to maintain explicit shape details and remove texture-related information completely . Here , we consider grayscale intensity edge maps rather than separate edge maps for each color channel . We propose to train CNNs using the edge maps in addition to the standard training data to learn shape-based representations for more effective shape-based decision-making . Besides training on the dataset with explicit shape cues , high capacity networks learn different feature representations when trained jointly on datasets from different distributions . Despite edge maps encouraging CNNs to learn shape-based representations , we observe that the network learns to encode features with texture details when introduced to the standard image data during training . We propose here to further restrain the network from learning texture details on standard image data . We discuss below the extraction of edge details from images to create the edge map dataset and explain the technique to reduce the texture bias of the CNN . Edge dataset Given a standard image dataset , we construct a new dataset with edge maps ( named the Edge dataset ) by extracting the edge details of each image . The edge details are extracted by the CNN-based edge detector using richer convolutional features ( RCF ) proposed in Liu et al . ( 2017 ) . RCF network produces a single-channel edge map that contains the pixel values between [ 0 , 255 ] . We convert the non-binary edge map into a binary map with values in { 0 , 255 } using a threshold of 128 and transform it into a 3-channel RGB edge map by duplicating the channels , so we can use the edge maps as a direct input to train the CNNs . The edge maps from the Edge dataset are used as input and can be independently used to train or evaluate CNNs without necessarily being combined with the standard image data . Please refer to Section A.1 for the details of RCF network . Style Randomization ( SR ) While using a dataset with explicit shape cues enhances shape-based representations , we propose to further reduce the texture bias of the network when training on standard images . It is shown in the literature of style transfer ( Dumoulin et al. , 2016 ; Huang & Belongie , 2017 ) that the statistics of feature maps ( e.g. , mean and standard deviation ) of a CNN effectively capture the style of an image and changing these statistics would correspond to a change in the style of an image . SIN dataset is generated using such style transfer technique and shown to reduce the texture bias of the networks . Inspired by this observation , we propose a simple technique to effectively reduce the texture bias using the feature statistics when being trained on standard training data . We modify the style of an image in the feature space so that the network becomes style-invariant . In particular , we randomize the style details , i.e . feature statistics , of an image during training such that the network can not rely on the texture cues . A similar approach named Style Blending ( SB ) is proposed in Nam et al . ( 2019 ) which randomizes the style information by interpolating the feature statistics between different samples in a mini-batch . We propose here a slightly different approach to make the network invariant to style information . Instead of interpolating the statistics of similar distribution of data i.e , training samples , we completely randomize the feature statistics ( mean and standard deviation ) by randomly sampling them from an uniform distribution . Considering Xi as the ith feature map of an intermediate layer in CNN , and µi & σi as the feature statistics of Xi , the style randomized feature map X̂i is defined as : X̂i : = σ̂i ∗ ( Xi − µi σi ) + µ̂i ( 1 ) where σ̂i ∼ Uniform ( 0.1 , 1 ) and µ̂i ∼ Uniform ( −1 , 1 ) . These specific choices of sampling for σ̂i and µ̂i were found to perform best on our evaluations . The style transfer technique described in Huang & Belongie ( 2017 ) replaces the feature statistics of content image with the statistics of a desired style image to change the style . Similarly , we replace the statistics of content image with random statistics to change the style information . Training the network with SR reduces the texture bias and improves shape-based decision making . An advantage of SR over SB is that the feature statistics are sampled from a different distribution than the training data , that encourages learning representations to generalize better to out-of-distribution data . We show in Section 5 that SR outperforms SB and aids the network to induce stronger shape-based representations .
The paper disproves the hypothesis that addressing shape bias improves robustness to corruptions of neural networks, which has been stated by the previous studies [1, 2]. The paper demonstrates that the degree of shape bias of a model is not correlated with classification accuracy on corrupted images via experiments. For the experiments, this paper presents two novel methods to encourage CNNs to be shape-biased: 1) edge dataset and 2) style randomization (SR). In the experiments, the authors train CNNs to be shape-biased to various degrees based on the proposed methods. Additionally, they compare test accuracies of the models to evaluate shape bias and robustness to corruption. In addition, this paper shows that through fine-tuning the affine parameters of the normalization layers, a CNN trained on original images can achieve comparable, if not better, performance than a CNN trained with data augmentation.
SP:da04daf3c2ef194dd3e9460acf3c967bb0222062
A Bayesian-Symbolic Approach to Learning and Reasoning for Intuitive Physics
1 INTRODUCTION . Imagine a ball rolling down a ramp . If asked to predict the trajectory of the ball , most of us will find it fairly easy to make a reasonable prediction . Not only that , simply by observing a single trajectory people can make reasonable guesses about the material and weight of the ball and the ramp . It is astonishing that while the exact answers to any of these prediction and reasoning tasks requires an indepth knowledge of Newtonian mechanics and solving of some intricate equations , yet an average human can perform such tasks without any formal training in physics . Even from an early age , humans demonstrate an innate ability to quickly learn and discover the laws of physical interactions with very limited supervision . This allows them to efficiently reason and plan action about commonsense tasks even in absence of complete information ( Spelke , 2000 ; Battaglia et al. , 2013 ) . Recent studies suggest that this ability of efficient physical reasoning with limited supervision is driven by a noisy model of the exact Newtonian dynamics , referred as the intuitive physics engine ( IPE ; Bates et al. , 2015 ; Gerstenberg et al. , 2015 ; Sanborn et al. , 2013 ; Lake et al. , 2017 ; Battaglia et al. , 2013 ) . As sample-efficient physical reasoning is recognized as a core domain of human common-sense knowledge ( Spelke & Kinzler , 2007 ) ; therefore an important problem in artificial intelligence is to develop agents that not only learn faster but also generalize beyond the training data . This has lead to a surge in works aimed at developing agents with an IPE or a model of the environment dynamics ( Amos et al. , 2018 ; Chang et al. , 2016 ; Grzeszczuk & Animator , 1998 ; Fragkiadaki et al. , 2015 ; Watters et al. , 2017 ; Battaglia et al. , 2016 ; Sanchez-Gonzalez et al. , 2019 ; Ehrhardt et al. , 2017 ; Kipf et al. , 2018 ; Seo et al. , 2019 ; Baradel et al. , 2020 ) . Among these , neural-network based learned models of physics ( Breen et al. , 2019 ; Battaglia et al. , 2016 ; Sanchez-Gonzalez et al. , 2019 ) tend to have good predictive accuracy but poor sample efficiency for learning . On the other hand , symbolic models ( Ullman et al. , 2018 ; Smith et al. , 2019 ; Sanborn et al. , 2013 ; Bramley et al. , 2018 ) are sample efficient but fail to adapt or accommodate any deviation from their fixed physics engine . Inspired by humans ’ highly data-efficient ability of learning and reasoning about their environment , we present Bayesian-symbolic physics ( BSP ) , the first fully Bayesian approach to symbolic intuitive physics that , by combining symbolic learning of physical force laws and statistical learning of unobserved properties of objects , enjoys the sample efficiency of symbolic methods with the accuracy and generalization of data-driven learned approaches . In BSP , we pose the evolution of the environment dynamics over time as a generative program of its objects interacting under Newtonian mechanics using forces , as shown in figure 2 . Being a fully Bayesian model , we treat objects and their properties such as mass , charge , etc . as random variables . As force laws are simply functions of these properties under the Newtonian assumption , in BSP we replace data-hungry neural networks ( NN ) with symbolic regression ( SR ) to learn explicit force laws ( in symbolic form ) and then evolve them deterministically using equations of motion . But a naive SR implementation is not enough : a vanilla grammar that does not constrain the search space of the force-laws can potentially have far worse sample efficiency and accuracy than a neural network . Therefore , we also introduce a grammar of Newtonian physics that leverages dimensional analysis to induce a physical unit system over the search space and then imposes physics-based constraints on the production rules , which help prune away any physically meaningless laws , thus drastically speeding up SR. Our main contributions are threefold : • We introduce a fully differentiable , top-down , Bayesian model for physical dynamics and an expectation-maximization ( EM ) based algorithm , which combines Markov chain Monte Carlo ( MCMC ) and SR , for maximum likelihood fitting of the model . • We introduce a grammar of Newtonian physics that appropriately constrains SR to allow data-efficient physics learning . • Through empirical evaluations , we demonstrate that the BSP approach reaches human-like sample efficiency , often just requiring 1 to 5 observations to learn the exact force laws – usually more than 10x fewer than that of the closest neural alternatives . 2 RELATED WORK . At a high level , the logic of physics engines can be decomposed into a dynamics module and a model of how the entities interact with each other depending on their mutual properties . These modules can be further divided into more components depending on how the module is realized . Using this break-down , we can categorize different models of physics based on what components of the model are learned . In figure 1 , we compare some of the recent models of physics that are of closely related to our work . Starting on the right end , we have fully learned , deep neural-network approach used by Breen et al . ( 2019 ) that do not use any prior knowledge about physics and therefore learn to predict dynamics completely in purely data-driven way . In the middle are hybrid models that introduce some prior knowledge about physical interaction or dynamics in their deep network based prection model . These include interaction networks ( INs ; Battaglia et al. , 2016 ) , ODE graph networks ( OGNs ) and Hamiltonian ODE graph networks ( HOGNs ; Sanchez-Gonzalez et al. , 2019 ) . Since these approaches employ deep networks to learn , they tend to have very good predictive accuracy but extremely bad sample efficiency and therefore require orders of magnitude more data to train than humans ( Ullman et al. , 2018 ; Battaglia et al. , 2016 ; Sanchez-Gonzalez et al. , 2019 ) . On the other end of the spectrum ( left ) are the fully symbolic , rule-based physics models and engines ( Smith et al. , 2019 ; Allen et al. , 2019 ; Wu et al. , 2015 ; Ullman et al. , 2018 ) . While these methods are suitable for reasoning tasks , they lack the flexibility of the data-driven , learned models as they can not generalize or adapt to any changes in the environment that their fixed physics engine simulates . For example , in such fixed models , inference can fail on physically implausible scenes and may require additional tricks to resolve such issues ( Smith et al. , 2019 ) . Symbolic regression has been used for general physics learning in many prior works ranging from Schmidt & Lipson ( 2009 ) that used SR to discover force laws from experimental data to the more recent work of Cranmer et al . ( 2020 ) on distilling symbolic forces from INs using genetic algorithms . Even more recently , Udrescu & Tegmark ( 2020 ) proposed an interesting framework AI Feynman , which recursively simplifies the SR problem using dimensional analysis and symmetries discovered by neural networks to discover the underlying physics equation that generated the data . The focus of these prior work has been to discover the underlying physical equations that directly leads to the observed data but unlike our approach , they do not target to allow for reasoning in physical environments , that is common task of interest in intuitive physics studies . 3 BAYESIAN-SYMBOLIC PHYSICS . Our framework , Bayesian-symbolic physics , combines symbolic learning of physical force laws with Bayesian statistical learning of object properties such as mass and charge . The environment is modelled by a probabilistic generative model governed by Newtonian dynamics . Physical laws are learnable symbolic expressions that determine the force exerted on each object , based on the position and properties of other objects . These properties might not be observed , so they are treated as latent variables and learned in a Bayesian fashion . The physical laws themselves have a prior distribution to organize the search space and discourage the model from learning physically meaningless laws ; we call this distribution a grammar of Newtonian physics . To learn with incomplete data , we are inspired by results from Ullman et al . ( 2018 ) , humans are able to simultaneously predict the trajectory and update their inference about the properties of the object under new observation . This motivates an EM-based learning and inference method to fit BSP models . In the E-step , we obtain the distribution of entity properties by sampling from their posterior distribution using the current guess of force laws , and in the M-step , we use the samples from the E-step to perform SR to update the force functions . This enables BSP models to learn and reason in environment with incomplete information . 3.1 GENERATIVE MODEL OF THE ENVIRONMENT . We represent each entity i ∈ { 1 . . . N } by a vector of properties zi , such as mass , charge , coefficient of friction , and shape , some of which may be unobserved . At each time step t , a state vector sit = ( p i t , v i t ) is associated with each entity i , where p i t ∈ Rd and vit ∈ Rd are position and velocity vectors respectively and d is the dimensionality of the environment , typically 2 or 3 . Let { τ i } Ni=1 , where τ i = pi1 : T : = ( p i 1 , . . . , p i T ) , be the set of observed trajectories from an environment with N entities . Together with a prior on z , the generative process of BSP defines a joint probability distribution p ( D , z ; F ) over the observed trajectory data D and latent properties z given the force function F .1 An example of the generative process of a three-body problem is shown in figure 2 . The state transition of an entity in a Newtonian system depends not only on its properties and current state but also on its interaction with other entities in the environment . Therefore , we define a pairwise interaction function F ( zi , si , zj , sj ) , where i , j ∈ { 1 . . . N } ; we interpret F as the force applied to i due to its interaction with j . Then , the trajectory τi of each entity is generated by a transition function T that consumes the current state and all of its interactions as sit+1 = T ( sit , F ( z i , sit , z 1 , s1t ) , . . . , F ( z i , sit , z N , sNt ) ) . ( 1 ) As forces are additive , forces on entity i can be easily summed to get the total force applied as f it = ∑N j=1 F ( z i , sit , z j , sjt ) . Similar to Sanchez-Gonzalez et al . ( 2019 ) , we use numerical integration to simulate the Newtonian dynamics , updating s with the acceleration obtained from f it . 1As physical dynamics are typically sensitive to initial states , we assume the noise-free initial states are given either as part of the data D or as a point-mass prior over the initial state , thus are omitted in the notation . Specifically , we choose the Euler integrator since its update rules correspond to the basic relations between position , velocity and acceleration . With these specifications , equation 1 becomes ait = f i t/m i , vit+1 = v i t + at∆t , p i t+1 = p i t + v i t+1∆t , ( 2 ) where mi is the mass of the recipient of the force f it and ∆t is the step size of the Euler integrator . Finally , we add Gaussian noise to each trajectory { τ i } Ni=1 , that is , D : = { τ̃ i } Ni=1 where τ̃ i : = ( p̃i1 , . . . , p̃ i T ) , p̃ i t ∼ N ( pit , σ2 ) and σ is the noise level . For clarity , Appendix A provides the complete generative process represented by a probabilistic program .
The paper proposes an Bayesian-symbolic physics (BSP), an intuitive physics model that jointly infers symbolic force laws and object properties (mass, friction coefficient). The inductive bias is force summation, F=ma, and a grammar of force laws to express object interactions. The inference is done via an EM method that alternates between object property estimation (E-step) and force law induction (M-step), using techniques like symbolic regression and Hamiltonian Monte Carlo (HMC). Some preliminary experiments are shown for the method's effectiveness and data efficiency.
SP:10461f5707fe6a701045ed1c3a96c22ceb858960
A Bayesian-Symbolic Approach to Learning and Reasoning for Intuitive Physics
1 INTRODUCTION . Imagine a ball rolling down a ramp . If asked to predict the trajectory of the ball , most of us will find it fairly easy to make a reasonable prediction . Not only that , simply by observing a single trajectory people can make reasonable guesses about the material and weight of the ball and the ramp . It is astonishing that while the exact answers to any of these prediction and reasoning tasks requires an indepth knowledge of Newtonian mechanics and solving of some intricate equations , yet an average human can perform such tasks without any formal training in physics . Even from an early age , humans demonstrate an innate ability to quickly learn and discover the laws of physical interactions with very limited supervision . This allows them to efficiently reason and plan action about commonsense tasks even in absence of complete information ( Spelke , 2000 ; Battaglia et al. , 2013 ) . Recent studies suggest that this ability of efficient physical reasoning with limited supervision is driven by a noisy model of the exact Newtonian dynamics , referred as the intuitive physics engine ( IPE ; Bates et al. , 2015 ; Gerstenberg et al. , 2015 ; Sanborn et al. , 2013 ; Lake et al. , 2017 ; Battaglia et al. , 2013 ) . As sample-efficient physical reasoning is recognized as a core domain of human common-sense knowledge ( Spelke & Kinzler , 2007 ) ; therefore an important problem in artificial intelligence is to develop agents that not only learn faster but also generalize beyond the training data . This has lead to a surge in works aimed at developing agents with an IPE or a model of the environment dynamics ( Amos et al. , 2018 ; Chang et al. , 2016 ; Grzeszczuk & Animator , 1998 ; Fragkiadaki et al. , 2015 ; Watters et al. , 2017 ; Battaglia et al. , 2016 ; Sanchez-Gonzalez et al. , 2019 ; Ehrhardt et al. , 2017 ; Kipf et al. , 2018 ; Seo et al. , 2019 ; Baradel et al. , 2020 ) . Among these , neural-network based learned models of physics ( Breen et al. , 2019 ; Battaglia et al. , 2016 ; Sanchez-Gonzalez et al. , 2019 ) tend to have good predictive accuracy but poor sample efficiency for learning . On the other hand , symbolic models ( Ullman et al. , 2018 ; Smith et al. , 2019 ; Sanborn et al. , 2013 ; Bramley et al. , 2018 ) are sample efficient but fail to adapt or accommodate any deviation from their fixed physics engine . Inspired by humans ’ highly data-efficient ability of learning and reasoning about their environment , we present Bayesian-symbolic physics ( BSP ) , the first fully Bayesian approach to symbolic intuitive physics that , by combining symbolic learning of physical force laws and statistical learning of unobserved properties of objects , enjoys the sample efficiency of symbolic methods with the accuracy and generalization of data-driven learned approaches . In BSP , we pose the evolution of the environment dynamics over time as a generative program of its objects interacting under Newtonian mechanics using forces , as shown in figure 2 . Being a fully Bayesian model , we treat objects and their properties such as mass , charge , etc . as random variables . As force laws are simply functions of these properties under the Newtonian assumption , in BSP we replace data-hungry neural networks ( NN ) with symbolic regression ( SR ) to learn explicit force laws ( in symbolic form ) and then evolve them deterministically using equations of motion . But a naive SR implementation is not enough : a vanilla grammar that does not constrain the search space of the force-laws can potentially have far worse sample efficiency and accuracy than a neural network . Therefore , we also introduce a grammar of Newtonian physics that leverages dimensional analysis to induce a physical unit system over the search space and then imposes physics-based constraints on the production rules , which help prune away any physically meaningless laws , thus drastically speeding up SR. Our main contributions are threefold : • We introduce a fully differentiable , top-down , Bayesian model for physical dynamics and an expectation-maximization ( EM ) based algorithm , which combines Markov chain Monte Carlo ( MCMC ) and SR , for maximum likelihood fitting of the model . • We introduce a grammar of Newtonian physics that appropriately constrains SR to allow data-efficient physics learning . • Through empirical evaluations , we demonstrate that the BSP approach reaches human-like sample efficiency , often just requiring 1 to 5 observations to learn the exact force laws – usually more than 10x fewer than that of the closest neural alternatives . 2 RELATED WORK . At a high level , the logic of physics engines can be decomposed into a dynamics module and a model of how the entities interact with each other depending on their mutual properties . These modules can be further divided into more components depending on how the module is realized . Using this break-down , we can categorize different models of physics based on what components of the model are learned . In figure 1 , we compare some of the recent models of physics that are of closely related to our work . Starting on the right end , we have fully learned , deep neural-network approach used by Breen et al . ( 2019 ) that do not use any prior knowledge about physics and therefore learn to predict dynamics completely in purely data-driven way . In the middle are hybrid models that introduce some prior knowledge about physical interaction or dynamics in their deep network based prection model . These include interaction networks ( INs ; Battaglia et al. , 2016 ) , ODE graph networks ( OGNs ) and Hamiltonian ODE graph networks ( HOGNs ; Sanchez-Gonzalez et al. , 2019 ) . Since these approaches employ deep networks to learn , they tend to have very good predictive accuracy but extremely bad sample efficiency and therefore require orders of magnitude more data to train than humans ( Ullman et al. , 2018 ; Battaglia et al. , 2016 ; Sanchez-Gonzalez et al. , 2019 ) . On the other end of the spectrum ( left ) are the fully symbolic , rule-based physics models and engines ( Smith et al. , 2019 ; Allen et al. , 2019 ; Wu et al. , 2015 ; Ullman et al. , 2018 ) . While these methods are suitable for reasoning tasks , they lack the flexibility of the data-driven , learned models as they can not generalize or adapt to any changes in the environment that their fixed physics engine simulates . For example , in such fixed models , inference can fail on physically implausible scenes and may require additional tricks to resolve such issues ( Smith et al. , 2019 ) . Symbolic regression has been used for general physics learning in many prior works ranging from Schmidt & Lipson ( 2009 ) that used SR to discover force laws from experimental data to the more recent work of Cranmer et al . ( 2020 ) on distilling symbolic forces from INs using genetic algorithms . Even more recently , Udrescu & Tegmark ( 2020 ) proposed an interesting framework AI Feynman , which recursively simplifies the SR problem using dimensional analysis and symmetries discovered by neural networks to discover the underlying physics equation that generated the data . The focus of these prior work has been to discover the underlying physical equations that directly leads to the observed data but unlike our approach , they do not target to allow for reasoning in physical environments , that is common task of interest in intuitive physics studies . 3 BAYESIAN-SYMBOLIC PHYSICS . Our framework , Bayesian-symbolic physics , combines symbolic learning of physical force laws with Bayesian statistical learning of object properties such as mass and charge . The environment is modelled by a probabilistic generative model governed by Newtonian dynamics . Physical laws are learnable symbolic expressions that determine the force exerted on each object , based on the position and properties of other objects . These properties might not be observed , so they are treated as latent variables and learned in a Bayesian fashion . The physical laws themselves have a prior distribution to organize the search space and discourage the model from learning physically meaningless laws ; we call this distribution a grammar of Newtonian physics . To learn with incomplete data , we are inspired by results from Ullman et al . ( 2018 ) , humans are able to simultaneously predict the trajectory and update their inference about the properties of the object under new observation . This motivates an EM-based learning and inference method to fit BSP models . In the E-step , we obtain the distribution of entity properties by sampling from their posterior distribution using the current guess of force laws , and in the M-step , we use the samples from the E-step to perform SR to update the force functions . This enables BSP models to learn and reason in environment with incomplete information . 3.1 GENERATIVE MODEL OF THE ENVIRONMENT . We represent each entity i ∈ { 1 . . . N } by a vector of properties zi , such as mass , charge , coefficient of friction , and shape , some of which may be unobserved . At each time step t , a state vector sit = ( p i t , v i t ) is associated with each entity i , where p i t ∈ Rd and vit ∈ Rd are position and velocity vectors respectively and d is the dimensionality of the environment , typically 2 or 3 . Let { τ i } Ni=1 , where τ i = pi1 : T : = ( p i 1 , . . . , p i T ) , be the set of observed trajectories from an environment with N entities . Together with a prior on z , the generative process of BSP defines a joint probability distribution p ( D , z ; F ) over the observed trajectory data D and latent properties z given the force function F .1 An example of the generative process of a three-body problem is shown in figure 2 . The state transition of an entity in a Newtonian system depends not only on its properties and current state but also on its interaction with other entities in the environment . Therefore , we define a pairwise interaction function F ( zi , si , zj , sj ) , where i , j ∈ { 1 . . . N } ; we interpret F as the force applied to i due to its interaction with j . Then , the trajectory τi of each entity is generated by a transition function T that consumes the current state and all of its interactions as sit+1 = T ( sit , F ( z i , sit , z 1 , s1t ) , . . . , F ( z i , sit , z N , sNt ) ) . ( 1 ) As forces are additive , forces on entity i can be easily summed to get the total force applied as f it = ∑N j=1 F ( z i , sit , z j , sjt ) . Similar to Sanchez-Gonzalez et al . ( 2019 ) , we use numerical integration to simulate the Newtonian dynamics , updating s with the acceleration obtained from f it . 1As physical dynamics are typically sensitive to initial states , we assume the noise-free initial states are given either as part of the data D or as a point-mass prior over the initial state , thus are omitted in the notation . Specifically , we choose the Euler integrator since its update rules correspond to the basic relations between position , velocity and acceleration . With these specifications , equation 1 becomes ait = f i t/m i , vit+1 = v i t + at∆t , p i t+1 = p i t + v i t+1∆t , ( 2 ) where mi is the mass of the recipient of the force f it and ∆t is the step size of the Euler integrator . Finally , we add Gaussian noise to each trajectory { τ i } Ni=1 , that is , D : = { τ̃ i } Ni=1 where τ̃ i : = ( p̃i1 , . . . , p̃ i T ) , p̃ i t ∼ N ( pit , σ2 ) and σ is the noise level . For clarity , Appendix A provides the complete generative process represented by a probabilistic program .
The paper addresses the problem of sample-efficient inference for symbolic physical rules. In the literature, there exists neural-network based models for learning a physical engine which have good predictive accuracy but poor sample efficiency, as well as symbolic models which are highly sensitive to deviations from their fixed physics engine. To be able to overcome issues as such, authors propose a generative model along with a symbolic regression framework, in which forces are produced from a probabilistic context free grammar that is designed to mimic simple Newtonian physics. This particular grammar is parameterized by a few latent variables related to unobserved properties of the physical environment, such as mass and charge. Finally, they develop an Expectation-Maximization algorithm, in order for estimating these latent variables as well as inferring the underlying physical laws of the system.
SP:10461f5707fe6a701045ed1c3a96c22ceb858960
Causal Curiosity: RL Agents Discovering Self-supervised Experiments for Causal Representation Learning
1 INTRODUCTION . Discovering causation in environments an agent might encounter remains an open and challenging problem for causal reinforcement learning ( Schölkopf ( 2015 ) , Bengio et al . ( 2013 ) , Schölkopf ( 2019 ) ) . Most approaches take the form of BAMDPs ( Bayes Adaptive Markov Decision Processes ) ( Zintgraf et al . ( 2019 ) ) or Hi-Param MDP ( Hidden Parameter MDPs ) ( Doshi-Velez & Konidaris ( 2016 ) ; Yao et al . ( 2018 ) ; Killian et al . ( 2017 ) ; Perez et al . ( 2020 ) ) which condition the transition p ( st+1|st , at ; H ) and/or reward function R ( rt+1|st , at , st+1 ; H ) of each environment on hidden parameters ( also referred to as causal factors in some of the above studies ) . Let s ∈ S , a ∈ A , r ∈ R , H ∈ H where S , A , R , and H are the set of states , actions , rewards and feasible hidden parameters . In the physical world and in the case of mechanical systems , examples of the parameter hj ∈ H include gravity , coefficients of friction , masses and sizes of objects . Typically , H is treated as a latent variable for which an embedding is learned during training , using variational methods ( Kingma et al . ( 2014 ) ; Ilse et al . ( 2019 ) ) . Let s0 : T be the entire state trajectory of length T . Similarly , a0 : T is the sequence of actions applied during that trajectory by the agent that results in s0 : T . In an environment parameterized by these causal factors , these latent variable approaches define a probability distribution over the entire sequence of ( rewards , states , actions ) conditioned on a latent z as p ( r0 : T , s0 : T , a0 : T−1 ; z ) that factorizes as T−1∏ i=1 p ( rt+1|st , at , st+1 , z ) p ( st+1|st , at , z ) p ( at|st , z ) ( 1 ) due to the Markov assumption . At test time , the agent infers the causal factor associated with its environment by observing the trajectories produced by its initial actions that can be issued by any policy such as model-based reinforcement learning . In practice , however , discovering causal factors in a physical environment is prone to various challenges that are caused by the disjointed nature of the influence of these factors on the produced trajectories . More specifically , at each time step , the transition function is affected by a subset of global causal factors . This subset is implicitly defined on the basis of the current state and the action taken . For example , if a body in an environment loses contact with the ground , the coefficient of friction between the body and the ground no longer affects the outcome of any action that is taken . Likewise , the outcome of an upward force applied by the agent to a body on the ground is unaffected by the friction coefficient . We can therefore take advantage of this natural discontinuity to discern causal factors . Without knowledge of how independent causal mechanisms affect the outcome of a particular action in a given state in an environment , it becomes impossible for the agent to conclude where the variation it encountered came from . Unsurprisingly , Hi-Param and BAMDP approaches fail to learn a disentangled embedding for the causal factors , making their behaviors uninterpretable ( Perez et al . ( 2020 ) ) . For example , if , in an environment , a body remains stationary under a particular force , the Hi-Param or BAMDP agent may apply a higher force to achieve its goal of perhaps moving the body , but will be unable to conclude whether the `` un-movability '' was caused by high friction or high mass of the body . Additionally , these approaches require human-supervised reward engineering , making it difficult to apply them outside of the simulated environments they are tested in . Our goal is , instead of focusing on maximizing reward for some particular task , to allow agents to discover causal processes through exploratory interaction . During training , our agents discover self-supervised experimental behaviors which they apply to a set of training environments . These behaviors allow them to learn about the various causal mechanisms that govern the transitions in each environment . During inference in a novel environment , they perform these discovered behaviors sequentially and use the outcome of each behavior to infer the embedding for a single causal factor ( Figure 1 ) . The main challenge while learning a disentangled representation for the causal factors of the world is that several causal factors may affect the outcome of behaviors in each environment . For example , when pushing a body on the ground , the outcome , i.e. , whether the body moves , or how far the body is pushed , depends on several factors , e.g. , mass , shape and size , frictional coefficients , etc . However , if , instead of pushing on the ground , the agent executes a perfect grasp-and-lift behavior , only mass will affect whether the body is lifted off the ground or not . Thus , it is clear that not all experimental behaviors are created equal and that the outcomes of some behaviors are caused by fewer causal factors than others . Our agents learn these behaviors without supervision using causal curiosity , an intrinsic reward . The outcome of a single such experimental behavior is then used to infer a binary quantized embedding describing the single isolated causal factor . Even though causal factors of variation in a physical world are easily identifiable to humans , a concrete definition is required to back up our proposed method . We conjecture that the causality of a factor of variation depends on the available actions to the agent . If the set of actions that an agent can take is very limited , there is no way for it to discern a diverse set of causal factors in the environment . Definition 1 ( Causal factors ) . Consider the POMDP ( O , S , A , p , r ) with observation space O , state space S , action spaceA , the transition function p , and the reward function r. Let o0 : T ∈ OT denotes a trajectory of observations and T be the length of such trajectories . Let d ( · , · ) : OT ×OT → R+ be a distance function defined on the space of trajectories of length T . The set H = { h1 , h2 , . . . , hk } is called a set of −causal factors if for every hj ∈ H , there exists a unique sequence of actions a0 : T that clusters the state trajectories into two sets S and S′ such that min { d ( o0 : T , o′0 : T ) : o0 : T ∈ O , o′0 : T ∈ O′ } > ( 2 ) and that hj is the cause of the trajectory of states obtained i.e. , p ( o0 : T |do ( hj = k ) , a0 : T ) 6= p ( o0 : T |do ( hj = k′ ) , a0 : T ) ∀k 6= k′ ( 3 ) Intuitively , a factor of variation affecting a set of environments is called causal if there exists a sequence of actions available to the agent where the resultant trajectories are clustered into two or more sets ( for simplicity here we assume binary clusters ) . This is analogous to the human ability to conclude whether objects are heavy or light , big or small . For a gentle introduction to the intuition about this definition , we refer the reader to Appendix D. According to Def . 1 , a causal factor is a parameter in the environment whose value , when intervened on ( i.e . varied ) over a set of values , results in trajectories of states that are divisible into disjoint clusters under a particular sequence of actions . These clusters represent the quantized values of the causal factor . For example , mass , which is a causal factor of a body , under an action sequence of a grasping and lifting motion , results in 2 clusters , liftable ( low mass ) and not liftable ( high mass ) . However , such an action sequence is not known in advance . Therefore , discovering a causal factor in the environment boils down to finding a sequence of actions that makes the effect of that factor prominent by producing clustered trajectories for different values of that environmental factor . Using the above , we propose an intrinsic reward , which allows our agents to discover experimental behaviors which are semantically meaningful and can be used to re-train for downstream tasks , resulting in high sample efficiency . Our work , therefore , forms an important link between structured representation learning and skill discovery , two largely disjoint fields in RL , which stand to benefit from each other . The contributions of the work are as follows : • We equip agents with the ability to perform experiments and behave meaningfully in a set of environments in an unsupervised manner . These behaviors can expose or obfuscate specific independent causal mechanisms that occur in the world of the agent , allowing the agent to learn about each in the absence of the others , an important human behavioral trait . • We introduce an intrinsic reward , causal curiosity , which allows our agents to discover these behaviors without human-engineered rewards . The outcomes of the experiments are used to learn a disentangled quantized binary representation for the causal factors of the environment , analogous to the human ability to conclude whether objects are light/heavy , big/small etc . • Through extensive experiments , we conclude that knowledge of the causal factors aids sample efficiency in two ways - first , that the knowledge of the causal factors aids transfer learning across multiple environments , and , second , that the experimental behaviors acquired can be repurposed for downstream tasks . 2 METHOD . Consider a set of N environments E with e ( i ) ∈ E where e ( i ) denotes the ith environment . The letter H is overloaded . While H is a set of global causal factors ( as defined in Def . 1 ) such that hj ∈ H , each causal factor hj is itself a random variable which assumes a particular value for every instantiation of an environment . Thus every environment e ( i ) is represented by a set of causal factors { h ( i ) j ∀j } . For each environment e ( i ) , ( z ( i ) ( 0 ) , z ( i ) ( 1 ) ... z ( i ) ( K−1 ) ) represents the disentangled embedding vector , such that z ( i ) ( j ) encodes h ( i ) j . Algorithm 1 Training Scheme 1 : Initialize j = 0 2 : Initialize training environment set Envs 3 : for iteration m to M do . Experiment Planner Training Loop 4 : Sample experimental behavior a0 : T ∼ CEM ( · ) 5 : for ith env in Envs do 6 : Apply a0 : T to env 7 : Collect S ( i ) = O ( i ) 0 : T 8 : Reset env 9 : Calculate −L ( S|M ) given that M is bimodal clustering model . Calculate Curiosity 10 : Update CEM ( · ) distribution with highest reward trajectories 11 : Use learnt qM ( z|S ) for cluster assignment of each env in Envs i.e . z ( i ) j = qM ( z|S ( i ) ) 12 : Update j = j + 1 13 : Repeat from step 2 , first setting Envs = { e ( i ) : z ( i ) j−1 = 0 } and then , setting Envs = { e ( i ) : z ( i ) j−1 = 1 }
This paper develops an intrinsic reward to help identify factors of variation within a family of MDPs. This intrinsic reward takes a form of curiosity and is used to develop initial behaviors to identify the causes of the latent variation in the environment dynamics. The experiments are used to validate the proposed intrinsic reward across several analyses used to identify its utility and effectiveness.
SP:5343a29c611b40fc6df160bff09a9aaf8140d0ab
Causal Curiosity: RL Agents Discovering Self-supervised Experiments for Causal Representation Learning
1 INTRODUCTION . Discovering causation in environments an agent might encounter remains an open and challenging problem for causal reinforcement learning ( Schölkopf ( 2015 ) , Bengio et al . ( 2013 ) , Schölkopf ( 2019 ) ) . Most approaches take the form of BAMDPs ( Bayes Adaptive Markov Decision Processes ) ( Zintgraf et al . ( 2019 ) ) or Hi-Param MDP ( Hidden Parameter MDPs ) ( Doshi-Velez & Konidaris ( 2016 ) ; Yao et al . ( 2018 ) ; Killian et al . ( 2017 ) ; Perez et al . ( 2020 ) ) which condition the transition p ( st+1|st , at ; H ) and/or reward function R ( rt+1|st , at , st+1 ; H ) of each environment on hidden parameters ( also referred to as causal factors in some of the above studies ) . Let s ∈ S , a ∈ A , r ∈ R , H ∈ H where S , A , R , and H are the set of states , actions , rewards and feasible hidden parameters . In the physical world and in the case of mechanical systems , examples of the parameter hj ∈ H include gravity , coefficients of friction , masses and sizes of objects . Typically , H is treated as a latent variable for which an embedding is learned during training , using variational methods ( Kingma et al . ( 2014 ) ; Ilse et al . ( 2019 ) ) . Let s0 : T be the entire state trajectory of length T . Similarly , a0 : T is the sequence of actions applied during that trajectory by the agent that results in s0 : T . In an environment parameterized by these causal factors , these latent variable approaches define a probability distribution over the entire sequence of ( rewards , states , actions ) conditioned on a latent z as p ( r0 : T , s0 : T , a0 : T−1 ; z ) that factorizes as T−1∏ i=1 p ( rt+1|st , at , st+1 , z ) p ( st+1|st , at , z ) p ( at|st , z ) ( 1 ) due to the Markov assumption . At test time , the agent infers the causal factor associated with its environment by observing the trajectories produced by its initial actions that can be issued by any policy such as model-based reinforcement learning . In practice , however , discovering causal factors in a physical environment is prone to various challenges that are caused by the disjointed nature of the influence of these factors on the produced trajectories . More specifically , at each time step , the transition function is affected by a subset of global causal factors . This subset is implicitly defined on the basis of the current state and the action taken . For example , if a body in an environment loses contact with the ground , the coefficient of friction between the body and the ground no longer affects the outcome of any action that is taken . Likewise , the outcome of an upward force applied by the agent to a body on the ground is unaffected by the friction coefficient . We can therefore take advantage of this natural discontinuity to discern causal factors . Without knowledge of how independent causal mechanisms affect the outcome of a particular action in a given state in an environment , it becomes impossible for the agent to conclude where the variation it encountered came from . Unsurprisingly , Hi-Param and BAMDP approaches fail to learn a disentangled embedding for the causal factors , making their behaviors uninterpretable ( Perez et al . ( 2020 ) ) . For example , if , in an environment , a body remains stationary under a particular force , the Hi-Param or BAMDP agent may apply a higher force to achieve its goal of perhaps moving the body , but will be unable to conclude whether the `` un-movability '' was caused by high friction or high mass of the body . Additionally , these approaches require human-supervised reward engineering , making it difficult to apply them outside of the simulated environments they are tested in . Our goal is , instead of focusing on maximizing reward for some particular task , to allow agents to discover causal processes through exploratory interaction . During training , our agents discover self-supervised experimental behaviors which they apply to a set of training environments . These behaviors allow them to learn about the various causal mechanisms that govern the transitions in each environment . During inference in a novel environment , they perform these discovered behaviors sequentially and use the outcome of each behavior to infer the embedding for a single causal factor ( Figure 1 ) . The main challenge while learning a disentangled representation for the causal factors of the world is that several causal factors may affect the outcome of behaviors in each environment . For example , when pushing a body on the ground , the outcome , i.e. , whether the body moves , or how far the body is pushed , depends on several factors , e.g. , mass , shape and size , frictional coefficients , etc . However , if , instead of pushing on the ground , the agent executes a perfect grasp-and-lift behavior , only mass will affect whether the body is lifted off the ground or not . Thus , it is clear that not all experimental behaviors are created equal and that the outcomes of some behaviors are caused by fewer causal factors than others . Our agents learn these behaviors without supervision using causal curiosity , an intrinsic reward . The outcome of a single such experimental behavior is then used to infer a binary quantized embedding describing the single isolated causal factor . Even though causal factors of variation in a physical world are easily identifiable to humans , a concrete definition is required to back up our proposed method . We conjecture that the causality of a factor of variation depends on the available actions to the agent . If the set of actions that an agent can take is very limited , there is no way for it to discern a diverse set of causal factors in the environment . Definition 1 ( Causal factors ) . Consider the POMDP ( O , S , A , p , r ) with observation space O , state space S , action spaceA , the transition function p , and the reward function r. Let o0 : T ∈ OT denotes a trajectory of observations and T be the length of such trajectories . Let d ( · , · ) : OT ×OT → R+ be a distance function defined on the space of trajectories of length T . The set H = { h1 , h2 , . . . , hk } is called a set of −causal factors if for every hj ∈ H , there exists a unique sequence of actions a0 : T that clusters the state trajectories into two sets S and S′ such that min { d ( o0 : T , o′0 : T ) : o0 : T ∈ O , o′0 : T ∈ O′ } > ( 2 ) and that hj is the cause of the trajectory of states obtained i.e. , p ( o0 : T |do ( hj = k ) , a0 : T ) 6= p ( o0 : T |do ( hj = k′ ) , a0 : T ) ∀k 6= k′ ( 3 ) Intuitively , a factor of variation affecting a set of environments is called causal if there exists a sequence of actions available to the agent where the resultant trajectories are clustered into two or more sets ( for simplicity here we assume binary clusters ) . This is analogous to the human ability to conclude whether objects are heavy or light , big or small . For a gentle introduction to the intuition about this definition , we refer the reader to Appendix D. According to Def . 1 , a causal factor is a parameter in the environment whose value , when intervened on ( i.e . varied ) over a set of values , results in trajectories of states that are divisible into disjoint clusters under a particular sequence of actions . These clusters represent the quantized values of the causal factor . For example , mass , which is a causal factor of a body , under an action sequence of a grasping and lifting motion , results in 2 clusters , liftable ( low mass ) and not liftable ( high mass ) . However , such an action sequence is not known in advance . Therefore , discovering a causal factor in the environment boils down to finding a sequence of actions that makes the effect of that factor prominent by producing clustered trajectories for different values of that environmental factor . Using the above , we propose an intrinsic reward , which allows our agents to discover experimental behaviors which are semantically meaningful and can be used to re-train for downstream tasks , resulting in high sample efficiency . Our work , therefore , forms an important link between structured representation learning and skill discovery , two largely disjoint fields in RL , which stand to benefit from each other . The contributions of the work are as follows : • We equip agents with the ability to perform experiments and behave meaningfully in a set of environments in an unsupervised manner . These behaviors can expose or obfuscate specific independent causal mechanisms that occur in the world of the agent , allowing the agent to learn about each in the absence of the others , an important human behavioral trait . • We introduce an intrinsic reward , causal curiosity , which allows our agents to discover these behaviors without human-engineered rewards . The outcomes of the experiments are used to learn a disentangled quantized binary representation for the causal factors of the environment , analogous to the human ability to conclude whether objects are light/heavy , big/small etc . • Through extensive experiments , we conclude that knowledge of the causal factors aids sample efficiency in two ways - first , that the knowledge of the causal factors aids transfer learning across multiple environments , and , second , that the experimental behaviors acquired can be repurposed for downstream tasks . 2 METHOD . Consider a set of N environments E with e ( i ) ∈ E where e ( i ) denotes the ith environment . The letter H is overloaded . While H is a set of global causal factors ( as defined in Def . 1 ) such that hj ∈ H , each causal factor hj is itself a random variable which assumes a particular value for every instantiation of an environment . Thus every environment e ( i ) is represented by a set of causal factors { h ( i ) j ∀j } . For each environment e ( i ) , ( z ( i ) ( 0 ) , z ( i ) ( 1 ) ... z ( i ) ( K−1 ) ) represents the disentangled embedding vector , such that z ( i ) ( j ) encodes h ( i ) j . Algorithm 1 Training Scheme 1 : Initialize j = 0 2 : Initialize training environment set Envs 3 : for iteration m to M do . Experiment Planner Training Loop 4 : Sample experimental behavior a0 : T ∼ CEM ( · ) 5 : for ith env in Envs do 6 : Apply a0 : T to env 7 : Collect S ( i ) = O ( i ) 0 : T 8 : Reset env 9 : Calculate −L ( S|M ) given that M is bimodal clustering model . Calculate Curiosity 10 : Update CEM ( · ) distribution with highest reward trajectories 11 : Use learnt qM ( z|S ) for cluster assignment of each env in Envs i.e . z ( i ) j = qM ( z|S ( i ) ) 12 : Update j = j + 1 13 : Repeat from step 2 , first setting Envs = { e ( i ) : z ( i ) j−1 = 0 } and then , setting Envs = { e ( i ) : z ( i ) j−1 = 1 }
This paper considers the problem of skill discovery in settings where the data appears to be a Markov Decision Process and part of the state is unobservable. The hidden state variables are interpreted as causal factors that control important aspects of the environment dynamics. Under this interpretation, the paper advocates for the use of a reward that encourages learned skills that exercise individual components of the hidden state. These skills are learned with a model-based RL algorithm -- one skill per causal factor -- then transferred for use in a downstream control problem that uses a different learning algorithm. The paper claims the learned skills are qualitatively meaningful, and that they enable agents to solve downstream problems without any additional training. Data used for empirical evidence comes from a simulated manipulation robot.
SP:5343a29c611b40fc6df160bff09a9aaf8140d0ab
ECONOMIC HYPERPARAMETER OPTIMIZATION WITH BLENDED SEARCH STRATEGY
1 INTRODUCTION . Hyperparameter optimization ( HPO ) of modern machine learning models is a resource-consuming task , which is unaffordable to individuals or organizations with little resource ( Yang & Shami , 2020 ) . Operating HPO in a low-cost regime has numerous benefits , such as democratizing ML techniques , enabling new applications of ML , which requires frequent low-latency tuning , and reducing the carbon footprint . It is inherently challenging due to the nature of the task : trying a large number of configurations of heterogeneous cost and accuracy in a large search space . The expense can accumulate from multiple sources : either a large number of individually cheap trials or a small number of expensive trials can add up the required resources . There have been multiple attempts to address the efficiency of HPO from different perspectives . Each of them has strengths and limitations . For example , Bayesian optimization ( BO ) ( Brochu et al. , 2010 ) , which is a class of global optimization algorithms , is used to minimize the total number of iterations to reach global optima . However , when the cost of different hyperparameter configurations is heterogeneous , vanilla BO may select a configuration that incurs unnecessarily high cost . As opposed to BO , local search ( LS ) methods ( Wu et al. , 2021 ) are able to control total cost by preventing very expensive trials until necessary , but they may get trapped in local optima . Multi-fidelity methods ( Jamieson & Talwalkar , 2016 ) aim to use cheap proxies to replace some of the expensive trials and approximate the accuracy assessment , but can only be used when such proxies exist . A single search strategy is difficult to meet the generic goal of economical HPO . In this work , we propose a blended search strategy which combines global search and local search strategy such that we can enjoy benefits from both worlds : ( 1 ) global search can ensure the convergence to the global optima when the budget is sufficient ; and ( 2 ) local search methods enable a better control on the cost incurred along the search trajectory . Given a particular global and local search method , our framework , which is named as BlendSearch , combines them according to the following design principles . ( 1 ) Instead of sticking with a particular method for configuration selection , we consider both of the candidate search methods and decide which one to use at each round of the configuration selection . ( 2 ) We use the global search method to help decide the starting points of local search threads . ( 3 ) We use the local search method to intervene the global search method ’ s configuration selection to avoid configurations that may incur unnecessarily large evaluation cost . ( 4 ) We prioritize search instances of both methods according to their performance and efficiency of performance improvement on the fly . Extensive empirical evaluation on the AutoML ∗Equal contribution Benchmark ( Gijsbers et al. , 2019 ) validates the robust performance of our method on a wide variety of datasets . BlendSearch is now publicly available in an open-source AutoML Library1 . 2 BACKGROUND AND RELATED WORK . We first briefly introduce the vanilla Bayesian optimization methods and local search methods , which are among the building blocks of our method . Bayesian optimization is a class of global optimization algorithms which is suitable for optimizing expensive black-box functions . It models the probabilistic distribution of the objective conditioned on the optimization variables . Typical models include Gaussian process ( Snoek et al. , 2012 ) , random forest ( Hutter et al. , 2011 ) , and tree Parzen estimator ( TPE ) ( Bergstra et al. , 2011 ) . In BO methods , an acquisition function is used to determine the next point to evaluate . Two common acquisition functions are the expected improvement ( EI ) ( Bull , 2011 ) over the currently best-observed objective and upper confidence bound ( UCB ) ( Srinivas et al. , 2009 ) . Local search methods are prevalent in the general optimization literature ( Spall et al. , 1992 ; Nesterov & Spokoiny , 2017 ) but less studied in the HPO literature due to the possibility of getting trapped in local optima ( György & Kocsis , 2011 ) . Recent work ( Wu et al. , 2021 ) shows that a local search method FLOW2 can make HPO cost-effective when combined with low-cost initialization and random restart . At each iteration , it samples a pair of vectors ( with opposite directions ) uniformly at random from a unit sphere , the center of which is the best configuration found so far ( a.k.a . incumbent ) and the radius of which is the current stepsize . Expensive configurations are avoided in the beginning as each iteration proposes a configuration near the incumbent . Random restart of the local search is performed once the convergence condition is satisfied . There are several attempts to address the limitations of vanilla BO or local search methods . BOwLS ( BO with local search ) ( Gao et al. , 2020 ) uses a BO model to select the starting point of a local search thread . Each local search thread is run until convergence and the BO model is updated with the start point and the converged loss . Trust region BO ( Eriksson et al. , 2019 ) fits a fixed number of local models and performs a principled global allocation of samples across these models via an implicit bandit approach . It is primarily designed for HPO problems with high-dimensional numerical hyperparamters . Unfortunately , all existing work that tries to combine global search with local search methods does not consider the heterogeneity of evaluation cost incurred along with the search . There are also a lot of attempts in making HPO efficient by speeding up configuration evaluation . Multifidelity optimizations ( Klein et al. , 2017 ; Li et al. , 2017 ; Kandasamy et al. , 2017 ; Falkner et al. , 2018 ; Lu et al. , 2019 ; Li et al. , 2020 ) are proposed for this purpose . They usually require an additional degree of freedom in the problem called ‘ fidelity ’ , to allow performance assessment on a configura- 1https : //github.com/microsoft/FLAML tion with different fidelities . There is surprisingly little prior work for generic cost-effective HPO . Gaussian process with expected improvement per second ( GPEIPS ) ( Snoek et al. , 2012 ) models the evaluation cost using another Gaussian process , and heuristically adds the estimated cost into the acquisition function . It does not always outperform GPEI as the acqusition function can overpenalize good but expensive configurations . 3 BLENDSEARCH . Our framework needs the following information as inputs . • B is the total budget of cost . In this work , we measure the cost by CPU/GPU time . • P is the input HPO problem , which has the following attributes characterizing the problem . – P.X is the search space in which each element x is a d-dimensional hyperparameter configuration . For a non-categorical hyperparameter coordinate i ∈ [ d ] , if different values of xi lead to heterogeneous cost and there is a known value P.xLowCosti corresponding to a low cost , it is considered as a controlled dimension . We use P.D to denote such a set of controlled dimensions . – P.LossFunc ( · ) is the loss function to be minimized in terms of the configurations x ∈ P.X . – P.CostFunc ( · ) is the cost function that outputs the cost incurred when evaluating x . The goal of an HPO algorithm is to minimize the loss P.LossFunc ( x ) with the constraint that the total cost incurred G ( π ) : = ∑ x∈I ( π ) P.CostFunc ( x ) ≤ B , where I ( π ) is the search trajectory of algorithm π . Note that both P.LossFunc ( x ) and P.CostFunc ( x ) are black-box functions meaning that typically the analytic form is not available , and only function values can be observed . In order to distinguish the operation of querying from loss/cost function and the loss/cost observation , we use P.LossFunc ( x ) and P.CostFunc ( x ) to denote the former , and use l ( x ) and c ( x ) to denote the latter . l and c ( omitting x ) are used when there is no ambiguity . • G is the global search method to be used . L is the local search method to be used . L.∆ is the largest stepsize used in local search method L , i.e. , the largest possible change on a hyperparameter value between two consecutive search steps . The overall design of our framework is presented in Figure 2 and Algorithm 1 . The key idea is to maintain a pool of search threads , one of which corresponds to global search and the others local search . The pool starts with one global search thread and gradually adds local search threads as the search goes on . Here a search thread is an instance of a global search or local search method , each with its own search trajectory . At each round , a search thread selector selects one of the search threads from the pool according to a priority metric that reflects the search threads ’ current performance and efficiency of performance improvement . The selected search thread will then be used to propose a configuration to evaluate in this round . When the selected search thread is the global search thread , a config validator first checks whether the proposed configuration is within the ‘ admissible ’ region for evaluation . If not , it uses a backup local search thread instead . A local search thread will be created only when the global search thread proposes a valid config and a certain create thread condition is met , and will be deleted once it converges . Two local search threads will be merged into one if they are close enough . The priority of each search thread is updated after each evaluation round . Algorithm 1 BlendSearch Inputs : HPO problem P , a global search method G , a local search method L , total budget B . 1 : Initialization : Initialize F .S = [ S0 ] where S0 is an instance of G. We denote by F .x0 the initial point of the search . By design , the values of the controlled dimensions of F .x0 are set to be P.xLowCost and those for the other dimensions are proposed by S0 . 2 : while F .c < B do 3 : S̃ , S̃bak ← SelectThread ( F ) 4 : ( x , l , c ) ← SearchEvaluate1Step ( S̃ , F , P ) 5 : if x is invalid then ( x , l , c ) ← SearchEvaluate1Step ( S̃bak , F , P ) 6 : if x is proposed by global search & CreateNewLSCondition is satisfied then 7 : Initialize S = InitializeSearchThread ( L , P , ( x , l , c ) ) 8 : Add the new LS thread S into the pool : F .S← F .S + S 9 : DeleteAndMergeLS ( F ) . Merge or delete existing LS threads when necessary 10 : Update F .Priority 11 : if x is proposed by global search then UpdateGSModel ( S0 , ( x , l , c ) ) For convenience , we use F to denote a collection of framework-level variables : • F .S is the list of search threads maintained in our framework . F .S contains at least one search thread and among them there is one and only one global search thread , i.e. , S0 , in F .S . • F .Priority is a priority dictionary , in which the keys are the search threads in F .S , and the values are the priority of the corresponding search threads . • Bookkeeping information of F : F .l∗ is the best loss achieved among all the search threads and F .c is the total cost consumed in our framework . • F .R is the ‘ admissible ’ region on the controlled dimensions of the current search , which is a hyperrectangle and can be written in the form of F .R : = { [ F .xmini , F .xmaxi ] } i∈D with F .xmini and F .xmaxi denoting the minimum and maximum value along the i-th dimension in F .R respectively . They are initially set as F .xmini = F .xmaxi = P.xLowCosti for all i ∈ D. The ‘ admissible ’ region gradually expands during the search : ( 1 ) it is expanded to cover all the points evaluated by all the search threads and all the points that are possible to be reached by the local search within one search step , as shown in line 7 and 8 of Algorithm 2 ; ( 2 ) it expands if a local search thread converges , as shown in line 3 of Algorithm 7 ( included in Appendix A ) . In the following , we explain the key steps in our algorithm . Step 1 : Search thread selector ( line 3 of Alg 1 ) . In addition to the primary search thread S̃ , SelectThread also outputs a backup search thread S̃bak which is guaranteed to be a local search thread . It is set to be none when there is no local search thread yet in F .S . Specifically , S̃ = arg max S∈F.S F .Priority ( S ) , S̃bak = { arg maxS∈ ( F.S\S0 ) F .Priority ( S ) F .S \ S0 6= ∅ None F .S \ S0 = ∅ , ( 1 ) The design of the priority metric follows the principle of optimism in the face of uncertainty from the multi-armed bandit problem to balance exploitation and exploration ( Lattimore & Szepesvári , 2020 ) . Specifically , linear extrapolation is performed adaptively and locally to calculate the improvement speed of each search thread . The estimated future reward based on such a linear extrapolation provides a first-order upper bound of the ground truth future reward assuming each search thread has a diminishing return , i.e. , the speed of improvement decreases as more resource is spent . Formally , we introduce the following variables and functions for each search thread S ∈ F .S . • Bookkeeping information : S.l1st and S.l2nd are the best loss so far and second best loss before the best loss is achieved . S.c1st and S.c2nd are the total cost taken when S.l1st and S.l2nd are achieved respectively . S.c is the total cost spent in S. S.x1st is the best configuration found so far . • S.s is the performance improvement speed of S. It is calculated as S.s = S.l 2nd−S.l1st S.c−S.c2nd . This formula is only valid when there is at least one improvement . Otherwise , we do not have enough information to estimate the speed of improvement . We set the speed to the highest speed of all the search threads when S.l2nd = S.l1st . It is due to an implicit assumption of diminishing return . • S.xmin and S.xmax are the minimum and maximum value of the i-th dimension of all hyperparameters configurations evaluated in S respectively . • S.CostImp ( · ) is a function whose input is a target loss and output is the anticipated cost for S to generate a better loss than this target . We use the following formula to compute it , which is intuitively using the cost for improvement in the past to estimate that in the future . S.CostImp ( l ) = max { S.c− S.c1st , S.c1st − S.c2nd , 2S.l 1st − l S.s } ( 2 ) Our proposed priority metric is essentially the negative of the projected loss of S : F .Priority ( S ) = − ( S.l1st − S.s× b ) ( 3 ) in which b = min ( maxS∈F.S S.CostImp ( F .l∗ ) , B − F .c ) . maxS∈F.S S.CostImp ( F .l∗ ) can be considered as the resource needed for every S to have a better performance than the currently best performance F .l∗ . Our priority metric estimates the loss of each search thread if such an amount of resource ( restricted by the budget left B − F .c ) is given . By considering both the search threads ’ current performance and potential improvement , it provides a fair trade-off between exploiting the currently-best and exploring the potentially-better choices . Algorithm 2 SearchEvaluate1Step Inputs : HPO problem P , search thread S , and F 1 : if S is None then Construct x as follows : generate the controlled dimensions of x by adding Guassian noises on the corresponding dimensions of F .x0 and for the rest of the dimensions sample uniformly at random from the search space P.X . 2 : else x← S.ProposeConfig ( ) 3 : if S = S0 ( i.e. , S is the global search thread ) & x /∈ F .R then x←invalid 4 : else l , c← P.LossFunc ( x ) , P.CostFunc ( x ) . Evaluate configuration x 5 : if x 6= invalid then 6 : BookKeeping ( S , x , l , c , F ) and update speed S.s , 7 : ∀i ∈ P.D , S.xmini ← min { xi , S.xmini } , F .xmini ← min { S.xmini − L.∆ , F .xmini } , 8 : ∀i ∈ P.D , S.xmaxi ← max { xi , S.xmaxi } , F .xmaxi ← max { S.xmaxi + L.∆ , F .xmaxi } 9 : Outputs : x , l , c Step 2 : Config validator and evaluator ( line 4-5 of Alg 1 ) . After a search thread ( and a backup search thread ) is selected , the next step is to propose the next configuration to try with the chosen search thread ( s ) . Intuitively speaking , we consider generating the next configuration to try primarily according to the selected search thread S̃ whose priority is ranked the highest . But we set a guard rail for the global search thread as it may propose an unnecessarily high-cost configuration . We thus introduce a config validator to validate the configurations proposed by global search according to whether they are within the current admissible region of our framework F .R ( line 3 of Alg 2 ) . A configuration marked as ‘ invalid ’ means that it is considered to be prone to incur unnecessarily high cost and will not be evaluated at this round . In this case , the selected backup search thread will be used to perform another round of SearchEvaluate1Step ( line 5 of Alg 1 ) if it is a valid search thread ( i.e. , not none ) . In the case where the backup thread is none , we generate the new configuration according to line 1 of Alg 2 . The config validator helps avoid potentially high-cost evaluation and thus avoid creating local search threads from high-cost points until necessary . It does not stick to local searches forever because the admissible region F .R gets expanded . Note that according to the definition of F .R , only the controlled dimensions of the hyperparameter configurations are subject to validation check . If needed , a multi-fidelity pruning strategy can be used in this config evaluator component . Multi-fidelity pruning does not necessarily yield better performance . So the adoption of multi-fidelity pruning in BlendSearch is optional . Step 3 : Search thread creator , updater and cleaner ( line 6-11 of Alg 1 ) . If the newly proposed configuration is proposed by global search and it is not marked as ‘ invalid ’ , we consider creating a new local search thread using the proposed configuration as a starting point . To make sure the newly created local search thread is relatively good , we first check whether the proposed configuration ’ s performance is better than at least half of the existing threads ’ performance ( specified in the CreateNewLSCondition ) . If so , a new local search thread will be initialized and added to the active search thread pool S. In DeleteAndMergeLS , we check whether a local search thread has converged according to the convergence condition of the specific local search method . If it is , the search thread will be removed from S. In addition , we also go through all the local search threads to see whether the incumbent of a LS thread is reachable in one step by another LS thread with lower loss ( ref . Appendix A ) . If so , the former LS thread will be deleted . After a configuration proposed by global search is evaluated , the observation tuple ( x , l , c ) is then used to update the model of the global search method through function UpdateGSModel . For example , when the global search method is a Bayesian optimization method , the model is the surrogate model used . Due to page limit , detailed pseudocode for several of the straightforward functions mentioned in our framework are provided in Appendix A , including CreateNewLSCondition , DeleteAndMergeLS , InitializeSearchThread and BookKeeping .
The proposed BlendedSearch (BS) presents an intuitive next step in the combination of global and local search schemes for hyper-parameter optimization (HPO). Global search schemes are widely used for HPO but can suffer from large HPO times since their vanilla forms do not account for function evaluation costs. Local search schemes are usually not widely used for HPO but seem useful if the goal is to restrict the search to a region of the search space where the function evaluation costs do not grow drastically. The proposed BS interleaves global and local search steps to ensure that the global search does not go into regions of high evaluation costs while also avoiding being stuck in local minima.
SP:59f3aa13da7e04d36e60a67555cd8254047e949a
ECONOMIC HYPERPARAMETER OPTIMIZATION WITH BLENDED SEARCH STRATEGY
1 INTRODUCTION . Hyperparameter optimization ( HPO ) of modern machine learning models is a resource-consuming task , which is unaffordable to individuals or organizations with little resource ( Yang & Shami , 2020 ) . Operating HPO in a low-cost regime has numerous benefits , such as democratizing ML techniques , enabling new applications of ML , which requires frequent low-latency tuning , and reducing the carbon footprint . It is inherently challenging due to the nature of the task : trying a large number of configurations of heterogeneous cost and accuracy in a large search space . The expense can accumulate from multiple sources : either a large number of individually cheap trials or a small number of expensive trials can add up the required resources . There have been multiple attempts to address the efficiency of HPO from different perspectives . Each of them has strengths and limitations . For example , Bayesian optimization ( BO ) ( Brochu et al. , 2010 ) , which is a class of global optimization algorithms , is used to minimize the total number of iterations to reach global optima . However , when the cost of different hyperparameter configurations is heterogeneous , vanilla BO may select a configuration that incurs unnecessarily high cost . As opposed to BO , local search ( LS ) methods ( Wu et al. , 2021 ) are able to control total cost by preventing very expensive trials until necessary , but they may get trapped in local optima . Multi-fidelity methods ( Jamieson & Talwalkar , 2016 ) aim to use cheap proxies to replace some of the expensive trials and approximate the accuracy assessment , but can only be used when such proxies exist . A single search strategy is difficult to meet the generic goal of economical HPO . In this work , we propose a blended search strategy which combines global search and local search strategy such that we can enjoy benefits from both worlds : ( 1 ) global search can ensure the convergence to the global optima when the budget is sufficient ; and ( 2 ) local search methods enable a better control on the cost incurred along the search trajectory . Given a particular global and local search method , our framework , which is named as BlendSearch , combines them according to the following design principles . ( 1 ) Instead of sticking with a particular method for configuration selection , we consider both of the candidate search methods and decide which one to use at each round of the configuration selection . ( 2 ) We use the global search method to help decide the starting points of local search threads . ( 3 ) We use the local search method to intervene the global search method ’ s configuration selection to avoid configurations that may incur unnecessarily large evaluation cost . ( 4 ) We prioritize search instances of both methods according to their performance and efficiency of performance improvement on the fly . Extensive empirical evaluation on the AutoML ∗Equal contribution Benchmark ( Gijsbers et al. , 2019 ) validates the robust performance of our method on a wide variety of datasets . BlendSearch is now publicly available in an open-source AutoML Library1 . 2 BACKGROUND AND RELATED WORK . We first briefly introduce the vanilla Bayesian optimization methods and local search methods , which are among the building blocks of our method . Bayesian optimization is a class of global optimization algorithms which is suitable for optimizing expensive black-box functions . It models the probabilistic distribution of the objective conditioned on the optimization variables . Typical models include Gaussian process ( Snoek et al. , 2012 ) , random forest ( Hutter et al. , 2011 ) , and tree Parzen estimator ( TPE ) ( Bergstra et al. , 2011 ) . In BO methods , an acquisition function is used to determine the next point to evaluate . Two common acquisition functions are the expected improvement ( EI ) ( Bull , 2011 ) over the currently best-observed objective and upper confidence bound ( UCB ) ( Srinivas et al. , 2009 ) . Local search methods are prevalent in the general optimization literature ( Spall et al. , 1992 ; Nesterov & Spokoiny , 2017 ) but less studied in the HPO literature due to the possibility of getting trapped in local optima ( György & Kocsis , 2011 ) . Recent work ( Wu et al. , 2021 ) shows that a local search method FLOW2 can make HPO cost-effective when combined with low-cost initialization and random restart . At each iteration , it samples a pair of vectors ( with opposite directions ) uniformly at random from a unit sphere , the center of which is the best configuration found so far ( a.k.a . incumbent ) and the radius of which is the current stepsize . Expensive configurations are avoided in the beginning as each iteration proposes a configuration near the incumbent . Random restart of the local search is performed once the convergence condition is satisfied . There are several attempts to address the limitations of vanilla BO or local search methods . BOwLS ( BO with local search ) ( Gao et al. , 2020 ) uses a BO model to select the starting point of a local search thread . Each local search thread is run until convergence and the BO model is updated with the start point and the converged loss . Trust region BO ( Eriksson et al. , 2019 ) fits a fixed number of local models and performs a principled global allocation of samples across these models via an implicit bandit approach . It is primarily designed for HPO problems with high-dimensional numerical hyperparamters . Unfortunately , all existing work that tries to combine global search with local search methods does not consider the heterogeneity of evaluation cost incurred along with the search . There are also a lot of attempts in making HPO efficient by speeding up configuration evaluation . Multifidelity optimizations ( Klein et al. , 2017 ; Li et al. , 2017 ; Kandasamy et al. , 2017 ; Falkner et al. , 2018 ; Lu et al. , 2019 ; Li et al. , 2020 ) are proposed for this purpose . They usually require an additional degree of freedom in the problem called ‘ fidelity ’ , to allow performance assessment on a configura- 1https : //github.com/microsoft/FLAML tion with different fidelities . There is surprisingly little prior work for generic cost-effective HPO . Gaussian process with expected improvement per second ( GPEIPS ) ( Snoek et al. , 2012 ) models the evaluation cost using another Gaussian process , and heuristically adds the estimated cost into the acquisition function . It does not always outperform GPEI as the acqusition function can overpenalize good but expensive configurations . 3 BLENDSEARCH . Our framework needs the following information as inputs . • B is the total budget of cost . In this work , we measure the cost by CPU/GPU time . • P is the input HPO problem , which has the following attributes characterizing the problem . – P.X is the search space in which each element x is a d-dimensional hyperparameter configuration . For a non-categorical hyperparameter coordinate i ∈ [ d ] , if different values of xi lead to heterogeneous cost and there is a known value P.xLowCosti corresponding to a low cost , it is considered as a controlled dimension . We use P.D to denote such a set of controlled dimensions . – P.LossFunc ( · ) is the loss function to be minimized in terms of the configurations x ∈ P.X . – P.CostFunc ( · ) is the cost function that outputs the cost incurred when evaluating x . The goal of an HPO algorithm is to minimize the loss P.LossFunc ( x ) with the constraint that the total cost incurred G ( π ) : = ∑ x∈I ( π ) P.CostFunc ( x ) ≤ B , where I ( π ) is the search trajectory of algorithm π . Note that both P.LossFunc ( x ) and P.CostFunc ( x ) are black-box functions meaning that typically the analytic form is not available , and only function values can be observed . In order to distinguish the operation of querying from loss/cost function and the loss/cost observation , we use P.LossFunc ( x ) and P.CostFunc ( x ) to denote the former , and use l ( x ) and c ( x ) to denote the latter . l and c ( omitting x ) are used when there is no ambiguity . • G is the global search method to be used . L is the local search method to be used . L.∆ is the largest stepsize used in local search method L , i.e. , the largest possible change on a hyperparameter value between two consecutive search steps . The overall design of our framework is presented in Figure 2 and Algorithm 1 . The key idea is to maintain a pool of search threads , one of which corresponds to global search and the others local search . The pool starts with one global search thread and gradually adds local search threads as the search goes on . Here a search thread is an instance of a global search or local search method , each with its own search trajectory . At each round , a search thread selector selects one of the search threads from the pool according to a priority metric that reflects the search threads ’ current performance and efficiency of performance improvement . The selected search thread will then be used to propose a configuration to evaluate in this round . When the selected search thread is the global search thread , a config validator first checks whether the proposed configuration is within the ‘ admissible ’ region for evaluation . If not , it uses a backup local search thread instead . A local search thread will be created only when the global search thread proposes a valid config and a certain create thread condition is met , and will be deleted once it converges . Two local search threads will be merged into one if they are close enough . The priority of each search thread is updated after each evaluation round . Algorithm 1 BlendSearch Inputs : HPO problem P , a global search method G , a local search method L , total budget B . 1 : Initialization : Initialize F .S = [ S0 ] where S0 is an instance of G. We denote by F .x0 the initial point of the search . By design , the values of the controlled dimensions of F .x0 are set to be P.xLowCost and those for the other dimensions are proposed by S0 . 2 : while F .c < B do 3 : S̃ , S̃bak ← SelectThread ( F ) 4 : ( x , l , c ) ← SearchEvaluate1Step ( S̃ , F , P ) 5 : if x is invalid then ( x , l , c ) ← SearchEvaluate1Step ( S̃bak , F , P ) 6 : if x is proposed by global search & CreateNewLSCondition is satisfied then 7 : Initialize S = InitializeSearchThread ( L , P , ( x , l , c ) ) 8 : Add the new LS thread S into the pool : F .S← F .S + S 9 : DeleteAndMergeLS ( F ) . Merge or delete existing LS threads when necessary 10 : Update F .Priority 11 : if x is proposed by global search then UpdateGSModel ( S0 , ( x , l , c ) ) For convenience , we use F to denote a collection of framework-level variables : • F .S is the list of search threads maintained in our framework . F .S contains at least one search thread and among them there is one and only one global search thread , i.e. , S0 , in F .S . • F .Priority is a priority dictionary , in which the keys are the search threads in F .S , and the values are the priority of the corresponding search threads . • Bookkeeping information of F : F .l∗ is the best loss achieved among all the search threads and F .c is the total cost consumed in our framework . • F .R is the ‘ admissible ’ region on the controlled dimensions of the current search , which is a hyperrectangle and can be written in the form of F .R : = { [ F .xmini , F .xmaxi ] } i∈D with F .xmini and F .xmaxi denoting the minimum and maximum value along the i-th dimension in F .R respectively . They are initially set as F .xmini = F .xmaxi = P.xLowCosti for all i ∈ D. The ‘ admissible ’ region gradually expands during the search : ( 1 ) it is expanded to cover all the points evaluated by all the search threads and all the points that are possible to be reached by the local search within one search step , as shown in line 7 and 8 of Algorithm 2 ; ( 2 ) it expands if a local search thread converges , as shown in line 3 of Algorithm 7 ( included in Appendix A ) . In the following , we explain the key steps in our algorithm . Step 1 : Search thread selector ( line 3 of Alg 1 ) . In addition to the primary search thread S̃ , SelectThread also outputs a backup search thread S̃bak which is guaranteed to be a local search thread . It is set to be none when there is no local search thread yet in F .S . Specifically , S̃ = arg max S∈F.S F .Priority ( S ) , S̃bak = { arg maxS∈ ( F.S\S0 ) F .Priority ( S ) F .S \ S0 6= ∅ None F .S \ S0 = ∅ , ( 1 ) The design of the priority metric follows the principle of optimism in the face of uncertainty from the multi-armed bandit problem to balance exploitation and exploration ( Lattimore & Szepesvári , 2020 ) . Specifically , linear extrapolation is performed adaptively and locally to calculate the improvement speed of each search thread . The estimated future reward based on such a linear extrapolation provides a first-order upper bound of the ground truth future reward assuming each search thread has a diminishing return , i.e. , the speed of improvement decreases as more resource is spent . Formally , we introduce the following variables and functions for each search thread S ∈ F .S . • Bookkeeping information : S.l1st and S.l2nd are the best loss so far and second best loss before the best loss is achieved . S.c1st and S.c2nd are the total cost taken when S.l1st and S.l2nd are achieved respectively . S.c is the total cost spent in S. S.x1st is the best configuration found so far . • S.s is the performance improvement speed of S. It is calculated as S.s = S.l 2nd−S.l1st S.c−S.c2nd . This formula is only valid when there is at least one improvement . Otherwise , we do not have enough information to estimate the speed of improvement . We set the speed to the highest speed of all the search threads when S.l2nd = S.l1st . It is due to an implicit assumption of diminishing return . • S.xmin and S.xmax are the minimum and maximum value of the i-th dimension of all hyperparameters configurations evaluated in S respectively . • S.CostImp ( · ) is a function whose input is a target loss and output is the anticipated cost for S to generate a better loss than this target . We use the following formula to compute it , which is intuitively using the cost for improvement in the past to estimate that in the future . S.CostImp ( l ) = max { S.c− S.c1st , S.c1st − S.c2nd , 2S.l 1st − l S.s } ( 2 ) Our proposed priority metric is essentially the negative of the projected loss of S : F .Priority ( S ) = − ( S.l1st − S.s× b ) ( 3 ) in which b = min ( maxS∈F.S S.CostImp ( F .l∗ ) , B − F .c ) . maxS∈F.S S.CostImp ( F .l∗ ) can be considered as the resource needed for every S to have a better performance than the currently best performance F .l∗ . Our priority metric estimates the loss of each search thread if such an amount of resource ( restricted by the budget left B − F .c ) is given . By considering both the search threads ’ current performance and potential improvement , it provides a fair trade-off between exploiting the currently-best and exploring the potentially-better choices . Algorithm 2 SearchEvaluate1Step Inputs : HPO problem P , search thread S , and F 1 : if S is None then Construct x as follows : generate the controlled dimensions of x by adding Guassian noises on the corresponding dimensions of F .x0 and for the rest of the dimensions sample uniformly at random from the search space P.X . 2 : else x← S.ProposeConfig ( ) 3 : if S = S0 ( i.e. , S is the global search thread ) & x /∈ F .R then x←invalid 4 : else l , c← P.LossFunc ( x ) , P.CostFunc ( x ) . Evaluate configuration x 5 : if x 6= invalid then 6 : BookKeeping ( S , x , l , c , F ) and update speed S.s , 7 : ∀i ∈ P.D , S.xmini ← min { xi , S.xmini } , F .xmini ← min { S.xmini − L.∆ , F .xmini } , 8 : ∀i ∈ P.D , S.xmaxi ← max { xi , S.xmaxi } , F .xmaxi ← max { S.xmaxi + L.∆ , F .xmaxi } 9 : Outputs : x , l , c Step 2 : Config validator and evaluator ( line 4-5 of Alg 1 ) . After a search thread ( and a backup search thread ) is selected , the next step is to propose the next configuration to try with the chosen search thread ( s ) . Intuitively speaking , we consider generating the next configuration to try primarily according to the selected search thread S̃ whose priority is ranked the highest . But we set a guard rail for the global search thread as it may propose an unnecessarily high-cost configuration . We thus introduce a config validator to validate the configurations proposed by global search according to whether they are within the current admissible region of our framework F .R ( line 3 of Alg 2 ) . A configuration marked as ‘ invalid ’ means that it is considered to be prone to incur unnecessarily high cost and will not be evaluated at this round . In this case , the selected backup search thread will be used to perform another round of SearchEvaluate1Step ( line 5 of Alg 1 ) if it is a valid search thread ( i.e. , not none ) . In the case where the backup thread is none , we generate the new configuration according to line 1 of Alg 2 . The config validator helps avoid potentially high-cost evaluation and thus avoid creating local search threads from high-cost points until necessary . It does not stick to local searches forever because the admissible region F .R gets expanded . Note that according to the definition of F .R , only the controlled dimensions of the hyperparameter configurations are subject to validation check . If needed , a multi-fidelity pruning strategy can be used in this config evaluator component . Multi-fidelity pruning does not necessarily yield better performance . So the adoption of multi-fidelity pruning in BlendSearch is optional . Step 3 : Search thread creator , updater and cleaner ( line 6-11 of Alg 1 ) . If the newly proposed configuration is proposed by global search and it is not marked as ‘ invalid ’ , we consider creating a new local search thread using the proposed configuration as a starting point . To make sure the newly created local search thread is relatively good , we first check whether the proposed configuration ’ s performance is better than at least half of the existing threads ’ performance ( specified in the CreateNewLSCondition ) . If so , a new local search thread will be initialized and added to the active search thread pool S. In DeleteAndMergeLS , we check whether a local search thread has converged according to the convergence condition of the specific local search method . If it is , the search thread will be removed from S. In addition , we also go through all the local search threads to see whether the incumbent of a LS thread is reachable in one step by another LS thread with lower loss ( ref . Appendix A ) . If so , the former LS thread will be deleted . After a configuration proposed by global search is evaluated , the observation tuple ( x , l , c ) is then used to update the model of the global search method through function UpdateGSModel . For example , when the global search method is a Bayesian optimization method , the model is the surrogate model used . Due to page limit , detailed pseudocode for several of the straightforward functions mentioned in our framework are provided in Appendix A , including CreateNewLSCondition , DeleteAndMergeLS , InitializeSearchThread and BookKeeping .
This paper proposes BlendSearch, which combines global and local optimisation for the problem of hyperparameter optimisation when search cost is heterogenous. To achieve so, they use the combination of one global search instance (e.g. Bayesian optimisation; used to identify promising regions as starting points for local search) with multiple local search instances (which actually do the search). The local search instances will be created, merged and deleted on the fly using the criteria proposed by the authors. The paper finally experimentally validates their approach in various hyperparameter tuning experiments to show promising results.
SP:59f3aa13da7e04d36e60a67555cd8254047e949a
Deformable Capsules for Object Detection
1 INTRODUCTION . Capsule networks promise many potential benefits over convolutional neural networks ( CNNs ) . These include practical benefits , such as requiring less data for training or better handling unbalanced class distributions ( Jiménez-Sánchez et al. , 2018 ) , and important theoretical benefits , such as buildingin stronger internal representations of objects ( Punjabi et al. , 2020 ) , and modeling the agreement between those intermediate representations which combine to form final object representations ( e.g . part-whole relationships ) ( Kosiorek et al. , 2019 ; Sabour et al. , 2017 ) . Although these benefits might not be seen in the performance metrics ( e.g . average precision ) on standard benchmark computer vision datasets , they are important for real-world applications . As an example , it was found by Alcorn et al . ( 2019 ) that CNNs fail to recognize 97 % of their pose space , while capsule networks have been shown to be far more robust to pose variations of objects ( Hinton et al. , 2018 ) ; further , real-world datasets are not often as extensive and cleanly distributed as ImageNet or MS COCO . These benefits are achieved in capsule networks by storing richer vector ( or matrix ) representations of features , rather than the simple scalars of CNNs , and dynamically choosing how to route that information through the network . The instantiation parameters for a feature are stored in these capsule vectors and contain information ( e.g . pose , deformation , hue , texture ) useful for constructing the object being modeled . Early studies have shown strong evidence that these vectors do in fact capture important local and global variations across objects ’ feature components ( or parts ) within a class ( Punjabi et al. , 2020 ; Sabour et al. , 2017 ) . Inside their networks , capsules dynamically route their information , seeking to maximize the agreement between these vector feature representations and the higher-level feature vectors they are attempting to form . Despite their potential benefits , many have remained unconvinced about the general applicability of capsule networks to large-scale computer vision tasks . To date , no capsule-based study has achieved classification performance comparable to a CNN on datasets such as ImageNet , instead relegated to smaller datasets such as MNIST or CIFAR . Worse still , to the best of our knowledge , no capsule network has shown successful results in object detection , a very important problem in computer vision , robotics , and medical imaging . Now , the argument can be made that standard benchmark datasets such as ImageNet or MS COCO likely contain majority of objects in that 3 % range of usual poses , and thus CNNs will appear to perform extremely well when measured in terms of accuracy , stripping capsule networks of one of their largest advantages . However , until capsule networks can perform on-par with CNNs on these typical object poses , few will care about the benefits of stronger internal representations and better generalization to unseen poses . Summary of Our Contributions : ( 1 ) We propose the first ever capsule-based object detection framework in the literature . Our network is a one-stage ( single-shot ) architecture , where objects are both localized and classified using capsules , and can perform on-par with the state-of-the-art CNNs on a large-scale dataset ( MS COCO ) . ( 2 ) We address the geometric constraint of convolutional capsules ( and locally-constrained routing ) by introducing deformable capsules , where parent capsules learn to adaptively sample child capsules , effectively eliminating rigid spatial restrictions while remaining memory efficient . ( 3 ) We design a new capsule-based prediction head structure , SplitCaps , which reformulates the projections of an objects ’ instantiation parameters , presence , and class , eliminating the previous dimensional increase of capsules by the number of classes . This crucial addition enables the training of capsule networks on large-scale computer vision datasets for the first time in the literature . ( 4 ) To route information across SplitCaps ’ unique structure , we introduce a novel Squeezeand-Excitation inspired dynamic routing algorithm , SE-Routing , which seeks to maximize agreement between child capsule projections , without the need of iterative loops 2 DEFORMABLE CAPSULES : FIXING LOCALLY-CONSTRAINED DYNAMIC ROUTING . The capsule network architecture proposed by Sabour et al . ( 2017 ) acted on global information , where digit capsules represented the pose and presence of digits in an image regardless of spatial location . The information from all children in the previous layer was sent to every parent in the following layer , weighted via the routing coefficients found in a cosine similarity routing algorithm . While this proved to be a highly-effective strategy , it was also computationally expensive , limiting its use to only small-scale datasets . Recent works attempted to scale up capsule networks to larger problems such as biomedical image segmentation ( LaLonde & Bagci , 2018 ) or action detection in video ( Duarte et al. , 2018 ) by using convolutional capsules and locally-constraining the routing algorithm . Although efficient solutions were presented in those studies , the representation power of capsule networks was fundamentally limited due to imposing local constraints . This is because convolutions , by design , have a fixed geometric structure ( Dai et al. , 2017 ) , and such a geometric constraint significantly inhibits capsules ’ ability to model part-whole relationships , relying on parts of objects to fall within a fixed local grid . Therefore , it is unreasonable to expect a capsule to effectively represent the pose and deformations of an object when the information related to the parts of that object are locked into a fixed spatial relationship . In this study , we propose to effectively solve this aforementioned problem by introducing a method that balances efficiency with the ability for a capsule to represent any pose and deformation of an object ( i.e . where child capsules can be found in different spatial relationships to one another for the same parent ) . In such a formulation , global information is not explicitly required , but it does require parent capsules to have more flexibility over which child capsules they draw information from . Our proposed solution is deformable capsules . The idea behind the proposed algorithm is simple : if parent capsules are supposed to capture common deformations of the objects they represent within their vectors , then the choice of which children to aggregate information from must be handled in a deformable manner as well . Deformable capsules allow parents to adaptively gather projections from a non-spatially-fixed set of children , and thus effectively and efficiently model objects ’ poses . To achieve this overall goal , we follow the same efficient convolutional capsule paradigm , where projection vectors are formed via a convolution operation with a kernel centered on the parent capsules ’ spatial location , but now we learn an additional set of weights for each parent capsule . These learnable weights are the same shape as each parent ’ s kernel , and represent the offset values for the spatial sampling of child capsules for that parent . Based on the child capsule representation vectors in the previous layer , these weights learn which children a parent capsule should adaptively sample from for a given input image . Dynamic routing then determines how to weight the information coming from each of these children based on their agreement for each projected parent . Let us give a concrete example to better illustrate the parameter savings of this technique . Given a H = 128 by W = 128 grid of child capsules with ci = 32 capsule types of ai = 8 atoms each , being routed to a set of cj = 10 parent capsule types of aj = 16 atoms each , the fully-connected capsules of Sabour et al . ( 2017 ) would requireH×W×ci×ai×cj×aj ⇒ 128×128×32×8×10×16 ≈ 671M parameters for this layer alone ( assuming the goal is classification , with detection requiring a multiplicative increase by the detection grid size ) . Instead , using our proposed deformable capsules with a k2 = 52 kernel , we only require 2× k× k× ai × cj × aj ⇒ 2× 5× 5× 8× 10× 16 ≈ 64K parameters . Convolutional capsules with locally-constrained routing require 32K parameters , not needing the additional spatial offsets kernel , but as mentioned above , they are fundamentally limited in the poses and deformations that they can represent . In our experiments , we found deformable capsules to converge faster and to much higher performance than convolutional capsules . 3 OBJECTS AS CAPSULES : SplitCaps WITH SE-Routing We propose a novel one-stage ( single-shot ) capsule network architecture for object detection , called DeformCaps , where objects are detected , classified , and modeled with capsules . Our overall network architecture , shown in Fig . 1 , is built upon CenterNet by Zhou et al . ( 2019a ) who proposed to represent objects in images as scalar point values located at the center of their bounding boxes . The authors then regress the remaining characteristics of the object ( e.g . height , width , depth ) for each center-point detected . In our work , we follow the same center-point detection paradigm , but represent our objects with capsule vectors instead . Since several recent studies have found utilizing a CNN backbone before forming capsule types to be beneficial to overall performance ( Duarte et al. , 2018 ; Kosiorek et al. , 2019 ; Tsai et al. , 2020 ) , we adopt the preferred backbone of CenterNet , DLA-34 ( Yu et al. , 2018 ) , as this gave the best trade-off between speed and accuracy . Features extracted from the backbone are sent to our capsule object detection head and a bounding box regression head . In order to perform object detection using capsules , we introduce a new capsule structure , called SplitCaps , composed of class-agnostic and class-presence capsules , and a novel routing algorithm , called SE-Routing . 3.1 SPLITCAPS : CLASS-AGNOSTIC CAPSULES AND CLASS-PRESENCE CAPSULES . As discussed in Section 2 , the original CapsNet by Sabour et al . ( 2017 ) was extremely expensive in computation and our proposed deformable capsules is a best possible solution to balance non-rigid deformations of objects while remaining memory efficient . However , there is a more significant memory hurdle capsule networks must overcome when scaling up to large-scale datasets , such as MS COCO . In their current implementation , capsule networks represent each class with its own parent capsule vector . On small scale classification datasets ( and using deformable routing ) , this is not an issue ; it amounts to 2× k× k× ai × cj × aj parameters and N × ci × cj × aj × 4 bytes to store the intermediate representations to be routed for the parents , where cj is usually around 10 classes to represent . Let us suppose we have 5× 5 kernels with 32 input capsule types of 8 atoms per capsule , 10 output capsule types of 16 atoms per capsule , and a batch size of 32 . In total , we would have 2× 5× 5× 8× 10× 16 = 64K parameters and 32× 32× 10× 16× 4 ≈ 655 KB . When we scale this up to object detection , we now need to store representations for every possible object location , and for MS COCO we need to represent 80 possible classes . This gives us 2× k × k×ai× cj ×aj ⇒ 2×5×5×8×80×16 = 512K parameters and N ×H×W × ci× cj ×aj ×4 bytes⇒ 32× 128× 128× 32× 80× 16× 4 ≈ 86 GB for the intermediate representations , where we assume the output grid of detections is 128 × 128 with a single detection ( i.e . bounding box ) predicted per class per location . The problem is not any better for large-scale classification datasets such as ImageNet either , where we lose the grid of predictions but grow to 1000 classes , which would require 2× 5× 5× 8× 1000× 16 = 6.4M parameters and 32× 32× 1000× 16× 4 ≈ 66 GB for the intermediate representations . Clearly , with most GPU memories limited to 12–24 GB , a solution is needed to be found for capsule networks to scale up to larger-scale computer vision tasks . To overcome this issue , we propose a new type of capsule architecture , SplitCaps , to more efficiently scale capsule networks to large-scale computer vision tasks . SplitCaps contains two parent capsule types , each with a different number of atoms per capsule , for each location of the detection grid . As before , the idea is to balance efficiency with the ability to learn powerful representations . Towards this goal , SplitCaps proposes to divide up between its two parent capsules the tasks of ( i ) learning the instantiation parameters necessary to model the possible variations of an object and ( ii ) predicting which classes of objects are present in a given input . The first capsule type we refer is our classagnostic object instantiation capsules , and the second we refer is class presence capsules . Class-agnostic object instantiation capsules : The purpose of these capsules is similar to those in previous works : model the possible variations ( in pose , deformation , texture , etc . ) of objects within a vector of instantiation parameters , the span of which should cover all possible variations for that object at test ( hence why capsules are better than CNNs at generalizing to unseen poses ) . While previous capsule networks did this in a class-wise manner , we argue such a formulation is not required and possibly it is redundant . Many variations ( e.g . rotation , skew , stroke thickness ) may be class-independent , and thus to model these variations class-wise would require repetition across each capsule type . Instead , we propose to model all classes within a single capsule type ( i.e . class-agnostic ) . In this way , while class-dependent variations would each require their own dimensions of the vector , class-independent variations can each be modeled along a single dimension for all possible objects . Since it is reasonable to assume there will be at least some class-specific variations , we increase the default capsule vector dimension from 16 to 64 to accommodate for possible class-specific instantiation parameters . During training , if an object is present at a given spatial location , the 64-dimensional capsule vector for that location is fed to a reconstruction regularization sub-network to construct the mask of that object as similar to the reconstruction regularization used by Sabour et al . ( 2017 ) for classification . This sub-network is a relatively small and fast addition : a set of three ReLU-activated 1× 1 convolutional layers with 256 filters each , followed by a final sigmoid-activated 1 × 1 convolution with N = n2 = 282 = 784 filters , before reshaping outputs to n× n. Since objects ’ scales vary dramatically , we scale normalize all objects ’ ground-truth masks to be 28 × 28 ( by following He et al . ( 2017 ) ) . Supervised training is conducted by computing the Dice loss ( Milletari et al. , 2016 ) between the predicted reconstruction , r , and the object ’ s mask , m Lr = 2 ∑N i rimi∑N i r 2 i + ∑N i m 2 i , ( 1 ) where Lr is used to provide a regularization signal to the instantiation parameters being learned . Class presence capsules : The class presence capsules attempt to model which classes of objects are present in the input at each spatial location , if any . We accomplish this by setting the atoms per capsule to the number of classes being represented ( i.e . 80 for MS COCO ) . Just as Hinton et al . ( 2018 ) separately modeled pose ( with a matrix ) and activation ( with a scalar ) , this 80-dimensional vector can be viewed as a class-dependent set of activation values . The activation values are then passed through a sigmoid function and thresholded ; if one or more activation values are above the threshold , an object is determined to be at that spatial location with the strongest activated dimension determining the class label . In order to produce a smooth loss function during training , we create a ground-truth heatmap by fitting a Gaussian distribution rather than a single point , to the center-point of each object ’ s bounding box , with variance proportional to the size of the box following Zhou et al . ( 2019a ) . More specifically , we create a heatmap H ∈ [ 0 , 1 ] Xd ×Yd ×K containing each down-scaled ground truth center-point p̃ = ( px d , py d ) for class k ∈ K using a Gaussian kernelHxyk = exp ( − ( x−p̃x ) 2+ ( y−p̃y ) 2 2σ2p ) , where d is the amount of downsampling in the network and σp is an object-size-adaptive standard deviation ( Law & Deng , 2018 ) . In the case of overlapping Gaussians , we take the element-wise maximum . To handle the large class imbalance between objects and background in our heatmaps , we use a penalty-reduced pixel-wise logistic regression with a focal loss ( Lin et al. , 2017 ) : Lh = −1 P ∑ xyk { ( 1− Ĥxyk ) α log ( Ĥxyk ) if Hxyk = 1 , ( 1−Hxyk ) β ( Ĥxyk ) α log ( 1− Ĥxyk ) , otherwise ; ( 2 ) where α , β are hyper-parameters of the focal loss , P is the number of center-points in the input , used to normalize all positive focal loss instances to 1 ( Zhou et al. , 2019a ) . We use α = 2 and β = 4 in all our experiments , following Law & Deng ( 2018 ) . At test , to efficiently retrieve the object ’ s exact center , we run a 3× 3 max-pooling over the thresholded spatial map . To predict the height and width of the bounding boxes of objects and recover the x , y offsets needed to map back to the upscaled image dimensions , we follow the same formulation as Zhou et al . ( 2019a ) and pass the backbone features through a 3× 3 convolutional layer with 256 feature maps , then a 1× 1 convolutional layer with 2 feature maps . These layers predict the local offset , Ô ∈ RWd ×Hd ×2 , and size prediction , Ŝ ∈ RWd ×Hd ×2 , for each center-point and are supervised by Lo = 1 P ∑ p ∣∣∣Ôp̃ − ( p d − p̃ ) ∣∣∣ and Ls = 1 P ∑ p ∣∣∣Ŝp − ( x2 − x1 , y2 − y1 ) ∣∣∣ , ( 3 ) respectively . Our final objective function is thus defined as L = Lh + λrLr + λsLs + λoLo . We keep λs = 0.1 and λo = 1 as done in Zhou et al . ( 2019a ) , and set λr = 0.1 initially , then step up to λr = 2.0 at the half-way in training .
The paper proposes to use the capsules to perform object detection on COCO. Capsules, while showing promises, are usually too expensive for tasks beyond MNIST and Cifar. The authors propose three key improvements in DeformCaps, SplitCaps and SE-Routing to improve the efficiency and therefore allow capsules to be applied on larger tasks such as object detection. The authors claim novelties in:
SP:ba5cdfc4c1ad55f08c3e39934785e11e61b202ea
Deformable Capsules for Object Detection
1 INTRODUCTION . Capsule networks promise many potential benefits over convolutional neural networks ( CNNs ) . These include practical benefits , such as requiring less data for training or better handling unbalanced class distributions ( Jiménez-Sánchez et al. , 2018 ) , and important theoretical benefits , such as buildingin stronger internal representations of objects ( Punjabi et al. , 2020 ) , and modeling the agreement between those intermediate representations which combine to form final object representations ( e.g . part-whole relationships ) ( Kosiorek et al. , 2019 ; Sabour et al. , 2017 ) . Although these benefits might not be seen in the performance metrics ( e.g . average precision ) on standard benchmark computer vision datasets , they are important for real-world applications . As an example , it was found by Alcorn et al . ( 2019 ) that CNNs fail to recognize 97 % of their pose space , while capsule networks have been shown to be far more robust to pose variations of objects ( Hinton et al. , 2018 ) ; further , real-world datasets are not often as extensive and cleanly distributed as ImageNet or MS COCO . These benefits are achieved in capsule networks by storing richer vector ( or matrix ) representations of features , rather than the simple scalars of CNNs , and dynamically choosing how to route that information through the network . The instantiation parameters for a feature are stored in these capsule vectors and contain information ( e.g . pose , deformation , hue , texture ) useful for constructing the object being modeled . Early studies have shown strong evidence that these vectors do in fact capture important local and global variations across objects ’ feature components ( or parts ) within a class ( Punjabi et al. , 2020 ; Sabour et al. , 2017 ) . Inside their networks , capsules dynamically route their information , seeking to maximize the agreement between these vector feature representations and the higher-level feature vectors they are attempting to form . Despite their potential benefits , many have remained unconvinced about the general applicability of capsule networks to large-scale computer vision tasks . To date , no capsule-based study has achieved classification performance comparable to a CNN on datasets such as ImageNet , instead relegated to smaller datasets such as MNIST or CIFAR . Worse still , to the best of our knowledge , no capsule network has shown successful results in object detection , a very important problem in computer vision , robotics , and medical imaging . Now , the argument can be made that standard benchmark datasets such as ImageNet or MS COCO likely contain majority of objects in that 3 % range of usual poses , and thus CNNs will appear to perform extremely well when measured in terms of accuracy , stripping capsule networks of one of their largest advantages . However , until capsule networks can perform on-par with CNNs on these typical object poses , few will care about the benefits of stronger internal representations and better generalization to unseen poses . Summary of Our Contributions : ( 1 ) We propose the first ever capsule-based object detection framework in the literature . Our network is a one-stage ( single-shot ) architecture , where objects are both localized and classified using capsules , and can perform on-par with the state-of-the-art CNNs on a large-scale dataset ( MS COCO ) . ( 2 ) We address the geometric constraint of convolutional capsules ( and locally-constrained routing ) by introducing deformable capsules , where parent capsules learn to adaptively sample child capsules , effectively eliminating rigid spatial restrictions while remaining memory efficient . ( 3 ) We design a new capsule-based prediction head structure , SplitCaps , which reformulates the projections of an objects ’ instantiation parameters , presence , and class , eliminating the previous dimensional increase of capsules by the number of classes . This crucial addition enables the training of capsule networks on large-scale computer vision datasets for the first time in the literature . ( 4 ) To route information across SplitCaps ’ unique structure , we introduce a novel Squeezeand-Excitation inspired dynamic routing algorithm , SE-Routing , which seeks to maximize agreement between child capsule projections , without the need of iterative loops 2 DEFORMABLE CAPSULES : FIXING LOCALLY-CONSTRAINED DYNAMIC ROUTING . The capsule network architecture proposed by Sabour et al . ( 2017 ) acted on global information , where digit capsules represented the pose and presence of digits in an image regardless of spatial location . The information from all children in the previous layer was sent to every parent in the following layer , weighted via the routing coefficients found in a cosine similarity routing algorithm . While this proved to be a highly-effective strategy , it was also computationally expensive , limiting its use to only small-scale datasets . Recent works attempted to scale up capsule networks to larger problems such as biomedical image segmentation ( LaLonde & Bagci , 2018 ) or action detection in video ( Duarte et al. , 2018 ) by using convolutional capsules and locally-constraining the routing algorithm . Although efficient solutions were presented in those studies , the representation power of capsule networks was fundamentally limited due to imposing local constraints . This is because convolutions , by design , have a fixed geometric structure ( Dai et al. , 2017 ) , and such a geometric constraint significantly inhibits capsules ’ ability to model part-whole relationships , relying on parts of objects to fall within a fixed local grid . Therefore , it is unreasonable to expect a capsule to effectively represent the pose and deformations of an object when the information related to the parts of that object are locked into a fixed spatial relationship . In this study , we propose to effectively solve this aforementioned problem by introducing a method that balances efficiency with the ability for a capsule to represent any pose and deformation of an object ( i.e . where child capsules can be found in different spatial relationships to one another for the same parent ) . In such a formulation , global information is not explicitly required , but it does require parent capsules to have more flexibility over which child capsules they draw information from . Our proposed solution is deformable capsules . The idea behind the proposed algorithm is simple : if parent capsules are supposed to capture common deformations of the objects they represent within their vectors , then the choice of which children to aggregate information from must be handled in a deformable manner as well . Deformable capsules allow parents to adaptively gather projections from a non-spatially-fixed set of children , and thus effectively and efficiently model objects ’ poses . To achieve this overall goal , we follow the same efficient convolutional capsule paradigm , where projection vectors are formed via a convolution operation with a kernel centered on the parent capsules ’ spatial location , but now we learn an additional set of weights for each parent capsule . These learnable weights are the same shape as each parent ’ s kernel , and represent the offset values for the spatial sampling of child capsules for that parent . Based on the child capsule representation vectors in the previous layer , these weights learn which children a parent capsule should adaptively sample from for a given input image . Dynamic routing then determines how to weight the information coming from each of these children based on their agreement for each projected parent . Let us give a concrete example to better illustrate the parameter savings of this technique . Given a H = 128 by W = 128 grid of child capsules with ci = 32 capsule types of ai = 8 atoms each , being routed to a set of cj = 10 parent capsule types of aj = 16 atoms each , the fully-connected capsules of Sabour et al . ( 2017 ) would requireH×W×ci×ai×cj×aj ⇒ 128×128×32×8×10×16 ≈ 671M parameters for this layer alone ( assuming the goal is classification , with detection requiring a multiplicative increase by the detection grid size ) . Instead , using our proposed deformable capsules with a k2 = 52 kernel , we only require 2× k× k× ai × cj × aj ⇒ 2× 5× 5× 8× 10× 16 ≈ 64K parameters . Convolutional capsules with locally-constrained routing require 32K parameters , not needing the additional spatial offsets kernel , but as mentioned above , they are fundamentally limited in the poses and deformations that they can represent . In our experiments , we found deformable capsules to converge faster and to much higher performance than convolutional capsules . 3 OBJECTS AS CAPSULES : SplitCaps WITH SE-Routing We propose a novel one-stage ( single-shot ) capsule network architecture for object detection , called DeformCaps , where objects are detected , classified , and modeled with capsules . Our overall network architecture , shown in Fig . 1 , is built upon CenterNet by Zhou et al . ( 2019a ) who proposed to represent objects in images as scalar point values located at the center of their bounding boxes . The authors then regress the remaining characteristics of the object ( e.g . height , width , depth ) for each center-point detected . In our work , we follow the same center-point detection paradigm , but represent our objects with capsule vectors instead . Since several recent studies have found utilizing a CNN backbone before forming capsule types to be beneficial to overall performance ( Duarte et al. , 2018 ; Kosiorek et al. , 2019 ; Tsai et al. , 2020 ) , we adopt the preferred backbone of CenterNet , DLA-34 ( Yu et al. , 2018 ) , as this gave the best trade-off between speed and accuracy . Features extracted from the backbone are sent to our capsule object detection head and a bounding box regression head . In order to perform object detection using capsules , we introduce a new capsule structure , called SplitCaps , composed of class-agnostic and class-presence capsules , and a novel routing algorithm , called SE-Routing . 3.1 SPLITCAPS : CLASS-AGNOSTIC CAPSULES AND CLASS-PRESENCE CAPSULES . As discussed in Section 2 , the original CapsNet by Sabour et al . ( 2017 ) was extremely expensive in computation and our proposed deformable capsules is a best possible solution to balance non-rigid deformations of objects while remaining memory efficient . However , there is a more significant memory hurdle capsule networks must overcome when scaling up to large-scale datasets , such as MS COCO . In their current implementation , capsule networks represent each class with its own parent capsule vector . On small scale classification datasets ( and using deformable routing ) , this is not an issue ; it amounts to 2× k× k× ai × cj × aj parameters and N × ci × cj × aj × 4 bytes to store the intermediate representations to be routed for the parents , where cj is usually around 10 classes to represent . Let us suppose we have 5× 5 kernels with 32 input capsule types of 8 atoms per capsule , 10 output capsule types of 16 atoms per capsule , and a batch size of 32 . In total , we would have 2× 5× 5× 8× 10× 16 = 64K parameters and 32× 32× 10× 16× 4 ≈ 655 KB . When we scale this up to object detection , we now need to store representations for every possible object location , and for MS COCO we need to represent 80 possible classes . This gives us 2× k × k×ai× cj ×aj ⇒ 2×5×5×8×80×16 = 512K parameters and N ×H×W × ci× cj ×aj ×4 bytes⇒ 32× 128× 128× 32× 80× 16× 4 ≈ 86 GB for the intermediate representations , where we assume the output grid of detections is 128 × 128 with a single detection ( i.e . bounding box ) predicted per class per location . The problem is not any better for large-scale classification datasets such as ImageNet either , where we lose the grid of predictions but grow to 1000 classes , which would require 2× 5× 5× 8× 1000× 16 = 6.4M parameters and 32× 32× 1000× 16× 4 ≈ 66 GB for the intermediate representations . Clearly , with most GPU memories limited to 12–24 GB , a solution is needed to be found for capsule networks to scale up to larger-scale computer vision tasks . To overcome this issue , we propose a new type of capsule architecture , SplitCaps , to more efficiently scale capsule networks to large-scale computer vision tasks . SplitCaps contains two parent capsule types , each with a different number of atoms per capsule , for each location of the detection grid . As before , the idea is to balance efficiency with the ability to learn powerful representations . Towards this goal , SplitCaps proposes to divide up between its two parent capsules the tasks of ( i ) learning the instantiation parameters necessary to model the possible variations of an object and ( ii ) predicting which classes of objects are present in a given input . The first capsule type we refer is our classagnostic object instantiation capsules , and the second we refer is class presence capsules . Class-agnostic object instantiation capsules : The purpose of these capsules is similar to those in previous works : model the possible variations ( in pose , deformation , texture , etc . ) of objects within a vector of instantiation parameters , the span of which should cover all possible variations for that object at test ( hence why capsules are better than CNNs at generalizing to unseen poses ) . While previous capsule networks did this in a class-wise manner , we argue such a formulation is not required and possibly it is redundant . Many variations ( e.g . rotation , skew , stroke thickness ) may be class-independent , and thus to model these variations class-wise would require repetition across each capsule type . Instead , we propose to model all classes within a single capsule type ( i.e . class-agnostic ) . In this way , while class-dependent variations would each require their own dimensions of the vector , class-independent variations can each be modeled along a single dimension for all possible objects . Since it is reasonable to assume there will be at least some class-specific variations , we increase the default capsule vector dimension from 16 to 64 to accommodate for possible class-specific instantiation parameters . During training , if an object is present at a given spatial location , the 64-dimensional capsule vector for that location is fed to a reconstruction regularization sub-network to construct the mask of that object as similar to the reconstruction regularization used by Sabour et al . ( 2017 ) for classification . This sub-network is a relatively small and fast addition : a set of three ReLU-activated 1× 1 convolutional layers with 256 filters each , followed by a final sigmoid-activated 1 × 1 convolution with N = n2 = 282 = 784 filters , before reshaping outputs to n× n. Since objects ’ scales vary dramatically , we scale normalize all objects ’ ground-truth masks to be 28 × 28 ( by following He et al . ( 2017 ) ) . Supervised training is conducted by computing the Dice loss ( Milletari et al. , 2016 ) between the predicted reconstruction , r , and the object ’ s mask , m Lr = 2 ∑N i rimi∑N i r 2 i + ∑N i m 2 i , ( 1 ) where Lr is used to provide a regularization signal to the instantiation parameters being learned . Class presence capsules : The class presence capsules attempt to model which classes of objects are present in the input at each spatial location , if any . We accomplish this by setting the atoms per capsule to the number of classes being represented ( i.e . 80 for MS COCO ) . Just as Hinton et al . ( 2018 ) separately modeled pose ( with a matrix ) and activation ( with a scalar ) , this 80-dimensional vector can be viewed as a class-dependent set of activation values . The activation values are then passed through a sigmoid function and thresholded ; if one or more activation values are above the threshold , an object is determined to be at that spatial location with the strongest activated dimension determining the class label . In order to produce a smooth loss function during training , we create a ground-truth heatmap by fitting a Gaussian distribution rather than a single point , to the center-point of each object ’ s bounding box , with variance proportional to the size of the box following Zhou et al . ( 2019a ) . More specifically , we create a heatmap H ∈ [ 0 , 1 ] Xd ×Yd ×K containing each down-scaled ground truth center-point p̃ = ( px d , py d ) for class k ∈ K using a Gaussian kernelHxyk = exp ( − ( x−p̃x ) 2+ ( y−p̃y ) 2 2σ2p ) , where d is the amount of downsampling in the network and σp is an object-size-adaptive standard deviation ( Law & Deng , 2018 ) . In the case of overlapping Gaussians , we take the element-wise maximum . To handle the large class imbalance between objects and background in our heatmaps , we use a penalty-reduced pixel-wise logistic regression with a focal loss ( Lin et al. , 2017 ) : Lh = −1 P ∑ xyk { ( 1− Ĥxyk ) α log ( Ĥxyk ) if Hxyk = 1 , ( 1−Hxyk ) β ( Ĥxyk ) α log ( 1− Ĥxyk ) , otherwise ; ( 2 ) where α , β are hyper-parameters of the focal loss , P is the number of center-points in the input , used to normalize all positive focal loss instances to 1 ( Zhou et al. , 2019a ) . We use α = 2 and β = 4 in all our experiments , following Law & Deng ( 2018 ) . At test , to efficiently retrieve the object ’ s exact center , we run a 3× 3 max-pooling over the thresholded spatial map . To predict the height and width of the bounding boxes of objects and recover the x , y offsets needed to map back to the upscaled image dimensions , we follow the same formulation as Zhou et al . ( 2019a ) and pass the backbone features through a 3× 3 convolutional layer with 256 feature maps , then a 1× 1 convolutional layer with 2 feature maps . These layers predict the local offset , Ô ∈ RWd ×Hd ×2 , and size prediction , Ŝ ∈ RWd ×Hd ×2 , for each center-point and are supervised by Lo = 1 P ∑ p ∣∣∣Ôp̃ − ( p d − p̃ ) ∣∣∣ and Ls = 1 P ∑ p ∣∣∣Ŝp − ( x2 − x1 , y2 − y1 ) ∣∣∣ , ( 3 ) respectively . Our final objective function is thus defined as L = Lh + λrLr + λsLs + λoLo . We keep λs = 0.1 and λo = 1 as done in Zhou et al . ( 2019a ) , and set λr = 0.1 initially , then step up to λr = 2.0 at the half-way in training .
This paper introduces capsule network for object detection. To solve the issue of capsule network when applied to large-scale detection problems, this paper develops deformable capsules, a new prediction head SplitCaps, and a dynamic routing algorithm, SE-Routing. Experiments are conducted on COCO where it performs slightly worse than the baselines but arguably predicts less false positives.
SP:ba5cdfc4c1ad55f08c3e39934785e11e61b202ea
Learning Associative Inference Using Fast Weight Memory
1 INTRODUCTION . Humans continually adapt in order to understand new situations in changing environments . One important adaptive ability is associative inference for composing features extracted from distinct experiences and relating them to each other ( Schlichting & Preston , 2015 ; Gershman et al. , 2015 ) . Suppose Alice has shared with you pictures of her toddler . Later , at the office party , you see a man carrying the depicted toddler . Since the toddler yields a shared feature in two different contexts , it may be plausible to infer that the man is Alice ’ s partner , without ever seeing him and Alice together . The ability to rapidly associate and bind together novel stimuli can help to derive knowledge systematically , in addition to the knowledge gained directly from observation . Virtually all modern cognitive architectures applied to challenging artificial intelligence problems are based on deep artificial neural networks ( NNs ) . Despite their empirical successes and theoretical generality , NNs tend to struggle to generalise in situations similar to the given example ( Lake et al. , 2017 ; Phillips , 1995 ; Lake & Baroni , 2017 ) . This weakness becomes even more severe if the training and test data exhibit systematic differences ( Atzmon et al. , 2016 ; Agrawal et al. , 2017 ) . For example , during training , the man ’ s representation might never be associated with the toddler ’ s , but during testing , this association might be necessary to make a useful prediction . In problems where humans excel , this sort of inference is likely ubiquitous since data is often combinatorially complex in a way that observations used during training will likely cover just a small fraction of all possible compositions . Such a lack of productivity and systematicity is a long-standing argument against the use of NNs as a substrate of an artificial cognitive architecture ( Fodor & Pylyshyn , 1988 ; Hadley , 1994 ; McLaughlin , 2009 ) . The hidden state of a neural model is a learned representation of the task-relevant information extracted from the input . To generalise to never-seen-before compositions of stimuli , the function which produces the state representation must be able to systematically construct all possible states . This requires a general and preferrably differentiable method , such as the Tensor Product Representation ( TPR ; Smolensky ( 1990 ) ) . TPRs provide a general and differentiable method for embed- 1Source code and data used in this paper is available at github.com/ischlag/Fast-Weight-Memory-public ding symbolic structures in vector spaces . A TPR state representation is constructed via the tensor product ( i.e . the generalised outer-product ) of learned component representations . Under certain constraints , such a mechanism guarantees a unique representation for every possible combination of components ( Smolensky , 1990 ; 2012 ) . In this work , we augment a recurrent NN ( RNN ) with an additional TPR-like memory representation . To facilitate the learning of multi-step associative inference , the TPR memory can be queried multiple times in a row , allowing the model to chain together various independent associations . In contrast to previous work on fast weights , we apply our memory-augmented RNN to much longer sequences . This requires the model to update its associative memory . Furthermore , we demonstrate the generality of our method by applying it to meta-reinforcement learning and small scale language modelling problems . In the next section , we cover related memory-augmented NNs . Section 3 describes the FWM in detail . Section 4 demonstrates the generality of our method through experiments in the supervised , self-supervised , and meta-reinforcement learning setting . The supervised-learning experiments in subsection 4.1 consist of a more challenging version of the bAbI dataset dubbed concatenated-bAbI or catbAbI . The meta-reinforcement learning experiment in section 4.2 demonstrates the FWM ’ s ability to learn to explore a partially observable environment through its ability to perform associative inference . Finally , the self-supervised experiments in subsection 4.3 demonstrate that the FWM can compete with the state-of-the-art word-level language models on small benchmark datasets . 2 RELATED WORK . RNNs such as the Long Short-Term Memory ( LSTM ; Hochreiter & Schmidhuber ( 1997 ) ; Gers et al . ( 2000 ) ) are in theory capable of implementing any algorithm ( Siegelmann & Sontag , 1991 ) . However , the linear growth of the hidden state of a fully connected RNN leads to quadratic growth in the number of trainable weights . Early work addressed this issue through the use of additional memory ( Das et al. , 1992 ; Mozer & Das , 1993 ) and differentiable fast weights ( Schmidhuber , 1992 ; 1993 ) . Recently , memory-augmented NNs have solved algorithmic toy problems ( Graves et al. , 2014 ; 2016 ) as well as reasoning and inference problems in synthetic and natural language ( Weston et al. , 2015b ; Xiong et al. , 2016 ) . Inspired by the random-access memory of computer architectures , a common approach is to incorporate a soft and differentiable lookup table into the NN model . Such slot-based memory matrices have shown to be difficult to train ( Munkhdalai & Yu , 2017b ) and require sophisticated mechanisms for the allocation and deallocation of memory ( Csordas & Schmidhuber , 2019 ) . The TransformerXL ( TXL ; Dai et al . ( 2019 ) ) , an autoregressive language model variant of the Transformer ( Vaswani et al. , 2017 ) , can be understood as a slot-based memory-augmented RNN where every new state is pushed into an immutable queue of finite size . Although it is recurrent , the layers of a transformer architecture are strictly forced to use inputs from a lower layer which limits its generality . Nevertheless , a sufficiently deep and well regularised TXL model has achieved state-of-the-art performance in large scale language modelling tasks . A biologically more plausible alternative of increasing the memory capacity of NNs are fastchanging weights , i.e . stateful weights that can adapt as a function of its input . Non-differentiable fast weights or “ dynamic links ” have been published since 1981 ( von der Malsburg , 1981 ; Feldman , 1982 ; Hinton & Plaut , 1987 ) . Subsequent work showed that a regular network can be trained by gradient descent to control the fast weights of a separate network ( Schmidhuber , 1992 ) or of itself ( Schmidhuber , 1993 ) in an end-to-end differentiable fashion . Recently , fast weights have made a comeback and achieved good results in small toy problems where regular NNs fall short ( Ba et al. , 2016a ; Schlag & Schmidhuber , 2017 ; Munkhdalai & Yu , 2017a ; Pritzel et al. , 2017 ; Ha et al. , 2017 ; Zhang & Zhou , 2017 ; Miconi et al. , 2018 ; 2019 ; Schlag & Schmidhuber , 2018 ; Munkhdalai et al. , 2019 ; Bartunov et al. , 2020 ) . Most memory-augmented NNs are based on content-based or key-based lookup mechanisms . An alternative to the storage of patterns in a lookup table is the idea that patterns are reconstructed through the implicit iterative minimisation of an energy function , such as in the classical Hopfield network ( Steinbuch , 1961 ; Willshaw et al. , 1969 ; Hopfield , 1982 ; Kanerva , 1988 ) or the modern Hopfield network ( Krotov & Hopfield , 2016 ; Demircigil et al. , 2017 ; Ramsauer et al. , 2020 ) . This is often described as an auto-associative type of memory as it reconstructs a previously stored pattern that mostly resembles the current pattern . A much less studied variation is the hetero-associative memory ( see e.g . Kosko ( 1988 ) ) where the retrieved pattern is different from the input pattern . This is more relevant for our use case . We aim to train an LSTM to construct , maintain , and edit its associative memory . The ability to edit Hopfield networks partially is not very well studied . For this reason , we employ a simple ( multi- ) linear hetero-associative memory as it is more closely related to the theory of TPRs ( whose manipulation is well understood ) and because the association is retrieved in a single step . Our work directly builds on two examples of differentiable fast weight memories : the TPR-RNN by Schlag & Schmidhuber ( 2018 ) and the Metalearned Neural Memory ( MNM ) by Munkhdalai et al . ( 2019 ) . The TPR-RNN is a sentence-level model for reasoning on text . It achieves excellent results on the regular bAbI tasks but it underperforms on word-level bAbI ( Schlag et al. , 2019 ) or algorithmic toy problems ( Le et al. , 2020 ) . In contrast , the MNM is a word-level model which augments the LSTM with a fully-connected multi-layer feed-forward network as its memory and trains it using a meta-learning objective . Both , MNM and TPR-RNN were developed on the regular bAbI dataset which only contains short sequences and does not require the model to remove deprecated associations from its memory . In this work , we train on an infinite sequence of bAbI stories where our FWM achieves excellent performance and improves over MNM . We further demonstrate strong performance in small-scale language modelling and meta reinforcement-learning which demonstrates the generality of our contribution . 3 PROPOSED METHOD . Our FWM is a fast-changing , multi-linear map which is controlled by a slowly-changing , non-linear LSTM . The slow weights of the LSTM are regular NN weights which are updated during training by gradient descent . In contrast , the fast weights of the FWM are updated by the LSTM at every step of the input sequence through a Hebb-like differentiable mechanism . This allows the FWM function to change rapidly even during testing—hence the name fast weights . Along with updating the fast weights , the LSTM also generates a memory query which is used to retrieve information that was previously stored . The retrieved information then becomes part of the model ’ s output . 3.1 THE FAST WEIGHT MEMORY Given a sequence of tokens x = ( x1 , ... , xT ) from a vocabulary V , the task of language modelling is to train a model which maximizes the joint probability p ( x ) which we factorize autoregressively p ( x1 : T ) =∏T t=1 p ( xt|x0 : t−1 ) where x0 is an artificial start token.2 In this work , we train an RNN model to encode the input sequence x1 : t into ht , the hidden state of the LSTM , and Ft , the fast weight tensor of the FWM , to maximize the probability of the next token xt+1 . At step t of the input sequence , the input token xt is embedded in a dE-dimensional vector space using a lookup table et = embedding ( xt ) . An LSTM with dLSTM hidden units encodes the sequence of embedded tokens into a fixed size vector representation ht = LSTM ( et , ht−1 ) . The probability distribution over the next token x̂t+1 = softmax ( W ( s ) ( ht + FWM ( ht , Ft ) ) where Ft ∈ RdFWM×d 2 FWM are the fast weights of the FWM at step t and W ( s ) ∈ R|V|×dLSTM . Note that the fast weight matrix Ft is a reshaped third-order tensor Ft ∈ RdFWM×dFWM×dFWM . This allows us to describe third-order tensor operations using matrix multiplications . We ’ ll now describe in detail the FWM function and how its fast weights are updated . 2We use the notation x1 : t to refer to the sequence ( x1 , x2 , ... , xt ) .
The authors present a working memory model composed of a recurrent neural network trained via gradient descent and an associative memory based on the approach taken by Ba et al. (2016) in "Using Fast Weights to Attend to the Recent Past". The model consists of an LSTM to which takes the input and its own state from the previous step to produce an output (or new state) which is then passed to a fast weight memory (FWM) module.
SP:38d522d92ad048087149a9d612a694c8ab95f3af
Learning Associative Inference Using Fast Weight Memory
1 INTRODUCTION . Humans continually adapt in order to understand new situations in changing environments . One important adaptive ability is associative inference for composing features extracted from distinct experiences and relating them to each other ( Schlichting & Preston , 2015 ; Gershman et al. , 2015 ) . Suppose Alice has shared with you pictures of her toddler . Later , at the office party , you see a man carrying the depicted toddler . Since the toddler yields a shared feature in two different contexts , it may be plausible to infer that the man is Alice ’ s partner , without ever seeing him and Alice together . The ability to rapidly associate and bind together novel stimuli can help to derive knowledge systematically , in addition to the knowledge gained directly from observation . Virtually all modern cognitive architectures applied to challenging artificial intelligence problems are based on deep artificial neural networks ( NNs ) . Despite their empirical successes and theoretical generality , NNs tend to struggle to generalise in situations similar to the given example ( Lake et al. , 2017 ; Phillips , 1995 ; Lake & Baroni , 2017 ) . This weakness becomes even more severe if the training and test data exhibit systematic differences ( Atzmon et al. , 2016 ; Agrawal et al. , 2017 ) . For example , during training , the man ’ s representation might never be associated with the toddler ’ s , but during testing , this association might be necessary to make a useful prediction . In problems where humans excel , this sort of inference is likely ubiquitous since data is often combinatorially complex in a way that observations used during training will likely cover just a small fraction of all possible compositions . Such a lack of productivity and systematicity is a long-standing argument against the use of NNs as a substrate of an artificial cognitive architecture ( Fodor & Pylyshyn , 1988 ; Hadley , 1994 ; McLaughlin , 2009 ) . The hidden state of a neural model is a learned representation of the task-relevant information extracted from the input . To generalise to never-seen-before compositions of stimuli , the function which produces the state representation must be able to systematically construct all possible states . This requires a general and preferrably differentiable method , such as the Tensor Product Representation ( TPR ; Smolensky ( 1990 ) ) . TPRs provide a general and differentiable method for embed- 1Source code and data used in this paper is available at github.com/ischlag/Fast-Weight-Memory-public ding symbolic structures in vector spaces . A TPR state representation is constructed via the tensor product ( i.e . the generalised outer-product ) of learned component representations . Under certain constraints , such a mechanism guarantees a unique representation for every possible combination of components ( Smolensky , 1990 ; 2012 ) . In this work , we augment a recurrent NN ( RNN ) with an additional TPR-like memory representation . To facilitate the learning of multi-step associative inference , the TPR memory can be queried multiple times in a row , allowing the model to chain together various independent associations . In contrast to previous work on fast weights , we apply our memory-augmented RNN to much longer sequences . This requires the model to update its associative memory . Furthermore , we demonstrate the generality of our method by applying it to meta-reinforcement learning and small scale language modelling problems . In the next section , we cover related memory-augmented NNs . Section 3 describes the FWM in detail . Section 4 demonstrates the generality of our method through experiments in the supervised , self-supervised , and meta-reinforcement learning setting . The supervised-learning experiments in subsection 4.1 consist of a more challenging version of the bAbI dataset dubbed concatenated-bAbI or catbAbI . The meta-reinforcement learning experiment in section 4.2 demonstrates the FWM ’ s ability to learn to explore a partially observable environment through its ability to perform associative inference . Finally , the self-supervised experiments in subsection 4.3 demonstrate that the FWM can compete with the state-of-the-art word-level language models on small benchmark datasets . 2 RELATED WORK . RNNs such as the Long Short-Term Memory ( LSTM ; Hochreiter & Schmidhuber ( 1997 ) ; Gers et al . ( 2000 ) ) are in theory capable of implementing any algorithm ( Siegelmann & Sontag , 1991 ) . However , the linear growth of the hidden state of a fully connected RNN leads to quadratic growth in the number of trainable weights . Early work addressed this issue through the use of additional memory ( Das et al. , 1992 ; Mozer & Das , 1993 ) and differentiable fast weights ( Schmidhuber , 1992 ; 1993 ) . Recently , memory-augmented NNs have solved algorithmic toy problems ( Graves et al. , 2014 ; 2016 ) as well as reasoning and inference problems in synthetic and natural language ( Weston et al. , 2015b ; Xiong et al. , 2016 ) . Inspired by the random-access memory of computer architectures , a common approach is to incorporate a soft and differentiable lookup table into the NN model . Such slot-based memory matrices have shown to be difficult to train ( Munkhdalai & Yu , 2017b ) and require sophisticated mechanisms for the allocation and deallocation of memory ( Csordas & Schmidhuber , 2019 ) . The TransformerXL ( TXL ; Dai et al . ( 2019 ) ) , an autoregressive language model variant of the Transformer ( Vaswani et al. , 2017 ) , can be understood as a slot-based memory-augmented RNN where every new state is pushed into an immutable queue of finite size . Although it is recurrent , the layers of a transformer architecture are strictly forced to use inputs from a lower layer which limits its generality . Nevertheless , a sufficiently deep and well regularised TXL model has achieved state-of-the-art performance in large scale language modelling tasks . A biologically more plausible alternative of increasing the memory capacity of NNs are fastchanging weights , i.e . stateful weights that can adapt as a function of its input . Non-differentiable fast weights or “ dynamic links ” have been published since 1981 ( von der Malsburg , 1981 ; Feldman , 1982 ; Hinton & Plaut , 1987 ) . Subsequent work showed that a regular network can be trained by gradient descent to control the fast weights of a separate network ( Schmidhuber , 1992 ) or of itself ( Schmidhuber , 1993 ) in an end-to-end differentiable fashion . Recently , fast weights have made a comeback and achieved good results in small toy problems where regular NNs fall short ( Ba et al. , 2016a ; Schlag & Schmidhuber , 2017 ; Munkhdalai & Yu , 2017a ; Pritzel et al. , 2017 ; Ha et al. , 2017 ; Zhang & Zhou , 2017 ; Miconi et al. , 2018 ; 2019 ; Schlag & Schmidhuber , 2018 ; Munkhdalai et al. , 2019 ; Bartunov et al. , 2020 ) . Most memory-augmented NNs are based on content-based or key-based lookup mechanisms . An alternative to the storage of patterns in a lookup table is the idea that patterns are reconstructed through the implicit iterative minimisation of an energy function , such as in the classical Hopfield network ( Steinbuch , 1961 ; Willshaw et al. , 1969 ; Hopfield , 1982 ; Kanerva , 1988 ) or the modern Hopfield network ( Krotov & Hopfield , 2016 ; Demircigil et al. , 2017 ; Ramsauer et al. , 2020 ) . This is often described as an auto-associative type of memory as it reconstructs a previously stored pattern that mostly resembles the current pattern . A much less studied variation is the hetero-associative memory ( see e.g . Kosko ( 1988 ) ) where the retrieved pattern is different from the input pattern . This is more relevant for our use case . We aim to train an LSTM to construct , maintain , and edit its associative memory . The ability to edit Hopfield networks partially is not very well studied . For this reason , we employ a simple ( multi- ) linear hetero-associative memory as it is more closely related to the theory of TPRs ( whose manipulation is well understood ) and because the association is retrieved in a single step . Our work directly builds on two examples of differentiable fast weight memories : the TPR-RNN by Schlag & Schmidhuber ( 2018 ) and the Metalearned Neural Memory ( MNM ) by Munkhdalai et al . ( 2019 ) . The TPR-RNN is a sentence-level model for reasoning on text . It achieves excellent results on the regular bAbI tasks but it underperforms on word-level bAbI ( Schlag et al. , 2019 ) or algorithmic toy problems ( Le et al. , 2020 ) . In contrast , the MNM is a word-level model which augments the LSTM with a fully-connected multi-layer feed-forward network as its memory and trains it using a meta-learning objective . Both , MNM and TPR-RNN were developed on the regular bAbI dataset which only contains short sequences and does not require the model to remove deprecated associations from its memory . In this work , we train on an infinite sequence of bAbI stories where our FWM achieves excellent performance and improves over MNM . We further demonstrate strong performance in small-scale language modelling and meta reinforcement-learning which demonstrates the generality of our contribution . 3 PROPOSED METHOD . Our FWM is a fast-changing , multi-linear map which is controlled by a slowly-changing , non-linear LSTM . The slow weights of the LSTM are regular NN weights which are updated during training by gradient descent . In contrast , the fast weights of the FWM are updated by the LSTM at every step of the input sequence through a Hebb-like differentiable mechanism . This allows the FWM function to change rapidly even during testing—hence the name fast weights . Along with updating the fast weights , the LSTM also generates a memory query which is used to retrieve information that was previously stored . The retrieved information then becomes part of the model ’ s output . 3.1 THE FAST WEIGHT MEMORY Given a sequence of tokens x = ( x1 , ... , xT ) from a vocabulary V , the task of language modelling is to train a model which maximizes the joint probability p ( x ) which we factorize autoregressively p ( x1 : T ) =∏T t=1 p ( xt|x0 : t−1 ) where x0 is an artificial start token.2 In this work , we train an RNN model to encode the input sequence x1 : t into ht , the hidden state of the LSTM , and Ft , the fast weight tensor of the FWM , to maximize the probability of the next token xt+1 . At step t of the input sequence , the input token xt is embedded in a dE-dimensional vector space using a lookup table et = embedding ( xt ) . An LSTM with dLSTM hidden units encodes the sequence of embedded tokens into a fixed size vector representation ht = LSTM ( et , ht−1 ) . The probability distribution over the next token x̂t+1 = softmax ( W ( s ) ( ht + FWM ( ht , Ft ) ) where Ft ∈ RdFWM×d 2 FWM are the fast weights of the FWM at step t and W ( s ) ∈ R|V|×dLSTM . Note that the fast weight matrix Ft is a reshaped third-order tensor Ft ∈ RdFWM×dFWM×dFWM . This allows us to describe third-order tensor operations using matrix multiplications . We ’ ll now describe in detail the FWM function and how its fast weights are updated . 2We use the notation x1 : t to refer to the sequence ( x1 , x2 , ... , xt ) .
The solution proposed is the combination of an RNN (LSTM) and Fast Weighted Memory (FWM). The LSTM produces a query to the memory used to retrieve information from the memory and be presented at the model output. It also controls the memory through fast weights that are updated through a Hebbian mechanism. The FWM is based on Tensor Product Representations (TPR). The FWM is differentiable and builds upon the work of TPR-RNN from Schlag and Schmidhuber and Metalearned Neural Memory (MNM) by Munkhdalai et al. In the experimental section, the authors propose a concatenated version of the bAbI dataset to test their model with language modeling and question answering. Further the model is trained on a meta-learning task over POMDPs on graphs, and on language modeling on the PennTree Bank dataset. They show that the LSTM-FWM model generalizes better than without memory and similar models and with smaller capacity.
SP:38d522d92ad048087149a9d612a694c8ab95f3af
Non-asymptotic Confidence Intervals of Off-policy Evaluation: Primal and Dual Bounds
1 INTRODUCTION . Off-policy evaluation ( OPE ) seeks to estimate the expected reward of a target policy in reinforcement learnings ( RL ) from observational data collected under different policies ( e.g. , Murphy et al. , 2001 ; Fonteneau et al. , 2013 ; Jiang & Li , 2016 ; Liu et al. , 2018a ) . OPE plays a central role in applying reinforcement learning ( RL ) with only observational data and has found important applications in areas such as medicine , self-driving , where interactive “ on-policy ” data is expensive or even infeasible to collect . A critical challenge in OPE is the uncertainty estimation , as having reliable confidence bounds is essential for making high-stakes decisions . In this work , we aim to tackle this problem by providing non-asymptotic confidence intervals of the expected value of the target policy . Our method allows us to rigorously quantify the uncertainty of the prediction and hence avoid the dangerous case of being overconfident in making costly and/or irreversible decisions . However , off-policy evaluation per se has remained a key technical challenge in the literature ( e.g. , Precup , 2000 ; Thomas & Brunskill , 2016 ; Jiang & Li , 2016 ; Liu et al. , 2018a ) , let alone gaining rigorous confidence estimation of it . This is especially true when 1 ) the underlying RL problem is long or infinite horizon , and 2 ) the data is collected under arbitrary and unknown algorithms ( a.k.a . behavior-agnostic ) . As a consequence , the collected data can exhibit arbitrary dependency structure , which makes constructing rigorous non-asymptotic confidence bounds particularly challenging . Traditionally , the only approach to provide non-asymptotic confidence bounds in OPE is to combine importance sampling ( IS ) with concentration inequalities ( e.g. , Thomas et al. , 2015a ; b ) , which , however , tends to degenerate for long/infinite horizon problems ( Liu et al. , 2018a ) . Furthermore , ∗Equal contribution . neither can this approach be applied to the behavior-agnostic settings , nor can it effectively handle the complicated time dependency structure inside individual trajectories . Instead , it requires to use a large number of independently collected trajectories drawn under known policies . In this work , we provide a practical approach for Behavior-agnostic , Off-policy , Infinite-horizon , Non-asymptotic , Confidence intervals based on arbitrarily Dependent data ( BONDIC ) . Our method is motivated by a recently proposed optimization-based ( or variational ) approach to estimating OPE confidence bounds ( Feng et al. , 2020 ) , which leverages a tail bound of kernel Bellman statistics ( Feng et al. , 2019 ) . Our approach achieves a new bound that is both an order-of-magnitude tighter and computationally efficient than that of Feng et al . ( 2020 ) . Our improvements are based on two pillars 1 ) developing a new primal-dual perspective on the non-asymptotic OPE confidence bounds , which is connected to a body of recent works on infinite-horizon value estimation ( Liu et al. , 2018a ; Nachum et al. , 2019a ; Tang et al. , 2020a ; Mousavi et al. , 2020 ) ; and 2 ) offering a new tight concentration inequality on the kernel Bellman statistics that applies to behavior-agnostic off-policy data with arbitrary dependency between transition pairs . Empirically , we demonstrate that our method can provide reliable and tight bounds on a variety of well-established benchmarks . Related Work Besides the aforementioned approach based on the combination of IS and concentration inequalities ( e.g. , Thomas et al. , 2015a ) , bootstrapping methods have also been widely used in off-policy estimation ( e.g. , White & White , 2010 ; Hanna et al. , 2017 ; Kostrikov & Nachum , 2020 ) . But the latter is limited to asymptotic bounds . Alternatively , Bayesian methods ( e.g . Engel et al. , 2005 ; Ghavamzadeh et al. , 2016a ) offers a different way to estimate the uncertainty in RL , but fails to guarantee frequentist coverage . In addition , Distributed RL ( Bellemare et al. , 2017 ) seeks to quantify the intrinsic uncertainties inside the Markov decision process , which is orthogonal to the estimation of uncertainty that we consider . Our work is built upon the recent advances in behavior-agnostic infinite-horizon OPE , including Liu et al . ( 2018a ) ; Feng et al . ( 2019 ) ; Tang et al . ( 2020a ) ; Mousavi et al . ( 2020 ) , as well as the DICE-family ( e.g. , Nachum et al. , 2019a ; Zhang et al. , 2020a ; Yang et al. , 2020b ) . In particular , our method can be viewed as extending the minimax framework of the infinite-horizon OPE in the infinite data region by Tang et al . ( 2020a ) ; Uehara et al . ( 2020 ) ; Jiang & Huang ( 2020 ) to the non-asymptotic finite sample region . Outline For the rest of the paper , we start with the problem statement in Section 2 , and an overview on the two dual approaches to infinite-horizon OPE that are tightly connected to our method in Section 3 . We then present our main approach in Section 4 and perform empirical studies in Section 5 . The proof and an abundance of additional discussions can be found in Appendix . 2 BACKGROUND , DATA ASSUMPTION , PROBLEM SETTING . Consider an agent acting in an unknown environment . At each time step t , the agent observes the current state st in a state space S , takes an action at ∼ π ( · | st ) in an action space A according to a given policy π ; then , the agent receives a reward rt and the state transits to s′t = st+1 , following an unknown transition/reward distribution ( rt , st+1 ) ∼ P ( · | st , at ) . Assume the initial state s0 is drawn from an known initial distribution D0 . Let γ ∈ ( 0 , 1 ) be a discount factor . In this setting , the expected reward of π is defined as Jπ : = Eπ [ ∑T t=0 γ trt | s0 ∼ D0 ] , which is the expected total discounted rewards when we execute π starting from D0 for T steps . In this work , we consider the infinite-horizon case with T → +∞ . Our goal is to provide an interval estimation of Jπ for a general and challenging setting with significantly released constraints on the data . In particular , we assume the data is behavior-agnostic and off-policy , which means that the data can be collected from multiple experiments , each of which can execute a mix of arbitrary , unknown policies , or even follow a non-fixed policy . More concretely , suppose that the model P is unknown , and we have a set of transition pairs D̂n = ( si , ai , ri , s′i ) n i=1 collected from previous experiments in a sequential order , such that for each data point i , the ( ri , s′i ) is drawn from the model P ( · | si , ai ) , while ( si , ai ) is generated with an arbitrary black box given the previous data points . We formalize both the data assumption and goal as below . Assumption 2.1 ( Data Assumption ) . Assume the data D̂n = ( si , ai , ri , s′i ) ni=1 is drawn from an arbitrary joint distribution , such that for each i = 1 , . . . , n , conditional on D̂ < i : = ( sj , aj , rj , s′j ) j < i ∪ ( si , ai ) , the subsequent local reward and next state ( ri , s′i ) are drawn from P ( · | si , ai ) . Goal Given a confidence level δ ∈ ( 0 , 1 ) , we want to construct an interval [ Ĵ− , Ĵ+ ] ⊂ R based on the data D̂n , such that Pr ( Jπ ∈ [ Ĵ− , Ĵ+ ] ) ≥ 1− δ , where Pr ( · ) is w.r.t . the randomness of the data . The partial ordering on the data points is introduced to accommodate the case that si+1 equals s′j for some j ≤ i . The data assumption only requires that ( ri , s′i ) is generated from P ( · | si , ai ) , and imposes no constraints on how ( si , ai ) is generated . This provides great flexibility in terms of the data collection process . In particular , we do not require ( si , ai ) ni=1 to be independent as always assumed in recent works ( Liu et al. , 2018a ; Mousavi et al. , 2020 ) . A crucial fact is that our data assumption actually implies a martingale structure on the empirical Bellman residual operator of the Q-function , As we will show in Section 4.1 , this enables us to derive a key concentration inequality underpinning our non-asymptotic confidence bounds . Here , we summarize a few notations that will simplify the presentation in the rest of work . First of all , we append each ( si , ai , ri , s′i ) with an action a ′ i ∼ π ( · | s′i ) following s′i . This can be done for free as long as π is given ( See the Remark in Section 3 ) . Also , we write xi = ( si , ai ) , x′i = ( s ′ i , a ′ i ) , and yi = ( x′i , ri ) = ( s ′ i , a ′ i , ri ) . Correspondingly , define X = S ×A to be the state-action space and Y = X ×R . Denote Pπ ( y | x ) = P ( s′ , r | x ) π ( a′ | s′ ) . In this way , the observed data can be written as pairs of { xi , yi } ni=1 , and Assumption 2.1 is equivalent to saying that yi ∼ Pπ ( · | xi ) given D̂ < i , which is similar to a supervised learning setting . We equalize the data D̂n with its empirical measure D̂n = ∑n i=1 δxi , yi/n , where δ is the Delta measure . 3 TWO DUAL APPROACHES TO INFINITE-HORIZON OFF-POLICY ESTIMATION . The deficiency of the traditional IS methods on long-/infinite-horizon RL problems ( a.k.a . the curse of horizon ( Liu et al. , 2018a ) ) has motivated a line of work on developing efficient infinite-horizon value estimation ( e.g. , Liu et al. , 2018a ; Feng et al. , 2019 ; Nachum et al. , 2019a ; Zhang et al. , 2020a ; Mousavi et al. , 2020 ; Tang et al. , 2020a ) . The main idea is to transform the value estimation problem into estimating either the Q-function or the visitation distribution ( or its related density ratio ) of the policy π . This section introduces and reinterprets these two tightly connected methods , which serves to lay out a foundation for our main confidence bounds from a primal and dual perspective . Given a policy π , its Q-function is defined as qπ ( x ) = Eπ [ ∑∞ t=0 γ trt | x0 = x ] , where the expectation is taken when we execute π initialized from a fixed state-action pair ( s0 , a0 ) = x0 = x . Let Dπ , t be the distribution of ( xt , yt ) = ( st , at , s′t , a ′ t , rt ) when executing policy π starting from s0 ∼ D0 for t steps . The visitation distribution of π is defined as Dπ = ∑∞ t=0 γ tDπ , t . Note that Dπ integrates to 1/ ( 1− γ ) , while we treat it as a probability measure in the notation . The expected reward Jπcan be expressed using either qπ or Dπ as follows : Jπ : = Eπ [ ∞∑ t=0 γtrt ] = Er∼Dπ [ r ] = Ex∼Dπ,0 [ qπ ( x ) ] , ( 1 ) where r ∼ Dπ ( resp . x ∼ Dπ,0 ) denotes sampling from the r- ( resp . x- ) marginal distribution of Dπ ( resp . Dπ,0 ) . Eq . ( 1 ) plays a key role in the infinite-horizon value estimation by transforming the estimation of Jπ into estimating either qπ or Dπ . Value Estimation via Q Function Because Dπ,0 ( x ) = D0 ( s ) π ( a|s ) is known , we can estimate Jπ by Ex∼Dπ,0 [ q̂ ( x ) ] with any estimation q̂ of the true Q-function qπ ; the expectation under x ∼ Dπ,0 can be estimated to any accuracy with Monte Carlo . To estimate qπ , we consider the empirical and expected Bellman residual operator : R̂q ( x , y ) = q ( x ) − γq ( x′ ) − r , Rπq ( x ) = Ey∼Pπ ( ·|x ) [ R̂q ( x , y ) ] . ( 2 ) It is well-known that qπ is the unique solution of the Bellman equation Rπq = 0 . Since yi ∼ Pπ ( ·|xi ) for each data point in D̂n , if q = qπ , then R̂q ( xi , yi ) , i = 1 , . . . , n are all zero-mean random variables . Let ω be any function from X to R , then∑i R̂q ( xi , yi ) ω ( xi ) also has zero mean . This motivates the following functional Bellman loss ( Feng et al. , 2019 ; 2020 ; Xie & Jiang , 2020 ) , LW ( q ; D̂n ) : = sup ω∈W { 1 n n∑ i=1 R̂q ( xi , yi ) ω ( xi ) } , ( 3 ) whereW is a set of functions ω : X → R. To ensure that the sup is finite , W is typically set to be an unit ball of some normed function spaceWo , such thatW = { ω ∈ Wo : ‖ω‖Wo ≤ 1 } . Feng et al . ( 2019 ) considers the simple case whenW is taken to be the unit ball K of the reproducing kernel Hilbert space ( RKHS ) with a positive definite kernel k : X × X → R , in which case the loss has a simple closed form solution : LK ( q ; D̂n ) = √√√√ 1 n2 n∑ ij=1 R̂q ( xi , yi ) k ( xi , xj ) R̂q ( xj , yj ) . ( 4 ) Note that the RHS of Eq . ( 4 ) is the square root of the kernel Bellman V-statistics in Feng et al . ( 2019 ) . Feng et al . ( 2019 ) showed that , when the support of data distribution D̂n covers the whole space ( which may require an infinite data size ) and k is an integrally strictly positive definite kernel , LK ( q ; D̂n ) = 0 iff q = qπ . Therefore , one can estimate qπ by minimizing LK ( q , D̂n ) . Remark The empirical Bellman residual operator R̂ can be extended to R̂q ( x , y ) = q ( x ) − r − γ 1m ∑m ` =1 q ( s ′ , a′ ` ) , where { a′ ` } mi=1 are i.i.d . drawn from π ( ·|s′ ) . As m increases , this gives a lower variance estimation of Rπq . If m = +∞ , we have R̂q ( x , y ) = q ( x ) − r − γEa′∼π ( · | s′ ) [ q ( s′ , a′ ) ] , which coincides with the operator used in the expected SARSA ( Sutton & Barto , 1998 ) . In fact , without any modification , all results in this work can be applied to R̂q for any m. Value Estimation via Visitation Distribution Another way to estimate Jπ in Eq . ( 1 ) is to approximate Dπ with a weighted empirical measure of the data ( Liu et al. , 2018a ; Nachum et al. , 2019a ; Mousavi et al. , 2020 ; Zhang et al. , 2020a ) . The key idea is to assign an importance weight ω ( xi ) to each data point xi in D̂n . We can choose the function ω : X → R properly such that Dπ and hence Jπ can be approximated by the ω-weighted empirical measure of D̂n as follows : Jπ ≈ Ĵω : = ED̂ωn [ r ] = 1 n n∑ i=1 ω ( xi ) ri , Dπ ≈ D̂ωn : = 1 n n∑ i=1 ω ( xi ) δxi , yi . ( 5 ) Intuitively , ω can be viewed as the density ratio between Dπ and D̂n , although the empirical measure D̂n may not have well-defined density . Liu et al . ( 2018a ) ; Mousavi et al . ( 2020 ) proposed to estimate ω by minimizing a discrepancy measure between D̂ωn and Dπ . To see this , note that D = Dπ if and only if ∆ ( D , q ) = 0 for any function q , where ∆ ( D , q ) = ED [ γq ( x′ ) − q ( x ) ] − EDπ [ γq ( x′ ) − q ( x ) ] = ED [ γq ( x′ ) − q ( x ) ] + EDπ,0 [ q ( x ) ] , ( 6 ) using the fact that EDπ [ γq ( x′ ) − q ( x ) ] = −EDπ,0 [ q ( x ) ] ( Theorem 1 , Liu et al. , 2018a ) . Also note that the RHS of Eq . ( 6 ) can be practically calculated given any D and q without knowing Dπ . Let Q be a set of functions q : X → R. One can define the following loss for ω : IQ ( ω ; D̂n ) = sup q∈Q { ∆ ( D̂ωn , q ) } . ( 7 ) Similar to LW ( q ; D̂n ) , when Q is a ball in RKHS , IQ ( ω ; D̂n ) also has a bilinear closed form analogous to Eq . ( 4 ) ; see Mousavi et al . ( 2020 ) and Appendix F. As we show in Section 4 , IQ ( ω ; D̂n ) and LW ( q ; D̂n ) are connected to the primal and dual views of our confidence bounds , respectively .
The paper studies an off-policy evaluation (OPE) problem for Markov decision processes (MDPs). It suggests an optimization-based method that can construct a non-asymptotic confidence interval, for a given confidence level, for the value function of a policy starting from a fixed initial distribution. The paper builds on the works of Feng et al. (2019, 2020); the main advantages of the current work with respect to the previous methods are that the suggested approach guarantees a faster convergence rate, it does not require full independence between transition pairs, and it does not need the global optimal solution of the underlying optimization problem, in order to construct guaranteed confidence intervals. The authors present some theoretical results about the construction, including a discussion on the special case of using RKHS approaches, and also present numerical experiments on benchmark problems, such as the inverted-pendulum, cartpole and type-1 diabetes.
SP:22b6740eb3b2977aaffb8919aee4883f62af815f
Non-asymptotic Confidence Intervals of Off-policy Evaluation: Primal and Dual Bounds
1 INTRODUCTION . Off-policy evaluation ( OPE ) seeks to estimate the expected reward of a target policy in reinforcement learnings ( RL ) from observational data collected under different policies ( e.g. , Murphy et al. , 2001 ; Fonteneau et al. , 2013 ; Jiang & Li , 2016 ; Liu et al. , 2018a ) . OPE plays a central role in applying reinforcement learning ( RL ) with only observational data and has found important applications in areas such as medicine , self-driving , where interactive “ on-policy ” data is expensive or even infeasible to collect . A critical challenge in OPE is the uncertainty estimation , as having reliable confidence bounds is essential for making high-stakes decisions . In this work , we aim to tackle this problem by providing non-asymptotic confidence intervals of the expected value of the target policy . Our method allows us to rigorously quantify the uncertainty of the prediction and hence avoid the dangerous case of being overconfident in making costly and/or irreversible decisions . However , off-policy evaluation per se has remained a key technical challenge in the literature ( e.g. , Precup , 2000 ; Thomas & Brunskill , 2016 ; Jiang & Li , 2016 ; Liu et al. , 2018a ) , let alone gaining rigorous confidence estimation of it . This is especially true when 1 ) the underlying RL problem is long or infinite horizon , and 2 ) the data is collected under arbitrary and unknown algorithms ( a.k.a . behavior-agnostic ) . As a consequence , the collected data can exhibit arbitrary dependency structure , which makes constructing rigorous non-asymptotic confidence bounds particularly challenging . Traditionally , the only approach to provide non-asymptotic confidence bounds in OPE is to combine importance sampling ( IS ) with concentration inequalities ( e.g. , Thomas et al. , 2015a ; b ) , which , however , tends to degenerate for long/infinite horizon problems ( Liu et al. , 2018a ) . Furthermore , ∗Equal contribution . neither can this approach be applied to the behavior-agnostic settings , nor can it effectively handle the complicated time dependency structure inside individual trajectories . Instead , it requires to use a large number of independently collected trajectories drawn under known policies . In this work , we provide a practical approach for Behavior-agnostic , Off-policy , Infinite-horizon , Non-asymptotic , Confidence intervals based on arbitrarily Dependent data ( BONDIC ) . Our method is motivated by a recently proposed optimization-based ( or variational ) approach to estimating OPE confidence bounds ( Feng et al. , 2020 ) , which leverages a tail bound of kernel Bellman statistics ( Feng et al. , 2019 ) . Our approach achieves a new bound that is both an order-of-magnitude tighter and computationally efficient than that of Feng et al . ( 2020 ) . Our improvements are based on two pillars 1 ) developing a new primal-dual perspective on the non-asymptotic OPE confidence bounds , which is connected to a body of recent works on infinite-horizon value estimation ( Liu et al. , 2018a ; Nachum et al. , 2019a ; Tang et al. , 2020a ; Mousavi et al. , 2020 ) ; and 2 ) offering a new tight concentration inequality on the kernel Bellman statistics that applies to behavior-agnostic off-policy data with arbitrary dependency between transition pairs . Empirically , we demonstrate that our method can provide reliable and tight bounds on a variety of well-established benchmarks . Related Work Besides the aforementioned approach based on the combination of IS and concentration inequalities ( e.g. , Thomas et al. , 2015a ) , bootstrapping methods have also been widely used in off-policy estimation ( e.g. , White & White , 2010 ; Hanna et al. , 2017 ; Kostrikov & Nachum , 2020 ) . But the latter is limited to asymptotic bounds . Alternatively , Bayesian methods ( e.g . Engel et al. , 2005 ; Ghavamzadeh et al. , 2016a ) offers a different way to estimate the uncertainty in RL , but fails to guarantee frequentist coverage . In addition , Distributed RL ( Bellemare et al. , 2017 ) seeks to quantify the intrinsic uncertainties inside the Markov decision process , which is orthogonal to the estimation of uncertainty that we consider . Our work is built upon the recent advances in behavior-agnostic infinite-horizon OPE , including Liu et al . ( 2018a ) ; Feng et al . ( 2019 ) ; Tang et al . ( 2020a ) ; Mousavi et al . ( 2020 ) , as well as the DICE-family ( e.g. , Nachum et al. , 2019a ; Zhang et al. , 2020a ; Yang et al. , 2020b ) . In particular , our method can be viewed as extending the minimax framework of the infinite-horizon OPE in the infinite data region by Tang et al . ( 2020a ) ; Uehara et al . ( 2020 ) ; Jiang & Huang ( 2020 ) to the non-asymptotic finite sample region . Outline For the rest of the paper , we start with the problem statement in Section 2 , and an overview on the two dual approaches to infinite-horizon OPE that are tightly connected to our method in Section 3 . We then present our main approach in Section 4 and perform empirical studies in Section 5 . The proof and an abundance of additional discussions can be found in Appendix . 2 BACKGROUND , DATA ASSUMPTION , PROBLEM SETTING . Consider an agent acting in an unknown environment . At each time step t , the agent observes the current state st in a state space S , takes an action at ∼ π ( · | st ) in an action space A according to a given policy π ; then , the agent receives a reward rt and the state transits to s′t = st+1 , following an unknown transition/reward distribution ( rt , st+1 ) ∼ P ( · | st , at ) . Assume the initial state s0 is drawn from an known initial distribution D0 . Let γ ∈ ( 0 , 1 ) be a discount factor . In this setting , the expected reward of π is defined as Jπ : = Eπ [ ∑T t=0 γ trt | s0 ∼ D0 ] , which is the expected total discounted rewards when we execute π starting from D0 for T steps . In this work , we consider the infinite-horizon case with T → +∞ . Our goal is to provide an interval estimation of Jπ for a general and challenging setting with significantly released constraints on the data . In particular , we assume the data is behavior-agnostic and off-policy , which means that the data can be collected from multiple experiments , each of which can execute a mix of arbitrary , unknown policies , or even follow a non-fixed policy . More concretely , suppose that the model P is unknown , and we have a set of transition pairs D̂n = ( si , ai , ri , s′i ) n i=1 collected from previous experiments in a sequential order , such that for each data point i , the ( ri , s′i ) is drawn from the model P ( · | si , ai ) , while ( si , ai ) is generated with an arbitrary black box given the previous data points . We formalize both the data assumption and goal as below . Assumption 2.1 ( Data Assumption ) . Assume the data D̂n = ( si , ai , ri , s′i ) ni=1 is drawn from an arbitrary joint distribution , such that for each i = 1 , . . . , n , conditional on D̂ < i : = ( sj , aj , rj , s′j ) j < i ∪ ( si , ai ) , the subsequent local reward and next state ( ri , s′i ) are drawn from P ( · | si , ai ) . Goal Given a confidence level δ ∈ ( 0 , 1 ) , we want to construct an interval [ Ĵ− , Ĵ+ ] ⊂ R based on the data D̂n , such that Pr ( Jπ ∈ [ Ĵ− , Ĵ+ ] ) ≥ 1− δ , where Pr ( · ) is w.r.t . the randomness of the data . The partial ordering on the data points is introduced to accommodate the case that si+1 equals s′j for some j ≤ i . The data assumption only requires that ( ri , s′i ) is generated from P ( · | si , ai ) , and imposes no constraints on how ( si , ai ) is generated . This provides great flexibility in terms of the data collection process . In particular , we do not require ( si , ai ) ni=1 to be independent as always assumed in recent works ( Liu et al. , 2018a ; Mousavi et al. , 2020 ) . A crucial fact is that our data assumption actually implies a martingale structure on the empirical Bellman residual operator of the Q-function , As we will show in Section 4.1 , this enables us to derive a key concentration inequality underpinning our non-asymptotic confidence bounds . Here , we summarize a few notations that will simplify the presentation in the rest of work . First of all , we append each ( si , ai , ri , s′i ) with an action a ′ i ∼ π ( · | s′i ) following s′i . This can be done for free as long as π is given ( See the Remark in Section 3 ) . Also , we write xi = ( si , ai ) , x′i = ( s ′ i , a ′ i ) , and yi = ( x′i , ri ) = ( s ′ i , a ′ i , ri ) . Correspondingly , define X = S ×A to be the state-action space and Y = X ×R . Denote Pπ ( y | x ) = P ( s′ , r | x ) π ( a′ | s′ ) . In this way , the observed data can be written as pairs of { xi , yi } ni=1 , and Assumption 2.1 is equivalent to saying that yi ∼ Pπ ( · | xi ) given D̂ < i , which is similar to a supervised learning setting . We equalize the data D̂n with its empirical measure D̂n = ∑n i=1 δxi , yi/n , where δ is the Delta measure . 3 TWO DUAL APPROACHES TO INFINITE-HORIZON OFF-POLICY ESTIMATION . The deficiency of the traditional IS methods on long-/infinite-horizon RL problems ( a.k.a . the curse of horizon ( Liu et al. , 2018a ) ) has motivated a line of work on developing efficient infinite-horizon value estimation ( e.g. , Liu et al. , 2018a ; Feng et al. , 2019 ; Nachum et al. , 2019a ; Zhang et al. , 2020a ; Mousavi et al. , 2020 ; Tang et al. , 2020a ) . The main idea is to transform the value estimation problem into estimating either the Q-function or the visitation distribution ( or its related density ratio ) of the policy π . This section introduces and reinterprets these two tightly connected methods , which serves to lay out a foundation for our main confidence bounds from a primal and dual perspective . Given a policy π , its Q-function is defined as qπ ( x ) = Eπ [ ∑∞ t=0 γ trt | x0 = x ] , where the expectation is taken when we execute π initialized from a fixed state-action pair ( s0 , a0 ) = x0 = x . Let Dπ , t be the distribution of ( xt , yt ) = ( st , at , s′t , a ′ t , rt ) when executing policy π starting from s0 ∼ D0 for t steps . The visitation distribution of π is defined as Dπ = ∑∞ t=0 γ tDπ , t . Note that Dπ integrates to 1/ ( 1− γ ) , while we treat it as a probability measure in the notation . The expected reward Jπcan be expressed using either qπ or Dπ as follows : Jπ : = Eπ [ ∞∑ t=0 γtrt ] = Er∼Dπ [ r ] = Ex∼Dπ,0 [ qπ ( x ) ] , ( 1 ) where r ∼ Dπ ( resp . x ∼ Dπ,0 ) denotes sampling from the r- ( resp . x- ) marginal distribution of Dπ ( resp . Dπ,0 ) . Eq . ( 1 ) plays a key role in the infinite-horizon value estimation by transforming the estimation of Jπ into estimating either qπ or Dπ . Value Estimation via Q Function Because Dπ,0 ( x ) = D0 ( s ) π ( a|s ) is known , we can estimate Jπ by Ex∼Dπ,0 [ q̂ ( x ) ] with any estimation q̂ of the true Q-function qπ ; the expectation under x ∼ Dπ,0 can be estimated to any accuracy with Monte Carlo . To estimate qπ , we consider the empirical and expected Bellman residual operator : R̂q ( x , y ) = q ( x ) − γq ( x′ ) − r , Rπq ( x ) = Ey∼Pπ ( ·|x ) [ R̂q ( x , y ) ] . ( 2 ) It is well-known that qπ is the unique solution of the Bellman equation Rπq = 0 . Since yi ∼ Pπ ( ·|xi ) for each data point in D̂n , if q = qπ , then R̂q ( xi , yi ) , i = 1 , . . . , n are all zero-mean random variables . Let ω be any function from X to R , then∑i R̂q ( xi , yi ) ω ( xi ) also has zero mean . This motivates the following functional Bellman loss ( Feng et al. , 2019 ; 2020 ; Xie & Jiang , 2020 ) , LW ( q ; D̂n ) : = sup ω∈W { 1 n n∑ i=1 R̂q ( xi , yi ) ω ( xi ) } , ( 3 ) whereW is a set of functions ω : X → R. To ensure that the sup is finite , W is typically set to be an unit ball of some normed function spaceWo , such thatW = { ω ∈ Wo : ‖ω‖Wo ≤ 1 } . Feng et al . ( 2019 ) considers the simple case whenW is taken to be the unit ball K of the reproducing kernel Hilbert space ( RKHS ) with a positive definite kernel k : X × X → R , in which case the loss has a simple closed form solution : LK ( q ; D̂n ) = √√√√ 1 n2 n∑ ij=1 R̂q ( xi , yi ) k ( xi , xj ) R̂q ( xj , yj ) . ( 4 ) Note that the RHS of Eq . ( 4 ) is the square root of the kernel Bellman V-statistics in Feng et al . ( 2019 ) . Feng et al . ( 2019 ) showed that , when the support of data distribution D̂n covers the whole space ( which may require an infinite data size ) and k is an integrally strictly positive definite kernel , LK ( q ; D̂n ) = 0 iff q = qπ . Therefore , one can estimate qπ by minimizing LK ( q , D̂n ) . Remark The empirical Bellman residual operator R̂ can be extended to R̂q ( x , y ) = q ( x ) − r − γ 1m ∑m ` =1 q ( s ′ , a′ ` ) , where { a′ ` } mi=1 are i.i.d . drawn from π ( ·|s′ ) . As m increases , this gives a lower variance estimation of Rπq . If m = +∞ , we have R̂q ( x , y ) = q ( x ) − r − γEa′∼π ( · | s′ ) [ q ( s′ , a′ ) ] , which coincides with the operator used in the expected SARSA ( Sutton & Barto , 1998 ) . In fact , without any modification , all results in this work can be applied to R̂q for any m. Value Estimation via Visitation Distribution Another way to estimate Jπ in Eq . ( 1 ) is to approximate Dπ with a weighted empirical measure of the data ( Liu et al. , 2018a ; Nachum et al. , 2019a ; Mousavi et al. , 2020 ; Zhang et al. , 2020a ) . The key idea is to assign an importance weight ω ( xi ) to each data point xi in D̂n . We can choose the function ω : X → R properly such that Dπ and hence Jπ can be approximated by the ω-weighted empirical measure of D̂n as follows : Jπ ≈ Ĵω : = ED̂ωn [ r ] = 1 n n∑ i=1 ω ( xi ) ri , Dπ ≈ D̂ωn : = 1 n n∑ i=1 ω ( xi ) δxi , yi . ( 5 ) Intuitively , ω can be viewed as the density ratio between Dπ and D̂n , although the empirical measure D̂n may not have well-defined density . Liu et al . ( 2018a ) ; Mousavi et al . ( 2020 ) proposed to estimate ω by minimizing a discrepancy measure between D̂ωn and Dπ . To see this , note that D = Dπ if and only if ∆ ( D , q ) = 0 for any function q , where ∆ ( D , q ) = ED [ γq ( x′ ) − q ( x ) ] − EDπ [ γq ( x′ ) − q ( x ) ] = ED [ γq ( x′ ) − q ( x ) ] + EDπ,0 [ q ( x ) ] , ( 6 ) using the fact that EDπ [ γq ( x′ ) − q ( x ) ] = −EDπ,0 [ q ( x ) ] ( Theorem 1 , Liu et al. , 2018a ) . Also note that the RHS of Eq . ( 6 ) can be practically calculated given any D and q without knowing Dπ . Let Q be a set of functions q : X → R. One can define the following loss for ω : IQ ( ω ; D̂n ) = sup q∈Q { ∆ ( D̂ωn , q ) } . ( 7 ) Similar to LW ( q ; D̂n ) , when Q is a ball in RKHS , IQ ( ω ; D̂n ) also has a bilinear closed form analogous to Eq . ( 4 ) ; see Mousavi et al . ( 2020 ) and Appendix F. As we show in Section 4 , IQ ( ω ; D̂n ) and LW ( q ; D̂n ) are connected to the primal and dual views of our confidence bounds , respectively .
This work constructs non-asymptotic confidence intervals for off-policy evaluation. This is achieved by assuming that the reward at any given time only depends on the state action pair, leveraging that assumed structure to define the difference between the empirical and estimated bellman residual operators as a Martingale difference sequence. This, in turn, then allows the authors to apply a Hoeffding-like concentration inequality which applies to Hilbert spaces. The authors then provide a derivation of the confidence bounds by considering the divergence between policies. The work improves on the rate of prior work from $O(n^{-\frac{1}{4}})$ to $O(n^{-\frac{1}{2}})$ and allows for estimation without the need of global optimality via the dual formulation, both of which are very nice additions to the literature. Experimental evaluation backs up the authors’ claims, showing very strong performance with respect to prior art.
SP:22b6740eb3b2977aaffb8919aee4883f62af815f
ROGA: Random Over-sampling Based on Genetic Algorithm
1 INTRODUCTION . When modeling the classification problem , the balance of classes can ensure that the information is balanced during the learning process of the model , but the classes are often unbalanced in actual tasks ( Kotsiantis et al . ( 2005 ) ; He & Garcia ( 2009 ) ) , which leads to the machine learning model preferring majority class samples . In order to solve this problem , a commonly used method uses oversampling algorithm to increase the minority class samples to balance the gap between the minority class samples and the majority class samples . Therefore , the quality of the generated samples will determine the training quality of the model after oversampling , but it is difficult to characterize this effect . In the past studies , oversampling methods only can estimated the noise samples , such as overlapping samples or outliers , and eliminated it as much as possible . Ensure that the sample does not make training the model more difficult . SMOTE ( Chawla et al . ( 2002 ) ) and its derivative algorithms generate new samples by interpolation . There has been a lot of work in the selection of samples to be interpolated , the number of interpolations , or the method of interpolation , and the final goal is to reduce the generation of noise samples by restricting the interpolation position . Some researchers pointed out that sampling should not be performed in the sample space , but should be projected to other spaces ( Wang et al . ( 2007 ) , Zhang & Yang ( 2018 ) ) . In addition , some researchers have proposed that sampling should be taken from the minority distribution ( Bellinger et al . ( 2015 ) , Das et al . ( 2015 ) ) to ensure the consistency of the distribution . It can be found that in order to reduce the generation of noise samples , the space for generating samples needs to be restricted , that is , the oversampling algorithm can only sample within a limited range . However , just paying attention to noise generation may not achieve better results . Too strong constraints will cause the sample generation space to be limited , and the generated samples will fall into a local optimal solution , so that it is impossible to find samples that are more conducive to model training . Therefore , in order to reduce the limitation on the sample generation space and reduce noise as much as possible , this paper proposes oversampling algorithm ROGA based on genetic algorithm . ROGA will randomly sample in the feature space before the first iteration , and generate a set of artificial samples as the basic population for the next iteration of the genetic algorithm . Random sampling will increase the noise in the samples , but it will also prevent ROGA from falling into a local optimal solution . In order to judge the noise , ROGA will calculate the fitness of each sample based on the Gaussian similarity with surrounding neighbors . The fitness represents the possibility that the sample is a noise sample . In the iterative process , new samples are generated through crossover and mutation operations , and samples with lower fitness are gradually removed , so as to reduce noise . ROGA will generate new samples in the entire feature space , mainly because the initial population is generated by random sampling in the entire feature space . The crossover and mutation operations of genetic algorithms will continuously change the samples in the population to find samples with higher fitness values , and the screening mechanism will help us eliminate noisy samples in the population . Therefore , ROGA can balance the wide generation space and noise generation . Through experiments on multiple datasets , we found that ROGA can achieve the best scores on some datasets on the F1-score . 2 RELATED WORK . 2.1 CLASS IMBALANCE . Data-based methods are represented by oversampling and undersampling . In order to balance the gap in the number of samples , oversampling generates new minority class samples , while undersampling ( Arefeen et al . ( 2020 ) ; Koziarski ( 2020 ) ) reduces redundant majority class samples . The algorithm-based method is to improve the model algorithm to make it more suitable for training on unbalanced data . The first improvement measure is to balance the loss caused by the majority class and the minority class in the cost-sensitive loss function . Cost-sensitive can be combined with various machine learning algorithms , such as Adaboost ( Wei ( 1999 ) ) , SVM ( Lin ( 2002 ) ) , Decision Tree ( Ling et al . ( 2005 ) ) , cross entropy ( Li & Zhu ( 2019 ) ) and so on . The second improvement measure is integrated learning technology . Liu et.al ( Liu et al . ( 2009 ) ) proposed EasyEnsemble and BalanceCascade , performed multiple under-sampling and integrated multiple models . Some researchers have added the ideas of Bagging ( Wang & Yao ( 2009 ) ) and Boosting ( Chawla et al . ( 2003 ) ) on SMOTE . 2.2 OVERSAMPLING . The oversampling algorithm is to generate new minority class samples to balance the quantitative difference between classes . The current oversampling algorithm can be divided into random sampling method , interpolation method , distributed sampling method and copy replacement method . The random sampling method is to perform random sampling in the feature space , and the generated samples can easily deviate from the distribution of the original samples and produce noisy data . The interpolation oversampling algorithm represented by SMOTEChawla et al . ( 2002 ) restricts the generation of samples between two samples , and generates new minority class samples through linear interpolation . On the basis of the SMOTEChawla et al . ( 2002 ) algorithm , a large number of improved algorithms have appeared . First , in order to further reduce the generation of noise , improvements can be made in the selection of the sample to be interpolated , the interpolation weight of the sample , and the position of the interpolation . SMOTE-Borderline ( Nguyen et al . ( 2011 ) ) believes that the minority class samples located at the decision boundary should be selected , and some researchers believe that interpolation should be performed within the minority class sample clusters generated by the clustering algorithm , such as KMeans-SMOTE ( Douzas & Bacao ( 2018 ) ) , CURE-SMOTE ( Ma & Fan ( 2017 ) ) , DBSMOTE ( Bunkhumpornpat et al . ( 2012 ) ) , SOMO ( Douzas & Bacao ( 2017b ) ) , etc . ADASYN ( He et al . ( 2008 ) ) , SMOTE-D ( Torres et al . ( 2016 ) ) and MSMOTE ( Hu et al . ( 2009 ) ) reduce the number of interpolations for some samples by setting the weight of the sample . When Safe-level SMOTE ( Bunkhumpornpat et al . ( 2009 ) ) generates samples , it will be closer to more regions of similar samples . In addition to controlling the noise generation in the generation stage , you can also filter the noises in the samples after generating the samples , such as SMOTE-FRST ( Verbiest et al . ( 2012 ) ) , SMOTE-IPF ( José et al . ( 2015 ) ) , MDO ( Abdi & Hashemi ( 2015 ) ) , etc . Second , the above methods all use linear interpolation when generating samples , but linear interpolation has limitations . Therefore , an improved algorithm for generating samples by nonlinear interpolation has appeared . Random-SMOTE ( Dong & Wang ( 2011 ) ) performs interpolation in a triangular area formed by three samples , and Geometric SMOTE ( Douzas & Bacao ( 2017a ) ) generates samples in a geometric area instead of a linear area . Third , choose a more appropriate generation space , such as projecting to low-dimensional space ( Wang et al . ( 2007 ) ) or high-dimensional space ( Zhang & Yang ( 2018 ) ) . Fourth , when selecting neighbor samples , other indicators can be used to measure the distance between samples , such as cosine distance ( Koto ( 2014 ) ) , propensity score ( Rivera et al . ( 2014 ) ) , surrounding-neighbors ( Garcia et al . ( 2012 ) ) etc . The distribution sampling method is to learn the distribution function or density function of minority class samples , and then sample from the distribution function to obtain a new artificial sample . DEAGO ( Bellinger et al . ( 2015 ) ) generates samples by denoising autoencoder , while RACOG and WRACOG ( Das et al . ( 2015 ) ) used the dependency tree algorithm to estimate the discrete probability distribution , and then generated artificial samples from the probability distribution through Gibbs sampling . The copy replacement method is to copy safe minority class samples and eliminate unsafe majority class samples ( Stefanowski & Wilk ( 2008 ) , Napierala et al . ( 2010 ) ) . 2.3 GENTIC ALGORITHM . Genetic algorithm ( GA ) is a bionic algorithm proposed by Holland ( Holland ( 1975 ) ) in 1975 . Its main idea is to simulate the inheritance and mutation of genes during human evolution , and to control the evolution direction of samples through the fitness function . As a heuristic algorithm , it is often used in optimization problems ( Rahmatsamii & Michielssen ( 1999 ) , Fonseca & Fleming ( 1993 ) , Wright ( 1990 ) , Homaifar et al . ( 1994 ) ) , using the entire problem space as the search space , and searching for the best value in the search space . Genetic algorithms are also often used to optimize machine learning algorithms , such as SVM ( Kim et al . ( 2005 ) ) , K-means ( Krishna & Narasimha Murty ( 1999 ) ) , Decision Tree ( Bala et al . ( 1995 ) ) , neural network ( Montana ( 1989 ) ) , etc . Genetic algorithm relies on randomness in the optimization process , which means that the speed of finding the optimal solution is unstable , but the genetic algorithm will not get stuck in a local solution when the fitness function is appropriate . In the process of solving , because it does not rely on the additional knowledge , its search range is wide . It is for this reason that we believe that genetic algorithms can find great patterns that have not yet been discovered . 3 ROGA . 3.1 GA . 3.1.1 BASIC POPULATION . In the first iteration , this paper randomly generated N artificial samples as the basic population . In each subsequent iteration , the artificial samples generated in the previous iteration will be used as the basic population for this iteration . 3.1.2 FITNESS . The consideration of the degree of adaptation of the sample is mainly based on its attribution as a minority class sample . The fitness value of this sample is calculated by the Gaussian similarity with the surrounding samples , which is computed as : fitness ( xi ) = K∑ j yj ∗ sim ( xi , xj ) ( 1 ) sim ( xi , xj ) = e − ( √∑n k ( xik−xjk ) 2 ) 2 2σ2 ( 2 ) xi is the sample that currently needs to calculate fitness . K is the number of neighbors to choose and set to 5 in this paper . yj ∈ { −1 , 1 } . If xi and xj belong to the same sample , then yj = 1 . If they belong to the heterogeneous sample , then yj = −1 . σ is the standard deviation of Gaussian kernel and set to 1 in this paper .
The authors focus on the class imbalance problem and propose an algorithm named ROGA to generated samples of minority classes to balance the quantitative difference between classes. Specifically, the proposed ROGA generates samples of minority classes by using a Genetic Algorithm (GA) to explore the sample space. Moreover, to reduce the noise samples generated by ROGA, the authors propose to calculate the fitness as the Gaussian similarity with the surrounding samples and eliminate the samples with low fitness. My detailed comments are as follows.
SP:dd6a80c29d23d8ee356c637fff15c8d28956fba3
ROGA: Random Over-sampling Based on Genetic Algorithm
1 INTRODUCTION . When modeling the classification problem , the balance of classes can ensure that the information is balanced during the learning process of the model , but the classes are often unbalanced in actual tasks ( Kotsiantis et al . ( 2005 ) ; He & Garcia ( 2009 ) ) , which leads to the machine learning model preferring majority class samples . In order to solve this problem , a commonly used method uses oversampling algorithm to increase the minority class samples to balance the gap between the minority class samples and the majority class samples . Therefore , the quality of the generated samples will determine the training quality of the model after oversampling , but it is difficult to characterize this effect . In the past studies , oversampling methods only can estimated the noise samples , such as overlapping samples or outliers , and eliminated it as much as possible . Ensure that the sample does not make training the model more difficult . SMOTE ( Chawla et al . ( 2002 ) ) and its derivative algorithms generate new samples by interpolation . There has been a lot of work in the selection of samples to be interpolated , the number of interpolations , or the method of interpolation , and the final goal is to reduce the generation of noise samples by restricting the interpolation position . Some researchers pointed out that sampling should not be performed in the sample space , but should be projected to other spaces ( Wang et al . ( 2007 ) , Zhang & Yang ( 2018 ) ) . In addition , some researchers have proposed that sampling should be taken from the minority distribution ( Bellinger et al . ( 2015 ) , Das et al . ( 2015 ) ) to ensure the consistency of the distribution . It can be found that in order to reduce the generation of noise samples , the space for generating samples needs to be restricted , that is , the oversampling algorithm can only sample within a limited range . However , just paying attention to noise generation may not achieve better results . Too strong constraints will cause the sample generation space to be limited , and the generated samples will fall into a local optimal solution , so that it is impossible to find samples that are more conducive to model training . Therefore , in order to reduce the limitation on the sample generation space and reduce noise as much as possible , this paper proposes oversampling algorithm ROGA based on genetic algorithm . ROGA will randomly sample in the feature space before the first iteration , and generate a set of artificial samples as the basic population for the next iteration of the genetic algorithm . Random sampling will increase the noise in the samples , but it will also prevent ROGA from falling into a local optimal solution . In order to judge the noise , ROGA will calculate the fitness of each sample based on the Gaussian similarity with surrounding neighbors . The fitness represents the possibility that the sample is a noise sample . In the iterative process , new samples are generated through crossover and mutation operations , and samples with lower fitness are gradually removed , so as to reduce noise . ROGA will generate new samples in the entire feature space , mainly because the initial population is generated by random sampling in the entire feature space . The crossover and mutation operations of genetic algorithms will continuously change the samples in the population to find samples with higher fitness values , and the screening mechanism will help us eliminate noisy samples in the population . Therefore , ROGA can balance the wide generation space and noise generation . Through experiments on multiple datasets , we found that ROGA can achieve the best scores on some datasets on the F1-score . 2 RELATED WORK . 2.1 CLASS IMBALANCE . Data-based methods are represented by oversampling and undersampling . In order to balance the gap in the number of samples , oversampling generates new minority class samples , while undersampling ( Arefeen et al . ( 2020 ) ; Koziarski ( 2020 ) ) reduces redundant majority class samples . The algorithm-based method is to improve the model algorithm to make it more suitable for training on unbalanced data . The first improvement measure is to balance the loss caused by the majority class and the minority class in the cost-sensitive loss function . Cost-sensitive can be combined with various machine learning algorithms , such as Adaboost ( Wei ( 1999 ) ) , SVM ( Lin ( 2002 ) ) , Decision Tree ( Ling et al . ( 2005 ) ) , cross entropy ( Li & Zhu ( 2019 ) ) and so on . The second improvement measure is integrated learning technology . Liu et.al ( Liu et al . ( 2009 ) ) proposed EasyEnsemble and BalanceCascade , performed multiple under-sampling and integrated multiple models . Some researchers have added the ideas of Bagging ( Wang & Yao ( 2009 ) ) and Boosting ( Chawla et al . ( 2003 ) ) on SMOTE . 2.2 OVERSAMPLING . The oversampling algorithm is to generate new minority class samples to balance the quantitative difference between classes . The current oversampling algorithm can be divided into random sampling method , interpolation method , distributed sampling method and copy replacement method . The random sampling method is to perform random sampling in the feature space , and the generated samples can easily deviate from the distribution of the original samples and produce noisy data . The interpolation oversampling algorithm represented by SMOTEChawla et al . ( 2002 ) restricts the generation of samples between two samples , and generates new minority class samples through linear interpolation . On the basis of the SMOTEChawla et al . ( 2002 ) algorithm , a large number of improved algorithms have appeared . First , in order to further reduce the generation of noise , improvements can be made in the selection of the sample to be interpolated , the interpolation weight of the sample , and the position of the interpolation . SMOTE-Borderline ( Nguyen et al . ( 2011 ) ) believes that the minority class samples located at the decision boundary should be selected , and some researchers believe that interpolation should be performed within the minority class sample clusters generated by the clustering algorithm , such as KMeans-SMOTE ( Douzas & Bacao ( 2018 ) ) , CURE-SMOTE ( Ma & Fan ( 2017 ) ) , DBSMOTE ( Bunkhumpornpat et al . ( 2012 ) ) , SOMO ( Douzas & Bacao ( 2017b ) ) , etc . ADASYN ( He et al . ( 2008 ) ) , SMOTE-D ( Torres et al . ( 2016 ) ) and MSMOTE ( Hu et al . ( 2009 ) ) reduce the number of interpolations for some samples by setting the weight of the sample . When Safe-level SMOTE ( Bunkhumpornpat et al . ( 2009 ) ) generates samples , it will be closer to more regions of similar samples . In addition to controlling the noise generation in the generation stage , you can also filter the noises in the samples after generating the samples , such as SMOTE-FRST ( Verbiest et al . ( 2012 ) ) , SMOTE-IPF ( José et al . ( 2015 ) ) , MDO ( Abdi & Hashemi ( 2015 ) ) , etc . Second , the above methods all use linear interpolation when generating samples , but linear interpolation has limitations . Therefore , an improved algorithm for generating samples by nonlinear interpolation has appeared . Random-SMOTE ( Dong & Wang ( 2011 ) ) performs interpolation in a triangular area formed by three samples , and Geometric SMOTE ( Douzas & Bacao ( 2017a ) ) generates samples in a geometric area instead of a linear area . Third , choose a more appropriate generation space , such as projecting to low-dimensional space ( Wang et al . ( 2007 ) ) or high-dimensional space ( Zhang & Yang ( 2018 ) ) . Fourth , when selecting neighbor samples , other indicators can be used to measure the distance between samples , such as cosine distance ( Koto ( 2014 ) ) , propensity score ( Rivera et al . ( 2014 ) ) , surrounding-neighbors ( Garcia et al . ( 2012 ) ) etc . The distribution sampling method is to learn the distribution function or density function of minority class samples , and then sample from the distribution function to obtain a new artificial sample . DEAGO ( Bellinger et al . ( 2015 ) ) generates samples by denoising autoencoder , while RACOG and WRACOG ( Das et al . ( 2015 ) ) used the dependency tree algorithm to estimate the discrete probability distribution , and then generated artificial samples from the probability distribution through Gibbs sampling . The copy replacement method is to copy safe minority class samples and eliminate unsafe majority class samples ( Stefanowski & Wilk ( 2008 ) , Napierala et al . ( 2010 ) ) . 2.3 GENTIC ALGORITHM . Genetic algorithm ( GA ) is a bionic algorithm proposed by Holland ( Holland ( 1975 ) ) in 1975 . Its main idea is to simulate the inheritance and mutation of genes during human evolution , and to control the evolution direction of samples through the fitness function . As a heuristic algorithm , it is often used in optimization problems ( Rahmatsamii & Michielssen ( 1999 ) , Fonseca & Fleming ( 1993 ) , Wright ( 1990 ) , Homaifar et al . ( 1994 ) ) , using the entire problem space as the search space , and searching for the best value in the search space . Genetic algorithms are also often used to optimize machine learning algorithms , such as SVM ( Kim et al . ( 2005 ) ) , K-means ( Krishna & Narasimha Murty ( 1999 ) ) , Decision Tree ( Bala et al . ( 1995 ) ) , neural network ( Montana ( 1989 ) ) , etc . Genetic algorithm relies on randomness in the optimization process , which means that the speed of finding the optimal solution is unstable , but the genetic algorithm will not get stuck in a local solution when the fitness function is appropriate . In the process of solving , because it does not rely on the additional knowledge , its search range is wide . It is for this reason that we believe that genetic algorithms can find great patterns that have not yet been discovered . 3 ROGA . 3.1 GA . 3.1.1 BASIC POPULATION . In the first iteration , this paper randomly generated N artificial samples as the basic population . In each subsequent iteration , the artificial samples generated in the previous iteration will be used as the basic population for this iteration . 3.1.2 FITNESS . The consideration of the degree of adaptation of the sample is mainly based on its attribution as a minority class sample . The fitness value of this sample is calculated by the Gaussian similarity with the surrounding samples , which is computed as : fitness ( xi ) = K∑ j yj ∗ sim ( xi , xj ) ( 1 ) sim ( xi , xj ) = e − ( √∑n k ( xik−xjk ) 2 ) 2 2σ2 ( 2 ) xi is the sample that currently needs to calculate fitness . K is the number of neighbors to choose and set to 5 in this paper . yj ∈ { −1 , 1 } . If xi and xj belong to the same sample , then yj = 1 . If they belong to the heterogeneous sample , then yj = −1 . σ is the standard deviation of Gaussian kernel and set to 1 in this paper .
In this work, the authors propose an oversampling technique which creates a population of synthetic samples for an imbalanced dataset using genetic algorithms. Each individual in the GA population corresponds to a synthetic sample, and the fitness function is based on the similarity (in feature space) of the synthetic sample compared to nearby samples of the same and different classes; standard crossover and mutation operators are used. In a limited set of experiments, the proposed approach sometimes outperforms competing approaches.
SP:dd6a80c29d23d8ee356c637fff15c8d28956fba3
Reusing Preprocessing Data as Auxiliary Supervision in Conversational Analysis
1 INTRODUCTION . The sharp increase in uses of video-conferencing creates both a need and an opportunity to better understand these conversations ( Kim et al. , 2019a ) . In post-event applications , analyzing conversations can give feedback to improve communication skills ( Hoque et al. , 2013 ; Naim et al. , 2015 ) . In real-time applications , such systems can be useful in legal trials , public speaking , e-health services , and more ( Poria et al. , 2019 ; Tanveer et al. , 2015 ) . Analyzing conversations requires both human expertise and a lot of time , which is what many multimodal conversational analysis systems are trying to solve with automation . However , to build such systems , analysts often require a training set annotated by humans ( Poria et al. , 2019 ) . The annotation process is costly , thereby limiting the amount of labeled data . Moreover , third-party annotations on emotions are often noisy . Noisy data coupled with limited labeled data increases the chance of overfitting ( James et al. , 2013 ) . From the perspective of feature engineering to analyze video-conferences , analysts often employ pre-built libraries ( Baltrušaitis et al. , 2016 ; Vokaturi , 2019 ) to extract multimodal features as inputs to training . This preprocessing phase is often computationally heavy , and the resulting features are only used as inputs . In this paper , we investigate how the preprocessed data can be re-used as auxiliary tasks in Primary Multi-Task Learning ( MTL ) , thereby promoting a more productive use of data , in the form of auxiliary supervised learning . Specifically , our main contributions are ( 1 ) the identification of beneficially auxiliary tasks , ( 2 ) the method of distributing learning capacity between the primary and auxiliary tasks , and ( 3 ) the relative supervision hierarchy between the primary and auxiliary tasks . We demonstrate the value of our approach through predicting emotions on two publicly available datasets , IEMOCAP ( Busso et al. , 2008 ) and SEMAINE ( McKeown et al. , 2011 ) . 2 RELATED WORKS AND HYPOTHESES . Multitask learning has a long history in machine learning ( Caruana , 1997 ) . In this paper , we focus on Primary MTL , a less commonly discussed subfield within MTL ( Mordan et al. , 2018 ) . Primary MTL is concerned with the performance on one ( primary ) task – the sole motivation of adding auxiliary tasks is to improve the primary task performance . In recent years , primary MTL has been gaining attention in computer vision ( Yoo et al. , 2018 ; Fariha , 2016 ; Yang et al. , 2018 ; Mordan et al. , 2018 ; Sadoughi & Busso , 2018 ) , speech recognition ( Krishna et al. , 2018 ; Chen & Mak , 2015 ; Tao & Busso , 2020 ; Bell et al. , 2016 ; Chen et al. , 2014 ) , and natural language processing ( NLP ) ( Arora et al. , 2019 ; Yousif et al. , 2018 ; Zalmout & Habash , 2019 ; Yang et al. , 2019 ; Du et al. , 2017 ) . The benefit of adding multiple tasks is to provide inductive bias through multiple noisy supervision ( Caruana , 1997 ; Lipton et al. , 2015 ; Ghosn & Bengio , 1997 ) . On the other hand , the drawback of adding multiple tasks increases the risk of negative transfer ( Torrey & Shavlik , 2010 ; Lee et al. , 2016 ; 2018 ; Liu et al. , 2019 ; Simm et al. , 2014 ) , which leads to many design considerations . Two of such considerations are , identifying ( a ) what tasks are beneficial and ( b ) how much of the model parameters to share between the primary and auxiliary tasks . In addition , because we are performing Primary MTL , we have the third consideration of ( c ) whether we should prioritize primary supervision by giving it a higher hierarchy than the auxiliary supervision . In contrast with previous MTL works , our approach ( a ) identifies sixteen beneficially auxiliary targets , ( b ) dedicates a primary-specific branch within the network , and ( c ) investigates the efficacy and generalization of prioritizing primary supervision across eight primary tasks . Since our input representation is fully text-based , we dive deeper into primary MTL in the NLP community . Regarding model architecture designs for primary MTL in NLP , Søgaard & Goldberg ( 2016 ) found that lower-level tasks like part-of-speech tagging , are better kept at the lower layers , enabling the higher-level tasks like Combinatory Categorical Grammar tagging to use these lowerlevel representations . In our approach , our model hierarchy is not based on the difficulty of the tasks , but more simply , we prioritize the primary task . Regarding identifying auxiliary supervisors in NLP , existing works have included tagging the input text ( Zalmout & Habash , 2019 ; Yang et al. , 2019 ; Søgaard & Goldberg , 2016 ) . Text classification with auxiliary supervisors have included research article classification ( Du et al. , 2017 ; Yousif et al. , 2018 ) , and tweet classification ( Arora et al. , 2019 ) . There is a large body of work in multimodal sentiment analysis , but not in the use of multimodal auxiliary supervisors , as detailed in the next paragraph . Multimodal analysis of conversations has been gaining attention in deep learning research , particularly for emotion recognition in conversations ( Poria et al. , 2019 ) . The methods in the recent three years have been intelligently fusing numeric vectors from the text , audio , and video modalities before feeding it to downstream layers . This approach is seen in MFN ( Zadeh et al. , 2018a ) , MARN ( Zadeh et al. , 2018b ) , CMN ( Hazarika et al. , 2018b ) , ICON ( Hazarika et al. , 2018a ) , DialogueRNN ( Majumder et al. , 2019 ) , and M3ER ( Mittal et al. , 2020 ) . Our approach is different in two ways . ( 1 ) Our audio and video information is encoded within text before feeding only the text as input . Having only text as input has the benefits of interpretability , and the ability to present the conversational analysis on paper ( Kim et al. , 2019b ) . This is similar to how the linguistics community performs manual conversational analysis using the Jefferson transcription system ( Jefferson , 2004 ) , where the transcripts are marked up with symbols indicating how the speech was articulated . ( 2 ) Instead of using the audio and video information as only inputs to a Single Task Learning ( STL ) model , the contribution of this paper is that we demonstrate how to use multimodal information in both input and as auxiliary supervisors to provide inductive bias that helps the primary task . Hypothesis H1 : The introduced set of auxiliary supervision features improves primary MTL . We introduce and motivate the full set of sixteen auxiliary supervisions , all based on existing literature : these are grouped into four families , each with four auxiliary targets . The four families are ( 1 ) facial action units , ( 2 ) prosody , ( 3 ) historical labels , and ( 4 ) future labels : ( 1 ) Facial action units , from the facial action coding system identifies universal facial expressions of emotions ( Ekman , 1997 ) . Particularly , AU 05 , 17 , 20 , 25 have been shown to be useful in detecting depression ( Yang et al. , 2016a ; Kim et al. , 2019b ) and rapport-building ( Anonymous , 2021 ) . ( 2 ) Prosody , the tone of voice – happiness , sadness , anger , and fear – can project warmth and attitudes ( Hall et al. , 2009 ) , and has been used as inputs in emotions detection ( Garcia-Garcia et al. , 2017 ) . ( 3 and 4 ) Using features at different historical time-points is a common practice in statistical learning , especially in time-series modelling ( Christ et al. , 2018 ) . Lastly , predicting future labels as auxiliary tasks can help in learning ( Caruana et al. , 1996 ; Cooper et al. , 2005 ; Trinh et al. , 2018 ; Zhu et al. , 2020 ; Shen et al. , 2020 ) . Inspired by their work , we propose using historical and future ( up to four talkturns ago or later ) target labels as auxiliary targets . Although historical and future target labels can be used as a pre-training objective and fine-tuned on the current target label , sequential transfer learning is not the focus of this paper . Given that we are extracting actions and prosody families as inputs , we propose to explore whether they can be reused as supervisors ( see Fig . 1 ) . Our hypothesis H1 is that re-using them as auxiliary supervision improves primary MTL . This is related to using hints in the existing MTL literature , where the auxiliary tasks promote the learning of the feature ( Cheng et al. , 2015 ; Yu & Jiang , 2016 ) . Hypothesis H2 : When the primary branch is given maximum learning capacity , it would not be outperformed by models with primary branch having less than the maximum learning capacity . Deeper models with higher learning capacity produce better results ( Huang et al. , 2019 ; Nakkiran et al. , 2019 ; Menegola et al. , 2017 ; Blumberg et al. , 2018 ; Romero et al. , 2014 ) . Also , since the auxiliary branch is shared with the primary supervision , the auxiliary capacity should be limited to enforce information transfer and improve performance ( Wu et al. , 2020 ) . Therefore , given a fixed learning capacity budget , our hypothesis H2 implies that we should allocate the maximum learning capacity to the primary branch because we care only about the primary task performance . Hypothesis H3 : Auxiliary supervision at the lower hierarchy yields better primary MTL as compared to flat-MTL . Having the auxiliary tasks at the same supervisory level as the primary task is inherently sub-optimal because we care only about the performance of the primary task ( Mordan et al. , 2018 ) . To prioritize the primary task , we could change the model architecture such that the auxiliary supervision is at the lower hierarchy than the primary supervision , which will be discussed in the next section . 3 MODEL ARCHITECTURE . 3.1 FLAT-MTL HIERARCHICAL ATTENTION MODEL . We start with an introduction of the Hierarchical Attention Model ( HAN ) ( Yang et al. , 2016b ) . We chose HAN because of its easy interpretability as it only uses single-head attention layers . There are four parts to the HAN model , ( 1 ) text input , ( 2 ) word encoder , ( 3 ) talkturn encoder , and ( 4 ) the predictor . In our application , we perform our predictions at the talkturn-level for both IEMOCAP and SEMAINE . For notation , let si represent the i-th talkturn and wit represent the t-th word in the i-th talkturn . Each single talkturn can contain up to T words , and each input talkturn can contain up to L past talkturns to give content context ( to discuss in section 4.2 ) . Text Input Given a talkturn of words , we first convert the words into vectors through an embedding matrix We , and the word selection one-hot vector , wit . Word encoder The word encoder comprises of bidirectional GRUs ( Bahdanau et al. , 2014 ) and a single head attention to aggregate word embeddings into talkturn embeddings . Given the vectors xit , the bidirectional GRU reads the words from left to right as well as from right to left ( as indicated by the direction of the GRU arrows ) and concatenates the two hidden states together to form hit . We then aggregate the hidden states into one talkturn embedding through the attention mechanism . uit is the hidden state from feeding hit into a one-layer perceptron ( with weights Ww and biases bw ) . The attention weight ( αit ) given to uit is the softmax normalized weight of the similarity between itself ( uit ) and uw , which are all randomly initialized and learnt jointly . xit = Wewit , t ∈ [ 1 , T ] uit = relu ( Wwhit + bw ) −→ h it = −−−→ GRU ( xit ) , t ∈ [ 1 , T ] αit = exp ( u > ituw ) Σtexp ( u > ituw ) ←− h it = ←−−− GRU ( xit ) , t ∈ [ T , 1 ] si = Σtαituit hit = ( −→ h it , ←− h it ) Talkturn encoder With the current and past talkturn embeddings ( content context , to discuss in section 4.2 ) , the talkturn encoder aggregates them into a single talkturn representation ( v ) in a similar fashion , as shown below . −→ h i = −−−→ GRU ( si ) , i ∈ [ 1 , L ] ui = relu ( Wshi + bs ) ←− h i = ←−−− GRU ( si ) , i ∈ [ L , 1 ] αi = exp ( u > i us ) Σiexp ( u > i us ) hi = ( −→ h i , ←− h i ) v = Σiαiui The simplest way of adding the sixteen ( four auxiliary targets from four families of auxiliary supervision ) auxiliary task predictors would be to append them to where the primary task predictor is , as illustrated in Fig . 2 . That way , all predictors use the same representation v. We refer to this architecture as flat-MTL because the auxiliary supervision is at the same level as the primary supervision . We are unable to test H2 and H3 using this architecture .
This paper addresses challenges faced in the multi-task learning (MTL) models used in analyzing multimodal conversational data. The main challenge paper is trying to solve is on how to select relevant auxiliary tasks that avoid negative transfer. The authors explore how the preprocessed data used for feature engineering can be re-used as auxiliary tasks in the model. The authors identified sixteen relevant auxiliary tasks, identified a method to distribute learning capacity between primary and auxiliary tasks and proposed a relative supervision hierarchy between primary and auxiliary tasks. An extensive set of experiments are conducted to show the effectiveness of the approach.
SP:14c8ee6cc91f94c22b9cd29c98be73e551677937
Reusing Preprocessing Data as Auxiliary Supervision in Conversational Analysis
1 INTRODUCTION . The sharp increase in uses of video-conferencing creates both a need and an opportunity to better understand these conversations ( Kim et al. , 2019a ) . In post-event applications , analyzing conversations can give feedback to improve communication skills ( Hoque et al. , 2013 ; Naim et al. , 2015 ) . In real-time applications , such systems can be useful in legal trials , public speaking , e-health services , and more ( Poria et al. , 2019 ; Tanveer et al. , 2015 ) . Analyzing conversations requires both human expertise and a lot of time , which is what many multimodal conversational analysis systems are trying to solve with automation . However , to build such systems , analysts often require a training set annotated by humans ( Poria et al. , 2019 ) . The annotation process is costly , thereby limiting the amount of labeled data . Moreover , third-party annotations on emotions are often noisy . Noisy data coupled with limited labeled data increases the chance of overfitting ( James et al. , 2013 ) . From the perspective of feature engineering to analyze video-conferences , analysts often employ pre-built libraries ( Baltrušaitis et al. , 2016 ; Vokaturi , 2019 ) to extract multimodal features as inputs to training . This preprocessing phase is often computationally heavy , and the resulting features are only used as inputs . In this paper , we investigate how the preprocessed data can be re-used as auxiliary tasks in Primary Multi-Task Learning ( MTL ) , thereby promoting a more productive use of data , in the form of auxiliary supervised learning . Specifically , our main contributions are ( 1 ) the identification of beneficially auxiliary tasks , ( 2 ) the method of distributing learning capacity between the primary and auxiliary tasks , and ( 3 ) the relative supervision hierarchy between the primary and auxiliary tasks . We demonstrate the value of our approach through predicting emotions on two publicly available datasets , IEMOCAP ( Busso et al. , 2008 ) and SEMAINE ( McKeown et al. , 2011 ) . 2 RELATED WORKS AND HYPOTHESES . Multitask learning has a long history in machine learning ( Caruana , 1997 ) . In this paper , we focus on Primary MTL , a less commonly discussed subfield within MTL ( Mordan et al. , 2018 ) . Primary MTL is concerned with the performance on one ( primary ) task – the sole motivation of adding auxiliary tasks is to improve the primary task performance . In recent years , primary MTL has been gaining attention in computer vision ( Yoo et al. , 2018 ; Fariha , 2016 ; Yang et al. , 2018 ; Mordan et al. , 2018 ; Sadoughi & Busso , 2018 ) , speech recognition ( Krishna et al. , 2018 ; Chen & Mak , 2015 ; Tao & Busso , 2020 ; Bell et al. , 2016 ; Chen et al. , 2014 ) , and natural language processing ( NLP ) ( Arora et al. , 2019 ; Yousif et al. , 2018 ; Zalmout & Habash , 2019 ; Yang et al. , 2019 ; Du et al. , 2017 ) . The benefit of adding multiple tasks is to provide inductive bias through multiple noisy supervision ( Caruana , 1997 ; Lipton et al. , 2015 ; Ghosn & Bengio , 1997 ) . On the other hand , the drawback of adding multiple tasks increases the risk of negative transfer ( Torrey & Shavlik , 2010 ; Lee et al. , 2016 ; 2018 ; Liu et al. , 2019 ; Simm et al. , 2014 ) , which leads to many design considerations . Two of such considerations are , identifying ( a ) what tasks are beneficial and ( b ) how much of the model parameters to share between the primary and auxiliary tasks . In addition , because we are performing Primary MTL , we have the third consideration of ( c ) whether we should prioritize primary supervision by giving it a higher hierarchy than the auxiliary supervision . In contrast with previous MTL works , our approach ( a ) identifies sixteen beneficially auxiliary targets , ( b ) dedicates a primary-specific branch within the network , and ( c ) investigates the efficacy and generalization of prioritizing primary supervision across eight primary tasks . Since our input representation is fully text-based , we dive deeper into primary MTL in the NLP community . Regarding model architecture designs for primary MTL in NLP , Søgaard & Goldberg ( 2016 ) found that lower-level tasks like part-of-speech tagging , are better kept at the lower layers , enabling the higher-level tasks like Combinatory Categorical Grammar tagging to use these lowerlevel representations . In our approach , our model hierarchy is not based on the difficulty of the tasks , but more simply , we prioritize the primary task . Regarding identifying auxiliary supervisors in NLP , existing works have included tagging the input text ( Zalmout & Habash , 2019 ; Yang et al. , 2019 ; Søgaard & Goldberg , 2016 ) . Text classification with auxiliary supervisors have included research article classification ( Du et al. , 2017 ; Yousif et al. , 2018 ) , and tweet classification ( Arora et al. , 2019 ) . There is a large body of work in multimodal sentiment analysis , but not in the use of multimodal auxiliary supervisors , as detailed in the next paragraph . Multimodal analysis of conversations has been gaining attention in deep learning research , particularly for emotion recognition in conversations ( Poria et al. , 2019 ) . The methods in the recent three years have been intelligently fusing numeric vectors from the text , audio , and video modalities before feeding it to downstream layers . This approach is seen in MFN ( Zadeh et al. , 2018a ) , MARN ( Zadeh et al. , 2018b ) , CMN ( Hazarika et al. , 2018b ) , ICON ( Hazarika et al. , 2018a ) , DialogueRNN ( Majumder et al. , 2019 ) , and M3ER ( Mittal et al. , 2020 ) . Our approach is different in two ways . ( 1 ) Our audio and video information is encoded within text before feeding only the text as input . Having only text as input has the benefits of interpretability , and the ability to present the conversational analysis on paper ( Kim et al. , 2019b ) . This is similar to how the linguistics community performs manual conversational analysis using the Jefferson transcription system ( Jefferson , 2004 ) , where the transcripts are marked up with symbols indicating how the speech was articulated . ( 2 ) Instead of using the audio and video information as only inputs to a Single Task Learning ( STL ) model , the contribution of this paper is that we demonstrate how to use multimodal information in both input and as auxiliary supervisors to provide inductive bias that helps the primary task . Hypothesis H1 : The introduced set of auxiliary supervision features improves primary MTL . We introduce and motivate the full set of sixteen auxiliary supervisions , all based on existing literature : these are grouped into four families , each with four auxiliary targets . The four families are ( 1 ) facial action units , ( 2 ) prosody , ( 3 ) historical labels , and ( 4 ) future labels : ( 1 ) Facial action units , from the facial action coding system identifies universal facial expressions of emotions ( Ekman , 1997 ) . Particularly , AU 05 , 17 , 20 , 25 have been shown to be useful in detecting depression ( Yang et al. , 2016a ; Kim et al. , 2019b ) and rapport-building ( Anonymous , 2021 ) . ( 2 ) Prosody , the tone of voice – happiness , sadness , anger , and fear – can project warmth and attitudes ( Hall et al. , 2009 ) , and has been used as inputs in emotions detection ( Garcia-Garcia et al. , 2017 ) . ( 3 and 4 ) Using features at different historical time-points is a common practice in statistical learning , especially in time-series modelling ( Christ et al. , 2018 ) . Lastly , predicting future labels as auxiliary tasks can help in learning ( Caruana et al. , 1996 ; Cooper et al. , 2005 ; Trinh et al. , 2018 ; Zhu et al. , 2020 ; Shen et al. , 2020 ) . Inspired by their work , we propose using historical and future ( up to four talkturns ago or later ) target labels as auxiliary targets . Although historical and future target labels can be used as a pre-training objective and fine-tuned on the current target label , sequential transfer learning is not the focus of this paper . Given that we are extracting actions and prosody families as inputs , we propose to explore whether they can be reused as supervisors ( see Fig . 1 ) . Our hypothesis H1 is that re-using them as auxiliary supervision improves primary MTL . This is related to using hints in the existing MTL literature , where the auxiliary tasks promote the learning of the feature ( Cheng et al. , 2015 ; Yu & Jiang , 2016 ) . Hypothesis H2 : When the primary branch is given maximum learning capacity , it would not be outperformed by models with primary branch having less than the maximum learning capacity . Deeper models with higher learning capacity produce better results ( Huang et al. , 2019 ; Nakkiran et al. , 2019 ; Menegola et al. , 2017 ; Blumberg et al. , 2018 ; Romero et al. , 2014 ) . Also , since the auxiliary branch is shared with the primary supervision , the auxiliary capacity should be limited to enforce information transfer and improve performance ( Wu et al. , 2020 ) . Therefore , given a fixed learning capacity budget , our hypothesis H2 implies that we should allocate the maximum learning capacity to the primary branch because we care only about the primary task performance . Hypothesis H3 : Auxiliary supervision at the lower hierarchy yields better primary MTL as compared to flat-MTL . Having the auxiliary tasks at the same supervisory level as the primary task is inherently sub-optimal because we care only about the performance of the primary task ( Mordan et al. , 2018 ) . To prioritize the primary task , we could change the model architecture such that the auxiliary supervision is at the lower hierarchy than the primary supervision , which will be discussed in the next section . 3 MODEL ARCHITECTURE . 3.1 FLAT-MTL HIERARCHICAL ATTENTION MODEL . We start with an introduction of the Hierarchical Attention Model ( HAN ) ( Yang et al. , 2016b ) . We chose HAN because of its easy interpretability as it only uses single-head attention layers . There are four parts to the HAN model , ( 1 ) text input , ( 2 ) word encoder , ( 3 ) talkturn encoder , and ( 4 ) the predictor . In our application , we perform our predictions at the talkturn-level for both IEMOCAP and SEMAINE . For notation , let si represent the i-th talkturn and wit represent the t-th word in the i-th talkturn . Each single talkturn can contain up to T words , and each input talkturn can contain up to L past talkturns to give content context ( to discuss in section 4.2 ) . Text Input Given a talkturn of words , we first convert the words into vectors through an embedding matrix We , and the word selection one-hot vector , wit . Word encoder The word encoder comprises of bidirectional GRUs ( Bahdanau et al. , 2014 ) and a single head attention to aggregate word embeddings into talkturn embeddings . Given the vectors xit , the bidirectional GRU reads the words from left to right as well as from right to left ( as indicated by the direction of the GRU arrows ) and concatenates the two hidden states together to form hit . We then aggregate the hidden states into one talkturn embedding through the attention mechanism . uit is the hidden state from feeding hit into a one-layer perceptron ( with weights Ww and biases bw ) . The attention weight ( αit ) given to uit is the softmax normalized weight of the similarity between itself ( uit ) and uw , which are all randomly initialized and learnt jointly . xit = Wewit , t ∈ [ 1 , T ] uit = relu ( Wwhit + bw ) −→ h it = −−−→ GRU ( xit ) , t ∈ [ 1 , T ] αit = exp ( u > ituw ) Σtexp ( u > ituw ) ←− h it = ←−−− GRU ( xit ) , t ∈ [ T , 1 ] si = Σtαituit hit = ( −→ h it , ←− h it ) Talkturn encoder With the current and past talkturn embeddings ( content context , to discuss in section 4.2 ) , the talkturn encoder aggregates them into a single talkturn representation ( v ) in a similar fashion , as shown below . −→ h i = −−−→ GRU ( si ) , i ∈ [ 1 , L ] ui = relu ( Wshi + bs ) ←− h i = ←−−− GRU ( si ) , i ∈ [ L , 1 ] αi = exp ( u > i us ) Σiexp ( u > i us ) hi = ( −→ h i , ←− h i ) v = Σiαiui The simplest way of adding the sixteen ( four auxiliary targets from four families of auxiliary supervision ) auxiliary task predictors would be to append them to where the primary task predictor is , as illustrated in Fig . 2 . That way , all predictors use the same representation v. We refer to this architecture as flat-MTL because the auxiliary supervision is at the same level as the primary supervision . We are unable to test H2 and H3 using this architecture .
This paper studies how the preprocessed data can be reused as auxiliary tasks in primary multi-task learning (MTL) for the multimodal emotion detection task. The authors propose and test three hypotheses for primary MTL. Two different hierarchical-level models, FLAT-MTL hierarchical attention model and HAN-Rock model, are proposed to improve the performance of the primary MTL.
SP:14c8ee6cc91f94c22b9cd29c98be73e551677937
OpenCoS: Contrastive Semi-supervised Learning for Handling Open-set Unlabeled Data
1 INTRODUCTION . Despite the recent success of deep neural networks with large-scale labeled data , many real-world scenarios suffer from expensive data acquisition and labeling costs . This has motivated the community to develop semi-supervised learning ( SSL ; Grandvalet & Bengio 2004 ; Chapelle et al . 2009 ) , i.e. , by further incorporating unlabeled data for training . Indeed , recent SSL works ( Berthelot et al. , 2019 ; 2020 ; Sohn et al. , 2020 ) demonstrate promising results on several benchmark datasets , as they could even approach the performance of fully supervised learning using only a small number of labels , e.g. , 93.73 % accuracy on CIFAR-10 with 250 labeled data ( Berthelot et al. , 2020 ) . However , SSL methods often fail to generalize when there is a mismatch between the classdistributions of labeled and unlabeled data ( Oliver et al. , 2018 ; Chen et al. , 2020c ; Guo et al. , 2020 ) , i.e. , when the unlabeled data contains out-of-class samples , whose ground-truth labels are not contained in the labeled dataset ( as illustrated in Figure 1 ( a ) ) . In this scenario , various label-guessing techniques used in the existing SSL methods may label those out-of-class samples incorrectly , which in turn significantly harms the overall training through their inner-process of entropy minimization ( Grandvalet & Bengio , 2004 ; Lee , 2013 ) or consistency regularization ( Xie et al. , 2019 ; Sohn et al. , 2020 ) . This problem may largely hinder the existing SSL methods from being used in practice , considering the open-set nature of unlabeled data collected in the wild ( Bendale & Boult , 2016 ) . Contribution . In this paper , we focus on a realistic SSL scenario , where unlabeled data may contain some unknown out-of-class samples , i.e. , there is a class distribution mismatch between labeled and unlabeled data ( Oliver et al. , 2018 ) . Compared to prior approaches that have bypassed this problem by simply filtering out them with some heuristic detection scores ( Nair et al. , 2019 ; Chen et al. , 2020c ) , the unique characteristic in our approach is to further leverage the information in out-of-class samples by assigning soft-labels to them : they may still contain some useful features for the in-classes . Somewhat surprisingly , we found that a recent technique of contrastive unsupervised learning ( Wu et al. , 2018 ; He et al. , 2020 ; Chen et al. , 2020a ) can play a key role for our goal . More specifically , we show that a pre-trained representation via contrastive learning , namely SimCLR ( Chen et al. , 2020a ) , on both labeled and unlabeled data enables us to design ( a ) an effective score for detecting out-of-class samples in unlabeled data , and ( b ) a systematic way to assign soft-labels to the detected out-of-class samples , by modeling class-conditional likelihoods from labeled data . Finally , we found ( c ) auxiliary batch normalization layers ( Xie et al. , 2020 ) could further help to mitigate the class-distribution mismatch via decoupling batch normalization layers . We propose a generic SSL framework , coined OpenCoS , based on the aforementioned techniques for handling open-set unlabeled data , which can be integrated with any existing SSL methods . We verify the effectiveness of the proposed method on a wide range of SSL benchmarks based on CIFAR-10 , CIFAR-100 ( Krizhevsky et al. , 2009 ) , and ImageNet ( Deng et al. , 2009 ) datasets , assuming the presence of various out-of-class data , e.g. , SVHN ( Netzer et al. , 2011 ) and TinyImageNet datasets . Our experimental results demonstrate that OpenCoS greatly improves existing state-of-the-art SSL methods ( Berthelot et al. , 2019 ; 2020 ; Sohn et al. , 2020 ) , not only by discarding out-of-class samples , but also by further leveraging them into training . We also compare our method to other recent works ( Nair et al. , 2019 ; Chen et al. , 2020c ; Guo et al. , 2020 ) addressing the same class distribution mismatch problem in SSL , and again confirms the effectiveness of our framework , e.g. , we achieve an accuracy of 68.37 % with 40 labels ( just 4 labels per class ) on CIFAR-10 with TinyImageNet as out-of-class , compared to DS3L ( Guo et al. , 2020 ) of 56.32 % . Overall , our work highlights the benefit of unsupervised representations in ( semi- ) supervised learning : such a label-free representation turns out to enhance model generalization due to its robustness on the novel , out-of-class samples . 2 PRELIMINARIES . 2.1 SEMI-SUPERVISED LEARNING . The goal of semi-supervised learning for classification is to train a classifier f : X → Y from a labeled dataset Dl = { x ( i ) l , y ( i ) l } Nl i=1 where each label yl is from a set of classes Y : = { 1 , · · · , C } , and an unlabeled dataset Du = { x ( i ) u } Nui=1 where each yu exists but is assumed to be unknown . In an attempt to leverage the extra information in Du , a number of techniques have been proposed , e.g. , entropy minimization ( Grandvalet & Bengio , 2004 ; Lee , 2013 ) and consistency regularization ( Sajjadi et al. , 2016 ) . In general , recent approaches in semi-supervised learning can be distinguished by the prior they adopt for the representation of unlabeled data : for example , the consistency regularization technique ( Sajjadi et al. , 2016 ) attempt to minimize the cross-entropy loss between any two predictions of different augmentations t1 ( xu ) and t2 ( xu ) from a given unlabeled sample xu , jointly with the standard training for a labeled sample ( xl , yl ) : LSSL ( xl , xu ) : = H ( yl , f ( xl ) ) + β ·H ( f ( t1 ( xu ) ) , f ( t2 ( xu ) ) ) , ( 1 ) where H is a standard cross-entropy loss for labeled data , and β is a hyperparameter . Recently , several “ holistic ” approaches of various techniques ( Zhang et al. , 2018 ; Cubuk et al. , 2019 ) have shown remarkable performance in practice , e.g. , MixMatch ( Berthelot et al. , 2019 ) , ReMixMatch ( Berthelot et al. , 2020 ) , and FixMatch ( Sohn et al. , 2020 ) , which we mainly consider in this paper . We note that our scheme can be integrated with any recent semi-supervised learning methods . 2.2 CONTRASTIVE REPRESENTATION LEARNING . Contrastive learning ( Oord et al. , 2018 ; Hénaff et al. , 2019 ; He et al. , 2020 ; Chen et al. , 2020a ) defines an unsupervised task for an encoder fe : X → Rde from a set of samples { xi } : assume that a “ query ” sample xq is given and there is a positive “ key ” x+ ∈ { xi } that xq matches . Then the contrastive loss is defined to let f to extract the necessary information to identify x+ from xq as follows : Lcon ( fe , xq , x+ ; { xi } ) : = − log exp ( h ( fe ( xq ) , fe ( x+ ) ) /τ ) ∑ i exp ( h ( fe ( xq ) , fe ( xi ) ) /τ ) , ( 2 ) where h ( · , · ) is a pre-defined similarity score , and τ is a temperature hyperparameter . In this paper , we primarily focus on SimCLR ( Chen et al. , 2020a ) , a particular form of contrastive learning : for a given { xi } Ni=1 , SimCLR first samples two separate data augmentation operations from a pre-defined family T , namely t1 , t2 ∼ T , and matches ( x̃i , x̃i+N ) : = ( t1 ( xi ) , t2 ( xi ) ) as a query-key pair interchangeably . The actual loss is then defined as follows : LSimCLR ( fe ; { xi } Ni=1 ) : = 1 2N 2N∑ q=1 Lcon ( fe , x̃q , x̃ ( q+N ) mod 2N ; { x̃i } 2Ni=1 \ { x̃q } ) , ( 3 ) hSimCLR ( v1 , v2 ) : = CosineSimilarity ( g ( v1 ) , g ( v2 ) ) = g ( v1 ) · g ( v2 ) ||g ( v1 ) ||2||g ( v2 ) ||2 , ( 4 ) where g : Rde → Rdp is a 2-layer neural network called projection header . In other words , the SimCLR loss defines a task to identify a “ semantically equivalent ” sample to xq up to the set of data augmentations T . 3 OPENCOS : A FRAMEWORK FOR OPEN-SET SEMI-SUPERVISED LEARNING . We consider semi-supervised classification problems involving C classes . In addition to the standard assumption of semi-supervised learning ( SSL ) , we assume that the unlabeled dataset Du is open-set , i.e. , the hidden labels yu of xu may not be in Y : = { 1 , · · · , C } . In this scenario , existing semisupervised learning techniques may degrade the classification performance , possibly due to incorrect label-guessing procedure for those out-of-class samples . In this respect , we introduce OpenCoS , a generic method for detecting and labeling out-of-class unlabeled samples in semi-supervised learning . Overall , our key intuition is to utilize the unsupervised representation from contrastive learning ( Wu et al. , 2018 ; He et al. , 2020 ; Chen et al. , 2020a ) to leverage such out-of-class samples in an appropriate manner . We present a brief overview of our method in Section 3.1 , and describe how our approach , OpenCoS , can handle out-of-class samples in Section 3.2 and 3.3 . 3.1 OVERVIEW OF OPENCOS . Recall that our goal is to train a classifier f : X → Y from a labeled dataset Dl and an open-set unlabeled dataset Du . Overall , OpenCoS aims to overcome the presence of out-of-class samples in Du through the following procedure : 1 . Pre-training via contrastive learning . OpenCoS first learns an unsupervised representation of f via SimCLR1 ( Chen et al. , 2020a ) , using both Dl and Du without labels . More specifically , we learn the penultimate features of f , denoted by fe , by minimizing the contrastive loss defined in ( 3 ) . We also introduce a projection header g ( 4 ) , which is a 2-layer MLP as per ( Chen et al. , 2020a ) . 2 . Detecting out-of-class samples . From a learned representation of fe and g , OpenCoS identifies an out-of-class unlabeled data Doutu from the given data Du = Dinu ∪ Doutu . This detection process is based on the similarity score between Dl and Du in the representation space of fe and g ( see Section 3.2 ) . 3 . Semi-supervised learning with auxiliary loss and batch normalization . Now , one can use any semi-supervised learning scheme to train f using Dl and Dinu , e.g. , ReMixMatch ( Berthelot et al. , 2020 ) . In addition , OpenCoS minimizes an auxiliary loss that assigns a soft-label to each sample in Doutu , which is also based on the representation of fe and g ( see Section 3.3 ) . Furthermore , we found maintaining auxiliary batch normalization layers ( Xie et al. , 2020 ) for Doutu is beneficial to our loss as they mitigate the distribution mismatch arisen from Doutu . Putting it all together , OpenCoS provides an effective and systematic way to detect and utilize outof-class data for semi-supervised learning . Due to its simplicity , our framework can incorporate the most recently proposed semi-supervised learning methods ( Berthelot et al. , 2019 ; 2020 ; Sohn et al. , 2020 ) and improve their performance in the presence of out-of-class samples . Figure 2 illustrates the overall training scheme of OpenCoS .
The paper proposes a new approach for open set semi-supervised learning, where there are unlabeled data from classes not in the labeled data. The paper uses a contrastive representation learning paradigm to learn a feature encoder and a similarity measurement. Then the paper filters outlier samples by the similarity measurement and further utilizes outlier samples with soft labels. The separate BN layers address the distribution shift between in-class and out-class data.
SP:313f52f0734140154ab31a602457829ae6eda9c0
OpenCoS: Contrastive Semi-supervised Learning for Handling Open-set Unlabeled Data
1 INTRODUCTION . Despite the recent success of deep neural networks with large-scale labeled data , many real-world scenarios suffer from expensive data acquisition and labeling costs . This has motivated the community to develop semi-supervised learning ( SSL ; Grandvalet & Bengio 2004 ; Chapelle et al . 2009 ) , i.e. , by further incorporating unlabeled data for training . Indeed , recent SSL works ( Berthelot et al. , 2019 ; 2020 ; Sohn et al. , 2020 ) demonstrate promising results on several benchmark datasets , as they could even approach the performance of fully supervised learning using only a small number of labels , e.g. , 93.73 % accuracy on CIFAR-10 with 250 labeled data ( Berthelot et al. , 2020 ) . However , SSL methods often fail to generalize when there is a mismatch between the classdistributions of labeled and unlabeled data ( Oliver et al. , 2018 ; Chen et al. , 2020c ; Guo et al. , 2020 ) , i.e. , when the unlabeled data contains out-of-class samples , whose ground-truth labels are not contained in the labeled dataset ( as illustrated in Figure 1 ( a ) ) . In this scenario , various label-guessing techniques used in the existing SSL methods may label those out-of-class samples incorrectly , which in turn significantly harms the overall training through their inner-process of entropy minimization ( Grandvalet & Bengio , 2004 ; Lee , 2013 ) or consistency regularization ( Xie et al. , 2019 ; Sohn et al. , 2020 ) . This problem may largely hinder the existing SSL methods from being used in practice , considering the open-set nature of unlabeled data collected in the wild ( Bendale & Boult , 2016 ) . Contribution . In this paper , we focus on a realistic SSL scenario , where unlabeled data may contain some unknown out-of-class samples , i.e. , there is a class distribution mismatch between labeled and unlabeled data ( Oliver et al. , 2018 ) . Compared to prior approaches that have bypassed this problem by simply filtering out them with some heuristic detection scores ( Nair et al. , 2019 ; Chen et al. , 2020c ) , the unique characteristic in our approach is to further leverage the information in out-of-class samples by assigning soft-labels to them : they may still contain some useful features for the in-classes . Somewhat surprisingly , we found that a recent technique of contrastive unsupervised learning ( Wu et al. , 2018 ; He et al. , 2020 ; Chen et al. , 2020a ) can play a key role for our goal . More specifically , we show that a pre-trained representation via contrastive learning , namely SimCLR ( Chen et al. , 2020a ) , on both labeled and unlabeled data enables us to design ( a ) an effective score for detecting out-of-class samples in unlabeled data , and ( b ) a systematic way to assign soft-labels to the detected out-of-class samples , by modeling class-conditional likelihoods from labeled data . Finally , we found ( c ) auxiliary batch normalization layers ( Xie et al. , 2020 ) could further help to mitigate the class-distribution mismatch via decoupling batch normalization layers . We propose a generic SSL framework , coined OpenCoS , based on the aforementioned techniques for handling open-set unlabeled data , which can be integrated with any existing SSL methods . We verify the effectiveness of the proposed method on a wide range of SSL benchmarks based on CIFAR-10 , CIFAR-100 ( Krizhevsky et al. , 2009 ) , and ImageNet ( Deng et al. , 2009 ) datasets , assuming the presence of various out-of-class data , e.g. , SVHN ( Netzer et al. , 2011 ) and TinyImageNet datasets . Our experimental results demonstrate that OpenCoS greatly improves existing state-of-the-art SSL methods ( Berthelot et al. , 2019 ; 2020 ; Sohn et al. , 2020 ) , not only by discarding out-of-class samples , but also by further leveraging them into training . We also compare our method to other recent works ( Nair et al. , 2019 ; Chen et al. , 2020c ; Guo et al. , 2020 ) addressing the same class distribution mismatch problem in SSL , and again confirms the effectiveness of our framework , e.g. , we achieve an accuracy of 68.37 % with 40 labels ( just 4 labels per class ) on CIFAR-10 with TinyImageNet as out-of-class , compared to DS3L ( Guo et al. , 2020 ) of 56.32 % . Overall , our work highlights the benefit of unsupervised representations in ( semi- ) supervised learning : such a label-free representation turns out to enhance model generalization due to its robustness on the novel , out-of-class samples . 2 PRELIMINARIES . 2.1 SEMI-SUPERVISED LEARNING . The goal of semi-supervised learning for classification is to train a classifier f : X → Y from a labeled dataset Dl = { x ( i ) l , y ( i ) l } Nl i=1 where each label yl is from a set of classes Y : = { 1 , · · · , C } , and an unlabeled dataset Du = { x ( i ) u } Nui=1 where each yu exists but is assumed to be unknown . In an attempt to leverage the extra information in Du , a number of techniques have been proposed , e.g. , entropy minimization ( Grandvalet & Bengio , 2004 ; Lee , 2013 ) and consistency regularization ( Sajjadi et al. , 2016 ) . In general , recent approaches in semi-supervised learning can be distinguished by the prior they adopt for the representation of unlabeled data : for example , the consistency regularization technique ( Sajjadi et al. , 2016 ) attempt to minimize the cross-entropy loss between any two predictions of different augmentations t1 ( xu ) and t2 ( xu ) from a given unlabeled sample xu , jointly with the standard training for a labeled sample ( xl , yl ) : LSSL ( xl , xu ) : = H ( yl , f ( xl ) ) + β ·H ( f ( t1 ( xu ) ) , f ( t2 ( xu ) ) ) , ( 1 ) where H is a standard cross-entropy loss for labeled data , and β is a hyperparameter . Recently , several “ holistic ” approaches of various techniques ( Zhang et al. , 2018 ; Cubuk et al. , 2019 ) have shown remarkable performance in practice , e.g. , MixMatch ( Berthelot et al. , 2019 ) , ReMixMatch ( Berthelot et al. , 2020 ) , and FixMatch ( Sohn et al. , 2020 ) , which we mainly consider in this paper . We note that our scheme can be integrated with any recent semi-supervised learning methods . 2.2 CONTRASTIVE REPRESENTATION LEARNING . Contrastive learning ( Oord et al. , 2018 ; Hénaff et al. , 2019 ; He et al. , 2020 ; Chen et al. , 2020a ) defines an unsupervised task for an encoder fe : X → Rde from a set of samples { xi } : assume that a “ query ” sample xq is given and there is a positive “ key ” x+ ∈ { xi } that xq matches . Then the contrastive loss is defined to let f to extract the necessary information to identify x+ from xq as follows : Lcon ( fe , xq , x+ ; { xi } ) : = − log exp ( h ( fe ( xq ) , fe ( x+ ) ) /τ ) ∑ i exp ( h ( fe ( xq ) , fe ( xi ) ) /τ ) , ( 2 ) where h ( · , · ) is a pre-defined similarity score , and τ is a temperature hyperparameter . In this paper , we primarily focus on SimCLR ( Chen et al. , 2020a ) , a particular form of contrastive learning : for a given { xi } Ni=1 , SimCLR first samples two separate data augmentation operations from a pre-defined family T , namely t1 , t2 ∼ T , and matches ( x̃i , x̃i+N ) : = ( t1 ( xi ) , t2 ( xi ) ) as a query-key pair interchangeably . The actual loss is then defined as follows : LSimCLR ( fe ; { xi } Ni=1 ) : = 1 2N 2N∑ q=1 Lcon ( fe , x̃q , x̃ ( q+N ) mod 2N ; { x̃i } 2Ni=1 \ { x̃q } ) , ( 3 ) hSimCLR ( v1 , v2 ) : = CosineSimilarity ( g ( v1 ) , g ( v2 ) ) = g ( v1 ) · g ( v2 ) ||g ( v1 ) ||2||g ( v2 ) ||2 , ( 4 ) where g : Rde → Rdp is a 2-layer neural network called projection header . In other words , the SimCLR loss defines a task to identify a “ semantically equivalent ” sample to xq up to the set of data augmentations T . 3 OPENCOS : A FRAMEWORK FOR OPEN-SET SEMI-SUPERVISED LEARNING . We consider semi-supervised classification problems involving C classes . In addition to the standard assumption of semi-supervised learning ( SSL ) , we assume that the unlabeled dataset Du is open-set , i.e. , the hidden labels yu of xu may not be in Y : = { 1 , · · · , C } . In this scenario , existing semisupervised learning techniques may degrade the classification performance , possibly due to incorrect label-guessing procedure for those out-of-class samples . In this respect , we introduce OpenCoS , a generic method for detecting and labeling out-of-class unlabeled samples in semi-supervised learning . Overall , our key intuition is to utilize the unsupervised representation from contrastive learning ( Wu et al. , 2018 ; He et al. , 2020 ; Chen et al. , 2020a ) to leverage such out-of-class samples in an appropriate manner . We present a brief overview of our method in Section 3.1 , and describe how our approach , OpenCoS , can handle out-of-class samples in Section 3.2 and 3.3 . 3.1 OVERVIEW OF OPENCOS . Recall that our goal is to train a classifier f : X → Y from a labeled dataset Dl and an open-set unlabeled dataset Du . Overall , OpenCoS aims to overcome the presence of out-of-class samples in Du through the following procedure : 1 . Pre-training via contrastive learning . OpenCoS first learns an unsupervised representation of f via SimCLR1 ( Chen et al. , 2020a ) , using both Dl and Du without labels . More specifically , we learn the penultimate features of f , denoted by fe , by minimizing the contrastive loss defined in ( 3 ) . We also introduce a projection header g ( 4 ) , which is a 2-layer MLP as per ( Chen et al. , 2020a ) . 2 . Detecting out-of-class samples . From a learned representation of fe and g , OpenCoS identifies an out-of-class unlabeled data Doutu from the given data Du = Dinu ∪ Doutu . This detection process is based on the similarity score between Dl and Du in the representation space of fe and g ( see Section 3.2 ) . 3 . Semi-supervised learning with auxiliary loss and batch normalization . Now , one can use any semi-supervised learning scheme to train f using Dl and Dinu , e.g. , ReMixMatch ( Berthelot et al. , 2020 ) . In addition , OpenCoS minimizes an auxiliary loss that assigns a soft-label to each sample in Doutu , which is also based on the representation of fe and g ( see Section 3.3 ) . Furthermore , we found maintaining auxiliary batch normalization layers ( Xie et al. , 2020 ) for Doutu is beneficial to our loss as they mitigate the distribution mismatch arisen from Doutu . Putting it all together , OpenCoS provides an effective and systematic way to detect and utilize outof-class data for semi-supervised learning . Due to its simplicity , our framework can incorporate the most recently proposed semi-supervised learning methods ( Berthelot et al. , 2019 ; 2020 ; Sohn et al. , 2020 ) and improve their performance in the presence of out-of-class samples . Figure 2 illustrates the overall training scheme of OpenCoS .
This paper considers the problem of semi-supervised learning, where the unlabeled data may include out-of-class samples. To address this task, the paper proposes a method consisting of three steps: (1) detecting out-of-class samples in the unlabeled set, (2) assigning soft-labels to the detected out-of-class samples using class-conditional likelihoods from labeled data, and (3) using auxiliary batch normalization layers to help mitigate the class distribution mismatch problem. Experiments are conducted on CIFAR-10, CIFAR-100, ImageNet datasets. Results show improvements over competing methods.
SP:313f52f0734140154ab31a602457829ae6eda9c0
Unsupervised Object Keypoint Learning using Local Spatial Predictability
1 INTRODUCTION . An intelligent agent situated in the visual world critically depends on a suitable representation of its incoming sensory information . For example , a representation that captures only information about relevant aspects of the world makes it easier to learn downstream tasks efficiently ( Barlow , 1989 ; Bengio et al. , 2013 ) . Similarly , when explicitly distinguishing abstract concepts , such as objects , at a representational level , it is easier to generalize ( systematically ) to novel scenes that are composed of these same abstract building blocks ( Lake et al. , 2017 ; van Steenkiste et al. , 2019 ; Greff et al. , 2020 ) . In recent work , several methods have been proposed to learn unsupervised representations of images that aim to facilitate agents in this way ( Veerapaneni et al. , 2019 ; Janner et al. , 2019 ) . Of particular interest are methods based on learned object keypoints that correspond to highly informative ( salient ) regions in the image as indicated by the presence of object parts ( Zhang et al. , 2018 ; Jakab et al. , 2018 ; Kulkarni et al. , 2019 ; Minderer et al. , 2019 ) . Many real world tasks primarily revolve around ( physical ) interactions between objects and agents . Therefore it is expected that a representation based on a set of task-agnostic object keypoints can be re-purposed to facilitate downstream learning ( and generalization ) on many different tasks ( Lake et al. , 2017 ) . One of the main challenges for learning representations based on object keypoints is to discover salient regions belonging to objects in an image without supervision . Recent methods take an information bottleneck approach , where a neural network is trained to allocate a fixed number of keypoints ( and learn corresponding representations ) in a way that helps making predictions about an image that has undergone some transformation ( Jakab et al. , 2018 ; Minderer et al. , 2019 ; Kulkarni et al. , 2019 ) . However , keypoints that are discovered in this way strongly depend on the specific transformation that is considered and therefore lack generality . For example , as we will confirm in our experiments , the recent Transporter ( Kulkarni et al. , 2019 ) learns to prioritize image regions that change over time , even when they are otherwise uninformative . Indeed , when relying on extrinsic object properties ( i.e . that are not unique to objects ) one becomes highly susceptible to distractors as we will demonstrate . In this work , we propose PermaKey a novel representation learning approach based on object keypoints that does not overly bias keypoints in this way . The key idea underlying our approach is to view objects as local regions in the image that have high internal predictive structure ( self-information ) . We argue that local predictability is an intrinsic property of an object and therefore more reliably captures objectness in images ( Alexe et al. , 2010 ) . This allows us to formulate a local spatial prediction problem to infer which of the image regions contain object parts . We perform this prediction task in the learned feature space of a convolutional neural network ( CNN ) to assess predictability based on a rich collection of learned low-level features . Using PointNet ( Jakab et al. , 2018 ) we can then convert these predictability maps to highly informative object keypoints . We extensively evaluate our approach on a number of Atari environments and compare to Transporter ( Kulkarni et al. , 2019 ) . We demonstrate how our method is able to discover keypoints that focus on image regions that are unpredictable and which often correspond to salient object parts . By leveraging local predictability to learn about objects , our method profits from a simpler yet better generalizable definition of an object . Indeed , we demonstrate how it learns keypoints that do not solely focus on temporal motion ( or any other extrinsic object property ) and is more robust to uninformative ( but predictable ) distractors in the environment , such as moving background . On Atari games , agents equipped with our keypoints outperform those using Transporter keypoints . Our method shows good performance even on challenging environments such as Battlezone involving shifting viewpoints where the Transporters ’ explicit motion bias fails to capture any task-relevant objects . As a final contribution , we investigate the use of graph neural networks ( Battaglia et al. , 2018 ) for processing keypoints , which potentially better accommodates their discrete nature when reasoning about their interactions , and provide an ablation study . 2 METHOD . To learn representations based on task-agnostic object keypoints we require a suitable definition of an object that can be applied in an unsupervised manner . At a high level , we define objects as abstract patterns in the visual input that can serve as modular building blocks ( i.e . they are self-contained and reusable independent of context ) for solving a particular task , in the sense that they can be separately intervened upon or reasoned with ( Greff et al. , 2020 ) . This lets us treat objects as local regions in input space that have high internal predictive structure based on statistical co-occurrence of features such as color , shape , etc . across a large number of samples . Hence , our focus is on their local predictability , which can be viewed as an “ intrinsic ” object property according to this definition . For example , Bruce & Tsotsos ( 2005 ) have previously shown that local regions with high self-information typically correspond to salient objects . More generally , self-information approximated via a set of cues involving center-surround feature differences has been used to quantify objectness ( Alexe et al. , 2010 ) . In this paper we introduce Prediction ERror MAp based KEYpoints ( PermaKey ) , which leverages this definition to learn about object keypoints and corresponding representations . The main component of PermaKey is a local spatial prediction network ( LSPN ) , which is trained to solve a local spatial prediction problem in feature space ( light-blue trapezoid in Figure 1 ) . It involves predicting the value of a feature from its surrounding neighbours , which can only be solved accurately when they belong to the same object . Hence , the error map ( predictability map ) that is obtained by evaluating the LSPN at different locations carves the feature space up into regions that have high internal predictive structure ( see rows 4 & 5 in Figure 2 ( a ) ) . In what follows , we delve into each of the 3 modules that constitute our PermaKey system : 1 ) the VAE to learn spatial features 2 ) the LSPN to solve the local spatial prediction task and 3 ) PointNet to group error maps into keypoints ( see Figure 1 for an overview ) . Spatial Feature Embedding To solve the local spatial prediction task we require an informative set of features at each image location . While prior approaches focus on low-level features of image patches ( eg . RGB values Isola et al . ( 2014 ) , or ICA features Bruce & Tsotsos ( 2005 ) ) , we propose to learn features using a Variational Auto-Encoder ( VAE ; Kingma & Welling ( 2014 ) ) . It consists of an Encoder that parametrizes the approximate posterior qφ ( z|x ) and a Decoder that parametrizes the generative model pθ ( xi|z ) , which are trained to model the observed data via the ELBO objective : Le ( θ , φ ) = Eqφ ( z|x ) log [ pθ ( x|z ) ] −DKL [ qφ ( z|x ) ||p ( z ) ] . ( 1 ) The encoder is based on several layers of convolutions that offer progressively more abstract image features by trading-off spatial resolution with depth . Hence , which layer ( s ) we choose as our feature embedding will have an effect on the outcome of the local spatial prediction problem . While more abstract high-level features are expected to better capture the internal predictive structure of an object , it will be more difficult to attribute the error of the prediction network to the exact image location . On the other hand , while more low-level features can be localized more accurately , they may lack the expressiveness to capture high-level properties of objects . Nonetheless , in practice we find that a spatial feature embedding based on earlier layers of the encoder works well ( see also Section 5.3 for an ablation ) . Local Spatial Prediction Task Using the learned spatial feature embedding we seek out salient regions of the input image that correspond to object parts . Our approach is based on the idea that objects correspond to local regions in feature space that have high internal predictive structure , which allows us to formulate the following local spatial prediction ( LSP ) task . For each location in the learned spatial feature embedding , we seek to predict the value of the features ( across the feature maps ) from its neighbouring feature values . When neighbouring areas correspond to the same object- ( part ) , i.e . they regularly appear together , we expect that this prediction problem is easy ( green arrow in Figure 3 ) . In contrast , this is much harder when insufficient context is available ( red arrow Figure 3 : Two different prediction scenarios encountered when attempting to solve the LSP task . In the first case , too little context information is available to predict the center patch from its surroundings , likely yielding a prediction error ( assuming the character is not always present ) . Alternatively , when sufficient context is available as in the second case , prediction becomes easy . in Figure 3 ) , or when features rarely co-occur . Similarly , when parts of an image remain fixed across a large number observations it is easily predictable regardless of how much context is available . We implement the local spatial prediction task by training a neural network ( LSPN in Figure 1 ) to predict a center patch of features from the 8 first-order neighbouring patches using the learned spatial feature embedding at layer l of the VAE encoder . The weights of this network are trained to solve this prediction problem across images and across feature locations using the following objective : Lp ( ψl ) = 1 NHW ∑ x H , W∑ i , j ( fLSPNψl ( A [ ne ( i , j ) ] ) −A [ i , j ] ) 2 , ( 2 ) where A ∈ RH×W×C is the set of feature maps at layer l of the encoder qφ ( z|x ) , and ne ( i , j ) are the coordinates of the first-order neighbours surrounding i , j and H , W are the height and width of the spatial feature maps respectively . The features of the neighbouring locations are concatenated before being fed to the network . We train a separate LSPN for each of the chosen feature embedding specified by the encoder layer ( s ) and record their error at each location to obtain predictability maps that are expected to indicate the presence of objects ( rows 4 & 5 in Figure 2 ( a ) ) . Extracting Keypoints from Error Maps The predictability maps can be thought of as being a superposition of the local predictability errors due to each of the individual objects in the scene . Hence , what remains is to extract the k most salient regions ( belonging to object parts ) as our object keypoints from these predictability maps . We do so by training a PointNet ( Jakab et al. , 2018 ) to reconstruct the error maps through a bottleneck consisting of k fixed-width 2D Gaussian windows with learnable centers µ that are the keypoints ( Lg loss in Figure 1 ) as shown below : Lg ( ω ) = 1 MHW M∑ m H , W∑ i , j ( fPointNetω ( H [ m , i , j ] ) −H [ m , i , j ] ) 2 . ( 3 ) HereH ∈ RM×H×W is the concatenation of layer-wise LSP error maps for various encoder layer ( s ) l ( M in total ) , and H , W are the height and width of the error maps ( potentially up-sampled ) . Since the bottleneck layer has only limited capacity it is forced to consider locations that are most helpful in minimizing reconstruction error . This also requires the PointNet to consider statistical regularities across the predictability maps that can efficiently be described . In that sense this procedure can be thought of as a way of ( spatially ) clustering the local errors belonging to the same object by placing keypoints .
The authors tackle the problem of self-supervised representation learning, and validate their approach on downstream Reinforcement Learning tasks. Building on the insight that predictability in local patches is a good inductive bias for salient regions that characterize objects, the authors propose a well-reasoned, well-engineered and thoroughly validated pipeline for learning object keypoints without supervision. The authors present a wide range of ablative studies to validate their design choices, and demonstrate the superiority of their method both illustratively as well as quantitatively on a number of standard Atari benchmarks.
SP:794393405d88536ffc86021bf4939b168ff7f791
Unsupervised Object Keypoint Learning using Local Spatial Predictability
1 INTRODUCTION . An intelligent agent situated in the visual world critically depends on a suitable representation of its incoming sensory information . For example , a representation that captures only information about relevant aspects of the world makes it easier to learn downstream tasks efficiently ( Barlow , 1989 ; Bengio et al. , 2013 ) . Similarly , when explicitly distinguishing abstract concepts , such as objects , at a representational level , it is easier to generalize ( systematically ) to novel scenes that are composed of these same abstract building blocks ( Lake et al. , 2017 ; van Steenkiste et al. , 2019 ; Greff et al. , 2020 ) . In recent work , several methods have been proposed to learn unsupervised representations of images that aim to facilitate agents in this way ( Veerapaneni et al. , 2019 ; Janner et al. , 2019 ) . Of particular interest are methods based on learned object keypoints that correspond to highly informative ( salient ) regions in the image as indicated by the presence of object parts ( Zhang et al. , 2018 ; Jakab et al. , 2018 ; Kulkarni et al. , 2019 ; Minderer et al. , 2019 ) . Many real world tasks primarily revolve around ( physical ) interactions between objects and agents . Therefore it is expected that a representation based on a set of task-agnostic object keypoints can be re-purposed to facilitate downstream learning ( and generalization ) on many different tasks ( Lake et al. , 2017 ) . One of the main challenges for learning representations based on object keypoints is to discover salient regions belonging to objects in an image without supervision . Recent methods take an information bottleneck approach , where a neural network is trained to allocate a fixed number of keypoints ( and learn corresponding representations ) in a way that helps making predictions about an image that has undergone some transformation ( Jakab et al. , 2018 ; Minderer et al. , 2019 ; Kulkarni et al. , 2019 ) . However , keypoints that are discovered in this way strongly depend on the specific transformation that is considered and therefore lack generality . For example , as we will confirm in our experiments , the recent Transporter ( Kulkarni et al. , 2019 ) learns to prioritize image regions that change over time , even when they are otherwise uninformative . Indeed , when relying on extrinsic object properties ( i.e . that are not unique to objects ) one becomes highly susceptible to distractors as we will demonstrate . In this work , we propose PermaKey a novel representation learning approach based on object keypoints that does not overly bias keypoints in this way . The key idea underlying our approach is to view objects as local regions in the image that have high internal predictive structure ( self-information ) . We argue that local predictability is an intrinsic property of an object and therefore more reliably captures objectness in images ( Alexe et al. , 2010 ) . This allows us to formulate a local spatial prediction problem to infer which of the image regions contain object parts . We perform this prediction task in the learned feature space of a convolutional neural network ( CNN ) to assess predictability based on a rich collection of learned low-level features . Using PointNet ( Jakab et al. , 2018 ) we can then convert these predictability maps to highly informative object keypoints . We extensively evaluate our approach on a number of Atari environments and compare to Transporter ( Kulkarni et al. , 2019 ) . We demonstrate how our method is able to discover keypoints that focus on image regions that are unpredictable and which often correspond to salient object parts . By leveraging local predictability to learn about objects , our method profits from a simpler yet better generalizable definition of an object . Indeed , we demonstrate how it learns keypoints that do not solely focus on temporal motion ( or any other extrinsic object property ) and is more robust to uninformative ( but predictable ) distractors in the environment , such as moving background . On Atari games , agents equipped with our keypoints outperform those using Transporter keypoints . Our method shows good performance even on challenging environments such as Battlezone involving shifting viewpoints where the Transporters ’ explicit motion bias fails to capture any task-relevant objects . As a final contribution , we investigate the use of graph neural networks ( Battaglia et al. , 2018 ) for processing keypoints , which potentially better accommodates their discrete nature when reasoning about their interactions , and provide an ablation study . 2 METHOD . To learn representations based on task-agnostic object keypoints we require a suitable definition of an object that can be applied in an unsupervised manner . At a high level , we define objects as abstract patterns in the visual input that can serve as modular building blocks ( i.e . they are self-contained and reusable independent of context ) for solving a particular task , in the sense that they can be separately intervened upon or reasoned with ( Greff et al. , 2020 ) . This lets us treat objects as local regions in input space that have high internal predictive structure based on statistical co-occurrence of features such as color , shape , etc . across a large number of samples . Hence , our focus is on their local predictability , which can be viewed as an “ intrinsic ” object property according to this definition . For example , Bruce & Tsotsos ( 2005 ) have previously shown that local regions with high self-information typically correspond to salient objects . More generally , self-information approximated via a set of cues involving center-surround feature differences has been used to quantify objectness ( Alexe et al. , 2010 ) . In this paper we introduce Prediction ERror MAp based KEYpoints ( PermaKey ) , which leverages this definition to learn about object keypoints and corresponding representations . The main component of PermaKey is a local spatial prediction network ( LSPN ) , which is trained to solve a local spatial prediction problem in feature space ( light-blue trapezoid in Figure 1 ) . It involves predicting the value of a feature from its surrounding neighbours , which can only be solved accurately when they belong to the same object . Hence , the error map ( predictability map ) that is obtained by evaluating the LSPN at different locations carves the feature space up into regions that have high internal predictive structure ( see rows 4 & 5 in Figure 2 ( a ) ) . In what follows , we delve into each of the 3 modules that constitute our PermaKey system : 1 ) the VAE to learn spatial features 2 ) the LSPN to solve the local spatial prediction task and 3 ) PointNet to group error maps into keypoints ( see Figure 1 for an overview ) . Spatial Feature Embedding To solve the local spatial prediction task we require an informative set of features at each image location . While prior approaches focus on low-level features of image patches ( eg . RGB values Isola et al . ( 2014 ) , or ICA features Bruce & Tsotsos ( 2005 ) ) , we propose to learn features using a Variational Auto-Encoder ( VAE ; Kingma & Welling ( 2014 ) ) . It consists of an Encoder that parametrizes the approximate posterior qφ ( z|x ) and a Decoder that parametrizes the generative model pθ ( xi|z ) , which are trained to model the observed data via the ELBO objective : Le ( θ , φ ) = Eqφ ( z|x ) log [ pθ ( x|z ) ] −DKL [ qφ ( z|x ) ||p ( z ) ] . ( 1 ) The encoder is based on several layers of convolutions that offer progressively more abstract image features by trading-off spatial resolution with depth . Hence , which layer ( s ) we choose as our feature embedding will have an effect on the outcome of the local spatial prediction problem . While more abstract high-level features are expected to better capture the internal predictive structure of an object , it will be more difficult to attribute the error of the prediction network to the exact image location . On the other hand , while more low-level features can be localized more accurately , they may lack the expressiveness to capture high-level properties of objects . Nonetheless , in practice we find that a spatial feature embedding based on earlier layers of the encoder works well ( see also Section 5.3 for an ablation ) . Local Spatial Prediction Task Using the learned spatial feature embedding we seek out salient regions of the input image that correspond to object parts . Our approach is based on the idea that objects correspond to local regions in feature space that have high internal predictive structure , which allows us to formulate the following local spatial prediction ( LSP ) task . For each location in the learned spatial feature embedding , we seek to predict the value of the features ( across the feature maps ) from its neighbouring feature values . When neighbouring areas correspond to the same object- ( part ) , i.e . they regularly appear together , we expect that this prediction problem is easy ( green arrow in Figure 3 ) . In contrast , this is much harder when insufficient context is available ( red arrow Figure 3 : Two different prediction scenarios encountered when attempting to solve the LSP task . In the first case , too little context information is available to predict the center patch from its surroundings , likely yielding a prediction error ( assuming the character is not always present ) . Alternatively , when sufficient context is available as in the second case , prediction becomes easy . in Figure 3 ) , or when features rarely co-occur . Similarly , when parts of an image remain fixed across a large number observations it is easily predictable regardless of how much context is available . We implement the local spatial prediction task by training a neural network ( LSPN in Figure 1 ) to predict a center patch of features from the 8 first-order neighbouring patches using the learned spatial feature embedding at layer l of the VAE encoder . The weights of this network are trained to solve this prediction problem across images and across feature locations using the following objective : Lp ( ψl ) = 1 NHW ∑ x H , W∑ i , j ( fLSPNψl ( A [ ne ( i , j ) ] ) −A [ i , j ] ) 2 , ( 2 ) where A ∈ RH×W×C is the set of feature maps at layer l of the encoder qφ ( z|x ) , and ne ( i , j ) are the coordinates of the first-order neighbours surrounding i , j and H , W are the height and width of the spatial feature maps respectively . The features of the neighbouring locations are concatenated before being fed to the network . We train a separate LSPN for each of the chosen feature embedding specified by the encoder layer ( s ) and record their error at each location to obtain predictability maps that are expected to indicate the presence of objects ( rows 4 & 5 in Figure 2 ( a ) ) . Extracting Keypoints from Error Maps The predictability maps can be thought of as being a superposition of the local predictability errors due to each of the individual objects in the scene . Hence , what remains is to extract the k most salient regions ( belonging to object parts ) as our object keypoints from these predictability maps . We do so by training a PointNet ( Jakab et al. , 2018 ) to reconstruct the error maps through a bottleneck consisting of k fixed-width 2D Gaussian windows with learnable centers µ that are the keypoints ( Lg loss in Figure 1 ) as shown below : Lg ( ω ) = 1 MHW M∑ m H , W∑ i , j ( fPointNetω ( H [ m , i , j ] ) −H [ m , i , j ] ) 2 . ( 3 ) HereH ∈ RM×H×W is the concatenation of layer-wise LSP error maps for various encoder layer ( s ) l ( M in total ) , and H , W are the height and width of the error maps ( potentially up-sampled ) . Since the bottleneck layer has only limited capacity it is forced to consider locations that are most helpful in minimizing reconstruction error . This also requires the PointNet to consider statistical regularities across the predictability maps that can efficiently be described . In that sense this procedure can be thought of as a way of ( spatially ) clustering the local errors belonging to the same object by placing keypoints .
This paper works on unsupervised discovering keypoints in an Atari game frame to help improving Atari game performance. The keypoint discovery is based on predicting "predictable" local structure. I.e., the authors consider points that can not be predicted from its neighbor as good. Experiments show the learned keypoints performs better on 3 Atari games (Table. 1) than a counterpart keypoint discovery method, Transporter.
SP:794393405d88536ffc86021bf4939b168ff7f791
Do Transformers Understand Polynomial Simplification?
Recently researchers have demonstrated that Transformers can be trained to learn symbolic tasks such as solving integration and differential equations in an end-toend fashion . In these setups , for an input symbolic expression , the Transformer predicts the final solution in a single step . Since such tasks may consist of a sequence of logical steps , question remains whether such networks have understood and learnt individual steps to reach the solution . To take a deeper look , we consider the task of polynomial simplification . Polynomials can be written in a simple normal form as a sum of monomials which are ordered in a lexicographic order . For a polynomial which is not necessarily in this normal form , a sequence of simplification steps is applied to reach the fully simplified ( i.e. , in the normal form ) polynomial . For this task , we describe a synthetic Polynomial dataset generation algorithm which generates polynomials with unique proof steps . Then , we conduct an extensive analysis of the Transformer ’ s abilities to learn the polynomial simplification task along different dimensions . 1 INTRODUCTION . With the state-of-the-art performance of Deep Neural Nets ( DNNs ) in perceptual tasks , researchers have started to explore their logical reasoning capabilities , in particular within the domain of Automated Theorem Proving ( ATP ) . In these domains ( LEAN ( de Moura et al. , 2015 ) , HOL Light and Mizar ( miz , 2020 ) ) , many recent works ( Paliwal et al. , 2020 ; Aygün et al. , 2020 ; Hahn et al. , 2020 ) have shown that Graph Neural Networks ( Gori et al. , 2005 ; Veličković et al. , 2018 ) and Transformers ( Vaswani et al. , 2017 ) can be trained to perform impressively on the theorem-proving task as part of a neuro-symbolic system . In a related but different development , recently Lample & Charton ( 2019 ) showed that for symbolic integration and differential equations , a large amount of synthetic end-to-end examples can be generated using symbolic systems . In these tasks , the authors show that Transformer networks can be trained to produce the final solution from an input integral ( or differential equation ) in a single step . This points to the exciting possibility of using deep neural nets to learn end-to-end theorem provers , and can be beneficial for formal mathematics ( Szegedy , 2020 ) . However , the setup combines multiple reasoning steps in a single shot . Additionally , integration ( or differential equation solving ) is a complex task requiring understanding of the integral symbols , functions , variables , and the basic concepts of arithmetic . As the system in Lample & Charton ( 2019 ) is simply trained to output the top solution ( s ) and a corresponding confidence score ( s ) , it is unclear what internal mechanisms enable these models to solve these problems . This lack of transparency has been noted in this context ( Davis , 2019 ) . An earlier work by Piotrowski et al . ( 2019 ) showed similar results for certain symbolic manipulation tasks and their work shares the same limitation . In this paper we ask if instead of only producing the end-result of symbolic manipulation or integral , can we have the model produce a human-readable proof as well . While we do not know if these models reason in the way humans do , one way to produce proofs would be to “ extract ” a proof from the models of the above type by “ probing ” them in some mannner . The problem of unraveling the inner workings of Transformers by probing is an active area of research ; however , at present our understanding is still evolving ( Rogers et al. , 2020 ) . Hence taking a detour , we instead train the model to produce the full proof . Inspired by Piotrowski et al . ( 2019 ) , we explore a novel but simpler setting of polynomial simplification . We illustrate the task with an example . We begin with a polynomial which is a sum of product of factors , where each factor is again a sum of monomials ( including constants ) , as shown below : P0 = ( 2 ∗ x22 ) ∗ factor︷ ︸︸ ︷ ( 3 ∗ x12︸ ︷︷ ︸ term +4 ) + product︷ ︸︸ ︷ ( 5 ∗ x21 + x11 ∗ x12 ) ∗ ( 3 ∗ x11 ) ∗ ( 2 ) , / * Initial * / To construct unique simplification steps , first each term in a factor is simplified . Once all factors are simplified ( facstep ) ; then within a product , all factors are multiplied ( mulstep ) . Lastly simplified products are summed ( sumstep ) . P0 = ( 2 ∗ x22 ) ∗ ( 3 ∗ x12 + 4 ) + ( 5 ∗ x21 + x11 ∗ x12 ) ∗ ( 3 ∗ x11 ) ∗ ( 2 ) , / * FACSTEP * / = ( 2 ∗ x22 ) ∗ ( 3 ∗ x2 + 4 ) + ( 5 ∗ x21 + x11 ∗ x12 ) ∗ ( 3 ∗ x11 ) ∗ ( 2 ) , ( P1 ) , / * FACSTEP * / = ( 2 ∗ x22 ) ∗ ( 3 ∗ x2 + 4 ) + ( 5 ∗ x21 + x1 ∗ x2 ) ∗ ( 3 ∗ x1 ) ∗ ( 2 ) , ( P2 ) , / * MULSTEP * / = ( 6 ∗ x32 + 8 ∗ x22 ) + ( 5 ∗ x21 + x1 ∗ x2 ) ∗ ( 3 ∗ x1 ) ∗ ( 2 ) , ( P3 ) , / * MULSTEP * / = ( 6 ∗ x32 + 8 ∗ x22 ) + ( 30 ∗ x31 + 6 ∗ x21 ∗ x2 ) , ( P4 ) , / * SUMSTEP * / = 30 ∗ x31 + 6 ∗ x32 + 6 ∗ x21 ∗ x2 + 8 ∗ x22 . ( P5 ) , / * ENDPOINT * / . Piotrowski et al . ( 2019 ) explores the task of learning symbolic re-write of an entire expression . In contrast , in our setting , for step-wise prediction , at each step the system needs to find the candidate sub-expression and a relevant simplification type to perform the simplification . This setup resembles the traditional ATP setup where a system needs to learn and execute symbolic steps to reach a final solution . But it is simpler as for each step only one type of simplification is applicable . By proof for an initial polynomial ( P0 ) we mean the sequence of simplification steps ( P1 to P5 ) . A model trained on step-wise prediction task , can be used to generate a full proof . Essentially , we start with an initial polynomial , and recursively feed the model output to itself , till it generates the final simplified polynomial ( in normal form ) . A proof is correct when all steps are correct . In the above setting ( termed COARSE ) , all terms in a factor are simplified at once in a facstep , and similarly all factors in a product are simplified at once in a mulstep . Additionally , we define another setting FINER , where a facstep involves simplification of a single term , and a mulstep involves multiplications of only two factors at once , illustrated below with an example ( for facstep ) : P0 = ( 5 ∗ x21 + x11 ∗ x12 ) ∗ ( 3 ∗ x11 ) ∗ ( 2 ) , / * FACSTEP * / = ( 5 ∗ x21 + x1 ∗ x2 ) ∗ ( 3 ∗ x11 ) ∗ ( 2 ) , / * FACSTEP * / = ( 5 ∗ x21 + x1 ∗ x2 ) ∗ ( 3 ∗ x1 ) ∗ ( 2 ) . As a state-of-the-art model , we explore Transformers . While both Graph Neural Networks and Transformers have been used for single-step representation learning of symbolic theorems and single step goal-theorem scoring , Transformer-based sequence-to-sequence networks have shown superiority in end-to-end tasks in integration , differential equations ( Lample & Charton , 2019 ) and temporal logic ( Hahn et al. , 2020 ) domains . Hence for the aforementioned tasks of step-wise polynomial simplification , we explore the Transformer ’ s ability along several dimensions . Our contributions are the following : 1 ) we propose polynomial simplification tasks requiring multiple steps of symbolic manipulation , 2 ) we show how datasets of different configurations can be generated synthetically for the task , 3 ) we propose an array of metrics to dissect the performance of Transformers , and 4 ) lastly through extensive experiments we show the performance of the Transformer on this task , establishing a strong baseline for future endeavors . Results Summary By varying over coefficient size , proof granularity and input representation ( in Tables 1 , 2 , Appendix Table 6 ) we observe that 1 ) full proof accuracy is only slightly lower than single-shot endpoint prediction accuracy in many 1-variable configurations , 2 ) coarse granular proofs help learn somewhat more accurate proofs , 3 ) prefix representation helps in most cases but infix sometimes provides higher accuracy . More than 80 % errors ( Tab . 7 and 8 in Appendix ) occur in multiplication steps , and we observe ( through independent experiments ) Transformer ’ s struggle to learn how to multiply numeric coefficients . By letting the system annotate the candidate subexpression , we observe that the system can understand candidate sub-expressions and which next step to perform explicitly ( Tables 3 , and Appendix Tables 9 , 10 , 11 ) . Also , through visualization we observe similar effects ( Figures 1 , 2 Appendix ) . We see systems trained for 2-variable outperform corresponding 1-variable systems on 1-variable test sets . For 1 variable , we observe steady and significant higher gains ( till 10 % for full proof ) using curriculum learning ( Table 17 Appendix ) . 2 RELATED WORK AND DISCUSSION . Unlike the problems dealt with by the aforementioned automatic theorem provers and related neuralbased systems , polynomial simplification does not involve any search . Our problem is simpler and tests a specific ability , namely certain kinds of symbol manipulations . This simplicity affords certain advantages ( shared by Piotrowski et al . ( 2019 ) and Lample & Charton ( 2019 ) ) : ( 1 ) We can generate artificial data to train models without limitations on the size . ( 2 ) It is easier to test the abilities of the models more thoroughly along multiple axes . ( 3 ) Accuracy achieved is much higher than for harder tasks , suggesting that fully solving such tasks may be possible in the near future . To compare with symbolic manipulation systems we note that in more detail the ability tested by our task is the following : the model must be able to identify smallest parts of the polynomial that can be simplified : ( 1 ) simplification of a factor , ( 2 ) multiplication of two factors , ( 3 ) addition of two sub-polynomials . Having identified what simplification to apply the model must produce a new polynomial with just that simplification . This ability is not tested by previous neural-based symbolic manipulation systems such as Piotrowski et al . ( 2019 ) and Lample & Charton ( 2019 ) and related works such as Saxton et al . ( 2019 ) and Hahn et al . ( 2020 ) . Several recent works have produced synthetic datasets for theorem proving tasks ( Aygün et al. , 2020 ; Wu et al. , 2020 ; Polu & Sutskever , 2020 ) , however , their focus remains more on search-based proofs .
The paper "Do Transformers Understand Polynomial Simplification?" introduces a new reasoning task (convert polynomials into a normal form) and studies the performance and errors of Transformers on this task. The task itself is quite simple: given a randomly generated term involving small constants, variables, additions, and multiplications, bring the term into a well-defined normal form. Each task has to be solved in a unique sequence of steps. The authors study the performance of Transformers to either simplify the expressions step by step or to predict the simplified version directly.
SP:37921395ed7b214f2921391b2fde1f2ba209719f
Do Transformers Understand Polynomial Simplification?
Recently researchers have demonstrated that Transformers can be trained to learn symbolic tasks such as solving integration and differential equations in an end-toend fashion . In these setups , for an input symbolic expression , the Transformer predicts the final solution in a single step . Since such tasks may consist of a sequence of logical steps , question remains whether such networks have understood and learnt individual steps to reach the solution . To take a deeper look , we consider the task of polynomial simplification . Polynomials can be written in a simple normal form as a sum of monomials which are ordered in a lexicographic order . For a polynomial which is not necessarily in this normal form , a sequence of simplification steps is applied to reach the fully simplified ( i.e. , in the normal form ) polynomial . For this task , we describe a synthetic Polynomial dataset generation algorithm which generates polynomials with unique proof steps . Then , we conduct an extensive analysis of the Transformer ’ s abilities to learn the polynomial simplification task along different dimensions . 1 INTRODUCTION . With the state-of-the-art performance of Deep Neural Nets ( DNNs ) in perceptual tasks , researchers have started to explore their logical reasoning capabilities , in particular within the domain of Automated Theorem Proving ( ATP ) . In these domains ( LEAN ( de Moura et al. , 2015 ) , HOL Light and Mizar ( miz , 2020 ) ) , many recent works ( Paliwal et al. , 2020 ; Aygün et al. , 2020 ; Hahn et al. , 2020 ) have shown that Graph Neural Networks ( Gori et al. , 2005 ; Veličković et al. , 2018 ) and Transformers ( Vaswani et al. , 2017 ) can be trained to perform impressively on the theorem-proving task as part of a neuro-symbolic system . In a related but different development , recently Lample & Charton ( 2019 ) showed that for symbolic integration and differential equations , a large amount of synthetic end-to-end examples can be generated using symbolic systems . In these tasks , the authors show that Transformer networks can be trained to produce the final solution from an input integral ( or differential equation ) in a single step . This points to the exciting possibility of using deep neural nets to learn end-to-end theorem provers , and can be beneficial for formal mathematics ( Szegedy , 2020 ) . However , the setup combines multiple reasoning steps in a single shot . Additionally , integration ( or differential equation solving ) is a complex task requiring understanding of the integral symbols , functions , variables , and the basic concepts of arithmetic . As the system in Lample & Charton ( 2019 ) is simply trained to output the top solution ( s ) and a corresponding confidence score ( s ) , it is unclear what internal mechanisms enable these models to solve these problems . This lack of transparency has been noted in this context ( Davis , 2019 ) . An earlier work by Piotrowski et al . ( 2019 ) showed similar results for certain symbolic manipulation tasks and their work shares the same limitation . In this paper we ask if instead of only producing the end-result of symbolic manipulation or integral , can we have the model produce a human-readable proof as well . While we do not know if these models reason in the way humans do , one way to produce proofs would be to “ extract ” a proof from the models of the above type by “ probing ” them in some mannner . The problem of unraveling the inner workings of Transformers by probing is an active area of research ; however , at present our understanding is still evolving ( Rogers et al. , 2020 ) . Hence taking a detour , we instead train the model to produce the full proof . Inspired by Piotrowski et al . ( 2019 ) , we explore a novel but simpler setting of polynomial simplification . We illustrate the task with an example . We begin with a polynomial which is a sum of product of factors , where each factor is again a sum of monomials ( including constants ) , as shown below : P0 = ( 2 ∗ x22 ) ∗ factor︷ ︸︸ ︷ ( 3 ∗ x12︸ ︷︷ ︸ term +4 ) + product︷ ︸︸ ︷ ( 5 ∗ x21 + x11 ∗ x12 ) ∗ ( 3 ∗ x11 ) ∗ ( 2 ) , / * Initial * / To construct unique simplification steps , first each term in a factor is simplified . Once all factors are simplified ( facstep ) ; then within a product , all factors are multiplied ( mulstep ) . Lastly simplified products are summed ( sumstep ) . P0 = ( 2 ∗ x22 ) ∗ ( 3 ∗ x12 + 4 ) + ( 5 ∗ x21 + x11 ∗ x12 ) ∗ ( 3 ∗ x11 ) ∗ ( 2 ) , / * FACSTEP * / = ( 2 ∗ x22 ) ∗ ( 3 ∗ x2 + 4 ) + ( 5 ∗ x21 + x11 ∗ x12 ) ∗ ( 3 ∗ x11 ) ∗ ( 2 ) , ( P1 ) , / * FACSTEP * / = ( 2 ∗ x22 ) ∗ ( 3 ∗ x2 + 4 ) + ( 5 ∗ x21 + x1 ∗ x2 ) ∗ ( 3 ∗ x1 ) ∗ ( 2 ) , ( P2 ) , / * MULSTEP * / = ( 6 ∗ x32 + 8 ∗ x22 ) + ( 5 ∗ x21 + x1 ∗ x2 ) ∗ ( 3 ∗ x1 ) ∗ ( 2 ) , ( P3 ) , / * MULSTEP * / = ( 6 ∗ x32 + 8 ∗ x22 ) + ( 30 ∗ x31 + 6 ∗ x21 ∗ x2 ) , ( P4 ) , / * SUMSTEP * / = 30 ∗ x31 + 6 ∗ x32 + 6 ∗ x21 ∗ x2 + 8 ∗ x22 . ( P5 ) , / * ENDPOINT * / . Piotrowski et al . ( 2019 ) explores the task of learning symbolic re-write of an entire expression . In contrast , in our setting , for step-wise prediction , at each step the system needs to find the candidate sub-expression and a relevant simplification type to perform the simplification . This setup resembles the traditional ATP setup where a system needs to learn and execute symbolic steps to reach a final solution . But it is simpler as for each step only one type of simplification is applicable . By proof for an initial polynomial ( P0 ) we mean the sequence of simplification steps ( P1 to P5 ) . A model trained on step-wise prediction task , can be used to generate a full proof . Essentially , we start with an initial polynomial , and recursively feed the model output to itself , till it generates the final simplified polynomial ( in normal form ) . A proof is correct when all steps are correct . In the above setting ( termed COARSE ) , all terms in a factor are simplified at once in a facstep , and similarly all factors in a product are simplified at once in a mulstep . Additionally , we define another setting FINER , where a facstep involves simplification of a single term , and a mulstep involves multiplications of only two factors at once , illustrated below with an example ( for facstep ) : P0 = ( 5 ∗ x21 + x11 ∗ x12 ) ∗ ( 3 ∗ x11 ) ∗ ( 2 ) , / * FACSTEP * / = ( 5 ∗ x21 + x1 ∗ x2 ) ∗ ( 3 ∗ x11 ) ∗ ( 2 ) , / * FACSTEP * / = ( 5 ∗ x21 + x1 ∗ x2 ) ∗ ( 3 ∗ x1 ) ∗ ( 2 ) . As a state-of-the-art model , we explore Transformers . While both Graph Neural Networks and Transformers have been used for single-step representation learning of symbolic theorems and single step goal-theorem scoring , Transformer-based sequence-to-sequence networks have shown superiority in end-to-end tasks in integration , differential equations ( Lample & Charton , 2019 ) and temporal logic ( Hahn et al. , 2020 ) domains . Hence for the aforementioned tasks of step-wise polynomial simplification , we explore the Transformer ’ s ability along several dimensions . Our contributions are the following : 1 ) we propose polynomial simplification tasks requiring multiple steps of symbolic manipulation , 2 ) we show how datasets of different configurations can be generated synthetically for the task , 3 ) we propose an array of metrics to dissect the performance of Transformers , and 4 ) lastly through extensive experiments we show the performance of the Transformer on this task , establishing a strong baseline for future endeavors . Results Summary By varying over coefficient size , proof granularity and input representation ( in Tables 1 , 2 , Appendix Table 6 ) we observe that 1 ) full proof accuracy is only slightly lower than single-shot endpoint prediction accuracy in many 1-variable configurations , 2 ) coarse granular proofs help learn somewhat more accurate proofs , 3 ) prefix representation helps in most cases but infix sometimes provides higher accuracy . More than 80 % errors ( Tab . 7 and 8 in Appendix ) occur in multiplication steps , and we observe ( through independent experiments ) Transformer ’ s struggle to learn how to multiply numeric coefficients . By letting the system annotate the candidate subexpression , we observe that the system can understand candidate sub-expressions and which next step to perform explicitly ( Tables 3 , and Appendix Tables 9 , 10 , 11 ) . Also , through visualization we observe similar effects ( Figures 1 , 2 Appendix ) . We see systems trained for 2-variable outperform corresponding 1-variable systems on 1-variable test sets . For 1 variable , we observe steady and significant higher gains ( till 10 % for full proof ) using curriculum learning ( Table 17 Appendix ) . 2 RELATED WORK AND DISCUSSION . Unlike the problems dealt with by the aforementioned automatic theorem provers and related neuralbased systems , polynomial simplification does not involve any search . Our problem is simpler and tests a specific ability , namely certain kinds of symbol manipulations . This simplicity affords certain advantages ( shared by Piotrowski et al . ( 2019 ) and Lample & Charton ( 2019 ) ) : ( 1 ) We can generate artificial data to train models without limitations on the size . ( 2 ) It is easier to test the abilities of the models more thoroughly along multiple axes . ( 3 ) Accuracy achieved is much higher than for harder tasks , suggesting that fully solving such tasks may be possible in the near future . To compare with symbolic manipulation systems we note that in more detail the ability tested by our task is the following : the model must be able to identify smallest parts of the polynomial that can be simplified : ( 1 ) simplification of a factor , ( 2 ) multiplication of two factors , ( 3 ) addition of two sub-polynomials . Having identified what simplification to apply the model must produce a new polynomial with just that simplification . This ability is not tested by previous neural-based symbolic manipulation systems such as Piotrowski et al . ( 2019 ) and Lample & Charton ( 2019 ) and related works such as Saxton et al . ( 2019 ) and Hahn et al . ( 2020 ) . Several recent works have produced synthetic datasets for theorem proving tasks ( Aygün et al. , 2020 ; Wu et al. , 2020 ; Polu & Sutskever , 2020 ) , however , their focus remains more on search-based proofs .
The authors analyze the performance of Transformer models on simplifying polynomials and - importantly - generating proofs at the same time. This is a very nice idea that allows to study the performance of Transformers in depth and at the same time in an important setting where verification is performed as part of running the model. And the authors show a strong baseline, with models performing very well in a number of settings. A few areas seem to have been neglected though. For one, the authors only train a 4-layer 4-head model, which is quite small as far as Transformers go. Maybe it's irrelevant for this problem - but having at least one bigger model as a point of comparison would be good. Next, the out-of-distribution question warrants more experiments. Can the Transformers simplify polynomials with way more factors than trained on? With a higher number of variables? Higher degrees? The authors also show that one main problem for Transformers is learning to multiply the coefficients. But - assuming this reviewer understood correctly - the authors do not apply the proof requirement to multiplication. E.g., for "12*3" the model has to immediately output "36" rather than "10*3 + 2*3 = 30 + 6 = 36". Maybe this could help the Transformer learn and be more resilient to coefficient size? So while the current version of the paper is ok, there are a few areas for improvement which prevent it from being a clear accept.
SP:37921395ed7b214f2921391b2fde1f2ba209719f
Can one hear the shape of a neural network?: Snooping the GPU via Magnetic Side Channel
1 INTRODUCTION . The Graphics Processing Unit ( GPU ) is a favored vehicle for executing a neural network . As it computes , it also hums—electromagnetically . What can this hum tell us ? Could listening to the GPU ’ s electromagnetic ( EM ) radiation reveal details about the neural network ? We study this question and find that magnetic induction sensing reveals a detailed network structure , including both topology and hyperparameter values , from inferences of otherwise unknown networks running on GPUs . Reverse engineering a network structure has attracted increasing research effort , motivated by several concerns . First , it has been well known that the performance of a network model hinges on its judiciously designed structure—but finding an effective design is no easy task . Significant time and energy is expended in searching and fine-tuning network structures ( Zoph et al. , 2018 ) . Moreover , in industry , optimized network structures are often considered confidential intellectual property . It is therefore important to understand the extent to which this valuable , privileged information can be compromised . Worse yet , a reverse engineered “ surrogate ” model also makes the black-box “ victim ” model more susceptible to adversarial transfer attacks ( Papernot et al. , 2017 ; Liu et al. , 2016 ) , in which a vulnerability identified in the surrogate is exploited on the victim . Success in the exploit is contingent on the ability of the surrogate to successfully model the vulnerabilities of the victim . Recovering accurate , detailed network topology and hyperparameters informs the modeling of a good surrogate . We examine the fluctuation of magnetic flux from the GPU ’ s power cable , and ask whether a passive observer can glean the information needed to reconstruct neural network structure . Remarkably , we show that , through magnetic induction sensing , a passive observer can reconstruct the complete network structure even for large and deep networks . Threat model . We consider an adversary that ( i ) is able to place a magnetic induction sensor in close proximity to the GPU ’ s power cable , ( ii ) knows the dimension of the input feature vector , and ( iii ) is able to launch a query of known batch size . We also consider that our attacker uses the same deep learning framework ( e.g. , PyTorch , TensorFlow ) as the black-box model . The adversary is otherwise weak , lacking access to the model source , binaries , training data , and underlying training data distribution ; without ability to execute code on the host CPU and GPU ; and without knowledge of the input values and output results of the launched queries . Not only that—it also lacks direct access to the GPU hardware , beyond the proximity to the power cable . The adversary only requires access to their own GPU hardware , matching the brand/version of the victim , e.g. , as purchased on the open market . Physical principle . The GPU consumes energy at a variable rate that depends on operations performed . Every microprocessor instruction is driven by transistor electron flows , and different instructions require different power levels ( Grochowski & Annavaram , 2006 ) . The many compute cores of a GPU amplify the fluctuation in energy consumption , and so too the current drawn from the power cable . Current induces magnetic flux governed by the Biot-Savart law ( Griffiths , 2005 ) , and current fluctuations induce EM ripples whose propagation through the environment is governed by the Ampère-Maxwell law . Even a cheap , $ 3 magnetic induction sensor ( see Fig . 2 ) placed within a few millimeters of the power cable suffices to record these EM ripples . Technique and results . To reconstruct the black-box network ’ s structure , we propose a two-step approach . First , we estimate the network topology , such as the number and types of layers , and types of activation functions , using a suitably trained neural network classifier . Then , for each layer , we estimate its hyperparameters using another set of deep neural network ( DNN ) models . The individually estimated hyperparameters are then jointly optimized by solving an integer programming problem to enforce consistency between the layers . We demonstrate the potential accuracy of this side-channel attack in recovering the details for a wide range of networks , including large , deep networks such as ResNet101 . We further apply this recovery approach to demonstrate black-box adversarial transfer attacks . 1.1 RELATED WORK : MODEL EXTRACTION BY QUERIES AND SIDE-CHANNEL ANALYSIS . Our work falls under the umbrella of black-box model extraction . Absent access to the model ’ s internals , one might infer structure from observed input-output pairs . For instance , Tramèr et al . ( 2016 ) demonstrated that , for simple models such as decision trees and support vector machines hosted on a cloud , certain internal information can be extracted via a multitude of queries . This approach , which was extended to infer details of deep neural networks ( Oh et al. , 2019 ; Liu et al. , 2016 ; Duddu & Rao , 2019 ) , is typically able to recover certain information , such as optimization learning rate and network structure type , but has not demonstrated recovery of full structural details . A contrasting approach , side-channel analysis ( SCA ) , extracts information gained from the physical implementation of a model , rather than in the mathematical model itself . Analysis of timing ( Kocher , 1996 ) , power ( Kocher et al. , 1999 ; Luo et al. , 2015 ) , cache flushes ( Yarom & Falkner , 2014 ) , and audio ( Genkin et al. , 2014 ) have been prominently demonstrated to extract secret keys from cryptographic procedures such as the Digital Signature and Advanced Encryption Standards . SCA was recently used to infer machine learning models by observing power consumption profiles ( Xiang et al. , 2020 ; Wei et al. , 2018 ; Dubey et al. , 2019 ) , timing information ( Duddu et al. , 2018 ) and memory/cache access ( Hu et al. , 2020 ; Hong et al. , 2019 ; Hua et al. , 2018 ; Yan et al. , 2020 ) . These methods placed a malware process on the machine hosting the black-box model . Our threat model does not involve introducing processes on the host . Recently , Batina et al . ( 2019 ) exploited EM radiation for network model extraction . They focused on EM radiation from embedded processors . In contrast to GPUs , embedded processors emit a relatively weak EM signal , necessitating delicate measurement devices and even mechanical opening of the chip package . Our advance . All these previous works are demonstrated on shallow networks ( e.g. , fewer than 20 layers ) . It remains unclear whether these methods can also extract deep network models , ones that are structurally more complex and more prevalent in practice . We demonstrate successful recovery of the full structure of deep networks , such as RetNet101 ( He et al. , 2016 ) . With that , we hope to raise awareness of the GPU ’ s EM radiation as an information-rich , easily-probed side channel . 2 MAGNETIC SIGNALS FROM GPUS . Before getting into the weeds , let us provide our intuition : we think of the magnetic signal as the GPU ’ s “ speech. ” The GPU speaks a series of “ words , ” demarcated by silence . Each word names the computational step that was executed . Let us now refine this explanation further , and ground it in physical principles . We use step to refer to performing a specific kind of network operation , such as a linear operation , batch normalization , pooling , activation function , etc . A layer is a sequences of steps , e.g. , a ( i ) linear operation , then ( ii ) pooling , then ( iii ) activation . While there may be data dependencies between steps , there are no such dependencies within a step . The parallel nature of GPU computation lends itself to a natural implementation of networks , wherein each step is executed in parallel , i.e. , single instruction multiple data ( SIMD ) parallelism . Transitions between steps , however , are synchronized ( Buck , 2007 ) : in our example above , activation begins only after pooling completes . This cross-step synchronization allows for implementations structured into modules , or GPU kernels . This modular approach is employed in widely-used deep learning frameworks such as PyTorch and TensorFlow ( Paszke et al. , 2019 ; Abadi et al. , 2016 ) . Signal . Kernel execution demands transistor flips , which place electric load on the GPU processor , in turn emitting magnetic flux from its power cable . An induction sensor measures this flux and produces proportional voltage . The time-varying voltage is our acquired signal ( see Fig . 1 ) . Different steps correspond to different GPU kernels , transistor flips , electric loads , and signal characteristics , which are distinguished even by the naked eye ( see Fig . 1 ) . Cross-step synchronization involves idling , dramatically reducing electric load and signal level ( see Fig . 1 ) . These rapid sharp drops demarcate steps . We observe that signal strongly correlates to the kind of GPU operations , rather than the specific values of computed floating point numbers . We verify this by examining signals using both PyTorch and TensorFlow and on multiple kinds of GPUs ( see Sec . 5 ) . The signal is also affected by the input to the network . Although the specific input data values do not influence the signal , the input data size does . When the GPU launches a network , the size of its single input ( e.g. , image resolution ) is fixed . But the network may be provided with a batch of input data ( e.g. , multiple images ) . As the batch size increases , more GPU cores will be utilized in each step . The GPU consequently draws more power , which in turn strengthens the signal . Once all GPU cores are involved , further increase of input batch size will not increase the signal strength , but elongate the execution time until the GPU runs out of memory . Therefore , in launching a query to the black-box network model , the adversary should choose a batch size sufficiently large to activate a sufficient number of GPU cores to produce a sufficient signal-to-noise ratio . We find that the range of the proper batch sizes is often relatively large ( e.g. , 64 ∼ 96 for ImageNet networks ) , loosely depending on the size of the single input ’ s features and the parallel computing ability of the GPU . In practice , the adversary can choose the batch size by experimenting with their own GPUs under various image resolutions . Notably however , we do not require knowledge of batch size to robustly recover network topology ( as opposed to hyperparameters ) , only that the batch size is sufficiently large enough to provide a clear signal . While we used a consumer friendly sensor with limited sampling rate ( see 4.1 ) and corresponding signal-to-noise ratio ( SNR ) , a sensor with high sampling rate and SNR would correspondingly require a smaller minimum batch size . 3 SIGNAL ANALYSIS AND NETWORK RECONSTRUCTION . We prepare for the attack by training several recovery DNN models ; we refer to training before the attack as pretraining . After the attacker launches a batch query ( whose input and output values are irrelevant ) we recover structure from the acquired signal in two stages : ( i ) topology and ( ii ) hyperparameters . To recover topology , a pretrained DNN model associates a step to every signal sample . This per-sample classification partitions the signal into segments corresponding to steps . We estimate hyperparameters for each individual segment in isolation , using a step-specific pretrained DNN model , and resolve inconsistencies between consecutive segments using an integer program . The pretraining of our recovery DNN models is hardware-specific , and good recovery requires pretraining on like hardware .
The paper presents a method for capturing the shape (type of layers) and their respective parameters of a neural network through the magnetic field induced as the GPU drains power. In particular, the GPU is snooped using an off-the-shelf magnetic induction sensor which is placed along the power cable of the GPU. It turns out that under some assumptions (knowledge of GPU model and deep learning framework, knowledge of input size and ability to launch query of specific batch size), based on the correlation of the power consumption pattern of the GPU with the operations being performed it is possible to recognize the type of operation being performed as well as the respective hyper-parameters with very few errors.
SP:f71ceed51963fee2042d66da98c14aeb91b93f74
Can one hear the shape of a neural network?: Snooping the GPU via Magnetic Side Channel
1 INTRODUCTION . The Graphics Processing Unit ( GPU ) is a favored vehicle for executing a neural network . As it computes , it also hums—electromagnetically . What can this hum tell us ? Could listening to the GPU ’ s electromagnetic ( EM ) radiation reveal details about the neural network ? We study this question and find that magnetic induction sensing reveals a detailed network structure , including both topology and hyperparameter values , from inferences of otherwise unknown networks running on GPUs . Reverse engineering a network structure has attracted increasing research effort , motivated by several concerns . First , it has been well known that the performance of a network model hinges on its judiciously designed structure—but finding an effective design is no easy task . Significant time and energy is expended in searching and fine-tuning network structures ( Zoph et al. , 2018 ) . Moreover , in industry , optimized network structures are often considered confidential intellectual property . It is therefore important to understand the extent to which this valuable , privileged information can be compromised . Worse yet , a reverse engineered “ surrogate ” model also makes the black-box “ victim ” model more susceptible to adversarial transfer attacks ( Papernot et al. , 2017 ; Liu et al. , 2016 ) , in which a vulnerability identified in the surrogate is exploited on the victim . Success in the exploit is contingent on the ability of the surrogate to successfully model the vulnerabilities of the victim . Recovering accurate , detailed network topology and hyperparameters informs the modeling of a good surrogate . We examine the fluctuation of magnetic flux from the GPU ’ s power cable , and ask whether a passive observer can glean the information needed to reconstruct neural network structure . Remarkably , we show that , through magnetic induction sensing , a passive observer can reconstruct the complete network structure even for large and deep networks . Threat model . We consider an adversary that ( i ) is able to place a magnetic induction sensor in close proximity to the GPU ’ s power cable , ( ii ) knows the dimension of the input feature vector , and ( iii ) is able to launch a query of known batch size . We also consider that our attacker uses the same deep learning framework ( e.g. , PyTorch , TensorFlow ) as the black-box model . The adversary is otherwise weak , lacking access to the model source , binaries , training data , and underlying training data distribution ; without ability to execute code on the host CPU and GPU ; and without knowledge of the input values and output results of the launched queries . Not only that—it also lacks direct access to the GPU hardware , beyond the proximity to the power cable . The adversary only requires access to their own GPU hardware , matching the brand/version of the victim , e.g. , as purchased on the open market . Physical principle . The GPU consumes energy at a variable rate that depends on operations performed . Every microprocessor instruction is driven by transistor electron flows , and different instructions require different power levels ( Grochowski & Annavaram , 2006 ) . The many compute cores of a GPU amplify the fluctuation in energy consumption , and so too the current drawn from the power cable . Current induces magnetic flux governed by the Biot-Savart law ( Griffiths , 2005 ) , and current fluctuations induce EM ripples whose propagation through the environment is governed by the Ampère-Maxwell law . Even a cheap , $ 3 magnetic induction sensor ( see Fig . 2 ) placed within a few millimeters of the power cable suffices to record these EM ripples . Technique and results . To reconstruct the black-box network ’ s structure , we propose a two-step approach . First , we estimate the network topology , such as the number and types of layers , and types of activation functions , using a suitably trained neural network classifier . Then , for each layer , we estimate its hyperparameters using another set of deep neural network ( DNN ) models . The individually estimated hyperparameters are then jointly optimized by solving an integer programming problem to enforce consistency between the layers . We demonstrate the potential accuracy of this side-channel attack in recovering the details for a wide range of networks , including large , deep networks such as ResNet101 . We further apply this recovery approach to demonstrate black-box adversarial transfer attacks . 1.1 RELATED WORK : MODEL EXTRACTION BY QUERIES AND SIDE-CHANNEL ANALYSIS . Our work falls under the umbrella of black-box model extraction . Absent access to the model ’ s internals , one might infer structure from observed input-output pairs . For instance , Tramèr et al . ( 2016 ) demonstrated that , for simple models such as decision trees and support vector machines hosted on a cloud , certain internal information can be extracted via a multitude of queries . This approach , which was extended to infer details of deep neural networks ( Oh et al. , 2019 ; Liu et al. , 2016 ; Duddu & Rao , 2019 ) , is typically able to recover certain information , such as optimization learning rate and network structure type , but has not demonstrated recovery of full structural details . A contrasting approach , side-channel analysis ( SCA ) , extracts information gained from the physical implementation of a model , rather than in the mathematical model itself . Analysis of timing ( Kocher , 1996 ) , power ( Kocher et al. , 1999 ; Luo et al. , 2015 ) , cache flushes ( Yarom & Falkner , 2014 ) , and audio ( Genkin et al. , 2014 ) have been prominently demonstrated to extract secret keys from cryptographic procedures such as the Digital Signature and Advanced Encryption Standards . SCA was recently used to infer machine learning models by observing power consumption profiles ( Xiang et al. , 2020 ; Wei et al. , 2018 ; Dubey et al. , 2019 ) , timing information ( Duddu et al. , 2018 ) and memory/cache access ( Hu et al. , 2020 ; Hong et al. , 2019 ; Hua et al. , 2018 ; Yan et al. , 2020 ) . These methods placed a malware process on the machine hosting the black-box model . Our threat model does not involve introducing processes on the host . Recently , Batina et al . ( 2019 ) exploited EM radiation for network model extraction . They focused on EM radiation from embedded processors . In contrast to GPUs , embedded processors emit a relatively weak EM signal , necessitating delicate measurement devices and even mechanical opening of the chip package . Our advance . All these previous works are demonstrated on shallow networks ( e.g. , fewer than 20 layers ) . It remains unclear whether these methods can also extract deep network models , ones that are structurally more complex and more prevalent in practice . We demonstrate successful recovery of the full structure of deep networks , such as RetNet101 ( He et al. , 2016 ) . With that , we hope to raise awareness of the GPU ’ s EM radiation as an information-rich , easily-probed side channel . 2 MAGNETIC SIGNALS FROM GPUS . Before getting into the weeds , let us provide our intuition : we think of the magnetic signal as the GPU ’ s “ speech. ” The GPU speaks a series of “ words , ” demarcated by silence . Each word names the computational step that was executed . Let us now refine this explanation further , and ground it in physical principles . We use step to refer to performing a specific kind of network operation , such as a linear operation , batch normalization , pooling , activation function , etc . A layer is a sequences of steps , e.g. , a ( i ) linear operation , then ( ii ) pooling , then ( iii ) activation . While there may be data dependencies between steps , there are no such dependencies within a step . The parallel nature of GPU computation lends itself to a natural implementation of networks , wherein each step is executed in parallel , i.e. , single instruction multiple data ( SIMD ) parallelism . Transitions between steps , however , are synchronized ( Buck , 2007 ) : in our example above , activation begins only after pooling completes . This cross-step synchronization allows for implementations structured into modules , or GPU kernels . This modular approach is employed in widely-used deep learning frameworks such as PyTorch and TensorFlow ( Paszke et al. , 2019 ; Abadi et al. , 2016 ) . Signal . Kernel execution demands transistor flips , which place electric load on the GPU processor , in turn emitting magnetic flux from its power cable . An induction sensor measures this flux and produces proportional voltage . The time-varying voltage is our acquired signal ( see Fig . 1 ) . Different steps correspond to different GPU kernels , transistor flips , electric loads , and signal characteristics , which are distinguished even by the naked eye ( see Fig . 1 ) . Cross-step synchronization involves idling , dramatically reducing electric load and signal level ( see Fig . 1 ) . These rapid sharp drops demarcate steps . We observe that signal strongly correlates to the kind of GPU operations , rather than the specific values of computed floating point numbers . We verify this by examining signals using both PyTorch and TensorFlow and on multiple kinds of GPUs ( see Sec . 5 ) . The signal is also affected by the input to the network . Although the specific input data values do not influence the signal , the input data size does . When the GPU launches a network , the size of its single input ( e.g. , image resolution ) is fixed . But the network may be provided with a batch of input data ( e.g. , multiple images ) . As the batch size increases , more GPU cores will be utilized in each step . The GPU consequently draws more power , which in turn strengthens the signal . Once all GPU cores are involved , further increase of input batch size will not increase the signal strength , but elongate the execution time until the GPU runs out of memory . Therefore , in launching a query to the black-box network model , the adversary should choose a batch size sufficiently large to activate a sufficient number of GPU cores to produce a sufficient signal-to-noise ratio . We find that the range of the proper batch sizes is often relatively large ( e.g. , 64 ∼ 96 for ImageNet networks ) , loosely depending on the size of the single input ’ s features and the parallel computing ability of the GPU . In practice , the adversary can choose the batch size by experimenting with their own GPUs under various image resolutions . Notably however , we do not require knowledge of batch size to robustly recover network topology ( as opposed to hyperparameters ) , only that the batch size is sufficiently large enough to provide a clear signal . While we used a consumer friendly sensor with limited sampling rate ( see 4.1 ) and corresponding signal-to-noise ratio ( SNR ) , a sensor with high sampling rate and SNR would correspondingly require a smaller minimum batch size . 3 SIGNAL ANALYSIS AND NETWORK RECONSTRUCTION . We prepare for the attack by training several recovery DNN models ; we refer to training before the attack as pretraining . After the attacker launches a batch query ( whose input and output values are irrelevant ) we recover structure from the acquired signal in two stages : ( i ) topology and ( ii ) hyperparameters . To recover topology , a pretrained DNN model associates a step to every signal sample . This per-sample classification partitions the signal into segments corresponding to steps . We estimate hyperparameters for each individual segment in isolation , using a step-specific pretrained DNN model , and resolve inconsistencies between consecutive segments using an integer program . The pretraining of our recovery DNN models is hardware-specific , and good recovery requires pretraining on like hardware .
This paper demonstrates that magnetic side channel information from a GPU (that is processing a deep neural net) can be snooped to recover the architecture and hyperparameters of the neural network. While the concept of side channel information snooping to recover codes/software (including ML models) is widely studied, the novelty claim is that recovering detailed structures of deep models is new. The paper also demonstrates that black-box attacks mounted using a recovered model is quite powerful compared to traditional black-box attacks.
SP:f71ceed51963fee2042d66da98c14aeb91b93f74
Efficient Sampling for Generative Adversarial Networks with Reparameterized Markov Chains
1 INTRODUCTION . Generative Adversarial Networks ( GANs ) ( Goodfellow et al. , 2014 ) have achieved a great success on generating realistic images in recent years ( Karras et al. , 2019 ; Brock et al. , 2019 ) . Unlike previous models that explicitly parameterize the data distribution , GANs rely on an alternative optimization between a generator and a discriminator to learn the data distribution implicitly . However , in practice , samples generated by GANs still suffer from problems such as mode collapse and bad artifacts . Recently , sampling methods have shown promising results on enhancing the sample quality of GANs by making use of the information in the discriminator . In the alternative training scheme of GANs , the generator only performs a few updates for the inner loop and has not fully utilized the density ratio information estimated by the discriminator . Thus , after GAN training , the sampling methods propose to further utilize this information to bridge the gap between the generative distribution and the data distribution in a fine-grained manner . For example , DRS ( Azadi et al. , 2019 ) applies rejection sampling , and MH-GAN ( Turner et al. , 2019 ) adopts Markov chain Monte Carlo ( MCMC ) sampling for the improved sample quality of GANs . Nevertheless , these methods still suffer a lot from the sample efficiency problem . For example , as will be shown in Section 5 , MH-GAN ’ s average acceptance ratio on CIFAR10 can be lower than 5 % , which makes the Markov chains slow to mix . As MH-GAN adopts an independent proposal q , i.e. , q ( x′|x ) = q ( x′ ) , the difference between samples can be so large that the proposal gets rejected easily . To address this limitation , we propose to generalize the independent proposal to a general dependent proposal q ( x′|x ) . To the end , the proposed sample can be a refinement of the previous one , which leads to a higher acceptance ratio and better sample quality . We can also balance between the exploration and exploitation of the Markov chains by tuning the step size . However , it is hard to design a proper dependent proposal in the high dimensional sample space X because the energy landscape could be very complex ( Neal et al. , 2010 ) . Nevertheless , we notice that the generative distribution pg ( x ) of GANs is implicitly defined as the push-forward of the latent prior distribution p0 ( z ) , and designing proposals in the low dimensional latent space is generally much easier . Hence , GAN ’ s latent variable structure motivates us to design a structured dependent proposal with two pairing Markov chains , one in the sample space X and the other in the latent space Z . As shown in Figure 1 , given the current pairing samples ( zk , xk ) , we draw the next proposal x′ in a bottom-to-up way : 1 ) drawing a latent proposal z′ following q ( z′|zk ) ; 2 ) pushing it forward through the generator and getting the sample proposal x′ = G ( z′ ) ; 3 ) assigning xk+1 = x′ if the proposal x′ is accepted , otherwise rejected xk+1 = xk . By utilizing the underlying structure of GANs , the proposed reparameterized sampler becomes more efficient in the low-dimensional latent space . We summarize our main contributions as follows : • We propose a structured dependent proposal of GANs , which reparameterizes the samplelevel transition x → x′ into the latent-level z → z′ with two pairing Markov chains . We prove that our reparameterized proposal admits a tractable acceptance criterion . • Our proposed method , called REP-GAN , serves as a unified framework for the existing sampling methods of GANs . It provides a better balance between exploration and exploitation by the structured dependent proposal , and also corrects the bias of Markov chains by the acceptance-rejection step . • Empirical results demonstrate that REP-GAN achieves better image quality and much higher sample efficiency than the state-of-the-art methods on both synthetic and real datasets . 2 RELATED WORK . Although GANs are able to synthesize high-quality images , the minimax nature of GANs makes it quite unstable , which usually results in degraded sample quality . A vast literature has been developed to fix the problems of GANs ever since , including novel network modules ( Miyato et al. , 2018 ) , training mechanism ( Metz et al. , 2017 ) , and alternative objectives ( Arjovsky et al. , 2017 ) . Moreover , there is another line of work using sampling methods to improve the sample quality of GANs . DRS ( Azadi et al. , 2019 ) firstly proposes to use rejection sampling . MH-GAN ( Turner et al. , 2019 ) instead uses the Metropolis-Hasting ( MH ) algorithm with an independent proposal . DDLS ( Che et al. , 2020 ) and DCD ( Song et al. , 2020 ) apply gradient-based proposals by viewing GAN as an energy-based model . Tanaka ( 2019 ) proposes a similar gradient-based method named DOT from the perspective of optimal transport . Different from them , our REP-GAN introduces a structured dependent proposal through latent reparameterization , and includes all three effective sampling mechanisms , the Markov Chain Monte Carlo method , the acceptance-rejection step , and the latent gradient-based proposal , to further improve the sample efficiency . As shown in Table 1 , many existing works are special cases of our REP-GAN . Our method also belongs to the thread of works that combine MCMC and neural networks for better sample quality . Previously , some works combine variational autoencoders ( Kingma & Welling , 2014 ) and MCMC to bridge the amorization gap ( Salimans et al. , 2015 ; Hoffman , 2017 ; Li et al. , 2017 ) , while others directly learn a neural proposal function for MCMC ( Song et al. , 2017 ; Levy et al. , 2018 ; Wang et al. , 2018 ) . Our work instead reparameterizes the high-dimensional sample-level transition into a simpler low-dimensional latent space via the learned generator network . 3 BACKGROUND . 3.1 GAN . GAN models the data distribution pd ( x ) implicitly with a generator G : Z → X mapping from a low-dimensional latent space Z to a high-dimensional sample space X , x = G ( z ) , z ∼ p0 ( z ) , ( 1 ) where the sample x follows the generative distribution pg ( x ) and the latent variable z follows the prior distribution p0 ( z ) , e.g. , a standard normal distribution N ( 0 , I ) . In GAN , a discriminator D : X → [ 0 , 1 ] is learned to distinguish samples from pd ( x ) and pg ( x ) in an adversarial way min G max D Ex∼pd ( x ) log ( D ( x ) ) + Ez∼p0 ( z ) log ( 1−D ( G ( z ) ) ) . ( 2 ) Goodfellow et al . ( 2014 ) point out that an optimal discriminator D implies the density ratio between the data and generative distributions D ( x ) = pd ( x ) pd ( x ) + pg ( x ) ⇒ pd ( x ) pg ( x ) = 1 D ( x ) −1 − 1 . ( 3 ) 3.2 MCMC . Markov Chain Monte Carlo ( MCMC ) refers to a kind of sampling methods that draw a chain of samples x1 : K ∈ XK from a target distribution pt ( x ) . We denote the initial distribution as p0 ( x ) and the proposal distribution as q ( x′|xk ) . With the Metropolis-Hastings ( MH ) algorithm , we accept the proposal x′ ∼ q ( x′|xk ) with probability α ( x′ , xk ) = min ( 1 , pt ( x ′ ) q ( xk|x′ ) pt ( xk ) q ( x′|xk ) ) ∈ [ 0 , 1 ] . ( 4 ) If x′ is accepted , xk+1 = x′ , otherwise xk+1 = xk . Under mild assumptions , the Markov chain is guaranteed to converge to pt ( x ) as K →∞ . In practice , the sample efficiency of MCMC crucially depends on the proposal distribution to trade off between exploration and exploitation . 4 THE PROPOSED REP-GAN . In this section , we first review MH-GAN and point out the limitations . We then propose our structured dependent proposal to overcome these obstacles , and finally discuss its theoretical properties as well as practical implementations . 4.1 FROM INDEPENDENT PROPOSAL TO DEPENDENT PROPOSAL . MH-GAN ( Turner et al. , 2019 ) first proposes to improve GAN sampling with MCMC . Specifically , given a perfect discriminator D and a descent ( but imperfect ) generator G after training , they take the data distribution pd ( x ) as the target distribution and use the generator distribution pg ( x ) as an independent proposal x′ ∼ q ( x′|xk ) = q ( x′ ) = pg ( x′ ) . ( 5 ) With the MH criterion ( Eqn . ( 4 ) ) and the density ratio ( Eqn . ( 3 ) ) , we should accept x′ with probability αMH ( x ′ , xk ) = min ( 1 , pd ( x ′ ) q ( xk ) pd ( xk ) q ( x′ ) ) = min ( 1 , D ( xk ) −1 − 1 D ( x′ ) −1 − 1 ) . ( 6 ) However , to achieve tractability , MH-GAN adopts an independent proposal q ( x′ ) with poor sample efficiency . As the proposed sample x′ is independent of the current sample xk , the difference between the two samples can be so large that it results in a very low acceptance probability . Consequently , samples can be trapped in the same place for a long time , leading to a very slow mixing of the chain . A natural solution is to take a dependent proposal q ( x′|xk ) that will propose a sample x′ close to the current one xk , which is more likely to be accepted . Nevertheless , the problem of such a dependent proposal is that its MH acceptance criterion αDEP ( x ′ , xk ) = min ( 1 , pd ( x ′ ) q ( xk|x′ ) pd ( xk ) q ( x′|xk ) ) , ( 7 ) is generally intractable because the data density pd ( x ) is unknown . Besides , it is hard to design a proper dependent proposal q ( x′|xk ) in the high dimensional sample space X with complex landscape . These obstacles prevent us from adopting a dependent proposal that is more suitable for MCMC . 4.2 A TRACTABLE STRUCTURED DEPENDENT PROPOSAL WITH REPARAMETERIZED MARKOV CHAINS . As discussed above , the major difficulty of a general dependent proposal q ( x′|xk ) is to compute the MH criterion . We show that it can be made tractable by considering an additional pairing Markov chain in the latent space . As we know , samples of GANs lie in a low-dimensional manifold induced by the push-forward of the latent variable . Suppose that at the k-th step of the Markov chain , we have a GAN sample xk with latent zk . Instead of drawing a sample x′ directly from a sample-level proposal distribution q ( x′|xk ) , we first draw a latent proposal z′ from a dependent latent proposal distribution q ( z′|zk ) . Afterward , we push the latent z′ forward through the generator and get the output x′ as our sample proposal . As illustrated in Figure 1 , our bottom-to-up proposal relies on the transition reparameterization with two pairing Markov chains in the sample space X and the latent space Z . Hence we call it a REP ( reparameterized ) proposal . Through a learned generator , we transport the transition xk → x′ in the high dimensional space X into the low dimensional space Z , zk → z′ , which enjoys a much better landscape and makes it easier to design proposals in MCMC algorithms . For example , the latent target distribution is nearly standard normal when the generator is nearly perfect . In fact , under mild conditions , the REP proposal distribution qREP ( x′|xk ) and the latent proposal distribution q ( z′|zk ) are tied with the following change of variables ( Gemici et al. , 2016 ; Ben-Israel , 1999 ) log qREP ( x ′|xk ) = log q ( x′|zk ) = log q ( z′|zk ) − 1 2 log detJ > z′Jz′ , ( 8 ) where Jz denotes the Jacobian matrix of the push-forward G at z , i.e. , [ Jz ] ij = ∂ xi/∂ zj , x = G ( z ) . Nevertheless , it remains unclear whether we can perform the MH test to decide the acceptance of the proposal x′ . Note that a general dependent proposal distribution does not meet a tractable MH acceptance criterion ( Eqn . ( 7 ) ) . Perhaps surprisingly , it can be shown that with our structured REP proposal , the MH acceptance criterion is tractable for general latent proposals q ( z′|zk ) . Theorem 1 . Consider a Markov chain of GAN samples x1 : K with initial distribution pg ( x ) . For step k + 1 , we accept our REP proposal x′ ∼ qREP ( x′|xk ) with probability αREP ( x ′ , xk ) = min ( 1 , p0 ( z ′ ) q ( zk|z′ ) p0 ( zk ) q ( z′|zk ) · D ( xk ) −1 − 1 D ( x′ ) −1 − 1 ) , ( 9 ) i.e . let xk+1 = x′ if x′ is accepted and xk+1 = xk otherwise . Further assume the chain is irreducible , aperiodic and not transient . Then , according to the Metropolis-Hastings algorithm , the stationary distribution of this Markov chain is the data distribution pd ( x ) ( Gelman et al. , 2013 ) . Proof . Note that similar to Eqn ( 8 ) , we also have the change of variables between pg ( x ) and p0 ( z ) , log pg ( x ) |x=G ( z ) = log p0 ( z ) − 1 2 log detJ > z Jz . ( 10 ) According to Gelman et al . ( 2013 ) , the assumptions that the chain is irreducible , aperiodic , and not transient make sure that the chain has a unique stationary distribution , and the MH algorithm ensures that this stationary distribution equals to the target distribution pd ( x ) . Thus we only need to show that the MH criterion in Eqn . ( 9 ) holds . Together with Eqn . ( 3 ) , ( 7 ) and ( 8 ) , we have αREP ( x ′ , xk ) = pd ( x ′ ) q ( xk|x′ ) pd ( xk ) q ( x′|xk ) = pd ( x ′ ) q ( zk|z′ ) ( det J > zkJzk ) − 12 pg ( xk ) pg ( x′ ) pd ( xk ) q ( z′|zk ) ( det J > z′Jz′ ) − 12 pg ( x′ ) pg ( xk ) = q ( zk|z′ ) ( det J > zkJzk ) − 12 p0 ( z′ ) ( det J > z′Jz′ ) − 12 ( D ( xk ) −1 − 1 ) q ( z′|zk ) ( det J > z′Jz′ ) − 12 p0 ( zk ) ( det J > zkJzk ) − 12 ( D ( x′ ) −1 − 1 ) = p0 ( z ′ ) q ( zk|z′ ) ( D ( xk ) −1 − 1 ) p0 ( zk ) q ( z′|zk ) ( D ( x′ ) −1 − 1 ) . ( 11 ) Hence the proof is completed . The theorem above demonstrates the following favorable properties of our method : • The discriminator score ratio is the same as αMH ( x′ , xk ) , but MH-GAN is restricted to a specific independent proposal . Our method instead works for any latent proposal q ( z′|zk ) . When we take q ( z′|zk ) = p0 ( z′ ) , our method reduces to MH-GAN . • Compared to αDEP ( x′ , xk ) of a general dependent proposal ( Eqn . ( 7 ) ) , the unknown data distributions terms are successfully cancelled in the reparameterized acceptance criterion . • The reparameterized MH acceptance criterion becomes tractable as it only involves the latent priors , the latent proposal distributions , and the discriminator scores . Combining the REP proposal qREP ( x′|xk ) and its tractable MH criterion αREP ( x′ , xk ) , we have developed a novel sampling method for GANs , coined as REP-GAN . See Appendix 1 for a detailed description . Moreover , our method can serve as a general approximate inference technique for Bayesian models by bridging MCMC and GANs . Previous works ( Marzouk et al. , 2016 ; Titsias , 2017 ; Hoffman et al. , 2019 ) also propose to avoid the bad geometry of a complex probability measure by reparameterizing the Markov transitions into a simpler measure . However , these methods are limited to explicit invertible mappings without dimensionality reduction . In our work , we first show that it is also tractable to conduct such model-based reparameterization with implicit models like GANs .
The paper proposes an MCMC based sampling mechanism for GANs. In contrast to earlier work, the proposal distribution is conditioning conditioned on the previous state (here in latent space), which is supposed to help sampling efficiency. This is achieved by a clever re-parametrization of intermediate steps of the MCMC chain. As an example, the authors provide a Langevin version (which uses gradient information) of their method.
SP:93f8114b248a8fbae75eadc40d70c6d38f3faff4
Efficient Sampling for Generative Adversarial Networks with Reparameterized Markov Chains
1 INTRODUCTION . Generative Adversarial Networks ( GANs ) ( Goodfellow et al. , 2014 ) have achieved a great success on generating realistic images in recent years ( Karras et al. , 2019 ; Brock et al. , 2019 ) . Unlike previous models that explicitly parameterize the data distribution , GANs rely on an alternative optimization between a generator and a discriminator to learn the data distribution implicitly . However , in practice , samples generated by GANs still suffer from problems such as mode collapse and bad artifacts . Recently , sampling methods have shown promising results on enhancing the sample quality of GANs by making use of the information in the discriminator . In the alternative training scheme of GANs , the generator only performs a few updates for the inner loop and has not fully utilized the density ratio information estimated by the discriminator . Thus , after GAN training , the sampling methods propose to further utilize this information to bridge the gap between the generative distribution and the data distribution in a fine-grained manner . For example , DRS ( Azadi et al. , 2019 ) applies rejection sampling , and MH-GAN ( Turner et al. , 2019 ) adopts Markov chain Monte Carlo ( MCMC ) sampling for the improved sample quality of GANs . Nevertheless , these methods still suffer a lot from the sample efficiency problem . For example , as will be shown in Section 5 , MH-GAN ’ s average acceptance ratio on CIFAR10 can be lower than 5 % , which makes the Markov chains slow to mix . As MH-GAN adopts an independent proposal q , i.e. , q ( x′|x ) = q ( x′ ) , the difference between samples can be so large that the proposal gets rejected easily . To address this limitation , we propose to generalize the independent proposal to a general dependent proposal q ( x′|x ) . To the end , the proposed sample can be a refinement of the previous one , which leads to a higher acceptance ratio and better sample quality . We can also balance between the exploration and exploitation of the Markov chains by tuning the step size . However , it is hard to design a proper dependent proposal in the high dimensional sample space X because the energy landscape could be very complex ( Neal et al. , 2010 ) . Nevertheless , we notice that the generative distribution pg ( x ) of GANs is implicitly defined as the push-forward of the latent prior distribution p0 ( z ) , and designing proposals in the low dimensional latent space is generally much easier . Hence , GAN ’ s latent variable structure motivates us to design a structured dependent proposal with two pairing Markov chains , one in the sample space X and the other in the latent space Z . As shown in Figure 1 , given the current pairing samples ( zk , xk ) , we draw the next proposal x′ in a bottom-to-up way : 1 ) drawing a latent proposal z′ following q ( z′|zk ) ; 2 ) pushing it forward through the generator and getting the sample proposal x′ = G ( z′ ) ; 3 ) assigning xk+1 = x′ if the proposal x′ is accepted , otherwise rejected xk+1 = xk . By utilizing the underlying structure of GANs , the proposed reparameterized sampler becomes more efficient in the low-dimensional latent space . We summarize our main contributions as follows : • We propose a structured dependent proposal of GANs , which reparameterizes the samplelevel transition x → x′ into the latent-level z → z′ with two pairing Markov chains . We prove that our reparameterized proposal admits a tractable acceptance criterion . • Our proposed method , called REP-GAN , serves as a unified framework for the existing sampling methods of GANs . It provides a better balance between exploration and exploitation by the structured dependent proposal , and also corrects the bias of Markov chains by the acceptance-rejection step . • Empirical results demonstrate that REP-GAN achieves better image quality and much higher sample efficiency than the state-of-the-art methods on both synthetic and real datasets . 2 RELATED WORK . Although GANs are able to synthesize high-quality images , the minimax nature of GANs makes it quite unstable , which usually results in degraded sample quality . A vast literature has been developed to fix the problems of GANs ever since , including novel network modules ( Miyato et al. , 2018 ) , training mechanism ( Metz et al. , 2017 ) , and alternative objectives ( Arjovsky et al. , 2017 ) . Moreover , there is another line of work using sampling methods to improve the sample quality of GANs . DRS ( Azadi et al. , 2019 ) firstly proposes to use rejection sampling . MH-GAN ( Turner et al. , 2019 ) instead uses the Metropolis-Hasting ( MH ) algorithm with an independent proposal . DDLS ( Che et al. , 2020 ) and DCD ( Song et al. , 2020 ) apply gradient-based proposals by viewing GAN as an energy-based model . Tanaka ( 2019 ) proposes a similar gradient-based method named DOT from the perspective of optimal transport . Different from them , our REP-GAN introduces a structured dependent proposal through latent reparameterization , and includes all three effective sampling mechanisms , the Markov Chain Monte Carlo method , the acceptance-rejection step , and the latent gradient-based proposal , to further improve the sample efficiency . As shown in Table 1 , many existing works are special cases of our REP-GAN . Our method also belongs to the thread of works that combine MCMC and neural networks for better sample quality . Previously , some works combine variational autoencoders ( Kingma & Welling , 2014 ) and MCMC to bridge the amorization gap ( Salimans et al. , 2015 ; Hoffman , 2017 ; Li et al. , 2017 ) , while others directly learn a neural proposal function for MCMC ( Song et al. , 2017 ; Levy et al. , 2018 ; Wang et al. , 2018 ) . Our work instead reparameterizes the high-dimensional sample-level transition into a simpler low-dimensional latent space via the learned generator network . 3 BACKGROUND . 3.1 GAN . GAN models the data distribution pd ( x ) implicitly with a generator G : Z → X mapping from a low-dimensional latent space Z to a high-dimensional sample space X , x = G ( z ) , z ∼ p0 ( z ) , ( 1 ) where the sample x follows the generative distribution pg ( x ) and the latent variable z follows the prior distribution p0 ( z ) , e.g. , a standard normal distribution N ( 0 , I ) . In GAN , a discriminator D : X → [ 0 , 1 ] is learned to distinguish samples from pd ( x ) and pg ( x ) in an adversarial way min G max D Ex∼pd ( x ) log ( D ( x ) ) + Ez∼p0 ( z ) log ( 1−D ( G ( z ) ) ) . ( 2 ) Goodfellow et al . ( 2014 ) point out that an optimal discriminator D implies the density ratio between the data and generative distributions D ( x ) = pd ( x ) pd ( x ) + pg ( x ) ⇒ pd ( x ) pg ( x ) = 1 D ( x ) −1 − 1 . ( 3 ) 3.2 MCMC . Markov Chain Monte Carlo ( MCMC ) refers to a kind of sampling methods that draw a chain of samples x1 : K ∈ XK from a target distribution pt ( x ) . We denote the initial distribution as p0 ( x ) and the proposal distribution as q ( x′|xk ) . With the Metropolis-Hastings ( MH ) algorithm , we accept the proposal x′ ∼ q ( x′|xk ) with probability α ( x′ , xk ) = min ( 1 , pt ( x ′ ) q ( xk|x′ ) pt ( xk ) q ( x′|xk ) ) ∈ [ 0 , 1 ] . ( 4 ) If x′ is accepted , xk+1 = x′ , otherwise xk+1 = xk . Under mild assumptions , the Markov chain is guaranteed to converge to pt ( x ) as K →∞ . In practice , the sample efficiency of MCMC crucially depends on the proposal distribution to trade off between exploration and exploitation . 4 THE PROPOSED REP-GAN . In this section , we first review MH-GAN and point out the limitations . We then propose our structured dependent proposal to overcome these obstacles , and finally discuss its theoretical properties as well as practical implementations . 4.1 FROM INDEPENDENT PROPOSAL TO DEPENDENT PROPOSAL . MH-GAN ( Turner et al. , 2019 ) first proposes to improve GAN sampling with MCMC . Specifically , given a perfect discriminator D and a descent ( but imperfect ) generator G after training , they take the data distribution pd ( x ) as the target distribution and use the generator distribution pg ( x ) as an independent proposal x′ ∼ q ( x′|xk ) = q ( x′ ) = pg ( x′ ) . ( 5 ) With the MH criterion ( Eqn . ( 4 ) ) and the density ratio ( Eqn . ( 3 ) ) , we should accept x′ with probability αMH ( x ′ , xk ) = min ( 1 , pd ( x ′ ) q ( xk ) pd ( xk ) q ( x′ ) ) = min ( 1 , D ( xk ) −1 − 1 D ( x′ ) −1 − 1 ) . ( 6 ) However , to achieve tractability , MH-GAN adopts an independent proposal q ( x′ ) with poor sample efficiency . As the proposed sample x′ is independent of the current sample xk , the difference between the two samples can be so large that it results in a very low acceptance probability . Consequently , samples can be trapped in the same place for a long time , leading to a very slow mixing of the chain . A natural solution is to take a dependent proposal q ( x′|xk ) that will propose a sample x′ close to the current one xk , which is more likely to be accepted . Nevertheless , the problem of such a dependent proposal is that its MH acceptance criterion αDEP ( x ′ , xk ) = min ( 1 , pd ( x ′ ) q ( xk|x′ ) pd ( xk ) q ( x′|xk ) ) , ( 7 ) is generally intractable because the data density pd ( x ) is unknown . Besides , it is hard to design a proper dependent proposal q ( x′|xk ) in the high dimensional sample space X with complex landscape . These obstacles prevent us from adopting a dependent proposal that is more suitable for MCMC . 4.2 A TRACTABLE STRUCTURED DEPENDENT PROPOSAL WITH REPARAMETERIZED MARKOV CHAINS . As discussed above , the major difficulty of a general dependent proposal q ( x′|xk ) is to compute the MH criterion . We show that it can be made tractable by considering an additional pairing Markov chain in the latent space . As we know , samples of GANs lie in a low-dimensional manifold induced by the push-forward of the latent variable . Suppose that at the k-th step of the Markov chain , we have a GAN sample xk with latent zk . Instead of drawing a sample x′ directly from a sample-level proposal distribution q ( x′|xk ) , we first draw a latent proposal z′ from a dependent latent proposal distribution q ( z′|zk ) . Afterward , we push the latent z′ forward through the generator and get the output x′ as our sample proposal . As illustrated in Figure 1 , our bottom-to-up proposal relies on the transition reparameterization with two pairing Markov chains in the sample space X and the latent space Z . Hence we call it a REP ( reparameterized ) proposal . Through a learned generator , we transport the transition xk → x′ in the high dimensional space X into the low dimensional space Z , zk → z′ , which enjoys a much better landscape and makes it easier to design proposals in MCMC algorithms . For example , the latent target distribution is nearly standard normal when the generator is nearly perfect . In fact , under mild conditions , the REP proposal distribution qREP ( x′|xk ) and the latent proposal distribution q ( z′|zk ) are tied with the following change of variables ( Gemici et al. , 2016 ; Ben-Israel , 1999 ) log qREP ( x ′|xk ) = log q ( x′|zk ) = log q ( z′|zk ) − 1 2 log detJ > z′Jz′ , ( 8 ) where Jz denotes the Jacobian matrix of the push-forward G at z , i.e. , [ Jz ] ij = ∂ xi/∂ zj , x = G ( z ) . Nevertheless , it remains unclear whether we can perform the MH test to decide the acceptance of the proposal x′ . Note that a general dependent proposal distribution does not meet a tractable MH acceptance criterion ( Eqn . ( 7 ) ) . Perhaps surprisingly , it can be shown that with our structured REP proposal , the MH acceptance criterion is tractable for general latent proposals q ( z′|zk ) . Theorem 1 . Consider a Markov chain of GAN samples x1 : K with initial distribution pg ( x ) . For step k + 1 , we accept our REP proposal x′ ∼ qREP ( x′|xk ) with probability αREP ( x ′ , xk ) = min ( 1 , p0 ( z ′ ) q ( zk|z′ ) p0 ( zk ) q ( z′|zk ) · D ( xk ) −1 − 1 D ( x′ ) −1 − 1 ) , ( 9 ) i.e . let xk+1 = x′ if x′ is accepted and xk+1 = xk otherwise . Further assume the chain is irreducible , aperiodic and not transient . Then , according to the Metropolis-Hastings algorithm , the stationary distribution of this Markov chain is the data distribution pd ( x ) ( Gelman et al. , 2013 ) . Proof . Note that similar to Eqn ( 8 ) , we also have the change of variables between pg ( x ) and p0 ( z ) , log pg ( x ) |x=G ( z ) = log p0 ( z ) − 1 2 log detJ > z Jz . ( 10 ) According to Gelman et al . ( 2013 ) , the assumptions that the chain is irreducible , aperiodic , and not transient make sure that the chain has a unique stationary distribution , and the MH algorithm ensures that this stationary distribution equals to the target distribution pd ( x ) . Thus we only need to show that the MH criterion in Eqn . ( 9 ) holds . Together with Eqn . ( 3 ) , ( 7 ) and ( 8 ) , we have αREP ( x ′ , xk ) = pd ( x ′ ) q ( xk|x′ ) pd ( xk ) q ( x′|xk ) = pd ( x ′ ) q ( zk|z′ ) ( det J > zkJzk ) − 12 pg ( xk ) pg ( x′ ) pd ( xk ) q ( z′|zk ) ( det J > z′Jz′ ) − 12 pg ( x′ ) pg ( xk ) = q ( zk|z′ ) ( det J > zkJzk ) − 12 p0 ( z′ ) ( det J > z′Jz′ ) − 12 ( D ( xk ) −1 − 1 ) q ( z′|zk ) ( det J > z′Jz′ ) − 12 p0 ( zk ) ( det J > zkJzk ) − 12 ( D ( x′ ) −1 − 1 ) = p0 ( z ′ ) q ( zk|z′ ) ( D ( xk ) −1 − 1 ) p0 ( zk ) q ( z′|zk ) ( D ( x′ ) −1 − 1 ) . ( 11 ) Hence the proof is completed . The theorem above demonstrates the following favorable properties of our method : • The discriminator score ratio is the same as αMH ( x′ , xk ) , but MH-GAN is restricted to a specific independent proposal . Our method instead works for any latent proposal q ( z′|zk ) . When we take q ( z′|zk ) = p0 ( z′ ) , our method reduces to MH-GAN . • Compared to αDEP ( x′ , xk ) of a general dependent proposal ( Eqn . ( 7 ) ) , the unknown data distributions terms are successfully cancelled in the reparameterized acceptance criterion . • The reparameterized MH acceptance criterion becomes tractable as it only involves the latent priors , the latent proposal distributions , and the discriminator scores . Combining the REP proposal qREP ( x′|xk ) and its tractable MH criterion αREP ( x′ , xk ) , we have developed a novel sampling method for GANs , coined as REP-GAN . See Appendix 1 for a detailed description . Moreover , our method can serve as a general approximate inference technique for Bayesian models by bridging MCMC and GANs . Previous works ( Marzouk et al. , 2016 ; Titsias , 2017 ; Hoffman et al. , 2019 ) also propose to avoid the bad geometry of a complex probability measure by reparameterizing the Markov transitions into a simpler measure . However , these methods are limited to explicit invertible mappings without dimensionality reduction . In our work , we first show that it is also tractable to conduct such model-based reparameterization with implicit models like GANs .
The paper proposes an MCMC sampling strategy for GANs. The idea is clear: for high-dimensional x, making a good proposal is difficult, so they propose to do that in the latent space. Then they use a similar strategy as MH-GAN to compute a rejection strategy. The difference between the two methods is that proposal in MH-GAN does not depend on x while the proposed method does, and the argument is that it results in a higher acceptance rate.
SP:93f8114b248a8fbae75eadc40d70c6d38f3faff4
On the Predictability of Pruning Across Scales
1 INTRODUCTION . For decades , neural network pruning—eliminating unwanted parts of the network—has been a popular approach for reducing network sizes or computational demands of inference ( LeCun et al. , 1990 ; Reed , 1993 ; Han et al. , 2015 ) . In practice , pruning can reduce the parameter-counts of contemporary models by 2x ( Gordon et al. , 2020 ) to 5x ( Renda et al. , 2020 ) with no reduction in accuracy . More than 80 pruning techniques have been published in the past decade ( Blalock et al. , 2020 ) , but , despite this enormous volume of research , there remains little guidance on important aspects of pruning . Consider a seemingly simple question one might ask when using a particular pruning technique : Given a family of neural networks ( e.g. , ResNets on ImageNet of various widths and depths ) , which family member should we prune ( and by how much ) to obtain the network with the smallest parametercount such that error does not exceed some threshold k ? As a first try , we could attempt to answer this question using brute force : we could prune every member of a family ( i.e. , perform grid search over widths and depths ) and select the smallest pruned network that satisfies our constraint on error . However , depending on the technique , pruning one network ( let alone grid searching ) could take days or weeks on expensive hardware . If we want a more efficient alternative , we will need to make assumptions about pruned networks : namely , that there is some structure to the way that their error behaves . For example , that pruning a particular network changes the error in a predictable way . Or that changing the width or depth of a network changes the error when pruning it in a predictable way . We could then train a smaller number of networks , characterize this structure , and estimate the answer to our question . We have reason to believe that such structure does exist for pruning : techniques already take advantage of it implicitly . For example , Cai et al . ( 2019 ) create a single neural network architecture that can be scaled down to many different sizes ; to choose which subnetwork to deploy , Cai et al . train an auxiliary , black-box neural network to predict subnetwork performance . Although this black-box approach implies the existence of structure , it does not reveal this structure explicitly or make it possible to reason analytically in a fashion that could answer our research question . Outside the context of pruning algorithms , such structure has been observed—and further codified explicitly—yielding insights and predictions in the form of scaling laws . Tan and Le ( 2019 ) design the EfficientNet family by developing a heuristic for predicting efficient tradeoffs between depth , width , and resolution . Hestness et al . ( 2017 ) observe a power-law relationship between dataset size and the error of vision and NLP models . Rosenfeld et al . ( 2020 ) use a power scaling law to predict the error of all variations of architecture families and dataset sizes jointly , for computer vision and natural language processing settings . Kaplan et al . ( 2020 ) develop a similar power law for language models that incorporates the computational cost of training . Inspired by this line of work , we address our research question about pruning by developing a scaling law to predict the error of networks as they are pruned . To the best of our knowledge , no explicit scaling law holding over pruning algorithms and network types currently exists . In order to formulate such a predictive scaling law , we consider the dependence of generalization error on the pruning-induced density for networks of different depths and width trained on different dataset sizes . We begin by developing a functional form that accurately estimates the generalization error of a specific model as it is pruned ( Section 3 ) . We then account for other architectural degrees of freedom , expanding the functional form for pruning into a scaling law that jointly considers density alongside width , depth , and dataset size ( Section 4 ) . The basis for this joint scaling law is an invariant we uncover that describes ways that we can interchange depth , width , and pruning without affecting error . The result is a scaling law that accurately predicts the performance of pruned networks across scales . Finally , we use this scaling law to answer our motivating question ( Section 7 ) . The same functional form can accurately estimate the error for both unstructured magnitude pruning ( Renda et al. , 2020 ) and SynFlow ( Tanaka et al. , 2020 ) when fit to the corresponding data , suggesting we have uncovered structure that may be applicable to iterative pruning more generally . And now that we have established this functional form , fitting it requires only a small amount of data ( Appendix 5 ) . In summary , our contributions are as follows : • We develop a scaling law that accurately estimates the error when pruning a single network . • We observe and characterize an invariant that allows error-preserving interchangeability among depth , width , and pruning density . • Using this invariant , we extend our single-network scaling law into a joint scaling law that predicts the error of all members of a network family at all dataset sizes and all pruning densities . • In doing so , we demonstrate that there is structure to the behavior of the error of iteratively pruned networks that we can capture explicitly with a simple functional form . • Our scaling law enables a framework for reasoning analytically about pruning , allowing us to answer our motivating question and similar questions about pruning . 2 EXPERIMENTAL SETUP . Pruning . We study two techniques for pruning neural networks : iterative magnitude pruning ( IMP ) ( Janowsky , 1989 ; Han et al. , 2015 ; Frankle et al. , 2020 ) in the main body of the paper and SynFlow ( Tanaka et al. , 2020 ) in Appendix E. We describe IMP in detail here and SynFlow in Appendix A. IMP prunes by removing a fraction—typically 20 % , as we do here—of individual weights with the lowest magnitudes at the end of training.1 We choose these weights globally throughout the network , i.e. , without regard to specific layers . We use per-weight magnitude pruning because it is generic , well-studied ( Han et al. , 2015 ) , and matches the sparsity/accuracy tradeoffs of more complicated methods ( Gale et al. , 2019 ; Blalock et al. , 2020 ; Renda et al. , 2020 ) . Pruning weights typically reduces the accuracy of the trained network , so it is standard practice to further train after pruning to recover accuracy . For IMP , we use a practice called weight rewinding , in which the values of unpruned weights are rewound to their values at epoch 10 and the training process is repeated from there to completion . To achieve density levels below 80 % , this process is repeated iteratively—pruning by 20 % , rewinding , and retraining—until a desired density level is reached . Renda et al . ( 2020 ) demonstrate that IMP with weight rewinding achieves state-of-the-art tradeoffs between sparsity and accuracy . For a formal statement of this pruning algorithm , see Appendix A. Datasets . We study the image classification tasks CIFAR-10 and ImageNet . Our scaling law predicts the error when training with the entire dataset and smaller subsamples . To subsample a dataset to a size of n , we randomly select n of the training examples without regard to individual classes such 1We do not prune biases or BatchNorm , so pruning 20 % of weights prunes fewer than 20 % of parameters . that in expectation we preserve the original dataset distribution ( we always retain the entire test set ) . When performing iterative pruning , we maintain the same subsample for all pruning iterations . Networks . We study three families of neural networks : ResNets for CIFAR-10 , ResNets for ImageNet , and ( in Appendix E ) VGG-style networks for CIFAR-10.2 We develop a scaling law that predicts the error ( when pruned ) of an entire family of networks with varying widths and—in the case of the CIFAR-10 ResNets—depths . To vary width , we multiply the number of channels in each layer by a width scaling factor . To vary depth of the CIFAR-10 ResNets , we vary the number of residual blocks . We refer to a network by its depth l ( the number of layers in the network , not counting skip connections ) and its width scaling factor w. Notation and terminology . Throughout the paper , we use the following notation and terminology : • DN = { xi , yi } Ni=1 is a labeled training set with N examples . A subsample of size n is a subset of DN containing n examples selected uniformly at random . • l and w are , respectively , the depth ( i.e. , the number of layers , excluding skip connections ) and the width scaling factor of a particular network . • A collection of networks that vary by width and depth are a network family . • s is the sparsity of a pruned network ( i.e. , the fraction of weights that have been pruned ) and d , 1− s is the density ( i.e. , the fraction of weights that have not been pruned ) . • ( d , l , w , n ) is the test error of a network with the specified density , depth , width scaling factor , and dataset size . • np ( l , w , n ) = ( 1 , l , w , n ) is the test error of the unpruned network with the specified depth , width scaling factor , and dataset size . When clear from context , we omit ( w , l , n ) and write np . • ̂ ( np , d | l , w , n ) is an estimate of the error of a pruned model for a scaling law that has been fit to a specific network with the specified depth , width scaling factor , and dataset size ( Section 3 ) . • ̂ ( np , d , l , w , n ) is an estimate of the error of a pruned model with the specified depth , width scaling factor , and dataset size for a scaling law that has been fit to a network family ( Section 4 ) . Dimensions . In developing scaling laws , we vary four different dimensions : dataset subsample size ( n ) and network degrees of freedom density ( d ) , network depth ( l ) , and width scaling factor ( w ) . We consider the following ranges of these values in our experiments in the main body of the paper : Network Family Ntrain Ntest Densities ( d ) Depths ( l ) Width Scalings ( w ) Subsample Sizes ( n ) CIFAR-10 ResNet 50K 10K 0.8i , i ∈ { 0 , . . . , 40 } 8 , 14 , 20 , 26 , 50 , 98 2i , i ∈ { −4 , . . . , 2 } Ni , i ∈ { 1 , 2 , 4 , 8 , 16 , 32 , 64 } ImageNet ResNet 1.28M 50K 0.8i , i ∈ { 0 , . . . , 30 } 50 2i , i ∈ { −4 , . . . , 0 } Ni , i ∈ { 1 , 2 , 4 } We use sanity checks to filter infeasible or unusual configurations from this table . In many cases , networks become disconnected before we reach the lowest density ( e.g. , ∼30 % of the CIFAR-10 ResNet configurations ) . We also eliminate configurations where increasing width or depth of the unpruned network lowers test accuracy ( e.g. , 144 of the 294 CIFAR-10 ResNet configurations of l , w , and n ) ; these are typically unusual , imbalanced configurations ( e.g. , l = 98 , w = 116 ) . Of the 12,054 possible CIFAR-10 ResNet configurations , about 8,000 are eliminated based on these sanity checks .
This paper studies how to estimate the performance of pruned networks using regression models. The authors first empirically observe that there exist three distinct regions of sparsity: (1) In the low-sparsity regime, pruning does not decrease the accuracy (2) In the mid-sparsity regime, a linear relationship between the sparsity and the accuracy is observed (3) In the high-sparsity regime, pruning does not decrease the accuracy again. Under this observation, the authors proposed a regression model called the rational family and empirically verified its performance. The authors further extended this model to incorporate the network width and depth under some empirical observation called the error-preserving invariant. The authors performed experiments to verify different perspectives of the proposed functional form.
SP:dac2e985d39e3466dafbf20124fdafe0f5b9bd24
On the Predictability of Pruning Across Scales
1 INTRODUCTION . For decades , neural network pruning—eliminating unwanted parts of the network—has been a popular approach for reducing network sizes or computational demands of inference ( LeCun et al. , 1990 ; Reed , 1993 ; Han et al. , 2015 ) . In practice , pruning can reduce the parameter-counts of contemporary models by 2x ( Gordon et al. , 2020 ) to 5x ( Renda et al. , 2020 ) with no reduction in accuracy . More than 80 pruning techniques have been published in the past decade ( Blalock et al. , 2020 ) , but , despite this enormous volume of research , there remains little guidance on important aspects of pruning . Consider a seemingly simple question one might ask when using a particular pruning technique : Given a family of neural networks ( e.g. , ResNets on ImageNet of various widths and depths ) , which family member should we prune ( and by how much ) to obtain the network with the smallest parametercount such that error does not exceed some threshold k ? As a first try , we could attempt to answer this question using brute force : we could prune every member of a family ( i.e. , perform grid search over widths and depths ) and select the smallest pruned network that satisfies our constraint on error . However , depending on the technique , pruning one network ( let alone grid searching ) could take days or weeks on expensive hardware . If we want a more efficient alternative , we will need to make assumptions about pruned networks : namely , that there is some structure to the way that their error behaves . For example , that pruning a particular network changes the error in a predictable way . Or that changing the width or depth of a network changes the error when pruning it in a predictable way . We could then train a smaller number of networks , characterize this structure , and estimate the answer to our question . We have reason to believe that such structure does exist for pruning : techniques already take advantage of it implicitly . For example , Cai et al . ( 2019 ) create a single neural network architecture that can be scaled down to many different sizes ; to choose which subnetwork to deploy , Cai et al . train an auxiliary , black-box neural network to predict subnetwork performance . Although this black-box approach implies the existence of structure , it does not reveal this structure explicitly or make it possible to reason analytically in a fashion that could answer our research question . Outside the context of pruning algorithms , such structure has been observed—and further codified explicitly—yielding insights and predictions in the form of scaling laws . Tan and Le ( 2019 ) design the EfficientNet family by developing a heuristic for predicting efficient tradeoffs between depth , width , and resolution . Hestness et al . ( 2017 ) observe a power-law relationship between dataset size and the error of vision and NLP models . Rosenfeld et al . ( 2020 ) use a power scaling law to predict the error of all variations of architecture families and dataset sizes jointly , for computer vision and natural language processing settings . Kaplan et al . ( 2020 ) develop a similar power law for language models that incorporates the computational cost of training . Inspired by this line of work , we address our research question about pruning by developing a scaling law to predict the error of networks as they are pruned . To the best of our knowledge , no explicit scaling law holding over pruning algorithms and network types currently exists . In order to formulate such a predictive scaling law , we consider the dependence of generalization error on the pruning-induced density for networks of different depths and width trained on different dataset sizes . We begin by developing a functional form that accurately estimates the generalization error of a specific model as it is pruned ( Section 3 ) . We then account for other architectural degrees of freedom , expanding the functional form for pruning into a scaling law that jointly considers density alongside width , depth , and dataset size ( Section 4 ) . The basis for this joint scaling law is an invariant we uncover that describes ways that we can interchange depth , width , and pruning without affecting error . The result is a scaling law that accurately predicts the performance of pruned networks across scales . Finally , we use this scaling law to answer our motivating question ( Section 7 ) . The same functional form can accurately estimate the error for both unstructured magnitude pruning ( Renda et al. , 2020 ) and SynFlow ( Tanaka et al. , 2020 ) when fit to the corresponding data , suggesting we have uncovered structure that may be applicable to iterative pruning more generally . And now that we have established this functional form , fitting it requires only a small amount of data ( Appendix 5 ) . In summary , our contributions are as follows : • We develop a scaling law that accurately estimates the error when pruning a single network . • We observe and characterize an invariant that allows error-preserving interchangeability among depth , width , and pruning density . • Using this invariant , we extend our single-network scaling law into a joint scaling law that predicts the error of all members of a network family at all dataset sizes and all pruning densities . • In doing so , we demonstrate that there is structure to the behavior of the error of iteratively pruned networks that we can capture explicitly with a simple functional form . • Our scaling law enables a framework for reasoning analytically about pruning , allowing us to answer our motivating question and similar questions about pruning . 2 EXPERIMENTAL SETUP . Pruning . We study two techniques for pruning neural networks : iterative magnitude pruning ( IMP ) ( Janowsky , 1989 ; Han et al. , 2015 ; Frankle et al. , 2020 ) in the main body of the paper and SynFlow ( Tanaka et al. , 2020 ) in Appendix E. We describe IMP in detail here and SynFlow in Appendix A. IMP prunes by removing a fraction—typically 20 % , as we do here—of individual weights with the lowest magnitudes at the end of training.1 We choose these weights globally throughout the network , i.e. , without regard to specific layers . We use per-weight magnitude pruning because it is generic , well-studied ( Han et al. , 2015 ) , and matches the sparsity/accuracy tradeoffs of more complicated methods ( Gale et al. , 2019 ; Blalock et al. , 2020 ; Renda et al. , 2020 ) . Pruning weights typically reduces the accuracy of the trained network , so it is standard practice to further train after pruning to recover accuracy . For IMP , we use a practice called weight rewinding , in which the values of unpruned weights are rewound to their values at epoch 10 and the training process is repeated from there to completion . To achieve density levels below 80 % , this process is repeated iteratively—pruning by 20 % , rewinding , and retraining—until a desired density level is reached . Renda et al . ( 2020 ) demonstrate that IMP with weight rewinding achieves state-of-the-art tradeoffs between sparsity and accuracy . For a formal statement of this pruning algorithm , see Appendix A. Datasets . We study the image classification tasks CIFAR-10 and ImageNet . Our scaling law predicts the error when training with the entire dataset and smaller subsamples . To subsample a dataset to a size of n , we randomly select n of the training examples without regard to individual classes such 1We do not prune biases or BatchNorm , so pruning 20 % of weights prunes fewer than 20 % of parameters . that in expectation we preserve the original dataset distribution ( we always retain the entire test set ) . When performing iterative pruning , we maintain the same subsample for all pruning iterations . Networks . We study three families of neural networks : ResNets for CIFAR-10 , ResNets for ImageNet , and ( in Appendix E ) VGG-style networks for CIFAR-10.2 We develop a scaling law that predicts the error ( when pruned ) of an entire family of networks with varying widths and—in the case of the CIFAR-10 ResNets—depths . To vary width , we multiply the number of channels in each layer by a width scaling factor . To vary depth of the CIFAR-10 ResNets , we vary the number of residual blocks . We refer to a network by its depth l ( the number of layers in the network , not counting skip connections ) and its width scaling factor w. Notation and terminology . Throughout the paper , we use the following notation and terminology : • DN = { xi , yi } Ni=1 is a labeled training set with N examples . A subsample of size n is a subset of DN containing n examples selected uniformly at random . • l and w are , respectively , the depth ( i.e. , the number of layers , excluding skip connections ) and the width scaling factor of a particular network . • A collection of networks that vary by width and depth are a network family . • s is the sparsity of a pruned network ( i.e. , the fraction of weights that have been pruned ) and d , 1− s is the density ( i.e. , the fraction of weights that have not been pruned ) . • ( d , l , w , n ) is the test error of a network with the specified density , depth , width scaling factor , and dataset size . • np ( l , w , n ) = ( 1 , l , w , n ) is the test error of the unpruned network with the specified depth , width scaling factor , and dataset size . When clear from context , we omit ( w , l , n ) and write np . • ̂ ( np , d | l , w , n ) is an estimate of the error of a pruned model for a scaling law that has been fit to a specific network with the specified depth , width scaling factor , and dataset size ( Section 3 ) . • ̂ ( np , d , l , w , n ) is an estimate of the error of a pruned model with the specified depth , width scaling factor , and dataset size for a scaling law that has been fit to a network family ( Section 4 ) . Dimensions . In developing scaling laws , we vary four different dimensions : dataset subsample size ( n ) and network degrees of freedom density ( d ) , network depth ( l ) , and width scaling factor ( w ) . We consider the following ranges of these values in our experiments in the main body of the paper : Network Family Ntrain Ntest Densities ( d ) Depths ( l ) Width Scalings ( w ) Subsample Sizes ( n ) CIFAR-10 ResNet 50K 10K 0.8i , i ∈ { 0 , . . . , 40 } 8 , 14 , 20 , 26 , 50 , 98 2i , i ∈ { −4 , . . . , 2 } Ni , i ∈ { 1 , 2 , 4 , 8 , 16 , 32 , 64 } ImageNet ResNet 1.28M 50K 0.8i , i ∈ { 0 , . . . , 30 } 50 2i , i ∈ { −4 , . . . , 0 } Ni , i ∈ { 1 , 2 , 4 } We use sanity checks to filter infeasible or unusual configurations from this table . In many cases , networks become disconnected before we reach the lowest density ( e.g. , ∼30 % of the CIFAR-10 ResNet configurations ) . We also eliminate configurations where increasing width or depth of the unpruned network lowers test accuracy ( e.g. , 144 of the 294 CIFAR-10 ResNet configurations of l , w , and n ) ; these are typically unusual , imbalanced configurations ( e.g. , l = 98 , w = 116 ) . Of the 12,054 possible CIFAR-10 ResNet configurations , about 8,000 are eliminated based on these sanity checks .
The authors propose a functional approximation to the error of pruned convolutional neural networks as a function of network hyperparameters. This functional approximation depends on a number of hyperparameters that are fit on the error of already trained and pruned networks on a certain task (in this case, image classification on CIFAR-10 and ImageNet are the tasks under consideration). The authors demonstrate that this fit is very accurate over many orders of magnitude, which demonstrates their hypothesis on the power law nature of the error distribution as a function of the hyperparameters under consideration.
SP:dac2e985d39e3466dafbf20124fdafe0f5b9bd24
MetaPhys: Few-Shot Adaptation for Non-Contact Physiological Measurement
1 INTRODUCTION . The importance of scalable health sensing has been acutely highlighted during the SARS-CoV-2 ( COVID-19 ) pandemic . The virus has been linked to increased risk of myocarditis and other serious cardiac ( heart ) conditions ( Puntmann et al. , 2020 ) . Contact sensors ( electrocardiograms , oximeters ) are the current gold-standard for measurement of heart function . However , these devices are still not ubiquitously available , especially in low-resource settings . The development of video-based contactless sensing of vital signs presents an opportunity for highly scalable physiological monitoring . Furthermore , in clinical settings non-contact sensing could reduce the risk of infection for vulnerable patients ( e.g. , infants and elderly ) and the discomfort caused to them ( Villarroel et al. , 2019 ) . While there are compelling advantages of camera-based sensing , the approach also presents unsolved challenges . The use of ambient illumination means camera-based measurement is sensitive to environmental differences in the intensity and composition of the incident light . Camera sensor differences mean that hardware can differ in sensitivity across the frequency spectrum . People ( the subjects ) exhibit large individual differences in appearance ( e.g. , skin type , facial hair ) and physiology ( e.g , pulse dynamics ) . Finally , contextual differences mean that motions in a video at test time might be different from those seen in the training data . One specific example is that there exists biases in performance across skin types Nowara et al . ( 2020 ) . This problem is not isolated to physiological measurement as studies have found systematic biases in facial gender classification , with error rates up to 7x higher on women than men and poorer performance on people with darker skin types ( Buolamwini & Gebru , 2018 ) . Moreover , there are several challenges in collecting large corpora of high-quality physiological data : 1 ) recruiting and instrumenting participants is often expensive and requires advanced technical expertise , 2 ) the data can reveal the identity of the subjects and/or sensitive health information meaning it is difficult for researchers to share such datasets . Therefore , training supervised models that generalize well across environments and subjects is challenging . For these reasons we observe that performance on cross-dataset evaluation is significantly worse than within-dataset evaluation using current state-of-the-art methods ( Chen & McDuff , 2018 ; Liu et al. , 2020 ) . Calibration of consumer health sensors is often performed in a clinic , where a clinician will collect readings from a high-end sensor to calibrate a consumer-level device the patient owns . The reason for this is partly due to the variability within readings from consumer devices across different individuals . Ideally , we would be able to train a personalized model for each individual ; however , standard supervised learning training schemes require large amounts of labeled data . Getting enough physiological training data of each individual is difficult because it requires using medical-grade devices to provide reliable labels . Being able to generate a personalized model from a small amount of training samples would enable customization based on a few seconds or minutes of video captured while visiting a clinic where people have access to a gold-standard device . Furthermore , if this process could be achieved without even the need for these devices ( i.e. , in an unsupervised manner ) , that would have even greater impact . Finally , combining remote physiological measurement with telehealth could provide patients ’ vital signs for clinicians during remote diagnosis . Given that requests for telehealth appointments have increased more than 10x during COVID-19 , and that this is expected to continue into the future ( Smith et al. , 2020 ) , robust personalized models are of growing importance . Meta-learning , or learning to learn , has been extensively studied in the past few years ( Hospedales et al. , 2020 ) . Instead of learning a specific generalized mapping , the goal of meta-learning is to design a model that can adapt to a new task or context with a small amount of data . Due to the inherent ability for fast adaption , meta-learning is a good candidate strategy for building personalized models ( e.g. , personalization in dialogue and video retargeting ( Madotto et al. , 2019 ; Lee et al. , 2019 ) . ) However , we argue that meta learning is underused in healthcare where clinicians can quickly adapt their clinical knowledge to different patients . The goal of this work is to develop a meta-learning based personalization framework in remote physiological measurement with a limited amount of data from an unseen individual ( task ) to mimic how a clinician manually calibrates sensor readings for a specific patient . When meta-learning is applied to remote physiological measurement , there are two kinds of scenarios : 1 ) supervised adaptation with few samples of labeled data from a clinical grade sensor and 2 ) unsupervised adaptation with unlabeled data . We hypothesize that supervised adaptation is more likely to yield a robust personalized model with only a few labels , while unsupervised adaptation may personalize the model less effectively but with much lower effort and complexity . In this paper , we propose a novel meta-learning approach to address the aforementioned challenges called MetaPhys . Our contributions are : 1 ) A meta-learning based deep neural framework , supporting both supervised and unsupervised few-shot adaptation , for camera-based vital sign measurement ; 2 ) A systematic cross-dataset evaluation showing that our system considerably outperforms the state-of-the-art ( 42 % to 52 % reduction in heart rate error ) ; 3 ) To perform an ablation experiment , freezing weights in the temporal and appearance branches to test sensitivity during adaptation ; 4 ) An analysis of performance for subjects with different skin types . Our code , example models , and video results can be found on our github page.1 2 BACKGROUND . Video-Based Physiological Measurement : Video-based physiological measurement is a growing interdisciplinary domain that leverages ubiquitous imaging devices ( e.g. , webcams , smartphones ’ cameras ) to measure vital signs and other physiological processes . Early work established that changes in light reflected from the body could be used to capture subtle variations blood volume and motion related to the photoplethysmogram ( PPG ) ( Takano & Ohta , 2007 ; Verkruysse et al. , 2008 ) and ballistocardiogram ( BCG ) ( Balakrishnan et al. , 2013 ) , respectively . Video analysis enables non-contact , spatial and temporal measurement of arterial and peripheral pulsations and allows for magnification of theses signals ( Wu et al. , 2012 ) , which may help with examination ( e.g. , ( Abnousi et al. , 2019 ) ) . Based on the PPG and BCG signal , heart rate can be extracted ( Poh et al. , 2010b ; Balakrishnan et al. , 2013 ) . However , the relationship between pixels and underlying physiological changes in a video is complex and neural models have shown strong performance compared to source separation techniques ( Chen & McDuff , 2018 ; Yu et al. , 2019 ; Zhan et al. , 2020 ) . Conventional supervised learning requires a large amount of training data to produce a generalized model . However , obtaining a large body of physiological and facial data is complicated and expensive . Current public datasets have limited 1https : //github.com/anonymous0paper/MetaPhys numbers of subjects and diversity in regards of appearance ( including skin type ) , camera sensors , environmental conditions and subject motions . Therefore , if the subject of interest is not in the training data or the video is otherwise different , performance can be considerably degraded , a result that is not acceptable for a physiological sensor . Lee et al . ( Lee et al. , 2020 ) recognized the potential for meta-learning applied to imaging-based cardiac pulse measurement . Their method ( Meta-rPPG ) focuses on using unsupervised meta-learning and a LSTM encoder-decoder architecture which to our knowledge was not validated in previous work . Instead , our proposed meta-learning framework is built on top of a state-of-the-art on-device network ( Liu et al. , 2020 ) and aims to explore the potential of both supervised and unsupervised ondevice personalized meta-learning . Meta-rPPG uses a synthetic gradient generator and a prototypical distance minimizer to perform transductive inference to enable unsupervised meta-learning . This learning mechanism requires a number of rather complex steps . We propose a relatively simpler mechanism that is physiologically and optically grounded ( Wang et al. , 2016 ; Liu et al. , 2020 ) and achieves greater accuracy . Meta-Learning and Person Specific Models : The ability to learn from a small number of samples or observations is often used as an example of the unique capabilities of human intelligence . However , machine learning systems are often brittle in a similar context . Meta-learning approaches tackle this problem by creating a general learner that is able to adapt to a new task with a small number of training samples , inspired by how humans can often master a new skill without many observations ( Hospedales et al. , 2020 ) . However , most of the previous work in meta-learning focuses on supervised vision problems ( Zoph et al. , 2018 ; Snell et al. , 2017 ) and in the computer vision literature has mainly been applied to image analysis ( Vinyals et al. , 2016 ; Li et al. , 2017 ) . Supervised regression in video settings has received less attention . One of few examples is object or face tracking ( Choi et al. , 2019 ; Park & Berg , 2018 ) . In these tasks , the learner needs to adapt to the individual differences in appearance of the target and then track it across frames , even if the appearance changes considerably over time in the video . Choi et al . ( 2019 ) present a matching network architecture providing the meta-learner with information in the form of loss gradients obtained using the training samples . The property of fast adaptation makes meta-learning a good candidate for personalizing models , it has been used in various applications such as dialogue agents ( Madotto et al. , 2019 ) , gaze estimation ( He et al. , 2019 ) , sleep stage classification ( Banluesombatkul et al. , 2020 ) , activity recognition ( Gong et al. , 2019 ) , and video retargeting ( Lee et al. , 2019 ) . For example , Banluesombatkul et al . proposed a MAML-based meta-learning system to perform fast adaption of a sleep stage classification model using biosignals ( Banluesombatkul et al. , 2020 ) . More recently , MetaPix ( Lee et al. , 2019 ) leveraged a meta-learning training schema with a small amount of video to adapt a universal generator to a particular background and human in the problem of video retargeting . Similarly , our proposed meta-learning framework is also capable of personalizing a universal remote physiological model to a new person or an environmental setting . 3 METHOD . 3.1 PHYSIOLOGICAL META-LEARNING . In camera-based cardiac measurement , the goal is to separate pixel changes due to volumetric variations in blood and pulsatile motions from other variations that are not related to the pulse signal . Examples of “ noise ” in this context that might impact the performance on the task include : changes in the environment ( illumination ) and changes in appearance of the subject and motions ( e.g. , facial expressions , rigid head motions ) . A model trained within a traditional supervised learning regime might perform well if illumination , non-pulsatile motions , and appearances in the test set are similar to those in the training set . However , empirical evidence shows that performance usually significantly degrades from one dataset to another , suggesting that traditional training is likely to overfit to the training set to some extent ( Chen & McDuff , 2018 ) . Therefore , to achieve state-of-the-art performance in remote physiological measurement on cross-dataset evaluation , the system should have : 1 ) a good initial representation of the mapping from the raw video data to pulse signal , and 2 ) a strategy for adapting to unseen individuals and environments . To achieve this , we propose a system called MetaPhys , an adaptable meta-learning based on-device framework aimed at efficient and personalized remote physiological sensing . MetaPhys uses a pretrained convolutional attention network as the backbone ( described below ) and leverages a novel personalized meta-learning schema to overcome the aforementioned limitations . We adopt ModelAgnostic Meta-Learning ( MAML ) ( Finn et al. , 2017 ) as our personalized parameter update schema . MAML produces a general initialization as the starting point for fast adaptation to a diverse set of unseen tasks with only a few training samples . However , applying MAML to the task of camera-based physiological measurement has differences to many previously explored meta-learning problems . Existing meta-learning approaches are often evaluated on classification or some toy regression tasks due to the lack of regression benchmark datasets ( Hospedales et al. , 2020 ) . Our problem is a nontrivial vision-based regression task due to the subtle nature of the underlying physiological signal . Algorithm 1 outlines the training process for MetaPhys , we first pretrain the backbone network to get an initial spatial-temporal representation . Then we treat each individual as a task τi . During the training , we split the data into a support set ( K video frames ) and a query set ( K ′ video frames ) for each individual ( task ) . The support set is used to update the task ’ s parameters and yield a personalized model θi . The query set is used to assess the effectiveness of the personalized model and further update the global initialization θ to make future adaptation better . A robust personalized model θi aims to provide a more accurate attention mask to the corresponding motion branch and to preform precise physiological measurement for the target individual as well as the target ’ s environment . During the testing stage , MetaPhys has the updated global initialization θ̂ , and can generate θ̂i for each test individual ( task ) by optimizing the test support set as θ̂τi ← θ̂ − α∇θ̂Lτif ( θ̂ ) . With this training and testing schema , the robust global initialization θ̂ generated from MetaPhys not only leverages the pretrained representation but also learns how to adapt to individual and environmental noise quickly .
In this paper, the authors present a few-shot learning model for non-contact physiological signal measurement to build a more accurate and convenient personalized health sensing system. The motivation is that traditional fine-tuning method for this task is difficult since it requires large sets of high-quality training data for specific individuals, due to differences between each individual, measurement environment, and camera sensor condition. Therefore, the authors applied MAML on top of the existing deep learning network (TS-CAN) and implemented a model that aims to learn fast from a small number of training samples. The main contributions of this paper are: a meta-learning model that supports both supervised and unsupervised few-shot adaptation; improved performance by about 40% compared to a baseline that does not use meta learning; empirical analysis of performance for subjects with different skin types.
SP:30580fb0f3acf76221f8b031518a30228c4d6162
MetaPhys: Few-Shot Adaptation for Non-Contact Physiological Measurement
1 INTRODUCTION . The importance of scalable health sensing has been acutely highlighted during the SARS-CoV-2 ( COVID-19 ) pandemic . The virus has been linked to increased risk of myocarditis and other serious cardiac ( heart ) conditions ( Puntmann et al. , 2020 ) . Contact sensors ( electrocardiograms , oximeters ) are the current gold-standard for measurement of heart function . However , these devices are still not ubiquitously available , especially in low-resource settings . The development of video-based contactless sensing of vital signs presents an opportunity for highly scalable physiological monitoring . Furthermore , in clinical settings non-contact sensing could reduce the risk of infection for vulnerable patients ( e.g. , infants and elderly ) and the discomfort caused to them ( Villarroel et al. , 2019 ) . While there are compelling advantages of camera-based sensing , the approach also presents unsolved challenges . The use of ambient illumination means camera-based measurement is sensitive to environmental differences in the intensity and composition of the incident light . Camera sensor differences mean that hardware can differ in sensitivity across the frequency spectrum . People ( the subjects ) exhibit large individual differences in appearance ( e.g. , skin type , facial hair ) and physiology ( e.g , pulse dynamics ) . Finally , contextual differences mean that motions in a video at test time might be different from those seen in the training data . One specific example is that there exists biases in performance across skin types Nowara et al . ( 2020 ) . This problem is not isolated to physiological measurement as studies have found systematic biases in facial gender classification , with error rates up to 7x higher on women than men and poorer performance on people with darker skin types ( Buolamwini & Gebru , 2018 ) . Moreover , there are several challenges in collecting large corpora of high-quality physiological data : 1 ) recruiting and instrumenting participants is often expensive and requires advanced technical expertise , 2 ) the data can reveal the identity of the subjects and/or sensitive health information meaning it is difficult for researchers to share such datasets . Therefore , training supervised models that generalize well across environments and subjects is challenging . For these reasons we observe that performance on cross-dataset evaluation is significantly worse than within-dataset evaluation using current state-of-the-art methods ( Chen & McDuff , 2018 ; Liu et al. , 2020 ) . Calibration of consumer health sensors is often performed in a clinic , where a clinician will collect readings from a high-end sensor to calibrate a consumer-level device the patient owns . The reason for this is partly due to the variability within readings from consumer devices across different individuals . Ideally , we would be able to train a personalized model for each individual ; however , standard supervised learning training schemes require large amounts of labeled data . Getting enough physiological training data of each individual is difficult because it requires using medical-grade devices to provide reliable labels . Being able to generate a personalized model from a small amount of training samples would enable customization based on a few seconds or minutes of video captured while visiting a clinic where people have access to a gold-standard device . Furthermore , if this process could be achieved without even the need for these devices ( i.e. , in an unsupervised manner ) , that would have even greater impact . Finally , combining remote physiological measurement with telehealth could provide patients ’ vital signs for clinicians during remote diagnosis . Given that requests for telehealth appointments have increased more than 10x during COVID-19 , and that this is expected to continue into the future ( Smith et al. , 2020 ) , robust personalized models are of growing importance . Meta-learning , or learning to learn , has been extensively studied in the past few years ( Hospedales et al. , 2020 ) . Instead of learning a specific generalized mapping , the goal of meta-learning is to design a model that can adapt to a new task or context with a small amount of data . Due to the inherent ability for fast adaption , meta-learning is a good candidate strategy for building personalized models ( e.g. , personalization in dialogue and video retargeting ( Madotto et al. , 2019 ; Lee et al. , 2019 ) . ) However , we argue that meta learning is underused in healthcare where clinicians can quickly adapt their clinical knowledge to different patients . The goal of this work is to develop a meta-learning based personalization framework in remote physiological measurement with a limited amount of data from an unseen individual ( task ) to mimic how a clinician manually calibrates sensor readings for a specific patient . When meta-learning is applied to remote physiological measurement , there are two kinds of scenarios : 1 ) supervised adaptation with few samples of labeled data from a clinical grade sensor and 2 ) unsupervised adaptation with unlabeled data . We hypothesize that supervised adaptation is more likely to yield a robust personalized model with only a few labels , while unsupervised adaptation may personalize the model less effectively but with much lower effort and complexity . In this paper , we propose a novel meta-learning approach to address the aforementioned challenges called MetaPhys . Our contributions are : 1 ) A meta-learning based deep neural framework , supporting both supervised and unsupervised few-shot adaptation , for camera-based vital sign measurement ; 2 ) A systematic cross-dataset evaluation showing that our system considerably outperforms the state-of-the-art ( 42 % to 52 % reduction in heart rate error ) ; 3 ) To perform an ablation experiment , freezing weights in the temporal and appearance branches to test sensitivity during adaptation ; 4 ) An analysis of performance for subjects with different skin types . Our code , example models , and video results can be found on our github page.1 2 BACKGROUND . Video-Based Physiological Measurement : Video-based physiological measurement is a growing interdisciplinary domain that leverages ubiquitous imaging devices ( e.g. , webcams , smartphones ’ cameras ) to measure vital signs and other physiological processes . Early work established that changes in light reflected from the body could be used to capture subtle variations blood volume and motion related to the photoplethysmogram ( PPG ) ( Takano & Ohta , 2007 ; Verkruysse et al. , 2008 ) and ballistocardiogram ( BCG ) ( Balakrishnan et al. , 2013 ) , respectively . Video analysis enables non-contact , spatial and temporal measurement of arterial and peripheral pulsations and allows for magnification of theses signals ( Wu et al. , 2012 ) , which may help with examination ( e.g. , ( Abnousi et al. , 2019 ) ) . Based on the PPG and BCG signal , heart rate can be extracted ( Poh et al. , 2010b ; Balakrishnan et al. , 2013 ) . However , the relationship between pixels and underlying physiological changes in a video is complex and neural models have shown strong performance compared to source separation techniques ( Chen & McDuff , 2018 ; Yu et al. , 2019 ; Zhan et al. , 2020 ) . Conventional supervised learning requires a large amount of training data to produce a generalized model . However , obtaining a large body of physiological and facial data is complicated and expensive . Current public datasets have limited 1https : //github.com/anonymous0paper/MetaPhys numbers of subjects and diversity in regards of appearance ( including skin type ) , camera sensors , environmental conditions and subject motions . Therefore , if the subject of interest is not in the training data or the video is otherwise different , performance can be considerably degraded , a result that is not acceptable for a physiological sensor . Lee et al . ( Lee et al. , 2020 ) recognized the potential for meta-learning applied to imaging-based cardiac pulse measurement . Their method ( Meta-rPPG ) focuses on using unsupervised meta-learning and a LSTM encoder-decoder architecture which to our knowledge was not validated in previous work . Instead , our proposed meta-learning framework is built on top of a state-of-the-art on-device network ( Liu et al. , 2020 ) and aims to explore the potential of both supervised and unsupervised ondevice personalized meta-learning . Meta-rPPG uses a synthetic gradient generator and a prototypical distance minimizer to perform transductive inference to enable unsupervised meta-learning . This learning mechanism requires a number of rather complex steps . We propose a relatively simpler mechanism that is physiologically and optically grounded ( Wang et al. , 2016 ; Liu et al. , 2020 ) and achieves greater accuracy . Meta-Learning and Person Specific Models : The ability to learn from a small number of samples or observations is often used as an example of the unique capabilities of human intelligence . However , machine learning systems are often brittle in a similar context . Meta-learning approaches tackle this problem by creating a general learner that is able to adapt to a new task with a small number of training samples , inspired by how humans can often master a new skill without many observations ( Hospedales et al. , 2020 ) . However , most of the previous work in meta-learning focuses on supervised vision problems ( Zoph et al. , 2018 ; Snell et al. , 2017 ) and in the computer vision literature has mainly been applied to image analysis ( Vinyals et al. , 2016 ; Li et al. , 2017 ) . Supervised regression in video settings has received less attention . One of few examples is object or face tracking ( Choi et al. , 2019 ; Park & Berg , 2018 ) . In these tasks , the learner needs to adapt to the individual differences in appearance of the target and then track it across frames , even if the appearance changes considerably over time in the video . Choi et al . ( 2019 ) present a matching network architecture providing the meta-learner with information in the form of loss gradients obtained using the training samples . The property of fast adaptation makes meta-learning a good candidate for personalizing models , it has been used in various applications such as dialogue agents ( Madotto et al. , 2019 ) , gaze estimation ( He et al. , 2019 ) , sleep stage classification ( Banluesombatkul et al. , 2020 ) , activity recognition ( Gong et al. , 2019 ) , and video retargeting ( Lee et al. , 2019 ) . For example , Banluesombatkul et al . proposed a MAML-based meta-learning system to perform fast adaption of a sleep stage classification model using biosignals ( Banluesombatkul et al. , 2020 ) . More recently , MetaPix ( Lee et al. , 2019 ) leveraged a meta-learning training schema with a small amount of video to adapt a universal generator to a particular background and human in the problem of video retargeting . Similarly , our proposed meta-learning framework is also capable of personalizing a universal remote physiological model to a new person or an environmental setting . 3 METHOD . 3.1 PHYSIOLOGICAL META-LEARNING . In camera-based cardiac measurement , the goal is to separate pixel changes due to volumetric variations in blood and pulsatile motions from other variations that are not related to the pulse signal . Examples of “ noise ” in this context that might impact the performance on the task include : changes in the environment ( illumination ) and changes in appearance of the subject and motions ( e.g. , facial expressions , rigid head motions ) . A model trained within a traditional supervised learning regime might perform well if illumination , non-pulsatile motions , and appearances in the test set are similar to those in the training set . However , empirical evidence shows that performance usually significantly degrades from one dataset to another , suggesting that traditional training is likely to overfit to the training set to some extent ( Chen & McDuff , 2018 ) . Therefore , to achieve state-of-the-art performance in remote physiological measurement on cross-dataset evaluation , the system should have : 1 ) a good initial representation of the mapping from the raw video data to pulse signal , and 2 ) a strategy for adapting to unseen individuals and environments . To achieve this , we propose a system called MetaPhys , an adaptable meta-learning based on-device framework aimed at efficient and personalized remote physiological sensing . MetaPhys uses a pretrained convolutional attention network as the backbone ( described below ) and leverages a novel personalized meta-learning schema to overcome the aforementioned limitations . We adopt ModelAgnostic Meta-Learning ( MAML ) ( Finn et al. , 2017 ) as our personalized parameter update schema . MAML produces a general initialization as the starting point for fast adaptation to a diverse set of unseen tasks with only a few training samples . However , applying MAML to the task of camera-based physiological measurement has differences to many previously explored meta-learning problems . Existing meta-learning approaches are often evaluated on classification or some toy regression tasks due to the lack of regression benchmark datasets ( Hospedales et al. , 2020 ) . Our problem is a nontrivial vision-based regression task due to the subtle nature of the underlying physiological signal . Algorithm 1 outlines the training process for MetaPhys , we first pretrain the backbone network to get an initial spatial-temporal representation . Then we treat each individual as a task τi . During the training , we split the data into a support set ( K video frames ) and a query set ( K ′ video frames ) for each individual ( task ) . The support set is used to update the task ’ s parameters and yield a personalized model θi . The query set is used to assess the effectiveness of the personalized model and further update the global initialization θ to make future adaptation better . A robust personalized model θi aims to provide a more accurate attention mask to the corresponding motion branch and to preform precise physiological measurement for the target individual as well as the target ’ s environment . During the testing stage , MetaPhys has the updated global initialization θ̂ , and can generate θ̂i for each test individual ( task ) by optimizing the test support set as θ̂τi ← θ̂ − α∇θ̂Lτif ( θ̂ ) . With this training and testing schema , the robust global initialization θ̂ generated from MetaPhys not only leverages the pretrained representation but also learns how to adapt to individual and environmental noise quickly .
The authors propose a system called MetaPhys for personalized remote physiological sensing from videos. Their system combines a pre-trained CNN with an existing meta learning method (MAML). The investigated both supervised and unsupervised training of their system. Performance evaluation of their methods on benchmark datasets show their model significantly outperforms SOTA methods using multiple metrics as well as for different skin types. They further show that the unsupervised model achieves comparable results to the supervised model.
SP:30580fb0f3acf76221f8b031518a30228c4d6162
Stochastic Subset Selection for Efficient Training and Inference of Neural Networks
Current machine learning algorithms are designed to work with huge volumes of high dimensional data such as images . However , these algorithms are being increasingly deployed to resource constrained systems such as mobile devices and embedded systems . Even in cases where large computing infrastructure is available , the size of each data instance , as well as datasets , can provide a huge bottleneck in data transfer across communication channels . Also , there is a huge incentive both in energy and monetary terms in reducing both the computational and memory requirements of these algorithms . For non-parametric models that require to leverage the stored training data at the inference time , the increased cost in memory and computation could be even more problematic . In this work , we aim to reduce the volume of data these algorithms must process through an endto-end two-stage neural subset selection model , where the first stage selects a set of candidate points using a conditionally independent Bernoulli mask followed by an iterative coreset selection via a conditional Categorical distribution . The subset selection model is trained by meta-learning with a distribution of sets . We validate our method on set reconstruction and classification tasks with feature selection as well as the selection of representative samples from a given dataset , on which our method outperforms relevant baselines . We also show in our experiments that our method enhances scalability of non-parametric models such as Neural Processes . 1 INTRODUCTION . The recent success of deep learning algorithms partly owes to the availability of huge volume of data ( Deng et al. , 2009 ; Krizhevsky et al. , 2009 ; Liu et al. , 2015 ) , which enables training of very large deep neural networks . However , the high dimensionality of each data instance and the large size of datasets makes it difficult , especially for resource-limited devices ( Chan et al. , 2018 ; Li et al. , 2019 ; Bhatia et al. , 2019 ) , to store and transfer the dataset , or perform on-device learning with the data . This problem becomes more problematic for non-parametric models such as Neural Processes ( Hensel , 1973 ; Kim et al. , 2019a ) which require the training dataset to be stored for inference . Therefore , it is appealing to reduce the size of the dataset , both at the instance ( Dovrat et al. , 2019 ; Li et al. , 2018b ; b ) and the dataset level , such that we selects only a small number of samples from the dataset , each of which contains only few selected input features ( e.g . pixels ) . Then , we could use the selected subset for the reconstruction of the entire set ( either each instance or the entire dataset ) or for a prediction task , such as classification . The simplest way to obtain such a subset is random sampling , but it is highly sub-optimal in that it treats all elements in the set equally . However , the pixels from each image and examples from each dataset will have varying degree of importance ( Katharopoulos & Fleuret , 2018 ) to a target task , whether it is reconstruction or prediction , and thus random sampling will generally incur large loss of accuracy for the target task . There exist some work on coreset construction ( Huggins et al. , 2016 ; Campbell & Broderick , 2018 ; 2019 ) which proposed to construct a small subset with the most important samples for Bayesian posterior inference . However , these methods can not be applied straightforwardly to deep learning with an arbitrary target task . How can we then sample elements from the given set to construct a subset , such that it suffers from minimal accuracy loss on any target task ? To this end , we propose to learn a sampler that learns to sample the most important samples for a given task , by training it jointly with the target task and additionally meta-learn a sampler over a distribution of datasets for instance selection in the classification task . Specifically , we learn the sampling rate for individual samples in two stages . First we learn a Bernoulli sampling rate for individual sample to efficiently screen out less important elements . Then , to select the most important elements out of this candidate set considering relative importance , we use a Categorical distribution to model the conditional distribution of sampling each element given a set of selected elements . After learning the sampling probability for each stage , we could perform stochastic selection of a given set , with linear time complexity . Our Stochastic Subset Selection ( SSS ) is a general framework to sample elements from a set , and it can be applied to both feature sampling and instance sampling . SSS can reduce the memory and computation cost required to process data while retaining performance on downstream tasks . Our model can benefit from a wide range of practical applications . For example , when sending an image to an edge device with low computing power , instead of sending the entire image , we could send a subset of pixels with their coordinates , which will reduce both communication and inference cost . Similarly , edge devices may need to perform inference on a huge amount of data that could be represented as a set ( e.g . video , point clouds ) in real-time , and our feature selection could be used to speed up the inference . Moreover , our model could also help with on-device learning on personal data ( e.g . photos ) , as it can select out examples to train the model at a reduced cost . Finally , it can help with the scalability of non-parametric models which requires storage of training examples , such as Neural Processes , to scale up to large-scale problems . We validate our SSS model on multiple datasets for 1D function regression and 2D image reconstruction and classification for both feature selection and instance selection . The results show that our method is able to select samples with minimal decrease on the target task accuracy , largely outperforming random or an existing sampling method . Our contribution in this work is threefold : • We propose a novel two-stage stochastic subset selection method that learns to sample a subset from a larger set with linear time complexity , with minimal loss of accuracy at the downstream task . • We propose a framework that trains the subset selection model via meta-learning , such that it can generalize to unseen tasks . • We validate the efficacy and generality of our model on various datasets for feature selection from an instance and instance selection from a dataset , on which it significantly outperforms relevant baselines . 2 RELATED WORK . Set encoding - Permutation invariant networks Recently , extensive research efforts have been made in the area of set representation learning with the goal of obtaining order-invariant ( or equivariant ) and size-invariant representations . Many propose simple methods to obtain set representations by applying non-linear transformations to each element before a pooling layer ( e.g . average pooling or max pooling ) ( Ravanbakhsh et al. , 2016 ; Qi et al. , 2017b ; Zaheer et al. , 2017 ; Sannai et al. , 2019 ) . However , these models are known to have limited expressive power and sometimes not capable of capturing high moments of distributions . Yet approaches such as Stochastic Deep Network ( De Bie et al. , 2018 ) and Set Transformer ( Lee et al. , 2018 ) consider the pairwise ( or higher order ) interactions among set elements and hence can capture more complex statistics of the distributions . These methods often result in higher performance in classification/regression tasks ; however , they have run time complexities of O ( n2 ) or higher . Subset sampling There exist some works which have been proposed to handle large sets . Dovrat et al . ( 2019 ) proposed to learn to sample a subset from a set by generating k virtual points , then matching them back to a subset of the original set . However , such element generation and matching process is highly inefficient . Our method on the other hand only learns to select from the original elements and does not suffer from such overhead . Wang et al . ( 2018 ) proposed to distill the knowledge of a large dataset to a small number of artificial data instances . However , these artificial data instances are only for faster training and doesn ’ t capture the statistics of the original set . Moreover , the instances are generated artificially and can differ from the original set making the method less applicable to other tasks . Also several works ( Qi et al. , 2017a ; c ; Li et al. , 2018b ; Eldar et al. , 1997 ; Moenning & Dodgson , 2003 ) propose farthest point sampling , which selects k points from a set by ensuring that the selected samples are far from each other on a given metric space . Image Compression Due to the huge demand for image and video transfer over the internet , a number of works have attempted to compress images with minimal distortion . These models ( Toderici et al. , 2017 ; Rippel & Bourdev , 2017 ; Mentzer et al. , 2018 ; Li et al. , 2018a ) typically consist of a pair of encoder and decoder , where the encoder will transfer the image into a compact matrix to reduce the memory footprint and communication cost , while the decoder is used to reconstruct the image back . These methods , while achieving huge successes in the image compression problem , are less flexible than ours . Firstly , our model can be applied to any type of sets ( and instances represented as sets ) , while the aforementioned models mainly work for images represented in tensor form . Furthermore , our method can be applied both at the instance and dataset level . Representation learning Our instance-sampling model is also related to the Variational Auto Encoder ( VAE ) ( Kingma & Welling , 2013 ) . However , while VAE learns a compact representation of a data point , our model learns a compact representation of a set . Balın et al . ( 2019 ) learns a global feature selection model for reconstruction of the input data from selected features via unsupervised learning . Chen et al . ( 2018 ) learns instancewise feature selection with the goal of model interpretation by extracting subset of features most informative for a given sample . Our method also falls in this category . Active Learning Active learning methods are aimed at selection of data points for labeling given a small labelled set . This domain is different from our method since active learning does not consider the label information but our method does utilize label information . Also , our motivation is quite different . We focus on efficiency in inference and training of non-parametric models by reducing the sizes of the inputs , be it pixels or instances and this greatly differs from the goal of active learning . Methods such as ( Sener & Savarese , 2017 ; Coleman et al. , 2019 ; Wei et al. , 2015 ) all tackle the data selection problem in the active learning setting . 3 APPROACH . 3.1 PRELIMINARIES . In this work , we consider data of the type D = { d1 , . . . , dn } where individual di ’ s are possibly represented as input xi and target yi . D is the complete set and we assume that within D , there exists a subset Ds = { si , . . . , sk } ⊂ D such that k n and that for an arbitrarily defined loss function ` ( . , D ) that we are interested in optimizing over the full set D , Ds can be used as a proxy for D such that ` ( . , D ) ≈ ` ( . , Ds ) . In what follows , we present a method that learns the conditional distribution p ( Ds|D ) of the subsetDs via a two stage selection procedure dubbed candidate selection and autoregressive subset selection . The overall objective is then to minimize the loss function with respect to the subset Ds , Ep ( Ds|D ) [ ` ( . , Ds ) ] . When the set D itself follows a distribution of sets as in the meta-learning framework , then the objective becomes ED [ Ep ( Ds|D ) [ ` ( . , Ds ) ] ] . In essence , we seek to construct a subset Ds that is optimally representative of the full set D w.r.t ` ( . ) .
This paper proposes a stochastic subset selection method for reducing the storage / transmission cost of datasets. The proposes method minimizes the expected loss over selected datasets. The data selection algorithm consists a candidate selection stage and an autoregressive selection stage, parameterized with neural networks, and are trainable by gradient methods. The authors formulate and tested their approach on four tasks. The problem formulation and methodology are technically sound. The proposed method also seems to be more general than competing methods, such as coreset.
SP:adf55a0c96d1e5ffb8016b8bec41aa0caca79793
Stochastic Subset Selection for Efficient Training and Inference of Neural Networks
Current machine learning algorithms are designed to work with huge volumes of high dimensional data such as images . However , these algorithms are being increasingly deployed to resource constrained systems such as mobile devices and embedded systems . Even in cases where large computing infrastructure is available , the size of each data instance , as well as datasets , can provide a huge bottleneck in data transfer across communication channels . Also , there is a huge incentive both in energy and monetary terms in reducing both the computational and memory requirements of these algorithms . For non-parametric models that require to leverage the stored training data at the inference time , the increased cost in memory and computation could be even more problematic . In this work , we aim to reduce the volume of data these algorithms must process through an endto-end two-stage neural subset selection model , where the first stage selects a set of candidate points using a conditionally independent Bernoulli mask followed by an iterative coreset selection via a conditional Categorical distribution . The subset selection model is trained by meta-learning with a distribution of sets . We validate our method on set reconstruction and classification tasks with feature selection as well as the selection of representative samples from a given dataset , on which our method outperforms relevant baselines . We also show in our experiments that our method enhances scalability of non-parametric models such as Neural Processes . 1 INTRODUCTION . The recent success of deep learning algorithms partly owes to the availability of huge volume of data ( Deng et al. , 2009 ; Krizhevsky et al. , 2009 ; Liu et al. , 2015 ) , which enables training of very large deep neural networks . However , the high dimensionality of each data instance and the large size of datasets makes it difficult , especially for resource-limited devices ( Chan et al. , 2018 ; Li et al. , 2019 ; Bhatia et al. , 2019 ) , to store and transfer the dataset , or perform on-device learning with the data . This problem becomes more problematic for non-parametric models such as Neural Processes ( Hensel , 1973 ; Kim et al. , 2019a ) which require the training dataset to be stored for inference . Therefore , it is appealing to reduce the size of the dataset , both at the instance ( Dovrat et al. , 2019 ; Li et al. , 2018b ; b ) and the dataset level , such that we selects only a small number of samples from the dataset , each of which contains only few selected input features ( e.g . pixels ) . Then , we could use the selected subset for the reconstruction of the entire set ( either each instance or the entire dataset ) or for a prediction task , such as classification . The simplest way to obtain such a subset is random sampling , but it is highly sub-optimal in that it treats all elements in the set equally . However , the pixels from each image and examples from each dataset will have varying degree of importance ( Katharopoulos & Fleuret , 2018 ) to a target task , whether it is reconstruction or prediction , and thus random sampling will generally incur large loss of accuracy for the target task . There exist some work on coreset construction ( Huggins et al. , 2016 ; Campbell & Broderick , 2018 ; 2019 ) which proposed to construct a small subset with the most important samples for Bayesian posterior inference . However , these methods can not be applied straightforwardly to deep learning with an arbitrary target task . How can we then sample elements from the given set to construct a subset , such that it suffers from minimal accuracy loss on any target task ? To this end , we propose to learn a sampler that learns to sample the most important samples for a given task , by training it jointly with the target task and additionally meta-learn a sampler over a distribution of datasets for instance selection in the classification task . Specifically , we learn the sampling rate for individual samples in two stages . First we learn a Bernoulli sampling rate for individual sample to efficiently screen out less important elements . Then , to select the most important elements out of this candidate set considering relative importance , we use a Categorical distribution to model the conditional distribution of sampling each element given a set of selected elements . After learning the sampling probability for each stage , we could perform stochastic selection of a given set , with linear time complexity . Our Stochastic Subset Selection ( SSS ) is a general framework to sample elements from a set , and it can be applied to both feature sampling and instance sampling . SSS can reduce the memory and computation cost required to process data while retaining performance on downstream tasks . Our model can benefit from a wide range of practical applications . For example , when sending an image to an edge device with low computing power , instead of sending the entire image , we could send a subset of pixels with their coordinates , which will reduce both communication and inference cost . Similarly , edge devices may need to perform inference on a huge amount of data that could be represented as a set ( e.g . video , point clouds ) in real-time , and our feature selection could be used to speed up the inference . Moreover , our model could also help with on-device learning on personal data ( e.g . photos ) , as it can select out examples to train the model at a reduced cost . Finally , it can help with the scalability of non-parametric models which requires storage of training examples , such as Neural Processes , to scale up to large-scale problems . We validate our SSS model on multiple datasets for 1D function regression and 2D image reconstruction and classification for both feature selection and instance selection . The results show that our method is able to select samples with minimal decrease on the target task accuracy , largely outperforming random or an existing sampling method . Our contribution in this work is threefold : • We propose a novel two-stage stochastic subset selection method that learns to sample a subset from a larger set with linear time complexity , with minimal loss of accuracy at the downstream task . • We propose a framework that trains the subset selection model via meta-learning , such that it can generalize to unseen tasks . • We validate the efficacy and generality of our model on various datasets for feature selection from an instance and instance selection from a dataset , on which it significantly outperforms relevant baselines . 2 RELATED WORK . Set encoding - Permutation invariant networks Recently , extensive research efforts have been made in the area of set representation learning with the goal of obtaining order-invariant ( or equivariant ) and size-invariant representations . Many propose simple methods to obtain set representations by applying non-linear transformations to each element before a pooling layer ( e.g . average pooling or max pooling ) ( Ravanbakhsh et al. , 2016 ; Qi et al. , 2017b ; Zaheer et al. , 2017 ; Sannai et al. , 2019 ) . However , these models are known to have limited expressive power and sometimes not capable of capturing high moments of distributions . Yet approaches such as Stochastic Deep Network ( De Bie et al. , 2018 ) and Set Transformer ( Lee et al. , 2018 ) consider the pairwise ( or higher order ) interactions among set elements and hence can capture more complex statistics of the distributions . These methods often result in higher performance in classification/regression tasks ; however , they have run time complexities of O ( n2 ) or higher . Subset sampling There exist some works which have been proposed to handle large sets . Dovrat et al . ( 2019 ) proposed to learn to sample a subset from a set by generating k virtual points , then matching them back to a subset of the original set . However , such element generation and matching process is highly inefficient . Our method on the other hand only learns to select from the original elements and does not suffer from such overhead . Wang et al . ( 2018 ) proposed to distill the knowledge of a large dataset to a small number of artificial data instances . However , these artificial data instances are only for faster training and doesn ’ t capture the statistics of the original set . Moreover , the instances are generated artificially and can differ from the original set making the method less applicable to other tasks . Also several works ( Qi et al. , 2017a ; c ; Li et al. , 2018b ; Eldar et al. , 1997 ; Moenning & Dodgson , 2003 ) propose farthest point sampling , which selects k points from a set by ensuring that the selected samples are far from each other on a given metric space . Image Compression Due to the huge demand for image and video transfer over the internet , a number of works have attempted to compress images with minimal distortion . These models ( Toderici et al. , 2017 ; Rippel & Bourdev , 2017 ; Mentzer et al. , 2018 ; Li et al. , 2018a ) typically consist of a pair of encoder and decoder , where the encoder will transfer the image into a compact matrix to reduce the memory footprint and communication cost , while the decoder is used to reconstruct the image back . These methods , while achieving huge successes in the image compression problem , are less flexible than ours . Firstly , our model can be applied to any type of sets ( and instances represented as sets ) , while the aforementioned models mainly work for images represented in tensor form . Furthermore , our method can be applied both at the instance and dataset level . Representation learning Our instance-sampling model is also related to the Variational Auto Encoder ( VAE ) ( Kingma & Welling , 2013 ) . However , while VAE learns a compact representation of a data point , our model learns a compact representation of a set . Balın et al . ( 2019 ) learns a global feature selection model for reconstruction of the input data from selected features via unsupervised learning . Chen et al . ( 2018 ) learns instancewise feature selection with the goal of model interpretation by extracting subset of features most informative for a given sample . Our method also falls in this category . Active Learning Active learning methods are aimed at selection of data points for labeling given a small labelled set . This domain is different from our method since active learning does not consider the label information but our method does utilize label information . Also , our motivation is quite different . We focus on efficiency in inference and training of non-parametric models by reducing the sizes of the inputs , be it pixels or instances and this greatly differs from the goal of active learning . Methods such as ( Sener & Savarese , 2017 ; Coleman et al. , 2019 ; Wei et al. , 2015 ) all tackle the data selection problem in the active learning setting . 3 APPROACH . 3.1 PRELIMINARIES . In this work , we consider data of the type D = { d1 , . . . , dn } where individual di ’ s are possibly represented as input xi and target yi . D is the complete set and we assume that within D , there exists a subset Ds = { si , . . . , sk } ⊂ D such that k n and that for an arbitrarily defined loss function ` ( . , D ) that we are interested in optimizing over the full set D , Ds can be used as a proxy for D such that ` ( . , D ) ≈ ` ( . , Ds ) . In what follows , we present a method that learns the conditional distribution p ( Ds|D ) of the subsetDs via a two stage selection procedure dubbed candidate selection and autoregressive subset selection . The overall objective is then to minimize the loss function with respect to the subset Ds , Ep ( Ds|D ) [ ` ( . , Ds ) ] . When the set D itself follows a distribution of sets as in the meta-learning framework , then the objective becomes ED [ Ep ( Ds|D ) [ ` ( . , Ds ) ] ] . In essence , we seek to construct a subset Ds that is optimally representative of the full set D w.r.t ` ( . ) .
This work introduces a method to select instances from any set (stochastic subset selection, or SSS). The experiments demonstrate a diverse set of use-cases, including feature selection and core-set selection. The proposed approach is a two-stage method involving candidate selection (learning a function $\rho$ to determine a Bernoulli probability for each input) and AutoRegressive subset selection (learning a function $f$ to generate probabilities for sampling elements from a reduced set); both stages use the Concrete distribution to ensure differentiability.
SP:adf55a0c96d1e5ffb8016b8bec41aa0caca79793
On the Dynamic Regret of Online Multiple Mirror Descent
1 INTRODUCTION . Online optimization refers to the design of sequential decisions where system parameters and cost functions vary with time . It has applications to various classes of problems , such as object tracking ( Shahrampour & Jadbabaie , 2017 ) , networking ( Shi et al. , 2018 ) , cloud computing ( Lin et al. , 2012 ) , and classification ( Crammer et al. , 2006 ) . It is also an important tool in the development of algorithms for reinforcement learning ( Yuan & Lamperski , 2017 ) and deep learning ( Mnih et al. , 2015 ) . In this work , we consider online convex optimization , which can be formulated as a discrete-time sequential learning process as follows . At each round t , the learner first makes a decision xt ∈ X , where X is a convex set representing the solution space . The learner then receives a convex cost function ft ( x ) : X → R and suffers the corresponding cost of ft ( xt ) associated with the submitted decision . The goal of the online learner is to minimize the total accrued cost over a finite number of rounds , denoted by T . For performance evaluation , prior studies on online learning often focus on the static regret , defined as the difference between the learner ’ s accumulated cost and that of an optimal fixed offline decision , which is made in hindsight with knowledge of ft ( · ) for all t : RegsT = T∑ t=1 ft ( xt ) −min x∈X T∑ t=1 ft ( x ) . A successful online algorithm closes the gap between the online decisions and the offline counterpart when normalized by T , i.e. , sustaining sublinear static regret in T . In the literature , there are various online algorithms ( Zinkevich , 2003 ; Cesa-Bianchi & Lugosi , 2006 ; Hazan et al. , 2006 ; Duchi et al. , 2010 ; Shalev-Shwartz , 2012 ) that guarantee a sublinear bound on the static regret . However , algorithms that guarantee performance close to that of a static decision may still perform poorly in dynamic settings . Consequently , the static regret fails to accurately reflect the quality of decisions in many practical scenarios . Therefore , the dynamic regret has become a popular metric in recent works ( Besbes et al. , 2015 ; Mokhtari et al. , 2016 ; Yang et al. , 2016 ; Zhang et al. , 2017 ) , which allows a dynamic sequence of comparison targets and is defined by RegdT = T∑ t=1 ft ( xt ) − T∑ t=1 ft ( x ∗ t ) , where x∗t = argminx∈X ft ( x ) is a minimizer of the cost at round t. It is well-known that the online optimization problem may be intractable in a dynamic setting , due to arbitrary fluctuation in the cost functions . Hence , achieving a sublinear bound on the dynamic regret may be impossible . However , it is possible to upper bound the dynamic regret in terms of certain regularity measures . One of the measures to represent regularity is the path length , defined by CT = T∑ t=2 ‖x∗t − x∗t−1‖ , ( 1 ) which illustrates the accumulative variation in the minimizer sequence . For instance , the dynamic regret of online gradient descent for convex cost functions can be bounded by O ( √ T ( 1 + CT ) ) ( Zinkevich , 2003 ) . 1 For strongly convex functions , the dynamic regret of online gradient descent can be reduced to O ( CT ) ( Mokhtari et al. , 2016 ) . When the cost functions are smooth and strongly convex , by allowing the learner to make multiple queries to the gradient of the cost functions , the regret bound can be further improved to O ( min ( CT , ST ) ) , where ST represents the squared path length , defined by ST = T∑ t=2 ‖x∗t − x∗t−1‖2 , ( 2 ) which can be smaller than the path length when the distance between successive minimizers is small . All the aforementioned studies require the cost functions to be Lipschitz continuous . However , there are many commonly used cost functions , e.g. , the quadratic function that do not meet the Lipschitz condition . In addition , the above works rely on measuring distances using Euclidean norms , which hinders the projection step in gradient descent update for some constraint sets , e.g. , probability simplex ( Duchi , 2018 ) . Besides gradient descent , mirror descent is another well-known technique of online convex optimization ( Hall & Willett , 2015 ; Jadbabaie et al. , 2015 ) . Mirror descent uses the Bregman divergence , which generalizes the Euclidean norm used in the projection step of gradient descent , thus acquiring expanded applicability to a broader range of problems . In addition , the Bregman divergence is only mildly dependent on the dimension of decision variables ( Beck & Teboulle , 2003 ; Nemirovsky & Yudin , 1983 ) , so that mirror descent is optimal among first-order methods when the decision variables have high dimensions ( Duchi et al. , 2010 ) . In this work we focus on the mirror descent approach . In previous works on online mirror descent , the learner queries the gradient of each cost function only once , and performs one step of mirror descent to update its decision ( Hall & Willett , 2015 ; Shahrampour & Jadbabaie , 2017 ) . In this case , the dynamic regret has an upper bound of order O ( √ T ( 1 + CT ) ) , which is the same as that of online gradient descent in ( Zinkevich , 2003 ) . In this work , we investigate whether it is possible to improve the dynamic regret when the learner performs multiple mirror descent steps in each online round , while relaxing the Lipschitz continuity condition on the cost functions . To this end , we analyze the performance of the Online Multiple Mirror Descent ( OMMD ) algorithm , which uses multiple steps of mirror descent per online round . When the cost functions are smooth and strongly convex , we show that the upper bound on the dynamic regret can be reduced from 1A more general definition of the dynamic regret was introduced in ( Zinkevich , 2003 ) , which allows comparison against an arbitrary sequence { ut } Tt=1 . We note that the regret bounds developed in ( Zinkevich , 2003 ) also hold for the specific case of ut = x∗t . O ( √ T ( 1 + CT ) ) to O ( min ( CT , ST , GT ) ) , where GT represent the sum squared gradients , i.e. , GT = T∑ t=1 ‖∇ft ( xt ) ‖2∗ , ( 3 ) where ‖.‖∗ denotes the dual norm . The sum squared gradients GT can be smaller than both the path length and squared path length , especially when the cost functions fluctuate drastically over time . In contrast to the aforementioned works , our analysis does not require the cost functions to be Lipschitz continuous . Furthermore , our numerical experiments suggest substantially reduced dynamic regret compared with the best known alternatives , including single-step dynamic mirror descent ( Hall & Willett , 2015 ) , online multiple gradient descent ( Zhang et al. , 2017 ) , and online gradient descent Zinkevich ( 2003 ) . 2 ONLINE MULTIPLE MIRROR DESCENT . In this section , we describe OMMD and discuss how the learner can improve the dynamic regret by performing multiple mirror descent steps per round . Before delving into the details , we proceed by stating several definitions and standard assumptions . 2.1 PRELIMINARIES . Definition 1 : The Bregman divergence with respect to the regularization function r ( · ) is defined as Dr ( x , y ) = r ( x ) − r ( y ) − 〈∇r ( y ) , x− y〉 . The Bregman divergence is a general distance-measuring function , which contains the Euclidean norm and the Kullback-Leibler divergence as two special cases . Using the Bregman divergence , a generalized definition of strong convexity is given in ( ShalevShwartz & Singer , 2007 ) . Definition 2 : A convex function f ( · ) is λ-strongly convex with respect to a convex and differentiable function r ( · ) if f ( y ) + 〈∇f ( y ) , x− y〉+ λDr ( x , y ) ≤ f ( x ) , ∀x , y ∈ X . Following many prior studies on mirror descent , we assume that the cost functions are λ-strongly convex , where the above generalized strong convexity definition is used . We further assume that the cost functions are L-smooth , and the regularization function r ( · ) is Lr-smooth and 1-strongly convex with respect to some norm ( refer to App . A for definitions ) . We note that these are standard assumptions commonly used in the literature after the group of studies began by ( Hazan et al. , 2006 ; Shalev-Shwartz & Singer , 2007 ) , to provide stronger regret bounds by constraining the curvature of cost functions . We further make a standard assumption that the Bregman divergence is Lipschitz continuous as follows : |Dr ( x , z ) −Dr ( y , z ) | ≤ K‖x− y‖ , ∀x , y , z ∈ X , where K is a positive constant . We note that this condition is much milder than the condition of Lipschitz continuous cost functions required in ( Zhang et al. , 2017 ; Mokhtari et al. , 2016 ; Hall & Willett , 2015 ) . There is a notable weakness in such bounds . Since the sequence of cost functions are revealed to the learner , the learner has no control over it . If these cost functions happen to not meet the Lipschitz condition , earlier analyses that require this condition become inapplicable . In this work , we do not require the cost functions to be Lipschitz continuous . Instead , we move the Lipschitz continuity condition from the cost functions to the Bregman divergence to broaden the application of our work . The main benefit of this is that the regularization function and the corresponding Bregman divergence is within the control of the learner . The learner can carefully design this regularization function to satisfy the Lipschitz continuity of the associated Bregman divergence with a small factor . For example , in the particular case of the KL divergence , which is obtained by the choosing negative entropy as the regularization function , on the set X = { x| ∑d i=1 xi = 1 ; xi ≥ 1 D } , the constant K is of O ( logD ) . Other examples of many widely used Bregman divergences that satisfy this condition are given in ( Bauschke & Borwein , 2001 ) . Algorithm 1 Online Multiple Mirror Descent Input : Arbitrary initialization of x1 ∈ X ; step size α ; time horizon T . Output : Sequence of decisions { xt : 1 ≤ t ≤ T } . 1 : for t = 1 , 2 , . . . , T do 2 : submit xt ∈ X and receive ft ( · ) 3 : set y1t = xt 4 : for i = 1 , 2 , . . . , M do 5 : yi+1t = argminy∈X { 〈∇ft ( yit ) , y〉+ 1αDr ( y , y i t ) } 6 : end for 7 : set xt+1 = yM+1t 8 : end for
This paper studies the dynamic regret of online multiple mirror descent, which is online mirror descent with M repeated steps on each of T sequential loss functions. The authors show three bounds for the dynamic regret of OMMD, which generalizes OMGD [Zhang et al. '17]: C_T (the path length of the minimizer sequence), S_T (the sum of squared segment lengths), and G_T (the squared dual gradient norm of the points played).
SP:874a441d5c5c7582a1d548bc5d0c635ed032434f
On the Dynamic Regret of Online Multiple Mirror Descent
1 INTRODUCTION . Online optimization refers to the design of sequential decisions where system parameters and cost functions vary with time . It has applications to various classes of problems , such as object tracking ( Shahrampour & Jadbabaie , 2017 ) , networking ( Shi et al. , 2018 ) , cloud computing ( Lin et al. , 2012 ) , and classification ( Crammer et al. , 2006 ) . It is also an important tool in the development of algorithms for reinforcement learning ( Yuan & Lamperski , 2017 ) and deep learning ( Mnih et al. , 2015 ) . In this work , we consider online convex optimization , which can be formulated as a discrete-time sequential learning process as follows . At each round t , the learner first makes a decision xt ∈ X , where X is a convex set representing the solution space . The learner then receives a convex cost function ft ( x ) : X → R and suffers the corresponding cost of ft ( xt ) associated with the submitted decision . The goal of the online learner is to minimize the total accrued cost over a finite number of rounds , denoted by T . For performance evaluation , prior studies on online learning often focus on the static regret , defined as the difference between the learner ’ s accumulated cost and that of an optimal fixed offline decision , which is made in hindsight with knowledge of ft ( · ) for all t : RegsT = T∑ t=1 ft ( xt ) −min x∈X T∑ t=1 ft ( x ) . A successful online algorithm closes the gap between the online decisions and the offline counterpart when normalized by T , i.e. , sustaining sublinear static regret in T . In the literature , there are various online algorithms ( Zinkevich , 2003 ; Cesa-Bianchi & Lugosi , 2006 ; Hazan et al. , 2006 ; Duchi et al. , 2010 ; Shalev-Shwartz , 2012 ) that guarantee a sublinear bound on the static regret . However , algorithms that guarantee performance close to that of a static decision may still perform poorly in dynamic settings . Consequently , the static regret fails to accurately reflect the quality of decisions in many practical scenarios . Therefore , the dynamic regret has become a popular metric in recent works ( Besbes et al. , 2015 ; Mokhtari et al. , 2016 ; Yang et al. , 2016 ; Zhang et al. , 2017 ) , which allows a dynamic sequence of comparison targets and is defined by RegdT = T∑ t=1 ft ( xt ) − T∑ t=1 ft ( x ∗ t ) , where x∗t = argminx∈X ft ( x ) is a minimizer of the cost at round t. It is well-known that the online optimization problem may be intractable in a dynamic setting , due to arbitrary fluctuation in the cost functions . Hence , achieving a sublinear bound on the dynamic regret may be impossible . However , it is possible to upper bound the dynamic regret in terms of certain regularity measures . One of the measures to represent regularity is the path length , defined by CT = T∑ t=2 ‖x∗t − x∗t−1‖ , ( 1 ) which illustrates the accumulative variation in the minimizer sequence . For instance , the dynamic regret of online gradient descent for convex cost functions can be bounded by O ( √ T ( 1 + CT ) ) ( Zinkevich , 2003 ) . 1 For strongly convex functions , the dynamic regret of online gradient descent can be reduced to O ( CT ) ( Mokhtari et al. , 2016 ) . When the cost functions are smooth and strongly convex , by allowing the learner to make multiple queries to the gradient of the cost functions , the regret bound can be further improved to O ( min ( CT , ST ) ) , where ST represents the squared path length , defined by ST = T∑ t=2 ‖x∗t − x∗t−1‖2 , ( 2 ) which can be smaller than the path length when the distance between successive minimizers is small . All the aforementioned studies require the cost functions to be Lipschitz continuous . However , there are many commonly used cost functions , e.g. , the quadratic function that do not meet the Lipschitz condition . In addition , the above works rely on measuring distances using Euclidean norms , which hinders the projection step in gradient descent update for some constraint sets , e.g. , probability simplex ( Duchi , 2018 ) . Besides gradient descent , mirror descent is another well-known technique of online convex optimization ( Hall & Willett , 2015 ; Jadbabaie et al. , 2015 ) . Mirror descent uses the Bregman divergence , which generalizes the Euclidean norm used in the projection step of gradient descent , thus acquiring expanded applicability to a broader range of problems . In addition , the Bregman divergence is only mildly dependent on the dimension of decision variables ( Beck & Teboulle , 2003 ; Nemirovsky & Yudin , 1983 ) , so that mirror descent is optimal among first-order methods when the decision variables have high dimensions ( Duchi et al. , 2010 ) . In this work we focus on the mirror descent approach . In previous works on online mirror descent , the learner queries the gradient of each cost function only once , and performs one step of mirror descent to update its decision ( Hall & Willett , 2015 ; Shahrampour & Jadbabaie , 2017 ) . In this case , the dynamic regret has an upper bound of order O ( √ T ( 1 + CT ) ) , which is the same as that of online gradient descent in ( Zinkevich , 2003 ) . In this work , we investigate whether it is possible to improve the dynamic regret when the learner performs multiple mirror descent steps in each online round , while relaxing the Lipschitz continuity condition on the cost functions . To this end , we analyze the performance of the Online Multiple Mirror Descent ( OMMD ) algorithm , which uses multiple steps of mirror descent per online round . When the cost functions are smooth and strongly convex , we show that the upper bound on the dynamic regret can be reduced from 1A more general definition of the dynamic regret was introduced in ( Zinkevich , 2003 ) , which allows comparison against an arbitrary sequence { ut } Tt=1 . We note that the regret bounds developed in ( Zinkevich , 2003 ) also hold for the specific case of ut = x∗t . O ( √ T ( 1 + CT ) ) to O ( min ( CT , ST , GT ) ) , where GT represent the sum squared gradients , i.e. , GT = T∑ t=1 ‖∇ft ( xt ) ‖2∗ , ( 3 ) where ‖.‖∗ denotes the dual norm . The sum squared gradients GT can be smaller than both the path length and squared path length , especially when the cost functions fluctuate drastically over time . In contrast to the aforementioned works , our analysis does not require the cost functions to be Lipschitz continuous . Furthermore , our numerical experiments suggest substantially reduced dynamic regret compared with the best known alternatives , including single-step dynamic mirror descent ( Hall & Willett , 2015 ) , online multiple gradient descent ( Zhang et al. , 2017 ) , and online gradient descent Zinkevich ( 2003 ) . 2 ONLINE MULTIPLE MIRROR DESCENT . In this section , we describe OMMD and discuss how the learner can improve the dynamic regret by performing multiple mirror descent steps per round . Before delving into the details , we proceed by stating several definitions and standard assumptions . 2.1 PRELIMINARIES . Definition 1 : The Bregman divergence with respect to the regularization function r ( · ) is defined as Dr ( x , y ) = r ( x ) − r ( y ) − 〈∇r ( y ) , x− y〉 . The Bregman divergence is a general distance-measuring function , which contains the Euclidean norm and the Kullback-Leibler divergence as two special cases . Using the Bregman divergence , a generalized definition of strong convexity is given in ( ShalevShwartz & Singer , 2007 ) . Definition 2 : A convex function f ( · ) is λ-strongly convex with respect to a convex and differentiable function r ( · ) if f ( y ) + 〈∇f ( y ) , x− y〉+ λDr ( x , y ) ≤ f ( x ) , ∀x , y ∈ X . Following many prior studies on mirror descent , we assume that the cost functions are λ-strongly convex , where the above generalized strong convexity definition is used . We further assume that the cost functions are L-smooth , and the regularization function r ( · ) is Lr-smooth and 1-strongly convex with respect to some norm ( refer to App . A for definitions ) . We note that these are standard assumptions commonly used in the literature after the group of studies began by ( Hazan et al. , 2006 ; Shalev-Shwartz & Singer , 2007 ) , to provide stronger regret bounds by constraining the curvature of cost functions . We further make a standard assumption that the Bregman divergence is Lipschitz continuous as follows : |Dr ( x , z ) −Dr ( y , z ) | ≤ K‖x− y‖ , ∀x , y , z ∈ X , where K is a positive constant . We note that this condition is much milder than the condition of Lipschitz continuous cost functions required in ( Zhang et al. , 2017 ; Mokhtari et al. , 2016 ; Hall & Willett , 2015 ) . There is a notable weakness in such bounds . Since the sequence of cost functions are revealed to the learner , the learner has no control over it . If these cost functions happen to not meet the Lipschitz condition , earlier analyses that require this condition become inapplicable . In this work , we do not require the cost functions to be Lipschitz continuous . Instead , we move the Lipschitz continuity condition from the cost functions to the Bregman divergence to broaden the application of our work . The main benefit of this is that the regularization function and the corresponding Bregman divergence is within the control of the learner . The learner can carefully design this regularization function to satisfy the Lipschitz continuity of the associated Bregman divergence with a small factor . For example , in the particular case of the KL divergence , which is obtained by the choosing negative entropy as the regularization function , on the set X = { x| ∑d i=1 xi = 1 ; xi ≥ 1 D } , the constant K is of O ( logD ) . Other examples of many widely used Bregman divergences that satisfy this condition are given in ( Bauschke & Borwein , 2001 ) . Algorithm 1 Online Multiple Mirror Descent Input : Arbitrary initialization of x1 ∈ X ; step size α ; time horizon T . Output : Sequence of decisions { xt : 1 ≤ t ≤ T } . 1 : for t = 1 , 2 , . . . , T do 2 : submit xt ∈ X and receive ft ( · ) 3 : set y1t = xt 4 : for i = 1 , 2 , . . . , M do 5 : yi+1t = argminy∈X { 〈∇ft ( yit ) , y〉+ 1αDr ( y , y i t ) } 6 : end for 7 : set xt+1 = yM+1t 8 : end for
This work derives a new upper bound on the dynamic regret for online convex optimization in the restricted setting where the comparison sequence is made up of the minimizers x^_1,...,x*_T of the loss sequence. There are three main parameters that control regret in this case: the path length C_T = ||x*_2-x*_1||+...+||x*_T-x*_{T-1}||. The squared path length C_T = ||x*_2-x*_1||^2+...+||x*_T-x*_{T-1}||^2. And the sum G_T of squared loss gradient norms evaluated at x*_1,...,x*_T.
SP:874a441d5c5c7582a1d548bc5d0c635ed032434f
Learning perturbation sets for robust machine learning
1 INTRODUCTION . Within the last decade , adversarial learning has become a core research area for studying robustness and machine learning . Adversarial attacks have expanded well beyond the original setting of imperceptible noise to more general notions of robustness , and can broadly be described as capturing sets of perturbations that humans are naturally invariant to . These invariants , such as facial recognition should be robust to adversarial glasses ( Sharif et al. , 2019 ) or traffic sign classification should be robust to adversarial graffiti ( Eykholt et al. , 2018 ) , form the motivation behind many real world adversarial attacks . However , human invariants can also include notions which are not inherently adversarial , for example image classifiers should be robust to common image corruptions ( Hendrycks & Dietterich , 2019 ) as well as changes in weather patterns ( Michaelis et al. , 2019 ) . On the other hand , although there has been much success in defending against small adversarial perturbations , most successful and principled methods for learning robust models are limited to human invariants that can be characterized using mathematically defined perturbation sets , for example perturbations bounded in ` p norm . After all , established guidelines for evaluating adversarial robustness ( Carlini et al. , 2019 ) have emphasized the importance of the perturbation set ( or the threat model ) as a necessary component for performing proper , scientific evaluations of adversarial defense proposals . However , this requirement makes it difficult to learn models which are robust to human invariants beyond these mathematical sets , where real world attacks and general notions of robustness can often be virtually impossible to write down as a formal set of equations . This incompatibility between existing methods for learning robust models and real-world , human invariants raises a fundamental question for the field of robust machine learning : How can we learn models that are robust to perturbations without a predefined perturbation set ? In the absence of a mathematical definition , in this work we present a general framework for learning perturbation sets from perturbed data . More concretely , given pairs of examples where one is a perturbed version of the other , we propose learning generative models that can “ perturb ” an example by varying a fixed region of the underlying latent space . The resulting perturbation sets are welldefined and can naturally be used in robust training and evaluation tasks . The approach is widely applicable to a range of robustness settings , as we make no assumptions on the type of perturbation being learned : the only requirement is to collect pairs of perturbed examples . Given the susceptibility of deep learning to adversarial examples , such a perturbation set will undoubtedly come under intense scrutiny , especially if it is to be used as a threat model for adversarial attacks . In this paper , we begin our theoretical contributions with a broad discussion of perturbation sets and formulate deterministic and probabilistic properties that a learned perturbation set should have in order to be a meaningful proxy for the true underlying perturbation set . The necessary subset property ensures that the set captures real perturbations , properly motivating its usage as an adversarial threat model . The sufficient likelihood property ensures that real perturbations have high probability , which motivates sampling from a perturbation set as a form of data augmentation . We then prove the main theoretical result , that a learned perturbation set defined by the decoder and prior of a conditional variational autoencoder ( CVAE ) ( Sohn et al. , 2015 ) implies both of these properties , providing a theoretically grounded framework for learning perturbation sets . The resulting CVAE perturbation sets are well motivated , can leverage standard architectures , and are computationally efficient with little tuning required . We highlight the versatility of our approach using CVAEs with an array of experiments , where we vary the complexity and scale of the datasets , perturbations , and downstream tasks . We first demonstrate how the approach can learn basic ` ∞ and rotation-translation-skew ( RTS ) perturbations ( Jaderberg et al. , 2015 ) in the MNIST setting . Since these sets can be mathematically defined , our goal is simply to measure exactly how well the learned perturbation set captures the target perturbation set on baseline tasks where the ground truth is known . We next look at a more difficult setting which can not be mathematically defined , and learn a perturbation set for common image corruptions on CIFAR10 ( Hendrycks & Dietterich , 2019 ) . The resulting perturbation set can interpolate between common corruptions , produce diverse samples , and be used in adversarial training and randomized smoothing frameworks . The adversarially trained models have improved generalization performance to both in- and out-of-distribution corruptions and better robustness to adversarial corruptions . In our final setting , we learn a perturbation set that captures real-world variations in lighting using a multi-illumination dataset of scenes captured “ in the wild ” ( Murmann et al. , 2019 ) . The perturbation set generates meaningful lighting samples and interpolations while generalizing to unseen scenes , and can be used to learn image segmentation models that are empirically and certifiably robust to lighting changes . All code and configuration files for reproducing the experiments as well as pretrained model weights for both the learned perturbation sets as well as the downstream robust classifiers are at https : //github.com/locuslab/perturbation_learning . 2 BACKGROUND AND RELATED WORK . Perturbation sets for adversarial threat models Adversarial examples were initially defined as imperceptible examples with small ` 1 , ` 2 and ` ∞ norm ( Biggio et al. , 2013 ; Szegedy et al. , 2013 ; Goodfellow et al. , 2014 ) , forming the earliest known , well-defined perturbation sets that were eventually generalized to the union of multiple ` p perturbations ( Tramèr & Boneh , 2019 ; Maini et al. , 2019 ; Croce & Hein , 2019 ; Stutz et al. , 2019 ) . Alternative perturbation sets to the ` p setting that remain well-defined incorporate more structure and semantic meaning , such as rotations and translations ( Engstrom et al. , 2017 ) , Wasserstein balls ( Wong et al. , 2019 ) , functional perturbations ( Laidlaw & Feizi , 2019 ) , distributional shifts ( Sinha et al. , 2017 ; Sagawa et al. , 2019 ) , word embeddings ( Miyato et al. , 2016 ) , and word substitutions ( Alzantot et al. , 2018 ; Jia et al. , 2019 ) . Other work has studied perturbation sets that are not necessarily mathematically formulated but welldefined from a human perspective such as spatial transformations ( Xiao et al. , 2018b ) . Real-world adversarial attacks tend to try to remain either inconspicuous to the viewer or meddle with features that humans would naturally ignore , such as textures on 3D printed objects ( Athalye et al. , 2017 ) , graffiti on traffic signs ( Eykholt et al. , 2018 ) , shapes of objects to avoid LiDAR detection ( Cao et al. , 2019 ) , irrelevant background noise for audio ( Li et al. , 2019a ) , or barely noticeable films on cameras ( Li et al. , 2019b ) . Although not necessarily adversarial , Hendrycks & Dietterich ( 2019 ) propose the set of common image corruptions as a measure of robustness to informal shifts in distribution . Generative modeling and adversarial robustness Relevant to our work is that which combines aspects of generative modeling with adversarial examples . While our work aims to learn real-world perturbation sets from data , most work in this space differs in that they either aim to generate synthetic adversarial ` p perturbations ( Xiao et al. , 2018a ) , run user studies to define the perturbation set ( Sharif et al. , 2019 ) , or simply do not restrict the adversary at all ( Song et al. , 2018 ; Bhattad et al. , 2020 ) . Gowal et al . ( 2019 ) trained a StyleGAN to disentangle real-world perturbations when no perturbation information is known in advance . However the resulting perturbation set relies on a stochastic approximation , and it is not immediately obvious what this set will ultimately capture . Most similar is the concurrent work of Robey et al . ( 2020 ) , which uses a GAN architecture from image-to-image translation to model simple perturbations between datasets . In contrast to both of these works , our setting requires the collection of paired data to directly learn how to perturb from perturbed pairs without needing to disentangle any features or translate datasets , allowing us to learn more targeted and complex perturbation sets . Furthermore , we formulate desirable properties of perturbation sets for downstream robustness tasks , and formally prove that a conditional variational autoencoder approach satisfies these properties . This results in a principled framework for learning perturbation sets that is quite distinct from these GAN-based approaches in both setting and motivation . Adversarial defenses and data augmentation Successful approaches for learning adversarially robust networks include methods which are both empirically robust via adversarial training ( Goodfellow et al. , 2014 ; Kurakin et al. , 2016 ; Madry et al. , 2017 ) and also certifiably robust via provable bounds ( Wong & Kolter , 2017 ; Wong et al. , 2018 ; Raghunathan et al. , 2018 ; Gowal et al. , 2018 ; Zhang et al. , 2019 ) and randomized smoothing ( Cohen et al. , 2019 ; Yang et al. , 2020 ) . Critically , these defenses require mathematically-defined perturbation sets , which has limited these approaches from learning robustness to more general , real-world perturbations . We directly build upon these approaches by learning perturbation sets that can be naturally and directly incorporated into robust training , greatly expanding the scope of adversarial defenses to new contexts . Our work also relates to using non-adversarial perturbations via data augmentation to reduce generalization error ( Zhang et al. , 2017 ; DeVries & Taylor , 2017 ; Cubuk et al. , 2019 ) , which can occasionally also improve robustness to unrelated image corruptions ( Geirhos et al. , 2018 ; Hendrycks et al. , 2019 ; Rusak et al. , 2020 ) . Our work differs in that rather than aggregating or proposing generic data augmentations , our perturbation sets can provide data augmentation that is targeted for a particular robustness setting . 3 PERTURBATION SETS LEARNED FROM DATA . For an example x ∈ Rm , a perturbation set S ( x ) ⊆ Rm is defined informally as the set of examples which are considered to be equivalent to x , and hence can be viewed as “ perturbations ” of x . This set is often used when finding an adversarial example , which is typically cast as an optimization problem to maximize the loss of a model over the perturbation set in order to break the model . For example , for a classifier h , loss function ` , and label y , an adversarial attack tries to solve the following : maximize x′∈S ( x ) ` ( h ( x′ ) , y ) . ( 1 ) A common choice for S ( x ) is an ` p ball around the unperturbed example , defined as S ( x ) = { x+ δ : ‖δ‖p ≤ } for some norm p and radius . This type of perturbation captures unstructured random noise , and is typically taken with respect to ` p norms for p ∈ { 0 , 1 , 2 , ∞ } , though more general distance metrics can also be used . Although defining the perturbation set is critical for developing adversarial defenses , in some scenarios , the true perturbation set may be difficult to mathematically describe . In these settings , it may still be possible to collect observations of ( non-adversarial ) perturbations , e.g . pairs of examples ( x , x̃ ) where x̃ is the perturbed data . In other words , x̃ is a perturbed version of x , from which we can learn an approximation of the true perturbation set . While there are numerous possible approaches one can take to learn S ( x ) from examples ( x , x̃ ) , in this work we take a generative modeling perspective , where examples are perturbed via an underlying latent space . Specifically , let g : Rk × Rm → Rm be a generator that takes a k-dimensional latent vector and an input , and outputs a perturbed version of the input . Then , we can define a learned perturbation set as follows : S ( x ) = { g ( z , x ) : ‖z‖ ≤ } ( 2 ) In other words , we have taken a well-defined norm-bounded ball in the latent space and mapped it to a set of perturbations with a generator g , which perturbs x into x̃ via a latent code z. Alternatively , we can define a perturbation set from a probabilistic modeling perspective , and use a distribution over the latent space to parameterize a distribution over examples . Then , S ( x ) is now a random variable defined by a probability distribution p ( z ) over the latent space as follows : S ( x ) ∼ pθ such that θ = g ( z , x ) , z ∼ p ( 3 ) where p has support { z : ‖z‖ ≤ } and pθ is a distribution parameterized by θ = g ( z , x ) .
.** In this work, the author(s) have presented an approach to identify valid perturbation operations that can be applied to the model inputs, which can be exploited to boost model robustness via purposefully corrupting the inputs during training. A weakly supervised setting has been assumed, such that pairs of valid perturbations (x, x') are available to support the identification. Technically, a conditional variational auto-encoder is trained to capture possible variations, where the perturbated inputs are used for reconstruction. The latent codes are treated as source space disruptions, concatenated with the original input x to reproduce x'. The author(s) provided empirical evidence to support their claim, along with some theoretical justifications.
SP:8c174c4e2b083f7313ad07aabbb7a3520d017499
Learning perturbation sets for robust machine learning
1 INTRODUCTION . Within the last decade , adversarial learning has become a core research area for studying robustness and machine learning . Adversarial attacks have expanded well beyond the original setting of imperceptible noise to more general notions of robustness , and can broadly be described as capturing sets of perturbations that humans are naturally invariant to . These invariants , such as facial recognition should be robust to adversarial glasses ( Sharif et al. , 2019 ) or traffic sign classification should be robust to adversarial graffiti ( Eykholt et al. , 2018 ) , form the motivation behind many real world adversarial attacks . However , human invariants can also include notions which are not inherently adversarial , for example image classifiers should be robust to common image corruptions ( Hendrycks & Dietterich , 2019 ) as well as changes in weather patterns ( Michaelis et al. , 2019 ) . On the other hand , although there has been much success in defending against small adversarial perturbations , most successful and principled methods for learning robust models are limited to human invariants that can be characterized using mathematically defined perturbation sets , for example perturbations bounded in ` p norm . After all , established guidelines for evaluating adversarial robustness ( Carlini et al. , 2019 ) have emphasized the importance of the perturbation set ( or the threat model ) as a necessary component for performing proper , scientific evaluations of adversarial defense proposals . However , this requirement makes it difficult to learn models which are robust to human invariants beyond these mathematical sets , where real world attacks and general notions of robustness can often be virtually impossible to write down as a formal set of equations . This incompatibility between existing methods for learning robust models and real-world , human invariants raises a fundamental question for the field of robust machine learning : How can we learn models that are robust to perturbations without a predefined perturbation set ? In the absence of a mathematical definition , in this work we present a general framework for learning perturbation sets from perturbed data . More concretely , given pairs of examples where one is a perturbed version of the other , we propose learning generative models that can “ perturb ” an example by varying a fixed region of the underlying latent space . The resulting perturbation sets are welldefined and can naturally be used in robust training and evaluation tasks . The approach is widely applicable to a range of robustness settings , as we make no assumptions on the type of perturbation being learned : the only requirement is to collect pairs of perturbed examples . Given the susceptibility of deep learning to adversarial examples , such a perturbation set will undoubtedly come under intense scrutiny , especially if it is to be used as a threat model for adversarial attacks . In this paper , we begin our theoretical contributions with a broad discussion of perturbation sets and formulate deterministic and probabilistic properties that a learned perturbation set should have in order to be a meaningful proxy for the true underlying perturbation set . The necessary subset property ensures that the set captures real perturbations , properly motivating its usage as an adversarial threat model . The sufficient likelihood property ensures that real perturbations have high probability , which motivates sampling from a perturbation set as a form of data augmentation . We then prove the main theoretical result , that a learned perturbation set defined by the decoder and prior of a conditional variational autoencoder ( CVAE ) ( Sohn et al. , 2015 ) implies both of these properties , providing a theoretically grounded framework for learning perturbation sets . The resulting CVAE perturbation sets are well motivated , can leverage standard architectures , and are computationally efficient with little tuning required . We highlight the versatility of our approach using CVAEs with an array of experiments , where we vary the complexity and scale of the datasets , perturbations , and downstream tasks . We first demonstrate how the approach can learn basic ` ∞ and rotation-translation-skew ( RTS ) perturbations ( Jaderberg et al. , 2015 ) in the MNIST setting . Since these sets can be mathematically defined , our goal is simply to measure exactly how well the learned perturbation set captures the target perturbation set on baseline tasks where the ground truth is known . We next look at a more difficult setting which can not be mathematically defined , and learn a perturbation set for common image corruptions on CIFAR10 ( Hendrycks & Dietterich , 2019 ) . The resulting perturbation set can interpolate between common corruptions , produce diverse samples , and be used in adversarial training and randomized smoothing frameworks . The adversarially trained models have improved generalization performance to both in- and out-of-distribution corruptions and better robustness to adversarial corruptions . In our final setting , we learn a perturbation set that captures real-world variations in lighting using a multi-illumination dataset of scenes captured “ in the wild ” ( Murmann et al. , 2019 ) . The perturbation set generates meaningful lighting samples and interpolations while generalizing to unseen scenes , and can be used to learn image segmentation models that are empirically and certifiably robust to lighting changes . All code and configuration files for reproducing the experiments as well as pretrained model weights for both the learned perturbation sets as well as the downstream robust classifiers are at https : //github.com/locuslab/perturbation_learning . 2 BACKGROUND AND RELATED WORK . Perturbation sets for adversarial threat models Adversarial examples were initially defined as imperceptible examples with small ` 1 , ` 2 and ` ∞ norm ( Biggio et al. , 2013 ; Szegedy et al. , 2013 ; Goodfellow et al. , 2014 ) , forming the earliest known , well-defined perturbation sets that were eventually generalized to the union of multiple ` p perturbations ( Tramèr & Boneh , 2019 ; Maini et al. , 2019 ; Croce & Hein , 2019 ; Stutz et al. , 2019 ) . Alternative perturbation sets to the ` p setting that remain well-defined incorporate more structure and semantic meaning , such as rotations and translations ( Engstrom et al. , 2017 ) , Wasserstein balls ( Wong et al. , 2019 ) , functional perturbations ( Laidlaw & Feizi , 2019 ) , distributional shifts ( Sinha et al. , 2017 ; Sagawa et al. , 2019 ) , word embeddings ( Miyato et al. , 2016 ) , and word substitutions ( Alzantot et al. , 2018 ; Jia et al. , 2019 ) . Other work has studied perturbation sets that are not necessarily mathematically formulated but welldefined from a human perspective such as spatial transformations ( Xiao et al. , 2018b ) . Real-world adversarial attacks tend to try to remain either inconspicuous to the viewer or meddle with features that humans would naturally ignore , such as textures on 3D printed objects ( Athalye et al. , 2017 ) , graffiti on traffic signs ( Eykholt et al. , 2018 ) , shapes of objects to avoid LiDAR detection ( Cao et al. , 2019 ) , irrelevant background noise for audio ( Li et al. , 2019a ) , or barely noticeable films on cameras ( Li et al. , 2019b ) . Although not necessarily adversarial , Hendrycks & Dietterich ( 2019 ) propose the set of common image corruptions as a measure of robustness to informal shifts in distribution . Generative modeling and adversarial robustness Relevant to our work is that which combines aspects of generative modeling with adversarial examples . While our work aims to learn real-world perturbation sets from data , most work in this space differs in that they either aim to generate synthetic adversarial ` p perturbations ( Xiao et al. , 2018a ) , run user studies to define the perturbation set ( Sharif et al. , 2019 ) , or simply do not restrict the adversary at all ( Song et al. , 2018 ; Bhattad et al. , 2020 ) . Gowal et al . ( 2019 ) trained a StyleGAN to disentangle real-world perturbations when no perturbation information is known in advance . However the resulting perturbation set relies on a stochastic approximation , and it is not immediately obvious what this set will ultimately capture . Most similar is the concurrent work of Robey et al . ( 2020 ) , which uses a GAN architecture from image-to-image translation to model simple perturbations between datasets . In contrast to both of these works , our setting requires the collection of paired data to directly learn how to perturb from perturbed pairs without needing to disentangle any features or translate datasets , allowing us to learn more targeted and complex perturbation sets . Furthermore , we formulate desirable properties of perturbation sets for downstream robustness tasks , and formally prove that a conditional variational autoencoder approach satisfies these properties . This results in a principled framework for learning perturbation sets that is quite distinct from these GAN-based approaches in both setting and motivation . Adversarial defenses and data augmentation Successful approaches for learning adversarially robust networks include methods which are both empirically robust via adversarial training ( Goodfellow et al. , 2014 ; Kurakin et al. , 2016 ; Madry et al. , 2017 ) and also certifiably robust via provable bounds ( Wong & Kolter , 2017 ; Wong et al. , 2018 ; Raghunathan et al. , 2018 ; Gowal et al. , 2018 ; Zhang et al. , 2019 ) and randomized smoothing ( Cohen et al. , 2019 ; Yang et al. , 2020 ) . Critically , these defenses require mathematically-defined perturbation sets , which has limited these approaches from learning robustness to more general , real-world perturbations . We directly build upon these approaches by learning perturbation sets that can be naturally and directly incorporated into robust training , greatly expanding the scope of adversarial defenses to new contexts . Our work also relates to using non-adversarial perturbations via data augmentation to reduce generalization error ( Zhang et al. , 2017 ; DeVries & Taylor , 2017 ; Cubuk et al. , 2019 ) , which can occasionally also improve robustness to unrelated image corruptions ( Geirhos et al. , 2018 ; Hendrycks et al. , 2019 ; Rusak et al. , 2020 ) . Our work differs in that rather than aggregating or proposing generic data augmentations , our perturbation sets can provide data augmentation that is targeted for a particular robustness setting . 3 PERTURBATION SETS LEARNED FROM DATA . For an example x ∈ Rm , a perturbation set S ( x ) ⊆ Rm is defined informally as the set of examples which are considered to be equivalent to x , and hence can be viewed as “ perturbations ” of x . This set is often used when finding an adversarial example , which is typically cast as an optimization problem to maximize the loss of a model over the perturbation set in order to break the model . For example , for a classifier h , loss function ` , and label y , an adversarial attack tries to solve the following : maximize x′∈S ( x ) ` ( h ( x′ ) , y ) . ( 1 ) A common choice for S ( x ) is an ` p ball around the unperturbed example , defined as S ( x ) = { x+ δ : ‖δ‖p ≤ } for some norm p and radius . This type of perturbation captures unstructured random noise , and is typically taken with respect to ` p norms for p ∈ { 0 , 1 , 2 , ∞ } , though more general distance metrics can also be used . Although defining the perturbation set is critical for developing adversarial defenses , in some scenarios , the true perturbation set may be difficult to mathematically describe . In these settings , it may still be possible to collect observations of ( non-adversarial ) perturbations , e.g . pairs of examples ( x , x̃ ) where x̃ is the perturbed data . In other words , x̃ is a perturbed version of x , from which we can learn an approximation of the true perturbation set . While there are numerous possible approaches one can take to learn S ( x ) from examples ( x , x̃ ) , in this work we take a generative modeling perspective , where examples are perturbed via an underlying latent space . Specifically , let g : Rk × Rm → Rm be a generator that takes a k-dimensional latent vector and an input , and outputs a perturbed version of the input . Then , we can define a learned perturbation set as follows : S ( x ) = { g ( z , x ) : ‖z‖ ≤ } ( 2 ) In other words , we have taken a well-defined norm-bounded ball in the latent space and mapped it to a set of perturbations with a generator g , which perturbs x into x̃ via a latent code z. Alternatively , we can define a perturbation set from a probabilistic modeling perspective , and use a distribution over the latent space to parameterize a distribution over examples . Then , S ( x ) is now a random variable defined by a probability distribution p ( z ) over the latent space as follows : S ( x ) ∼ pθ such that θ = g ( z , x ) , z ∼ p ( 3 ) where p has support { z : ‖z‖ ≤ } and pθ is a distribution parameterized by θ = g ( z , x ) .
This paper addresses the problem of constraining adversarial image perturbations to be similar to some natural class of perturbations. This would allow natural perturbations to be treated with the same rigor (e.g. quantifiable attack and defense strengths) as standard adversarial perturbations. Standard adversarial perturbations are arbitrary perturbations of an image that are within a certain $\mathcal{l}_p$-ball around the datapoint in pixel space. They are otherwise unconstrained and therefore appear as unstructured noise. Instead, the paper proposes to train a conditional autoencoder to generate perturbed versions of clean images from pairs of clean and perturbed images. The autoencoder can then be used to generate new perturbations that are similar to the training data. Adversarial versions of these perturbations can then be defined in the latent space of the autoencoder, rather than in pixel space. The paper provides theoretical arguments that perturbations generated in this way are close to the perturbations used for training. Using these learned adversarial perturbations, models can then be trained that are robust to them.
SP:8c174c4e2b083f7313ad07aabbb7a3520d017499
SEED: Self-supervised Distillation For Visual Representation
1 INTRODUCTION The burgeoning studies and success on self-supervised learning ( SSL ) for visual representation are mainly marked by its extraordinary potency of learning from unlabeled data at scale . Accompanying with the SSL is its phenomenal benefit of obtaining task-agnostic representations while allowing the training to dispense with prohibitively expensive data labeling . Major ramifications of visual SSL include pretext tasks ( Noroozi & Favaro , 2016 ; Zhang et al. , 2016 ; Gidaris et al. , 2018 ; Zhang et al. , 2019 ; Feng et al. , 2019 ) , contrastive representation learning ( Wu et al. , 2018 ; He et al. , 2020 ; Chen et al. , 2020a ) , online/offline clustering ( Yang et al. , 2016 ; Caron et al. , 2018 ; Li et al. , 2020 ; Caron et al. , 2020 ; Grill et al. , 2020 ) , etc . Among them , several recent works ( He et al. , 2020 ; Chen et al. , 2020a ; Caron et al. , 2020 ) have achieved comparable or even better accuracy than the supervised pre-training when transferring to downstream tasks , e.g . semi-supervised classification , object detection . The aforementioned top-performing SSL algorithms all involve large networks ( e.g. , ResNet-50 ( He et al. , 2016 ) or larger ) , with , however , little attention on small networks . Empirically , we find that existing techniques like contrastive learning do not work well on small networks . For instance , the linear probe top-1 accuracy on ImageNet using MoCo-V2 ( Chen et al. , 2020c ) is only 36.3 % with MobileNetV3-Large ( see Figure 1 ) , which is much lower compared with its supervised training accuracy 75.2 % ( Howard et al. , 2019 ) . For EfficientNet-B0 , the accuracy is 42.2 % compared with its supervised training accuracy 77.1 % ( Tan & Le , 2019 ) . We conjecture that this is because smaller models with fewer parameters can not effectively learn instance level discriminative representation with large amount of data . To address this challenge , we inject knowledge distillation ( KD ) ( Buciluǎ et al. , 2006 ; Hinton et al. , 2015 ) into self-supervised learning and propose self-supervised distillation ( dubbed as SEED ) as a new learning paradigm . That is , train the larger , and distill to the smaller both in self-supervised manner . Instead of directly conducting self-supervised training on a smaller model , SEED first trains a large model ( as the teacher ) in a self-supervised way , and then distills the knowledge to the smaller model ( as the student ) . Note that the conventional distillation is for supervised learning , while the distillation here is in the self-supervised setting without any labeled data . Supervised distillation can be formulated as training a student to mimic the probability mass function over classes predicted by a teacher model . In unsupervised knowledge distillation setting , however , the distribution over classes is not directly attainable . Therefore , we propose a simple yet effective self-supervised distillation method . Similar to ( He et al. , 2020 ; Wu et al. , 2018 ) , we maintain a queue of data samples . Given an instance , we first use the teacher network to obtain its similarity scores with all the data samples in the queue as well as the instance itself . Then the student encoder is trained to mimic the similarity score distribution inferred by the teacher over these data samples . The simplicity and flexibility that SEED brings are self-evident . 1 ) It does not require any clustering/prototypical computing procedure to retrieve the pseudo-labels or latent classes . 2 ) The teacher model can be pre-trained with any advanced SSL approach , e.g. , MoCo-V2 ( Chen et al. , 2020c ) , SimCLR ( Chen et al. , 2020a ) , SWAV ( Caron et al. , 2020 ) . 3 ) The knowledge can be distilled to any target small networks ( either shallower , thinner , or totally different architectures ) . To demonstrate the effectiveness , we comprehensively evaluate the learned representations on series of downstream tasks , e.g. , fully/semi-supervised classification , object detection , and also assess the transferability to other domains . For example , on ImageNet-1k dataset , SEED improves the linear probe accuracy of EfficientNet-B0 from 42.2 % to 67.6 % ( a gain over 25 % ) , and MobileNet-V3 from 36.3 % to 68.2 % ( a gain over 31 % ) compared to MoCo-V2 baselines , as shown in Figure 1 and Section 4 . Our contributions can be summarized as follows : • We are the first to address the problem of self-supervised visual representation learning for small models . • We propose a self-supervised distillation ( SEED ) technique to transfer knowledge from a large model to a small model without any labeled data . • With the proposed distillation technique ( SEED ) , we significantly improve the state-of-theart SSL performance on small models . • We exhaustively compare a variety of distillation strategies to show the validity of SEED under multiple settings . 2 RELATED WORK . Among the recent literature in self-supervised learning , contrastive based approaches show prominent results on downstream tasks . Majority of the techniques along this direction are stemming from noise-contrastive estimation ( Gutmann & Hyvärinen , 2010 ) where the latent distribution is estimated by contrasting with randomly or artificially generated noises . Oord et al . ( 2018 ) first proposed Info-NCE to learn image representations by predicting the future using an auto-regressive model for unsupervised learning . Follow-up works include improving the efficiency ( Hénaff et al. , 2019 ) , and using multi-view as positive samples ( Tian et al. , 2019b ) . As these approaches can only have the access to limited negative instances , Wu et al . ( 2018 ) designed a memory-bank to store the previously seen random representations as negative samples , and treat each of them as independent categories ( instance discrimination ) . However , this approach also comes with a deficiency that the previously stored vectors are inconsistent with the recently computed representations during the earlier stage of pre-training . Chen et al . ( 2020a ) mitigate this issue by sampling negative samples from a large batch . Concurrently , He et al . ( 2020 ) improve the memory-bank based method and propose to use the momentum updated encoder for the remission of representation inconsistency . Other techniques include Misra & Maaten ( 2020 ) that combines the pretext-invariant objective loss with contrastive learning , and Wang & Isola ( 2020 ) that decomposes contrastive loss into alignment and uniformity objectiveness . Knowledge distillation ( Hinton et al. , 2015 ) aims to transfer knowledge from a cumbersome model to a smaller one without losing too much generalization power , which is also well investigated in model compression ( Buciluǎ et al. , 2006 ) . Instead of mimicking the teacher ’ s output logit , attention transfer ( Zagoruyko & Komodakis , 2016 ) formulates knowledge distillation on attention maps . Similarly , works in ( Ahn et al. , 2019 ; Yim et al. , 2017 ; Koratana et al. , 2019 ; Huang & Wang , 2017 ) have utilized different learning objectives including consistency on feature maps , consistency on probability mass function , and maximizing the mutual information . CRD ( Tian et al. , 2019a ) , which is derived from CMC ( Tian et al. , 2019b ) , optimizes the student network by a similar objective to Oord et al . ( 2018 ) using a derived lower bound on mutual information . However , the aforementioned efforts all focus on task-specific distillation ( e.g. , image classification ) during the fine-tuning phase rather than a task-agnostic distillation in the pre-training phase for the representation learning . Several works on natural language pre-training proposed to leverage knowledge distillation for a smaller yet stronger small models . For instances , DistillBert ( Sanh et al. , 2019 ) , TinyBert ( Jiao et al. , 2019 ) , and MobileBert ( Sun et al. , 2020 ) , have used knowledge distillation for model compression and shown their validity on multiple downstream tasks . Similar works also emphasize the value of smaller and faster models for language representation learning by leveraging knowledge distillation ( Turc et al. , 2019 ; Sun et al. , 2019 ) . These works all demonstrate the effectiveness of knowledge distillation for language representation learning in small models , while are not extended to the pre-training for visual representations . Notably , a recent concurrent work CompRess ( Abbasi Koohpayegani et al. , 2020 ) also point out the importance to develop better SSL method for smaller models . SEED closely relates to the above techniques but aims to facilitate visual representation learning during pre-training phase using distillation technique for small models , which as far as we know has not yet been investigated . 3 METHOD . 3.1 PRELIMINARY ON KNOWLEDGE DISTILLATION . Knowledge distillation ( Hinton et al. , 2015 ; Buciluǎ et al. , 2006 ) is an effective technique to transfer knowledge from a strong teacher network to a target student network . The training task can be generalized as the following formulation : θ̂S = argmin θS N∑ i Lsup ( xi , θS , yi ) + Ldistill ( xi , θS , θT ) , ( 1 ) where xi is an image , yi is the corresponding annotation , θS is the parameter set for the student network , and θT is the set for the teacher network . The loss Lsup is the alignment error between the network prediction and the annotation . For example in image classification task ( Mishra & Marr , 2017 ; Shen & Savvides , 2020 ; Polino et al. , 2018 ; Cho & Hariharan , 2019 ) , it is normally a cross entropy loss . For object detection ( Liu et al. , 2019 ; Chen et al. , 2017 ) , it includes bounding box regression as well . The loss of Ldistill is the mimic error of the student network towards a pre-trained teacher network . For example in ( Hinton et al. , 2015 ) , the teacher signal comes from the softmax prediction of multiple large-scale networks and the loss is measured by the Kullback–Leibler divergence . In Romero et al . ( 2014 ) , the task is to align the intermediate feature map values and to minimize the squared l2 distance . The effectiveness has been well demonstrated in the supervised setting with labeled data , but remains unknown for the unsupervised setting , which is our focus . 3.2 SELF-SUPERVISED DISTILLATION FOR VISUAL REPRESENTATION . Different from supervised distillation , SEED aims to transfer knowledge from a large model to a small model without requiring labeled data , so that the learned representations in small model can be used for downstream tasks . Inspired by contrastive SSL , we formulate a simple approach for the distillation on the basis of instance similarity distribution over a contrastive instance queue . Similar to He et al . ( 2020 ) , we maintain an instance queue for storing data samples ’ encoding output from the teacher . Given a new sample , we compute its similarity scores with all the samples in the queue using both the teacher and the student models . We require that the similarity score distribution computed by the student matches with that computed by the teacher , which is formulated as minimizing the cross entropy between the student and the teacher ’ s similarity score distributions ( as illustrated in Figure 2 ) . Specifically , for a randomly augmented view xi of an image , it is first mapped and normalized into feature vector representations zTi = f T θ ( xi ) /||fTθ ( xi ) ||2 , and zSi = fSθ ( xi ) /||fSθ ( xi ) ||2 , where zTi , z S i ∈ RD , and fTθ and fSθ denote the teacher and student encoders , respectively . Let D = [ d1 ... dK ] denote the instance queue where K is the queue length and dj is the feature vector obtained from the teacher encoder . Similar to the contrastive learning framework , D is progressively updated under the “ first-in first-out ” strategy as distillation proceeds . That is , we en-queue the visual features of the current batch inferred by the teacher and de-queue the earliest seen samples at the end of iteration . Note that the maintained samples in queue D are mostly random and irrelevant to the target instance xi . Minimizing the cross entropy between the similarity score distribution computed by the student and teacher based on D softly contrasts xi with randomly selected samples , without directly aligning with the teacher encoder . To address this problem , we add the teacher ’ s embedding ( zTi ) into the queue and form D + = [ d1 ... dK , dK+1 ] with dK+1 = zTi . Let pT ( xi ; θT ; D+ ) denote the similarity score between the extracted teacher feature zTi and dj ’ s ( j = 1 , ... , K + 1 ) computed by the teacher model . pT ( xi ; θT ; D+ ) is defined as pT ( xi ; θT , D + ) = [ pT1 ... p T K+1 ] , p T j = exp ( zTi · dj/τT ) ∑ d∼D+ exp ( z T i · d/τT ) , ( 2 ) and τT is a temperature parameter for the teacher . Note , we use ( ) T to represent the feature from the teacher network and use ( · ) to represent the inner product between two features . Similarly let pS ( xi ; θS , D+ ) denote the similarity score computed by the student model , which is defined as pS ( xi ; θS , D + ) = [ pS1 ... p S K+1 ] , where p S j = exp ( zSi · dj/τS ) ∑ d∼D+ exp ( z S i · d/τS ) , ( 3 ) and τS is a temperature parameter for the student . Our self-supervised distillation can be formulated as minimizing the cross entropy between the similarity scores of the teacher , pT ( xi ; θT , D+ ) , and the student , pS ( xi ; θS , D+ ) , over all the instances xi , that is , θ̂S = argmin θS N∑ i −pT ( xi ; θT , D+ ) · logpS ( xi ; θS , D+ ) = argmin θS N∑ i K+1∑ j − exp ( z T i · dj/τT ) ∑ d∼D+ exp ( z T i · d/τT ) · log exp ( z S i · dj/τS ) ∑ d∼D+ exp ( z S i · d/τS ) . ( 4 ) Since the teacher network is pre-trained and frozen , the queued features are consistent during training w.r.t . the student network . The higher the value of pTj is , the larger weight will be laid on p S j . Due to the l2 normalization , similarity score between zTi and dK+1 remains constant 1 before softmax normalization , which is the largest among pTj . Thus , the weight for p S K+1 is the largest and can be adjusted solely by tuning the value of τT . By minimizing the loss , the feature of zSi can be aligned with zTi and meanwhile contrasts with other unrelated image features in D. We further discuss the relation of these two goals with our learning objective in Appendix A.5 . Relations with Info-NCE loss . When τT → 0 , the softmax function for pT smoothly approaches to a one-hot vector , where pTK+1 equals 1 and all others 0 . In this extreme case , the loss becomes LNCE = N∑ i − log exp ( z T i · zSi /τ ) ∑ d∼D+ exp ( z S i · d/τ ) , ( 5 ) which is similar to the widely-used Info-NCE loss ( Oord et al. , 2018 ) in contrastive-based SSL ( see discussion in Appendix A.6 .
The paper address the problem of knowledge distillation in self-supervised learning, where the representational knowledge from the larger model (i.e., teacher) is used to guide the learning of a smaller model (i.e, student). To achieve this, an instance queue is used to compute the similarity score between teacher model features and the feature of a given image, and the learning objective is to minimise the cross-entropy loss of the similarity between teacher and student models. The paper provides comprehensive empirical results to justify the efficacy of the proposed approach.
SP:9f8b8c56abc19f30f03426367ab036ba47bc1f27