paper_name
stringlengths
11
170
text
stringlengths
8.07k
307k
summary
stringlengths
152
6.16k
paper_id
stringlengths
43
43
ANOMALY DETECTION WITH FRAME-GROUP ATTENTION IN SURVEILLANCE VIDEOS
1 INTRODUCTION . Nowadays anomaly detection is useful to maintain social security and conduct legal forensics . Due to the ambiguous definition of abnormal events , it increases the difficulty of detection . For example , the appearance of a vehicle on a road is normal , while it is abnormal when a vehicle is on the sidewalk . So we make the goal clear in order to carry out consequent measures . Abnormal behavior is defined as rapid movements in slow moving crowds , such as cycling , running , throwing from a height , etc . Based on this definition , the commonly used datasets for anomaly detection are integrated and relabeled . The new fusion dataset contains more scenes and anomaly types , so it is more challenging for the anomaly detection . Subsequent experiments are performed on this new dataset . The test results show that the algorithm proposed in this paper has great advantages in many metrics . The end-to-end anomaly detection network shown in Fig . 1 has the following contributions : ( 1 ) The video group composed of consecutive multiple frames is the basic processing unit to extract expressive features with the designed group feature extractor . On the one hand , the spatial-temporal information could be retained comparing with single-image processing . On the other hand , the abnormality score of a single frame can be easily obtained without the access of the whole video , which can copy with the situation where video streams are the input . ( 2 ) The designed framework composed of group feature extractor and group score mapper can effectively obtain the abnormality score using the spatial-temporal information . Implicit vector-based attention mechanism is used to weight the frame-group features . The more important the feature is , the higher the weight is . ( 3 ) The basic cross-entropy loss and the improved hinge loss are united to improve the performance of the network . The latter devote to make the score of the abnormal frames greater than that of normal frames . The paper is organized as follows . Section 1 introduces the background of anomaly detection . Section 2 introduces the related work on anomaly detection . Section 3 mainly introduces the details of the proposed anomaly detection algorithm . Section 4 introduces the fusion dataset and then analyzes the experimental results . Section 5 gives the summary of the whole paper . 2 RELATED WORK . The challenges of video semantic analysis lie in the extraction and representation of video features . The video contains complex spatial texture information and time information . Multidimensional data provides more information but meanwhile it contains a lot of redundant information . How to extract low-redundant , comprehensive and representative video features is one of the research focuses . The manual extraction method of video features focuses on the extraction and analysis of low-level visual features , such as guided gradient histograms Xiao et al . ( 2014 ) , optical flow maps Reddy et al . ( 2011 ) , spatio-temporal points of interest Dollár et al . ( 2005 ) , texture models Xiao et al . ( 2018 ) , filtering models Zhang et al . ( 2018 ) , etc . After obtaining the statistical information , the visual dictionary Roshtkhari & Levine ( 2013 ) and other methods will be used to save the normal distribution , and then calculate the similarity criterion to determine whether the target is abnormal . Luo & Wang ( 2019 ) explores the method of multi-stream manual features for video representation . It constructs a three-dimensional video representation structure composed of spatio-temporal vector and positional vector , and improves the encoding method to make the extracted video representation structure more powerful in representation . With the rapid development of deep learning , automatic feature extraction using neural networks has become a research hotspot . Zhou et al . ( 2016 ) uses 3D convolutional networks to detect abnormal events in surveillance video . In Sabokrou et al . ( 2017 ) , the video frame is divided into several small areas , and each small area is feed into a 3D self-encoding network combined with 3D convolutional neural network to extract features and detect anomaly . Medel ( 2016 ) proposes a long-short term memory network based on convolution , which simultaneously extracts spatial and temporal information . Xu et al . ( 2015 ) first uses stacked auto-encoders to learn and fuse the appearance and motion characteristics of abnormal individuals , and then trains multiple single-classifiers to calculate the abnormal score . Ionescu et al . ( 2019 ) uses one-to-many classifiers instead of the single-classifiers after obtaining multiple pseudo-anomaly classes from the trained normal behavior pattern . Hinami et al . ( 2017 ) multiple attributes of the same target to extract features . Due to the lack of anomalous videos and various types of anomaly , it is difficult to find a general model that covers all anomalous events . The auto-encoding network Yuan et al . ( 2019 ) performs anomaly detection based on the reconstruction error . Hasan et al . ( 2016 ) uses a convolutional neural network to implement video anomaly detection . Since the convolutional layer operates on a twodimensional structure , time information will be lost . Chong & Tay ( 2017 ) designs a spatio-temporal autoencoder that encodes video sequence with spatial convolution and Convolutional Long-Short Term Memory ( ConvLSTM ) Shi et al . ( 2015 ) structure , and then uses the symmetric structure called the decoder , convert the video encoding into the image sequence . The abnormal score can be obtained from the calculation of the Euclidean distance between the decoded images and the original images . An & Cho ( 2015 ) proposes a variational autoencoder ( Variational Autoencoder , VAE ) , which uses the results of video encoding to fit a distribution function . Jing & Yujin ( 2017 ) supplements a gradient difference constraint on the basis of the sparse denoising auto-encoding network , which is helpful to make the model more effective in detecting abnormal behavior . For specific tasks , the model trained according to the specific task can often get better results . In Sultani et al . ( 2018 ) , the video containing abnormal events is divided into several video segments to form multiple video instances . A fully connected network is designed to map the video features extracted by the C3D network Tran et al . ( 2015 ) into abnormal scores . The score of the abnormal instance is higher than the score of the instances with only normal frames . The experiments in this paper show that the network has achieved good results . But the detection process is disconnected . In order to minimize the interference to the input data and obtain the final score directly and timely , we designs an end-to-end network , which uses both positive and negative samples to make the model more targeted . 3 PROPOSED METHOD . The paper proposes an end-to-end anomaly detection network , which operates on the frame-group formed with consecutive frames to obtain the abnormality score . The whole framework is composed of group feature extractor and group score mapper . The former performs on the raw frame-group to obtain the spatial-temporal group-feature . The latter performs on the group-feature to obtain the abnormality score . 3.1 THE GROUP-FEATURE EXTRACTOR . The frame-group is defined as a structure consisting of consecutive τ frames , which contains rich spatial texture information and temporal change information . Fig . 2 shows the details of the groupfeature extractor , where In ( 0 , Spa , Tem ) t and Out ( 0 , Spa , Tem ) t represent the input and output matrixes in time t respectively . Spa and Tem mean the input and output feature map in the spatial feature extractor and the temporal feature extractor respectively . Since the frame-group contains multiple continuous frames , in order not to destroy the time information within consecutive frames , we use a trainable convolution kernel to extract spatial information of each single-frame in the time dimension . Then batch normalization Ioffe & Szegedy ( 2015 ) is used to prevent the gradient dispersion and accelerate the model convergence . Activation function helps to make the model nonlinear . Two sets of ” convolution-regular-activation ” structures are used in the experiments . The first group uses 128 convolution kernels with size of 5× 5 and step size of 3 , and the second one uses 64 convolution kernels with size of 3× 3 and step size of 2 . After obtaining the spatial feature maps , ConvLSTM will further extract the spatial and temporal information using gate structures . The implementation of hidden features is shown in Equation ( 1 ) . Where the hidden feature HidTemt is used to record the accumulated state information up to time t. The symbol ⊗ represents the Hadamard product . σ and tanh represents the sigmoid and tanh nonlinear activation functions respectively . Conv is the convolution operation . This paper uses two cascading ConvLSTM layers to extract time flow information . The first layer uses 64 convolution kernels with size of 3 × 3 and the second one uses 32 same kernels . We use the ” same padding ” to keep the size of input and output feature maps same . HidTemt = σ ( Conv ( Out Tem t−1 , In Tem t , Hid Tem t−1 ) ) ⊗ HidTemt−1 + σ ( Conv ( OutTemt−1 , In Tem t , Hid Tem t−1 ) ⊗ tanh ( Conv ( Outt−1 , In Tem t ) ) ( 1 ) While the final output is shown in Equation ( 2 ) : OutTemt = σ ( Conv ( Out Tem t−1 , In Tem t , Hid Tem t ) ) ⊗ tanh ( HidTemt ) ( 2 ) In order to better extract the spatial and temporal information as well as high-level and low-level features of frame-group , we use a multi-level feature fusion structure to merge multi-level features of the frame-group . The output result of the multi-level feature fusion structure is regarded as the final feature representation of the frame-group . In the experiment , the structure was implemented using a 3D convolution Zhou et al . ( 2018 ) layer with size of 8× 1× 1 . 3.2 THE GROUP-SCORE MAPPER . In the group-score mapper , the attention mechanism Ilse et al . ( 2018 ) is used to increase the decisive influence of useful features and weaken the effects of irrelevant features on the results . The fully connected network is used to make the encoding of the group-feature more expressive while reducing feature dimensions . The group-level pooling is applied to map the refined group-feature to the abnormality score of the video group . The specific process is shown in Fig . 3 . The implicit vector method based attention mechanism assigns different weights to different features in order that the key features have a more important impact on the result and the interference of noise can be suppressed . The trainable transformation matrix will be used to project the original group feature into the implicit space , and then the weight vector will be obtained by an inverse transformation matrix . Different from the attention mechanism aiming at multiple instances in Ilse et al . ( 2018 ) , this paper focus on the attention of the group-feature . To be specific , the implicit vector is used to generate a weight vector of the original group , which has a dimension of 128 in the experiment . Fgrp is the flattened Out0t with length =1444 . T represents transposition operation . V and W are the feature space transformation matrices . Ψnl is a non-linear transformation function . Therefore we can define the coefficient χk of the kth element F ( k ) grp as Equation ( 3 ) . χk = exp ( ( WTΨnl ( VF T grp ) ) k ) ∑K i=1 exp ( ( W TΨnl ( VF T grp ) ) i ) , k ∈ [ 1 , K ] ( 3 ) The weighted group feature F̃grp is as Equation ( 4 ) . F̃grp = ( χ1F ( 1 ) grp , · · · , χkF ( k ) grp ) , k ∈ [ 1 , K ] ( 4 ) The weighted group-feature next passes through two fully connected layers with Dropout operation to reduce the feature dimensions and the computation and enhance the feature expressive ability . The output dimensions of the two fully connected layers are 512 , and theRelu activation function is used . The Dropout parameter is set to 0.5 , that is , 50 % of the neural units are discarded randomly and not participated in each iteration of training , which can reduce the risk of neural network overfitting . Group-pooling is used to get the final group score . The trainable weight matrix followed by the sigmoid function is used to map the refined group feature to the abnormality score . The positive samples marked as 1 are the frame-groups containing anomalies , while negative samples contain only normal . As the trainable weight matrix of the refined group feature F̃grp is marked Φ and the sigmoid is marked σ the predicted group-score B̂ ( t ) corresponding to the input ( In0t , · · · , In 0 t+τ ) is defined as Equation ( 5 ) . B̂ ( t ) = σ ( F̃grp ·Φ ) ( 5 )
The paper proposes an end-to-end abnormal behavior detection network to detect strenuous movements in slow moving crowds. The group-feature extractor is adopted. The proposed algorithm is tested on the integrated dataset.
SP:d9735ed582c13df8aa906746db500b271759a785
Revealing the Incentive to Cause Distributional Shift
1 INTRODUCTION . Consider a content recommendation system whose performance is measured by accuracy in predicting what users will click . This system can achieve better performance by either 1 : Making better predictions , or 2 : Changing the distribution of users such that predictions are easier to make . We propose the term auto-induced distributional shift ( ADS ) to describe this latter kind of distributional shift , caused by the algorithm ’ s own predictions or behaviour ( Figure 1 ) . ADS are not inherently bad ; often they are desirable . But unexpected ADS can lead to unintended behavior . While it is common in machine learning ( ML ) to assume ( e.g . via the i.i.d . assumption ) that ADS will not occur , ADS are inevitable in many real-world applications . Thus it is important to understand how ML algorithms behave when such assumptions are violated , i.e . in the actual scenario they will encounter during training – this is the motivation of our work . In many cases , including news recommendation , we would consider 2 a form of specification gaming ( Krakovna et al. , 2020 ) – the algorithm changed the task rather than solving it as intended . We care which means the algorithm used to solve the problem – 1 vs. 2 – but we only told it about the ends , so it didn ’ t know not to ‘ cheat ’ . This is an example of a specification problem ( Leike et al. , 2017 ; Ortega et al. , 2018 ) : a problem which arises from a discrepancy between the performance metric ( maximize accuracy ) and “ what we really meant ” ( maximize accuracy only via 1 ) , which is difficult to encode as a performance metric . Ideally , we ’ d like to quantify the desirability of all possible means , e.g . assign appropriate rewards to all potential strategies and side-effects , but this is intractable for real-world settings . Using human feedback to learn reward functions which account for such impacts is a promising approach to specifying desired behavior ( Leike et al. , 2018 ; Christiano et al. , 2017 ) . But the same issue can arise whenever human feedback is used in training : a means of improving performance could be to alter human preferences , making them easier to satisfy . Thus in this work , we pursue a complementary approach : managing learners ’ incentives . A learner has an incentive to behave in a certain way when doing so can increase performance ( e.g . accuracy or reward ) . Informally , we say an incentive is hidden when the learner behaves as if it were not present . But we note that changes to the learning algorithm or training regime could cause previously hidden incentives to be revealed , resulting in unexpected and potentially undesirable behaviour . Managing incentives ( e.g . controlling which incentives are hidden/ revealed ) can allow algorithm designers to disincentivize broad classes of strategies ( such as any that rely on manipulating human preferences ) without knowing their exact instantiation . Our goal in this work is to provide insight and practical tools for understanding and managing learners ’ incentives , via unit tests for incentives . We present unit tests for diagnosing incentives for ADS in both supervised learning ( SL ) and reinforcement learning ( RL ) . The unit tests both have two means by which the learner can improve performance : one which creates ADS and one which does not . The intended method of improving performance is one that does not induce ADS ; the other is hidden and we want it to remain hidden . A learner fails the unit test if it pursues the incentive to increase performance via ADS . In both the RL and SL unit tests , we find that ‘ vanilla ’ learning algorithms ( e.g . minibatch SGD ) pass the test , but introducing an outer-loop of meta-learning ( e.g . Population-Based Training ( PBT ) ( Jaderberg et al. , 2017 ) ) can lead to high levels of failure . Our contributions include : 1 . Defining Auto-induced Distributional Shift ( ADS ) and identifying issues that can arise from learners pursuing incentives for ADS in myopic reinforcement learning or online supervised learning problems . 2 . Creating unit tests that can determine which learning algorithms are liable to pursue incentives for ADS in these settings . 3 . Using these unit tests to experimentally confirm qualitative features of learning algorithms that affect their tendency to pursue incentives for ADS . 4 . Constructing a novel synthetic content recommendation environment that illustrates social problems associated with ADS , and experimentally validating that our unit tests are predictive of learning algorithms ’ behavior in this more complex environment . 5 . Proposing a mitigation strategy called context swapping that can effectively hide incentives for ADS . Broadly speaking , our experiments demonstrate that performance metrics are incomplete specifications of which behavior is desired , and that we must consider other algorithmic choices as part of the specification process . In particular , considering which incentives are revealed by different learning algorithms provides a natural way of specifying which means of achieving high performance are acceptable . 2 BACKGROUND . 2.1 META-LEARNING AND POPULATION BASED TRAINING . Meta-learning is the use of machine learning techniques to learn machine learning algorithms . This involves running multiple training scenarios in an inner loop ( IL ) , while an outer loop ( OL ) uses the outcomes of the inner loop ( s ) as data-points from which to learn which learning algorithms are most effective ( Metz et al. , 2019 ) . The number of IL steps per OL step is called the interval . Population-based training ( PBT ) ( Jaderberg et al. , 2017 ) is a meta-learning algorithm that trains multiple learners L1 , ... , Ln in parallel , after each interval ( T steps of IL ) applying an evolutionary OL step which consists of : ( 1 ) Evaluate the performance of each learner , ( 2 ) Replace both parameters and hyperparameters of 20 % lowest-performing learners with copies of those from the 20 % high-performing learners ( EXPLOIT ) . ( 3 ) Randomly perturb the hyperparameters ( but not the parameters ) of all learners ( EXPLORE ) . Two distinctive features of PBT are notable because they give the OL more control than many other meta-learning algorithms over the learning process . First , PBT applies optimization to parameters , not just hyperparameters ; this means the OL can directly select for parameters which lead to ADS , instead of only being able to influence parameter values via hyperparameters . Second , PBT performs multiple OL steps per training run . 2.2 DISTRIBUTIONAL SHIFT AND CONTENT RECOMMENDATION . In general , distributional shift refers to change of the data distribution over time . In supervised learning with data x and labels y , this can be more specifically described as dataset shift : change in the joint distribution of P ( x , y ) between the training and test sets ( Moreno-Torres et al. , 2012 ; Quionero-Candela et al. , 2009 ) . As identified by Moreno-Torres et al . ( 2012 ) , two common kinds of shift are : ( 1 ) Covariate shift : changing P ( x ) . In content recommendation , this corresponds to changing the user base of the recommendation system . For instance , a media outlet which publishes inflammatory content may appeal to users with extreme views while alienating more moderate users . This self-selection effect ( Kayhan , 2015 ) may appear to a recommendation system as an increase in performance , leading to a feedback effect , as previously noted by Shah et al . ( 2018 ) . This type of feedback effect has been identified as contributing to filter bubbles and radicalization ( Pariser , 2011 ; Kayhan , 2015 ) . ( 2 ) Concept shift : changing P ( y|x ) . In content recommendation , this corresponds to changing a given user ’ s interest in different kinds of content . For example , exposure to a fake news story has been shown to increase the perceived accuracy of ( and thus presumably future interest in ) the content , an example of the illusory truth effect ( Pennycook et al. , 2019 ) . For further details on such effects in content recommendation , see Appendix A . 3 AUTO-INDUCED DISTRIBUTION SHIFT ( ADS ) . Auto-induced distribution shift ( ADS ) is distributional shift caused by an algorithm ’ s behaviour . This is in contrast to distributional shift which would happen even if the learner were not present – e.g . for a crash-prediction algorithm trained on data from the summer , encountering snowy roads is an example of distributional shift , but not auto-induced distributional shift ( ADS ) . We emphasize that ADS are not inherently bad or good ; often ADS can even be desirable : consider the crash-prediction algorithm . If it works well , such a system will help drivers avoid collisions , thus making self-refuting predictions which result in ADS . What separates desirable and undesirable ADS ? The collision-alert system alters its data distribution in a way that is aligned with the goal of fewer collisions , whereas the news manipulation results in changes that are misaligned with the goal of better predicting existing users ’ interests ( Leike et al. , 2018 ) . In reinforcement learning ( RL ) , ADS are typically encouraged as a means to increase performance . On the other hand , in supervised learning ( SL ) , the i.i.d . assumption precludes ADS in theory . In practice , however , the possibility of using ADS to increase performance ( and thus an incentive to do so ) often remains . For instance , this occurs in online learning . In our experiments , we explicitly model such situations where i.i.d . assumptions are violated : We study the behavior of SL and myopic RL algorithms , in environments designed to include incentives for ADS , in order to understand when incentives are effectively hidden . Fig . 2 contrasts these settings with typical RL and SL . 4 INCENTIVES . For our study of incentives , we use the following terminology : an incentive for a behavior ( e.g . an action , a classification , etc . ) is present ( not absent ) to the extent that the behaviour will increase performance ( e.g . reward , accuracy , etc . ) ( Everitt & Hutter , 2019 ) . This incentive is revealed to ( not hidden from ) a learner if it would , at higher than chance levels , learn to perform the behavior given sufficient capacity and training experience . The incentive is pursued ( not eschewed ) by a learner if it actually performs the incentivized behaviour . Note even when an incentive is revealed , it may not be pursued , e.g . due to limited capacity and/or data , or simply chance . For example , in content recommendation , the incentive to drive users away is present if some user types are easier to predict than others . But this incentive may be hidden from the learner by using a myopic algorithm , e.g . one that does not see the effects of its actions on the distribution of users . The incentive might instead be revealed to the outer loop of a meta-learning algorithm like PBT , which does see the effects of learner ’ s actions . Even when this incentive is revealed , however , it might not end up being pursued . For example , this could happen if predicting which recommendations will drive away users is too difficult a learning problem , or if the incentive to do so is dominated by other incentives ( e.g . change individual users ’ interests , or improve accuracy of predictions ) . In general , it may be difficult to determine empirically which incentives are revealed , because failure to pursue an incentive can be due to limited capacity , insufficient training , and/or random chance . To address this challenge , we devise extremely simple environments ( ‘ unit tests ’ ) , where we can be confident that revealed incentives will be pursued . Hiding incentives can be an effective method of influencing learner behavior . For example , hiding the incentive to manipulate users from a content recommendation algorithm could prevent it from influencing users in a way they would not endorse . However , if machine learning practitioners are not aware that incentives are present , or that properties of the learning algorithm are hiding them , then seemingly innocuous changes to the learning algorithm may lead to significant unexpected changes in behavior . Hiding incentives for ADS may seem counter-intuitive and counter-productive in the context of reinforcement learning ( RL ) , where moving towards high-reward states is typically desirable . However , for real-world applications of RL , the ultimate goal is not a system that achieves high reward , but rather one that behaves according to the designer ’ s intentions . And as we discussed , it can be intractable to design reward functions that perfectly specify intended behavior . Moreover , substantial real-world issues could result from improper management of learners ’ incentives . Examples include tampering with human-generated reward signals ( Everitt & Hutter , 2018 ) ( e.g . selecting news articles to manipulate users ) , and making “ self-fulfilling prophecies ” ( e.g . driving up an asset ’ s value by publicly predicting its value will increase ( Armstrong & O ’ Rorke , 2017 ) ) . Hiding incentives for ADS via Context Swapping We propose a technique called context swapping that can hide incentives for ADS that might otherwise be revealed by the use of meta-learning or other algorithmic choices . The technique trainsN learners in parallel , and ( e.g . deterministically ) shuffles the learners through N different copies of the same ( or similar ) environments . When N is larger than the interval of the OL optimizer , each learner inhabits each copy for at most a single time-step before an OL step is applied . This can hide incentives for ADS in practice , see Sec . 5.1.1 .
The paper talks about a self-selection phenomenon which the authors call Auto-induced Distributional Shift (ADS). This phenomenon is common in recommender systems, where the promotion of a type of contents (e.g., liberal versus conservative) leads to a change in the active user base. Self-selection bias is a big topic and hard to quantify precisely. Instead, the paper makes a novel connection to Partially-Observable Markov Decision Process (POMDP), where the self-selection effect is analogous to the changes in the environment states (i.e., the active user base) after agent decisions (i.e., content recommendation). With this setup, the paper is able to simulate the self-selection process and analyze the system parameters that may affect the characteristics of the process, such as its mixing time. The paper also contains some other discussions on whether we can "hide the incentives" or, as I understand it, completely block the gradient path, between a state change and the final reward as a way to prevent ADS. This is substantiated by a self-cooperating/defecting game adapted from prisoner's dilemma and a comparative study of a few learning algorithms including meta-learning and q-learning. This seems to bring novelty, but I have some questions about the technical details as well as how to apply the ideas in more general cases.
SP:b9dac07af2d73a1ade1d2c55f98d768daac0d177
Revealing the Incentive to Cause Distributional Shift
1 INTRODUCTION . Consider a content recommendation system whose performance is measured by accuracy in predicting what users will click . This system can achieve better performance by either 1 : Making better predictions , or 2 : Changing the distribution of users such that predictions are easier to make . We propose the term auto-induced distributional shift ( ADS ) to describe this latter kind of distributional shift , caused by the algorithm ’ s own predictions or behaviour ( Figure 1 ) . ADS are not inherently bad ; often they are desirable . But unexpected ADS can lead to unintended behavior . While it is common in machine learning ( ML ) to assume ( e.g . via the i.i.d . assumption ) that ADS will not occur , ADS are inevitable in many real-world applications . Thus it is important to understand how ML algorithms behave when such assumptions are violated , i.e . in the actual scenario they will encounter during training – this is the motivation of our work . In many cases , including news recommendation , we would consider 2 a form of specification gaming ( Krakovna et al. , 2020 ) – the algorithm changed the task rather than solving it as intended . We care which means the algorithm used to solve the problem – 1 vs. 2 – but we only told it about the ends , so it didn ’ t know not to ‘ cheat ’ . This is an example of a specification problem ( Leike et al. , 2017 ; Ortega et al. , 2018 ) : a problem which arises from a discrepancy between the performance metric ( maximize accuracy ) and “ what we really meant ” ( maximize accuracy only via 1 ) , which is difficult to encode as a performance metric . Ideally , we ’ d like to quantify the desirability of all possible means , e.g . assign appropriate rewards to all potential strategies and side-effects , but this is intractable for real-world settings . Using human feedback to learn reward functions which account for such impacts is a promising approach to specifying desired behavior ( Leike et al. , 2018 ; Christiano et al. , 2017 ) . But the same issue can arise whenever human feedback is used in training : a means of improving performance could be to alter human preferences , making them easier to satisfy . Thus in this work , we pursue a complementary approach : managing learners ’ incentives . A learner has an incentive to behave in a certain way when doing so can increase performance ( e.g . accuracy or reward ) . Informally , we say an incentive is hidden when the learner behaves as if it were not present . But we note that changes to the learning algorithm or training regime could cause previously hidden incentives to be revealed , resulting in unexpected and potentially undesirable behaviour . Managing incentives ( e.g . controlling which incentives are hidden/ revealed ) can allow algorithm designers to disincentivize broad classes of strategies ( such as any that rely on manipulating human preferences ) without knowing their exact instantiation . Our goal in this work is to provide insight and practical tools for understanding and managing learners ’ incentives , via unit tests for incentives . We present unit tests for diagnosing incentives for ADS in both supervised learning ( SL ) and reinforcement learning ( RL ) . The unit tests both have two means by which the learner can improve performance : one which creates ADS and one which does not . The intended method of improving performance is one that does not induce ADS ; the other is hidden and we want it to remain hidden . A learner fails the unit test if it pursues the incentive to increase performance via ADS . In both the RL and SL unit tests , we find that ‘ vanilla ’ learning algorithms ( e.g . minibatch SGD ) pass the test , but introducing an outer-loop of meta-learning ( e.g . Population-Based Training ( PBT ) ( Jaderberg et al. , 2017 ) ) can lead to high levels of failure . Our contributions include : 1 . Defining Auto-induced Distributional Shift ( ADS ) and identifying issues that can arise from learners pursuing incentives for ADS in myopic reinforcement learning or online supervised learning problems . 2 . Creating unit tests that can determine which learning algorithms are liable to pursue incentives for ADS in these settings . 3 . Using these unit tests to experimentally confirm qualitative features of learning algorithms that affect their tendency to pursue incentives for ADS . 4 . Constructing a novel synthetic content recommendation environment that illustrates social problems associated with ADS , and experimentally validating that our unit tests are predictive of learning algorithms ’ behavior in this more complex environment . 5 . Proposing a mitigation strategy called context swapping that can effectively hide incentives for ADS . Broadly speaking , our experiments demonstrate that performance metrics are incomplete specifications of which behavior is desired , and that we must consider other algorithmic choices as part of the specification process . In particular , considering which incentives are revealed by different learning algorithms provides a natural way of specifying which means of achieving high performance are acceptable . 2 BACKGROUND . 2.1 META-LEARNING AND POPULATION BASED TRAINING . Meta-learning is the use of machine learning techniques to learn machine learning algorithms . This involves running multiple training scenarios in an inner loop ( IL ) , while an outer loop ( OL ) uses the outcomes of the inner loop ( s ) as data-points from which to learn which learning algorithms are most effective ( Metz et al. , 2019 ) . The number of IL steps per OL step is called the interval . Population-based training ( PBT ) ( Jaderberg et al. , 2017 ) is a meta-learning algorithm that trains multiple learners L1 , ... , Ln in parallel , after each interval ( T steps of IL ) applying an evolutionary OL step which consists of : ( 1 ) Evaluate the performance of each learner , ( 2 ) Replace both parameters and hyperparameters of 20 % lowest-performing learners with copies of those from the 20 % high-performing learners ( EXPLOIT ) . ( 3 ) Randomly perturb the hyperparameters ( but not the parameters ) of all learners ( EXPLORE ) . Two distinctive features of PBT are notable because they give the OL more control than many other meta-learning algorithms over the learning process . First , PBT applies optimization to parameters , not just hyperparameters ; this means the OL can directly select for parameters which lead to ADS , instead of only being able to influence parameter values via hyperparameters . Second , PBT performs multiple OL steps per training run . 2.2 DISTRIBUTIONAL SHIFT AND CONTENT RECOMMENDATION . In general , distributional shift refers to change of the data distribution over time . In supervised learning with data x and labels y , this can be more specifically described as dataset shift : change in the joint distribution of P ( x , y ) between the training and test sets ( Moreno-Torres et al. , 2012 ; Quionero-Candela et al. , 2009 ) . As identified by Moreno-Torres et al . ( 2012 ) , two common kinds of shift are : ( 1 ) Covariate shift : changing P ( x ) . In content recommendation , this corresponds to changing the user base of the recommendation system . For instance , a media outlet which publishes inflammatory content may appeal to users with extreme views while alienating more moderate users . This self-selection effect ( Kayhan , 2015 ) may appear to a recommendation system as an increase in performance , leading to a feedback effect , as previously noted by Shah et al . ( 2018 ) . This type of feedback effect has been identified as contributing to filter bubbles and radicalization ( Pariser , 2011 ; Kayhan , 2015 ) . ( 2 ) Concept shift : changing P ( y|x ) . In content recommendation , this corresponds to changing a given user ’ s interest in different kinds of content . For example , exposure to a fake news story has been shown to increase the perceived accuracy of ( and thus presumably future interest in ) the content , an example of the illusory truth effect ( Pennycook et al. , 2019 ) . For further details on such effects in content recommendation , see Appendix A . 3 AUTO-INDUCED DISTRIBUTION SHIFT ( ADS ) . Auto-induced distribution shift ( ADS ) is distributional shift caused by an algorithm ’ s behaviour . This is in contrast to distributional shift which would happen even if the learner were not present – e.g . for a crash-prediction algorithm trained on data from the summer , encountering snowy roads is an example of distributional shift , but not auto-induced distributional shift ( ADS ) . We emphasize that ADS are not inherently bad or good ; often ADS can even be desirable : consider the crash-prediction algorithm . If it works well , such a system will help drivers avoid collisions , thus making self-refuting predictions which result in ADS . What separates desirable and undesirable ADS ? The collision-alert system alters its data distribution in a way that is aligned with the goal of fewer collisions , whereas the news manipulation results in changes that are misaligned with the goal of better predicting existing users ’ interests ( Leike et al. , 2018 ) . In reinforcement learning ( RL ) , ADS are typically encouraged as a means to increase performance . On the other hand , in supervised learning ( SL ) , the i.i.d . assumption precludes ADS in theory . In practice , however , the possibility of using ADS to increase performance ( and thus an incentive to do so ) often remains . For instance , this occurs in online learning . In our experiments , we explicitly model such situations where i.i.d . assumptions are violated : We study the behavior of SL and myopic RL algorithms , in environments designed to include incentives for ADS , in order to understand when incentives are effectively hidden . Fig . 2 contrasts these settings with typical RL and SL . 4 INCENTIVES . For our study of incentives , we use the following terminology : an incentive for a behavior ( e.g . an action , a classification , etc . ) is present ( not absent ) to the extent that the behaviour will increase performance ( e.g . reward , accuracy , etc . ) ( Everitt & Hutter , 2019 ) . This incentive is revealed to ( not hidden from ) a learner if it would , at higher than chance levels , learn to perform the behavior given sufficient capacity and training experience . The incentive is pursued ( not eschewed ) by a learner if it actually performs the incentivized behaviour . Note even when an incentive is revealed , it may not be pursued , e.g . due to limited capacity and/or data , or simply chance . For example , in content recommendation , the incentive to drive users away is present if some user types are easier to predict than others . But this incentive may be hidden from the learner by using a myopic algorithm , e.g . one that does not see the effects of its actions on the distribution of users . The incentive might instead be revealed to the outer loop of a meta-learning algorithm like PBT , which does see the effects of learner ’ s actions . Even when this incentive is revealed , however , it might not end up being pursued . For example , this could happen if predicting which recommendations will drive away users is too difficult a learning problem , or if the incentive to do so is dominated by other incentives ( e.g . change individual users ’ interests , or improve accuracy of predictions ) . In general , it may be difficult to determine empirically which incentives are revealed , because failure to pursue an incentive can be due to limited capacity , insufficient training , and/or random chance . To address this challenge , we devise extremely simple environments ( ‘ unit tests ’ ) , where we can be confident that revealed incentives will be pursued . Hiding incentives can be an effective method of influencing learner behavior . For example , hiding the incentive to manipulate users from a content recommendation algorithm could prevent it from influencing users in a way they would not endorse . However , if machine learning practitioners are not aware that incentives are present , or that properties of the learning algorithm are hiding them , then seemingly innocuous changes to the learning algorithm may lead to significant unexpected changes in behavior . Hiding incentives for ADS may seem counter-intuitive and counter-productive in the context of reinforcement learning ( RL ) , where moving towards high-reward states is typically desirable . However , for real-world applications of RL , the ultimate goal is not a system that achieves high reward , but rather one that behaves according to the designer ’ s intentions . And as we discussed , it can be intractable to design reward functions that perfectly specify intended behavior . Moreover , substantial real-world issues could result from improper management of learners ’ incentives . Examples include tampering with human-generated reward signals ( Everitt & Hutter , 2018 ) ( e.g . selecting news articles to manipulate users ) , and making “ self-fulfilling prophecies ” ( e.g . driving up an asset ’ s value by publicly predicting its value will increase ( Armstrong & O ’ Rorke , 2017 ) ) . Hiding incentives for ADS via Context Swapping We propose a technique called context swapping that can hide incentives for ADS that might otherwise be revealed by the use of meta-learning or other algorithmic choices . The technique trainsN learners in parallel , and ( e.g . deterministically ) shuffles the learners through N different copies of the same ( or similar ) environments . When N is larger than the interval of the OL optimizer , each learner inhabits each copy for at most a single time-step before an OL step is applied . This can hide incentives for ADS in practice , see Sec . 5.1.1 .
The paper looks at the problem of auto-induced distributional shift, which is what happens when the inputs to a machine learning algorithm are affected by the algorithm used for learning itself. In general, ML algorithms do not face an i.i.d. distribution of data or users; rather, in recommendation systems for example, the choice of content displayed will affect how users react to it and even which users we face. In machine learning applied to users or humans, said users/humans we make decisions on may try to react to the decision rule in order to obtain better outcomes. The authors aim to study ADS, and to design tests for incentives, to detect whether given algorithms hide or detect incentives that cause ADS.
SP:b9dac07af2d73a1ade1d2c55f98d768daac0d177
Revealing the Incentive to Cause Distributional Shift
1 INTRODUCTION . Consider a content recommendation system whose performance is measured by accuracy in predicting what users will click . This system can achieve better performance by either 1 : Making better predictions , or 2 : Changing the distribution of users such that predictions are easier to make . We propose the term auto-induced distributional shift ( ADS ) to describe this latter kind of distributional shift , caused by the algorithm ’ s own predictions or behaviour ( Figure 1 ) . ADS are not inherently bad ; often they are desirable . But unexpected ADS can lead to unintended behavior . While it is common in machine learning ( ML ) to assume ( e.g . via the i.i.d . assumption ) that ADS will not occur , ADS are inevitable in many real-world applications . Thus it is important to understand how ML algorithms behave when such assumptions are violated , i.e . in the actual scenario they will encounter during training – this is the motivation of our work . In many cases , including news recommendation , we would consider 2 a form of specification gaming ( Krakovna et al. , 2020 ) – the algorithm changed the task rather than solving it as intended . We care which means the algorithm used to solve the problem – 1 vs. 2 – but we only told it about the ends , so it didn ’ t know not to ‘ cheat ’ . This is an example of a specification problem ( Leike et al. , 2017 ; Ortega et al. , 2018 ) : a problem which arises from a discrepancy between the performance metric ( maximize accuracy ) and “ what we really meant ” ( maximize accuracy only via 1 ) , which is difficult to encode as a performance metric . Ideally , we ’ d like to quantify the desirability of all possible means , e.g . assign appropriate rewards to all potential strategies and side-effects , but this is intractable for real-world settings . Using human feedback to learn reward functions which account for such impacts is a promising approach to specifying desired behavior ( Leike et al. , 2018 ; Christiano et al. , 2017 ) . But the same issue can arise whenever human feedback is used in training : a means of improving performance could be to alter human preferences , making them easier to satisfy . Thus in this work , we pursue a complementary approach : managing learners ’ incentives . A learner has an incentive to behave in a certain way when doing so can increase performance ( e.g . accuracy or reward ) . Informally , we say an incentive is hidden when the learner behaves as if it were not present . But we note that changes to the learning algorithm or training regime could cause previously hidden incentives to be revealed , resulting in unexpected and potentially undesirable behaviour . Managing incentives ( e.g . controlling which incentives are hidden/ revealed ) can allow algorithm designers to disincentivize broad classes of strategies ( such as any that rely on manipulating human preferences ) without knowing their exact instantiation . Our goal in this work is to provide insight and practical tools for understanding and managing learners ’ incentives , via unit tests for incentives . We present unit tests for diagnosing incentives for ADS in both supervised learning ( SL ) and reinforcement learning ( RL ) . The unit tests both have two means by which the learner can improve performance : one which creates ADS and one which does not . The intended method of improving performance is one that does not induce ADS ; the other is hidden and we want it to remain hidden . A learner fails the unit test if it pursues the incentive to increase performance via ADS . In both the RL and SL unit tests , we find that ‘ vanilla ’ learning algorithms ( e.g . minibatch SGD ) pass the test , but introducing an outer-loop of meta-learning ( e.g . Population-Based Training ( PBT ) ( Jaderberg et al. , 2017 ) ) can lead to high levels of failure . Our contributions include : 1 . Defining Auto-induced Distributional Shift ( ADS ) and identifying issues that can arise from learners pursuing incentives for ADS in myopic reinforcement learning or online supervised learning problems . 2 . Creating unit tests that can determine which learning algorithms are liable to pursue incentives for ADS in these settings . 3 . Using these unit tests to experimentally confirm qualitative features of learning algorithms that affect their tendency to pursue incentives for ADS . 4 . Constructing a novel synthetic content recommendation environment that illustrates social problems associated with ADS , and experimentally validating that our unit tests are predictive of learning algorithms ’ behavior in this more complex environment . 5 . Proposing a mitigation strategy called context swapping that can effectively hide incentives for ADS . Broadly speaking , our experiments demonstrate that performance metrics are incomplete specifications of which behavior is desired , and that we must consider other algorithmic choices as part of the specification process . In particular , considering which incentives are revealed by different learning algorithms provides a natural way of specifying which means of achieving high performance are acceptable . 2 BACKGROUND . 2.1 META-LEARNING AND POPULATION BASED TRAINING . Meta-learning is the use of machine learning techniques to learn machine learning algorithms . This involves running multiple training scenarios in an inner loop ( IL ) , while an outer loop ( OL ) uses the outcomes of the inner loop ( s ) as data-points from which to learn which learning algorithms are most effective ( Metz et al. , 2019 ) . The number of IL steps per OL step is called the interval . Population-based training ( PBT ) ( Jaderberg et al. , 2017 ) is a meta-learning algorithm that trains multiple learners L1 , ... , Ln in parallel , after each interval ( T steps of IL ) applying an evolutionary OL step which consists of : ( 1 ) Evaluate the performance of each learner , ( 2 ) Replace both parameters and hyperparameters of 20 % lowest-performing learners with copies of those from the 20 % high-performing learners ( EXPLOIT ) . ( 3 ) Randomly perturb the hyperparameters ( but not the parameters ) of all learners ( EXPLORE ) . Two distinctive features of PBT are notable because they give the OL more control than many other meta-learning algorithms over the learning process . First , PBT applies optimization to parameters , not just hyperparameters ; this means the OL can directly select for parameters which lead to ADS , instead of only being able to influence parameter values via hyperparameters . Second , PBT performs multiple OL steps per training run . 2.2 DISTRIBUTIONAL SHIFT AND CONTENT RECOMMENDATION . In general , distributional shift refers to change of the data distribution over time . In supervised learning with data x and labels y , this can be more specifically described as dataset shift : change in the joint distribution of P ( x , y ) between the training and test sets ( Moreno-Torres et al. , 2012 ; Quionero-Candela et al. , 2009 ) . As identified by Moreno-Torres et al . ( 2012 ) , two common kinds of shift are : ( 1 ) Covariate shift : changing P ( x ) . In content recommendation , this corresponds to changing the user base of the recommendation system . For instance , a media outlet which publishes inflammatory content may appeal to users with extreme views while alienating more moderate users . This self-selection effect ( Kayhan , 2015 ) may appear to a recommendation system as an increase in performance , leading to a feedback effect , as previously noted by Shah et al . ( 2018 ) . This type of feedback effect has been identified as contributing to filter bubbles and radicalization ( Pariser , 2011 ; Kayhan , 2015 ) . ( 2 ) Concept shift : changing P ( y|x ) . In content recommendation , this corresponds to changing a given user ’ s interest in different kinds of content . For example , exposure to a fake news story has been shown to increase the perceived accuracy of ( and thus presumably future interest in ) the content , an example of the illusory truth effect ( Pennycook et al. , 2019 ) . For further details on such effects in content recommendation , see Appendix A . 3 AUTO-INDUCED DISTRIBUTION SHIFT ( ADS ) . Auto-induced distribution shift ( ADS ) is distributional shift caused by an algorithm ’ s behaviour . This is in contrast to distributional shift which would happen even if the learner were not present – e.g . for a crash-prediction algorithm trained on data from the summer , encountering snowy roads is an example of distributional shift , but not auto-induced distributional shift ( ADS ) . We emphasize that ADS are not inherently bad or good ; often ADS can even be desirable : consider the crash-prediction algorithm . If it works well , such a system will help drivers avoid collisions , thus making self-refuting predictions which result in ADS . What separates desirable and undesirable ADS ? The collision-alert system alters its data distribution in a way that is aligned with the goal of fewer collisions , whereas the news manipulation results in changes that are misaligned with the goal of better predicting existing users ’ interests ( Leike et al. , 2018 ) . In reinforcement learning ( RL ) , ADS are typically encouraged as a means to increase performance . On the other hand , in supervised learning ( SL ) , the i.i.d . assumption precludes ADS in theory . In practice , however , the possibility of using ADS to increase performance ( and thus an incentive to do so ) often remains . For instance , this occurs in online learning . In our experiments , we explicitly model such situations where i.i.d . assumptions are violated : We study the behavior of SL and myopic RL algorithms , in environments designed to include incentives for ADS , in order to understand when incentives are effectively hidden . Fig . 2 contrasts these settings with typical RL and SL . 4 INCENTIVES . For our study of incentives , we use the following terminology : an incentive for a behavior ( e.g . an action , a classification , etc . ) is present ( not absent ) to the extent that the behaviour will increase performance ( e.g . reward , accuracy , etc . ) ( Everitt & Hutter , 2019 ) . This incentive is revealed to ( not hidden from ) a learner if it would , at higher than chance levels , learn to perform the behavior given sufficient capacity and training experience . The incentive is pursued ( not eschewed ) by a learner if it actually performs the incentivized behaviour . Note even when an incentive is revealed , it may not be pursued , e.g . due to limited capacity and/or data , or simply chance . For example , in content recommendation , the incentive to drive users away is present if some user types are easier to predict than others . But this incentive may be hidden from the learner by using a myopic algorithm , e.g . one that does not see the effects of its actions on the distribution of users . The incentive might instead be revealed to the outer loop of a meta-learning algorithm like PBT , which does see the effects of learner ’ s actions . Even when this incentive is revealed , however , it might not end up being pursued . For example , this could happen if predicting which recommendations will drive away users is too difficult a learning problem , or if the incentive to do so is dominated by other incentives ( e.g . change individual users ’ interests , or improve accuracy of predictions ) . In general , it may be difficult to determine empirically which incentives are revealed , because failure to pursue an incentive can be due to limited capacity , insufficient training , and/or random chance . To address this challenge , we devise extremely simple environments ( ‘ unit tests ’ ) , where we can be confident that revealed incentives will be pursued . Hiding incentives can be an effective method of influencing learner behavior . For example , hiding the incentive to manipulate users from a content recommendation algorithm could prevent it from influencing users in a way they would not endorse . However , if machine learning practitioners are not aware that incentives are present , or that properties of the learning algorithm are hiding them , then seemingly innocuous changes to the learning algorithm may lead to significant unexpected changes in behavior . Hiding incentives for ADS may seem counter-intuitive and counter-productive in the context of reinforcement learning ( RL ) , where moving towards high-reward states is typically desirable . However , for real-world applications of RL , the ultimate goal is not a system that achieves high reward , but rather one that behaves according to the designer ’ s intentions . And as we discussed , it can be intractable to design reward functions that perfectly specify intended behavior . Moreover , substantial real-world issues could result from improper management of learners ’ incentives . Examples include tampering with human-generated reward signals ( Everitt & Hutter , 2018 ) ( e.g . selecting news articles to manipulate users ) , and making “ self-fulfilling prophecies ” ( e.g . driving up an asset ’ s value by publicly predicting its value will increase ( Armstrong & O ’ Rorke , 2017 ) ) . Hiding incentives for ADS via Context Swapping We propose a technique called context swapping that can hide incentives for ADS that might otherwise be revealed by the use of meta-learning or other algorithmic choices . The technique trainsN learners in parallel , and ( e.g . deterministically ) shuffles the learners through N different copies of the same ( or similar ) environments . When N is larger than the interval of the OL optimizer , each learner inhabits each copy for at most a single time-step before an OL step is applied . This can hide incentives for ADS in practice , see Sec . 5.1.1 .
The paper realizes that the ability of a model to induce a distribution shift can provide incentives to the learner that are not necessarily in line with the intention of the algorithm designer. It might find other means to reduce the risk through specification gaming rather than improving predictions. The authors propose two simple unit tests to detect such behavior and illustrate in these examples that meta-learning makes algorithms more susceptible to this potentially unanticipated behavior. As an approach to partially fix the issue they propose context-swapping such that the algorithm does not directly see the consequences of its actions.
SP:b9dac07af2d73a1ade1d2c55f98d768daac0d177
Provable hierarchical lifelong learning with a sketch-based modular architecture
1 INTRODUCTION . How can complex concepts be learned ? Human experience suggests that hierarchical structure is key : the complex concepts we use are no more than simple combinations of slightly less complex concepts that we have already learned , and so on . This intuition suggests that the learning of complex concepts is most tractably approached in a setting where multiple tasks are present , where it is possible to leverage what was learned from one task in another . Lifelong learning ( Silver et al. , 2013 ; Chen & Liu , 2018 ) captures such a setting : we are presented with a sequence of learning tasks and wish to understand how to ( selectively ) transfer what was learned on previous tasks to novel tasks . We seek a method that we can analyze and prove leverages what it learns on simple tasks to efficiently learn complex tasks ; in particular , tasks that could not be learned without the help provided by learning the simple tasks first . In this work , we propose an architecture for addressing such problems based on creating new modules to represent the various tasks . Indeed , other modular approaches to lifelong learning ( Yoon et al. , 2018 ; Rusu et al. , 2016 ) have been proposed previously . But , these works did not consider what we view as the main advantage of such architectures : their suitability for theoretical analysis . We prove that our architecture is capable of efficiently learning complex tasks by utilizing the functions learned to solve previous tasks as components in an algorithm for the more complex task . In addition to our analysis proving that the complex tasks may be learned , we also demonstrate that such an approach can learn functions that standard training methods fail to learn in practice , including some that are believed not to be learnable , even in principle ( Klivans & Sherstov , 2009 ) . We also consider methods for automatically identifying whether a learning task posed to the agent matches a previously learned task or is a novel task . We note briefly that a few other works considered lifelong learning from a theoretical perspective . An early approach by Solomonoff ( 1989 ) did not seriously consider computational complexity aspects . Ruvolo & Eaton ( 2013 ) gave the first provable lifelong learning algorithm with such an analysis . But , the transfer of knowledge across tasks in their framework was limited to feature learning . In particular , they did not consider the kind of deep hierarchies of tasks that we seek to learn . 1.1 OVERVIEW OF THE ARCHITECTURE . The main technical novelty in our architecture over previous modular lifelong learners is that ours uses a particular type of internal data structure called sketches ( Ghazi et al. , 2019 ; Panigrahy , 2019 ) . All such data , including inputs from the environment , outputs from a module for another task , decisions such as choosing an action to take , or even descriptions of the modules themselves , are encoded as such sketches . Although sketches have a dense ( vector ) representation , they can also be interpreted as a kind of structured representation ( Ghazi et al. , 2019 , Theorem 9 ) and are recursive ; that is , they point to the previous modules/events that they arose from ( Figure 1 , right ) . However , in order to construct these sketches in Ghazi et al . ( 2019 ) , the structure of the network is assumed to be given . No algorithms for constructing such a hierarchical network of modules from training data were known . In this work we show a method to construct such a hierarchical network from training data . We provide an architecture and algorithms for learning from a stream of training inputs that produces such a network of modules over time . This includes challenges of identifying each module , and discovering which other modules it depends on . Our architecture can be viewed as a variant of the Transformer architecture ( Radford et al. , 2021 ; Shazeer et al. , 2017 ) , particularly the Switch Transformer ( Fedus et al. , 2021 ) in conjunction with the idea of Neural Memory ( Wang et al. , 2021 ) . Instead of having a single feedforward layer , the Switch Transformer has an array of feedforward layers that an input can be routed to at each layer . Neural Memory on the other hand is a large table of values , and one or a few locations of the memory can be accessed at each layer of a deep network . In a sense the Switch Transfomer can be viewed as having a memory of possible feedforward layers ( although they use very few ) to read from . It is viewing the memory as holding “ parts of a deep network ” as opposed to data , although this difference between program and data is artificial : for example , embedding table entries can be viewed as “ data ” but are also used to alter the computation of the rest of the network , and in this sense act as a “ program modifier ” . The key component of our architecture is a locality sensitive hash ( LSH ) table based memory ( see Wang et al . ( 2021 ) ) that holds sketches of data ( such as inputs ) and modules or programs ( think of an encoding of a small deep network ) that handles such sketches ( Figure 1 , left ) . The “ operating system ” of our architecture executes the basic loop of taking sketches ( either from the environment or from internal modules ) and routing/hashing them to the LSH table to execute the next module that processes these sketches . These modules produce new sketches that are fed back into the loop . New modules ( or concepts ) are formed simply by instantiating a new hash bucket whenever a new frequently-occurring context arises , i.e . whenever several sketches hash to the same place ; the context can be viewed as a function-pointer and the sketch can be viewed as arguments for a call to that function . Frequent subsets of sketches may be combined to produce compound sketches . Finally we include pointers among sketches based on co-occurrence and co-reference in the sketches themselves . These pointers form a knowledge graph : for example if the inputs are images of pairs of people where the pairs are drawn from some latent social network , then assuming sufficient sampling of the network , this network will arise as a subgraph of the graph given by these pointers . The main loop allows these pointers to be dereferenced by passing them through the memory table , so they indeed serve the intended purpose . The main idea of the architecture is that all events produce sketches , which can intuitively be thought of as the “ mind-state ” of the system when that event occurs . The sketch-to-sketch similarity property ( see below ) combined with a similarity-preserving hash function ensures that similar sketches go to the same hash bucket ( Appendix B ) ; thus the hash table can be viewed as a content addressed memory . See Figure 1 for an illustration of this . We remark that the distances between embeddings of scene representations were used to automatically segment video into discrete events by Franklin et al . ( 2020 ) , and obtained strong agreement with human annotators . The thresholded distance used to obtain the segmentation is analogous to our locality-sensitive hashes , which we use as context sketches . A sketch can be viewed at different levels of granularity before using it to access the hash table ; this becomes the context of the sketch . Each bucket contains a program that is executed when a sketch arises that indexes into that bucket . The program in turn produces outputs and new sketches that are routed back to the hash table . The system works in a continuous loop where sketches are coming in from the environment and also from previous iterations ; the main structure of the loop is : Phenomena sketch context bucket program Phenomena input f h produces output Thus external and internal inputs arrive as sketches that are converted into a coarser representation using a function f ( see Section 2.1 below ) and then hashed to a bucket using a locality-sensitive hash function h. The program at that bucket is executed to produce an output-sketch that is fed back into the system and may also produce external outputs . This basic loop ( described in Algorithm 1 ) is executed by the routing module , which can be thought of as the operating system of the architecture . 2 SKETCHES REVIEW . Our architecture relies on the properties of the sketches introduced in Ghazi et al . ( 2019 ) . In this section we briefly describe the key properties of these sketches ; the interested reader is referred to Ghazi et al . ( 2019 ) ; Wang et al . ( 2021 ) for details . A sketch is a compact representation of a possibly exponentially-wide ( d×N ) matrix in which only a small number k of the columns are nonzero , that supports efficient computation of inner products , and for which encoding and decoding are performed by linear transformations . For concreteness , we note that sketches may be computed by random projections to Rd′ for d′ ≥ kd logN ; the JohnsonLindenstrauss Lemma then guarantees that inner-products are preserved . For our purposes , we suppose modules M1 , . . . , MN produce vectors x1 , . . . , xN ∈ Rd as output , where only k of the modules produce ( nonzero ) outputs . We view the sparse collection of module outputs as a small set of pairs of the form { [ Mi1 , xi1 ] , . . . , [ Mik , xik ] } : For example an input image has a sketch that can be thought of as a tuple [ IMAGE , 〈bit-map-sketch〉 ] . An output by an image recognition module that finds a person in the image can be represented as [ PERSON , [ 〈personsketch〉 , 〈position-in-image-sketch〉 ] ) ; here IMAGE and PERSON can be thought of as “ labels ” . If the outputs of these modules are vector embeddings in the usual sense , then indeed the inner products measure the similarity of the objects represented by the output embeddings . Observe that the constituent individual vectors xj in a sketch may themselves be sketches . For example , 〈person-sketch〉 could in turn be set of such pairs { [ NAME , 〈name-sketch〉 ] , [ FACIALFEATURES , 〈facial-sketch〉 ] , [ POSTURE , 〈posture-sketch〉 ] } , and an image consisting of multiple people could be mapped by our recognition module to a set { 〈person-1-sketch〉 , 〈person-2sketch〉 , . . . , 〈person-k-sketch〉 } . Note if the if the tuple is very large , we will not be able to recover the sketch of each of its members but only get a “ average ” or summary of all the sketches – however if a member has high enough relative weight ( see ( Ghazi et al. , 2019 , Section 3.3 ) ) it can be recovered . Appendix C.1 discusses how large objects can be stored as sketches hierarchically . Indeed , following Ghazi et al . ( 2019 ) , the outputs of modules in our architecture will be tuples that , in addition to an “ output ” component , represent the input sketches which , in turn , represent the modules that produced those inputs , e.g. , { [ MODULE-ID , 〈module-id〉 ] , [ OUTPUT-SKETCH , 〈outputsketch〉 ] , [ RECURSIVE-INPUT-SKETCH , 〈recursive-input-sketch〉 ] } . By recursively unpacking the input sketch , it is possible to reconstruct the history of computation that produced the sketch . Algorithm 1 Informal presentation of the main execution loop Input : input sketch T ( this sketch may contain a desired output for training ) 1 current-sketches← { T } 2 while current-sketches is not empty : 3 current-programs← ∅ 4 foreach sketch S in current-sketches do 5 extract context C = f ( S ) 6 update access-frequency-count of bucket h ( C ) 7 if bucket h ( C ) has a program P : 8 append ( S , P ) to current-programs 9 else : 10 if bucket h ( C ) is frequently accessed : 11 initialize program at h ( C ) with some random program and mark it for training . 12 Fetch programs Pi ( possibly by some similarity criterion ) , append those ( S , Pi ) to current-programs 13 Routing module chooses some subset of current-programs , runs each program on its associated sketch , appends outputs to current-sketches 14 Append sketches on outgoing edges of accessed buckets to current-sketches 15 if any of the programs are marked for training : 16 routing module picks one or some of them and trains them , and may choose to stop execution loop 17 if any of the sketches is of ( a special ) type OUTPUT sketch : 18 routing module picks one such , outputs that sketch or performs that action , and may choose to stop execution loop 19 if any of the sketches is of type REWARD sketch ( say for correct prediction or action ) : 20 updates the reward for this bucket and propagates those rewards to prior buckets 21 Routing module picks k combinations of sketches in current-sketches , and combine them into compound sketches : S1 , . . . , Sk ( may produce 0 sketches ) 22 current-sketches← { S1 , . . . , Sk }
This work introduces a continual-learning architecture that combines elements for sketches, hash functions, modules and routing. Theoretical guarantees are provided for the performance of the architecture. Some experiments seem to support the advantage of the proposed architecture over conventional deep learning ones.
SP:947b34e24d3d4faf15927f870765559c64b84536
Provable hierarchical lifelong learning with a sketch-based modular architecture
1 INTRODUCTION . How can complex concepts be learned ? Human experience suggests that hierarchical structure is key : the complex concepts we use are no more than simple combinations of slightly less complex concepts that we have already learned , and so on . This intuition suggests that the learning of complex concepts is most tractably approached in a setting where multiple tasks are present , where it is possible to leverage what was learned from one task in another . Lifelong learning ( Silver et al. , 2013 ; Chen & Liu , 2018 ) captures such a setting : we are presented with a sequence of learning tasks and wish to understand how to ( selectively ) transfer what was learned on previous tasks to novel tasks . We seek a method that we can analyze and prove leverages what it learns on simple tasks to efficiently learn complex tasks ; in particular , tasks that could not be learned without the help provided by learning the simple tasks first . In this work , we propose an architecture for addressing such problems based on creating new modules to represent the various tasks . Indeed , other modular approaches to lifelong learning ( Yoon et al. , 2018 ; Rusu et al. , 2016 ) have been proposed previously . But , these works did not consider what we view as the main advantage of such architectures : their suitability for theoretical analysis . We prove that our architecture is capable of efficiently learning complex tasks by utilizing the functions learned to solve previous tasks as components in an algorithm for the more complex task . In addition to our analysis proving that the complex tasks may be learned , we also demonstrate that such an approach can learn functions that standard training methods fail to learn in practice , including some that are believed not to be learnable , even in principle ( Klivans & Sherstov , 2009 ) . We also consider methods for automatically identifying whether a learning task posed to the agent matches a previously learned task or is a novel task . We note briefly that a few other works considered lifelong learning from a theoretical perspective . An early approach by Solomonoff ( 1989 ) did not seriously consider computational complexity aspects . Ruvolo & Eaton ( 2013 ) gave the first provable lifelong learning algorithm with such an analysis . But , the transfer of knowledge across tasks in their framework was limited to feature learning . In particular , they did not consider the kind of deep hierarchies of tasks that we seek to learn . 1.1 OVERVIEW OF THE ARCHITECTURE . The main technical novelty in our architecture over previous modular lifelong learners is that ours uses a particular type of internal data structure called sketches ( Ghazi et al. , 2019 ; Panigrahy , 2019 ) . All such data , including inputs from the environment , outputs from a module for another task , decisions such as choosing an action to take , or even descriptions of the modules themselves , are encoded as such sketches . Although sketches have a dense ( vector ) representation , they can also be interpreted as a kind of structured representation ( Ghazi et al. , 2019 , Theorem 9 ) and are recursive ; that is , they point to the previous modules/events that they arose from ( Figure 1 , right ) . However , in order to construct these sketches in Ghazi et al . ( 2019 ) , the structure of the network is assumed to be given . No algorithms for constructing such a hierarchical network of modules from training data were known . In this work we show a method to construct such a hierarchical network from training data . We provide an architecture and algorithms for learning from a stream of training inputs that produces such a network of modules over time . This includes challenges of identifying each module , and discovering which other modules it depends on . Our architecture can be viewed as a variant of the Transformer architecture ( Radford et al. , 2021 ; Shazeer et al. , 2017 ) , particularly the Switch Transformer ( Fedus et al. , 2021 ) in conjunction with the idea of Neural Memory ( Wang et al. , 2021 ) . Instead of having a single feedforward layer , the Switch Transformer has an array of feedforward layers that an input can be routed to at each layer . Neural Memory on the other hand is a large table of values , and one or a few locations of the memory can be accessed at each layer of a deep network . In a sense the Switch Transfomer can be viewed as having a memory of possible feedforward layers ( although they use very few ) to read from . It is viewing the memory as holding “ parts of a deep network ” as opposed to data , although this difference between program and data is artificial : for example , embedding table entries can be viewed as “ data ” but are also used to alter the computation of the rest of the network , and in this sense act as a “ program modifier ” . The key component of our architecture is a locality sensitive hash ( LSH ) table based memory ( see Wang et al . ( 2021 ) ) that holds sketches of data ( such as inputs ) and modules or programs ( think of an encoding of a small deep network ) that handles such sketches ( Figure 1 , left ) . The “ operating system ” of our architecture executes the basic loop of taking sketches ( either from the environment or from internal modules ) and routing/hashing them to the LSH table to execute the next module that processes these sketches . These modules produce new sketches that are fed back into the loop . New modules ( or concepts ) are formed simply by instantiating a new hash bucket whenever a new frequently-occurring context arises , i.e . whenever several sketches hash to the same place ; the context can be viewed as a function-pointer and the sketch can be viewed as arguments for a call to that function . Frequent subsets of sketches may be combined to produce compound sketches . Finally we include pointers among sketches based on co-occurrence and co-reference in the sketches themselves . These pointers form a knowledge graph : for example if the inputs are images of pairs of people where the pairs are drawn from some latent social network , then assuming sufficient sampling of the network , this network will arise as a subgraph of the graph given by these pointers . The main loop allows these pointers to be dereferenced by passing them through the memory table , so they indeed serve the intended purpose . The main idea of the architecture is that all events produce sketches , which can intuitively be thought of as the “ mind-state ” of the system when that event occurs . The sketch-to-sketch similarity property ( see below ) combined with a similarity-preserving hash function ensures that similar sketches go to the same hash bucket ( Appendix B ) ; thus the hash table can be viewed as a content addressed memory . See Figure 1 for an illustration of this . We remark that the distances between embeddings of scene representations were used to automatically segment video into discrete events by Franklin et al . ( 2020 ) , and obtained strong agreement with human annotators . The thresholded distance used to obtain the segmentation is analogous to our locality-sensitive hashes , which we use as context sketches . A sketch can be viewed at different levels of granularity before using it to access the hash table ; this becomes the context of the sketch . Each bucket contains a program that is executed when a sketch arises that indexes into that bucket . The program in turn produces outputs and new sketches that are routed back to the hash table . The system works in a continuous loop where sketches are coming in from the environment and also from previous iterations ; the main structure of the loop is : Phenomena sketch context bucket program Phenomena input f h produces output Thus external and internal inputs arrive as sketches that are converted into a coarser representation using a function f ( see Section 2.1 below ) and then hashed to a bucket using a locality-sensitive hash function h. The program at that bucket is executed to produce an output-sketch that is fed back into the system and may also produce external outputs . This basic loop ( described in Algorithm 1 ) is executed by the routing module , which can be thought of as the operating system of the architecture . 2 SKETCHES REVIEW . Our architecture relies on the properties of the sketches introduced in Ghazi et al . ( 2019 ) . In this section we briefly describe the key properties of these sketches ; the interested reader is referred to Ghazi et al . ( 2019 ) ; Wang et al . ( 2021 ) for details . A sketch is a compact representation of a possibly exponentially-wide ( d×N ) matrix in which only a small number k of the columns are nonzero , that supports efficient computation of inner products , and for which encoding and decoding are performed by linear transformations . For concreteness , we note that sketches may be computed by random projections to Rd′ for d′ ≥ kd logN ; the JohnsonLindenstrauss Lemma then guarantees that inner-products are preserved . For our purposes , we suppose modules M1 , . . . , MN produce vectors x1 , . . . , xN ∈ Rd as output , where only k of the modules produce ( nonzero ) outputs . We view the sparse collection of module outputs as a small set of pairs of the form { [ Mi1 , xi1 ] , . . . , [ Mik , xik ] } : For example an input image has a sketch that can be thought of as a tuple [ IMAGE , 〈bit-map-sketch〉 ] . An output by an image recognition module that finds a person in the image can be represented as [ PERSON , [ 〈personsketch〉 , 〈position-in-image-sketch〉 ] ) ; here IMAGE and PERSON can be thought of as “ labels ” . If the outputs of these modules are vector embeddings in the usual sense , then indeed the inner products measure the similarity of the objects represented by the output embeddings . Observe that the constituent individual vectors xj in a sketch may themselves be sketches . For example , 〈person-sketch〉 could in turn be set of such pairs { [ NAME , 〈name-sketch〉 ] , [ FACIALFEATURES , 〈facial-sketch〉 ] , [ POSTURE , 〈posture-sketch〉 ] } , and an image consisting of multiple people could be mapped by our recognition module to a set { 〈person-1-sketch〉 , 〈person-2sketch〉 , . . . , 〈person-k-sketch〉 } . Note if the if the tuple is very large , we will not be able to recover the sketch of each of its members but only get a “ average ” or summary of all the sketches – however if a member has high enough relative weight ( see ( Ghazi et al. , 2019 , Section 3.3 ) ) it can be recovered . Appendix C.1 discusses how large objects can be stored as sketches hierarchically . Indeed , following Ghazi et al . ( 2019 ) , the outputs of modules in our architecture will be tuples that , in addition to an “ output ” component , represent the input sketches which , in turn , represent the modules that produced those inputs , e.g. , { [ MODULE-ID , 〈module-id〉 ] , [ OUTPUT-SKETCH , 〈outputsketch〉 ] , [ RECURSIVE-INPUT-SKETCH , 〈recursive-input-sketch〉 ] } . By recursively unpacking the input sketch , it is possible to reconstruct the history of computation that produced the sketch . Algorithm 1 Informal presentation of the main execution loop Input : input sketch T ( this sketch may contain a desired output for training ) 1 current-sketches← { T } 2 while current-sketches is not empty : 3 current-programs← ∅ 4 foreach sketch S in current-sketches do 5 extract context C = f ( S ) 6 update access-frequency-count of bucket h ( C ) 7 if bucket h ( C ) has a program P : 8 append ( S , P ) to current-programs 9 else : 10 if bucket h ( C ) is frequently accessed : 11 initialize program at h ( C ) with some random program and mark it for training . 12 Fetch programs Pi ( possibly by some similarity criterion ) , append those ( S , Pi ) to current-programs 13 Routing module chooses some subset of current-programs , runs each program on its associated sketch , appends outputs to current-sketches 14 Append sketches on outgoing edges of accessed buckets to current-sketches 15 if any of the programs are marked for training : 16 routing module picks one or some of them and trains them , and may choose to stop execution loop 17 if any of the sketches is of ( a special ) type OUTPUT sketch : 18 routing module picks one such , outputs that sketch or performs that action , and may choose to stop execution loop 19 if any of the sketches is of type REWARD sketch ( say for correct prediction or action ) : 20 updates the reward for this bucket and propagates those rewards to prior buckets 21 Routing module picks k combinations of sketches in current-sketches , and combine them into compound sketches : S1 , . . . , Sk ( may produce 0 sketches ) 22 current-sketches← { S1 , . . . , Sk }
The submission proposes an approach to lifelong learning using a sketch-based modular architecture. The primary contributions of the paper are proofs of the learnability of certain classes of tasks with three different choices of modular architectures. The algorithms are also evaluated empirically on toy supervised learning tasks.
SP:947b34e24d3d4faf15927f870765559c64b84536
Provable hierarchical lifelong learning with a sketch-based modular architecture
1 INTRODUCTION . How can complex concepts be learned ? Human experience suggests that hierarchical structure is key : the complex concepts we use are no more than simple combinations of slightly less complex concepts that we have already learned , and so on . This intuition suggests that the learning of complex concepts is most tractably approached in a setting where multiple tasks are present , where it is possible to leverage what was learned from one task in another . Lifelong learning ( Silver et al. , 2013 ; Chen & Liu , 2018 ) captures such a setting : we are presented with a sequence of learning tasks and wish to understand how to ( selectively ) transfer what was learned on previous tasks to novel tasks . We seek a method that we can analyze and prove leverages what it learns on simple tasks to efficiently learn complex tasks ; in particular , tasks that could not be learned without the help provided by learning the simple tasks first . In this work , we propose an architecture for addressing such problems based on creating new modules to represent the various tasks . Indeed , other modular approaches to lifelong learning ( Yoon et al. , 2018 ; Rusu et al. , 2016 ) have been proposed previously . But , these works did not consider what we view as the main advantage of such architectures : their suitability for theoretical analysis . We prove that our architecture is capable of efficiently learning complex tasks by utilizing the functions learned to solve previous tasks as components in an algorithm for the more complex task . In addition to our analysis proving that the complex tasks may be learned , we also demonstrate that such an approach can learn functions that standard training methods fail to learn in practice , including some that are believed not to be learnable , even in principle ( Klivans & Sherstov , 2009 ) . We also consider methods for automatically identifying whether a learning task posed to the agent matches a previously learned task or is a novel task . We note briefly that a few other works considered lifelong learning from a theoretical perspective . An early approach by Solomonoff ( 1989 ) did not seriously consider computational complexity aspects . Ruvolo & Eaton ( 2013 ) gave the first provable lifelong learning algorithm with such an analysis . But , the transfer of knowledge across tasks in their framework was limited to feature learning . In particular , they did not consider the kind of deep hierarchies of tasks that we seek to learn . 1.1 OVERVIEW OF THE ARCHITECTURE . The main technical novelty in our architecture over previous modular lifelong learners is that ours uses a particular type of internal data structure called sketches ( Ghazi et al. , 2019 ; Panigrahy , 2019 ) . All such data , including inputs from the environment , outputs from a module for another task , decisions such as choosing an action to take , or even descriptions of the modules themselves , are encoded as such sketches . Although sketches have a dense ( vector ) representation , they can also be interpreted as a kind of structured representation ( Ghazi et al. , 2019 , Theorem 9 ) and are recursive ; that is , they point to the previous modules/events that they arose from ( Figure 1 , right ) . However , in order to construct these sketches in Ghazi et al . ( 2019 ) , the structure of the network is assumed to be given . No algorithms for constructing such a hierarchical network of modules from training data were known . In this work we show a method to construct such a hierarchical network from training data . We provide an architecture and algorithms for learning from a stream of training inputs that produces such a network of modules over time . This includes challenges of identifying each module , and discovering which other modules it depends on . Our architecture can be viewed as a variant of the Transformer architecture ( Radford et al. , 2021 ; Shazeer et al. , 2017 ) , particularly the Switch Transformer ( Fedus et al. , 2021 ) in conjunction with the idea of Neural Memory ( Wang et al. , 2021 ) . Instead of having a single feedforward layer , the Switch Transformer has an array of feedforward layers that an input can be routed to at each layer . Neural Memory on the other hand is a large table of values , and one or a few locations of the memory can be accessed at each layer of a deep network . In a sense the Switch Transfomer can be viewed as having a memory of possible feedforward layers ( although they use very few ) to read from . It is viewing the memory as holding “ parts of a deep network ” as opposed to data , although this difference between program and data is artificial : for example , embedding table entries can be viewed as “ data ” but are also used to alter the computation of the rest of the network , and in this sense act as a “ program modifier ” . The key component of our architecture is a locality sensitive hash ( LSH ) table based memory ( see Wang et al . ( 2021 ) ) that holds sketches of data ( such as inputs ) and modules or programs ( think of an encoding of a small deep network ) that handles such sketches ( Figure 1 , left ) . The “ operating system ” of our architecture executes the basic loop of taking sketches ( either from the environment or from internal modules ) and routing/hashing them to the LSH table to execute the next module that processes these sketches . These modules produce new sketches that are fed back into the loop . New modules ( or concepts ) are formed simply by instantiating a new hash bucket whenever a new frequently-occurring context arises , i.e . whenever several sketches hash to the same place ; the context can be viewed as a function-pointer and the sketch can be viewed as arguments for a call to that function . Frequent subsets of sketches may be combined to produce compound sketches . Finally we include pointers among sketches based on co-occurrence and co-reference in the sketches themselves . These pointers form a knowledge graph : for example if the inputs are images of pairs of people where the pairs are drawn from some latent social network , then assuming sufficient sampling of the network , this network will arise as a subgraph of the graph given by these pointers . The main loop allows these pointers to be dereferenced by passing them through the memory table , so they indeed serve the intended purpose . The main idea of the architecture is that all events produce sketches , which can intuitively be thought of as the “ mind-state ” of the system when that event occurs . The sketch-to-sketch similarity property ( see below ) combined with a similarity-preserving hash function ensures that similar sketches go to the same hash bucket ( Appendix B ) ; thus the hash table can be viewed as a content addressed memory . See Figure 1 for an illustration of this . We remark that the distances between embeddings of scene representations were used to automatically segment video into discrete events by Franklin et al . ( 2020 ) , and obtained strong agreement with human annotators . The thresholded distance used to obtain the segmentation is analogous to our locality-sensitive hashes , which we use as context sketches . A sketch can be viewed at different levels of granularity before using it to access the hash table ; this becomes the context of the sketch . Each bucket contains a program that is executed when a sketch arises that indexes into that bucket . The program in turn produces outputs and new sketches that are routed back to the hash table . The system works in a continuous loop where sketches are coming in from the environment and also from previous iterations ; the main structure of the loop is : Phenomena sketch context bucket program Phenomena input f h produces output Thus external and internal inputs arrive as sketches that are converted into a coarser representation using a function f ( see Section 2.1 below ) and then hashed to a bucket using a locality-sensitive hash function h. The program at that bucket is executed to produce an output-sketch that is fed back into the system and may also produce external outputs . This basic loop ( described in Algorithm 1 ) is executed by the routing module , which can be thought of as the operating system of the architecture . 2 SKETCHES REVIEW . Our architecture relies on the properties of the sketches introduced in Ghazi et al . ( 2019 ) . In this section we briefly describe the key properties of these sketches ; the interested reader is referred to Ghazi et al . ( 2019 ) ; Wang et al . ( 2021 ) for details . A sketch is a compact representation of a possibly exponentially-wide ( d×N ) matrix in which only a small number k of the columns are nonzero , that supports efficient computation of inner products , and for which encoding and decoding are performed by linear transformations . For concreteness , we note that sketches may be computed by random projections to Rd′ for d′ ≥ kd logN ; the JohnsonLindenstrauss Lemma then guarantees that inner-products are preserved . For our purposes , we suppose modules M1 , . . . , MN produce vectors x1 , . . . , xN ∈ Rd as output , where only k of the modules produce ( nonzero ) outputs . We view the sparse collection of module outputs as a small set of pairs of the form { [ Mi1 , xi1 ] , . . . , [ Mik , xik ] } : For example an input image has a sketch that can be thought of as a tuple [ IMAGE , 〈bit-map-sketch〉 ] . An output by an image recognition module that finds a person in the image can be represented as [ PERSON , [ 〈personsketch〉 , 〈position-in-image-sketch〉 ] ) ; here IMAGE and PERSON can be thought of as “ labels ” . If the outputs of these modules are vector embeddings in the usual sense , then indeed the inner products measure the similarity of the objects represented by the output embeddings . Observe that the constituent individual vectors xj in a sketch may themselves be sketches . For example , 〈person-sketch〉 could in turn be set of such pairs { [ NAME , 〈name-sketch〉 ] , [ FACIALFEATURES , 〈facial-sketch〉 ] , [ POSTURE , 〈posture-sketch〉 ] } , and an image consisting of multiple people could be mapped by our recognition module to a set { 〈person-1-sketch〉 , 〈person-2sketch〉 , . . . , 〈person-k-sketch〉 } . Note if the if the tuple is very large , we will not be able to recover the sketch of each of its members but only get a “ average ” or summary of all the sketches – however if a member has high enough relative weight ( see ( Ghazi et al. , 2019 , Section 3.3 ) ) it can be recovered . Appendix C.1 discusses how large objects can be stored as sketches hierarchically . Indeed , following Ghazi et al . ( 2019 ) , the outputs of modules in our architecture will be tuples that , in addition to an “ output ” component , represent the input sketches which , in turn , represent the modules that produced those inputs , e.g. , { [ MODULE-ID , 〈module-id〉 ] , [ OUTPUT-SKETCH , 〈outputsketch〉 ] , [ RECURSIVE-INPUT-SKETCH , 〈recursive-input-sketch〉 ] } . By recursively unpacking the input sketch , it is possible to reconstruct the history of computation that produced the sketch . Algorithm 1 Informal presentation of the main execution loop Input : input sketch T ( this sketch may contain a desired output for training ) 1 current-sketches← { T } 2 while current-sketches is not empty : 3 current-programs← ∅ 4 foreach sketch S in current-sketches do 5 extract context C = f ( S ) 6 update access-frequency-count of bucket h ( C ) 7 if bucket h ( C ) has a program P : 8 append ( S , P ) to current-programs 9 else : 10 if bucket h ( C ) is frequently accessed : 11 initialize program at h ( C ) with some random program and mark it for training . 12 Fetch programs Pi ( possibly by some similarity criterion ) , append those ( S , Pi ) to current-programs 13 Routing module chooses some subset of current-programs , runs each program on its associated sketch , appends outputs to current-sketches 14 Append sketches on outgoing edges of accessed buckets to current-sketches 15 if any of the programs are marked for training : 16 routing module picks one or some of them and trains them , and may choose to stop execution loop 17 if any of the sketches is of ( a special ) type OUTPUT sketch : 18 routing module picks one such , outputs that sketch or performs that action , and may choose to stop execution loop 19 if any of the sketches is of type REWARD sketch ( say for correct prediction or action ) : 20 updates the reward for this bucket and propagates those rewards to prior buckets 21 Routing module picks k combinations of sketches in current-sketches , and combine them into compound sketches : S1 , . . . , Sk ( may produce 0 sketches ) 22 current-sketches← { S1 , . . . , Sk }
The authors propose a modular architecture for multitask learning in the presence of hierarchically structured tasks leveraging sketches and locally sensitive hashing. They further provide proofs and error bounds about how the proposed architecture can learn tasks while leveraging access to previously learned subroutines. The authors additionally provide extensions to the proposed architecture in the case of tasks depending on other tasks and lack of clear task boundaries. Empirical studies are conducted for this modular approach in comparison to end-to-end models on synthetic domains related to learning the intersection of half-spaces and MNIST digits.
SP:947b34e24d3d4faf15927f870765559c64b84536
Retriever: Learning Content-Style Representation as a Token-Level Bipartite Graph
1 INTRODUCTION . Human perceptual systems routinely separate content and style to better understand their observations ( Tenenbaum & Freeman , 2000 ) . In artificial intelligence , a content and style decomposed representation is also very much desired . However , we notice that existing work does not have a unified definition for content and style . Some definitions are dataset-dependent ( Chou & Lee , 2019 ; Ren et al. , 2021 ) , while some others have to be defined on a certain modality ( Lorenz et al. , 2019 ; Wu et al. , 2019 ) . We wonder , since content-style separation is helpful to our entire perception system , why is there not a unified definition that applies to all perception data ? In order to answer this question , we must first study the characteristics of data . The data of interest , including text , speech , image , and video , are structured . They can be divided into standardized tokens , either naturally as words in language and speech or intentionally as patches in images . Notably , the order of these tokens matters . Disrupting the order of words can make a speech express a completely different meaning . Reversing the order of frames in a video can make a stand-up action become a sit-down action . But there is also some information that is not affected by the order of tokens . For example , scrambling the words in a speech does not change the speaker ’ s voice , and a frame-shuffled video does not change how the person in the video looks . We notice that the content we intuitively think of is affected by the order of tokens , while the style is usually not . Therefore , we could generally define style as token-level permutation invariant ( P.I . ) information and define content as the rest of the information in structured data . However , merely dividing data into two parts is not enough . As Bengio et al . ( 2013 ) pointed out , if we are to take the notion of disentangling seriously , we require a richer interaction of features than that offered by simple linear combinations . An intuitive example is that we could never generate a colored pattern by linearly combining a generic color feature with a gray-scale stimulus pattern . Inspired by this , we propose to model content and style by a token-level bipartite graph , as Figure 1 illustrates . This representation includes an array of content tokens , a set of style tokens , and a set of links modeling the interaction between them . Such a representation allows for fine-grained access and manipulation of features , and enables exciting downstream tasks such as part-level style transfer . In this paper , we design a modal-agnostic framework , named Retriever , for learning bipartite graph representation of content and style . Retriever adopts the autoencoder architecture and addresses two main challenges in it . One is how to decompose the defined content and style in an unsupervised setting . The other is how to compose these two separated factors to reconstruct data . To tackle the first challenge , we employ a cross-attention module that takes the dataset-shared prototype as query to retrieve the style tokens from input data ( Carion et al. , 2020 ) . A cross-attention operation only allows the P.I . information to pass ( Lee et al. , 2019 ) , which is exactly what we want for style . On the other content path , we employ a vector quantization ( VQ ) module ( van den Oord et al. , 2017 ) as the information bottleneck . In addition , we enforce man-induced constraints to make the content tokens interpretable . To tackle the second challenge , we innovate the link attention module for the reconstruction from the bipartite graph . Specifically , the content and style serve as the query and value , respectively . Links between the content and style are learnt and stored in the linking keys . Link attention allows us to retrieve style by content query . As such , the interpretability is propagated from content to style , and the entire representation is friendly to fine-grained editing . We evaluate Retriever in both speech and image domains . In the speech domain , we achieve state-of-the-art ( SOTA ) performance in zero-shot voice conversion , demonstrating a complete and precise decomposition of content and style . In the image domain , we achieve competitive results in part discovery task , which demonstrates the interpretability of the decomposed content . More excitingly , we try part-level style transfer , which can not be offered by most of the existing contentstyle disentanglement approaches . Vivid and interpretable results are achieved . To summarize , our main contributions are three-folds : i ) We provide an intuitive and modalagnostic definition of content and style for structured data . We are the first to model content and style with a token-level bipartite graph . ii ) We propose an unsupervised framework , named Retriever , for learning the proposed content-style representation . A novel link attention module is designed for data reconstruction from content-style bipartite graph . iii ) We demonstrate the power of Retriever in challenging downstream tasks in both speech and image domains . 2 RELATED WORK . Content-style decomposed representation can be approached in supervised or unsupervised settings . When style labels , such as the speaker labels of speeches ( Kameoka et al. , 2018 ; Qian et al. , 2019 ; Yuan et al. , 2021 ) and the identity labels of face images ( Mathieu et al. , 2016 ; Szabó et al. , 2018 ; Jha et al. , 2018 ; Bouchacourt et al. , 2018 ; Gabbay & Hoshen , 2020 ) , are available , latent variables can be divided into content and style based on group supervision . Recently , there has been increased interest in unsupervised learning of content and style . Since there is no explicit supervision signal , the basic problem one must first solve is the definition of content and style . We discover that all existing definitions are either domain-specific or task-specific . For example , in speech domain , Chou & Lee ( 2019 ) assume that style is the global statistical information and content is what is left after instance normalization ( IN ) . Ebbers et al . ( 2021 ) suggest that style captures long-term stability and content captures short-term variations . In image domain , the definition is even more diverse . Lorenz et al . ( 2019 ) try to discover the invariants under spatial and appearance transformations and treat them as style and content , respectively . Wu et al . ( 2019 ) define content as 2D landmarks and style as the rest of information . Ren et al . ( 2021 ) define content as the most important factor across the whole dataset for image reconstruction , which is rather abstract . In this work , we attempt to find a general and modal-agnostic definition of content and style . Style transfer is partially related to our work , as it concerns the combination of content and style to reconstruct data . AdaIN ( Huang & Belongie , 2017 ; Chou & Lee , 2019 ) goes beyond the linear combination of content and style ( Tenenbaum & Freeman , 2000 ) and proposes to inject style into content by aligning the mean and variance of the content features with those of the style features . However , style is not separated from content in this line of research . Liu et al . ( 2021 ) touch upon the part-based style transfer task as we do . They model the relationship between content and style by a one-one mapping . They follow the common definition of content and style in the image domain as shape and appearance , and try to disentangle them with hand-crafted data augmentation methods . Besides , the term “ style ” is often seen in image generative models , such as StyleGAN ( Karras et al. , 2019 ) . However , the style mentioned in this type of work is conceptually different from the style in our work . In StyleGAN , there is no concept of content , and style is the whole latent variable containing all the information including the appearance and shape of an image . Following StyleGAN , Hudson & Zitnick ( 2021 ) employ a bipartite structure to enable long-range interactions across the image , which iteratively propagates information from a set of latent variables to the evolving visual features . Recently , researchers have become interested in disentangling content and style from the latent variables of StyleGAN ( Alharbi & Wonka , 2020 ; Kwon & Ye , 2021 ) . However , they only work for well-aligned images and are hard to be applied to other modalities . 3 CONTENT-STYLE REPRESENTATION FOR STRUCTURED DATA . In this section , we provide definitions of content and style for structured data , introduce the framework for content-style decomposition , and propose the token-level bipartite graph representation . 3.1 DEFINITION OF CONTENT AND STYLE . The data of interest is structured data that can be tokenized , denoted by X = [ x1 , x2 , ... , xn ] . We think of text , speech , and image , among many others , as structured data . Each token xi can be a word in text , a phoneme in a speech , or a patch in an image . These data are structured because non-trivial instances ( examples of trivial instances are a silent speech or a blank image ) are not able to keep their full information when the order of tokens is not given . Inspired by this intuition , we define style of X as the information that is not affected by the permutation of tokens , or permutation invariant ( P.I . ) information . Content is the rest of information in X . 3.2 CONTENT-STYLE SEPARATION . The information in a piece of structured data is carried either in the content or in the style . By definition , style can be extracted by a P.I . function fP.I . ( · ) , which satisfies f ( π ( X ) ) = f ( X ) , where π ( · ) represents permutation of tokens . To achieve content-style decomposition , we naturally adopt an autoencoder architecture , as shown in Figure 2 . The bottom path is the style path which implements fP.I. ( · ) . We shall find a powerful P.I . function which will let all the P.I . information pass . The top path is responsible for extracting the content , but the challenge is that there does not exist a function which only lets pass the non-P.I . information . Therefore , we employ in the content path a permutation-variant function , which will let all information pass , including the P.I . information . Obviously , if we do not pose any constraint on the content path , as shown in Figure 2 ( a ) , the style information will be leaked to the content path . To squeeze the style information out of the content path , an information bottleneck fB.N . ( · ) is required . A perfect bottleneck , as shown in Figure 2 ( c ) , can avoid the style leak while achieving perfect reconstruction . But an imperfect bottleneck , being too wide or too narrow , will cause style leak or content loss , as shown in Figure 2 ( b ) and Figure 2 ( d ) , respectively .
The paper proposes a novel idea of disentangling the content and style of structured data by treating style as permutation invariant information. It adopts VQ network for content encoding, and Cross-Attention for Style and Linking Attention at decoder. It is shown to be domain agonistic - worked well in image and audio domain.
SP:722cc6521f20497b8c08fda764bdf11704fb1ffb
Retriever: Learning Content-Style Representation as a Token-Level Bipartite Graph
1 INTRODUCTION . Human perceptual systems routinely separate content and style to better understand their observations ( Tenenbaum & Freeman , 2000 ) . In artificial intelligence , a content and style decomposed representation is also very much desired . However , we notice that existing work does not have a unified definition for content and style . Some definitions are dataset-dependent ( Chou & Lee , 2019 ; Ren et al. , 2021 ) , while some others have to be defined on a certain modality ( Lorenz et al. , 2019 ; Wu et al. , 2019 ) . We wonder , since content-style separation is helpful to our entire perception system , why is there not a unified definition that applies to all perception data ? In order to answer this question , we must first study the characteristics of data . The data of interest , including text , speech , image , and video , are structured . They can be divided into standardized tokens , either naturally as words in language and speech or intentionally as patches in images . Notably , the order of these tokens matters . Disrupting the order of words can make a speech express a completely different meaning . Reversing the order of frames in a video can make a stand-up action become a sit-down action . But there is also some information that is not affected by the order of tokens . For example , scrambling the words in a speech does not change the speaker ’ s voice , and a frame-shuffled video does not change how the person in the video looks . We notice that the content we intuitively think of is affected by the order of tokens , while the style is usually not . Therefore , we could generally define style as token-level permutation invariant ( P.I . ) information and define content as the rest of the information in structured data . However , merely dividing data into two parts is not enough . As Bengio et al . ( 2013 ) pointed out , if we are to take the notion of disentangling seriously , we require a richer interaction of features than that offered by simple linear combinations . An intuitive example is that we could never generate a colored pattern by linearly combining a generic color feature with a gray-scale stimulus pattern . Inspired by this , we propose to model content and style by a token-level bipartite graph , as Figure 1 illustrates . This representation includes an array of content tokens , a set of style tokens , and a set of links modeling the interaction between them . Such a representation allows for fine-grained access and manipulation of features , and enables exciting downstream tasks such as part-level style transfer . In this paper , we design a modal-agnostic framework , named Retriever , for learning bipartite graph representation of content and style . Retriever adopts the autoencoder architecture and addresses two main challenges in it . One is how to decompose the defined content and style in an unsupervised setting . The other is how to compose these two separated factors to reconstruct data . To tackle the first challenge , we employ a cross-attention module that takes the dataset-shared prototype as query to retrieve the style tokens from input data ( Carion et al. , 2020 ) . A cross-attention operation only allows the P.I . information to pass ( Lee et al. , 2019 ) , which is exactly what we want for style . On the other content path , we employ a vector quantization ( VQ ) module ( van den Oord et al. , 2017 ) as the information bottleneck . In addition , we enforce man-induced constraints to make the content tokens interpretable . To tackle the second challenge , we innovate the link attention module for the reconstruction from the bipartite graph . Specifically , the content and style serve as the query and value , respectively . Links between the content and style are learnt and stored in the linking keys . Link attention allows us to retrieve style by content query . As such , the interpretability is propagated from content to style , and the entire representation is friendly to fine-grained editing . We evaluate Retriever in both speech and image domains . In the speech domain , we achieve state-of-the-art ( SOTA ) performance in zero-shot voice conversion , demonstrating a complete and precise decomposition of content and style . In the image domain , we achieve competitive results in part discovery task , which demonstrates the interpretability of the decomposed content . More excitingly , we try part-level style transfer , which can not be offered by most of the existing contentstyle disentanglement approaches . Vivid and interpretable results are achieved . To summarize , our main contributions are three-folds : i ) We provide an intuitive and modalagnostic definition of content and style for structured data . We are the first to model content and style with a token-level bipartite graph . ii ) We propose an unsupervised framework , named Retriever , for learning the proposed content-style representation . A novel link attention module is designed for data reconstruction from content-style bipartite graph . iii ) We demonstrate the power of Retriever in challenging downstream tasks in both speech and image domains . 2 RELATED WORK . Content-style decomposed representation can be approached in supervised or unsupervised settings . When style labels , such as the speaker labels of speeches ( Kameoka et al. , 2018 ; Qian et al. , 2019 ; Yuan et al. , 2021 ) and the identity labels of face images ( Mathieu et al. , 2016 ; Szabó et al. , 2018 ; Jha et al. , 2018 ; Bouchacourt et al. , 2018 ; Gabbay & Hoshen , 2020 ) , are available , latent variables can be divided into content and style based on group supervision . Recently , there has been increased interest in unsupervised learning of content and style . Since there is no explicit supervision signal , the basic problem one must first solve is the definition of content and style . We discover that all existing definitions are either domain-specific or task-specific . For example , in speech domain , Chou & Lee ( 2019 ) assume that style is the global statistical information and content is what is left after instance normalization ( IN ) . Ebbers et al . ( 2021 ) suggest that style captures long-term stability and content captures short-term variations . In image domain , the definition is even more diverse . Lorenz et al . ( 2019 ) try to discover the invariants under spatial and appearance transformations and treat them as style and content , respectively . Wu et al . ( 2019 ) define content as 2D landmarks and style as the rest of information . Ren et al . ( 2021 ) define content as the most important factor across the whole dataset for image reconstruction , which is rather abstract . In this work , we attempt to find a general and modal-agnostic definition of content and style . Style transfer is partially related to our work , as it concerns the combination of content and style to reconstruct data . AdaIN ( Huang & Belongie , 2017 ; Chou & Lee , 2019 ) goes beyond the linear combination of content and style ( Tenenbaum & Freeman , 2000 ) and proposes to inject style into content by aligning the mean and variance of the content features with those of the style features . However , style is not separated from content in this line of research . Liu et al . ( 2021 ) touch upon the part-based style transfer task as we do . They model the relationship between content and style by a one-one mapping . They follow the common definition of content and style in the image domain as shape and appearance , and try to disentangle them with hand-crafted data augmentation methods . Besides , the term “ style ” is often seen in image generative models , such as StyleGAN ( Karras et al. , 2019 ) . However , the style mentioned in this type of work is conceptually different from the style in our work . In StyleGAN , there is no concept of content , and style is the whole latent variable containing all the information including the appearance and shape of an image . Following StyleGAN , Hudson & Zitnick ( 2021 ) employ a bipartite structure to enable long-range interactions across the image , which iteratively propagates information from a set of latent variables to the evolving visual features . Recently , researchers have become interested in disentangling content and style from the latent variables of StyleGAN ( Alharbi & Wonka , 2020 ; Kwon & Ye , 2021 ) . However , they only work for well-aligned images and are hard to be applied to other modalities . 3 CONTENT-STYLE REPRESENTATION FOR STRUCTURED DATA . In this section , we provide definitions of content and style for structured data , introduce the framework for content-style decomposition , and propose the token-level bipartite graph representation . 3.1 DEFINITION OF CONTENT AND STYLE . The data of interest is structured data that can be tokenized , denoted by X = [ x1 , x2 , ... , xn ] . We think of text , speech , and image , among many others , as structured data . Each token xi can be a word in text , a phoneme in a speech , or a patch in an image . These data are structured because non-trivial instances ( examples of trivial instances are a silent speech or a blank image ) are not able to keep their full information when the order of tokens is not given . Inspired by this intuition , we define style of X as the information that is not affected by the permutation of tokens , or permutation invariant ( P.I . ) information . Content is the rest of information in X . 3.2 CONTENT-STYLE SEPARATION . The information in a piece of structured data is carried either in the content or in the style . By definition , style can be extracted by a P.I . function fP.I . ( · ) , which satisfies f ( π ( X ) ) = f ( X ) , where π ( · ) represents permutation of tokens . To achieve content-style decomposition , we naturally adopt an autoencoder architecture , as shown in Figure 2 . The bottom path is the style path which implements fP.I. ( · ) . We shall find a powerful P.I . function which will let all the P.I . information pass . The top path is responsible for extracting the content , but the challenge is that there does not exist a function which only lets pass the non-P.I . information . Therefore , we employ in the content path a permutation-variant function , which will let all information pass , including the P.I . information . Obviously , if we do not pose any constraint on the content path , as shown in Figure 2 ( a ) , the style information will be leaked to the content path . To squeeze the style information out of the content path , an information bottleneck fB.N . ( · ) is required . A perfect bottleneck , as shown in Figure 2 ( c ) , can avoid the style leak while achieving perfect reconstruction . But an imperfect bottleneck , being too wide or too narrow , will cause style leak or content loss , as shown in Figure 2 ( b ) and Figure 2 ( d ) , respectively .
This paper proposes a framework for learning disentangled representations of content and style in an unsupervised way. The paper presents a slightly uncommon definition of content and style, which serves as a foundation for the proposed methodology and experiments. Experiments are conducted on speech and image datasets.
SP:722cc6521f20497b8c08fda764bdf11704fb1ffb
Retriever: Learning Content-Style Representation as a Token-Level Bipartite Graph
1 INTRODUCTION . Human perceptual systems routinely separate content and style to better understand their observations ( Tenenbaum & Freeman , 2000 ) . In artificial intelligence , a content and style decomposed representation is also very much desired . However , we notice that existing work does not have a unified definition for content and style . Some definitions are dataset-dependent ( Chou & Lee , 2019 ; Ren et al. , 2021 ) , while some others have to be defined on a certain modality ( Lorenz et al. , 2019 ; Wu et al. , 2019 ) . We wonder , since content-style separation is helpful to our entire perception system , why is there not a unified definition that applies to all perception data ? In order to answer this question , we must first study the characteristics of data . The data of interest , including text , speech , image , and video , are structured . They can be divided into standardized tokens , either naturally as words in language and speech or intentionally as patches in images . Notably , the order of these tokens matters . Disrupting the order of words can make a speech express a completely different meaning . Reversing the order of frames in a video can make a stand-up action become a sit-down action . But there is also some information that is not affected by the order of tokens . For example , scrambling the words in a speech does not change the speaker ’ s voice , and a frame-shuffled video does not change how the person in the video looks . We notice that the content we intuitively think of is affected by the order of tokens , while the style is usually not . Therefore , we could generally define style as token-level permutation invariant ( P.I . ) information and define content as the rest of the information in structured data . However , merely dividing data into two parts is not enough . As Bengio et al . ( 2013 ) pointed out , if we are to take the notion of disentangling seriously , we require a richer interaction of features than that offered by simple linear combinations . An intuitive example is that we could never generate a colored pattern by linearly combining a generic color feature with a gray-scale stimulus pattern . Inspired by this , we propose to model content and style by a token-level bipartite graph , as Figure 1 illustrates . This representation includes an array of content tokens , a set of style tokens , and a set of links modeling the interaction between them . Such a representation allows for fine-grained access and manipulation of features , and enables exciting downstream tasks such as part-level style transfer . In this paper , we design a modal-agnostic framework , named Retriever , for learning bipartite graph representation of content and style . Retriever adopts the autoencoder architecture and addresses two main challenges in it . One is how to decompose the defined content and style in an unsupervised setting . The other is how to compose these two separated factors to reconstruct data . To tackle the first challenge , we employ a cross-attention module that takes the dataset-shared prototype as query to retrieve the style tokens from input data ( Carion et al. , 2020 ) . A cross-attention operation only allows the P.I . information to pass ( Lee et al. , 2019 ) , which is exactly what we want for style . On the other content path , we employ a vector quantization ( VQ ) module ( van den Oord et al. , 2017 ) as the information bottleneck . In addition , we enforce man-induced constraints to make the content tokens interpretable . To tackle the second challenge , we innovate the link attention module for the reconstruction from the bipartite graph . Specifically , the content and style serve as the query and value , respectively . Links between the content and style are learnt and stored in the linking keys . Link attention allows us to retrieve style by content query . As such , the interpretability is propagated from content to style , and the entire representation is friendly to fine-grained editing . We evaluate Retriever in both speech and image domains . In the speech domain , we achieve state-of-the-art ( SOTA ) performance in zero-shot voice conversion , demonstrating a complete and precise decomposition of content and style . In the image domain , we achieve competitive results in part discovery task , which demonstrates the interpretability of the decomposed content . More excitingly , we try part-level style transfer , which can not be offered by most of the existing contentstyle disentanglement approaches . Vivid and interpretable results are achieved . To summarize , our main contributions are three-folds : i ) We provide an intuitive and modalagnostic definition of content and style for structured data . We are the first to model content and style with a token-level bipartite graph . ii ) We propose an unsupervised framework , named Retriever , for learning the proposed content-style representation . A novel link attention module is designed for data reconstruction from content-style bipartite graph . iii ) We demonstrate the power of Retriever in challenging downstream tasks in both speech and image domains . 2 RELATED WORK . Content-style decomposed representation can be approached in supervised or unsupervised settings . When style labels , such as the speaker labels of speeches ( Kameoka et al. , 2018 ; Qian et al. , 2019 ; Yuan et al. , 2021 ) and the identity labels of face images ( Mathieu et al. , 2016 ; Szabó et al. , 2018 ; Jha et al. , 2018 ; Bouchacourt et al. , 2018 ; Gabbay & Hoshen , 2020 ) , are available , latent variables can be divided into content and style based on group supervision . Recently , there has been increased interest in unsupervised learning of content and style . Since there is no explicit supervision signal , the basic problem one must first solve is the definition of content and style . We discover that all existing definitions are either domain-specific or task-specific . For example , in speech domain , Chou & Lee ( 2019 ) assume that style is the global statistical information and content is what is left after instance normalization ( IN ) . Ebbers et al . ( 2021 ) suggest that style captures long-term stability and content captures short-term variations . In image domain , the definition is even more diverse . Lorenz et al . ( 2019 ) try to discover the invariants under spatial and appearance transformations and treat them as style and content , respectively . Wu et al . ( 2019 ) define content as 2D landmarks and style as the rest of information . Ren et al . ( 2021 ) define content as the most important factor across the whole dataset for image reconstruction , which is rather abstract . In this work , we attempt to find a general and modal-agnostic definition of content and style . Style transfer is partially related to our work , as it concerns the combination of content and style to reconstruct data . AdaIN ( Huang & Belongie , 2017 ; Chou & Lee , 2019 ) goes beyond the linear combination of content and style ( Tenenbaum & Freeman , 2000 ) and proposes to inject style into content by aligning the mean and variance of the content features with those of the style features . However , style is not separated from content in this line of research . Liu et al . ( 2021 ) touch upon the part-based style transfer task as we do . They model the relationship between content and style by a one-one mapping . They follow the common definition of content and style in the image domain as shape and appearance , and try to disentangle them with hand-crafted data augmentation methods . Besides , the term “ style ” is often seen in image generative models , such as StyleGAN ( Karras et al. , 2019 ) . However , the style mentioned in this type of work is conceptually different from the style in our work . In StyleGAN , there is no concept of content , and style is the whole latent variable containing all the information including the appearance and shape of an image . Following StyleGAN , Hudson & Zitnick ( 2021 ) employ a bipartite structure to enable long-range interactions across the image , which iteratively propagates information from a set of latent variables to the evolving visual features . Recently , researchers have become interested in disentangling content and style from the latent variables of StyleGAN ( Alharbi & Wonka , 2020 ; Kwon & Ye , 2021 ) . However , they only work for well-aligned images and are hard to be applied to other modalities . 3 CONTENT-STYLE REPRESENTATION FOR STRUCTURED DATA . In this section , we provide definitions of content and style for structured data , introduce the framework for content-style decomposition , and propose the token-level bipartite graph representation . 3.1 DEFINITION OF CONTENT AND STYLE . The data of interest is structured data that can be tokenized , denoted by X = [ x1 , x2 , ... , xn ] . We think of text , speech , and image , among many others , as structured data . Each token xi can be a word in text , a phoneme in a speech , or a patch in an image . These data are structured because non-trivial instances ( examples of trivial instances are a silent speech or a blank image ) are not able to keep their full information when the order of tokens is not given . Inspired by this intuition , we define style of X as the information that is not affected by the permutation of tokens , or permutation invariant ( P.I . ) information . Content is the rest of information in X . 3.2 CONTENT-STYLE SEPARATION . The information in a piece of structured data is carried either in the content or in the style . By definition , style can be extracted by a P.I . function fP.I . ( · ) , which satisfies f ( π ( X ) ) = f ( X ) , where π ( · ) represents permutation of tokens . To achieve content-style decomposition , we naturally adopt an autoencoder architecture , as shown in Figure 2 . The bottom path is the style path which implements fP.I. ( · ) . We shall find a powerful P.I . function which will let all the P.I . information pass . The top path is responsible for extracting the content , but the challenge is that there does not exist a function which only lets pass the non-P.I . information . Therefore , we employ in the content path a permutation-variant function , which will let all information pass , including the P.I . information . Obviously , if we do not pose any constraint on the content path , as shown in Figure 2 ( a ) , the style information will be leaked to the content path . To squeeze the style information out of the content path , an information bottleneck fB.N . ( · ) is required . A perfect bottleneck , as shown in Figure 2 ( c ) , can avoid the style leak while achieving perfect reconstruction . But an imperfect bottleneck , being too wide or too narrow , will cause style leak or content loss , as shown in Figure 2 ( b ) and Figure 2 ( d ) , respectively .
This paper proposes an unsupervised framework to learn content and style representations of structured data, such as texts, images and speeches. The task is interesting to me and decomposition representation learning is important. In addition, a bipartite graph is proposed to model the link between content tokens and style tokens, making the model more interpretable. The proposed model performs relatively well on both speech and image domains.
SP:722cc6521f20497b8c08fda764bdf11704fb1ffb
Half-Inverse Gradients for Physical Deep Learning
1 INTRODUCTION . The groundbreaking successes of deep learning ( Krizhevsky et al. , 2012 ; Sutskever et al. , 2014 ; Silver et al. , 2017 ) have led to ongoing efforts to study the capabilities of neural networks across all scientific disciplines . In the area of physical simulation , neural networks have been used in various ways , such as creating accurate reduced-order models ( Morton et al. , 2018 ) , inferring improved discretization stencils ( Bar-Sinai et al. , 2019 ) , or suppressing numerical errors ( Um et al. , 2020 ) . The long-term goal of these methods is to exceed classical simulations in terms of accuracy and speed , which has been achieved , e.g. , for rigid bodies ( de Avila Belbute-Peres et al. , 2018 ) , physical inverse problems ( Holl et al. , 2020 ) , and two-dimensional turbulence ( Kochkov et al. , 2021 ) . The successful application of deep learning to physical systems naturally hinges on the training setup . In recent years , the use of physical loss functions has proven beneficial for the training procedure , yielding substantial improvements over purely supervised training approaches ( Tompson et al. , 2017 ; Wu & Tegmark , 2019 ; Greydanus et al. , 2019 ) . These improvements were shown to stem from three aspects ( Battaglia et al. , 2016 ; Holl et al. , 2020 ) : ( i ) Incorporating prior knowledge from physical principles facilitates the learning process , ( ii ) the ambiguities of multimodal cases are resolved naturally , and ( iii ) simulating the physics at training time can provide more realistic data distributions than pre-computed data sets . Approaches for training with physical losses can be divided into two categories . On the one hand , equation-focused approaches that introduce physical residuals ( Tompson et al. , 2017 ; Raissi et al. , 2019 ) , and on the other hand , solver-focused approaches that additionally integrate well-established numerical procedures into the training ( Um et al. , 2020 ; Kochkov et al. , 2021 ) . From a mathematical point of view , training a neural network with a physical loss function bears the difficulties of both network training and physics optimization . In order to obtain satisfying results , it is vital to treat flat regions of the optimization landscapes effectively . In learning , the challenging loss landscapes are addressed using gradient-based optimizers with data-based normalizing schemes such as Adam ( Kingma & Ba , 2015 ) , whereas in physics , the optimizers of choice are higher-order techniques such as Newton ’ s method ( Gill & Murray , 1978 ) that inherently make use of inversion processes . However , Holl et al . ( 2021 ) found that these approaches can not effectively handle the joint optimization of network and physics . Gradient-descent-based optimizers suffer from vanishing or exploding gradients , preventing effective convergence , while higher-order methods do not generally scale to the high-dimensional parameter spaces required by deep learning ( Goodfellow et al. , 2016 ) . We likewise focus on inversion-based approach but propose a new method for joint physics and network optimization which we refer to as half-inverse gradients . At its core lies a partial matrix inversion , which we derive from the interaction between network and physics both formally and geometrically . An important property of our method is that its runtime scales linearly in the number of network parameters . To demonstrate the wide-ranging and practical applicability of our method , we show that it yields significant improvements in terms of convergence speed and final loss values over existing methods . These improvements are measured both in terms of absolute accuracy as well as wall-clock time . We evaluate a diverse set of physical systems , such as the Schrödinger equation , a nonlinear chain system and the Poisson problem . 2 GRADIENTS BASED ON HALF-INVERSE JACOBIANS . Optimization on continuous spaces can be effectively performed with derivative-based methods , the simplest of which is gradient descent . For a target function L ( θ ) to be minimized of several variables θ , using bold symbols for vector-valued quantitites in this section , and learning rate η , gradient descent proceeds by repeatedly applying updates ∆θGD ( η ) = −η · ( ∂L ∂θ ) > . ( 1 ) For quadratic objectives , this algorithm convergences linearly with the rate of convergence depending on the condition number λ of the Hessian matrix ( Lax , 2014 ) . In the ill-conditioned case λ 1 , flat regions in the optimization landscape can significantly slow down the optimization progress . This is a ubiquitous problem in non-convex optimization tasks of the generic form : L ( θ ) = ∑ i l ( yi ( θ ) , ŷi ) = ∑ i l ( f ( xi ; θ ) , ŷi ) ( 2 ) Here ( xi , ŷi ) denotes the ith data points from a chosen set of measurements , f is a function parametrized by θ to be optimized to model the relationship between the data points yi ( θ ) = f ( xi ; θ ) , and l denotes a loss function measuring the optimization progress . In the following , we assume the most common case of l ( yi , ŷi ) = 12 ||yi − ŷi|| 2 2 being the squared l2-loss Physics Optimization . Simulating a physical system consists of two steps : ( i ) mathematically modeling the system by a differential equation , and ( ii ) discretizing the occuring differential operators to receive a solver usable on a computer . If we then wish to manipulate a physical system by an external force to reach a given configuration , we have to solve an inverse problem of the form 2 . In such a control task , the sum reduces to a single data point ( x , ŷ ) with x being the initial state , ŷ the target state and θ the external force we want to find . The physical solver corresponds to the function f representing time evolution y ( θ ) = f ( x ; θ ) . This single data point sum still includes squared summation over vector components of y − ŷ in the l2-loss . Sensitive behavior of the physical system connected to its high-frequency modes is present in the physical solver f , and produces small singular values in its linear approximation . This leads to an ill-conditioned Jacobian and flat regions in the optimization landscape when minimizing 2 . This is addressed by using methods that incorporate more information than only the gradient . Prominent examples are Newton ’ s method or the Gauss-Newton ’ s algorithm ( Gill & Murray , 1978 ) ; the latter one is based on the Jacobian of f and the loss gradient : ∆θGN = − ( ∂y ∂θ ) −1 · ( ∂L ∂y ) > ( 3 ) Here , the inversion of the Jacobian is done with the pseudoinverse . The Gauss-Newton update maps the steepest descent direction in y space to the parameter space θ . Therefore , to first order , the resulting update approximates gradient descent steps in y space , further details of which are given in the appendix . An advantage of this formulation is that the update steps in y space are invariant under arbitrary rescaling of the parameters θ , which cancels inherent scales in f and ensures quick progress in the optimization landscape . Neural Network Training . When f represents a neural network in equation 2 , the optimization matches the typical supervised learning task . In this context , the problem of flat regions in the optimization landscape is also referred to as pathological curvature ( Martens , 2010 ) . Solving this problem with higher-order methods is considered to be too expensive given the large number of parameters θ . For learning tasks , widely used optimizers such as Adam instead use gradient information from earlier update steps , for instance in the form of momentum or adaptive learning rate terms , thereby achieving better optimization progress at little additional computational cost . Additionally , the updates are computed on mini-batches instead of the full data set , which saves computational resources and benefits generalization . Neural Network Training with Physics Objectives . For the remainder of the paper , we consider joint optimization problems , where f denotes a composition of a neural network parameterized by θ and a physics solver . Using classical network optimizers for minimizing equation 2 is inefficient in this case since data normalization in the network output space is not possible and the classical initialization schemes can not normalize the effects of the physics solver . As such , they are unsuited to capture the strong coupling between optimization parameters typically encountered in physics applications . While Gauss-Newton seems promising for these cases , the involved Jacobian inversion tends to result in large overshoots in the updates when the involved physics solver is ill-conditioned . As we will demonstrate , this leads to oversaturation of neurons , hampering the learning capability of the neural network . 2.1 AN ILL-CONDITIONED TOY EXAMPLE . To illustrate the argumentation so far , we consider a data set sampled from ŷ ( x ) = ( sin ( 6x ) , cos ( 9x ) ) for x ∈ [ −1 , 1 ] : We train a neural network to describe this data set by using the loss function l ( y , ŷ ; γ ) = 12 ( y1 − ŷ1 ) 2 + 12 ( λ · y2 − ŷ2 ) 2 , where y1 and y2 denote the first and second component of the y-vectors . For a scale factor of γ = 1 , we receive the well-conditioned mean squared error loss . However , l becomes increasingly ill-conditioned as γ is decreased , which mimics the effects of a physics solver . For real-world physics solvers the situation would typically be even more pronounced , as these scales usually vary strongly in direction and magnitude across different data points and optimization steps . We use a small neural network with a single hidden layer with 7 neurons and a tanh activation . We then compare training with the well-conditioned γ = 1 loss against an ill-conditioned γ = 0.01 loss . In both cases , we train the network using both Adam and Gauss-Newton as representatives of gradient-based and higher-order optimizers , respectively . The results are shown in figure 1 . In the well-conditioned case , Adam and Gauss-Newton behave similarly , decreasing the loss by about three orders of magnitude . However , in the ill-conditioned case , both optimizers fail to minimize the objective beyond a certain point . To explain this observation , we first illustrate the behavior from the physics viewpoint by considering the trajectory of the network output f ( x ) for a single value x during training ( figure 1 , right ) . For γ= 1 , Adam optimizes the network to accurately predict ŷ ( x ) while for γ= 0.01 , the updates neglect the second component preventing Adam to move efficiently along the small-scale coordinate ( blue curve in figure 1b , right ) . To illustrate the situation from the viewpoint of the network , we consider the variance in the outputs of specific neurons over different x ( figure 1 , middle ) . When γ = 1 , all neurons process information by producing different outcomes for different x . However , for γ = 0.01 , Gauss-Newton ’ s inversion of the small-scale component y2 results in large updates , leading to an oversaturation of neurons ( red curve in figure 1b , middle ) . These neurons stop processing information , reducing the effective capacity of the network and preventing the network from accurately fitting ŷ . Facing these problems , a natural questions arises : Is it possible to construct an algorithm that can successfully process the inherently different scales of a physics solver while training a neural network at the same time ?
The paper proposes a way to interpolate between gradient descent and Gauss-Newton's method for solving nonlinear least squares problems arising from physics informed training. The authors cite past work that physics informed training is often ill conditioned, so gradient descent often performs poorly. They give a classic example of ill-conditioning, and show that gradient descent converges slowly, while Gauss-Newton quickly saturates neuron activations. This motivates them to introduce Half-Inverse Gradients (HIG), which interpolates between GD and GN using the SVD. The authors then try the method on several test problems in scientific computing: Control of nonlinear oscillators, Poisson, and control of a Quantum dipole. They compare Adam, HIG, and GN.
SP:8941a9f4e862c5d17fbed644a647f8aa73b7737a
Half-Inverse Gradients for Physical Deep Learning
1 INTRODUCTION . The groundbreaking successes of deep learning ( Krizhevsky et al. , 2012 ; Sutskever et al. , 2014 ; Silver et al. , 2017 ) have led to ongoing efforts to study the capabilities of neural networks across all scientific disciplines . In the area of physical simulation , neural networks have been used in various ways , such as creating accurate reduced-order models ( Morton et al. , 2018 ) , inferring improved discretization stencils ( Bar-Sinai et al. , 2019 ) , or suppressing numerical errors ( Um et al. , 2020 ) . The long-term goal of these methods is to exceed classical simulations in terms of accuracy and speed , which has been achieved , e.g. , for rigid bodies ( de Avila Belbute-Peres et al. , 2018 ) , physical inverse problems ( Holl et al. , 2020 ) , and two-dimensional turbulence ( Kochkov et al. , 2021 ) . The successful application of deep learning to physical systems naturally hinges on the training setup . In recent years , the use of physical loss functions has proven beneficial for the training procedure , yielding substantial improvements over purely supervised training approaches ( Tompson et al. , 2017 ; Wu & Tegmark , 2019 ; Greydanus et al. , 2019 ) . These improvements were shown to stem from three aspects ( Battaglia et al. , 2016 ; Holl et al. , 2020 ) : ( i ) Incorporating prior knowledge from physical principles facilitates the learning process , ( ii ) the ambiguities of multimodal cases are resolved naturally , and ( iii ) simulating the physics at training time can provide more realistic data distributions than pre-computed data sets . Approaches for training with physical losses can be divided into two categories . On the one hand , equation-focused approaches that introduce physical residuals ( Tompson et al. , 2017 ; Raissi et al. , 2019 ) , and on the other hand , solver-focused approaches that additionally integrate well-established numerical procedures into the training ( Um et al. , 2020 ; Kochkov et al. , 2021 ) . From a mathematical point of view , training a neural network with a physical loss function bears the difficulties of both network training and physics optimization . In order to obtain satisfying results , it is vital to treat flat regions of the optimization landscapes effectively . In learning , the challenging loss landscapes are addressed using gradient-based optimizers with data-based normalizing schemes such as Adam ( Kingma & Ba , 2015 ) , whereas in physics , the optimizers of choice are higher-order techniques such as Newton ’ s method ( Gill & Murray , 1978 ) that inherently make use of inversion processes . However , Holl et al . ( 2021 ) found that these approaches can not effectively handle the joint optimization of network and physics . Gradient-descent-based optimizers suffer from vanishing or exploding gradients , preventing effective convergence , while higher-order methods do not generally scale to the high-dimensional parameter spaces required by deep learning ( Goodfellow et al. , 2016 ) . We likewise focus on inversion-based approach but propose a new method for joint physics and network optimization which we refer to as half-inverse gradients . At its core lies a partial matrix inversion , which we derive from the interaction between network and physics both formally and geometrically . An important property of our method is that its runtime scales linearly in the number of network parameters . To demonstrate the wide-ranging and practical applicability of our method , we show that it yields significant improvements in terms of convergence speed and final loss values over existing methods . These improvements are measured both in terms of absolute accuracy as well as wall-clock time . We evaluate a diverse set of physical systems , such as the Schrödinger equation , a nonlinear chain system and the Poisson problem . 2 GRADIENTS BASED ON HALF-INVERSE JACOBIANS . Optimization on continuous spaces can be effectively performed with derivative-based methods , the simplest of which is gradient descent . For a target function L ( θ ) to be minimized of several variables θ , using bold symbols for vector-valued quantitites in this section , and learning rate η , gradient descent proceeds by repeatedly applying updates ∆θGD ( η ) = −η · ( ∂L ∂θ ) > . ( 1 ) For quadratic objectives , this algorithm convergences linearly with the rate of convergence depending on the condition number λ of the Hessian matrix ( Lax , 2014 ) . In the ill-conditioned case λ 1 , flat regions in the optimization landscape can significantly slow down the optimization progress . This is a ubiquitous problem in non-convex optimization tasks of the generic form : L ( θ ) = ∑ i l ( yi ( θ ) , ŷi ) = ∑ i l ( f ( xi ; θ ) , ŷi ) ( 2 ) Here ( xi , ŷi ) denotes the ith data points from a chosen set of measurements , f is a function parametrized by θ to be optimized to model the relationship between the data points yi ( θ ) = f ( xi ; θ ) , and l denotes a loss function measuring the optimization progress . In the following , we assume the most common case of l ( yi , ŷi ) = 12 ||yi − ŷi|| 2 2 being the squared l2-loss Physics Optimization . Simulating a physical system consists of two steps : ( i ) mathematically modeling the system by a differential equation , and ( ii ) discretizing the occuring differential operators to receive a solver usable on a computer . If we then wish to manipulate a physical system by an external force to reach a given configuration , we have to solve an inverse problem of the form 2 . In such a control task , the sum reduces to a single data point ( x , ŷ ) with x being the initial state , ŷ the target state and θ the external force we want to find . The physical solver corresponds to the function f representing time evolution y ( θ ) = f ( x ; θ ) . This single data point sum still includes squared summation over vector components of y − ŷ in the l2-loss . Sensitive behavior of the physical system connected to its high-frequency modes is present in the physical solver f , and produces small singular values in its linear approximation . This leads to an ill-conditioned Jacobian and flat regions in the optimization landscape when minimizing 2 . This is addressed by using methods that incorporate more information than only the gradient . Prominent examples are Newton ’ s method or the Gauss-Newton ’ s algorithm ( Gill & Murray , 1978 ) ; the latter one is based on the Jacobian of f and the loss gradient : ∆θGN = − ( ∂y ∂θ ) −1 · ( ∂L ∂y ) > ( 3 ) Here , the inversion of the Jacobian is done with the pseudoinverse . The Gauss-Newton update maps the steepest descent direction in y space to the parameter space θ . Therefore , to first order , the resulting update approximates gradient descent steps in y space , further details of which are given in the appendix . An advantage of this formulation is that the update steps in y space are invariant under arbitrary rescaling of the parameters θ , which cancels inherent scales in f and ensures quick progress in the optimization landscape . Neural Network Training . When f represents a neural network in equation 2 , the optimization matches the typical supervised learning task . In this context , the problem of flat regions in the optimization landscape is also referred to as pathological curvature ( Martens , 2010 ) . Solving this problem with higher-order methods is considered to be too expensive given the large number of parameters θ . For learning tasks , widely used optimizers such as Adam instead use gradient information from earlier update steps , for instance in the form of momentum or adaptive learning rate terms , thereby achieving better optimization progress at little additional computational cost . Additionally , the updates are computed on mini-batches instead of the full data set , which saves computational resources and benefits generalization . Neural Network Training with Physics Objectives . For the remainder of the paper , we consider joint optimization problems , where f denotes a composition of a neural network parameterized by θ and a physics solver . Using classical network optimizers for minimizing equation 2 is inefficient in this case since data normalization in the network output space is not possible and the classical initialization schemes can not normalize the effects of the physics solver . As such , they are unsuited to capture the strong coupling between optimization parameters typically encountered in physics applications . While Gauss-Newton seems promising for these cases , the involved Jacobian inversion tends to result in large overshoots in the updates when the involved physics solver is ill-conditioned . As we will demonstrate , this leads to oversaturation of neurons , hampering the learning capability of the neural network . 2.1 AN ILL-CONDITIONED TOY EXAMPLE . To illustrate the argumentation so far , we consider a data set sampled from ŷ ( x ) = ( sin ( 6x ) , cos ( 9x ) ) for x ∈ [ −1 , 1 ] : We train a neural network to describe this data set by using the loss function l ( y , ŷ ; γ ) = 12 ( y1 − ŷ1 ) 2 + 12 ( λ · y2 − ŷ2 ) 2 , where y1 and y2 denote the first and second component of the y-vectors . For a scale factor of γ = 1 , we receive the well-conditioned mean squared error loss . However , l becomes increasingly ill-conditioned as γ is decreased , which mimics the effects of a physics solver . For real-world physics solvers the situation would typically be even more pronounced , as these scales usually vary strongly in direction and magnitude across different data points and optimization steps . We use a small neural network with a single hidden layer with 7 neurons and a tanh activation . We then compare training with the well-conditioned γ = 1 loss against an ill-conditioned γ = 0.01 loss . In both cases , we train the network using both Adam and Gauss-Newton as representatives of gradient-based and higher-order optimizers , respectively . The results are shown in figure 1 . In the well-conditioned case , Adam and Gauss-Newton behave similarly , decreasing the loss by about three orders of magnitude . However , in the ill-conditioned case , both optimizers fail to minimize the objective beyond a certain point . To explain this observation , we first illustrate the behavior from the physics viewpoint by considering the trajectory of the network output f ( x ) for a single value x during training ( figure 1 , right ) . For γ= 1 , Adam optimizes the network to accurately predict ŷ ( x ) while for γ= 0.01 , the updates neglect the second component preventing Adam to move efficiently along the small-scale coordinate ( blue curve in figure 1b , right ) . To illustrate the situation from the viewpoint of the network , we consider the variance in the outputs of specific neurons over different x ( figure 1 , middle ) . When γ = 1 , all neurons process information by producing different outcomes for different x . However , for γ = 0.01 , Gauss-Newton ’ s inversion of the small-scale component y2 results in large updates , leading to an oversaturation of neurons ( red curve in figure 1b , middle ) . These neurons stop processing information , reducing the effective capacity of the network and preventing the network from accurately fitting ŷ . Facing these problems , a natural questions arises : Is it possible to construct an algorithm that can successfully process the inherently different scales of a physics solver while training a neural network at the same time ?
This manuscript introduces a new optimization fashion bridging the Gauss-Newton method and the vanilla gradient descent method in the middle for physical optimization with neural networks. Traditionally, when a neural network is used for a physical problem, it will inevitably be affected by the unbalanced magnitudes dramatically. This manuscript proposes HIG, which is a middle point of two popular and individually advantageous optimization methods. It also provides a nice guideline on how to choose the hyperparameters and examine the efficacy of HIG on a concept-illustrating synthetic problem and three realistic physical problems.
SP:8941a9f4e862c5d17fbed644a647f8aa73b7737a
Half-Inverse Gradients for Physical Deep Learning
1 INTRODUCTION . The groundbreaking successes of deep learning ( Krizhevsky et al. , 2012 ; Sutskever et al. , 2014 ; Silver et al. , 2017 ) have led to ongoing efforts to study the capabilities of neural networks across all scientific disciplines . In the area of physical simulation , neural networks have been used in various ways , such as creating accurate reduced-order models ( Morton et al. , 2018 ) , inferring improved discretization stencils ( Bar-Sinai et al. , 2019 ) , or suppressing numerical errors ( Um et al. , 2020 ) . The long-term goal of these methods is to exceed classical simulations in terms of accuracy and speed , which has been achieved , e.g. , for rigid bodies ( de Avila Belbute-Peres et al. , 2018 ) , physical inverse problems ( Holl et al. , 2020 ) , and two-dimensional turbulence ( Kochkov et al. , 2021 ) . The successful application of deep learning to physical systems naturally hinges on the training setup . In recent years , the use of physical loss functions has proven beneficial for the training procedure , yielding substantial improvements over purely supervised training approaches ( Tompson et al. , 2017 ; Wu & Tegmark , 2019 ; Greydanus et al. , 2019 ) . These improvements were shown to stem from three aspects ( Battaglia et al. , 2016 ; Holl et al. , 2020 ) : ( i ) Incorporating prior knowledge from physical principles facilitates the learning process , ( ii ) the ambiguities of multimodal cases are resolved naturally , and ( iii ) simulating the physics at training time can provide more realistic data distributions than pre-computed data sets . Approaches for training with physical losses can be divided into two categories . On the one hand , equation-focused approaches that introduce physical residuals ( Tompson et al. , 2017 ; Raissi et al. , 2019 ) , and on the other hand , solver-focused approaches that additionally integrate well-established numerical procedures into the training ( Um et al. , 2020 ; Kochkov et al. , 2021 ) . From a mathematical point of view , training a neural network with a physical loss function bears the difficulties of both network training and physics optimization . In order to obtain satisfying results , it is vital to treat flat regions of the optimization landscapes effectively . In learning , the challenging loss landscapes are addressed using gradient-based optimizers with data-based normalizing schemes such as Adam ( Kingma & Ba , 2015 ) , whereas in physics , the optimizers of choice are higher-order techniques such as Newton ’ s method ( Gill & Murray , 1978 ) that inherently make use of inversion processes . However , Holl et al . ( 2021 ) found that these approaches can not effectively handle the joint optimization of network and physics . Gradient-descent-based optimizers suffer from vanishing or exploding gradients , preventing effective convergence , while higher-order methods do not generally scale to the high-dimensional parameter spaces required by deep learning ( Goodfellow et al. , 2016 ) . We likewise focus on inversion-based approach but propose a new method for joint physics and network optimization which we refer to as half-inverse gradients . At its core lies a partial matrix inversion , which we derive from the interaction between network and physics both formally and geometrically . An important property of our method is that its runtime scales linearly in the number of network parameters . To demonstrate the wide-ranging and practical applicability of our method , we show that it yields significant improvements in terms of convergence speed and final loss values over existing methods . These improvements are measured both in terms of absolute accuracy as well as wall-clock time . We evaluate a diverse set of physical systems , such as the Schrödinger equation , a nonlinear chain system and the Poisson problem . 2 GRADIENTS BASED ON HALF-INVERSE JACOBIANS . Optimization on continuous spaces can be effectively performed with derivative-based methods , the simplest of which is gradient descent . For a target function L ( θ ) to be minimized of several variables θ , using bold symbols for vector-valued quantitites in this section , and learning rate η , gradient descent proceeds by repeatedly applying updates ∆θGD ( η ) = −η · ( ∂L ∂θ ) > . ( 1 ) For quadratic objectives , this algorithm convergences linearly with the rate of convergence depending on the condition number λ of the Hessian matrix ( Lax , 2014 ) . In the ill-conditioned case λ 1 , flat regions in the optimization landscape can significantly slow down the optimization progress . This is a ubiquitous problem in non-convex optimization tasks of the generic form : L ( θ ) = ∑ i l ( yi ( θ ) , ŷi ) = ∑ i l ( f ( xi ; θ ) , ŷi ) ( 2 ) Here ( xi , ŷi ) denotes the ith data points from a chosen set of measurements , f is a function parametrized by θ to be optimized to model the relationship between the data points yi ( θ ) = f ( xi ; θ ) , and l denotes a loss function measuring the optimization progress . In the following , we assume the most common case of l ( yi , ŷi ) = 12 ||yi − ŷi|| 2 2 being the squared l2-loss Physics Optimization . Simulating a physical system consists of two steps : ( i ) mathematically modeling the system by a differential equation , and ( ii ) discretizing the occuring differential operators to receive a solver usable on a computer . If we then wish to manipulate a physical system by an external force to reach a given configuration , we have to solve an inverse problem of the form 2 . In such a control task , the sum reduces to a single data point ( x , ŷ ) with x being the initial state , ŷ the target state and θ the external force we want to find . The physical solver corresponds to the function f representing time evolution y ( θ ) = f ( x ; θ ) . This single data point sum still includes squared summation over vector components of y − ŷ in the l2-loss . Sensitive behavior of the physical system connected to its high-frequency modes is present in the physical solver f , and produces small singular values in its linear approximation . This leads to an ill-conditioned Jacobian and flat regions in the optimization landscape when minimizing 2 . This is addressed by using methods that incorporate more information than only the gradient . Prominent examples are Newton ’ s method or the Gauss-Newton ’ s algorithm ( Gill & Murray , 1978 ) ; the latter one is based on the Jacobian of f and the loss gradient : ∆θGN = − ( ∂y ∂θ ) −1 · ( ∂L ∂y ) > ( 3 ) Here , the inversion of the Jacobian is done with the pseudoinverse . The Gauss-Newton update maps the steepest descent direction in y space to the parameter space θ . Therefore , to first order , the resulting update approximates gradient descent steps in y space , further details of which are given in the appendix . An advantage of this formulation is that the update steps in y space are invariant under arbitrary rescaling of the parameters θ , which cancels inherent scales in f and ensures quick progress in the optimization landscape . Neural Network Training . When f represents a neural network in equation 2 , the optimization matches the typical supervised learning task . In this context , the problem of flat regions in the optimization landscape is also referred to as pathological curvature ( Martens , 2010 ) . Solving this problem with higher-order methods is considered to be too expensive given the large number of parameters θ . For learning tasks , widely used optimizers such as Adam instead use gradient information from earlier update steps , for instance in the form of momentum or adaptive learning rate terms , thereby achieving better optimization progress at little additional computational cost . Additionally , the updates are computed on mini-batches instead of the full data set , which saves computational resources and benefits generalization . Neural Network Training with Physics Objectives . For the remainder of the paper , we consider joint optimization problems , where f denotes a composition of a neural network parameterized by θ and a physics solver . Using classical network optimizers for minimizing equation 2 is inefficient in this case since data normalization in the network output space is not possible and the classical initialization schemes can not normalize the effects of the physics solver . As such , they are unsuited to capture the strong coupling between optimization parameters typically encountered in physics applications . While Gauss-Newton seems promising for these cases , the involved Jacobian inversion tends to result in large overshoots in the updates when the involved physics solver is ill-conditioned . As we will demonstrate , this leads to oversaturation of neurons , hampering the learning capability of the neural network . 2.1 AN ILL-CONDITIONED TOY EXAMPLE . To illustrate the argumentation so far , we consider a data set sampled from ŷ ( x ) = ( sin ( 6x ) , cos ( 9x ) ) for x ∈ [ −1 , 1 ] : We train a neural network to describe this data set by using the loss function l ( y , ŷ ; γ ) = 12 ( y1 − ŷ1 ) 2 + 12 ( λ · y2 − ŷ2 ) 2 , where y1 and y2 denote the first and second component of the y-vectors . For a scale factor of γ = 1 , we receive the well-conditioned mean squared error loss . However , l becomes increasingly ill-conditioned as γ is decreased , which mimics the effects of a physics solver . For real-world physics solvers the situation would typically be even more pronounced , as these scales usually vary strongly in direction and magnitude across different data points and optimization steps . We use a small neural network with a single hidden layer with 7 neurons and a tanh activation . We then compare training with the well-conditioned γ = 1 loss against an ill-conditioned γ = 0.01 loss . In both cases , we train the network using both Adam and Gauss-Newton as representatives of gradient-based and higher-order optimizers , respectively . The results are shown in figure 1 . In the well-conditioned case , Adam and Gauss-Newton behave similarly , decreasing the loss by about three orders of magnitude . However , in the ill-conditioned case , both optimizers fail to minimize the objective beyond a certain point . To explain this observation , we first illustrate the behavior from the physics viewpoint by considering the trajectory of the network output f ( x ) for a single value x during training ( figure 1 , right ) . For γ= 1 , Adam optimizes the network to accurately predict ŷ ( x ) while for γ= 0.01 , the updates neglect the second component preventing Adam to move efficiently along the small-scale coordinate ( blue curve in figure 1b , right ) . To illustrate the situation from the viewpoint of the network , we consider the variance in the outputs of specific neurons over different x ( figure 1 , middle ) . When γ = 1 , all neurons process information by producing different outcomes for different x . However , for γ = 0.01 , Gauss-Newton ’ s inversion of the small-scale component y2 results in large updates , leading to an oversaturation of neurons ( red curve in figure 1b , middle ) . These neurons stop processing information , reducing the effective capacity of the network and preventing the network from accurately fitting ŷ . Facing these problems , a natural questions arises : Is it possible to construct an algorithm that can successfully process the inherently different scales of a physics solver while training a neural network at the same time ?
The paper considers the training of neural networks for physical simulations. By distributing the burden equally between network and physics, the paper presents the half-inverse gradients (HIGs) method. Experiments show its advantage for achieving a faster and more accurate minimization.
SP:8941a9f4e862c5d17fbed644a647f8aa73b7737a
Direct Molecular Conformation Generation
1 INTRODUCTION . Molecular conformation generation aims to generate the 3D coordinates of all the atoms of molecules , which then can be used in molecular property prediction ( Axelrod & Gomez-Bombarelli , 2021 ) , docking ( Roy et al. , 2015 ) , structure-based virtual screening ( Kontoyianni , 2017 ) , etc . Molecular conformation can be physically observed using X-ray crystallography , but it is prohibitively costly for industry-scale tasks ( Mansimov et al. , 2019 ) . Ab initio methods , such as density functional theory ( DFT ) ( Parr , 1980 ; Baseden & Tye , 2014 ) , can accurately predict the molecular shapes , but take up to several hours per small molecule ( Hu et al. , 2021 ) .To handle large-scale molecules , people turn to leverage the classical force fields , like UFF ( Rappe et al. , 1992 ) or MMFF ( Halgren , 1996 ) , to estimate conformations , which is efficient but unacceptably inaccurate ( Kanal et al. , 2018 ) . Recently , people start to explore machine learning methods to generate conformation . Simm & Hernández-Lobato ( 2020 ) , Shi et al . ( 2020 ) and Shi et al . ( 2021 ) leveraged variational auto-encoder ( VAE ) , flow-based models and score-based methods for conformation generation , respectively . With learned models , molecule conformations can be sampled independently ( Simm & HernándezLobato , 2020 ; Shi et al. , 2020 ) or using Langevin dynamics ( Xu et al. , 2021a ; Shi et al. , 2021 ) . The common part of these methods is that they are all built upon the interatomic distances among atoms ( i.e. , the distance between atom pairs ) . Specifically , Simm & Hernández-Lobato ( 2020 ) ; Shi et al . ( 2020 ) ; Xu et al . ( 2021a ; b ) use various generative methods to model the distribution of interatomic distances , and then reconstruct conformations based on distances . Shi et al . ( 2021 ) leveraged a score-matching network to model the density gradient of interatomic distances . Moreover , Winter et al . ( 2021 ) use variational auto-encoder to first predict bond length , bond angle and dihedral angle and then reconstruct the coordinates based on the intermediate results . A major reason of using distance-based methods is that the interatomic distances are invariant to rotation and translation of the conformation . However , a potential drawback is that the predicted distances might conflict with each other . For example , they did not explicitly consider the triangle inequality for distances among any three atoms . The underlying degree-of-freedom of these distances is only 3N − 6 ( N is the number of atoms in a molecule ) while practically , these methods often generate distances with the degree-of-freedom of roughly N ( N − 1 ) /2 , which usually lead to violations of the triangle inequality . For example , we found that in GraphDG ( Simm & Hernández-Lobato , 2020 ) , a prevailing representative of distance-based method , 8.65 % of molecular graphs in the GEOM-Drugs test set will produce distance matrix that violates the triangle inequality . In this work , we explore the possibility to directly generate the coordinates of all atoms . This is a straightforward and more natural choice and avoids violations of the triangle inequality , and has demonstrated remarkable performance on protein structure prediction by the AlphaFold 2 ( Jumper et al. , 2021 ) . We design a model that generates atom coordinates directly . The generator in our model stacks multiple blocks , and each block outputs a conformation which is then refined by the following block . A block consists of several modules that can encode the previous conformation as well as the features of bonds , atoms and global information . At the end of each block , we add a normalization layer that centers the coordinates at the origin . Since a molecule may have multiple conformations , we use the variational auto-encoder ( VAE ) framework which allows diverse generation . To realize roto-translation equivariance , i.e. , rotating and translating a set of atom coordinates do not change the conformation , we adopt a loss that is invariant to rotation and translation of atom coordinates . We conduct experiments on four benchmark settings , which are GEOM-QM9 and GEOM-Drugs with small-scale setting ( Shi et al. , 2021 ) and large-scale setting ( Axelrod & Gomez-Bombarelli , 2021 ) . Compared with previous methods , ours achieves state-of-the-art results on GEOM-Drugs ( both small-scale and large-scale settings ) , and outperforms almost all previous baselines on GEOMQM9 , demonstrating the effectiveness of our method . Our contributions are summarized as follows : ( 1 ) We explore a new direction of conformation generation , that directly generates the coordinates of a molecular conformation without generating interatomic distances . We empirically show that directly generating conformation achieves state-of-the-art results on several tasks . ( 2 ) We leverage a fine-grained loss function for training , that is invariant to the roto-translation of the conformation . ( 3 ) We propose a new model that iteratively refines the conformations . Our model is inspired by multiple advanced architectures like GATv2 ( Brody et al. , 2021 ) , graph network ( GN ) block ( Battaglia et al. , 2018 ) , that can effectively model molecules . 2 PRELIMINARIES . In this section , we introduce the notations used in this work , give a formal definition of the molecular conformation generation problem , and briefly introduce how to align two conformations under rotation and translation . Notations : Let G = ( V , E ) denote a molecular graph , where V and E are collections of atoms and bonds , respectively . Specifically , V = { v1 , v2 , · · · , v|V | } with the i-th atom vi . Let eij denote the bond between atom vi and vj . LetN ( i ) denote the neighbors of atom i , i.e. , N ( i ) = { vj | eij ∈ E } . We useR to represent the conformation ofG , whereR ∈ R|V |×3 . The i-th row ofR is the coordinate of atom vi . Let ρ ( · ) denote a roto-translation operation , i.e . an affine transformation ρ ( R ) = Rt + b where the orientation-preserving orthogonal transformation t ∈ SO ( 3 ) ⊂ R3×3 represents a rotation and the vector b ∈ R1×3 represents a translation . Let MLP ( · · · ) denote the multi-layer perception network , where the inputs are concatenated together and then processed by linear mapping , Batch Normalization ( Ioffe & Szegedy , 2015 ) and ReLU activation sequentially . Problem definition : Given a graph G = ( V , E ) , our task is to learn a mapping , that can output the coordinates R of all atoms in V , i.e. , R ∈ R|V |×3 . 1 Matching loss : Let R1 and R2 denote two conformations , both of which are N × 3 matrices ( N is the number of rows in R1 and R2 ) . The matching loss between R1 and R2 is defined as follows : ` M ( R1 , R2 ) = min ρ ‖ρ ( R1 ) −R2‖2F , ( 1 ) 1A molecule corresponds to different conformations at different energy level . To model such cases , the problem is to generate R based on G and a random noise z. where ‖ · ‖F denotes the Frobenius norm , i.e. , ‖A‖2F = ∑ i , j |Aij |2 . The matching loss is invariant to the rotation and translation of either of the two input conformations . It is obviously nonnegative , and is zero if R1 is obtained by a roto-translational operation of R2 . Karney ( 2007 ) proposed to use quaternions to solve Eqn. ( 1 ) . A quaternion q is an extension of complex numbers , q = q0u + q1i + q2j + q3k , where q0 , q1 , q2 , q3 are scalars and u , i , j , k are orientation vectors . With quaternions , any rotation operation is specified by a 3 × 3 matrix , where each element in the matrix is the basic algebra of q0 to q3 and some constants . The solution to Eqn . ( 1 ) is the minimal eigenvalue of a 4× 4 matrix obtained by the basic algebra on R1 and R2 , the corresponding optimal rotation and translation ρ∗ can be obtained from the eigenvectors . Note that the best ρ∗ is related to both R1 and R2 . To stabilize training , we set the gradients of ρ∗ w.r.t . the model parameter as zero . More details can be found in Karney ( 2007 ) . 3 OUR METHOD . We introduce our proposed method in this section . 3.1 CONFORMATION GENERATION FRAMEWORK . Our goal can be formalized as learning to generate samples from the conditional distribution p ( R|G ) . We follow the variational auto-encoder ( VAE ) scheme ( Kingma & Welling , 2014 ; Rezende et al. , 2014 ; Sohn et al. , 2015 ) as it enables flexible model architecture ( vs. flow-based models ) , efficient ( i.e. , i.i.d ) generation ( vs. score-matching methods ) , and stable training and diverse sample generation ( vs. adversarial methods ) . Given a molecule graph G , the conditional variant of VAE generates R using a likelihood model p ( R|z , G ) where z is a latent code drawn from a prior p ( z ) = N ( 0 , I ) . The corresponding p ( R|G ) = ∫ p ( z ) p ( R|z , G ) dz is however intractable to evaluate and maximize to fit data . VAE handles this by introducing a ( conditional ) inference model q ( z|R , G ) which leads to the following identity : log p ( R|G ) = Eq ( z|R , G ) [ log p ( R|z , G ) ] −DKL ( q ( z|R , G ) ‖p ( z ) ) +DKL ( q ( z|R , G ) ‖p ( z|R , G ) ) , ( 2 ) where DKL denotes the Kullback-Leibler ( KL ) divergence , and p ( z|R , G ) = p ( z ) p ( R|z , G ) ∫ p ( z ) p ( R|z , G ) dz is the true posterior . Due to the nonnegativity of the third term , the first two terms form a lower bound of log p ( R|G ) . When q ( z|R , G ) is properly chosen , the bound is tractable to optimize . Moreover , as the left-hand-side is independent of q ( z|R , G ) , tightening the bound ( i.e. , minimizing the third term ) can be achieved by maximizing the bound w.r.t q ( z|R , G ) . Therefore , as a loss function to be minimized , the objective is : Eq ( z|R , G ) [ − log p ( R|z , G ) ] +DKL ( q ( z|R , G ) ‖p ( z ) ) . ( 3 ) Now we develop our specification for the conformation generation task . We construct the likelihood model with regard to a decoded reference conformation R̂ ( z , G ) : p ( R|z , G ) ∝ exp { − 1 γ ` M ( R̂ ( z , G ) , R ) } , ( 4 ) where γ > 0 is a variance parameter that we choose to fix as 1 ( see Sec . 3.4 ( 1 ) for explanation ) . Note that the usage of ` M guarantees all roto-translation equivalent conformations have the same probability . For the inference model , we choose q ( z|R , G ) = N ( z|µR , G , ΣR , G ) , ( 5 ) where the conditional mean and variance are outputs from some encoder . It enables tractable loss optimization via reparameterization : z ∼ q ( z|R , G ) is equivalent to z = µR , G + ΣR , G where ∼ N ( 0 , I ) . With the above specification , the loss function becomes : minE ∼N ( 0 , I ) ` M ( R̂ ( µR , G + ΣR , G , G ) , R ) + βDKL ( N ( µR , G , ΣR , G ) ‖N ( 0 , I ) ) , ( 6 ) where the minimization is applied over all model parameters . Note that in Eqn . ( 6 ) , an additional hyperparameter β is introduced in the spirit of β-VAE ( Higgins et al. , 2016 ) to handle the strength of the prior regularization . The second term in Eqn . ( 6 ) has a closed-form expression for optimization .
The authors present a method that is able to accurately generate molecule confirmations, achieving competitive results across four datasets. Unlike previous methods that often rely on directly predicting various inter-atomic distances (through a distance matrix) (which in some cases results in physically impossible molecules), the presented work predicts the location of all atoms. The loss function is invariant to rotation, an important property of many molecules.
SP:c4f98019ecbb9d4260f85664731f019e8fd8f8b0
Direct Molecular Conformation Generation
1 INTRODUCTION . Molecular conformation generation aims to generate the 3D coordinates of all the atoms of molecules , which then can be used in molecular property prediction ( Axelrod & Gomez-Bombarelli , 2021 ) , docking ( Roy et al. , 2015 ) , structure-based virtual screening ( Kontoyianni , 2017 ) , etc . Molecular conformation can be physically observed using X-ray crystallography , but it is prohibitively costly for industry-scale tasks ( Mansimov et al. , 2019 ) . Ab initio methods , such as density functional theory ( DFT ) ( Parr , 1980 ; Baseden & Tye , 2014 ) , can accurately predict the molecular shapes , but take up to several hours per small molecule ( Hu et al. , 2021 ) .To handle large-scale molecules , people turn to leverage the classical force fields , like UFF ( Rappe et al. , 1992 ) or MMFF ( Halgren , 1996 ) , to estimate conformations , which is efficient but unacceptably inaccurate ( Kanal et al. , 2018 ) . Recently , people start to explore machine learning methods to generate conformation . Simm & Hernández-Lobato ( 2020 ) , Shi et al . ( 2020 ) and Shi et al . ( 2021 ) leveraged variational auto-encoder ( VAE ) , flow-based models and score-based methods for conformation generation , respectively . With learned models , molecule conformations can be sampled independently ( Simm & HernándezLobato , 2020 ; Shi et al. , 2020 ) or using Langevin dynamics ( Xu et al. , 2021a ; Shi et al. , 2021 ) . The common part of these methods is that they are all built upon the interatomic distances among atoms ( i.e. , the distance between atom pairs ) . Specifically , Simm & Hernández-Lobato ( 2020 ) ; Shi et al . ( 2020 ) ; Xu et al . ( 2021a ; b ) use various generative methods to model the distribution of interatomic distances , and then reconstruct conformations based on distances . Shi et al . ( 2021 ) leveraged a score-matching network to model the density gradient of interatomic distances . Moreover , Winter et al . ( 2021 ) use variational auto-encoder to first predict bond length , bond angle and dihedral angle and then reconstruct the coordinates based on the intermediate results . A major reason of using distance-based methods is that the interatomic distances are invariant to rotation and translation of the conformation . However , a potential drawback is that the predicted distances might conflict with each other . For example , they did not explicitly consider the triangle inequality for distances among any three atoms . The underlying degree-of-freedom of these distances is only 3N − 6 ( N is the number of atoms in a molecule ) while practically , these methods often generate distances with the degree-of-freedom of roughly N ( N − 1 ) /2 , which usually lead to violations of the triangle inequality . For example , we found that in GraphDG ( Simm & Hernández-Lobato , 2020 ) , a prevailing representative of distance-based method , 8.65 % of molecular graphs in the GEOM-Drugs test set will produce distance matrix that violates the triangle inequality . In this work , we explore the possibility to directly generate the coordinates of all atoms . This is a straightforward and more natural choice and avoids violations of the triangle inequality , and has demonstrated remarkable performance on protein structure prediction by the AlphaFold 2 ( Jumper et al. , 2021 ) . We design a model that generates atom coordinates directly . The generator in our model stacks multiple blocks , and each block outputs a conformation which is then refined by the following block . A block consists of several modules that can encode the previous conformation as well as the features of bonds , atoms and global information . At the end of each block , we add a normalization layer that centers the coordinates at the origin . Since a molecule may have multiple conformations , we use the variational auto-encoder ( VAE ) framework which allows diverse generation . To realize roto-translation equivariance , i.e. , rotating and translating a set of atom coordinates do not change the conformation , we adopt a loss that is invariant to rotation and translation of atom coordinates . We conduct experiments on four benchmark settings , which are GEOM-QM9 and GEOM-Drugs with small-scale setting ( Shi et al. , 2021 ) and large-scale setting ( Axelrod & Gomez-Bombarelli , 2021 ) . Compared with previous methods , ours achieves state-of-the-art results on GEOM-Drugs ( both small-scale and large-scale settings ) , and outperforms almost all previous baselines on GEOMQM9 , demonstrating the effectiveness of our method . Our contributions are summarized as follows : ( 1 ) We explore a new direction of conformation generation , that directly generates the coordinates of a molecular conformation without generating interatomic distances . We empirically show that directly generating conformation achieves state-of-the-art results on several tasks . ( 2 ) We leverage a fine-grained loss function for training , that is invariant to the roto-translation of the conformation . ( 3 ) We propose a new model that iteratively refines the conformations . Our model is inspired by multiple advanced architectures like GATv2 ( Brody et al. , 2021 ) , graph network ( GN ) block ( Battaglia et al. , 2018 ) , that can effectively model molecules . 2 PRELIMINARIES . In this section , we introduce the notations used in this work , give a formal definition of the molecular conformation generation problem , and briefly introduce how to align two conformations under rotation and translation . Notations : Let G = ( V , E ) denote a molecular graph , where V and E are collections of atoms and bonds , respectively . Specifically , V = { v1 , v2 , · · · , v|V | } with the i-th atom vi . Let eij denote the bond between atom vi and vj . LetN ( i ) denote the neighbors of atom i , i.e. , N ( i ) = { vj | eij ∈ E } . We useR to represent the conformation ofG , whereR ∈ R|V |×3 . The i-th row ofR is the coordinate of atom vi . Let ρ ( · ) denote a roto-translation operation , i.e . an affine transformation ρ ( R ) = Rt + b where the orientation-preserving orthogonal transformation t ∈ SO ( 3 ) ⊂ R3×3 represents a rotation and the vector b ∈ R1×3 represents a translation . Let MLP ( · · · ) denote the multi-layer perception network , where the inputs are concatenated together and then processed by linear mapping , Batch Normalization ( Ioffe & Szegedy , 2015 ) and ReLU activation sequentially . Problem definition : Given a graph G = ( V , E ) , our task is to learn a mapping , that can output the coordinates R of all atoms in V , i.e. , R ∈ R|V |×3 . 1 Matching loss : Let R1 and R2 denote two conformations , both of which are N × 3 matrices ( N is the number of rows in R1 and R2 ) . The matching loss between R1 and R2 is defined as follows : ` M ( R1 , R2 ) = min ρ ‖ρ ( R1 ) −R2‖2F , ( 1 ) 1A molecule corresponds to different conformations at different energy level . To model such cases , the problem is to generate R based on G and a random noise z. where ‖ · ‖F denotes the Frobenius norm , i.e. , ‖A‖2F = ∑ i , j |Aij |2 . The matching loss is invariant to the rotation and translation of either of the two input conformations . It is obviously nonnegative , and is zero if R1 is obtained by a roto-translational operation of R2 . Karney ( 2007 ) proposed to use quaternions to solve Eqn. ( 1 ) . A quaternion q is an extension of complex numbers , q = q0u + q1i + q2j + q3k , where q0 , q1 , q2 , q3 are scalars and u , i , j , k are orientation vectors . With quaternions , any rotation operation is specified by a 3 × 3 matrix , where each element in the matrix is the basic algebra of q0 to q3 and some constants . The solution to Eqn . ( 1 ) is the minimal eigenvalue of a 4× 4 matrix obtained by the basic algebra on R1 and R2 , the corresponding optimal rotation and translation ρ∗ can be obtained from the eigenvectors . Note that the best ρ∗ is related to both R1 and R2 . To stabilize training , we set the gradients of ρ∗ w.r.t . the model parameter as zero . More details can be found in Karney ( 2007 ) . 3 OUR METHOD . We introduce our proposed method in this section . 3.1 CONFORMATION GENERATION FRAMEWORK . Our goal can be formalized as learning to generate samples from the conditional distribution p ( R|G ) . We follow the variational auto-encoder ( VAE ) scheme ( Kingma & Welling , 2014 ; Rezende et al. , 2014 ; Sohn et al. , 2015 ) as it enables flexible model architecture ( vs. flow-based models ) , efficient ( i.e. , i.i.d ) generation ( vs. score-matching methods ) , and stable training and diverse sample generation ( vs. adversarial methods ) . Given a molecule graph G , the conditional variant of VAE generates R using a likelihood model p ( R|z , G ) where z is a latent code drawn from a prior p ( z ) = N ( 0 , I ) . The corresponding p ( R|G ) = ∫ p ( z ) p ( R|z , G ) dz is however intractable to evaluate and maximize to fit data . VAE handles this by introducing a ( conditional ) inference model q ( z|R , G ) which leads to the following identity : log p ( R|G ) = Eq ( z|R , G ) [ log p ( R|z , G ) ] −DKL ( q ( z|R , G ) ‖p ( z ) ) +DKL ( q ( z|R , G ) ‖p ( z|R , G ) ) , ( 2 ) where DKL denotes the Kullback-Leibler ( KL ) divergence , and p ( z|R , G ) = p ( z ) p ( R|z , G ) ∫ p ( z ) p ( R|z , G ) dz is the true posterior . Due to the nonnegativity of the third term , the first two terms form a lower bound of log p ( R|G ) . When q ( z|R , G ) is properly chosen , the bound is tractable to optimize . Moreover , as the left-hand-side is independent of q ( z|R , G ) , tightening the bound ( i.e. , minimizing the third term ) can be achieved by maximizing the bound w.r.t q ( z|R , G ) . Therefore , as a loss function to be minimized , the objective is : Eq ( z|R , G ) [ − log p ( R|z , G ) ] +DKL ( q ( z|R , G ) ‖p ( z ) ) . ( 3 ) Now we develop our specification for the conformation generation task . We construct the likelihood model with regard to a decoded reference conformation R̂ ( z , G ) : p ( R|z , G ) ∝ exp { − 1 γ ` M ( R̂ ( z , G ) , R ) } , ( 4 ) where γ > 0 is a variance parameter that we choose to fix as 1 ( see Sec . 3.4 ( 1 ) for explanation ) . Note that the usage of ` M guarantees all roto-translation equivalent conformations have the same probability . For the inference model , we choose q ( z|R , G ) = N ( z|µR , G , ΣR , G ) , ( 5 ) where the conditional mean and variance are outputs from some encoder . It enables tractable loss optimization via reparameterization : z ∼ q ( z|R , G ) is equivalent to z = µR , G + ΣR , G where ∼ N ( 0 , I ) . With the above specification , the loss function becomes : minE ∼N ( 0 , I ) ` M ( R̂ ( µR , G + ΣR , G , G ) , R ) + βDKL ( N ( µR , G , ΣR , G ) ‖N ( 0 , I ) ) , ( 6 ) where the minimization is applied over all model parameters . Note that in Eqn . ( 6 ) , an additional hyperparameter β is introduced in the spirit of β-VAE ( Higgins et al. , 2016 ) to handle the strength of the prior regularization . The second term in Eqn . ( 6 ) has a closed-form expression for optimization .
The paper presents a direct method for generating a molecular conformation conditional on the molecular graph. Inspired by the success of AlphaFold2, the authors demonstrated that one could directly write out 3D coordinates for a small molecule rather than use the previous ways of generating intermediate interatomic distance matrices or iterate over forces. The method displays a decent performance on the standard benchmark set of QM9. It performs better than past baseline methods for larger molecules.
SP:c4f98019ecbb9d4260f85664731f019e8fd8f8b0
Direct Molecular Conformation Generation
1 INTRODUCTION . Molecular conformation generation aims to generate the 3D coordinates of all the atoms of molecules , which then can be used in molecular property prediction ( Axelrod & Gomez-Bombarelli , 2021 ) , docking ( Roy et al. , 2015 ) , structure-based virtual screening ( Kontoyianni , 2017 ) , etc . Molecular conformation can be physically observed using X-ray crystallography , but it is prohibitively costly for industry-scale tasks ( Mansimov et al. , 2019 ) . Ab initio methods , such as density functional theory ( DFT ) ( Parr , 1980 ; Baseden & Tye , 2014 ) , can accurately predict the molecular shapes , but take up to several hours per small molecule ( Hu et al. , 2021 ) .To handle large-scale molecules , people turn to leverage the classical force fields , like UFF ( Rappe et al. , 1992 ) or MMFF ( Halgren , 1996 ) , to estimate conformations , which is efficient but unacceptably inaccurate ( Kanal et al. , 2018 ) . Recently , people start to explore machine learning methods to generate conformation . Simm & Hernández-Lobato ( 2020 ) , Shi et al . ( 2020 ) and Shi et al . ( 2021 ) leveraged variational auto-encoder ( VAE ) , flow-based models and score-based methods for conformation generation , respectively . With learned models , molecule conformations can be sampled independently ( Simm & HernándezLobato , 2020 ; Shi et al. , 2020 ) or using Langevin dynamics ( Xu et al. , 2021a ; Shi et al. , 2021 ) . The common part of these methods is that they are all built upon the interatomic distances among atoms ( i.e. , the distance between atom pairs ) . Specifically , Simm & Hernández-Lobato ( 2020 ) ; Shi et al . ( 2020 ) ; Xu et al . ( 2021a ; b ) use various generative methods to model the distribution of interatomic distances , and then reconstruct conformations based on distances . Shi et al . ( 2021 ) leveraged a score-matching network to model the density gradient of interatomic distances . Moreover , Winter et al . ( 2021 ) use variational auto-encoder to first predict bond length , bond angle and dihedral angle and then reconstruct the coordinates based on the intermediate results . A major reason of using distance-based methods is that the interatomic distances are invariant to rotation and translation of the conformation . However , a potential drawback is that the predicted distances might conflict with each other . For example , they did not explicitly consider the triangle inequality for distances among any three atoms . The underlying degree-of-freedom of these distances is only 3N − 6 ( N is the number of atoms in a molecule ) while practically , these methods often generate distances with the degree-of-freedom of roughly N ( N − 1 ) /2 , which usually lead to violations of the triangle inequality . For example , we found that in GraphDG ( Simm & Hernández-Lobato , 2020 ) , a prevailing representative of distance-based method , 8.65 % of molecular graphs in the GEOM-Drugs test set will produce distance matrix that violates the triangle inequality . In this work , we explore the possibility to directly generate the coordinates of all atoms . This is a straightforward and more natural choice and avoids violations of the triangle inequality , and has demonstrated remarkable performance on protein structure prediction by the AlphaFold 2 ( Jumper et al. , 2021 ) . We design a model that generates atom coordinates directly . The generator in our model stacks multiple blocks , and each block outputs a conformation which is then refined by the following block . A block consists of several modules that can encode the previous conformation as well as the features of bonds , atoms and global information . At the end of each block , we add a normalization layer that centers the coordinates at the origin . Since a molecule may have multiple conformations , we use the variational auto-encoder ( VAE ) framework which allows diverse generation . To realize roto-translation equivariance , i.e. , rotating and translating a set of atom coordinates do not change the conformation , we adopt a loss that is invariant to rotation and translation of atom coordinates . We conduct experiments on four benchmark settings , which are GEOM-QM9 and GEOM-Drugs with small-scale setting ( Shi et al. , 2021 ) and large-scale setting ( Axelrod & Gomez-Bombarelli , 2021 ) . Compared with previous methods , ours achieves state-of-the-art results on GEOM-Drugs ( both small-scale and large-scale settings ) , and outperforms almost all previous baselines on GEOMQM9 , demonstrating the effectiveness of our method . Our contributions are summarized as follows : ( 1 ) We explore a new direction of conformation generation , that directly generates the coordinates of a molecular conformation without generating interatomic distances . We empirically show that directly generating conformation achieves state-of-the-art results on several tasks . ( 2 ) We leverage a fine-grained loss function for training , that is invariant to the roto-translation of the conformation . ( 3 ) We propose a new model that iteratively refines the conformations . Our model is inspired by multiple advanced architectures like GATv2 ( Brody et al. , 2021 ) , graph network ( GN ) block ( Battaglia et al. , 2018 ) , that can effectively model molecules . 2 PRELIMINARIES . In this section , we introduce the notations used in this work , give a formal definition of the molecular conformation generation problem , and briefly introduce how to align two conformations under rotation and translation . Notations : Let G = ( V , E ) denote a molecular graph , where V and E are collections of atoms and bonds , respectively . Specifically , V = { v1 , v2 , · · · , v|V | } with the i-th atom vi . Let eij denote the bond between atom vi and vj . LetN ( i ) denote the neighbors of atom i , i.e. , N ( i ) = { vj | eij ∈ E } . We useR to represent the conformation ofG , whereR ∈ R|V |×3 . The i-th row ofR is the coordinate of atom vi . Let ρ ( · ) denote a roto-translation operation , i.e . an affine transformation ρ ( R ) = Rt + b where the orientation-preserving orthogonal transformation t ∈ SO ( 3 ) ⊂ R3×3 represents a rotation and the vector b ∈ R1×3 represents a translation . Let MLP ( · · · ) denote the multi-layer perception network , where the inputs are concatenated together and then processed by linear mapping , Batch Normalization ( Ioffe & Szegedy , 2015 ) and ReLU activation sequentially . Problem definition : Given a graph G = ( V , E ) , our task is to learn a mapping , that can output the coordinates R of all atoms in V , i.e. , R ∈ R|V |×3 . 1 Matching loss : Let R1 and R2 denote two conformations , both of which are N × 3 matrices ( N is the number of rows in R1 and R2 ) . The matching loss between R1 and R2 is defined as follows : ` M ( R1 , R2 ) = min ρ ‖ρ ( R1 ) −R2‖2F , ( 1 ) 1A molecule corresponds to different conformations at different energy level . To model such cases , the problem is to generate R based on G and a random noise z. where ‖ · ‖F denotes the Frobenius norm , i.e. , ‖A‖2F = ∑ i , j |Aij |2 . The matching loss is invariant to the rotation and translation of either of the two input conformations . It is obviously nonnegative , and is zero if R1 is obtained by a roto-translational operation of R2 . Karney ( 2007 ) proposed to use quaternions to solve Eqn. ( 1 ) . A quaternion q is an extension of complex numbers , q = q0u + q1i + q2j + q3k , where q0 , q1 , q2 , q3 are scalars and u , i , j , k are orientation vectors . With quaternions , any rotation operation is specified by a 3 × 3 matrix , where each element in the matrix is the basic algebra of q0 to q3 and some constants . The solution to Eqn . ( 1 ) is the minimal eigenvalue of a 4× 4 matrix obtained by the basic algebra on R1 and R2 , the corresponding optimal rotation and translation ρ∗ can be obtained from the eigenvectors . Note that the best ρ∗ is related to both R1 and R2 . To stabilize training , we set the gradients of ρ∗ w.r.t . the model parameter as zero . More details can be found in Karney ( 2007 ) . 3 OUR METHOD . We introduce our proposed method in this section . 3.1 CONFORMATION GENERATION FRAMEWORK . Our goal can be formalized as learning to generate samples from the conditional distribution p ( R|G ) . We follow the variational auto-encoder ( VAE ) scheme ( Kingma & Welling , 2014 ; Rezende et al. , 2014 ; Sohn et al. , 2015 ) as it enables flexible model architecture ( vs. flow-based models ) , efficient ( i.e. , i.i.d ) generation ( vs. score-matching methods ) , and stable training and diverse sample generation ( vs. adversarial methods ) . Given a molecule graph G , the conditional variant of VAE generates R using a likelihood model p ( R|z , G ) where z is a latent code drawn from a prior p ( z ) = N ( 0 , I ) . The corresponding p ( R|G ) = ∫ p ( z ) p ( R|z , G ) dz is however intractable to evaluate and maximize to fit data . VAE handles this by introducing a ( conditional ) inference model q ( z|R , G ) which leads to the following identity : log p ( R|G ) = Eq ( z|R , G ) [ log p ( R|z , G ) ] −DKL ( q ( z|R , G ) ‖p ( z ) ) +DKL ( q ( z|R , G ) ‖p ( z|R , G ) ) , ( 2 ) where DKL denotes the Kullback-Leibler ( KL ) divergence , and p ( z|R , G ) = p ( z ) p ( R|z , G ) ∫ p ( z ) p ( R|z , G ) dz is the true posterior . Due to the nonnegativity of the third term , the first two terms form a lower bound of log p ( R|G ) . When q ( z|R , G ) is properly chosen , the bound is tractable to optimize . Moreover , as the left-hand-side is independent of q ( z|R , G ) , tightening the bound ( i.e. , minimizing the third term ) can be achieved by maximizing the bound w.r.t q ( z|R , G ) . Therefore , as a loss function to be minimized , the objective is : Eq ( z|R , G ) [ − log p ( R|z , G ) ] +DKL ( q ( z|R , G ) ‖p ( z ) ) . ( 3 ) Now we develop our specification for the conformation generation task . We construct the likelihood model with regard to a decoded reference conformation R̂ ( z , G ) : p ( R|z , G ) ∝ exp { − 1 γ ` M ( R̂ ( z , G ) , R ) } , ( 4 ) where γ > 0 is a variance parameter that we choose to fix as 1 ( see Sec . 3.4 ( 1 ) for explanation ) . Note that the usage of ` M guarantees all roto-translation equivalent conformations have the same probability . For the inference model , we choose q ( z|R , G ) = N ( z|µR , G , ΣR , G ) , ( 5 ) where the conditional mean and variance are outputs from some encoder . It enables tractable loss optimization via reparameterization : z ∼ q ( z|R , G ) is equivalent to z = µR , G + ΣR , G where ∼ N ( 0 , I ) . With the above specification , the loss function becomes : minE ∼N ( 0 , I ) ` M ( R̂ ( µR , G + ΣR , G , G ) , R ) + βDKL ( N ( µR , G , ΣR , G ) ‖N ( 0 , I ) ) , ( 6 ) where the minimization is applied over all model parameters . Note that in Eqn . ( 6 ) , an additional hyperparameter β is introduced in the spirit of β-VAE ( Higgins et al. , 2016 ) to handle the strength of the prior regularization . The second term in Eqn . ( 6 ) has a closed-form expression for optimization .
The paper proposed a new VAE-based generative model for generating molecular conformations from graphs. The whole formulation and training objective are similar to existing VAE-based models like CVGAE, and the main contrition lies in the architecture of the decoder. The architecture borrows the idea from the recent advance of AlphaFold: the proposed decoder is composed of several identical updating blocks, where they iteratively update the node/edge embeddings as well as the coordinates in each block. And the blocks are implemented with advanced graph neural networks.
SP:c4f98019ecbb9d4260f85664731f019e8fd8f8b0
To Impute or Not To Impute? Missing Data in Treatment Effect Estimation
1 INTRODUCTION . Treatment effects are arguably the most important estimand in causal inference [ Pearl , 2009 ; Neyman , 1923 ; Rubin , 1974 ] . A reason for this is that a treatment effect lies at the heart of a causal question . Using causal inference , we try to more explicitly attribute effect to the treatment in question , by carefully disentangling the role of the environment . We shall explain with a running example . Imagine , a job-training program to boost employment . Before sponsoring such a program , a legislative body may want to estimate its effect before widespread adoption . Using past data on the program , the body has to rely on causal methods to infer the effect of the training program before formal adoption . We define effect as the difference in outcome when applying the treatment versus not applying the treatment ( or any alternative treatment for that matter ) . Literature on inferring ( or predicting ) treatment effects is largely concerned with handling selection bias . That is , we identify a possible difference between the treated and non-treated subpopulations of the data , seeing that treatment is rarely distributed uniformly across the population . If not accounted for , selection bias will lead to biased estimates . As such , many works focus on novel strategies to handle this bias [ Johansson et al. , 2016 ; Alaa & van der Schaar , 2017 ; Shalit et al. , 2017 ; Rubin , 1974 ; Imbens & Rubin , 2015 ] . In the past , the program was not offered to everyone . Those with a job were less likely to be considered . As were those that had been unemployed for a long time . Perhaps age played a role ; being less likely to switch careers , older people would benefit less from job-training . Treatment effect models are adopted in a wide range of fields , such as : medicine [ Obermeyer & Emanuel , 2016 ; Alaa et al. , 2021 ; Bica et al. , 2021 ] , marketing [ Devriendt et al. , 2018 ; Ascarza , 2018 ; Debaere et al. , 2019 ] , or even human resources [ Rombaut & Guerry , 2020 ] . However , these methods have almost exclusively assumed that data is complete . From a practitioner ’ s standpoint , this may not always be the case and , in reality , data is often incomplete [ Burton & Altman , 2004 ; Lit- tle et al. , 2012 ] . When missingness is not properly accounted for when training these models , their adoption in critical environments , such as medicine , could lead to misguided decisions [ Garcı́aLaencina et al. , 2009 ; Little & Rubin , 2019 ] . We define two reasons why missingness may detrimentally influence treatment effects models . First , when certain covariates are missing when making a treatment decision , the fact that these variables are missing may also contribute to selection-bias . Without knowledge of someone ’ s age , it was deemed better to not offer the program . This is understandable , as the high price of the program requires some level of certainty . A second reason why missingness in the data may have disastrous effects on treatment effects models is that missingness may also be caused by the treatment . Missingness as a result of the treatment choice increases the difference between treatment subpopulations , even when there was no difference to begin with . Effectively , these set of covariates would be very much alike had it not been for their missingness . Adjusting on these missing variables introduces bias to the model . Once an applicant has accepted their offer for job-training , the organisers require some additional information . Imagine , the program ’ s registration process asking the applicant ’ s current address , the job of their spouse , the amount of children they have , etc . Had they not accepted to participate in the program , they would be less likely to provide this additional information . The literature proposes two solutions to handle missingness : ( i ) either we impute the missing variables before subjecting the data to a learner [ Rubin , 1978 ; 2004 ; Little & Rubin , 2019 ; Kallus et al. , 2018 ] ; or ( ii ) we consider a missing variable as another value , and use it directly [ Mayer et al. , 2020b ; a ; D ’ Agostino Jr & Rubin , 2000 ; Rosenbaum & Rubin , 1984 ] . We find that imputation effectively removes information— i.e . given that missingness may cause treatment-selection , it is much harder to handle selection bias when we are given only part of the total information . However , considering that missingness may be different between treatment subpopulations , it can also introduce bias where there is none to begin with . In this case , not imputing the data will introduce bias . Contribution . We introduce ( and motivate adoption of ) a formal description of missingness in data used to estimate treatment effects [ Neyman , 1923 ; Rubin , 1974 ] . In particular , we find that previous attempts— dating as far back as the 1980s [ Rosenbaum & Rubin , 1984 , Appendix B ] — at formalising missingness in treatment effects are too general and allow for inaccurate descriptions of missingness and its impact . We illustrate why these descriptions are insufficient , and provide an alternative termed mixed confounded missingness ( MCM ) . We argue that MCM is a general-purpose missingness mechanism distinct from well-known missingness mechansims such as missing ( completely ) at random [ Little & Rubin , 2019 ] , and a refinement of conditional independence of treatment [ Rosenbaum & Rubin , 1984 ] that should be adopted to describe missingness when estimating treatment effects . Furthermore , based on the insights provided by MCM , we propose a strategy to handling missing data in treatment effects , termed selective imputation . Our approach is theoretically motivated and we provide empirical evidence of how methods benefit from this approach and demonstrate the harm when missingness is not correctly dealt with . 2 PRELIMINARIES . Estimating causal effects is a difficult endeavor , as it requires us to answer a counterfactual question . In particular , when we observe the outcome after applying a treatment on an individual , it is impossible to also observe that individual ’ s outcome under alternative treatment [ Holland , 1986 ] . As a treatment effect is defined as the difference between both outcomes , we are tasked with inferring an estimand which is never observed , which is crucially different from standard supervised learning . One can estimate causal effects by conducting randomised controlled trials ( RCTs ) [ Fisher , 1925 ; Neyman , 1923 ] . However , RCTs are often very expensive , and are sometimes considered unethical in a clinical setting [ Hellman & Hellman , 1991 ; Edwards et al. , 1999 ] . However , the alternative we consider in our work— estimating effects from observational data —comes with its own challenges . Contrasting an RCT study , comparing the subpopulations associated with each treatment in an observational dataset will result in biased estimates . The reason lies in the difference between these subpopulations . If treatment is indeed not assigned randomly , but instead based on an individual ’ s characteristics , then these characteristics are more represented in each subpopulation as a result . If these characteristics also affect the outcome , then the outcomes become biased as the subpopulations are no longer comparable . This phenomenon is often termed selection bias . Notation . Let X ∈ X ⊆ Rd be the covariates of an individual ; let the individual be treated with W ∈ { 0 , 1 } ; and let Y ∈ Y ⊆ R be their observed outcome . Practically , X could be a patient with lung-cancer ; W = 1 could be chemo-therapy ( and W = 0 radio-therapy ) ; and Y their tumour size after treatment . We use a subscript , Xi to indicate the ith element in X , which means that Xi ∈ R. Assumptions in causal inference . Estimating unbiased treatment effects from observational data has received a lot of attention in recent years . One of the more popular avenues in the literature , is the potential outcomes ( POs ) framework of causality [ Neyman , 1923 ; Rubin , 1974 ] . We define the PO of a treatment w ∈ { 0 , 1 } as Y ( w ) , where Y ( w ) corresponds to the outcome an individual would have experienced had they been assigned treatment W = w. While the standard consistency assumption ( see Assum . 1 below ) allows us to interpret the observed outcome as the potential outcome of the observed treatment , i.e . Y = Y ( W ) ; selection bias makes estimating Y ( ¬W ) more involved . Countering selection bias is achieved by correctly adjusting for the confounders . In doing so , we make the following assumptions , standard in the PO-framework : Assumption 1 ( Consistency ) . The observed outcome Y = Y ( W ) = Y ( w ) if W = w , for w ∈ { 0 , 1 } and i = 1 , 2 , . . . , N , 1 i.e . outcomes in the data correspond to one of the potential outcomes . Assumption 2 ( Ignorability ) . The joint distribution p ( X , W , Y ) satisfies strong ignorability : Y ( 0 ) , Y ( 1 ) ⊥ W |X , i.e . the potential outcomes are independent of the treatment , conditioned on X , implying that there are no additional ( unobserved ) confounders beyond the variables in X . Assumption 3 ( Overlap ) . The distribution p ( X , W , Y ) satisfies overlap : ∃ δ ∈ ( 0 , 1 ) s.t . δ < p ( W |X = x ) < 1− δ , ∀x ∈ X , i.e . each individual has a probability to receive either treatment . Graphical models and causality . Alternatively to POs , we can express causal relationships as a graphical model . In particular , a causal relationship is depicted as a directed edge in a directed acyclic graph ( DAG ) [ Pearl , 2009 ] , where a parent node is the cause and the child node is the effect . The ignorability assumption in Assum . 2 is sometimes illustrated in such a graphical model [ Richardson & Robins , 2013 ] . Specifically , the ignorability assumption can be expressed as the DAG shown in Fig . 1a . Typically the influence of the treatment on the outcome is expressed as a single world intervention graph ( SWIG ) : W w Y [ Richardson & Robins , 2013 ] . We have removed this SWIG-path from our figures in order to focus our discussion on the path ( s ) between X and W . Note that the set of DAGs ( i.e . the Markov equivalence class ) that satisfy Assum . 2 encompasses more than just the DAG in Fig . 1a . Other DAGs in this equivalence class can just as easily respect Assum . 1 to 3 , but they would make no sense . For example , reversing the arrow between X and Y would imply that outcome causes the covariates in the individuals , while still respecting ignorability . Instead , Fig . 1a is motivated through logical reasoning , where treatment and outcome is caused by the covariates . Throughout the remainder of this paper , we will build ( and extend ) heavily on Fig . 1a . Causal estimands . We now arrive at our two estimands of interest : the average treatment effect ( ATE ) , and the conditional average treatment effect ( CATE ) . Given the notation above , we can define each estimand as follows : Definition 1 ( ATE ) . The ATE is defined as the population wide difference between a treatment ’ s potential outcomes . Mathematically , we can define the ATE as follows : τ̄ ( X ) : = EX [ Y ( 1 ) −Y ( 0 ) ] . Definition 2 ( CATE ) . The CATE is defined as a conditional difference between a treatment ’ s potential outcomes . Mathematically , we can define the CATE as follows : τ ( x ) : = E [ Y ( 1 ) −Y ( 0 ) |X = x ] . Missingness . In practice , a sample X may be incomplete . For example , a clinician responding to an urgent trauma case may have to select treatment based on incomplete information . In this scenario , the incomplete variables are considered missing . To learn from these data we could consider completing this sample through imputation , but missingness in itself may be informative . Perhaps the clinician ’ s decision would have been different if they had had complete information . Typically , we define three mechanisms to describe how a variable ended up to be missing : a first is missing completely at random ( MCAR ) , where missingness in one variable is independent of the other variables , a second is missing at random ( MAR ) , where the missingness in one variable may depend on 1The well-known stable unit treatment value assumption ( SUTVA ) assumes both no interference and consistency [ Rubin , 1980 ] . The equation in our consistency assumption also implies no interference . the other ( observed ) variables , and the third is missing not at random ( MNAR ) , where missingness is typically assumed to be caused by variables outside the observed covariates [ van Buuren , 2018 ; Rubin , 1976 ; Little & Rubin , 2019 ] . Generally , MCAR is attributed to noise in data-collection . We indicate the missing data in X with a variable Z ∈ { 1 , ? } d , where Zi = ? if Xi is missing , and Zi = 1 if Xi is observed . Having Z ⊥ X , Y ( w ) , corresponds with MCAR ; and Z 6⊥ X , but Z ⊥ Y ( w ) |X , corresponds with M ( N ) AR . In our paper , we denote the complete ( but unobserved ) sample as X , and the incomplete ( but observed ) sample as X̃ : = Z X ∈ { ? , R } d where we define as the element-wise product and we take Xi × ? = ? , i.e . if Xi is unobserved it equals ? in X̃ . Note that none of the existing missingness mechanisms take the treatment W into account as standard , since they span a broader literature beyond treatment effects . We have illustrated MCAR and M ( N ) AR as DAGs in Fig . 1b and Fig . 1c , respectively , where we have included arrows from X̃ and Z to W . This corresponds to the situation where treatment is decided based on what is actually observed ; the alternative where X is causing W would lead to a confounded setting , which is commonly assumed not to be the case in the literature . Note that these DAGs respect the conditional independent statements assumed in their respective missingness mechanisms . As we have noted in our introduction , we could either impute a missing valueXij with an estimate thereof , denoted Ẋij , such that we can predict a treatment effect from data with imputed samples ( i.e . learn τ̄ ( Ẋ ) or τ ( Ẋ ) ) ; or we could predict treatment effects from data with missingness directly ( i.e . learn τ̄ ( X̃ ) or τ ( X̃ ) ) .
In this paper, the authors mainly study the problem of missing data in treatment effect estimation and highlight the importance of addressing this problem. The authors propose a selective imputation scheme which is more well suited for addressing missingness in such scenarios. Authors also present several sample scenarios illustratively which indicate potential issues with current methods while doing TE with missingness. Empirical results compare different scenarios where general imputation schemes (imputing all data, no data, wrong data) can be much worse than their proposed method.
SP:3edf31c90be4d925f166a801ee1b9bc5a987e32e
To Impute or Not To Impute? Missing Data in Treatment Effect Estimation
1 INTRODUCTION . Treatment effects are arguably the most important estimand in causal inference [ Pearl , 2009 ; Neyman , 1923 ; Rubin , 1974 ] . A reason for this is that a treatment effect lies at the heart of a causal question . Using causal inference , we try to more explicitly attribute effect to the treatment in question , by carefully disentangling the role of the environment . We shall explain with a running example . Imagine , a job-training program to boost employment . Before sponsoring such a program , a legislative body may want to estimate its effect before widespread adoption . Using past data on the program , the body has to rely on causal methods to infer the effect of the training program before formal adoption . We define effect as the difference in outcome when applying the treatment versus not applying the treatment ( or any alternative treatment for that matter ) . Literature on inferring ( or predicting ) treatment effects is largely concerned with handling selection bias . That is , we identify a possible difference between the treated and non-treated subpopulations of the data , seeing that treatment is rarely distributed uniformly across the population . If not accounted for , selection bias will lead to biased estimates . As such , many works focus on novel strategies to handle this bias [ Johansson et al. , 2016 ; Alaa & van der Schaar , 2017 ; Shalit et al. , 2017 ; Rubin , 1974 ; Imbens & Rubin , 2015 ] . In the past , the program was not offered to everyone . Those with a job were less likely to be considered . As were those that had been unemployed for a long time . Perhaps age played a role ; being less likely to switch careers , older people would benefit less from job-training . Treatment effect models are adopted in a wide range of fields , such as : medicine [ Obermeyer & Emanuel , 2016 ; Alaa et al. , 2021 ; Bica et al. , 2021 ] , marketing [ Devriendt et al. , 2018 ; Ascarza , 2018 ; Debaere et al. , 2019 ] , or even human resources [ Rombaut & Guerry , 2020 ] . However , these methods have almost exclusively assumed that data is complete . From a practitioner ’ s standpoint , this may not always be the case and , in reality , data is often incomplete [ Burton & Altman , 2004 ; Lit- tle et al. , 2012 ] . When missingness is not properly accounted for when training these models , their adoption in critical environments , such as medicine , could lead to misguided decisions [ Garcı́aLaencina et al. , 2009 ; Little & Rubin , 2019 ] . We define two reasons why missingness may detrimentally influence treatment effects models . First , when certain covariates are missing when making a treatment decision , the fact that these variables are missing may also contribute to selection-bias . Without knowledge of someone ’ s age , it was deemed better to not offer the program . This is understandable , as the high price of the program requires some level of certainty . A second reason why missingness in the data may have disastrous effects on treatment effects models is that missingness may also be caused by the treatment . Missingness as a result of the treatment choice increases the difference between treatment subpopulations , even when there was no difference to begin with . Effectively , these set of covariates would be very much alike had it not been for their missingness . Adjusting on these missing variables introduces bias to the model . Once an applicant has accepted their offer for job-training , the organisers require some additional information . Imagine , the program ’ s registration process asking the applicant ’ s current address , the job of their spouse , the amount of children they have , etc . Had they not accepted to participate in the program , they would be less likely to provide this additional information . The literature proposes two solutions to handle missingness : ( i ) either we impute the missing variables before subjecting the data to a learner [ Rubin , 1978 ; 2004 ; Little & Rubin , 2019 ; Kallus et al. , 2018 ] ; or ( ii ) we consider a missing variable as another value , and use it directly [ Mayer et al. , 2020b ; a ; D ’ Agostino Jr & Rubin , 2000 ; Rosenbaum & Rubin , 1984 ] . We find that imputation effectively removes information— i.e . given that missingness may cause treatment-selection , it is much harder to handle selection bias when we are given only part of the total information . However , considering that missingness may be different between treatment subpopulations , it can also introduce bias where there is none to begin with . In this case , not imputing the data will introduce bias . Contribution . We introduce ( and motivate adoption of ) a formal description of missingness in data used to estimate treatment effects [ Neyman , 1923 ; Rubin , 1974 ] . In particular , we find that previous attempts— dating as far back as the 1980s [ Rosenbaum & Rubin , 1984 , Appendix B ] — at formalising missingness in treatment effects are too general and allow for inaccurate descriptions of missingness and its impact . We illustrate why these descriptions are insufficient , and provide an alternative termed mixed confounded missingness ( MCM ) . We argue that MCM is a general-purpose missingness mechanism distinct from well-known missingness mechansims such as missing ( completely ) at random [ Little & Rubin , 2019 ] , and a refinement of conditional independence of treatment [ Rosenbaum & Rubin , 1984 ] that should be adopted to describe missingness when estimating treatment effects . Furthermore , based on the insights provided by MCM , we propose a strategy to handling missing data in treatment effects , termed selective imputation . Our approach is theoretically motivated and we provide empirical evidence of how methods benefit from this approach and demonstrate the harm when missingness is not correctly dealt with . 2 PRELIMINARIES . Estimating causal effects is a difficult endeavor , as it requires us to answer a counterfactual question . In particular , when we observe the outcome after applying a treatment on an individual , it is impossible to also observe that individual ’ s outcome under alternative treatment [ Holland , 1986 ] . As a treatment effect is defined as the difference between both outcomes , we are tasked with inferring an estimand which is never observed , which is crucially different from standard supervised learning . One can estimate causal effects by conducting randomised controlled trials ( RCTs ) [ Fisher , 1925 ; Neyman , 1923 ] . However , RCTs are often very expensive , and are sometimes considered unethical in a clinical setting [ Hellman & Hellman , 1991 ; Edwards et al. , 1999 ] . However , the alternative we consider in our work— estimating effects from observational data —comes with its own challenges . Contrasting an RCT study , comparing the subpopulations associated with each treatment in an observational dataset will result in biased estimates . The reason lies in the difference between these subpopulations . If treatment is indeed not assigned randomly , but instead based on an individual ’ s characteristics , then these characteristics are more represented in each subpopulation as a result . If these characteristics also affect the outcome , then the outcomes become biased as the subpopulations are no longer comparable . This phenomenon is often termed selection bias . Notation . Let X ∈ X ⊆ Rd be the covariates of an individual ; let the individual be treated with W ∈ { 0 , 1 } ; and let Y ∈ Y ⊆ R be their observed outcome . Practically , X could be a patient with lung-cancer ; W = 1 could be chemo-therapy ( and W = 0 radio-therapy ) ; and Y their tumour size after treatment . We use a subscript , Xi to indicate the ith element in X , which means that Xi ∈ R. Assumptions in causal inference . Estimating unbiased treatment effects from observational data has received a lot of attention in recent years . One of the more popular avenues in the literature , is the potential outcomes ( POs ) framework of causality [ Neyman , 1923 ; Rubin , 1974 ] . We define the PO of a treatment w ∈ { 0 , 1 } as Y ( w ) , where Y ( w ) corresponds to the outcome an individual would have experienced had they been assigned treatment W = w. While the standard consistency assumption ( see Assum . 1 below ) allows us to interpret the observed outcome as the potential outcome of the observed treatment , i.e . Y = Y ( W ) ; selection bias makes estimating Y ( ¬W ) more involved . Countering selection bias is achieved by correctly adjusting for the confounders . In doing so , we make the following assumptions , standard in the PO-framework : Assumption 1 ( Consistency ) . The observed outcome Y = Y ( W ) = Y ( w ) if W = w , for w ∈ { 0 , 1 } and i = 1 , 2 , . . . , N , 1 i.e . outcomes in the data correspond to one of the potential outcomes . Assumption 2 ( Ignorability ) . The joint distribution p ( X , W , Y ) satisfies strong ignorability : Y ( 0 ) , Y ( 1 ) ⊥ W |X , i.e . the potential outcomes are independent of the treatment , conditioned on X , implying that there are no additional ( unobserved ) confounders beyond the variables in X . Assumption 3 ( Overlap ) . The distribution p ( X , W , Y ) satisfies overlap : ∃ δ ∈ ( 0 , 1 ) s.t . δ < p ( W |X = x ) < 1− δ , ∀x ∈ X , i.e . each individual has a probability to receive either treatment . Graphical models and causality . Alternatively to POs , we can express causal relationships as a graphical model . In particular , a causal relationship is depicted as a directed edge in a directed acyclic graph ( DAG ) [ Pearl , 2009 ] , where a parent node is the cause and the child node is the effect . The ignorability assumption in Assum . 2 is sometimes illustrated in such a graphical model [ Richardson & Robins , 2013 ] . Specifically , the ignorability assumption can be expressed as the DAG shown in Fig . 1a . Typically the influence of the treatment on the outcome is expressed as a single world intervention graph ( SWIG ) : W w Y [ Richardson & Robins , 2013 ] . We have removed this SWIG-path from our figures in order to focus our discussion on the path ( s ) between X and W . Note that the set of DAGs ( i.e . the Markov equivalence class ) that satisfy Assum . 2 encompasses more than just the DAG in Fig . 1a . Other DAGs in this equivalence class can just as easily respect Assum . 1 to 3 , but they would make no sense . For example , reversing the arrow between X and Y would imply that outcome causes the covariates in the individuals , while still respecting ignorability . Instead , Fig . 1a is motivated through logical reasoning , where treatment and outcome is caused by the covariates . Throughout the remainder of this paper , we will build ( and extend ) heavily on Fig . 1a . Causal estimands . We now arrive at our two estimands of interest : the average treatment effect ( ATE ) , and the conditional average treatment effect ( CATE ) . Given the notation above , we can define each estimand as follows : Definition 1 ( ATE ) . The ATE is defined as the population wide difference between a treatment ’ s potential outcomes . Mathematically , we can define the ATE as follows : τ̄ ( X ) : = EX [ Y ( 1 ) −Y ( 0 ) ] . Definition 2 ( CATE ) . The CATE is defined as a conditional difference between a treatment ’ s potential outcomes . Mathematically , we can define the CATE as follows : τ ( x ) : = E [ Y ( 1 ) −Y ( 0 ) |X = x ] . Missingness . In practice , a sample X may be incomplete . For example , a clinician responding to an urgent trauma case may have to select treatment based on incomplete information . In this scenario , the incomplete variables are considered missing . To learn from these data we could consider completing this sample through imputation , but missingness in itself may be informative . Perhaps the clinician ’ s decision would have been different if they had had complete information . Typically , we define three mechanisms to describe how a variable ended up to be missing : a first is missing completely at random ( MCAR ) , where missingness in one variable is independent of the other variables , a second is missing at random ( MAR ) , where the missingness in one variable may depend on 1The well-known stable unit treatment value assumption ( SUTVA ) assumes both no interference and consistency [ Rubin , 1980 ] . The equation in our consistency assumption also implies no interference . the other ( observed ) variables , and the third is missing not at random ( MNAR ) , where missingness is typically assumed to be caused by variables outside the observed covariates [ van Buuren , 2018 ; Rubin , 1976 ; Little & Rubin , 2019 ] . Generally , MCAR is attributed to noise in data-collection . We indicate the missing data in X with a variable Z ∈ { 1 , ? } d , where Zi = ? if Xi is missing , and Zi = 1 if Xi is observed . Having Z ⊥ X , Y ( w ) , corresponds with MCAR ; and Z 6⊥ X , but Z ⊥ Y ( w ) |X , corresponds with M ( N ) AR . In our paper , we denote the complete ( but unobserved ) sample as X , and the incomplete ( but observed ) sample as X̃ : = Z X ∈ { ? , R } d where we define as the element-wise product and we take Xi × ? = ? , i.e . if Xi is unobserved it equals ? in X̃ . Note that none of the existing missingness mechanisms take the treatment W into account as standard , since they span a broader literature beyond treatment effects . We have illustrated MCAR and M ( N ) AR as DAGs in Fig . 1b and Fig . 1c , respectively , where we have included arrows from X̃ and Z to W . This corresponds to the situation where treatment is decided based on what is actually observed ; the alternative where X is causing W would lead to a confounded setting , which is commonly assumed not to be the case in the literature . Note that these DAGs respect the conditional independent statements assumed in their respective missingness mechanisms . As we have noted in our introduction , we could either impute a missing valueXij with an estimate thereof , denoted Ẋij , such that we can predict a treatment effect from data with imputed samples ( i.e . learn τ̄ ( Ẋ ) or τ ( Ẋ ) ) ; or we could predict treatment effects from data with missingness directly ( i.e . learn τ̄ ( X̃ ) or τ ( X̃ ) ) .
This paper studies dealing with missing values in estimating treatment effects. Authors identify a new missingness mechanism, mixed confounded missingness (MCM), including missingness that determines treatment selection and missingness that is determined by treatment selection. The authors show that both imputation and no imputation lead to poor treatment effect estimations. The authors present a selective imputation strategy that informs which variables should be imputed and which should not. They empirically demonstrate the effectiveness of the strategy.
SP:3edf31c90be4d925f166a801ee1b9bc5a987e32e
To Impute or Not To Impute? Missing Data in Treatment Effect Estimation
1 INTRODUCTION . Treatment effects are arguably the most important estimand in causal inference [ Pearl , 2009 ; Neyman , 1923 ; Rubin , 1974 ] . A reason for this is that a treatment effect lies at the heart of a causal question . Using causal inference , we try to more explicitly attribute effect to the treatment in question , by carefully disentangling the role of the environment . We shall explain with a running example . Imagine , a job-training program to boost employment . Before sponsoring such a program , a legislative body may want to estimate its effect before widespread adoption . Using past data on the program , the body has to rely on causal methods to infer the effect of the training program before formal adoption . We define effect as the difference in outcome when applying the treatment versus not applying the treatment ( or any alternative treatment for that matter ) . Literature on inferring ( or predicting ) treatment effects is largely concerned with handling selection bias . That is , we identify a possible difference between the treated and non-treated subpopulations of the data , seeing that treatment is rarely distributed uniformly across the population . If not accounted for , selection bias will lead to biased estimates . As such , many works focus on novel strategies to handle this bias [ Johansson et al. , 2016 ; Alaa & van der Schaar , 2017 ; Shalit et al. , 2017 ; Rubin , 1974 ; Imbens & Rubin , 2015 ] . In the past , the program was not offered to everyone . Those with a job were less likely to be considered . As were those that had been unemployed for a long time . Perhaps age played a role ; being less likely to switch careers , older people would benefit less from job-training . Treatment effect models are adopted in a wide range of fields , such as : medicine [ Obermeyer & Emanuel , 2016 ; Alaa et al. , 2021 ; Bica et al. , 2021 ] , marketing [ Devriendt et al. , 2018 ; Ascarza , 2018 ; Debaere et al. , 2019 ] , or even human resources [ Rombaut & Guerry , 2020 ] . However , these methods have almost exclusively assumed that data is complete . From a practitioner ’ s standpoint , this may not always be the case and , in reality , data is often incomplete [ Burton & Altman , 2004 ; Lit- tle et al. , 2012 ] . When missingness is not properly accounted for when training these models , their adoption in critical environments , such as medicine , could lead to misguided decisions [ Garcı́aLaencina et al. , 2009 ; Little & Rubin , 2019 ] . We define two reasons why missingness may detrimentally influence treatment effects models . First , when certain covariates are missing when making a treatment decision , the fact that these variables are missing may also contribute to selection-bias . Without knowledge of someone ’ s age , it was deemed better to not offer the program . This is understandable , as the high price of the program requires some level of certainty . A second reason why missingness in the data may have disastrous effects on treatment effects models is that missingness may also be caused by the treatment . Missingness as a result of the treatment choice increases the difference between treatment subpopulations , even when there was no difference to begin with . Effectively , these set of covariates would be very much alike had it not been for their missingness . Adjusting on these missing variables introduces bias to the model . Once an applicant has accepted their offer for job-training , the organisers require some additional information . Imagine , the program ’ s registration process asking the applicant ’ s current address , the job of their spouse , the amount of children they have , etc . Had they not accepted to participate in the program , they would be less likely to provide this additional information . The literature proposes two solutions to handle missingness : ( i ) either we impute the missing variables before subjecting the data to a learner [ Rubin , 1978 ; 2004 ; Little & Rubin , 2019 ; Kallus et al. , 2018 ] ; or ( ii ) we consider a missing variable as another value , and use it directly [ Mayer et al. , 2020b ; a ; D ’ Agostino Jr & Rubin , 2000 ; Rosenbaum & Rubin , 1984 ] . We find that imputation effectively removes information— i.e . given that missingness may cause treatment-selection , it is much harder to handle selection bias when we are given only part of the total information . However , considering that missingness may be different between treatment subpopulations , it can also introduce bias where there is none to begin with . In this case , not imputing the data will introduce bias . Contribution . We introduce ( and motivate adoption of ) a formal description of missingness in data used to estimate treatment effects [ Neyman , 1923 ; Rubin , 1974 ] . In particular , we find that previous attempts— dating as far back as the 1980s [ Rosenbaum & Rubin , 1984 , Appendix B ] — at formalising missingness in treatment effects are too general and allow for inaccurate descriptions of missingness and its impact . We illustrate why these descriptions are insufficient , and provide an alternative termed mixed confounded missingness ( MCM ) . We argue that MCM is a general-purpose missingness mechanism distinct from well-known missingness mechansims such as missing ( completely ) at random [ Little & Rubin , 2019 ] , and a refinement of conditional independence of treatment [ Rosenbaum & Rubin , 1984 ] that should be adopted to describe missingness when estimating treatment effects . Furthermore , based on the insights provided by MCM , we propose a strategy to handling missing data in treatment effects , termed selective imputation . Our approach is theoretically motivated and we provide empirical evidence of how methods benefit from this approach and demonstrate the harm when missingness is not correctly dealt with . 2 PRELIMINARIES . Estimating causal effects is a difficult endeavor , as it requires us to answer a counterfactual question . In particular , when we observe the outcome after applying a treatment on an individual , it is impossible to also observe that individual ’ s outcome under alternative treatment [ Holland , 1986 ] . As a treatment effect is defined as the difference between both outcomes , we are tasked with inferring an estimand which is never observed , which is crucially different from standard supervised learning . One can estimate causal effects by conducting randomised controlled trials ( RCTs ) [ Fisher , 1925 ; Neyman , 1923 ] . However , RCTs are often very expensive , and are sometimes considered unethical in a clinical setting [ Hellman & Hellman , 1991 ; Edwards et al. , 1999 ] . However , the alternative we consider in our work— estimating effects from observational data —comes with its own challenges . Contrasting an RCT study , comparing the subpopulations associated with each treatment in an observational dataset will result in biased estimates . The reason lies in the difference between these subpopulations . If treatment is indeed not assigned randomly , but instead based on an individual ’ s characteristics , then these characteristics are more represented in each subpopulation as a result . If these characteristics also affect the outcome , then the outcomes become biased as the subpopulations are no longer comparable . This phenomenon is often termed selection bias . Notation . Let X ∈ X ⊆ Rd be the covariates of an individual ; let the individual be treated with W ∈ { 0 , 1 } ; and let Y ∈ Y ⊆ R be their observed outcome . Practically , X could be a patient with lung-cancer ; W = 1 could be chemo-therapy ( and W = 0 radio-therapy ) ; and Y their tumour size after treatment . We use a subscript , Xi to indicate the ith element in X , which means that Xi ∈ R. Assumptions in causal inference . Estimating unbiased treatment effects from observational data has received a lot of attention in recent years . One of the more popular avenues in the literature , is the potential outcomes ( POs ) framework of causality [ Neyman , 1923 ; Rubin , 1974 ] . We define the PO of a treatment w ∈ { 0 , 1 } as Y ( w ) , where Y ( w ) corresponds to the outcome an individual would have experienced had they been assigned treatment W = w. While the standard consistency assumption ( see Assum . 1 below ) allows us to interpret the observed outcome as the potential outcome of the observed treatment , i.e . Y = Y ( W ) ; selection bias makes estimating Y ( ¬W ) more involved . Countering selection bias is achieved by correctly adjusting for the confounders . In doing so , we make the following assumptions , standard in the PO-framework : Assumption 1 ( Consistency ) . The observed outcome Y = Y ( W ) = Y ( w ) if W = w , for w ∈ { 0 , 1 } and i = 1 , 2 , . . . , N , 1 i.e . outcomes in the data correspond to one of the potential outcomes . Assumption 2 ( Ignorability ) . The joint distribution p ( X , W , Y ) satisfies strong ignorability : Y ( 0 ) , Y ( 1 ) ⊥ W |X , i.e . the potential outcomes are independent of the treatment , conditioned on X , implying that there are no additional ( unobserved ) confounders beyond the variables in X . Assumption 3 ( Overlap ) . The distribution p ( X , W , Y ) satisfies overlap : ∃ δ ∈ ( 0 , 1 ) s.t . δ < p ( W |X = x ) < 1− δ , ∀x ∈ X , i.e . each individual has a probability to receive either treatment . Graphical models and causality . Alternatively to POs , we can express causal relationships as a graphical model . In particular , a causal relationship is depicted as a directed edge in a directed acyclic graph ( DAG ) [ Pearl , 2009 ] , where a parent node is the cause and the child node is the effect . The ignorability assumption in Assum . 2 is sometimes illustrated in such a graphical model [ Richardson & Robins , 2013 ] . Specifically , the ignorability assumption can be expressed as the DAG shown in Fig . 1a . Typically the influence of the treatment on the outcome is expressed as a single world intervention graph ( SWIG ) : W w Y [ Richardson & Robins , 2013 ] . We have removed this SWIG-path from our figures in order to focus our discussion on the path ( s ) between X and W . Note that the set of DAGs ( i.e . the Markov equivalence class ) that satisfy Assum . 2 encompasses more than just the DAG in Fig . 1a . Other DAGs in this equivalence class can just as easily respect Assum . 1 to 3 , but they would make no sense . For example , reversing the arrow between X and Y would imply that outcome causes the covariates in the individuals , while still respecting ignorability . Instead , Fig . 1a is motivated through logical reasoning , where treatment and outcome is caused by the covariates . Throughout the remainder of this paper , we will build ( and extend ) heavily on Fig . 1a . Causal estimands . We now arrive at our two estimands of interest : the average treatment effect ( ATE ) , and the conditional average treatment effect ( CATE ) . Given the notation above , we can define each estimand as follows : Definition 1 ( ATE ) . The ATE is defined as the population wide difference between a treatment ’ s potential outcomes . Mathematically , we can define the ATE as follows : τ̄ ( X ) : = EX [ Y ( 1 ) −Y ( 0 ) ] . Definition 2 ( CATE ) . The CATE is defined as a conditional difference between a treatment ’ s potential outcomes . Mathematically , we can define the CATE as follows : τ ( x ) : = E [ Y ( 1 ) −Y ( 0 ) |X = x ] . Missingness . In practice , a sample X may be incomplete . For example , a clinician responding to an urgent trauma case may have to select treatment based on incomplete information . In this scenario , the incomplete variables are considered missing . To learn from these data we could consider completing this sample through imputation , but missingness in itself may be informative . Perhaps the clinician ’ s decision would have been different if they had had complete information . Typically , we define three mechanisms to describe how a variable ended up to be missing : a first is missing completely at random ( MCAR ) , where missingness in one variable is independent of the other variables , a second is missing at random ( MAR ) , where the missingness in one variable may depend on 1The well-known stable unit treatment value assumption ( SUTVA ) assumes both no interference and consistency [ Rubin , 1980 ] . The equation in our consistency assumption also implies no interference . the other ( observed ) variables , and the third is missing not at random ( MNAR ) , where missingness is typically assumed to be caused by variables outside the observed covariates [ van Buuren , 2018 ; Rubin , 1976 ; Little & Rubin , 2019 ] . Generally , MCAR is attributed to noise in data-collection . We indicate the missing data in X with a variable Z ∈ { 1 , ? } d , where Zi = ? if Xi is missing , and Zi = 1 if Xi is observed . Having Z ⊥ X , Y ( w ) , corresponds with MCAR ; and Z 6⊥ X , but Z ⊥ Y ( w ) |X , corresponds with M ( N ) AR . In our paper , we denote the complete ( but unobserved ) sample as X , and the incomplete ( but observed ) sample as X̃ : = Z X ∈ { ? , R } d where we define as the element-wise product and we take Xi × ? = ? , i.e . if Xi is unobserved it equals ? in X̃ . Note that none of the existing missingness mechanisms take the treatment W into account as standard , since they span a broader literature beyond treatment effects . We have illustrated MCAR and M ( N ) AR as DAGs in Fig . 1b and Fig . 1c , respectively , where we have included arrows from X̃ and Z to W . This corresponds to the situation where treatment is decided based on what is actually observed ; the alternative where X is causing W would lead to a confounded setting , which is commonly assumed not to be the case in the literature . Note that these DAGs respect the conditional independent statements assumed in their respective missingness mechanisms . As we have noted in our introduction , we could either impute a missing valueXij with an estimate thereof , denoted Ẋij , such that we can predict a treatment effect from data with imputed samples ( i.e . learn τ̄ ( Ẋ ) or τ ( Ẋ ) ) ; or we could predict treatment effects from data with missingness directly ( i.e . learn τ̄ ( X̃ ) or τ ( X̃ ) ) .
"we identify a new missingness mechanism, which we term mixed confounded missingness (MCM), where some missingness determines treatment selection and other missingness is determined by treatment selection." The author gave a new term called “MCM” which is not something new. MCM is a type of MNAR (Missing-Not-At-Random). MCM cannot be listed parallel to MCAR, MAR and MNAR.
SP:3edf31c90be4d925f166a801ee1b9bc5a987e32e
FlowX: Towards Explainable Graph Neural Networks via Message Flows
1 INTRODUCTION . With the advances of deep learning , graph neural networks ( GNNs ) are achieving promising performance on many graph tasks , including graph classification ( Xu et al. , 2019 ; Gao & Ji , 2019 ; Chen et al. , 2020 ) , node classification ( Kipf & Welling , 2017 ; Veličković et al. , 2018 ; Wu et al. , 2019 ) , and graph generation ( Luo et al. , 2021 ; You et al. , 2018 ) . Many research efforts have been made to develop advanced graph operations , such as graph message passing ( Kipf & Welling , 2017 ; Veličković et al. , 2018 ; Li et al. , 2019 ) , graph pooling ( Yuan & Ji , 2020 ; Zhang et al. , 2018 ; Ying et al. , 2018 ) , and 3D graph operations ( Schütt et al. , 2017 ; Klicpera et al. , 2020 ) . Deep graph models usually consist of many layers of these operations stacked on top of each other interspersed with nonlinear functions . The resulting deep models are usually deep and highly nonlinear and complex . While these complex systems allow for accurate modeling , their decision mechanisms are highly elusive and not human-intelligible . Given the increasing importance and demand for trustworthy and fair artificial intelligence , it is imperative to develop methods to open the black-box and explain these highly complex deep models . Driven by these needs , significant efforts have been made to investigate the explainability of deep models on images and texts . These methods are developed from different perspectives , including studying the gradients of models ( Simonyan et al. , 2013 ; Smilkov et al. , 2017 ; Yang et al. , 2019 ) , mapping hidden features to input space ( Zhou et al. , 2016 ; Selvaraju et al. , 2017 ) , occluding different input features ( Yuan et al. , 2020a ; Dabkowski & Gal , 2017 ; Chen et al. , 2018 ) , and studying the meaning of hidden layers ( Yuan et al. , 2019 ; Olah et al. , 2018 ; Du et al. , 2018 ) , etc . In contrast , the explainability of deep graph models is still less explored . Since graph data contain limited locality information but have important structural information , it is usually not natural to directly extend image or text based methods to graphs . Recently , several techniques have been proposed to explain GNNs , such as XGNN ( Yuan et al. , 2020b ) , GNNExplainer ( Ying et al. , 2019 ) , PGExplainer ( Luo et al. , 2020 ) , and SubgraphX ( Yuan et al. , 2021 ) , etc . These methods mainly focus on explaining graph nodes , edges , features , or subgraphs . In this work , we observe and argue that message flows are the inherent functional mechanism of GNNs and thus are more natural and intuitive for studying the explainability of GNNs . To this end , we propose a message flow based explanation method , known as FlowX , to explain GNNs . FlowX attributes GNN predictions to message flows and studies the importance of different message flows . We first develop a systematic framework that lays the foundation on message flows for naturally explaining the message passing in GNNs . With our framework , the FlowX first quantifies the importance of flows by following the phylosophy of Shapley values . Since message flows can not be directly quantified to calculate marginal contributions , we propose an approximation scheme as the initial assessments of different flows . We then propose a learning-based algorithm taking advantages from the initial assessments to capture important flows in predictions . We conduct extensive experiments on both synthetic and real-world datasets . Experimental results show that our proposed FlowX outperforms existing methods significantly and consistently . Both quantitative and qualitative studies demonstrate that our proposed FlowX leads to improved explainability of GNNs . 2 RELATED WORK . 2.1 GRAPH NEURAL NETWORKS . With the advances of deep learning , several graph neural network approaches have been proposed to solve graph tasks , including graph convolutional networks ( GCNs ) ( Kipf & Welling , 2017 ) , graph attention networks ( GATs ) ( Veličković et al. , 2018 ) , and graph isomorphism networks ( GINs ) ( Xu et al. , 2019 ) , etc . They generally follow a message-passing framework to learn graph node features . Specifically , the new features of a target node are learned by aggregating messages flows passed from its neighboring nodes . Without loss of generality , we consider the input graph as a directed graph with n nodes and m edges . The graph is denoted as G = ( V , E ) , where V = { v1 , . . . , vn } denotes nodes , and E = { eij } represents edges in which eij is the directed edge vi → vj . Then it can be represented by a feature matrix X ∈ Rd×n and an adjacency matrix A ∈ Rn×n . Each node vi is associated with a d-dimensional feature vector xi corresponding to the i-th column of X . The element aij in A represents the weight of eij , and aij = 0 indicates eij does not exist . For the t-th layer in GNNs , the message aggregation procedures can be mathematically written as a two-step computation as Aggregate : St = Xt−1Ât , ( 1 ) Combine : Xt = M t ( St ) , ( 2 ) where Xt ∈ Rdt×n denotes the node feature matrix computed by the t-th GNN layer and X0 = X . Here M t ( · ) denotes the node feature transformation function at layer t and Ât is the connectivity matrix at layer t. Note that we name the elements in Ât as layer edges and âtjk indicates the layer edge connecting node j and k in layer t. For example , in GCNs , the transformations are defined as σ ( W tSt ) and Ât = D− 1 2 ( A+ I ) D− 1 2 where W t ∈ Rdt×dt−1 is a trainable weight matrix , σ ( · ) denotes the activation function , I is an identity matrix to add self-loops to the adjacency matrix , and D denotes the diagonal node degree matrix . We can stack T GNN layers on top of each other to form a T -layer network , and the network function can be expressed as f ( G ) = g ( MT ( MT−1 ( · · ·M1 ( X0Â1 ) · · · ) ÂT−1 ) ÂT ) . When f ( G ) is a graph classification model , g ( · ) generally consists of a readout function , such as global mean pooling , and a multi-layer perceptron ( MLP ) graph classifier . Meanwhile , when f ( G ) is a node classification model , g ( · ) represents a MLP node classifier . 2.2 EXPLAINABILITY OF GRAPH NEURAL NETWORKS . A major limitation of GNNs is their lack of explainability . Thus , different methods have been proposed to explain the predictions of GNNs , such as GraphLime ( Huang et al. , 2020 ) , GNNExplainer ( Ying et al. , 2019 ) , PGExplainer ( Luo et al. , 2020 ) , PGMExplainer ( Vu & Thai , 2020 ) , SubgraphX ( Yuan et al. , 2021 ) , XGNN ( Yuan et al. , 2020b ) , and GraphSVX ( Duval & Malliaros , 2021 ) . These methods can be mainly grouped into four categories based on the views of their explanations . First , several techniques provide explanations by identifying important nodes in the input graph . For example , GradCAM ( Pope et al. , 2019 ) measures node importance by combining the hidden features and gradients ; LRP ( Baldassarre & Azizpour , 2019 ) and Excitation BP ( Pope et al. , 2019 ) decompose the predictions into several terms and assign these terms to different nodes ; PGM-Explainer ( Vu & Thai , 2020 ) builds a probabilistic graphical model by randomly perturbing the node features and employs an interpretable Bayesian network to generate explanations . Second , several existing methods , such as GNNExplainer ( Ying et al. , 2019 ) , PGExplainer ( Luo et al. , 2020 ) , and GraphMask ( Schlichtkrull et al. , 2021 ) , explain GNNs by studying the importance of different graph edges . These methods follow a similar high-level idea that learns masks to identify important edges while maximizing the mutual information . Next , the recent study SubgraphX ( Yuan et al. , 2021 ) proposes to explain GNNs via subgraphs . It incorporates the Monte Carlo tree search algorithm to explore subgraphs and employs Shapley values to measure the importance . Finally , XGNN ( Yuan et al. , 2020b ) focuses on model-level explanations , which can provide high-level insights and general understanding . It proposes to generate graph patterns that can maximize a certain model prediction . While those methods explain GNNs from different views , none of them can provide explanations in terms of message flows and we believe message flows are more natural for performing explainability . To the best of our knowledge , GNN-LRP ( Schnake et al. , 2020 ) is the only algorithm that explains GNNs by relevant walks . The relevant walk is defined as a T -length ordered edge sequence that corresponds to a T -step directed path on the input graph . To study walk explainability , GNN-LRP considers the GNN prediction as a function and decomposes it using higher-order Taylor expansions to distribute prediction scores to relevant walks . Specifically , by using T -order Taylor expansion with a proper root , each term in the Taylor expansion corresponds to a relevant walk and is regarded as the importance score . While our proposed FlowX shares a similar explanation target , i.e. , flow/walk , with GNN-LRP , our method is fundamentally different . The GNN-LRP is developed based on score decomposition while our method follows the phylosopy of Shapley values from cooperative game theory as initial assessments and proposes a learning-based algorithm for the score generation . In addition , GNN-LRP has several constraints on the activation function and bias term used in GNNs while our method can be applied to general GNN models . Furthermore , as the GNN-LRP follows the Gradient× Input scheme , it may not pass the model parameter randomization test and may not be sensitive to model parameters ( Adebayo et al. , 2018 ) . Differences with Other Methods Using Shapley Values : Shapley values are commonly used in explaining machine learning methods . In particular , a recent study proposes a surrogate method , known as GraphSVX ( Duval & Malliaros , 2021 ) , to explain GNNs with both node and feature masks . Another recent study proposes SubgraphX ( Yuan et al. , 2021 ) , which employs a search algorithm to explore and identify subgraphs with high Shapley scores . While these methods use Shapley values , there are several fundamental differences . First , our proposed method focuses on explaining message flows , which are the most basic and natural units for explanations as GNNs are based on message passing schemes . Second , we only use Shapley-like values as initial approximations to facilitating further training . Experiments show that the learning step is very important . Furthermore , the fundamental difference with GraphSVX is reflected in the fact that , while our method is a perturbation-based method , GraphSVX is a surrogate method ( Yuan et al. , 2020c ) . Due to these differences , we show in experiments that our FlowX achieves more natural and improved performance as compared with other methods .
FlowX is an explanation method for Graph Neural Networks. It derives importance measures for message flows, which are inherent function mechanisms of GNNs. These measures are initialized with a Monte Carlo approximation of the Shapley Values from Game Theory, applied to message flows. They are refined by learning a linear transformation, before being converted back to layer edge importance score ultimately provided as an explanation. Various experiments are performed to assess the relevance of the proposed explainer.
SP:e8ef6056b642b813c92dcbd0ed737eafbe736c87
FlowX: Towards Explainable Graph Neural Networks via Message Flows
1 INTRODUCTION . With the advances of deep learning , graph neural networks ( GNNs ) are achieving promising performance on many graph tasks , including graph classification ( Xu et al. , 2019 ; Gao & Ji , 2019 ; Chen et al. , 2020 ) , node classification ( Kipf & Welling , 2017 ; Veličković et al. , 2018 ; Wu et al. , 2019 ) , and graph generation ( Luo et al. , 2021 ; You et al. , 2018 ) . Many research efforts have been made to develop advanced graph operations , such as graph message passing ( Kipf & Welling , 2017 ; Veličković et al. , 2018 ; Li et al. , 2019 ) , graph pooling ( Yuan & Ji , 2020 ; Zhang et al. , 2018 ; Ying et al. , 2018 ) , and 3D graph operations ( Schütt et al. , 2017 ; Klicpera et al. , 2020 ) . Deep graph models usually consist of many layers of these operations stacked on top of each other interspersed with nonlinear functions . The resulting deep models are usually deep and highly nonlinear and complex . While these complex systems allow for accurate modeling , their decision mechanisms are highly elusive and not human-intelligible . Given the increasing importance and demand for trustworthy and fair artificial intelligence , it is imperative to develop methods to open the black-box and explain these highly complex deep models . Driven by these needs , significant efforts have been made to investigate the explainability of deep models on images and texts . These methods are developed from different perspectives , including studying the gradients of models ( Simonyan et al. , 2013 ; Smilkov et al. , 2017 ; Yang et al. , 2019 ) , mapping hidden features to input space ( Zhou et al. , 2016 ; Selvaraju et al. , 2017 ) , occluding different input features ( Yuan et al. , 2020a ; Dabkowski & Gal , 2017 ; Chen et al. , 2018 ) , and studying the meaning of hidden layers ( Yuan et al. , 2019 ; Olah et al. , 2018 ; Du et al. , 2018 ) , etc . In contrast , the explainability of deep graph models is still less explored . Since graph data contain limited locality information but have important structural information , it is usually not natural to directly extend image or text based methods to graphs . Recently , several techniques have been proposed to explain GNNs , such as XGNN ( Yuan et al. , 2020b ) , GNNExplainer ( Ying et al. , 2019 ) , PGExplainer ( Luo et al. , 2020 ) , and SubgraphX ( Yuan et al. , 2021 ) , etc . These methods mainly focus on explaining graph nodes , edges , features , or subgraphs . In this work , we observe and argue that message flows are the inherent functional mechanism of GNNs and thus are more natural and intuitive for studying the explainability of GNNs . To this end , we propose a message flow based explanation method , known as FlowX , to explain GNNs . FlowX attributes GNN predictions to message flows and studies the importance of different message flows . We first develop a systematic framework that lays the foundation on message flows for naturally explaining the message passing in GNNs . With our framework , the FlowX first quantifies the importance of flows by following the phylosophy of Shapley values . Since message flows can not be directly quantified to calculate marginal contributions , we propose an approximation scheme as the initial assessments of different flows . We then propose a learning-based algorithm taking advantages from the initial assessments to capture important flows in predictions . We conduct extensive experiments on both synthetic and real-world datasets . Experimental results show that our proposed FlowX outperforms existing methods significantly and consistently . Both quantitative and qualitative studies demonstrate that our proposed FlowX leads to improved explainability of GNNs . 2 RELATED WORK . 2.1 GRAPH NEURAL NETWORKS . With the advances of deep learning , several graph neural network approaches have been proposed to solve graph tasks , including graph convolutional networks ( GCNs ) ( Kipf & Welling , 2017 ) , graph attention networks ( GATs ) ( Veličković et al. , 2018 ) , and graph isomorphism networks ( GINs ) ( Xu et al. , 2019 ) , etc . They generally follow a message-passing framework to learn graph node features . Specifically , the new features of a target node are learned by aggregating messages flows passed from its neighboring nodes . Without loss of generality , we consider the input graph as a directed graph with n nodes and m edges . The graph is denoted as G = ( V , E ) , where V = { v1 , . . . , vn } denotes nodes , and E = { eij } represents edges in which eij is the directed edge vi → vj . Then it can be represented by a feature matrix X ∈ Rd×n and an adjacency matrix A ∈ Rn×n . Each node vi is associated with a d-dimensional feature vector xi corresponding to the i-th column of X . The element aij in A represents the weight of eij , and aij = 0 indicates eij does not exist . For the t-th layer in GNNs , the message aggregation procedures can be mathematically written as a two-step computation as Aggregate : St = Xt−1Ât , ( 1 ) Combine : Xt = M t ( St ) , ( 2 ) where Xt ∈ Rdt×n denotes the node feature matrix computed by the t-th GNN layer and X0 = X . Here M t ( · ) denotes the node feature transformation function at layer t and Ât is the connectivity matrix at layer t. Note that we name the elements in Ât as layer edges and âtjk indicates the layer edge connecting node j and k in layer t. For example , in GCNs , the transformations are defined as σ ( W tSt ) and Ât = D− 1 2 ( A+ I ) D− 1 2 where W t ∈ Rdt×dt−1 is a trainable weight matrix , σ ( · ) denotes the activation function , I is an identity matrix to add self-loops to the adjacency matrix , and D denotes the diagonal node degree matrix . We can stack T GNN layers on top of each other to form a T -layer network , and the network function can be expressed as f ( G ) = g ( MT ( MT−1 ( · · ·M1 ( X0Â1 ) · · · ) ÂT−1 ) ÂT ) . When f ( G ) is a graph classification model , g ( · ) generally consists of a readout function , such as global mean pooling , and a multi-layer perceptron ( MLP ) graph classifier . Meanwhile , when f ( G ) is a node classification model , g ( · ) represents a MLP node classifier . 2.2 EXPLAINABILITY OF GRAPH NEURAL NETWORKS . A major limitation of GNNs is their lack of explainability . Thus , different methods have been proposed to explain the predictions of GNNs , such as GraphLime ( Huang et al. , 2020 ) , GNNExplainer ( Ying et al. , 2019 ) , PGExplainer ( Luo et al. , 2020 ) , PGMExplainer ( Vu & Thai , 2020 ) , SubgraphX ( Yuan et al. , 2021 ) , XGNN ( Yuan et al. , 2020b ) , and GraphSVX ( Duval & Malliaros , 2021 ) . These methods can be mainly grouped into four categories based on the views of their explanations . First , several techniques provide explanations by identifying important nodes in the input graph . For example , GradCAM ( Pope et al. , 2019 ) measures node importance by combining the hidden features and gradients ; LRP ( Baldassarre & Azizpour , 2019 ) and Excitation BP ( Pope et al. , 2019 ) decompose the predictions into several terms and assign these terms to different nodes ; PGM-Explainer ( Vu & Thai , 2020 ) builds a probabilistic graphical model by randomly perturbing the node features and employs an interpretable Bayesian network to generate explanations . Second , several existing methods , such as GNNExplainer ( Ying et al. , 2019 ) , PGExplainer ( Luo et al. , 2020 ) , and GraphMask ( Schlichtkrull et al. , 2021 ) , explain GNNs by studying the importance of different graph edges . These methods follow a similar high-level idea that learns masks to identify important edges while maximizing the mutual information . Next , the recent study SubgraphX ( Yuan et al. , 2021 ) proposes to explain GNNs via subgraphs . It incorporates the Monte Carlo tree search algorithm to explore subgraphs and employs Shapley values to measure the importance . Finally , XGNN ( Yuan et al. , 2020b ) focuses on model-level explanations , which can provide high-level insights and general understanding . It proposes to generate graph patterns that can maximize a certain model prediction . While those methods explain GNNs from different views , none of them can provide explanations in terms of message flows and we believe message flows are more natural for performing explainability . To the best of our knowledge , GNN-LRP ( Schnake et al. , 2020 ) is the only algorithm that explains GNNs by relevant walks . The relevant walk is defined as a T -length ordered edge sequence that corresponds to a T -step directed path on the input graph . To study walk explainability , GNN-LRP considers the GNN prediction as a function and decomposes it using higher-order Taylor expansions to distribute prediction scores to relevant walks . Specifically , by using T -order Taylor expansion with a proper root , each term in the Taylor expansion corresponds to a relevant walk and is regarded as the importance score . While our proposed FlowX shares a similar explanation target , i.e. , flow/walk , with GNN-LRP , our method is fundamentally different . The GNN-LRP is developed based on score decomposition while our method follows the phylosopy of Shapley values from cooperative game theory as initial assessments and proposes a learning-based algorithm for the score generation . In addition , GNN-LRP has several constraints on the activation function and bias term used in GNNs while our method can be applied to general GNN models . Furthermore , as the GNN-LRP follows the Gradient× Input scheme , it may not pass the model parameter randomization test and may not be sensitive to model parameters ( Adebayo et al. , 2018 ) . Differences with Other Methods Using Shapley Values : Shapley values are commonly used in explaining machine learning methods . In particular , a recent study proposes a surrogate method , known as GraphSVX ( Duval & Malliaros , 2021 ) , to explain GNNs with both node and feature masks . Another recent study proposes SubgraphX ( Yuan et al. , 2021 ) , which employs a search algorithm to explore and identify subgraphs with high Shapley scores . While these methods use Shapley values , there are several fundamental differences . First , our proposed method focuses on explaining message flows , which are the most basic and natural units for explanations as GNNs are based on message passing schemes . Second , we only use Shapley-like values as initial approximations to facilitating further training . Experiments show that the learning step is very important . Furthermore , the fundamental difference with GraphSVX is reflected in the fact that , while our method is a perturbation-based method , GraphSVX is a surrogate method ( Yuan et al. , 2020c ) . Due to these differences , we show in experiments that our FlowX achieves more natural and improved performance as compared with other methods .
This paper explains GNNs by identifying important message flows. The authors use the concept of Shapley Value in Cooperative Game Theory and calculate Shapley Value as the initial assessments of flow importance score. A learning-based algorithm enables the refinement of important scores. Experiments are evaluated on both synthetic and real-world datasets.
SP:e8ef6056b642b813c92dcbd0ed737eafbe736c87
FlowX: Towards Explainable Graph Neural Networks via Message Flows
1 INTRODUCTION . With the advances of deep learning , graph neural networks ( GNNs ) are achieving promising performance on many graph tasks , including graph classification ( Xu et al. , 2019 ; Gao & Ji , 2019 ; Chen et al. , 2020 ) , node classification ( Kipf & Welling , 2017 ; Veličković et al. , 2018 ; Wu et al. , 2019 ) , and graph generation ( Luo et al. , 2021 ; You et al. , 2018 ) . Many research efforts have been made to develop advanced graph operations , such as graph message passing ( Kipf & Welling , 2017 ; Veličković et al. , 2018 ; Li et al. , 2019 ) , graph pooling ( Yuan & Ji , 2020 ; Zhang et al. , 2018 ; Ying et al. , 2018 ) , and 3D graph operations ( Schütt et al. , 2017 ; Klicpera et al. , 2020 ) . Deep graph models usually consist of many layers of these operations stacked on top of each other interspersed with nonlinear functions . The resulting deep models are usually deep and highly nonlinear and complex . While these complex systems allow for accurate modeling , their decision mechanisms are highly elusive and not human-intelligible . Given the increasing importance and demand for trustworthy and fair artificial intelligence , it is imperative to develop methods to open the black-box and explain these highly complex deep models . Driven by these needs , significant efforts have been made to investigate the explainability of deep models on images and texts . These methods are developed from different perspectives , including studying the gradients of models ( Simonyan et al. , 2013 ; Smilkov et al. , 2017 ; Yang et al. , 2019 ) , mapping hidden features to input space ( Zhou et al. , 2016 ; Selvaraju et al. , 2017 ) , occluding different input features ( Yuan et al. , 2020a ; Dabkowski & Gal , 2017 ; Chen et al. , 2018 ) , and studying the meaning of hidden layers ( Yuan et al. , 2019 ; Olah et al. , 2018 ; Du et al. , 2018 ) , etc . In contrast , the explainability of deep graph models is still less explored . Since graph data contain limited locality information but have important structural information , it is usually not natural to directly extend image or text based methods to graphs . Recently , several techniques have been proposed to explain GNNs , such as XGNN ( Yuan et al. , 2020b ) , GNNExplainer ( Ying et al. , 2019 ) , PGExplainer ( Luo et al. , 2020 ) , and SubgraphX ( Yuan et al. , 2021 ) , etc . These methods mainly focus on explaining graph nodes , edges , features , or subgraphs . In this work , we observe and argue that message flows are the inherent functional mechanism of GNNs and thus are more natural and intuitive for studying the explainability of GNNs . To this end , we propose a message flow based explanation method , known as FlowX , to explain GNNs . FlowX attributes GNN predictions to message flows and studies the importance of different message flows . We first develop a systematic framework that lays the foundation on message flows for naturally explaining the message passing in GNNs . With our framework , the FlowX first quantifies the importance of flows by following the phylosophy of Shapley values . Since message flows can not be directly quantified to calculate marginal contributions , we propose an approximation scheme as the initial assessments of different flows . We then propose a learning-based algorithm taking advantages from the initial assessments to capture important flows in predictions . We conduct extensive experiments on both synthetic and real-world datasets . Experimental results show that our proposed FlowX outperforms existing methods significantly and consistently . Both quantitative and qualitative studies demonstrate that our proposed FlowX leads to improved explainability of GNNs . 2 RELATED WORK . 2.1 GRAPH NEURAL NETWORKS . With the advances of deep learning , several graph neural network approaches have been proposed to solve graph tasks , including graph convolutional networks ( GCNs ) ( Kipf & Welling , 2017 ) , graph attention networks ( GATs ) ( Veličković et al. , 2018 ) , and graph isomorphism networks ( GINs ) ( Xu et al. , 2019 ) , etc . They generally follow a message-passing framework to learn graph node features . Specifically , the new features of a target node are learned by aggregating messages flows passed from its neighboring nodes . Without loss of generality , we consider the input graph as a directed graph with n nodes and m edges . The graph is denoted as G = ( V , E ) , where V = { v1 , . . . , vn } denotes nodes , and E = { eij } represents edges in which eij is the directed edge vi → vj . Then it can be represented by a feature matrix X ∈ Rd×n and an adjacency matrix A ∈ Rn×n . Each node vi is associated with a d-dimensional feature vector xi corresponding to the i-th column of X . The element aij in A represents the weight of eij , and aij = 0 indicates eij does not exist . For the t-th layer in GNNs , the message aggregation procedures can be mathematically written as a two-step computation as Aggregate : St = Xt−1Ât , ( 1 ) Combine : Xt = M t ( St ) , ( 2 ) where Xt ∈ Rdt×n denotes the node feature matrix computed by the t-th GNN layer and X0 = X . Here M t ( · ) denotes the node feature transformation function at layer t and Ât is the connectivity matrix at layer t. Note that we name the elements in Ât as layer edges and âtjk indicates the layer edge connecting node j and k in layer t. For example , in GCNs , the transformations are defined as σ ( W tSt ) and Ât = D− 1 2 ( A+ I ) D− 1 2 where W t ∈ Rdt×dt−1 is a trainable weight matrix , σ ( · ) denotes the activation function , I is an identity matrix to add self-loops to the adjacency matrix , and D denotes the diagonal node degree matrix . We can stack T GNN layers on top of each other to form a T -layer network , and the network function can be expressed as f ( G ) = g ( MT ( MT−1 ( · · ·M1 ( X0Â1 ) · · · ) ÂT−1 ) ÂT ) . When f ( G ) is a graph classification model , g ( · ) generally consists of a readout function , such as global mean pooling , and a multi-layer perceptron ( MLP ) graph classifier . Meanwhile , when f ( G ) is a node classification model , g ( · ) represents a MLP node classifier . 2.2 EXPLAINABILITY OF GRAPH NEURAL NETWORKS . A major limitation of GNNs is their lack of explainability . Thus , different methods have been proposed to explain the predictions of GNNs , such as GraphLime ( Huang et al. , 2020 ) , GNNExplainer ( Ying et al. , 2019 ) , PGExplainer ( Luo et al. , 2020 ) , PGMExplainer ( Vu & Thai , 2020 ) , SubgraphX ( Yuan et al. , 2021 ) , XGNN ( Yuan et al. , 2020b ) , and GraphSVX ( Duval & Malliaros , 2021 ) . These methods can be mainly grouped into four categories based on the views of their explanations . First , several techniques provide explanations by identifying important nodes in the input graph . For example , GradCAM ( Pope et al. , 2019 ) measures node importance by combining the hidden features and gradients ; LRP ( Baldassarre & Azizpour , 2019 ) and Excitation BP ( Pope et al. , 2019 ) decompose the predictions into several terms and assign these terms to different nodes ; PGM-Explainer ( Vu & Thai , 2020 ) builds a probabilistic graphical model by randomly perturbing the node features and employs an interpretable Bayesian network to generate explanations . Second , several existing methods , such as GNNExplainer ( Ying et al. , 2019 ) , PGExplainer ( Luo et al. , 2020 ) , and GraphMask ( Schlichtkrull et al. , 2021 ) , explain GNNs by studying the importance of different graph edges . These methods follow a similar high-level idea that learns masks to identify important edges while maximizing the mutual information . Next , the recent study SubgraphX ( Yuan et al. , 2021 ) proposes to explain GNNs via subgraphs . It incorporates the Monte Carlo tree search algorithm to explore subgraphs and employs Shapley values to measure the importance . Finally , XGNN ( Yuan et al. , 2020b ) focuses on model-level explanations , which can provide high-level insights and general understanding . It proposes to generate graph patterns that can maximize a certain model prediction . While those methods explain GNNs from different views , none of them can provide explanations in terms of message flows and we believe message flows are more natural for performing explainability . To the best of our knowledge , GNN-LRP ( Schnake et al. , 2020 ) is the only algorithm that explains GNNs by relevant walks . The relevant walk is defined as a T -length ordered edge sequence that corresponds to a T -step directed path on the input graph . To study walk explainability , GNN-LRP considers the GNN prediction as a function and decomposes it using higher-order Taylor expansions to distribute prediction scores to relevant walks . Specifically , by using T -order Taylor expansion with a proper root , each term in the Taylor expansion corresponds to a relevant walk and is regarded as the importance score . While our proposed FlowX shares a similar explanation target , i.e. , flow/walk , with GNN-LRP , our method is fundamentally different . The GNN-LRP is developed based on score decomposition while our method follows the phylosopy of Shapley values from cooperative game theory as initial assessments and proposes a learning-based algorithm for the score generation . In addition , GNN-LRP has several constraints on the activation function and bias term used in GNNs while our method can be applied to general GNN models . Furthermore , as the GNN-LRP follows the Gradient× Input scheme , it may not pass the model parameter randomization test and may not be sensitive to model parameters ( Adebayo et al. , 2018 ) . Differences with Other Methods Using Shapley Values : Shapley values are commonly used in explaining machine learning methods . In particular , a recent study proposes a surrogate method , known as GraphSVX ( Duval & Malliaros , 2021 ) , to explain GNNs with both node and feature masks . Another recent study proposes SubgraphX ( Yuan et al. , 2021 ) , which employs a search algorithm to explore and identify subgraphs with high Shapley scores . While these methods use Shapley values , there are several fundamental differences . First , our proposed method focuses on explaining message flows , which are the most basic and natural units for explanations as GNNs are based on message passing schemes . Second , we only use Shapley-like values as initial approximations to facilitating further training . Experiments show that the learning step is very important . Furthermore , the fundamental difference with GraphSVX is reflected in the fact that , while our method is a perturbation-based method , GraphSVX is a surrogate method ( Yuan et al. , 2020c ) . Due to these differences , we show in experiments that our FlowX achieves more natural and improved performance as compared with other methods .
With explainability in Graph Neural Networks (GNN) still in a nascent stage, most graph explanation methods generate explanations in terms of nodes, node features, edges, or sub-graphs. GNN's are essentially message-passing networks, where every node has access to a local view of the graph created by the propagation of neural messages (embeddings) along edges in the node’s local neighborhood. However, none of the previously proposed GNN explainability methods consider message-flows as possible explanations. The paper proposes FlowX to identify important message flows by employing concepts of Shapley values, where an approximation scheme is used to estimate the Shapley values as initial assessments of flow importance. Finally, a learning algorithm is proposed to refine and map the message flow importance to edge mask explanations, where experimental studies on both synthetic and real-world datasets show the improvement of explanations using FlowX.
SP:e8ef6056b642b813c92dcbd0ed737eafbe736c87
Mistake-driven Image Classification with FastGAN and SpinalNet
1 INTRODUCTION . Supervised training of deep learning models , like the image classification models we consider in this paper , is the most efficient training approach , but also the most data-intensive . To mitigate this issue , alternative techniques are commonly applied , e.g. , transfer learning from a pretrained model to a new domain ( Ridnik et al. , 2021 ) or data augmentation to expand the available dataset synthetically ( Shorten & Khoshgoftaar , 2019 ) . One particular data augmentation technique is to use Generative Adversarial Networks ( GANs ) ( Goodfellow et al. , 2020 ) that learn to produce new data that is similar to the distribution of the GAN ’ s training data . GAN-based augmentation has been shown to be successful in aiding the training process ( Bowles et al. , 2018 ; Wang et al. , 2018c ; Tanaka & Aranha , 2019 ) and has found practical adoption in other research domains ( Frid-Adar et al. , 2018 ; Sasmal et al. , 2020 ) . One challenge and limitation of GAN-based augmentation is either the high computational cost to augment each class of the dataset individually or the selection of the classes to augment that best support the model training . In this paper , we focus on a mistake-driven training procedure ( see Figure 1 ) that utilizes GAN-based data augmentation only after the initial model training , albeit transfer learning or training from scratch , and augments only those classes with the lowest accuracy , where the model shows performance weaknesses . This keeps the effort for class-wise GAN training at a lower level than a full-sized data augmentation procedure but still contributes to the model improvement by focusing on the most significant deficits accuracy-wise . The mistake-driven training method is fully compatible with any other training regime as it does not interfere directly with the model training or finetuning step except by querying the model during evaluation and enhancing the dataset for finetuning . Due to this explicit focus on model weaknesses as well as the careful selection of the components in the mistake-driven training pipeline , our method is computationally efficient and shows compet- itive performance on a number of benchmarks . First , we employ the progressive SpinalNet neural network architecture ( Kabir et al. , 2020 ; Chopra , 2021 ) as the image classification model , build on a backbone model , e.g . a pretrained Wide-ResNet ( Zagoruyko & Komodakis , 2016 ) or EfficientNetB7 ( Tan & Le , 2019 ) as used in the experiments . Afterward , the class-wise accuracy on the validation set is computed , and the worst-performing classes are identified . For each of these classes , a sampleefficient GAN is trained , here we choose the light-weight FastGAN method ( Liu et al. , 2021 ) , and use it to generate new samples . Finally , the already trained model is finetuned under consideration of the newly generated samples to improve and balance the model performance among the previously worst-performing classes . We perform an extensive experimental evaluation to test the influence of each component in the mistake-driven training pipeline and our component selection of backbone models , activation functions , and model optimizers . The method is evaluated on five widely used image classification datasets and exceeds the previous state-of-the-art accuracy on four of them . The contribution of our paper is threefold : 1 . During training , our method focuses on those classes with the lowest accuracy after the initial training phase . Only these classes are augmented to boost the accuracy , which leads to better performance . 2 . Due to the light-weight GAN method , the GAN-based augmentation is viable and effective for mistake-driven training even for datasets with only a few example images per class , while simultaneously requiring less computation than other , more complex GAN methods . 3 . Our extensive experiments , including ablation studies , show competitive or better accuracy than the previous state-of-the-art on five datasets . 2 RELATED WORK . This section relates the presented work to the recent literature on data augmentation using GANs . There are two types of image augmentation methods that help in increasing the accuracy of the model and making the model more robust . The first one is a geometrical transformation-based augmentation , and the other one is generative adversarial-based augmentation . Geometrical Transformation & Data Augmentation In the past decade , various data augmentation techniques have been used to improve classification prediction accuracy . The most common ones are those based on geometrical transformations ( Shorten & Khoshgoftaar , 2019 ) e.g. , cropping , flipping , rotation , color space , noise injection , and translation . These geometrical transformations increase the training dataset and improve the test accuracy ( Perez & Wang , 2017 ) . These data augmentation techniques are a best practice for training deep neural networks , especially in computer vision tasks where a vast number of augmentations are available and can be combined . Cubuk et al . ( 2019 ) further introduces a method to perform this combination , called AutoAugment automatically , that learns dataset-specific augmentation strategies to increase the final model accuracy . Synthetic Data Generation Using Generative Models Generative models , GANs in this context , have shown growing capability in generating very realistic data . These generated synthetic images can be utilized for data augmentation in data classification . Researchers have been attempting to enhance high-resolution images with GANs but with little success due to the enormous amount of data required to train GANs . Data augmentation with GANs has recently received increasing attention from the research community . Some research works have attempted to supplement images using GANs for data classification ( Tanaka & Aranha , 2019 ) . However , with limited data , utilizing GANs to augment data becomes a strenuous process . Rashid et al . ( 2019 ) , proposed to augment the ISIC skin lesion classification dataset using GANs . The results produced by data augmentation using GANs outperform ResNet and densenet models . In another line of work , Sasmal et al . ( 2020 ) used DCGAN for generating synthetic colonoscopic images . The generated images help in data augmentation to perform better polyp classification . Furthermore , Bejiga & Melgani ( 2018 ) suggests a GAN-based domain adaptation technique for aerial image classification . They use GANs for unsupervised domain adaptation of aerial remote sensing images . In the same field of work , Saha et al . ( 2021 ) developed TilGAN for the classification of images showing til , i.e. , tumor-infiltrating lymphocytes and non-til images . In addition to the previous research works , Zeng et al . ( 2020 ) propose to use GANs for augmenting data to detect disease severity . In another line of work , GANs were used for data augmentation in the field of multi-domain learning ( Yamaguchi et al. , 2020 ) . These multi-domain GANs learn both the outer and target datasets simultaneously and generate new samples for the target tasks . A detailed survey on the use of GANs for data augmentation is presented by Shorten & Khoshgoftaar ( 2019 ) . In this paper , our focus is to augment high-resolution images with a limited dataset which can further be used for finetuning the model . However , if the amount of the training data is not a constraining factor , IDA GAN ( Yang & Zhou , 2021 ) and Polarity GAN ( Deepshikha & Naman , 2020 ) can be utilized for data augmentation , too . Data Augmentation with Limited Data GANs generally require massive datasets for training ; limited data makes learning the underlying model arduous . Moreover , training GANs with limited data can easily lead to overfitting ( Bowles et al. , 2018 ) , which makes the training more difficult . Transfer learning can be used to avoid the problem of overfitting of GANs , which also results in better performance ( Bengio , 2012 ) . Apart from the traditional way of augmenting data using geometric transformations , some GANs use observations that have been forged ( Wang et al. , 2018b ) for generating new samples . Even though generating new images with limited data using GANs remains a challenging task , but at least the risk of overfitting can be reduced by using a pretrained model on a huge dataset and using that pretrained model for training GANs can produce some good quality images Wang et al . ( 2018b ) . However , using this technique sometimes leads to mode collapse , which is further fixed by Liu et al . ( 2021 ) using skip connections while training . 3 BACKGROUND . 3.1 SHARPNESS-AWARE MINIMIZATION . In deep learning models , we need to optimize the loss function such that the DL model can converge to global minima . To reach the minima , many optimization algorithms such as stochastic gradient descent , Adam ( Kingma & Ba , 2014 ) , and RMSProp are being used as a design choice for optimizing the loss function . Zhang et al . ( 2016 ) show that DL models could memorize the training data and easily overfit to it , due to which the trained model lack generalization ability . However , when a DL model converges to an abrupt global minimum , the value of the loss function remains high in the neighborhood of the global minimum , causing the DL model to lose its generalization ability . For the better generalization of DL models , Sharpness-Aware Minimization ( SAM ) was proposed ( Foret et al. , 2020 ) , where the optimization goal is reformulated such that it considers the output of loss functions from not only the minimum but also at its neighboring points . In that way , SAM minimizes both loss value and loss sharpness . Finally , the minimization of loss value and loss sharpness is done using gradient descent by learning those parameters that converge to a global minima , which has nearly the same loss value at the neighboring points . 3.2 PROGRESSIVE SPINAL NETWORKS . In the human biological network , the spine performs the preprocessing of the input , which then goes to the brain for the final output ( D ’ Mello & Dickenson , 2008 ) . By taking inspiration from the human spinal cord , Kabir et al . ( 2020 ) proposed spinal networks . As the human brain receives information from various sensory neurons , and these signals are processed by the human spine before reaching the brain . Progressive SpinalNet consists of a processing unit and concatenating unit . The input to the Progressive SpinalNet Fully Connected ( FC ) layer is the CNN features . The processing unit can be a single hidden layer or multiple hidden layers . Each layer receives some portion from the input . The output of the processing unit is concatenated , and the following processing unit receives the concatenated output as an input . The gradients are easily propagated back to the first FC layer from the last FC layer due to connections between the layers . This helps in dealing with the vanishing gradient problem . The size of each layer is progressively increased , and the output size is the same for all the FC layers . The Progressive SpinalNet can be deeper as it does not suffer from a vanishing gradient . Contradicting the traditional way of feedforward neural networks , they used forward and introduced sideways and zig-zag interactions , which leads to better network predictions . 3.3 GENERATIVE ADVERSARIAL NETWORKS . The task of Generative Adversarial Networks ( GANs ) is to learn the distribution of the training data and generate new samples . GAN learns the distribution of the input data ρdata and generates synthetic images which have nearly the same distribution as the input image . The GAN architecture consists of basically two deep neural network architecture : ( a ) : the generative network G and ( b ) : the discriminator network D. The generator takes a noise vector z as an input from a known distribution ρz , generally a uniform distribution and outputs G ( z ) which maps to the space of distribution ρg . The generator G tries to produces more realistic images as the training progresses , and the discriminator D improves its ability to discriminate between synthetic and authentic images . Finally , the generator aims to generate images that have the same distribution as the input images , i.e. , ρg = ρdata . This basically leads to min-max optimization problem where the discriminator network D is trained to maximize log ( D ( x ) ) , where D ( x ) is the output of the discriminator and the generator network is trained as to minimize log ( 1-D ( G ( z ) ) . So , the objective function for GANs is a min-max objective function : min G max D J ( D , G ) & = Ex∼px [ log ( D ( x ) ) ] + Ez , ∼pz [ log ( 1−D ( G ( Z ) ) ] Furthermore , the computation cost to train Vanilla GANs is exorbitant , and it takes a large amount of training data to learn the distribution of training data . This limits GANs and its variants to generate high fidelity images when the training data is less , and we have fewer computational resources . To train GAN with limited data and low computational resources , Liu et al . ( 2021 ) proposed lightweight GAN , which can generate high fidelity images even when the training data is significantly less ( 50-100 images ) .
The paper proposes a solution for the imbalanced classification method. Learning the CNN traditionally on training data, Finding the classes with low accuracy and generating/augmenting the samples from those classes aiming to improve the accuracy of those classes by fine-tuning the model on it, is the proposed solution. Several experiments on datasets such as CIFAR10 is done. Results the feasibility and perfection of the idea. For generating samples from classes with low accuracy, a GAN is used.
SP:b487ec775a1bd8d0332e748517ea328444adbb48
Mistake-driven Image Classification with FastGAN and SpinalNet
1 INTRODUCTION . Supervised training of deep learning models , like the image classification models we consider in this paper , is the most efficient training approach , but also the most data-intensive . To mitigate this issue , alternative techniques are commonly applied , e.g. , transfer learning from a pretrained model to a new domain ( Ridnik et al. , 2021 ) or data augmentation to expand the available dataset synthetically ( Shorten & Khoshgoftaar , 2019 ) . One particular data augmentation technique is to use Generative Adversarial Networks ( GANs ) ( Goodfellow et al. , 2020 ) that learn to produce new data that is similar to the distribution of the GAN ’ s training data . GAN-based augmentation has been shown to be successful in aiding the training process ( Bowles et al. , 2018 ; Wang et al. , 2018c ; Tanaka & Aranha , 2019 ) and has found practical adoption in other research domains ( Frid-Adar et al. , 2018 ; Sasmal et al. , 2020 ) . One challenge and limitation of GAN-based augmentation is either the high computational cost to augment each class of the dataset individually or the selection of the classes to augment that best support the model training . In this paper , we focus on a mistake-driven training procedure ( see Figure 1 ) that utilizes GAN-based data augmentation only after the initial model training , albeit transfer learning or training from scratch , and augments only those classes with the lowest accuracy , where the model shows performance weaknesses . This keeps the effort for class-wise GAN training at a lower level than a full-sized data augmentation procedure but still contributes to the model improvement by focusing on the most significant deficits accuracy-wise . The mistake-driven training method is fully compatible with any other training regime as it does not interfere directly with the model training or finetuning step except by querying the model during evaluation and enhancing the dataset for finetuning . Due to this explicit focus on model weaknesses as well as the careful selection of the components in the mistake-driven training pipeline , our method is computationally efficient and shows compet- itive performance on a number of benchmarks . First , we employ the progressive SpinalNet neural network architecture ( Kabir et al. , 2020 ; Chopra , 2021 ) as the image classification model , build on a backbone model , e.g . a pretrained Wide-ResNet ( Zagoruyko & Komodakis , 2016 ) or EfficientNetB7 ( Tan & Le , 2019 ) as used in the experiments . Afterward , the class-wise accuracy on the validation set is computed , and the worst-performing classes are identified . For each of these classes , a sampleefficient GAN is trained , here we choose the light-weight FastGAN method ( Liu et al. , 2021 ) , and use it to generate new samples . Finally , the already trained model is finetuned under consideration of the newly generated samples to improve and balance the model performance among the previously worst-performing classes . We perform an extensive experimental evaluation to test the influence of each component in the mistake-driven training pipeline and our component selection of backbone models , activation functions , and model optimizers . The method is evaluated on five widely used image classification datasets and exceeds the previous state-of-the-art accuracy on four of them . The contribution of our paper is threefold : 1 . During training , our method focuses on those classes with the lowest accuracy after the initial training phase . Only these classes are augmented to boost the accuracy , which leads to better performance . 2 . Due to the light-weight GAN method , the GAN-based augmentation is viable and effective for mistake-driven training even for datasets with only a few example images per class , while simultaneously requiring less computation than other , more complex GAN methods . 3 . Our extensive experiments , including ablation studies , show competitive or better accuracy than the previous state-of-the-art on five datasets . 2 RELATED WORK . This section relates the presented work to the recent literature on data augmentation using GANs . There are two types of image augmentation methods that help in increasing the accuracy of the model and making the model more robust . The first one is a geometrical transformation-based augmentation , and the other one is generative adversarial-based augmentation . Geometrical Transformation & Data Augmentation In the past decade , various data augmentation techniques have been used to improve classification prediction accuracy . The most common ones are those based on geometrical transformations ( Shorten & Khoshgoftaar , 2019 ) e.g. , cropping , flipping , rotation , color space , noise injection , and translation . These geometrical transformations increase the training dataset and improve the test accuracy ( Perez & Wang , 2017 ) . These data augmentation techniques are a best practice for training deep neural networks , especially in computer vision tasks where a vast number of augmentations are available and can be combined . Cubuk et al . ( 2019 ) further introduces a method to perform this combination , called AutoAugment automatically , that learns dataset-specific augmentation strategies to increase the final model accuracy . Synthetic Data Generation Using Generative Models Generative models , GANs in this context , have shown growing capability in generating very realistic data . These generated synthetic images can be utilized for data augmentation in data classification . Researchers have been attempting to enhance high-resolution images with GANs but with little success due to the enormous amount of data required to train GANs . Data augmentation with GANs has recently received increasing attention from the research community . Some research works have attempted to supplement images using GANs for data classification ( Tanaka & Aranha , 2019 ) . However , with limited data , utilizing GANs to augment data becomes a strenuous process . Rashid et al . ( 2019 ) , proposed to augment the ISIC skin lesion classification dataset using GANs . The results produced by data augmentation using GANs outperform ResNet and densenet models . In another line of work , Sasmal et al . ( 2020 ) used DCGAN for generating synthetic colonoscopic images . The generated images help in data augmentation to perform better polyp classification . Furthermore , Bejiga & Melgani ( 2018 ) suggests a GAN-based domain adaptation technique for aerial image classification . They use GANs for unsupervised domain adaptation of aerial remote sensing images . In the same field of work , Saha et al . ( 2021 ) developed TilGAN for the classification of images showing til , i.e. , tumor-infiltrating lymphocytes and non-til images . In addition to the previous research works , Zeng et al . ( 2020 ) propose to use GANs for augmenting data to detect disease severity . In another line of work , GANs were used for data augmentation in the field of multi-domain learning ( Yamaguchi et al. , 2020 ) . These multi-domain GANs learn both the outer and target datasets simultaneously and generate new samples for the target tasks . A detailed survey on the use of GANs for data augmentation is presented by Shorten & Khoshgoftaar ( 2019 ) . In this paper , our focus is to augment high-resolution images with a limited dataset which can further be used for finetuning the model . However , if the amount of the training data is not a constraining factor , IDA GAN ( Yang & Zhou , 2021 ) and Polarity GAN ( Deepshikha & Naman , 2020 ) can be utilized for data augmentation , too . Data Augmentation with Limited Data GANs generally require massive datasets for training ; limited data makes learning the underlying model arduous . Moreover , training GANs with limited data can easily lead to overfitting ( Bowles et al. , 2018 ) , which makes the training more difficult . Transfer learning can be used to avoid the problem of overfitting of GANs , which also results in better performance ( Bengio , 2012 ) . Apart from the traditional way of augmenting data using geometric transformations , some GANs use observations that have been forged ( Wang et al. , 2018b ) for generating new samples . Even though generating new images with limited data using GANs remains a challenging task , but at least the risk of overfitting can be reduced by using a pretrained model on a huge dataset and using that pretrained model for training GANs can produce some good quality images Wang et al . ( 2018b ) . However , using this technique sometimes leads to mode collapse , which is further fixed by Liu et al . ( 2021 ) using skip connections while training . 3 BACKGROUND . 3.1 SHARPNESS-AWARE MINIMIZATION . In deep learning models , we need to optimize the loss function such that the DL model can converge to global minima . To reach the minima , many optimization algorithms such as stochastic gradient descent , Adam ( Kingma & Ba , 2014 ) , and RMSProp are being used as a design choice for optimizing the loss function . Zhang et al . ( 2016 ) show that DL models could memorize the training data and easily overfit to it , due to which the trained model lack generalization ability . However , when a DL model converges to an abrupt global minimum , the value of the loss function remains high in the neighborhood of the global minimum , causing the DL model to lose its generalization ability . For the better generalization of DL models , Sharpness-Aware Minimization ( SAM ) was proposed ( Foret et al. , 2020 ) , where the optimization goal is reformulated such that it considers the output of loss functions from not only the minimum but also at its neighboring points . In that way , SAM minimizes both loss value and loss sharpness . Finally , the minimization of loss value and loss sharpness is done using gradient descent by learning those parameters that converge to a global minima , which has nearly the same loss value at the neighboring points . 3.2 PROGRESSIVE SPINAL NETWORKS . In the human biological network , the spine performs the preprocessing of the input , which then goes to the brain for the final output ( D ’ Mello & Dickenson , 2008 ) . By taking inspiration from the human spinal cord , Kabir et al . ( 2020 ) proposed spinal networks . As the human brain receives information from various sensory neurons , and these signals are processed by the human spine before reaching the brain . Progressive SpinalNet consists of a processing unit and concatenating unit . The input to the Progressive SpinalNet Fully Connected ( FC ) layer is the CNN features . The processing unit can be a single hidden layer or multiple hidden layers . Each layer receives some portion from the input . The output of the processing unit is concatenated , and the following processing unit receives the concatenated output as an input . The gradients are easily propagated back to the first FC layer from the last FC layer due to connections between the layers . This helps in dealing with the vanishing gradient problem . The size of each layer is progressively increased , and the output size is the same for all the FC layers . The Progressive SpinalNet can be deeper as it does not suffer from a vanishing gradient . Contradicting the traditional way of feedforward neural networks , they used forward and introduced sideways and zig-zag interactions , which leads to better network predictions . 3.3 GENERATIVE ADVERSARIAL NETWORKS . The task of Generative Adversarial Networks ( GANs ) is to learn the distribution of the training data and generate new samples . GAN learns the distribution of the input data ρdata and generates synthetic images which have nearly the same distribution as the input image . The GAN architecture consists of basically two deep neural network architecture : ( a ) : the generative network G and ( b ) : the discriminator network D. The generator takes a noise vector z as an input from a known distribution ρz , generally a uniform distribution and outputs G ( z ) which maps to the space of distribution ρg . The generator G tries to produces more realistic images as the training progresses , and the discriminator D improves its ability to discriminate between synthetic and authentic images . Finally , the generator aims to generate images that have the same distribution as the input images , i.e. , ρg = ρdata . This basically leads to min-max optimization problem where the discriminator network D is trained to maximize log ( D ( x ) ) , where D ( x ) is the output of the discriminator and the generator network is trained as to minimize log ( 1-D ( G ( z ) ) . So , the objective function for GANs is a min-max objective function : min G max D J ( D , G ) & = Ex∼px [ log ( D ( x ) ) ] + Ez , ∼pz [ log ( 1−D ( G ( Z ) ) ] Furthermore , the computation cost to train Vanilla GANs is exorbitant , and it takes a large amount of training data to learn the distribution of training data . This limits GANs and its variants to generate high fidelity images when the training data is less , and we have fewer computational resources . To train GAN with limited data and low computational resources , Liu et al . ( 2021 ) proposed lightweight GAN , which can generate high fidelity images even when the training data is significantly less ( 50-100 images ) .
This paper studies mistake-driven image classification, with the idea of applying data augumentation to classes with lower classification accuracy. Emphasizing the training on classes with low accuracy boosts the overall performance of trained CNN classifier. The proposed method is quite straightforward, and the paper is clearly written. It first evaluates the classification accuracy of each class on the validation set, then selects the categories with lowest accracy for data augumentation with GAN, and add the augumented class into the training set for fine-tuning. Experiments are tested on 5 dataset, which demonstrate improved performance.
SP:b487ec775a1bd8d0332e748517ea328444adbb48
Mistake-driven Image Classification with FastGAN and SpinalNet
1 INTRODUCTION . Supervised training of deep learning models , like the image classification models we consider in this paper , is the most efficient training approach , but also the most data-intensive . To mitigate this issue , alternative techniques are commonly applied , e.g. , transfer learning from a pretrained model to a new domain ( Ridnik et al. , 2021 ) or data augmentation to expand the available dataset synthetically ( Shorten & Khoshgoftaar , 2019 ) . One particular data augmentation technique is to use Generative Adversarial Networks ( GANs ) ( Goodfellow et al. , 2020 ) that learn to produce new data that is similar to the distribution of the GAN ’ s training data . GAN-based augmentation has been shown to be successful in aiding the training process ( Bowles et al. , 2018 ; Wang et al. , 2018c ; Tanaka & Aranha , 2019 ) and has found practical adoption in other research domains ( Frid-Adar et al. , 2018 ; Sasmal et al. , 2020 ) . One challenge and limitation of GAN-based augmentation is either the high computational cost to augment each class of the dataset individually or the selection of the classes to augment that best support the model training . In this paper , we focus on a mistake-driven training procedure ( see Figure 1 ) that utilizes GAN-based data augmentation only after the initial model training , albeit transfer learning or training from scratch , and augments only those classes with the lowest accuracy , where the model shows performance weaknesses . This keeps the effort for class-wise GAN training at a lower level than a full-sized data augmentation procedure but still contributes to the model improvement by focusing on the most significant deficits accuracy-wise . The mistake-driven training method is fully compatible with any other training regime as it does not interfere directly with the model training or finetuning step except by querying the model during evaluation and enhancing the dataset for finetuning . Due to this explicit focus on model weaknesses as well as the careful selection of the components in the mistake-driven training pipeline , our method is computationally efficient and shows compet- itive performance on a number of benchmarks . First , we employ the progressive SpinalNet neural network architecture ( Kabir et al. , 2020 ; Chopra , 2021 ) as the image classification model , build on a backbone model , e.g . a pretrained Wide-ResNet ( Zagoruyko & Komodakis , 2016 ) or EfficientNetB7 ( Tan & Le , 2019 ) as used in the experiments . Afterward , the class-wise accuracy on the validation set is computed , and the worst-performing classes are identified . For each of these classes , a sampleefficient GAN is trained , here we choose the light-weight FastGAN method ( Liu et al. , 2021 ) , and use it to generate new samples . Finally , the already trained model is finetuned under consideration of the newly generated samples to improve and balance the model performance among the previously worst-performing classes . We perform an extensive experimental evaluation to test the influence of each component in the mistake-driven training pipeline and our component selection of backbone models , activation functions , and model optimizers . The method is evaluated on five widely used image classification datasets and exceeds the previous state-of-the-art accuracy on four of them . The contribution of our paper is threefold : 1 . During training , our method focuses on those classes with the lowest accuracy after the initial training phase . Only these classes are augmented to boost the accuracy , which leads to better performance . 2 . Due to the light-weight GAN method , the GAN-based augmentation is viable and effective for mistake-driven training even for datasets with only a few example images per class , while simultaneously requiring less computation than other , more complex GAN methods . 3 . Our extensive experiments , including ablation studies , show competitive or better accuracy than the previous state-of-the-art on five datasets . 2 RELATED WORK . This section relates the presented work to the recent literature on data augmentation using GANs . There are two types of image augmentation methods that help in increasing the accuracy of the model and making the model more robust . The first one is a geometrical transformation-based augmentation , and the other one is generative adversarial-based augmentation . Geometrical Transformation & Data Augmentation In the past decade , various data augmentation techniques have been used to improve classification prediction accuracy . The most common ones are those based on geometrical transformations ( Shorten & Khoshgoftaar , 2019 ) e.g. , cropping , flipping , rotation , color space , noise injection , and translation . These geometrical transformations increase the training dataset and improve the test accuracy ( Perez & Wang , 2017 ) . These data augmentation techniques are a best practice for training deep neural networks , especially in computer vision tasks where a vast number of augmentations are available and can be combined . Cubuk et al . ( 2019 ) further introduces a method to perform this combination , called AutoAugment automatically , that learns dataset-specific augmentation strategies to increase the final model accuracy . Synthetic Data Generation Using Generative Models Generative models , GANs in this context , have shown growing capability in generating very realistic data . These generated synthetic images can be utilized for data augmentation in data classification . Researchers have been attempting to enhance high-resolution images with GANs but with little success due to the enormous amount of data required to train GANs . Data augmentation with GANs has recently received increasing attention from the research community . Some research works have attempted to supplement images using GANs for data classification ( Tanaka & Aranha , 2019 ) . However , with limited data , utilizing GANs to augment data becomes a strenuous process . Rashid et al . ( 2019 ) , proposed to augment the ISIC skin lesion classification dataset using GANs . The results produced by data augmentation using GANs outperform ResNet and densenet models . In another line of work , Sasmal et al . ( 2020 ) used DCGAN for generating synthetic colonoscopic images . The generated images help in data augmentation to perform better polyp classification . Furthermore , Bejiga & Melgani ( 2018 ) suggests a GAN-based domain adaptation technique for aerial image classification . They use GANs for unsupervised domain adaptation of aerial remote sensing images . In the same field of work , Saha et al . ( 2021 ) developed TilGAN for the classification of images showing til , i.e. , tumor-infiltrating lymphocytes and non-til images . In addition to the previous research works , Zeng et al . ( 2020 ) propose to use GANs for augmenting data to detect disease severity . In another line of work , GANs were used for data augmentation in the field of multi-domain learning ( Yamaguchi et al. , 2020 ) . These multi-domain GANs learn both the outer and target datasets simultaneously and generate new samples for the target tasks . A detailed survey on the use of GANs for data augmentation is presented by Shorten & Khoshgoftaar ( 2019 ) . In this paper , our focus is to augment high-resolution images with a limited dataset which can further be used for finetuning the model . However , if the amount of the training data is not a constraining factor , IDA GAN ( Yang & Zhou , 2021 ) and Polarity GAN ( Deepshikha & Naman , 2020 ) can be utilized for data augmentation , too . Data Augmentation with Limited Data GANs generally require massive datasets for training ; limited data makes learning the underlying model arduous . Moreover , training GANs with limited data can easily lead to overfitting ( Bowles et al. , 2018 ) , which makes the training more difficult . Transfer learning can be used to avoid the problem of overfitting of GANs , which also results in better performance ( Bengio , 2012 ) . Apart from the traditional way of augmenting data using geometric transformations , some GANs use observations that have been forged ( Wang et al. , 2018b ) for generating new samples . Even though generating new images with limited data using GANs remains a challenging task , but at least the risk of overfitting can be reduced by using a pretrained model on a huge dataset and using that pretrained model for training GANs can produce some good quality images Wang et al . ( 2018b ) . However , using this technique sometimes leads to mode collapse , which is further fixed by Liu et al . ( 2021 ) using skip connections while training . 3 BACKGROUND . 3.1 SHARPNESS-AWARE MINIMIZATION . In deep learning models , we need to optimize the loss function such that the DL model can converge to global minima . To reach the minima , many optimization algorithms such as stochastic gradient descent , Adam ( Kingma & Ba , 2014 ) , and RMSProp are being used as a design choice for optimizing the loss function . Zhang et al . ( 2016 ) show that DL models could memorize the training data and easily overfit to it , due to which the trained model lack generalization ability . However , when a DL model converges to an abrupt global minimum , the value of the loss function remains high in the neighborhood of the global minimum , causing the DL model to lose its generalization ability . For the better generalization of DL models , Sharpness-Aware Minimization ( SAM ) was proposed ( Foret et al. , 2020 ) , where the optimization goal is reformulated such that it considers the output of loss functions from not only the minimum but also at its neighboring points . In that way , SAM minimizes both loss value and loss sharpness . Finally , the minimization of loss value and loss sharpness is done using gradient descent by learning those parameters that converge to a global minima , which has nearly the same loss value at the neighboring points . 3.2 PROGRESSIVE SPINAL NETWORKS . In the human biological network , the spine performs the preprocessing of the input , which then goes to the brain for the final output ( D ’ Mello & Dickenson , 2008 ) . By taking inspiration from the human spinal cord , Kabir et al . ( 2020 ) proposed spinal networks . As the human brain receives information from various sensory neurons , and these signals are processed by the human spine before reaching the brain . Progressive SpinalNet consists of a processing unit and concatenating unit . The input to the Progressive SpinalNet Fully Connected ( FC ) layer is the CNN features . The processing unit can be a single hidden layer or multiple hidden layers . Each layer receives some portion from the input . The output of the processing unit is concatenated , and the following processing unit receives the concatenated output as an input . The gradients are easily propagated back to the first FC layer from the last FC layer due to connections between the layers . This helps in dealing with the vanishing gradient problem . The size of each layer is progressively increased , and the output size is the same for all the FC layers . The Progressive SpinalNet can be deeper as it does not suffer from a vanishing gradient . Contradicting the traditional way of feedforward neural networks , they used forward and introduced sideways and zig-zag interactions , which leads to better network predictions . 3.3 GENERATIVE ADVERSARIAL NETWORKS . The task of Generative Adversarial Networks ( GANs ) is to learn the distribution of the training data and generate new samples . GAN learns the distribution of the input data ρdata and generates synthetic images which have nearly the same distribution as the input image . The GAN architecture consists of basically two deep neural network architecture : ( a ) : the generative network G and ( b ) : the discriminator network D. The generator takes a noise vector z as an input from a known distribution ρz , generally a uniform distribution and outputs G ( z ) which maps to the space of distribution ρg . The generator G tries to produces more realistic images as the training progresses , and the discriminator D improves its ability to discriminate between synthetic and authentic images . Finally , the generator aims to generate images that have the same distribution as the input images , i.e. , ρg = ρdata . This basically leads to min-max optimization problem where the discriminator network D is trained to maximize log ( D ( x ) ) , where D ( x ) is the output of the discriminator and the generator network is trained as to minimize log ( 1-D ( G ( z ) ) . So , the objective function for GANs is a min-max objective function : min G max D J ( D , G ) & = Ex∼px [ log ( D ( x ) ) ] + Ez , ∼pz [ log ( 1−D ( G ( Z ) ) ] Furthermore , the computation cost to train Vanilla GANs is exorbitant , and it takes a large amount of training data to learn the distribution of training data . This limits GANs and its variants to generate high fidelity images when the training data is less , and we have fewer computational resources . To train GAN with limited data and low computational resources , Liu et al . ( 2021 ) proposed lightweight GAN , which can generate high fidelity images even when the training data is significantly less ( 50-100 images ) .
The paper presents a method that uses a pertained model for classification in order to choose classes with low accuracy, then performs a GAN-based augmentation to those classes, and retrains the classification model with the augmented dataset. The claim is that this procedure improves the classification performance. There are several known components in the proposed architecture, and recent works such as SpinalNet, and FastGAN are utilized as a classifier and as a lightweight GAN synthesizer, respectively.
SP:b487ec775a1bd8d0332e748517ea328444adbb48
GRODIN: Improved Large-Scale Out-of-Domain detection via Back-propagation
1 INTRODUCTION . Many problems are solved with machine learning techniques today . Prominent examples of supervised learning power could be found in many domains : image classification , speech recognition , medical surveys , self-driving cars , text translation ( 6 ; 19 ; 28 ; 24 ; 1 ) , etc .. In some applications , it is very important to be confident on the prediction of a trained model : self-driving cars , medicine , stock market trading , etc .. Usually , the prediction mechanism remains uncovered and it requires additional efforts to ensure the model quality when working with real-world data . We search for a new way to automatically understand that prediction on this particular sample is not reliable with data uncertainty estimation or knowledge uncertainty estimation ( 2 ) . One of the most important tasks in this field is out-of-domain detection . It allows us to separate the data suitable for inference from the examples that are not intended for model usage . Due to the importance of the task out-of-domain methods evolved from ‘ naive ‘ approaches to sophisticated algorithms . These algorithms either analyse the prediction model results to understand if we could rely on them , or build a new dedicated model for OOD . The first type of the methods we call “ lightweight ” , as they usually could be used for on-the-fly verification of prediction . The other class could deliver better detection quality , but requires substantive computational resources and separate training . We refer to this one as “ heavy ” . The “ lightweight ” models are usually built on top of certain prediction tasks , such as classification , and are based on the properties of loss functions used in the training process . Softmax probability is an example of such property , it is directly used for many practical implementations ( 10 ; 7 ) . The prediction quality of the softmax probability thresholding could be extended with input preprocessing and probability calibration as shown in ODIN ( 20 ) algorithm . This method provides the state-of-theart results on most available benchmarks ( tiny-ImageNet ( 26 ) , CIFAR-10 ( 16 ) , CIFAR-100 ( 16 ) , MNIST ( 3 ) , SVHN ( 25 ) , etc. ) . However , there is room for improvement . There is a bunch of more challenging problems constructed on top of ImageNet ( 26 ) image classification task : ImageNet-A ( 12 ) , ImageNet-O ( 12 ) , ImageNet-R ( 8 ) , ImageNet-C ( 9 ) . The alternative “ heavy ” methods were developed : outlier exposure ( 11 ) ; mahalanobis distance-based confidence score ( 18 ) ; class of strong and theoretically justified out-of-distribution detectors called ensembles ( 2 ; 23 ; 22 ) . All these methods usually provide better results , but are hard to use in practice : some of them require changing the training loss function and therefore neural network retraining ( 11 ) ; or require solving auxiliary logistic regression problem and heavy computation of mahalanobis distance in ( 18 ) ; sometimes researcher need additional training and inference of several neural networks simultaneously for ensemble methods ( 22 ) . Recent studies in deep learning suggest that the gradient of the loss function taken for a particular example carries a lot of information other than model prediction . Influence functions ( 14 ) use information about first and second derivatives with respect to network weights to estimate what is the impact of a single precedent on test set quality . Neural tangent kernel ( 13 ) gives us another point of view on the training process and generalization from the position of gradient analysis . To the best of our knowledge , there is only one work in out-of-distribution detection domain that utilize the gradient of the model with respect to weights ( 17 ) . This approach uses information from the gradient of different layers as a building blocks for their separate DNN model . The approach requires a lot of out-of-distribution data to train the model and could not be assigned to “ lightweight ” models . In this paper , we focus on developing a new simple and computationally lightweight approach for detecting out-of-distribution examples based on gradient analysis . We investigate the derivative of cross-entropy loss function and decompose it into two parts , showing the difference between them . The proposed method is being tested on several challenging benchmarks and compared with various methods . Also , we analyse the impact of highly popular input preprocessing and give intuition why this technique helps OOD detectors . 2 METHOD . Model mistakes come from different sources : irreducible errors , low model capacity , wrong modeling assumptions , sample distribution shift , and so on . For each type of errors , we define a formal problem setup and develop methods to deal with it . Those setups are not mutually exclusive and their methods could complement each other . This paper focuses on a particular problem : estimation of the probability that a particular sample comes from a different population . To formally define this problem we use notation from Tab . 1 . Given this notation , there exist a statistical population Γ . Elements of this population are pairs ( x , y ) , where x ∈ Rn is a sample , y ∈ Y is a label . We assume that there exists a deterministic correspondence between population precedent and corresponding label . Statistically representative training set X is used to train prediction model by minimization of empirical loss function L. With enough data and mild assumptions on loss function , the resulting model with parameters θ̂ should replicate correspondence between x and y . As a result , our model should give a correct prediction to any x from the general population . Thus , given assumptions , there is a natural way to define xi as the out-of-domain sample : xi is out-of-domain↔ ∀ ( x , y ) ∈ Γ : xi 6= x ( 1 ) Our task is to estimate , if the particular sample xi is out-of-domain , given only the estimated model parameters θ̂ . The core idea of our method is quite simple . We train prediction model by minimisation of some additive loss function L = 1m ∑ ( x , y ) ∈X ` ( θ , x , y ) . When minimisation is performed by stochastic gradient descent or similar methods , the expectation of the model parameters gradient norm reduces on training set elements with the number of optimization steps . The expectation aims to zero for flexible enough decision functions . In tangent kernel space ( NTK for neural models ) the optimization process looks like seeking for optimization parameter θ that pulls representation of training set points ∇ ` ( θ , x , y ) to zero vector . We can use this property and determine the model behavior for an example by the distance of its representation in the trained tangent kernel space ( defined by θ̂ ) from zero . Using this information we can predict many practical properties of the particular prediction : expected accuracy , model uncertainty , out-of-domain points detection , etc .. In this paper , we focus on the latter case and build a method for out-of-domain detection on top of this principle . The modern definition of the domain depends on the application and we will show this difference in the experimental section . From a theoretical perspective , we equate domain and the population . This way we allow a researcher to define their notion of the domain with the selection of sampling technique . The ideally trained model brings all points of the population to a stationary point in model parameters space . In this paper we make an assumption that kernel of this transformation is equal to the population and the observed transformation differs from ideal one with Gaussian error : ∇θ ` ( θ , x , y ) |θ̂ = ∇θ ` ( θ , x , y ) |θ∗ + δ , δ ∼ N ( 0 , E ) . Now we can define a log probability of population Γ membership : g ( x , θ̂ ) = logP ( x|Γ ) ∼ ∥∥∇θ ` ( θ , x , y ) |θ̂∥∥22 The main problem for practical application of the method is to define a loss function for examples , that come to the model during its exploitation and have no label . In this case , it is natural to use the class assigned by the model ĉ as a label and check the uncertainty of the model in the decision . We focus , without loss of generality , on image classification problem over k classes with neural models . Negative log likelihood over softmax probability modeling is one of the most commonly used loss functions for this problem : ` ( θ , x , y ) = − log e hy ( x , θ ) ∑k c=1 e hc ( x , θ ) where hc are outputs of the neural model for each class c. Using this model and the label assumption we can formulate the result log probability of population membership g ( x , θ̂ ) for arbitrary point x : g ( x , θ̂ ) = ∥∥∥∥∥∇θ log ehĉ ( x , θ ) ∑k c=1 e hc ( x , θ ) ∣∣∣∣∣ θ̂ ∥∥∥∥∥ 2 2 Now we can choose significance level α and filter out points that belong to the population with probability less than this significance level : P ( x|Γ ) < α . In practice we don ’ t use significance level directly , but define a threshold δ ( α ) for g ( x , θ̂ ) . If we have information on out-of-domain examples we choose the threshold that delivers the selected significance level on cross-validation . We use this setup as a baseline variant of our method in the experimental section . In the literature there are at least two ways how to enhance the result of the baseline model : temperature scaling ( 5 ) , and input perturbation ( 20 ) . In our framework these enhancements are easily explained and compliment the baseline model . To show this we need to unfold components of the gradient vector : ∇θ ` ( x , θ̂ ) = −∇θ log maxc′ e h c′ ( x , θ ) ∑k c=1 e hc ( x , θ ) ∣∣∣ θ̂ = S ( x , θ̂ ) G ( x , θ̂ ) , where S ( x , θ̂ ) = 1 1+ ∑ c 6=ĉ e ( hc ( x , θ̂ ) −hĉ ( x , θ̂ ) ) G ( x , θ̂ ) = − ∑ c 6=ĉ e ( hc ( x , θ̂ ) −hĉ ( x , θ̂ ) ) ∂ ( hĉ ( x , θ ) −hc ( x , θ ) ) ∂θ ∣∣∣ θ̂ In the last expression there are two multiplicative parts ( S and G ) . S is a scalar part , that reflects the probability of the predicted class . The G is cumulative gradient vector for all classes output nodes of the network weighted by their preference over predicted class ehc ( x , θ̂ ) /ehĉ ( x , θ̂ ) . The first part is equal to the softmax score from ODIN up to the notations used . The second part is the information from NTK space . As one can see both S and G heavily depend on class weights hc , and it is important to calibrate these values for the task the model is used for . One of the most popular ways of model calibration is temperature parameter injection ( 5 ) . In this method we scale class weights hc with the temperature factor 1T . The optimal temperature is then optimized using some calibration quality metric like Expected Calibration Error ( 5 ) for the target dataset . The solution of this optimization problem depends on the data provided , see the experimental section for details . The other way of out-of-domain detection model improvement is altering the source signal , e.g . the image in case of the image classification task . In our framework we assume that during training process the optimization pulls domain space to a stationary point in model parameters space . As only training examples are observed , we pull the entire domain using the train set as mount points . In this process the rest of the domain slacks and this cause well-known difference in gradients between training set points and validation points . To reduce this slack we can move point towards training points . We follow the alteration procedure introduced in the ODIN paper : xp = xo − ε sign ( −∇x log maxc′ e hc′ ( x , θ ) /T∑k c=1 e hc ( x , θ ) /T ∣∣∣∣∣ xo ) During this procedure , source image is altered to reduce the gradient and compensate the slack between training points and the rest of the domain . To sum it up , the proposed method is a composition of ε-input perturbation , temperature calibration by scaling outputs by 1/T factor and decomposition of ∇θ ` ( x , θ̂ ) into two multiplicative parts : S ( x , θ̂ ) and G ( x , θ̂ ) . These parts can be used as a single estimator : g ( x , θ̂ ) = ‖S ( x , θ̂ ) G ( x , θ̂ ) ‖22 , or alone : g ( x , θ̂ ) = ‖G ( x , θ̂ ) ‖22 , g ( x , θ̂ ) = S ( x , θ̂ ) . The last variant gives us exactly ODIN .
This paper proposes an anomaly detection score based on the derivative of the log-likelihood: $ \mid\mid \nabla_{\theta} \log p_{\theta}(\hat{c} | \mathbf{x}) \mid \mid_{2}^{2} $ where $\hat{c}$ is the predicted class (as we want the method to be applicable to test points). The intuition is that if $\mathbf{x}$ is from training set, then the model should already be fairly well fit to the point, meaning that the derivative should be near zero. This metric along with some variants derived from sub-terms are compared on image data sets against baselines such as ODIN, maximum softmax probability, maximum logit, and ensembles.
SP:11a820faae032646dbab551a349655998c9a0286
GRODIN: Improved Large-Scale Out-of-Domain detection via Back-propagation
1 INTRODUCTION . Many problems are solved with machine learning techniques today . Prominent examples of supervised learning power could be found in many domains : image classification , speech recognition , medical surveys , self-driving cars , text translation ( 6 ; 19 ; 28 ; 24 ; 1 ) , etc .. In some applications , it is very important to be confident on the prediction of a trained model : self-driving cars , medicine , stock market trading , etc .. Usually , the prediction mechanism remains uncovered and it requires additional efforts to ensure the model quality when working with real-world data . We search for a new way to automatically understand that prediction on this particular sample is not reliable with data uncertainty estimation or knowledge uncertainty estimation ( 2 ) . One of the most important tasks in this field is out-of-domain detection . It allows us to separate the data suitable for inference from the examples that are not intended for model usage . Due to the importance of the task out-of-domain methods evolved from ‘ naive ‘ approaches to sophisticated algorithms . These algorithms either analyse the prediction model results to understand if we could rely on them , or build a new dedicated model for OOD . The first type of the methods we call “ lightweight ” , as they usually could be used for on-the-fly verification of prediction . The other class could deliver better detection quality , but requires substantive computational resources and separate training . We refer to this one as “ heavy ” . The “ lightweight ” models are usually built on top of certain prediction tasks , such as classification , and are based on the properties of loss functions used in the training process . Softmax probability is an example of such property , it is directly used for many practical implementations ( 10 ; 7 ) . The prediction quality of the softmax probability thresholding could be extended with input preprocessing and probability calibration as shown in ODIN ( 20 ) algorithm . This method provides the state-of-theart results on most available benchmarks ( tiny-ImageNet ( 26 ) , CIFAR-10 ( 16 ) , CIFAR-100 ( 16 ) , MNIST ( 3 ) , SVHN ( 25 ) , etc. ) . However , there is room for improvement . There is a bunch of more challenging problems constructed on top of ImageNet ( 26 ) image classification task : ImageNet-A ( 12 ) , ImageNet-O ( 12 ) , ImageNet-R ( 8 ) , ImageNet-C ( 9 ) . The alternative “ heavy ” methods were developed : outlier exposure ( 11 ) ; mahalanobis distance-based confidence score ( 18 ) ; class of strong and theoretically justified out-of-distribution detectors called ensembles ( 2 ; 23 ; 22 ) . All these methods usually provide better results , but are hard to use in practice : some of them require changing the training loss function and therefore neural network retraining ( 11 ) ; or require solving auxiliary logistic regression problem and heavy computation of mahalanobis distance in ( 18 ) ; sometimes researcher need additional training and inference of several neural networks simultaneously for ensemble methods ( 22 ) . Recent studies in deep learning suggest that the gradient of the loss function taken for a particular example carries a lot of information other than model prediction . Influence functions ( 14 ) use information about first and second derivatives with respect to network weights to estimate what is the impact of a single precedent on test set quality . Neural tangent kernel ( 13 ) gives us another point of view on the training process and generalization from the position of gradient analysis . To the best of our knowledge , there is only one work in out-of-distribution detection domain that utilize the gradient of the model with respect to weights ( 17 ) . This approach uses information from the gradient of different layers as a building blocks for their separate DNN model . The approach requires a lot of out-of-distribution data to train the model and could not be assigned to “ lightweight ” models . In this paper , we focus on developing a new simple and computationally lightweight approach for detecting out-of-distribution examples based on gradient analysis . We investigate the derivative of cross-entropy loss function and decompose it into two parts , showing the difference between them . The proposed method is being tested on several challenging benchmarks and compared with various methods . Also , we analyse the impact of highly popular input preprocessing and give intuition why this technique helps OOD detectors . 2 METHOD . Model mistakes come from different sources : irreducible errors , low model capacity , wrong modeling assumptions , sample distribution shift , and so on . For each type of errors , we define a formal problem setup and develop methods to deal with it . Those setups are not mutually exclusive and their methods could complement each other . This paper focuses on a particular problem : estimation of the probability that a particular sample comes from a different population . To formally define this problem we use notation from Tab . 1 . Given this notation , there exist a statistical population Γ . Elements of this population are pairs ( x , y ) , where x ∈ Rn is a sample , y ∈ Y is a label . We assume that there exists a deterministic correspondence between population precedent and corresponding label . Statistically representative training set X is used to train prediction model by minimization of empirical loss function L. With enough data and mild assumptions on loss function , the resulting model with parameters θ̂ should replicate correspondence between x and y . As a result , our model should give a correct prediction to any x from the general population . Thus , given assumptions , there is a natural way to define xi as the out-of-domain sample : xi is out-of-domain↔ ∀ ( x , y ) ∈ Γ : xi 6= x ( 1 ) Our task is to estimate , if the particular sample xi is out-of-domain , given only the estimated model parameters θ̂ . The core idea of our method is quite simple . We train prediction model by minimisation of some additive loss function L = 1m ∑ ( x , y ) ∈X ` ( θ , x , y ) . When minimisation is performed by stochastic gradient descent or similar methods , the expectation of the model parameters gradient norm reduces on training set elements with the number of optimization steps . The expectation aims to zero for flexible enough decision functions . In tangent kernel space ( NTK for neural models ) the optimization process looks like seeking for optimization parameter θ that pulls representation of training set points ∇ ` ( θ , x , y ) to zero vector . We can use this property and determine the model behavior for an example by the distance of its representation in the trained tangent kernel space ( defined by θ̂ ) from zero . Using this information we can predict many practical properties of the particular prediction : expected accuracy , model uncertainty , out-of-domain points detection , etc .. In this paper , we focus on the latter case and build a method for out-of-domain detection on top of this principle . The modern definition of the domain depends on the application and we will show this difference in the experimental section . From a theoretical perspective , we equate domain and the population . This way we allow a researcher to define their notion of the domain with the selection of sampling technique . The ideally trained model brings all points of the population to a stationary point in model parameters space . In this paper we make an assumption that kernel of this transformation is equal to the population and the observed transformation differs from ideal one with Gaussian error : ∇θ ` ( θ , x , y ) |θ̂ = ∇θ ` ( θ , x , y ) |θ∗ + δ , δ ∼ N ( 0 , E ) . Now we can define a log probability of population Γ membership : g ( x , θ̂ ) = logP ( x|Γ ) ∼ ∥∥∇θ ` ( θ , x , y ) |θ̂∥∥22 The main problem for practical application of the method is to define a loss function for examples , that come to the model during its exploitation and have no label . In this case , it is natural to use the class assigned by the model ĉ as a label and check the uncertainty of the model in the decision . We focus , without loss of generality , on image classification problem over k classes with neural models . Negative log likelihood over softmax probability modeling is one of the most commonly used loss functions for this problem : ` ( θ , x , y ) = − log e hy ( x , θ ) ∑k c=1 e hc ( x , θ ) where hc are outputs of the neural model for each class c. Using this model and the label assumption we can formulate the result log probability of population membership g ( x , θ̂ ) for arbitrary point x : g ( x , θ̂ ) = ∥∥∥∥∥∇θ log ehĉ ( x , θ ) ∑k c=1 e hc ( x , θ ) ∣∣∣∣∣ θ̂ ∥∥∥∥∥ 2 2 Now we can choose significance level α and filter out points that belong to the population with probability less than this significance level : P ( x|Γ ) < α . In practice we don ’ t use significance level directly , but define a threshold δ ( α ) for g ( x , θ̂ ) . If we have information on out-of-domain examples we choose the threshold that delivers the selected significance level on cross-validation . We use this setup as a baseline variant of our method in the experimental section . In the literature there are at least two ways how to enhance the result of the baseline model : temperature scaling ( 5 ) , and input perturbation ( 20 ) . In our framework these enhancements are easily explained and compliment the baseline model . To show this we need to unfold components of the gradient vector : ∇θ ` ( x , θ̂ ) = −∇θ log maxc′ e h c′ ( x , θ ) ∑k c=1 e hc ( x , θ ) ∣∣∣ θ̂ = S ( x , θ̂ ) G ( x , θ̂ ) , where S ( x , θ̂ ) = 1 1+ ∑ c 6=ĉ e ( hc ( x , θ̂ ) −hĉ ( x , θ̂ ) ) G ( x , θ̂ ) = − ∑ c 6=ĉ e ( hc ( x , θ̂ ) −hĉ ( x , θ̂ ) ) ∂ ( hĉ ( x , θ ) −hc ( x , θ ) ) ∂θ ∣∣∣ θ̂ In the last expression there are two multiplicative parts ( S and G ) . S is a scalar part , that reflects the probability of the predicted class . The G is cumulative gradient vector for all classes output nodes of the network weighted by their preference over predicted class ehc ( x , θ̂ ) /ehĉ ( x , θ̂ ) . The first part is equal to the softmax score from ODIN up to the notations used . The second part is the information from NTK space . As one can see both S and G heavily depend on class weights hc , and it is important to calibrate these values for the task the model is used for . One of the most popular ways of model calibration is temperature parameter injection ( 5 ) . In this method we scale class weights hc with the temperature factor 1T . The optimal temperature is then optimized using some calibration quality metric like Expected Calibration Error ( 5 ) for the target dataset . The solution of this optimization problem depends on the data provided , see the experimental section for details . The other way of out-of-domain detection model improvement is altering the source signal , e.g . the image in case of the image classification task . In our framework we assume that during training process the optimization pulls domain space to a stationary point in model parameters space . As only training examples are observed , we pull the entire domain using the train set as mount points . In this process the rest of the domain slacks and this cause well-known difference in gradients between training set points and validation points . To reduce this slack we can move point towards training points . We follow the alteration procedure introduced in the ODIN paper : xp = xo − ε sign ( −∇x log maxc′ e hc′ ( x , θ ) /T∑k c=1 e hc ( x , θ ) /T ∣∣∣∣∣ xo ) During this procedure , source image is altered to reduce the gradient and compensate the slack between training points and the rest of the domain . To sum it up , the proposed method is a composition of ε-input perturbation , temperature calibration by scaling outputs by 1/T factor and decomposition of ∇θ ` ( x , θ̂ ) into two multiplicative parts : S ( x , θ̂ ) and G ( x , θ̂ ) . These parts can be used as a single estimator : g ( x , θ̂ ) = ‖S ( x , θ̂ ) G ( x , θ̂ ) ‖22 , or alone : g ( x , θ̂ ) = ‖G ( x , θ̂ ) ‖22 , g ( x , θ̂ ) = S ( x , θ̂ ) . The last variant gives us exactly ODIN .
This paper proposes to use the norm of gradients as the score to detect OOD data. The experiments use CIFAR-10 and ImageNet as the distribution datasets and use the unseen classes or perturbed images for the OOD data. The result shows the norm of gradients improves the OOD detection.
SP:11a820faae032646dbab551a349655998c9a0286
GRODIN: Improved Large-Scale Out-of-Domain detection via Back-propagation
1 INTRODUCTION . Many problems are solved with machine learning techniques today . Prominent examples of supervised learning power could be found in many domains : image classification , speech recognition , medical surveys , self-driving cars , text translation ( 6 ; 19 ; 28 ; 24 ; 1 ) , etc .. In some applications , it is very important to be confident on the prediction of a trained model : self-driving cars , medicine , stock market trading , etc .. Usually , the prediction mechanism remains uncovered and it requires additional efforts to ensure the model quality when working with real-world data . We search for a new way to automatically understand that prediction on this particular sample is not reliable with data uncertainty estimation or knowledge uncertainty estimation ( 2 ) . One of the most important tasks in this field is out-of-domain detection . It allows us to separate the data suitable for inference from the examples that are not intended for model usage . Due to the importance of the task out-of-domain methods evolved from ‘ naive ‘ approaches to sophisticated algorithms . These algorithms either analyse the prediction model results to understand if we could rely on them , or build a new dedicated model for OOD . The first type of the methods we call “ lightweight ” , as they usually could be used for on-the-fly verification of prediction . The other class could deliver better detection quality , but requires substantive computational resources and separate training . We refer to this one as “ heavy ” . The “ lightweight ” models are usually built on top of certain prediction tasks , such as classification , and are based on the properties of loss functions used in the training process . Softmax probability is an example of such property , it is directly used for many practical implementations ( 10 ; 7 ) . The prediction quality of the softmax probability thresholding could be extended with input preprocessing and probability calibration as shown in ODIN ( 20 ) algorithm . This method provides the state-of-theart results on most available benchmarks ( tiny-ImageNet ( 26 ) , CIFAR-10 ( 16 ) , CIFAR-100 ( 16 ) , MNIST ( 3 ) , SVHN ( 25 ) , etc. ) . However , there is room for improvement . There is a bunch of more challenging problems constructed on top of ImageNet ( 26 ) image classification task : ImageNet-A ( 12 ) , ImageNet-O ( 12 ) , ImageNet-R ( 8 ) , ImageNet-C ( 9 ) . The alternative “ heavy ” methods were developed : outlier exposure ( 11 ) ; mahalanobis distance-based confidence score ( 18 ) ; class of strong and theoretically justified out-of-distribution detectors called ensembles ( 2 ; 23 ; 22 ) . All these methods usually provide better results , but are hard to use in practice : some of them require changing the training loss function and therefore neural network retraining ( 11 ) ; or require solving auxiliary logistic regression problem and heavy computation of mahalanobis distance in ( 18 ) ; sometimes researcher need additional training and inference of several neural networks simultaneously for ensemble methods ( 22 ) . Recent studies in deep learning suggest that the gradient of the loss function taken for a particular example carries a lot of information other than model prediction . Influence functions ( 14 ) use information about first and second derivatives with respect to network weights to estimate what is the impact of a single precedent on test set quality . Neural tangent kernel ( 13 ) gives us another point of view on the training process and generalization from the position of gradient analysis . To the best of our knowledge , there is only one work in out-of-distribution detection domain that utilize the gradient of the model with respect to weights ( 17 ) . This approach uses information from the gradient of different layers as a building blocks for their separate DNN model . The approach requires a lot of out-of-distribution data to train the model and could not be assigned to “ lightweight ” models . In this paper , we focus on developing a new simple and computationally lightweight approach for detecting out-of-distribution examples based on gradient analysis . We investigate the derivative of cross-entropy loss function and decompose it into two parts , showing the difference between them . The proposed method is being tested on several challenging benchmarks and compared with various methods . Also , we analyse the impact of highly popular input preprocessing and give intuition why this technique helps OOD detectors . 2 METHOD . Model mistakes come from different sources : irreducible errors , low model capacity , wrong modeling assumptions , sample distribution shift , and so on . For each type of errors , we define a formal problem setup and develop methods to deal with it . Those setups are not mutually exclusive and their methods could complement each other . This paper focuses on a particular problem : estimation of the probability that a particular sample comes from a different population . To formally define this problem we use notation from Tab . 1 . Given this notation , there exist a statistical population Γ . Elements of this population are pairs ( x , y ) , where x ∈ Rn is a sample , y ∈ Y is a label . We assume that there exists a deterministic correspondence between population precedent and corresponding label . Statistically representative training set X is used to train prediction model by minimization of empirical loss function L. With enough data and mild assumptions on loss function , the resulting model with parameters θ̂ should replicate correspondence between x and y . As a result , our model should give a correct prediction to any x from the general population . Thus , given assumptions , there is a natural way to define xi as the out-of-domain sample : xi is out-of-domain↔ ∀ ( x , y ) ∈ Γ : xi 6= x ( 1 ) Our task is to estimate , if the particular sample xi is out-of-domain , given only the estimated model parameters θ̂ . The core idea of our method is quite simple . We train prediction model by minimisation of some additive loss function L = 1m ∑ ( x , y ) ∈X ` ( θ , x , y ) . When minimisation is performed by stochastic gradient descent or similar methods , the expectation of the model parameters gradient norm reduces on training set elements with the number of optimization steps . The expectation aims to zero for flexible enough decision functions . In tangent kernel space ( NTK for neural models ) the optimization process looks like seeking for optimization parameter θ that pulls representation of training set points ∇ ` ( θ , x , y ) to zero vector . We can use this property and determine the model behavior for an example by the distance of its representation in the trained tangent kernel space ( defined by θ̂ ) from zero . Using this information we can predict many practical properties of the particular prediction : expected accuracy , model uncertainty , out-of-domain points detection , etc .. In this paper , we focus on the latter case and build a method for out-of-domain detection on top of this principle . The modern definition of the domain depends on the application and we will show this difference in the experimental section . From a theoretical perspective , we equate domain and the population . This way we allow a researcher to define their notion of the domain with the selection of sampling technique . The ideally trained model brings all points of the population to a stationary point in model parameters space . In this paper we make an assumption that kernel of this transformation is equal to the population and the observed transformation differs from ideal one with Gaussian error : ∇θ ` ( θ , x , y ) |θ̂ = ∇θ ` ( θ , x , y ) |θ∗ + δ , δ ∼ N ( 0 , E ) . Now we can define a log probability of population Γ membership : g ( x , θ̂ ) = logP ( x|Γ ) ∼ ∥∥∇θ ` ( θ , x , y ) |θ̂∥∥22 The main problem for practical application of the method is to define a loss function for examples , that come to the model during its exploitation and have no label . In this case , it is natural to use the class assigned by the model ĉ as a label and check the uncertainty of the model in the decision . We focus , without loss of generality , on image classification problem over k classes with neural models . Negative log likelihood over softmax probability modeling is one of the most commonly used loss functions for this problem : ` ( θ , x , y ) = − log e hy ( x , θ ) ∑k c=1 e hc ( x , θ ) where hc are outputs of the neural model for each class c. Using this model and the label assumption we can formulate the result log probability of population membership g ( x , θ̂ ) for arbitrary point x : g ( x , θ̂ ) = ∥∥∥∥∥∇θ log ehĉ ( x , θ ) ∑k c=1 e hc ( x , θ ) ∣∣∣∣∣ θ̂ ∥∥∥∥∥ 2 2 Now we can choose significance level α and filter out points that belong to the population with probability less than this significance level : P ( x|Γ ) < α . In practice we don ’ t use significance level directly , but define a threshold δ ( α ) for g ( x , θ̂ ) . If we have information on out-of-domain examples we choose the threshold that delivers the selected significance level on cross-validation . We use this setup as a baseline variant of our method in the experimental section . In the literature there are at least two ways how to enhance the result of the baseline model : temperature scaling ( 5 ) , and input perturbation ( 20 ) . In our framework these enhancements are easily explained and compliment the baseline model . To show this we need to unfold components of the gradient vector : ∇θ ` ( x , θ̂ ) = −∇θ log maxc′ e h c′ ( x , θ ) ∑k c=1 e hc ( x , θ ) ∣∣∣ θ̂ = S ( x , θ̂ ) G ( x , θ̂ ) , where S ( x , θ̂ ) = 1 1+ ∑ c 6=ĉ e ( hc ( x , θ̂ ) −hĉ ( x , θ̂ ) ) G ( x , θ̂ ) = − ∑ c 6=ĉ e ( hc ( x , θ̂ ) −hĉ ( x , θ̂ ) ) ∂ ( hĉ ( x , θ ) −hc ( x , θ ) ) ∂θ ∣∣∣ θ̂ In the last expression there are two multiplicative parts ( S and G ) . S is a scalar part , that reflects the probability of the predicted class . The G is cumulative gradient vector for all classes output nodes of the network weighted by their preference over predicted class ehc ( x , θ̂ ) /ehĉ ( x , θ̂ ) . The first part is equal to the softmax score from ODIN up to the notations used . The second part is the information from NTK space . As one can see both S and G heavily depend on class weights hc , and it is important to calibrate these values for the task the model is used for . One of the most popular ways of model calibration is temperature parameter injection ( 5 ) . In this method we scale class weights hc with the temperature factor 1T . The optimal temperature is then optimized using some calibration quality metric like Expected Calibration Error ( 5 ) for the target dataset . The solution of this optimization problem depends on the data provided , see the experimental section for details . The other way of out-of-domain detection model improvement is altering the source signal , e.g . the image in case of the image classification task . In our framework we assume that during training process the optimization pulls domain space to a stationary point in model parameters space . As only training examples are observed , we pull the entire domain using the train set as mount points . In this process the rest of the domain slacks and this cause well-known difference in gradients between training set points and validation points . To reduce this slack we can move point towards training points . We follow the alteration procedure introduced in the ODIN paper : xp = xo − ε sign ( −∇x log maxc′ e hc′ ( x , θ ) /T∑k c=1 e hc ( x , θ ) /T ∣∣∣∣∣ xo ) During this procedure , source image is altered to reduce the gradient and compensate the slack between training points and the rest of the domain . To sum it up , the proposed method is a composition of ε-input perturbation , temperature calibration by scaling outputs by 1/T factor and decomposition of ∇θ ` ( x , θ̂ ) into two multiplicative parts : S ( x , θ̂ ) and G ( x , θ̂ ) . These parts can be used as a single estimator : g ( x , θ̂ ) = ‖S ( x , θ̂ ) G ( x , θ̂ ) ‖22 , or alone : g ( x , θ̂ ) = ‖G ( x , θ̂ ) ‖22 , g ( x , θ̂ ) = S ( x , θ̂ ) . The last variant gives us exactly ODIN .
This paper proposed a new method called GRODIIN to detect whether a new sample is similar with training set or from out of distribution. The basic assumption is that the expectation of gradient descent should be close to zero vector on the in-domain training set. Then this paper can compute the gradient on a new example, and compare its distance in the tangent kernel space.
SP:11a820faae032646dbab551a349655998c9a0286
Natural Language Descriptions of Deep Features
1 INTRODUCTION . A surprising amount can be learned about the behavior of a deep network by understanding the individual neurons that make it up . Previous studies aimed at visualizing or automatically categorizing neurons have identified a range of interpretable functions across models and application domains : low-level convolutional units in image classifiers implement color detectors and Gabor filters ( Erhan et al. , 2009 ) , while some later units activate for specific parts and object categories ( Zeiler & Fergus , 2014 ; Bau et al. , 2017 ) . Outside of computer vision , single neurons have been found to encode sentiment in language data ( Radford et al. , 2017 ) and biological function in computational chemistry ( Preuer et al. , 2019 ) . Given a new model trained to perform a new task , can we automatically find , describe , and catalog these behaviors ? Techniques for characterizing the behavior of individual neurons are still quite limited . Approaches based on visualization ( Zeiler & Fergus , 2014 ; Girshick et al. , 2014 ; Karpathy et al. , 2015 ; Mahendran & Vedaldi , 2015 ; Olah et al. , 2017 ) leave much of the work of interpretation up to human users , and can not be used for large-scale analysis . Existing automated labeling techniques ( Bau et al. , 2017 ; 2019 ; Mu & Andreas , 2020 ) require researchers to pre-define a fixed space of candidate neuron labels ; they label only a subset of neurons in a given network and can not be used to surface novel or unexpected behaviors . This paper develops an alternative paradigm for labeling neurons with expressive , compositional , and open-ended annotations in the form of natural language descriptions . We focus on the visual domain : building on past work on information-theoretic approaches to model interpretability , we formulate neuron labeling as a problem of finding informative descriptions of a neuron ’ s pattern of activation on input images . We describe a procedure ( called MILAN , for mutual-informationguided linguistic annotation of neurons ) that labels individual neurons with fine-grained natural language descriptions by searching for descriptions that maximize pointwise mutual information with the image regions in which neurons are active . To do so , we first collect a new dataset of fine-grained image annotations ( MILANNOTATIONS , Figure 1c ) , then use these to construct learned approximations to the distributions over image regions ( Figure 1b ) and descriptions . In some cases , MILAN surfaces neuron descriptions that more specific than the underlying training data ( Figure 1d ) . MILAN is largely model-agnostic and can surface descriptions for different classes of neurons , ranging from convolutional units in CNNs to fully connected units in vision transformers , even when the target network is trained on data that differs systematically from MILANNOTATIONS ’ images . These descriptions can in turn serve a diverse set of practical goals in model interpretability and dataset design . Our experiments highlight three : using MILAN-generated descriptions to ( 1 ) analyze the role and importance of different neuron classes in convolutional image classifiers , ( 2 ) audit models for sensitive demographic data by comparing comparing their features when trained on anonymized ( blurred ) and non-anonymized datasets , and ( 3 ) identify and mitigate the effects of spurious correlations with text features , improving classifier performance on adversarially distributed test sets . Taken together , these results show that fine-grained , automatic annotation of deep network models is both possible and practical : rich explanations produced by automated annotation procedures can surface meaningful and actionable information about model behavior.1 2 RELATED WORK . Interpreting deep networks MILAN builds on a long line of recent approaches aimed at explaining the behavior of deep networks by characterizing the function of individual neurons , either by visualizing the inputs they select for ( Zeiler & Fergus , 2014 ; Girshick et al. , 2014 ; Karpathy et al. , 2015 ; Mahendran & Vedaldi , 2015 ; Olah et al. , 2017 ) or by automatically categorizing them according to the concepts they recognize ( Bau et al. , 2017 ; 2018 ; Mu & Andreas , 2020 ; Morcos et al. , 2018 ; Dalvi et al. , 2019 ) . Past approaches to automatic neuron labeling require fixed , pre-defined label sets ; in computer vision , this has limited exploration to pre-selected object classes , parts , materials , and simple logical combinations of these concepts . While manual inspection of neurons has revealed that a wider range of features play an important role in visual recognition ( e.g . orientation , illumination , and spatial relations ; Cammarata et al . 2021 ) MILAN is the first automated approach that can identify such features at scale . Discrete categorization is also possible for directions in representation space ( Kim et al. , 2018 ; Andreas et al. , 2017 ; Schwettmann et al. , 2021 ) and for clusters of images induced by visual representations ( Laina et al. , 2020 ) ; in the latter , an off-the-shelf image captioning model is used to obtain language descriptions of the unifying visual concept for the cluster , although the descriptions miss low-level visual commonalities . As MILAN requires only a primitive procedure for generating model inputs maximally associated with the feature or direction of interest , future work might extend it to these settings as well . 1Code , MILANNOTATIONS data , and a trained MILAN model are available at [ anonymized ] . Natural language explanations of decisions Previous work aimed at explaining computer vision classifiers using natural language has focused on generating explanations for individual classification decisions ( e.g. , Hendricks et al. , 2016 ; Park et al. , 2018 ; Hendricks et al. , 2018 ; Zellers et al. , 2019 ) . Outside of computer vision , several recent papers have proposed procedures for generating natural language explanations of decisions in text classification models ( Zaidan & Eisner , 2008 ; Camburu et al. , 2018 ; Rajani et al. , 2019 ; Narang et al. , 2020 ) and of representations in more general sequence modeling problems ( Andreas & Klein , 2017 ) . These approaches require task-specific datasets and often specialized training procedures , and do not assist with interpretability at the model level . To the best of our knowledge , MILAN is the first approach for generating compositional natural language descriptions for interpretability at the level of individual features rather than input-conditional decisions or representations . More fundamentally , MILAN can do so independently of the model being described , making it ( as shown in Section 4 ) modular , portable , and to a limited extent task-agnostic . 3 APPROACH . Neurons and exemplars Consider the neuron depicted in Figure 1b , located in a convlutional network trained to classify scenes ( Zhou et al. , 2017 ) . When the images in Figure 1 are provided as input to the network , the neuron activates in patches of grass near animals , but not in grass without animals nearby . How might we automate the process of automatically generating such a description ? While the image regions depicted in Fig . 1b do not completely characterize the neuron ’ s function in the broader network , past work has found that actionable information can be gleaned from such regions alone . Bau et al . ( 2020 ; 2019 ) use them to identify neurons that can trigger class predictions or generative synthesis of specific objects ; Andreas & Klein ( 2017 ) use them to predict sequence outputs on novel inputs ; Olah et al . ( 2018 ) and Mu & Andreas ( 2020 ) use them to identify adversarial vulnerabilities . Thus , building on this past work , our approach to neuron labeling also begins by representing each neuron via the set of input regions on which its activity exceeds a fixed threshold . Definition 1 . Let f : X → Y be a neural network , and let fi ( x ) denote the activation value of the ith neuron in f given an input x.2 Then , the exemplar representation of the neuron fi is given by : Ei = { x ∈ X : fi ( x ) > ηi } . ( 1 ) for some activation threshold ηi ( discussed in more detail below ) . Exemplars and descriptions Given this explicit representation of fi ’ s behavior , it remains to construct a description di of the neuron . Past work ( Bau et al. , 2017 ; Andreas et al. , 2017 ) begins with a fixed inventory of candidate descriptions ( e.g . object categories ) , defines an exemplar set E′d for each such category ( e.g . via the output of a semantic segmentation procedure ) then labels neurons by optimizing di : = argmind δ ( Ei , E ′ d ) for some measure of set distance ( e.g . Jaccard , 1912 ) . In this work , we instead adopt a probabilistic approach to neuron labeling . In computer vision applications , each Ei is a set of image patches . Humans are adept at describing such patches ( Rashtchian et al. , 2010 ) and one straightforward possibility might be to directly optimize di : = argmaxd p ( d | Ei ) . In practice , however , the distribution of human descriptions given images may not be wellaligned with the needs of model users . Fig . 2 includes examples of human-generated descriptions for exemplar sets . Many of them ( e.g . text for AlexNet conv3-252 ) are accurate , but generic ; in reality , the neuron responds specifically to text on screens . The generated description of a neuron should capture the specificity of its function—especially relative to other neurons in the same model . We thus adopt an information-theoretic criterion for selecting descriptions : our final neuron description procedure optimizes pointwise mutual information between descriptions and exemplar sets : Definition 2 . The max-mutual-information description of the neuron fi is given by : MILAN ( fi ) : = argmax d pmi ( d ; Ei ) = argmax d log p ( d | Ei ) − log p ( d ) . ( 2 ) To turn Eq . ( 2 ) into a practical procedure for annotating neurons , three additional steps are required : constructing a tractable approximation to the exemplar set Ei ( Section 3.1 ) , using human-generated image descriptions to model p ( d | E ) and p ( d ) ( Section 3.2 and Section 3.3 ) , and finding a highquality description d in the infinite space of natural language strings ( Section 3.4 ) . 2In this paper , we will be primarily concerned with neurons in convolutional layers ; for each neuron , we will thus take the input space X to be the space of all image patches equal in size to the neuron ’ s receptive field . 3.1 APPROXIMATING THE EXEMPLAR SET . As written , the exemplar set in Equation ( 1 ) captures a neuron ’ s behavior on all image patches . This set is large ( limited only by the precision used to represent individual pixel values ) , so we follow past work ( Bau et al. , 2017 ) by restricting each Ei to the set of images that cause the greatest activation in the neuron fi . For convolutional neurons in image processing tasks , sets Ei ultimately comprise k images with activation masks indicating the regions of those images in which fi fired ( Fig . 1a ; see Bau et al . 2017 for details ) . Throughout this paper , we use exemplar sets with k = 15 images and choose ηi equal to the 0.99 percentile of activations for the neuron fi . 3.2 MODELING p ( d | E ) AND p ( d ) The term pmi ( d ; Ei ) in Equation ( 2 ) can be expressed in terms of two distributions : the probability p ( d | Ei ) that a human would describe an image region with d , and the probability p ( d ) that a human would use the description d for any neuron . p ( d | Ei ) is , roughly speaking , a distribution over image captions ( Donahue et al. , 2015 ) . Here , however , the input to the model is not a single image but a set of image regions ( the masks in Fig . 1a ) ; we seek natural language descriptions of the common features of those regions . We approximate p ( d | Ei ) with learned model—specifically the Show-Attend-Tell image description model of Xu et al . ( 2015 ) trained on the MILANNOTATIONS dataset described below , and with several modifications tailored to our use case . We approximate p ( d ) with a two-layer LSTM language model ( Hochreiter & Schmidhuber , 1997 ) trained on the text of MILANNOTATIONS . Details about both models are provided in Appendix B .
This paper describes a novel procedure (MILAN) to interpret deep learning models for computer vision by generating natural language description that specifies the activation selectivity of a given neuron in the model. For this aim, they first define an exemplar set of input image regions for each neuron by thresholding its activation value. Then they search a natural language description by optimizing the point-wise mutual information between descriptions and the exemplar set. The probability distributions for calculating the mutual information are approximated by training the SAT model and a two-layer LSTM language model on a newly collected dataset (MILANNOTATIONS), which includes annotations of 20k units labeled by human participants. The authors first test the generalizability of MILAN descriptions across different model architectures, datasets, and tasks, showing its privilege of generating higher agreement with human annotations compared to baseline methods. They then demonstrate three interesting applications of MILAN procedure and show how these natural language descriptions help us to understand and control the learned models.
SP:a9350b7ff3e5a6b031fb4227f811f41d20ab8323
Natural Language Descriptions of Deep Features
1 INTRODUCTION . A surprising amount can be learned about the behavior of a deep network by understanding the individual neurons that make it up . Previous studies aimed at visualizing or automatically categorizing neurons have identified a range of interpretable functions across models and application domains : low-level convolutional units in image classifiers implement color detectors and Gabor filters ( Erhan et al. , 2009 ) , while some later units activate for specific parts and object categories ( Zeiler & Fergus , 2014 ; Bau et al. , 2017 ) . Outside of computer vision , single neurons have been found to encode sentiment in language data ( Radford et al. , 2017 ) and biological function in computational chemistry ( Preuer et al. , 2019 ) . Given a new model trained to perform a new task , can we automatically find , describe , and catalog these behaviors ? Techniques for characterizing the behavior of individual neurons are still quite limited . Approaches based on visualization ( Zeiler & Fergus , 2014 ; Girshick et al. , 2014 ; Karpathy et al. , 2015 ; Mahendran & Vedaldi , 2015 ; Olah et al. , 2017 ) leave much of the work of interpretation up to human users , and can not be used for large-scale analysis . Existing automated labeling techniques ( Bau et al. , 2017 ; 2019 ; Mu & Andreas , 2020 ) require researchers to pre-define a fixed space of candidate neuron labels ; they label only a subset of neurons in a given network and can not be used to surface novel or unexpected behaviors . This paper develops an alternative paradigm for labeling neurons with expressive , compositional , and open-ended annotations in the form of natural language descriptions . We focus on the visual domain : building on past work on information-theoretic approaches to model interpretability , we formulate neuron labeling as a problem of finding informative descriptions of a neuron ’ s pattern of activation on input images . We describe a procedure ( called MILAN , for mutual-informationguided linguistic annotation of neurons ) that labels individual neurons with fine-grained natural language descriptions by searching for descriptions that maximize pointwise mutual information with the image regions in which neurons are active . To do so , we first collect a new dataset of fine-grained image annotations ( MILANNOTATIONS , Figure 1c ) , then use these to construct learned approximations to the distributions over image regions ( Figure 1b ) and descriptions . In some cases , MILAN surfaces neuron descriptions that more specific than the underlying training data ( Figure 1d ) . MILAN is largely model-agnostic and can surface descriptions for different classes of neurons , ranging from convolutional units in CNNs to fully connected units in vision transformers , even when the target network is trained on data that differs systematically from MILANNOTATIONS ’ images . These descriptions can in turn serve a diverse set of practical goals in model interpretability and dataset design . Our experiments highlight three : using MILAN-generated descriptions to ( 1 ) analyze the role and importance of different neuron classes in convolutional image classifiers , ( 2 ) audit models for sensitive demographic data by comparing comparing their features when trained on anonymized ( blurred ) and non-anonymized datasets , and ( 3 ) identify and mitigate the effects of spurious correlations with text features , improving classifier performance on adversarially distributed test sets . Taken together , these results show that fine-grained , automatic annotation of deep network models is both possible and practical : rich explanations produced by automated annotation procedures can surface meaningful and actionable information about model behavior.1 2 RELATED WORK . Interpreting deep networks MILAN builds on a long line of recent approaches aimed at explaining the behavior of deep networks by characterizing the function of individual neurons , either by visualizing the inputs they select for ( Zeiler & Fergus , 2014 ; Girshick et al. , 2014 ; Karpathy et al. , 2015 ; Mahendran & Vedaldi , 2015 ; Olah et al. , 2017 ) or by automatically categorizing them according to the concepts they recognize ( Bau et al. , 2017 ; 2018 ; Mu & Andreas , 2020 ; Morcos et al. , 2018 ; Dalvi et al. , 2019 ) . Past approaches to automatic neuron labeling require fixed , pre-defined label sets ; in computer vision , this has limited exploration to pre-selected object classes , parts , materials , and simple logical combinations of these concepts . While manual inspection of neurons has revealed that a wider range of features play an important role in visual recognition ( e.g . orientation , illumination , and spatial relations ; Cammarata et al . 2021 ) MILAN is the first automated approach that can identify such features at scale . Discrete categorization is also possible for directions in representation space ( Kim et al. , 2018 ; Andreas et al. , 2017 ; Schwettmann et al. , 2021 ) and for clusters of images induced by visual representations ( Laina et al. , 2020 ) ; in the latter , an off-the-shelf image captioning model is used to obtain language descriptions of the unifying visual concept for the cluster , although the descriptions miss low-level visual commonalities . As MILAN requires only a primitive procedure for generating model inputs maximally associated with the feature or direction of interest , future work might extend it to these settings as well . 1Code , MILANNOTATIONS data , and a trained MILAN model are available at [ anonymized ] . Natural language explanations of decisions Previous work aimed at explaining computer vision classifiers using natural language has focused on generating explanations for individual classification decisions ( e.g. , Hendricks et al. , 2016 ; Park et al. , 2018 ; Hendricks et al. , 2018 ; Zellers et al. , 2019 ) . Outside of computer vision , several recent papers have proposed procedures for generating natural language explanations of decisions in text classification models ( Zaidan & Eisner , 2008 ; Camburu et al. , 2018 ; Rajani et al. , 2019 ; Narang et al. , 2020 ) and of representations in more general sequence modeling problems ( Andreas & Klein , 2017 ) . These approaches require task-specific datasets and often specialized training procedures , and do not assist with interpretability at the model level . To the best of our knowledge , MILAN is the first approach for generating compositional natural language descriptions for interpretability at the level of individual features rather than input-conditional decisions or representations . More fundamentally , MILAN can do so independently of the model being described , making it ( as shown in Section 4 ) modular , portable , and to a limited extent task-agnostic . 3 APPROACH . Neurons and exemplars Consider the neuron depicted in Figure 1b , located in a convlutional network trained to classify scenes ( Zhou et al. , 2017 ) . When the images in Figure 1 are provided as input to the network , the neuron activates in patches of grass near animals , but not in grass without animals nearby . How might we automate the process of automatically generating such a description ? While the image regions depicted in Fig . 1b do not completely characterize the neuron ’ s function in the broader network , past work has found that actionable information can be gleaned from such regions alone . Bau et al . ( 2020 ; 2019 ) use them to identify neurons that can trigger class predictions or generative synthesis of specific objects ; Andreas & Klein ( 2017 ) use them to predict sequence outputs on novel inputs ; Olah et al . ( 2018 ) and Mu & Andreas ( 2020 ) use them to identify adversarial vulnerabilities . Thus , building on this past work , our approach to neuron labeling also begins by representing each neuron via the set of input regions on which its activity exceeds a fixed threshold . Definition 1 . Let f : X → Y be a neural network , and let fi ( x ) denote the activation value of the ith neuron in f given an input x.2 Then , the exemplar representation of the neuron fi is given by : Ei = { x ∈ X : fi ( x ) > ηi } . ( 1 ) for some activation threshold ηi ( discussed in more detail below ) . Exemplars and descriptions Given this explicit representation of fi ’ s behavior , it remains to construct a description di of the neuron . Past work ( Bau et al. , 2017 ; Andreas et al. , 2017 ) begins with a fixed inventory of candidate descriptions ( e.g . object categories ) , defines an exemplar set E′d for each such category ( e.g . via the output of a semantic segmentation procedure ) then labels neurons by optimizing di : = argmind δ ( Ei , E ′ d ) for some measure of set distance ( e.g . Jaccard , 1912 ) . In this work , we instead adopt a probabilistic approach to neuron labeling . In computer vision applications , each Ei is a set of image patches . Humans are adept at describing such patches ( Rashtchian et al. , 2010 ) and one straightforward possibility might be to directly optimize di : = argmaxd p ( d | Ei ) . In practice , however , the distribution of human descriptions given images may not be wellaligned with the needs of model users . Fig . 2 includes examples of human-generated descriptions for exemplar sets . Many of them ( e.g . text for AlexNet conv3-252 ) are accurate , but generic ; in reality , the neuron responds specifically to text on screens . The generated description of a neuron should capture the specificity of its function—especially relative to other neurons in the same model . We thus adopt an information-theoretic criterion for selecting descriptions : our final neuron description procedure optimizes pointwise mutual information between descriptions and exemplar sets : Definition 2 . The max-mutual-information description of the neuron fi is given by : MILAN ( fi ) : = argmax d pmi ( d ; Ei ) = argmax d log p ( d | Ei ) − log p ( d ) . ( 2 ) To turn Eq . ( 2 ) into a practical procedure for annotating neurons , three additional steps are required : constructing a tractable approximation to the exemplar set Ei ( Section 3.1 ) , using human-generated image descriptions to model p ( d | E ) and p ( d ) ( Section 3.2 and Section 3.3 ) , and finding a highquality description d in the infinite space of natural language strings ( Section 3.4 ) . 2In this paper , we will be primarily concerned with neurons in convolutional layers ; for each neuron , we will thus take the input space X to be the space of all image patches equal in size to the neuron ’ s receptive field . 3.1 APPROXIMATING THE EXEMPLAR SET . As written , the exemplar set in Equation ( 1 ) captures a neuron ’ s behavior on all image patches . This set is large ( limited only by the precision used to represent individual pixel values ) , so we follow past work ( Bau et al. , 2017 ) by restricting each Ei to the set of images that cause the greatest activation in the neuron fi . For convolutional neurons in image processing tasks , sets Ei ultimately comprise k images with activation masks indicating the regions of those images in which fi fired ( Fig . 1a ; see Bau et al . 2017 for details ) . Throughout this paper , we use exemplar sets with k = 15 images and choose ηi equal to the 0.99 percentile of activations for the neuron fi . 3.2 MODELING p ( d | E ) AND p ( d ) The term pmi ( d ; Ei ) in Equation ( 2 ) can be expressed in terms of two distributions : the probability p ( d | Ei ) that a human would describe an image region with d , and the probability p ( d ) that a human would use the description d for any neuron . p ( d | Ei ) is , roughly speaking , a distribution over image captions ( Donahue et al. , 2015 ) . Here , however , the input to the model is not a single image but a set of image regions ( the masks in Fig . 1a ) ; we seek natural language descriptions of the common features of those regions . We approximate p ( d | Ei ) with learned model—specifically the Show-Attend-Tell image description model of Xu et al . ( 2015 ) trained on the MILANNOTATIONS dataset described below , and with several modifications tailored to our use case . We approximate p ( d ) with a two-layer LSTM language model ( Hochreiter & Schmidhuber , 1997 ) trained on the text of MILANNOTATIONS . Details about both models are provided in Appendix B .
The authors introduced MILAN, for mutual-information-guided linguistic annotation of neurons) that automatically labels neurons with open-ended, compositional, natural language descriptions. This is done by searching for descriptions that maximize point-wise mutual information with the image regions in which the neurons are active. It uses (Bau, et. al. 2017) model for the selection of 15 images with regions, and Xu et. al. 2015 (Show-Attend-Tell) with a modification in pmi (probability of mutual information) for describing these regions. The Show-Attend-Tell model is trained on MILANANOTATIONS dataset, a large contribution of the technique. It is a dataset of images and fine-grained region descriptions. The dataset is comprised of 20K neurons (sets of regions) with descriptions. TESTING: The testing section is a large part of the contribution as well. * Section 4: MILAN obtained higher agreement with human annotations on held-out networks than baseline. It also shows that the model works across architecture, dataset, and task * Section 5: neurons captioned with many adjectives or prepositions are relatively important to model behavior * Section 6: Models trained on blurred faces acquire neurons selective for blurred faces * Section 7: Networks devotes substantial capacity to identifying text labels in images.
SP:a9350b7ff3e5a6b031fb4227f811f41d20ab8323
Natural Language Descriptions of Deep Features
1 INTRODUCTION . A surprising amount can be learned about the behavior of a deep network by understanding the individual neurons that make it up . Previous studies aimed at visualizing or automatically categorizing neurons have identified a range of interpretable functions across models and application domains : low-level convolutional units in image classifiers implement color detectors and Gabor filters ( Erhan et al. , 2009 ) , while some later units activate for specific parts and object categories ( Zeiler & Fergus , 2014 ; Bau et al. , 2017 ) . Outside of computer vision , single neurons have been found to encode sentiment in language data ( Radford et al. , 2017 ) and biological function in computational chemistry ( Preuer et al. , 2019 ) . Given a new model trained to perform a new task , can we automatically find , describe , and catalog these behaviors ? Techniques for characterizing the behavior of individual neurons are still quite limited . Approaches based on visualization ( Zeiler & Fergus , 2014 ; Girshick et al. , 2014 ; Karpathy et al. , 2015 ; Mahendran & Vedaldi , 2015 ; Olah et al. , 2017 ) leave much of the work of interpretation up to human users , and can not be used for large-scale analysis . Existing automated labeling techniques ( Bau et al. , 2017 ; 2019 ; Mu & Andreas , 2020 ) require researchers to pre-define a fixed space of candidate neuron labels ; they label only a subset of neurons in a given network and can not be used to surface novel or unexpected behaviors . This paper develops an alternative paradigm for labeling neurons with expressive , compositional , and open-ended annotations in the form of natural language descriptions . We focus on the visual domain : building on past work on information-theoretic approaches to model interpretability , we formulate neuron labeling as a problem of finding informative descriptions of a neuron ’ s pattern of activation on input images . We describe a procedure ( called MILAN , for mutual-informationguided linguistic annotation of neurons ) that labels individual neurons with fine-grained natural language descriptions by searching for descriptions that maximize pointwise mutual information with the image regions in which neurons are active . To do so , we first collect a new dataset of fine-grained image annotations ( MILANNOTATIONS , Figure 1c ) , then use these to construct learned approximations to the distributions over image regions ( Figure 1b ) and descriptions . In some cases , MILAN surfaces neuron descriptions that more specific than the underlying training data ( Figure 1d ) . MILAN is largely model-agnostic and can surface descriptions for different classes of neurons , ranging from convolutional units in CNNs to fully connected units in vision transformers , even when the target network is trained on data that differs systematically from MILANNOTATIONS ’ images . These descriptions can in turn serve a diverse set of practical goals in model interpretability and dataset design . Our experiments highlight three : using MILAN-generated descriptions to ( 1 ) analyze the role and importance of different neuron classes in convolutional image classifiers , ( 2 ) audit models for sensitive demographic data by comparing comparing their features when trained on anonymized ( blurred ) and non-anonymized datasets , and ( 3 ) identify and mitigate the effects of spurious correlations with text features , improving classifier performance on adversarially distributed test sets . Taken together , these results show that fine-grained , automatic annotation of deep network models is both possible and practical : rich explanations produced by automated annotation procedures can surface meaningful and actionable information about model behavior.1 2 RELATED WORK . Interpreting deep networks MILAN builds on a long line of recent approaches aimed at explaining the behavior of deep networks by characterizing the function of individual neurons , either by visualizing the inputs they select for ( Zeiler & Fergus , 2014 ; Girshick et al. , 2014 ; Karpathy et al. , 2015 ; Mahendran & Vedaldi , 2015 ; Olah et al. , 2017 ) or by automatically categorizing them according to the concepts they recognize ( Bau et al. , 2017 ; 2018 ; Mu & Andreas , 2020 ; Morcos et al. , 2018 ; Dalvi et al. , 2019 ) . Past approaches to automatic neuron labeling require fixed , pre-defined label sets ; in computer vision , this has limited exploration to pre-selected object classes , parts , materials , and simple logical combinations of these concepts . While manual inspection of neurons has revealed that a wider range of features play an important role in visual recognition ( e.g . orientation , illumination , and spatial relations ; Cammarata et al . 2021 ) MILAN is the first automated approach that can identify such features at scale . Discrete categorization is also possible for directions in representation space ( Kim et al. , 2018 ; Andreas et al. , 2017 ; Schwettmann et al. , 2021 ) and for clusters of images induced by visual representations ( Laina et al. , 2020 ) ; in the latter , an off-the-shelf image captioning model is used to obtain language descriptions of the unifying visual concept for the cluster , although the descriptions miss low-level visual commonalities . As MILAN requires only a primitive procedure for generating model inputs maximally associated with the feature or direction of interest , future work might extend it to these settings as well . 1Code , MILANNOTATIONS data , and a trained MILAN model are available at [ anonymized ] . Natural language explanations of decisions Previous work aimed at explaining computer vision classifiers using natural language has focused on generating explanations for individual classification decisions ( e.g. , Hendricks et al. , 2016 ; Park et al. , 2018 ; Hendricks et al. , 2018 ; Zellers et al. , 2019 ) . Outside of computer vision , several recent papers have proposed procedures for generating natural language explanations of decisions in text classification models ( Zaidan & Eisner , 2008 ; Camburu et al. , 2018 ; Rajani et al. , 2019 ; Narang et al. , 2020 ) and of representations in more general sequence modeling problems ( Andreas & Klein , 2017 ) . These approaches require task-specific datasets and often specialized training procedures , and do not assist with interpretability at the model level . To the best of our knowledge , MILAN is the first approach for generating compositional natural language descriptions for interpretability at the level of individual features rather than input-conditional decisions or representations . More fundamentally , MILAN can do so independently of the model being described , making it ( as shown in Section 4 ) modular , portable , and to a limited extent task-agnostic . 3 APPROACH . Neurons and exemplars Consider the neuron depicted in Figure 1b , located in a convlutional network trained to classify scenes ( Zhou et al. , 2017 ) . When the images in Figure 1 are provided as input to the network , the neuron activates in patches of grass near animals , but not in grass without animals nearby . How might we automate the process of automatically generating such a description ? While the image regions depicted in Fig . 1b do not completely characterize the neuron ’ s function in the broader network , past work has found that actionable information can be gleaned from such regions alone . Bau et al . ( 2020 ; 2019 ) use them to identify neurons that can trigger class predictions or generative synthesis of specific objects ; Andreas & Klein ( 2017 ) use them to predict sequence outputs on novel inputs ; Olah et al . ( 2018 ) and Mu & Andreas ( 2020 ) use them to identify adversarial vulnerabilities . Thus , building on this past work , our approach to neuron labeling also begins by representing each neuron via the set of input regions on which its activity exceeds a fixed threshold . Definition 1 . Let f : X → Y be a neural network , and let fi ( x ) denote the activation value of the ith neuron in f given an input x.2 Then , the exemplar representation of the neuron fi is given by : Ei = { x ∈ X : fi ( x ) > ηi } . ( 1 ) for some activation threshold ηi ( discussed in more detail below ) . Exemplars and descriptions Given this explicit representation of fi ’ s behavior , it remains to construct a description di of the neuron . Past work ( Bau et al. , 2017 ; Andreas et al. , 2017 ) begins with a fixed inventory of candidate descriptions ( e.g . object categories ) , defines an exemplar set E′d for each such category ( e.g . via the output of a semantic segmentation procedure ) then labels neurons by optimizing di : = argmind δ ( Ei , E ′ d ) for some measure of set distance ( e.g . Jaccard , 1912 ) . In this work , we instead adopt a probabilistic approach to neuron labeling . In computer vision applications , each Ei is a set of image patches . Humans are adept at describing such patches ( Rashtchian et al. , 2010 ) and one straightforward possibility might be to directly optimize di : = argmaxd p ( d | Ei ) . In practice , however , the distribution of human descriptions given images may not be wellaligned with the needs of model users . Fig . 2 includes examples of human-generated descriptions for exemplar sets . Many of them ( e.g . text for AlexNet conv3-252 ) are accurate , but generic ; in reality , the neuron responds specifically to text on screens . The generated description of a neuron should capture the specificity of its function—especially relative to other neurons in the same model . We thus adopt an information-theoretic criterion for selecting descriptions : our final neuron description procedure optimizes pointwise mutual information between descriptions and exemplar sets : Definition 2 . The max-mutual-information description of the neuron fi is given by : MILAN ( fi ) : = argmax d pmi ( d ; Ei ) = argmax d log p ( d | Ei ) − log p ( d ) . ( 2 ) To turn Eq . ( 2 ) into a practical procedure for annotating neurons , three additional steps are required : constructing a tractable approximation to the exemplar set Ei ( Section 3.1 ) , using human-generated image descriptions to model p ( d | E ) and p ( d ) ( Section 3.2 and Section 3.3 ) , and finding a highquality description d in the infinite space of natural language strings ( Section 3.4 ) . 2In this paper , we will be primarily concerned with neurons in convolutional layers ; for each neuron , we will thus take the input space X to be the space of all image patches equal in size to the neuron ’ s receptive field . 3.1 APPROXIMATING THE EXEMPLAR SET . As written , the exemplar set in Equation ( 1 ) captures a neuron ’ s behavior on all image patches . This set is large ( limited only by the precision used to represent individual pixel values ) , so we follow past work ( Bau et al. , 2017 ) by restricting each Ei to the set of images that cause the greatest activation in the neuron fi . For convolutional neurons in image processing tasks , sets Ei ultimately comprise k images with activation masks indicating the regions of those images in which fi fired ( Fig . 1a ; see Bau et al . 2017 for details ) . Throughout this paper , we use exemplar sets with k = 15 images and choose ηi equal to the 0.99 percentile of activations for the neuron fi . 3.2 MODELING p ( d | E ) AND p ( d ) The term pmi ( d ; Ei ) in Equation ( 2 ) can be expressed in terms of two distributions : the probability p ( d | Ei ) that a human would describe an image region with d , and the probability p ( d ) that a human would use the description d for any neuron . p ( d | Ei ) is , roughly speaking , a distribution over image captions ( Donahue et al. , 2015 ) . Here , however , the input to the model is not a single image but a set of image regions ( the masks in Fig . 1a ) ; we seek natural language descriptions of the common features of those regions . We approximate p ( d | Ei ) with learned model—specifically the Show-Attend-Tell image description model of Xu et al . ( 2015 ) trained on the MILANNOTATIONS dataset described below , and with several modifications tailored to our use case . We approximate p ( d ) with a two-layer LSTM language model ( Hochreiter & Schmidhuber , 1997 ) trained on the text of MILANNOTATIONS . Details about both models are provided in Appendix B .
This work proposes a framework for interpreting model behaviour by generating language descriptions of neurons in the model. The method is trained to maximize mutual information between the description and input examples that activate the neuron. The experiments show results for image classification, generation, and unsupervised representation learning. In particular, this method yields model description that achieve higher BERTScore than max-likelihood training when transferring to neurons in new architectures. Moreover the authors show how this technique can be used to compute correlations between descriptions and neuron importance (e.g. wrt classification accuracy), interpreting model behaviour (e.g. anonymized models still select for unblurred faces), and that one can remove spurious feature corrleations by removing models with specific descriptions.
SP:a9350b7ff3e5a6b031fb4227f811f41d20ab8323
A NEW BACKBONE FOR HYPERSPECTRAL IMAGE RECONSTRUCTION
As the inverse process of snapshot compressive imaging , the hyperspectral image ( HSI ) reconstruction takes the 2D measurement as input and posteriorly retrieves the captured 3D spatial-spectral signal . Built upon several assumptions , numerous sophisticated neural networks have come to the fore in this task . Despite their prosperity under experimental settings , it ’ s still extremely challenging for existing networks to achieve high-fidelity reconstructive quality while maximizing the reconstructive efficiency ( computational efficiency and power occupation ) , which prohibits their further deployment in practical applications . In this paper , we firstly conduct a retrospective analysis on aforementioned assumptions , through which we indicate the imminent aspiration for an authentically practicaloriented network in reconstructive community . By analysing the effectiveness and limitations of the widely-used reconstructive backbone U-Net , we propose a Simple Reconstruction Network , namely SRN , just based on some popular techniques , e.g. , scale/spectral-invariant learning and identity connection . It turns out , under current conditions , such a pragmatic solution outperforms existing reconstructive methods by an obvious margin and maximize the reconstructive efficiency concretely . We hope the proposed SRN can further contribute to the cutting-edge reconstructive methods as a promising backbone , and also benefit the realistic tasks , i.e. , real-time/high-resolution HSI reconstruction , solely as a baseline . 1 INTRODUCTION . Hyperspectral imaging ( HSI ) refers to multi-channel imaging where each channel stores information at a specific spectral wavelength for a fixed real-world scene ( Plaza et al. , 2009 ) . By capturing spatial intensity in a spectral-wise manner , hyperspectral images empower richer information than traditional RGB image cubes and they have been applied in a wide range of scenarios , e.g. , object detection ( Kim et al. , 2012 ; Xu et al. , 2015 ) , remote sensing ( Borengasser et al. , 2007 ; Melgani & Bruzzone , 2004 ; Yuan et al. , 2017 ) , medical image processing ( Lu & Fei , 2014 ; Meng et al. , 2020c ) etc . HSI can be captured and measured by snapshot compressive imaging ( SCI ) systems , which tend to compress information of snapshots along the spectral axis into one single 2D measurement ( Yuan et al. , 2021 ) . The coded aperture snapshot spectral imaging ( CASSI ) system ( Wagadarikar et al. , 2008 ; Meng et al. , 2020b ) forms one mainstream research direction among existing SCI systems due to its passive modulation property ( Llull et al. , 2013 ; Wagadarikar et al. , 2008 ; 2009 ; Yuan et al. , 2015 ) . The goal of HSI reconstruction is to transform the measurements into desired cubic hyperspectral images . As a result , a dimensional-expansion mapping function ( 2D to 3D ) is required , for which reason such a mapping relationship approximation is deemed to be much harder than general image regression tasks . By introducing domain expertise , previous research efforts have proposed a quite number of reconstruction algorithms ( Bioucas-Dias & Figueiredo , 2007 ; Liu et al. , 2019 ; Miao et al. , 2019 ; Meng et al. , 2020b ; Wang et al. , 2020 ; 2017 ; 2019 ; Yuan , 2016 ) , among which deep neural networks ( Meng et al. , 2020b ; c ; Miao et al. , 2019 ; Wang et al. , 2019 ; Wang et al. , 2019 ; 2020 ; Zheng et al. , 2021 ) enable an effective way to faithfully bridge between input and output compositional hierarchies ( LeCun et al. , 2015 ) . 1.1 MOTIVATION . While neural networks become increasingly prevalent in solving the HSI reconstruction problem , their success is reliant on several idealistic hypotheses , which hardly holds in practical scenarios . This prohibits the further application and exploration of HSI . Proper Dataset Volume . The feasibility of learning in a universal sense can be defined by satisfying a VC generalization bound Abu-Mostafa et al . ( 2012 ) . From this perspective , deep neural networks are considered to be high potential due to their high VC bound ( which can be described as the amount of free variables ) . Notably , the corresponding feasibility of neural networks is generally determined by their model complexity and the volume of datasets . In the recent HSI reconstruction methods , more increasingly complicated reconstructive networks have been proposed by assuming the underlying dataset is sufficiently large so that the learning is feasible . This neglects the fact that there ’ s limited data accessible . Under such circumstance , simpler model might be more promising . Ideal reconstructive rate . Practically , any reconstructive algorithm appears with a substantial forward model . For temporal-insensitive situations , the inverse model processes the measurements at any reconstructive rate rrecon > 0 , without considering cooperating with the forward model . However , the reconstructive rate should be higher than ( or at least equal to ) capture rate of the forward model , i.e. , rrecon ≥ rcap > 0 , for temporal-sensitive cases , i.e. , real-time/high-speed HSI reconstruction . For example , λ-net proposed by Miao et al . ( 2019 ) can be applied in reality with rrecon > 30fps . More generally , reconstructive methods are always hypothetically deemed to be efficient enough , i.e. , compatible with any forward systems , which however probably suffers from a deviation from current technical support . Considering the arbitrariness of the lower bound rcap , we can not determine an “ ideal ” reconstructive rate but only to maximize it , i.e. , minimize the reconstructive time . For neural network-based methods , eliminating the number of parameters and computational burdens is a sound solution . Unconstrained computing power . The success of the deep neural networks can largely attribute to the overparameterization ( Soltanolkotabi et al. , 2018 ) —the parameters in neural networks are a lot more than the training samples for a good representation learning . Actually , just by investing more computing power P , the cornerstone which overparametrization is reliant upon , researchers have made great progress in diverse applications ( Thompson et al. , 2020 ) . Latent performance boost can be further expected if more computing power is available , until one reaches the computing power bottleneck P ∗ . It turns out it ’ s difficult to solve such a bottleneck in practical . For example , to conduct TSA-Net ( Meng et al. , 2020b ) for high resolution ( HR ) -HSI restoration ( 1024×1024 ) , the required GPU memory would be unrestrictedly over 18Gb , which indicates dilemma encountered by all high-performanced reconstructive methods with large model size . 1.2 CONTRIBUTIONS . In this study , bearing the limitations imposed by the scale of datasets , the capability of optical systems , and the computational platform , we posit the possibility of network construction with min- imum inductive bias , based on an observation upon the reconstructive baseline U-net . We propose a simple yet quite promising CNN reconstructive network , namely Simple Recon Net ( SRN ) , whose success is owing to revisiting and tailoring several practical techniques for HSI , i.e. , spatial/spectral invariant learning and residual learning . We summarize the contribution of this work as follows . • The proposed SRN provides a new state-of-the-art by improving the previous one ( Huang et al. , 2021 ) > 3dB in PSNR . Moreover , our approach presents clear perceptual improvement across different spectral channels ( Fig . 1 Left ) . • We significantly shrink the model size ( see Fig . 1 Right ) without sacrificing the performance , i.e. , to most extent , we only use < 1/3 parameters of GSM-based method ( Huang et al. , 2021 ) and to the maximum , reduce FLOPs by > 34times as shown in Tab . 3 , both of which yield a higher temporal efficiency and computational efficiency . This makes realtime/higher-resolution images reconstruction practically executable under restricted GPU conditions . • The proposed network can either be solely used as a baseline , or conjunctively referred to as a backbone , contributing to more complicated methods , i , e. , more sophisticated E2E methods or unrolling methods . 2 RELATED WORKS . The basic idea of SCI is to modulate the high-dimensional signal using a higher frequency than the capture rate of the camera . In this manner , a compressed coded frame obtained will include the information in the high-dimensional signal and a high-performance algorithm can then be employed to recover the desired data . For compression , the novel implementation of SCI , CASSI , uses a coded aperture and a prism to conduct the ( spatio- ) spectral modulation . Previously , iterative-based optimization algorithms predominate the field of HSI reconstruction by approximating the image priors through diverse regularization techniques , i.e. , the total variance ( TV ) ( Kittle et al. , 2010 ; Wang et al. , 2015 ; Wagadarikar et al. , 2008 ) , sparsity ( Wang et al. , 2017 ; 2015 ) , non-local similarity ( NLS ) ( Wang et al. , 2016 ; Fu et al. , 2016 ) , Markov Random Field ( MRF ) ( Tappen , 2007 ) , Gaussian mixture model ( Yang et al. , 2015 ) etc , among which DeSCI ( Liu et al. , 2019 ) achieves best performance on both video and spectral compressive imaging . TwIST ( Bioucas-Dias & Figueiredo , 2007 ) proposed a two-step Iterative shrinkage/thresholding algorithm by modeling the reconstructive problem as a a linear observation model with a nonquadratic regularizer ( i.e. , total variation ) . GPSR ( M. A. T. Figueiredo et al. , 2007 ) proposes to use gradient projection ( GP ) algorithms to solve the inverse problem that is formulated as bound-constrained quadratic programming ( BCQP ) process . Inspired by the success of deep learning in other image translation problems , researchers have started using deep learning to reconstruct hyperspectral images from CASSI measurements ( Meng et al. , 2020b ; c ; Miao et al. , 2019 ; Wang et al. , 2019 ; Wang et al. , 2019 ; 2020 ; Zheng et al. , 2021 ) , which can be substantially divided into two streams : end-to-end neural networks ( E2E-NN ) models and others . The former stream tends to directly learn a complete mapping function from measurements ( always packaged with masks ) to estimated HSIs . Other researchers turns to introduce NN models into conventional optimization algorithms , named deep unrolling/unfolding nad plug-and-play methods , leading to lightweight and interpretable methods . Proposed in Ronneberger et al . ( 2015 ) , U-Net sat atop leaderboards regarding medical image tracking and segmentation , followed by which many variants have been derived in recent years , i.e. , 3D U-Net ( Çiçek et al. , 2016 ) , Ternaus U-Net ( Iglovikov & Shvets , 2018 ) , MultiResUNet ( Ibtehaz & Rahman , 2020 ) and Attention U-Net ( Oktay et al. , 2018 ) etc . Typical investigation correlates such a predominance with characteristics of medical images : 1 ) repeated tissue patterns and complicated gradient distribution ; 2 ) locally anomalous region and atypical noise distribution . U-Net intelligently fits the above characteristics by firstly abstracts coarse information and then focus on localization through simultaneously expansion and skip connection . As a classical network structure , U-Net serves as the first precast backbone in HSI reconstruction , among a series of famous architectures , and has been faithfully employed in both E2E and unrolling methods . For example , the λ-net ( Miao et al. , 2019 ) is a dual-stage generative model which employs a U-Net and residual learning strategy . The TSA-Net ( Meng et al. , 2020b ) which combined spatial-spectral self-attention with U-Net led to excellent results on both simulation and real data . As a deep unfolding method , GAP-net ( Meng et al. , 2020a ) utilizes 15-layer U-Net as a trained denoiser in each stage . Recent Gaussian Scale Mixture Prior-based ( GSM-based ) baseline ( Huang et al. , 2021 ) employing U-Net for two objects : a lightweight U-Net for approximating the regularization parameters , another lightweight U-Net for estimating the local-mean of GSM prior . U-Net has exemplified the rationality of uncomplicated neural network in field of HSI reconstruction , even if considering the huge difference between the medical images and hyperspectral images . Actually , as reported in Tab . 1 and Tab . 2 , U-net only achieves sub-optimal performance when solely referred to as a reconstructive baseline , which reveals both the validity and the limitations of such a generic solution . It turns out the performance of neural networks are sensitive to minor adjustments . Compared with the U-Net , it ’ s possible to construct a “ substitute network ” that enables a significant performance boost with mainstream techniques at hand .
Different from the previous works about Unet structure for HSI reconstruction, this paper introduces a new backbone, which is efficient and lightweight. The experiments also demosntrate that the proposed model can significantly outperfom the previous works in quantitative evaluation results. From the above summary, this paper should be of significance to the application society of CASSI imaging reconstruction.
SP:240edf46f5a790ea8eda9053c49797a08a4f725b
A NEW BACKBONE FOR HYPERSPECTRAL IMAGE RECONSTRUCTION
As the inverse process of snapshot compressive imaging , the hyperspectral image ( HSI ) reconstruction takes the 2D measurement as input and posteriorly retrieves the captured 3D spatial-spectral signal . Built upon several assumptions , numerous sophisticated neural networks have come to the fore in this task . Despite their prosperity under experimental settings , it ’ s still extremely challenging for existing networks to achieve high-fidelity reconstructive quality while maximizing the reconstructive efficiency ( computational efficiency and power occupation ) , which prohibits their further deployment in practical applications . In this paper , we firstly conduct a retrospective analysis on aforementioned assumptions , through which we indicate the imminent aspiration for an authentically practicaloriented network in reconstructive community . By analysing the effectiveness and limitations of the widely-used reconstructive backbone U-Net , we propose a Simple Reconstruction Network , namely SRN , just based on some popular techniques , e.g. , scale/spectral-invariant learning and identity connection . It turns out , under current conditions , such a pragmatic solution outperforms existing reconstructive methods by an obvious margin and maximize the reconstructive efficiency concretely . We hope the proposed SRN can further contribute to the cutting-edge reconstructive methods as a promising backbone , and also benefit the realistic tasks , i.e. , real-time/high-resolution HSI reconstruction , solely as a baseline . 1 INTRODUCTION . Hyperspectral imaging ( HSI ) refers to multi-channel imaging where each channel stores information at a specific spectral wavelength for a fixed real-world scene ( Plaza et al. , 2009 ) . By capturing spatial intensity in a spectral-wise manner , hyperspectral images empower richer information than traditional RGB image cubes and they have been applied in a wide range of scenarios , e.g. , object detection ( Kim et al. , 2012 ; Xu et al. , 2015 ) , remote sensing ( Borengasser et al. , 2007 ; Melgani & Bruzzone , 2004 ; Yuan et al. , 2017 ) , medical image processing ( Lu & Fei , 2014 ; Meng et al. , 2020c ) etc . HSI can be captured and measured by snapshot compressive imaging ( SCI ) systems , which tend to compress information of snapshots along the spectral axis into one single 2D measurement ( Yuan et al. , 2021 ) . The coded aperture snapshot spectral imaging ( CASSI ) system ( Wagadarikar et al. , 2008 ; Meng et al. , 2020b ) forms one mainstream research direction among existing SCI systems due to its passive modulation property ( Llull et al. , 2013 ; Wagadarikar et al. , 2008 ; 2009 ; Yuan et al. , 2015 ) . The goal of HSI reconstruction is to transform the measurements into desired cubic hyperspectral images . As a result , a dimensional-expansion mapping function ( 2D to 3D ) is required , for which reason such a mapping relationship approximation is deemed to be much harder than general image regression tasks . By introducing domain expertise , previous research efforts have proposed a quite number of reconstruction algorithms ( Bioucas-Dias & Figueiredo , 2007 ; Liu et al. , 2019 ; Miao et al. , 2019 ; Meng et al. , 2020b ; Wang et al. , 2020 ; 2017 ; 2019 ; Yuan , 2016 ) , among which deep neural networks ( Meng et al. , 2020b ; c ; Miao et al. , 2019 ; Wang et al. , 2019 ; Wang et al. , 2019 ; 2020 ; Zheng et al. , 2021 ) enable an effective way to faithfully bridge between input and output compositional hierarchies ( LeCun et al. , 2015 ) . 1.1 MOTIVATION . While neural networks become increasingly prevalent in solving the HSI reconstruction problem , their success is reliant on several idealistic hypotheses , which hardly holds in practical scenarios . This prohibits the further application and exploration of HSI . Proper Dataset Volume . The feasibility of learning in a universal sense can be defined by satisfying a VC generalization bound Abu-Mostafa et al . ( 2012 ) . From this perspective , deep neural networks are considered to be high potential due to their high VC bound ( which can be described as the amount of free variables ) . Notably , the corresponding feasibility of neural networks is generally determined by their model complexity and the volume of datasets . In the recent HSI reconstruction methods , more increasingly complicated reconstructive networks have been proposed by assuming the underlying dataset is sufficiently large so that the learning is feasible . This neglects the fact that there ’ s limited data accessible . Under such circumstance , simpler model might be more promising . Ideal reconstructive rate . Practically , any reconstructive algorithm appears with a substantial forward model . For temporal-insensitive situations , the inverse model processes the measurements at any reconstructive rate rrecon > 0 , without considering cooperating with the forward model . However , the reconstructive rate should be higher than ( or at least equal to ) capture rate of the forward model , i.e. , rrecon ≥ rcap > 0 , for temporal-sensitive cases , i.e. , real-time/high-speed HSI reconstruction . For example , λ-net proposed by Miao et al . ( 2019 ) can be applied in reality with rrecon > 30fps . More generally , reconstructive methods are always hypothetically deemed to be efficient enough , i.e. , compatible with any forward systems , which however probably suffers from a deviation from current technical support . Considering the arbitrariness of the lower bound rcap , we can not determine an “ ideal ” reconstructive rate but only to maximize it , i.e. , minimize the reconstructive time . For neural network-based methods , eliminating the number of parameters and computational burdens is a sound solution . Unconstrained computing power . The success of the deep neural networks can largely attribute to the overparameterization ( Soltanolkotabi et al. , 2018 ) —the parameters in neural networks are a lot more than the training samples for a good representation learning . Actually , just by investing more computing power P , the cornerstone which overparametrization is reliant upon , researchers have made great progress in diverse applications ( Thompson et al. , 2020 ) . Latent performance boost can be further expected if more computing power is available , until one reaches the computing power bottleneck P ∗ . It turns out it ’ s difficult to solve such a bottleneck in practical . For example , to conduct TSA-Net ( Meng et al. , 2020b ) for high resolution ( HR ) -HSI restoration ( 1024×1024 ) , the required GPU memory would be unrestrictedly over 18Gb , which indicates dilemma encountered by all high-performanced reconstructive methods with large model size . 1.2 CONTRIBUTIONS . In this study , bearing the limitations imposed by the scale of datasets , the capability of optical systems , and the computational platform , we posit the possibility of network construction with min- imum inductive bias , based on an observation upon the reconstructive baseline U-net . We propose a simple yet quite promising CNN reconstructive network , namely Simple Recon Net ( SRN ) , whose success is owing to revisiting and tailoring several practical techniques for HSI , i.e. , spatial/spectral invariant learning and residual learning . We summarize the contribution of this work as follows . • The proposed SRN provides a new state-of-the-art by improving the previous one ( Huang et al. , 2021 ) > 3dB in PSNR . Moreover , our approach presents clear perceptual improvement across different spectral channels ( Fig . 1 Left ) . • We significantly shrink the model size ( see Fig . 1 Right ) without sacrificing the performance , i.e. , to most extent , we only use < 1/3 parameters of GSM-based method ( Huang et al. , 2021 ) and to the maximum , reduce FLOPs by > 34times as shown in Tab . 3 , both of which yield a higher temporal efficiency and computational efficiency . This makes realtime/higher-resolution images reconstruction practically executable under restricted GPU conditions . • The proposed network can either be solely used as a baseline , or conjunctively referred to as a backbone , contributing to more complicated methods , i , e. , more sophisticated E2E methods or unrolling methods . 2 RELATED WORKS . The basic idea of SCI is to modulate the high-dimensional signal using a higher frequency than the capture rate of the camera . In this manner , a compressed coded frame obtained will include the information in the high-dimensional signal and a high-performance algorithm can then be employed to recover the desired data . For compression , the novel implementation of SCI , CASSI , uses a coded aperture and a prism to conduct the ( spatio- ) spectral modulation . Previously , iterative-based optimization algorithms predominate the field of HSI reconstruction by approximating the image priors through diverse regularization techniques , i.e. , the total variance ( TV ) ( Kittle et al. , 2010 ; Wang et al. , 2015 ; Wagadarikar et al. , 2008 ) , sparsity ( Wang et al. , 2017 ; 2015 ) , non-local similarity ( NLS ) ( Wang et al. , 2016 ; Fu et al. , 2016 ) , Markov Random Field ( MRF ) ( Tappen , 2007 ) , Gaussian mixture model ( Yang et al. , 2015 ) etc , among which DeSCI ( Liu et al. , 2019 ) achieves best performance on both video and spectral compressive imaging . TwIST ( Bioucas-Dias & Figueiredo , 2007 ) proposed a two-step Iterative shrinkage/thresholding algorithm by modeling the reconstructive problem as a a linear observation model with a nonquadratic regularizer ( i.e. , total variation ) . GPSR ( M. A. T. Figueiredo et al. , 2007 ) proposes to use gradient projection ( GP ) algorithms to solve the inverse problem that is formulated as bound-constrained quadratic programming ( BCQP ) process . Inspired by the success of deep learning in other image translation problems , researchers have started using deep learning to reconstruct hyperspectral images from CASSI measurements ( Meng et al. , 2020b ; c ; Miao et al. , 2019 ; Wang et al. , 2019 ; Wang et al. , 2019 ; 2020 ; Zheng et al. , 2021 ) , which can be substantially divided into two streams : end-to-end neural networks ( E2E-NN ) models and others . The former stream tends to directly learn a complete mapping function from measurements ( always packaged with masks ) to estimated HSIs . Other researchers turns to introduce NN models into conventional optimization algorithms , named deep unrolling/unfolding nad plug-and-play methods , leading to lightweight and interpretable methods . Proposed in Ronneberger et al . ( 2015 ) , U-Net sat atop leaderboards regarding medical image tracking and segmentation , followed by which many variants have been derived in recent years , i.e. , 3D U-Net ( Çiçek et al. , 2016 ) , Ternaus U-Net ( Iglovikov & Shvets , 2018 ) , MultiResUNet ( Ibtehaz & Rahman , 2020 ) and Attention U-Net ( Oktay et al. , 2018 ) etc . Typical investigation correlates such a predominance with characteristics of medical images : 1 ) repeated tissue patterns and complicated gradient distribution ; 2 ) locally anomalous region and atypical noise distribution . U-Net intelligently fits the above characteristics by firstly abstracts coarse information and then focus on localization through simultaneously expansion and skip connection . As a classical network structure , U-Net serves as the first precast backbone in HSI reconstruction , among a series of famous architectures , and has been faithfully employed in both E2E and unrolling methods . For example , the λ-net ( Miao et al. , 2019 ) is a dual-stage generative model which employs a U-Net and residual learning strategy . The TSA-Net ( Meng et al. , 2020b ) which combined spatial-spectral self-attention with U-Net led to excellent results on both simulation and real data . As a deep unfolding method , GAP-net ( Meng et al. , 2020a ) utilizes 15-layer U-Net as a trained denoiser in each stage . Recent Gaussian Scale Mixture Prior-based ( GSM-based ) baseline ( Huang et al. , 2021 ) employing U-Net for two objects : a lightweight U-Net for approximating the regularization parameters , another lightweight U-Net for estimating the local-mean of GSM prior . U-Net has exemplified the rationality of uncomplicated neural network in field of HSI reconstruction , even if considering the huge difference between the medical images and hyperspectral images . Actually , as reported in Tab . 1 and Tab . 2 , U-net only achieves sub-optimal performance when solely referred to as a reconstructive baseline , which reveals both the validity and the limitations of such a generic solution . It turns out the performance of neural networks are sensitive to minor adjustments . Compared with the U-Net , it ’ s possible to construct a “ substitute network ” that enables a significant performance boost with mainstream techniques at hand .
This paper introduces a hyperspectral image reconstruction method that aims to produce an image with multiple channels from a single-shot measurement with high reconstruction quality and efficiency. This is achieved through the development of a simple reconstruction network that adopts some tricks such as spatial and spectral invariant learning and identity connection. The proposed method was tested on CAVE and KAIST datasets, and was compared with several state-of-the-art methods. The results show clear advantages of the proposed method.
SP:240edf46f5a790ea8eda9053c49797a08a4f725b
A NEW BACKBONE FOR HYPERSPECTRAL IMAGE RECONSTRUCTION
As the inverse process of snapshot compressive imaging , the hyperspectral image ( HSI ) reconstruction takes the 2D measurement as input and posteriorly retrieves the captured 3D spatial-spectral signal . Built upon several assumptions , numerous sophisticated neural networks have come to the fore in this task . Despite their prosperity under experimental settings , it ’ s still extremely challenging for existing networks to achieve high-fidelity reconstructive quality while maximizing the reconstructive efficiency ( computational efficiency and power occupation ) , which prohibits their further deployment in practical applications . In this paper , we firstly conduct a retrospective analysis on aforementioned assumptions , through which we indicate the imminent aspiration for an authentically practicaloriented network in reconstructive community . By analysing the effectiveness and limitations of the widely-used reconstructive backbone U-Net , we propose a Simple Reconstruction Network , namely SRN , just based on some popular techniques , e.g. , scale/spectral-invariant learning and identity connection . It turns out , under current conditions , such a pragmatic solution outperforms existing reconstructive methods by an obvious margin and maximize the reconstructive efficiency concretely . We hope the proposed SRN can further contribute to the cutting-edge reconstructive methods as a promising backbone , and also benefit the realistic tasks , i.e. , real-time/high-resolution HSI reconstruction , solely as a baseline . 1 INTRODUCTION . Hyperspectral imaging ( HSI ) refers to multi-channel imaging where each channel stores information at a specific spectral wavelength for a fixed real-world scene ( Plaza et al. , 2009 ) . By capturing spatial intensity in a spectral-wise manner , hyperspectral images empower richer information than traditional RGB image cubes and they have been applied in a wide range of scenarios , e.g. , object detection ( Kim et al. , 2012 ; Xu et al. , 2015 ) , remote sensing ( Borengasser et al. , 2007 ; Melgani & Bruzzone , 2004 ; Yuan et al. , 2017 ) , medical image processing ( Lu & Fei , 2014 ; Meng et al. , 2020c ) etc . HSI can be captured and measured by snapshot compressive imaging ( SCI ) systems , which tend to compress information of snapshots along the spectral axis into one single 2D measurement ( Yuan et al. , 2021 ) . The coded aperture snapshot spectral imaging ( CASSI ) system ( Wagadarikar et al. , 2008 ; Meng et al. , 2020b ) forms one mainstream research direction among existing SCI systems due to its passive modulation property ( Llull et al. , 2013 ; Wagadarikar et al. , 2008 ; 2009 ; Yuan et al. , 2015 ) . The goal of HSI reconstruction is to transform the measurements into desired cubic hyperspectral images . As a result , a dimensional-expansion mapping function ( 2D to 3D ) is required , for which reason such a mapping relationship approximation is deemed to be much harder than general image regression tasks . By introducing domain expertise , previous research efforts have proposed a quite number of reconstruction algorithms ( Bioucas-Dias & Figueiredo , 2007 ; Liu et al. , 2019 ; Miao et al. , 2019 ; Meng et al. , 2020b ; Wang et al. , 2020 ; 2017 ; 2019 ; Yuan , 2016 ) , among which deep neural networks ( Meng et al. , 2020b ; c ; Miao et al. , 2019 ; Wang et al. , 2019 ; Wang et al. , 2019 ; 2020 ; Zheng et al. , 2021 ) enable an effective way to faithfully bridge between input and output compositional hierarchies ( LeCun et al. , 2015 ) . 1.1 MOTIVATION . While neural networks become increasingly prevalent in solving the HSI reconstruction problem , their success is reliant on several idealistic hypotheses , which hardly holds in practical scenarios . This prohibits the further application and exploration of HSI . Proper Dataset Volume . The feasibility of learning in a universal sense can be defined by satisfying a VC generalization bound Abu-Mostafa et al . ( 2012 ) . From this perspective , deep neural networks are considered to be high potential due to their high VC bound ( which can be described as the amount of free variables ) . Notably , the corresponding feasibility of neural networks is generally determined by their model complexity and the volume of datasets . In the recent HSI reconstruction methods , more increasingly complicated reconstructive networks have been proposed by assuming the underlying dataset is sufficiently large so that the learning is feasible . This neglects the fact that there ’ s limited data accessible . Under such circumstance , simpler model might be more promising . Ideal reconstructive rate . Practically , any reconstructive algorithm appears with a substantial forward model . For temporal-insensitive situations , the inverse model processes the measurements at any reconstructive rate rrecon > 0 , without considering cooperating with the forward model . However , the reconstructive rate should be higher than ( or at least equal to ) capture rate of the forward model , i.e. , rrecon ≥ rcap > 0 , for temporal-sensitive cases , i.e. , real-time/high-speed HSI reconstruction . For example , λ-net proposed by Miao et al . ( 2019 ) can be applied in reality with rrecon > 30fps . More generally , reconstructive methods are always hypothetically deemed to be efficient enough , i.e. , compatible with any forward systems , which however probably suffers from a deviation from current technical support . Considering the arbitrariness of the lower bound rcap , we can not determine an “ ideal ” reconstructive rate but only to maximize it , i.e. , minimize the reconstructive time . For neural network-based methods , eliminating the number of parameters and computational burdens is a sound solution . Unconstrained computing power . The success of the deep neural networks can largely attribute to the overparameterization ( Soltanolkotabi et al. , 2018 ) —the parameters in neural networks are a lot more than the training samples for a good representation learning . Actually , just by investing more computing power P , the cornerstone which overparametrization is reliant upon , researchers have made great progress in diverse applications ( Thompson et al. , 2020 ) . Latent performance boost can be further expected if more computing power is available , until one reaches the computing power bottleneck P ∗ . It turns out it ’ s difficult to solve such a bottleneck in practical . For example , to conduct TSA-Net ( Meng et al. , 2020b ) for high resolution ( HR ) -HSI restoration ( 1024×1024 ) , the required GPU memory would be unrestrictedly over 18Gb , which indicates dilemma encountered by all high-performanced reconstructive methods with large model size . 1.2 CONTRIBUTIONS . In this study , bearing the limitations imposed by the scale of datasets , the capability of optical systems , and the computational platform , we posit the possibility of network construction with min- imum inductive bias , based on an observation upon the reconstructive baseline U-net . We propose a simple yet quite promising CNN reconstructive network , namely Simple Recon Net ( SRN ) , whose success is owing to revisiting and tailoring several practical techniques for HSI , i.e. , spatial/spectral invariant learning and residual learning . We summarize the contribution of this work as follows . • The proposed SRN provides a new state-of-the-art by improving the previous one ( Huang et al. , 2021 ) > 3dB in PSNR . Moreover , our approach presents clear perceptual improvement across different spectral channels ( Fig . 1 Left ) . • We significantly shrink the model size ( see Fig . 1 Right ) without sacrificing the performance , i.e. , to most extent , we only use < 1/3 parameters of GSM-based method ( Huang et al. , 2021 ) and to the maximum , reduce FLOPs by > 34times as shown in Tab . 3 , both of which yield a higher temporal efficiency and computational efficiency . This makes realtime/higher-resolution images reconstruction practically executable under restricted GPU conditions . • The proposed network can either be solely used as a baseline , or conjunctively referred to as a backbone , contributing to more complicated methods , i , e. , more sophisticated E2E methods or unrolling methods . 2 RELATED WORKS . The basic idea of SCI is to modulate the high-dimensional signal using a higher frequency than the capture rate of the camera . In this manner , a compressed coded frame obtained will include the information in the high-dimensional signal and a high-performance algorithm can then be employed to recover the desired data . For compression , the novel implementation of SCI , CASSI , uses a coded aperture and a prism to conduct the ( spatio- ) spectral modulation . Previously , iterative-based optimization algorithms predominate the field of HSI reconstruction by approximating the image priors through diverse regularization techniques , i.e. , the total variance ( TV ) ( Kittle et al. , 2010 ; Wang et al. , 2015 ; Wagadarikar et al. , 2008 ) , sparsity ( Wang et al. , 2017 ; 2015 ) , non-local similarity ( NLS ) ( Wang et al. , 2016 ; Fu et al. , 2016 ) , Markov Random Field ( MRF ) ( Tappen , 2007 ) , Gaussian mixture model ( Yang et al. , 2015 ) etc , among which DeSCI ( Liu et al. , 2019 ) achieves best performance on both video and spectral compressive imaging . TwIST ( Bioucas-Dias & Figueiredo , 2007 ) proposed a two-step Iterative shrinkage/thresholding algorithm by modeling the reconstructive problem as a a linear observation model with a nonquadratic regularizer ( i.e. , total variation ) . GPSR ( M. A. T. Figueiredo et al. , 2007 ) proposes to use gradient projection ( GP ) algorithms to solve the inverse problem that is formulated as bound-constrained quadratic programming ( BCQP ) process . Inspired by the success of deep learning in other image translation problems , researchers have started using deep learning to reconstruct hyperspectral images from CASSI measurements ( Meng et al. , 2020b ; c ; Miao et al. , 2019 ; Wang et al. , 2019 ; Wang et al. , 2019 ; 2020 ; Zheng et al. , 2021 ) , which can be substantially divided into two streams : end-to-end neural networks ( E2E-NN ) models and others . The former stream tends to directly learn a complete mapping function from measurements ( always packaged with masks ) to estimated HSIs . Other researchers turns to introduce NN models into conventional optimization algorithms , named deep unrolling/unfolding nad plug-and-play methods , leading to lightweight and interpretable methods . Proposed in Ronneberger et al . ( 2015 ) , U-Net sat atop leaderboards regarding medical image tracking and segmentation , followed by which many variants have been derived in recent years , i.e. , 3D U-Net ( Çiçek et al. , 2016 ) , Ternaus U-Net ( Iglovikov & Shvets , 2018 ) , MultiResUNet ( Ibtehaz & Rahman , 2020 ) and Attention U-Net ( Oktay et al. , 2018 ) etc . Typical investigation correlates such a predominance with characteristics of medical images : 1 ) repeated tissue patterns and complicated gradient distribution ; 2 ) locally anomalous region and atypical noise distribution . U-Net intelligently fits the above characteristics by firstly abstracts coarse information and then focus on localization through simultaneously expansion and skip connection . As a classical network structure , U-Net serves as the first precast backbone in HSI reconstruction , among a series of famous architectures , and has been faithfully employed in both E2E and unrolling methods . For example , the λ-net ( Miao et al. , 2019 ) is a dual-stage generative model which employs a U-Net and residual learning strategy . The TSA-Net ( Meng et al. , 2020b ) which combined spatial-spectral self-attention with U-Net led to excellent results on both simulation and real data . As a deep unfolding method , GAP-net ( Meng et al. , 2020a ) utilizes 15-layer U-Net as a trained denoiser in each stage . Recent Gaussian Scale Mixture Prior-based ( GSM-based ) baseline ( Huang et al. , 2021 ) employing U-Net for two objects : a lightweight U-Net for approximating the regularization parameters , another lightweight U-Net for estimating the local-mean of GSM prior . U-Net has exemplified the rationality of uncomplicated neural network in field of HSI reconstruction , even if considering the huge difference between the medical images and hyperspectral images . Actually , as reported in Tab . 1 and Tab . 2 , U-net only achieves sub-optimal performance when solely referred to as a reconstructive baseline , which reveals both the validity and the limitations of such a generic solution . It turns out the performance of neural networks are sensitive to minor adjustments . Compared with the U-Net , it ’ s possible to construct a “ substitute network ” that enables a significant performance boost with mainstream techniques at hand .
This work proposes a novel backbone network for hyperspectral image reconstruction for snapshot compressive imaging (CASSI). The key structure of the proposed method is illustrated in Figure 3, essentially using skip connections between Conv-ReLU-Conv blocks repeatedly. A number of techniques such as downsampling, upsampling, pixelshuffling were employed to maximize efficiency. The proposed method achieved SOTA performance in the given CASSI reconstruction tasks over recent works with small network size and fast computation.
SP:240edf46f5a790ea8eda9053c49797a08a4f725b
PDQN - A Deep Reinforcement Learning Method for Planning with Long Delays: Optimization of Manufacturing Dispatching
1 INTRODUCTION . This paper proposes a method based on Deep Reinforcement Learning for automated production scheduling in semiconductor manufacturing systems . In such systems , scheduling decisions must be made for processing operations . These systems involve machines that each perform operations to process a variety of different semiconductor devices . Each type of device requires a specific set of operations to be performed which varies depending on the type of device . These systems also include re-entrant connections , and the machines may be subject to machine failures , in which machines break down during processing and need to be repaired before resuming operations . In the industry , static dispatching policies such as Critical Ratio ( CR ) or First-In-First-Out ( FIFO ) are often used , together with manual adjustments at failing machines . Obtaining efficient scheduling and dispatch policies at every machine , especially in a system with machine failures , is a challenging and complex task . There are multiple key productivity indicators that are considered in manufacturing systems . Included in these are throughput , cycle time , and lateness with respect to due dates . Optimizing weighted combinations of these productivity indicators is a challenging task . In this paper we introduce a novel Reinforcement Learning algorithm for planning in such environments . Due to the complexity of the issue , in this paper we focus specifically on the task of reducing lateness with respect to due dates . It should be noted that this objective function , in itself , and in isolation , is a measure that manufacturing system researchers have studied for decades , with less than desired success . In each factory system modeled in this paper , there is a set of machines that are used to process boxes of semiconductor devices on sheets of silicon wafers . These boxes are referred to as parts . At each point in time that a machine becomes available , a dynamic scheduling decision ( dispatching decision ) must be made as to what that machine should do next . In this paper , this decision is modeled as a choice of which part to process next from the queue at that machine group . Here , this process is modeled as a Markov Decision Process ( MDP ) . An MDP includes a state , action , and reward where the state is the information describing the system , the action is a choice of which decision to make , and the reward is a signal returned after an action is taken which indicates the quality of that action . In the factory systems being modeled , the semiconductor devices produced are hard drive head chips which are used to read from and write to hard drives . There is a range of different head types produced in the facility . In our experiments , we simulate the first 20 processing steps for each head type to model the front of line in the facility . In recent years Deep Reinforcement Learning ( RL ) techniques have been demonstrated to show remarkable performance in a number of previously challenging domains such as complex games ( Mnih et al. , 2015 ; Silver et al. , 2016a ; b ; Berner et al. , 2019 ; Vinyals et al. , 2019 ; Schrittwieser et al. , 2020 ) . In addition , some work has been done in applying such techniques to manufacturing systems , e.g . Waschneck et al . ( 2018 ) . One of the main difficulties in this domain is delayed rewards with particularly long delays ; other domains with this feature include medical interventions in healthcare . Consequently , our focus in this paper is to develop a planning method that can account for extra long delays in rewards , together with highly stochastic dynamics . So , this paper presents the Predictron Deep Q-Network ( PDQN ) , a novel Deep RL technique that combines the Deep Q-Network ( DQN ) ( Mnih et al. , 2015 ) and predictron ( Silver et al. , 2017 ) methods to learn a policy for dispatching of parts in a simulated system modeled after a semiconductor manufacturing facility . The DQN is a model-free RL optimization algorithm that trains through experience to estimate Q-values which can be used to form a policy . The predictron is a model-based policy evaluation algorithm that can be rolled forward multiple ” imagined ” planning steps to predict future rewards and values . The PDQN uses the predictron as a trained background planning model to generate value estimates for use in fine-tuning a pre-trained DQN . By doing this , it is possible to incorporate background planning as part of the training process . This combination helps the algorithm account for the highly delayed rewards encountered in these factory systems . Inspiration for this setup comes in part from Dyna ( Sutton , 1990 ) in which a model is used to train a policy , the main difference is that the PDQN uses an abstract model to perform its planning . The PDQN is also closely related to methods such as Value Prediction Network ( VPN ) ( Oh et al. , 2017 ) and MuZero ( Schrittwieser et al. , 2020 ) , but is different from these papers and approaches by using background planning instead of decision time planning and by using an arbitrary number of steps in between each abstract state representation . Background planning has recently been shown to be the largest contributor to policy improvement when using planning in model-based RL ( Hamrick et al. , 2021 ) . We compare the PDQN with both DQN and two standard factory dispatching policies , CR and FIFO . 2 RELATED WORK . 2.1 DEEP REINFORCEMENT LEARNING IN PRODUCTION SCHEDULING . In recent years , work has been done in applying deep reinforcement learning to production scheduling tasks ( Cadavid et al. , 2019 ) . Stricker et al . ( 2018 ) presents a Q-learning with artificial neural network function approximation dispatching method . This method was demonstrated to outperform a First-In-First-Out on the task of maximizing utilization and minimizing lead time on a small simulated semiconductor manufacturing system . In Zhang et al . ( 2020 ) a method is similarly proposed to automatically generate priority dispatch rules using a deep reinforcement learning agent . Here , a Graph Neural Network-based scheme is used to embed the states . This work , however , only applies to job shop problems in which there are a fixed number of jobs to be completed . Therefore this approach would be inapplicable to the more realistic production scheduling problem encountered in semi-conductor manufacturing where new jobs are repeatedly being added into the system and production can continue indefinitely . In addition , the work in Zhang et al . ( 2020 ) only considers deterministic systems which don ’ t account for uncertainties such as machine failures . In Katsikopoulos & Engelbrecht ( 2003 ) an approach to addressing Markov decision processes with delays and asynchronous cost collection is considered . However that work assumes fixed or deterministic delays or stochastic delays which are independent of the state . In the systems considered in this paper the delays are dependent upon the policy so this approach may not be applicable . In Derman et al . ( 2021 ) they consider MDPs in which there are action delays such that actions are executed some number of steps after they are chosen . This is a separate issue than the one we are addressing with PDQN . In our case actions are executed immediately , the challenge in our case is that actions affect the return over many time steps . In Campbell et al . ( 2016 ) they consider the problem of applying Q-learning with stochastic time delays in the reward signal . This is again different from the issue we are addressing as in our problem . It is not that specific reward values are not received immediately it is that the effects of each action impact the return over ong horizons which makes learning and credit assignment difficult . Delayed feedback is also considered in Walsh et al . ( 2008 ) . However it is limited to fixed , constant delays , which is not applicable for our case . 2.2 DEEP Q-NETWORK . DQN Mnih et al . ( 2015 ) is a Q-learning method , which works by estimating the expected discounted future return for a given state and action pair . For DQNs this is accomplished by using a Neural Network function approximator . DQN uses mini-batch stochastic gradient descent to update the weights of the neural network based on the gradient of a loss function to minimize the expected value of the loss . For DQNs the Mean Squared Error ( MSE ) loss is used as seen in Equation 1 . L ( θ ) = E [ ( r + γmax a′ Q ( s′ , a′ ; θ̄ ) −Q ( s , a ; θ ) ) 2 ] ( 1 ) where θ represents the weight parameters of the neural network . θ̄ represents an earlier copy of θ , which is used to form a target network . The purpose of the target network is to estimate the expected value of the next state . The training is stabilized by only updating θ̄ after a number of training iterations , thereby giving the online network a stable target . An alternative to this is to use a soft update technique where the target is gradually updated towards the online network . Q-learning is considered an off-policy method , as it can train on data collected by a different policy . To get the best result , however , exploration and exploitation should be tuned according to the problem . A common solution is to use the -greedy policy on the Q-function , where is slowly decayed over time . Experienced data is stored as a set of { state , action , reward , next state } in an experience replay buffer and sampled according to some distribution , originally uniformly . 2.3 PREDICTRON . The predictron ( Silver et al. , 2017 ) is an architecture for model-based value estimation and policy evaluation . It consists of a fully abstract model which works by ” imagining ” a sequence of waypoints , each simultaneously describing an arbitrary number of steps into the future and an estimation of the value from the abstract waypoint state . It is strongly related to methods such as n-step TD-learning ( Watkins , 1989 ) and eligibility traces ( Sutton & Barto , 2018 ) . The predictron learns a representation function f which outputs the first abstract state . Furthermore , it learns K sets of functions , where each set includes a value function vk , a next abstract state function sk , a reward function for the transition to the next abstract state rk , a discount value function γk and an eligibility trace function λk . The predictron has two outputs describing the predicted returns ( preturns ) , g0 : K and gλ . Here g0 : K is the set of K preturns , with one k-preturn gk for each abstract step k , as seen in Equation 2 . The λ-preturn gλ , seen in Equation 3 , is the weighted average of the k-preturns , where the λ-weights are determined using the learned eligibility trace parameters . gk = r1 + γ1 ( r2 + γ2 ( . . .+ γk−1 ( rk + γkvk ) . . . ) ) ( 2 ) gλ = K∑ k=0 wkgk ( 3 ) where wk = ( 1− λk ) ∏k−1 j=0 λ j if k < K ∏K−1 j=0 λ j otherwise ( 4 ) The predictron is trained by minimizing the MSE loss for both g0 : K and gλ , as defined in Equations 5 and 6 . L0 : K = 1 2K K∑ k=0 ‖Ep [ g|s ] − Em [ gk|s ] ‖2 ( 5 ) Lλ = 1 2 ‖Ep [ g|s ] − Em [ gλ|s ] ‖2 ( 6 ) where Ep is the sampled sum of discounted rewards gained in the episode , and Em is the predicted value from the model . Thirdly , an optional loss is minimized , the consistency loss , improving the consistency between the k-preturns and the λ-preturn , as seen in Equation 7 . L = 1 2 K∑ k=0 ‖Em [ gλ|s ] − Em [ gk|s ] ‖2 ( 7 ) The predictron is the inspiration for both the VPN ( Oh et al. , 2017 ) and MuZero ( Schrittwieser et al. , 2020 ) , in the sense that they all use abstract state-space representations . The main difference is that VPN and MuZero also train a policy for control , whereas the predictron is purely policy evaluation . VPN and MuZero both use tree searches to conduct their planning , whereas the predictron uses an estimation of eligibility traces to different depths of its abstract version of the expected future .
The authors study a deep reinforcement learning approach to the problem of scheduling machines in a semiconductor factory. The authors' main contribution is a deep Q-learning based system that uses a predictron to estimate the value function (instead of max_a Q(s',a)). The intuition behind the domain is that there are many machine groups that can process parts. The goal is to select the order that the machines should process parts. The authors compare a double DQN to their predictron DQN (PDQN) to baselines that are currently in use: critical ratio and first-in-first-out, with the objective of minimizing lateness. They build simulators based on real data: one that is proprietary and one that they release. They find the RL systems reduce lateness by substantially (20-50%) relative to the baselines and that their PDQN performs better by around 30% compared to DQN. However, they note that the RL systems complete substantially fewer parts, as much as 15% fewer for PDQN and 25% for DQN, suggesting that lateness may not be a good reward function for this task.
SP:5cf802d45ad504d98403d2c1e21922603ab1e08b
PDQN - A Deep Reinforcement Learning Method for Planning with Long Delays: Optimization of Manufacturing Dispatching
1 INTRODUCTION . This paper proposes a method based on Deep Reinforcement Learning for automated production scheduling in semiconductor manufacturing systems . In such systems , scheduling decisions must be made for processing operations . These systems involve machines that each perform operations to process a variety of different semiconductor devices . Each type of device requires a specific set of operations to be performed which varies depending on the type of device . These systems also include re-entrant connections , and the machines may be subject to machine failures , in which machines break down during processing and need to be repaired before resuming operations . In the industry , static dispatching policies such as Critical Ratio ( CR ) or First-In-First-Out ( FIFO ) are often used , together with manual adjustments at failing machines . Obtaining efficient scheduling and dispatch policies at every machine , especially in a system with machine failures , is a challenging and complex task . There are multiple key productivity indicators that are considered in manufacturing systems . Included in these are throughput , cycle time , and lateness with respect to due dates . Optimizing weighted combinations of these productivity indicators is a challenging task . In this paper we introduce a novel Reinforcement Learning algorithm for planning in such environments . Due to the complexity of the issue , in this paper we focus specifically on the task of reducing lateness with respect to due dates . It should be noted that this objective function , in itself , and in isolation , is a measure that manufacturing system researchers have studied for decades , with less than desired success . In each factory system modeled in this paper , there is a set of machines that are used to process boxes of semiconductor devices on sheets of silicon wafers . These boxes are referred to as parts . At each point in time that a machine becomes available , a dynamic scheduling decision ( dispatching decision ) must be made as to what that machine should do next . In this paper , this decision is modeled as a choice of which part to process next from the queue at that machine group . Here , this process is modeled as a Markov Decision Process ( MDP ) . An MDP includes a state , action , and reward where the state is the information describing the system , the action is a choice of which decision to make , and the reward is a signal returned after an action is taken which indicates the quality of that action . In the factory systems being modeled , the semiconductor devices produced are hard drive head chips which are used to read from and write to hard drives . There is a range of different head types produced in the facility . In our experiments , we simulate the first 20 processing steps for each head type to model the front of line in the facility . In recent years Deep Reinforcement Learning ( RL ) techniques have been demonstrated to show remarkable performance in a number of previously challenging domains such as complex games ( Mnih et al. , 2015 ; Silver et al. , 2016a ; b ; Berner et al. , 2019 ; Vinyals et al. , 2019 ; Schrittwieser et al. , 2020 ) . In addition , some work has been done in applying such techniques to manufacturing systems , e.g . Waschneck et al . ( 2018 ) . One of the main difficulties in this domain is delayed rewards with particularly long delays ; other domains with this feature include medical interventions in healthcare . Consequently , our focus in this paper is to develop a planning method that can account for extra long delays in rewards , together with highly stochastic dynamics . So , this paper presents the Predictron Deep Q-Network ( PDQN ) , a novel Deep RL technique that combines the Deep Q-Network ( DQN ) ( Mnih et al. , 2015 ) and predictron ( Silver et al. , 2017 ) methods to learn a policy for dispatching of parts in a simulated system modeled after a semiconductor manufacturing facility . The DQN is a model-free RL optimization algorithm that trains through experience to estimate Q-values which can be used to form a policy . The predictron is a model-based policy evaluation algorithm that can be rolled forward multiple ” imagined ” planning steps to predict future rewards and values . The PDQN uses the predictron as a trained background planning model to generate value estimates for use in fine-tuning a pre-trained DQN . By doing this , it is possible to incorporate background planning as part of the training process . This combination helps the algorithm account for the highly delayed rewards encountered in these factory systems . Inspiration for this setup comes in part from Dyna ( Sutton , 1990 ) in which a model is used to train a policy , the main difference is that the PDQN uses an abstract model to perform its planning . The PDQN is also closely related to methods such as Value Prediction Network ( VPN ) ( Oh et al. , 2017 ) and MuZero ( Schrittwieser et al. , 2020 ) , but is different from these papers and approaches by using background planning instead of decision time planning and by using an arbitrary number of steps in between each abstract state representation . Background planning has recently been shown to be the largest contributor to policy improvement when using planning in model-based RL ( Hamrick et al. , 2021 ) . We compare the PDQN with both DQN and two standard factory dispatching policies , CR and FIFO . 2 RELATED WORK . 2.1 DEEP REINFORCEMENT LEARNING IN PRODUCTION SCHEDULING . In recent years , work has been done in applying deep reinforcement learning to production scheduling tasks ( Cadavid et al. , 2019 ) . Stricker et al . ( 2018 ) presents a Q-learning with artificial neural network function approximation dispatching method . This method was demonstrated to outperform a First-In-First-Out on the task of maximizing utilization and minimizing lead time on a small simulated semiconductor manufacturing system . In Zhang et al . ( 2020 ) a method is similarly proposed to automatically generate priority dispatch rules using a deep reinforcement learning agent . Here , a Graph Neural Network-based scheme is used to embed the states . This work , however , only applies to job shop problems in which there are a fixed number of jobs to be completed . Therefore this approach would be inapplicable to the more realistic production scheduling problem encountered in semi-conductor manufacturing where new jobs are repeatedly being added into the system and production can continue indefinitely . In addition , the work in Zhang et al . ( 2020 ) only considers deterministic systems which don ’ t account for uncertainties such as machine failures . In Katsikopoulos & Engelbrecht ( 2003 ) an approach to addressing Markov decision processes with delays and asynchronous cost collection is considered . However that work assumes fixed or deterministic delays or stochastic delays which are independent of the state . In the systems considered in this paper the delays are dependent upon the policy so this approach may not be applicable . In Derman et al . ( 2021 ) they consider MDPs in which there are action delays such that actions are executed some number of steps after they are chosen . This is a separate issue than the one we are addressing with PDQN . In our case actions are executed immediately , the challenge in our case is that actions affect the return over many time steps . In Campbell et al . ( 2016 ) they consider the problem of applying Q-learning with stochastic time delays in the reward signal . This is again different from the issue we are addressing as in our problem . It is not that specific reward values are not received immediately it is that the effects of each action impact the return over ong horizons which makes learning and credit assignment difficult . Delayed feedback is also considered in Walsh et al . ( 2008 ) . However it is limited to fixed , constant delays , which is not applicable for our case . 2.2 DEEP Q-NETWORK . DQN Mnih et al . ( 2015 ) is a Q-learning method , which works by estimating the expected discounted future return for a given state and action pair . For DQNs this is accomplished by using a Neural Network function approximator . DQN uses mini-batch stochastic gradient descent to update the weights of the neural network based on the gradient of a loss function to minimize the expected value of the loss . For DQNs the Mean Squared Error ( MSE ) loss is used as seen in Equation 1 . L ( θ ) = E [ ( r + γmax a′ Q ( s′ , a′ ; θ̄ ) −Q ( s , a ; θ ) ) 2 ] ( 1 ) where θ represents the weight parameters of the neural network . θ̄ represents an earlier copy of θ , which is used to form a target network . The purpose of the target network is to estimate the expected value of the next state . The training is stabilized by only updating θ̄ after a number of training iterations , thereby giving the online network a stable target . An alternative to this is to use a soft update technique where the target is gradually updated towards the online network . Q-learning is considered an off-policy method , as it can train on data collected by a different policy . To get the best result , however , exploration and exploitation should be tuned according to the problem . A common solution is to use the -greedy policy on the Q-function , where is slowly decayed over time . Experienced data is stored as a set of { state , action , reward , next state } in an experience replay buffer and sampled according to some distribution , originally uniformly . 2.3 PREDICTRON . The predictron ( Silver et al. , 2017 ) is an architecture for model-based value estimation and policy evaluation . It consists of a fully abstract model which works by ” imagining ” a sequence of waypoints , each simultaneously describing an arbitrary number of steps into the future and an estimation of the value from the abstract waypoint state . It is strongly related to methods such as n-step TD-learning ( Watkins , 1989 ) and eligibility traces ( Sutton & Barto , 2018 ) . The predictron learns a representation function f which outputs the first abstract state . Furthermore , it learns K sets of functions , where each set includes a value function vk , a next abstract state function sk , a reward function for the transition to the next abstract state rk , a discount value function γk and an eligibility trace function λk . The predictron has two outputs describing the predicted returns ( preturns ) , g0 : K and gλ . Here g0 : K is the set of K preturns , with one k-preturn gk for each abstract step k , as seen in Equation 2 . The λ-preturn gλ , seen in Equation 3 , is the weighted average of the k-preturns , where the λ-weights are determined using the learned eligibility trace parameters . gk = r1 + γ1 ( r2 + γ2 ( . . .+ γk−1 ( rk + γkvk ) . . . ) ) ( 2 ) gλ = K∑ k=0 wkgk ( 3 ) where wk = ( 1− λk ) ∏k−1 j=0 λ j if k < K ∏K−1 j=0 λ j otherwise ( 4 ) The predictron is trained by minimizing the MSE loss for both g0 : K and gλ , as defined in Equations 5 and 6 . L0 : K = 1 2K K∑ k=0 ‖Ep [ g|s ] − Em [ gk|s ] ‖2 ( 5 ) Lλ = 1 2 ‖Ep [ g|s ] − Em [ gλ|s ] ‖2 ( 6 ) where Ep is the sampled sum of discounted rewards gained in the episode , and Em is the predicted value from the model . Thirdly , an optional loss is minimized , the consistency loss , improving the consistency between the k-preturns and the λ-preturn , as seen in Equation 7 . L = 1 2 K∑ k=0 ‖Em [ gλ|s ] − Em [ gk|s ] ‖2 ( 7 ) The predictron is the inspiration for both the VPN ( Oh et al. , 2017 ) and MuZero ( Schrittwieser et al. , 2020 ) , in the sense that they all use abstract state-space representations . The main difference is that VPN and MuZero also train a policy for control , whereas the predictron is purely policy evaluation . VPN and MuZero both use tree searches to conduct their planning , whereas the predictron uses an estimation of eligibility traces to different depths of its abstract version of the expected future .
This paper finds its motivation in scheduling for semiconductor manufacturing systems. It proposes a deep RL algorithm for tackling the highly delayed feedback usually encountered in this type of dynamic system. The authors introduce an algorithm called Predictron Deep Q-Network (PDQN) that plugs a predictron architecture into the loss of the Q-network. The efficiency of PDQN is tested on two scheduling problems and challenged against 3 natural baselines, CR, FIFO, and DQN, the first two baselines being standard for scheduling.
SP:5cf802d45ad504d98403d2c1e21922603ab1e08b
PDQN - A Deep Reinforcement Learning Method for Planning with Long Delays: Optimization of Manufacturing Dispatching
1 INTRODUCTION . This paper proposes a method based on Deep Reinforcement Learning for automated production scheduling in semiconductor manufacturing systems . In such systems , scheduling decisions must be made for processing operations . These systems involve machines that each perform operations to process a variety of different semiconductor devices . Each type of device requires a specific set of operations to be performed which varies depending on the type of device . These systems also include re-entrant connections , and the machines may be subject to machine failures , in which machines break down during processing and need to be repaired before resuming operations . In the industry , static dispatching policies such as Critical Ratio ( CR ) or First-In-First-Out ( FIFO ) are often used , together with manual adjustments at failing machines . Obtaining efficient scheduling and dispatch policies at every machine , especially in a system with machine failures , is a challenging and complex task . There are multiple key productivity indicators that are considered in manufacturing systems . Included in these are throughput , cycle time , and lateness with respect to due dates . Optimizing weighted combinations of these productivity indicators is a challenging task . In this paper we introduce a novel Reinforcement Learning algorithm for planning in such environments . Due to the complexity of the issue , in this paper we focus specifically on the task of reducing lateness with respect to due dates . It should be noted that this objective function , in itself , and in isolation , is a measure that manufacturing system researchers have studied for decades , with less than desired success . In each factory system modeled in this paper , there is a set of machines that are used to process boxes of semiconductor devices on sheets of silicon wafers . These boxes are referred to as parts . At each point in time that a machine becomes available , a dynamic scheduling decision ( dispatching decision ) must be made as to what that machine should do next . In this paper , this decision is modeled as a choice of which part to process next from the queue at that machine group . Here , this process is modeled as a Markov Decision Process ( MDP ) . An MDP includes a state , action , and reward where the state is the information describing the system , the action is a choice of which decision to make , and the reward is a signal returned after an action is taken which indicates the quality of that action . In the factory systems being modeled , the semiconductor devices produced are hard drive head chips which are used to read from and write to hard drives . There is a range of different head types produced in the facility . In our experiments , we simulate the first 20 processing steps for each head type to model the front of line in the facility . In recent years Deep Reinforcement Learning ( RL ) techniques have been demonstrated to show remarkable performance in a number of previously challenging domains such as complex games ( Mnih et al. , 2015 ; Silver et al. , 2016a ; b ; Berner et al. , 2019 ; Vinyals et al. , 2019 ; Schrittwieser et al. , 2020 ) . In addition , some work has been done in applying such techniques to manufacturing systems , e.g . Waschneck et al . ( 2018 ) . One of the main difficulties in this domain is delayed rewards with particularly long delays ; other domains with this feature include medical interventions in healthcare . Consequently , our focus in this paper is to develop a planning method that can account for extra long delays in rewards , together with highly stochastic dynamics . So , this paper presents the Predictron Deep Q-Network ( PDQN ) , a novel Deep RL technique that combines the Deep Q-Network ( DQN ) ( Mnih et al. , 2015 ) and predictron ( Silver et al. , 2017 ) methods to learn a policy for dispatching of parts in a simulated system modeled after a semiconductor manufacturing facility . The DQN is a model-free RL optimization algorithm that trains through experience to estimate Q-values which can be used to form a policy . The predictron is a model-based policy evaluation algorithm that can be rolled forward multiple ” imagined ” planning steps to predict future rewards and values . The PDQN uses the predictron as a trained background planning model to generate value estimates for use in fine-tuning a pre-trained DQN . By doing this , it is possible to incorporate background planning as part of the training process . This combination helps the algorithm account for the highly delayed rewards encountered in these factory systems . Inspiration for this setup comes in part from Dyna ( Sutton , 1990 ) in which a model is used to train a policy , the main difference is that the PDQN uses an abstract model to perform its planning . The PDQN is also closely related to methods such as Value Prediction Network ( VPN ) ( Oh et al. , 2017 ) and MuZero ( Schrittwieser et al. , 2020 ) , but is different from these papers and approaches by using background planning instead of decision time planning and by using an arbitrary number of steps in between each abstract state representation . Background planning has recently been shown to be the largest contributor to policy improvement when using planning in model-based RL ( Hamrick et al. , 2021 ) . We compare the PDQN with both DQN and two standard factory dispatching policies , CR and FIFO . 2 RELATED WORK . 2.1 DEEP REINFORCEMENT LEARNING IN PRODUCTION SCHEDULING . In recent years , work has been done in applying deep reinforcement learning to production scheduling tasks ( Cadavid et al. , 2019 ) . Stricker et al . ( 2018 ) presents a Q-learning with artificial neural network function approximation dispatching method . This method was demonstrated to outperform a First-In-First-Out on the task of maximizing utilization and minimizing lead time on a small simulated semiconductor manufacturing system . In Zhang et al . ( 2020 ) a method is similarly proposed to automatically generate priority dispatch rules using a deep reinforcement learning agent . Here , a Graph Neural Network-based scheme is used to embed the states . This work , however , only applies to job shop problems in which there are a fixed number of jobs to be completed . Therefore this approach would be inapplicable to the more realistic production scheduling problem encountered in semi-conductor manufacturing where new jobs are repeatedly being added into the system and production can continue indefinitely . In addition , the work in Zhang et al . ( 2020 ) only considers deterministic systems which don ’ t account for uncertainties such as machine failures . In Katsikopoulos & Engelbrecht ( 2003 ) an approach to addressing Markov decision processes with delays and asynchronous cost collection is considered . However that work assumes fixed or deterministic delays or stochastic delays which are independent of the state . In the systems considered in this paper the delays are dependent upon the policy so this approach may not be applicable . In Derman et al . ( 2021 ) they consider MDPs in which there are action delays such that actions are executed some number of steps after they are chosen . This is a separate issue than the one we are addressing with PDQN . In our case actions are executed immediately , the challenge in our case is that actions affect the return over many time steps . In Campbell et al . ( 2016 ) they consider the problem of applying Q-learning with stochastic time delays in the reward signal . This is again different from the issue we are addressing as in our problem . It is not that specific reward values are not received immediately it is that the effects of each action impact the return over ong horizons which makes learning and credit assignment difficult . Delayed feedback is also considered in Walsh et al . ( 2008 ) . However it is limited to fixed , constant delays , which is not applicable for our case . 2.2 DEEP Q-NETWORK . DQN Mnih et al . ( 2015 ) is a Q-learning method , which works by estimating the expected discounted future return for a given state and action pair . For DQNs this is accomplished by using a Neural Network function approximator . DQN uses mini-batch stochastic gradient descent to update the weights of the neural network based on the gradient of a loss function to minimize the expected value of the loss . For DQNs the Mean Squared Error ( MSE ) loss is used as seen in Equation 1 . L ( θ ) = E [ ( r + γmax a′ Q ( s′ , a′ ; θ̄ ) −Q ( s , a ; θ ) ) 2 ] ( 1 ) where θ represents the weight parameters of the neural network . θ̄ represents an earlier copy of θ , which is used to form a target network . The purpose of the target network is to estimate the expected value of the next state . The training is stabilized by only updating θ̄ after a number of training iterations , thereby giving the online network a stable target . An alternative to this is to use a soft update technique where the target is gradually updated towards the online network . Q-learning is considered an off-policy method , as it can train on data collected by a different policy . To get the best result , however , exploration and exploitation should be tuned according to the problem . A common solution is to use the -greedy policy on the Q-function , where is slowly decayed over time . Experienced data is stored as a set of { state , action , reward , next state } in an experience replay buffer and sampled according to some distribution , originally uniformly . 2.3 PREDICTRON . The predictron ( Silver et al. , 2017 ) is an architecture for model-based value estimation and policy evaluation . It consists of a fully abstract model which works by ” imagining ” a sequence of waypoints , each simultaneously describing an arbitrary number of steps into the future and an estimation of the value from the abstract waypoint state . It is strongly related to methods such as n-step TD-learning ( Watkins , 1989 ) and eligibility traces ( Sutton & Barto , 2018 ) . The predictron learns a representation function f which outputs the first abstract state . Furthermore , it learns K sets of functions , where each set includes a value function vk , a next abstract state function sk , a reward function for the transition to the next abstract state rk , a discount value function γk and an eligibility trace function λk . The predictron has two outputs describing the predicted returns ( preturns ) , g0 : K and gλ . Here g0 : K is the set of K preturns , with one k-preturn gk for each abstract step k , as seen in Equation 2 . The λ-preturn gλ , seen in Equation 3 , is the weighted average of the k-preturns , where the λ-weights are determined using the learned eligibility trace parameters . gk = r1 + γ1 ( r2 + γ2 ( . . .+ γk−1 ( rk + γkvk ) . . . ) ) ( 2 ) gλ = K∑ k=0 wkgk ( 3 ) where wk = ( 1− λk ) ∏k−1 j=0 λ j if k < K ∏K−1 j=0 λ j otherwise ( 4 ) The predictron is trained by minimizing the MSE loss for both g0 : K and gλ , as defined in Equations 5 and 6 . L0 : K = 1 2K K∑ k=0 ‖Ep [ g|s ] − Em [ gk|s ] ‖2 ( 5 ) Lλ = 1 2 ‖Ep [ g|s ] − Em [ gλ|s ] ‖2 ( 6 ) where Ep is the sampled sum of discounted rewards gained in the episode , and Em is the predicted value from the model . Thirdly , an optional loss is minimized , the consistency loss , improving the consistency between the k-preturns and the λ-preturn , as seen in Equation 7 . L = 1 2 K∑ k=0 ‖Em [ gλ|s ] − Em [ gk|s ] ‖2 ( 7 ) The predictron is the inspiration for both the VPN ( Oh et al. , 2017 ) and MuZero ( Schrittwieser et al. , 2020 ) , in the sense that they all use abstract state-space representations . The main difference is that VPN and MuZero also train a policy for control , whereas the predictron is purely policy evaluation . VPN and MuZero both use tree searches to conduct their planning , whereas the predictron uses an estimation of eligibility traces to different depths of its abstract version of the expected future .
This paper tackles the dynamic scheduling problem in semiconductor manufacturing using an RL approach. Due to the processing actions taking different amount of time to complete, the problem has a long reward delay issue, which the paper addresses through using predictron to estimate the targets in DQN. Simulation experiments were performed on domains constructed using real-world data and against common heuristic baselines and DQN. Results show that the proposed method outperforms the baselines in terms of cumulative lateness of the parts.
SP:5cf802d45ad504d98403d2c1e21922603ab1e08b
BANANA: a Benchmark for the Assessment of Neural Architectures for Nucleic Acids
1 INTRODUCTION . Since the advent of sequencing techniques ( Sanger et al. , 1977 ) , there has been an exponentially increasing availability of data in the form of sequences of DNA , RNA , and proteins . Analysis of these sequences has marked many milestones in every field of biology , from the Human Genome Project ( Watson , 1990 ) to the engineering of vaccines for the SARS-COV-2 virus ( Chen et al. , 2020 ) , from climate-change studies ( Jansson & Hofmockel , 2020 ) to forensics ( Bianchi & Liò , 2007 ) . Due to the huge amount of data , these advances could have not been achieved without the support of bioinformatics algorithms . Many tasks in bioinformatics are traditionally solved by search algorithms , such as BLAST ( Altschul et al. , 1990 ) , which matches a sequence against a reference database containing annotated entries ( and so tasks are solved in terms of similarity ) . Databases are usually very large and search can be very slow , impacting fields in which a timely response is important , such as cancer diagnostics . Indexing strategies or heuristic searches can speed up the querying process , at the expense of a space or accuracy trade-off . The application of machine learning methods has provided a great contribution to this field , allowing to solve tasks in a computationally inexpensive way , with a greater robustness to noise , and to discover new associations ( Vinga , 2014 ; Larranaga et al. , 2006 ) . In particular , the recent development of Natural Language Processing ( NLP ) techniques has lead researchers to use advanced neural models for modeling biological sequences , such as proteins , DNA , and RNA ( Ji et al. , 2021 ; Zaheer et al. , 2020 ; Wahab et al. , 2021 ) . However , the heterogeneity in the databases where biological data are stored and the lack of a general consensus on the data processing makes it difficult to define machine learning tasks , and more in general to approach this domain without having a deep understanding of it . At the same time , there is a consensus in the NLP community that to properly evaluate a language model there is the necessity to test in on multiple tasks to measure whether it can be broadly applied . For this reason , multi-tasks benchmarks such as SUPERGLUE ( Wang et al. , 2019a ) have been developed . To meet these needs , Rao et al . ( 2019 ) have developed TAPE , a benchmark designed to rigorously evaluate the performance of learned protein embeddings through a multitude of tasks , encompassing the domains of structure prediction , evolutionary understanding , and protein engineering , which have similarities with NLP tasks such as named entity recognition and natural language classification . A different class of languages , not covered by TAPE , ranges over the DNA and RNA domains . These domains are crucial in bioinformatics because they enable researching tumors , subcellular structures and the environment . Accordingly , we present BANANA ( Benchmark for the Assessment of Neural Architectures for Nucleic Acids ) , a benchmark consisting of six classification tasks assessing language understanding performance in the DNA and RNA domains . The tasks are defined over three genomics ( human DNA , bacterial 16S gene , nematoda ITS2 gene ) and one transcriptomics ( human mRNA ) language and measure an architecture ’ s capability of performing whole-sequence classification in a variety of setups . We curate existing data providing datasets that do not impose any specific constraint regarding the approach , creating a benchmark that is versatile and easy to use even for those who do not have knowledge of the domain . Finally , we perform few experiments with advanced neural architecture , so as to provide baselines for future works . In Section 2 we describe existing benchmarks and draw similarities and differences with our work . Section 3 provides background for our domain of application and highlights the importance of our tasks , which are described in Section 4 . We evaluate our baselines in Section 5 , while Section 6 list related works for each task . Finally , Section 7 concludes . 2 NATURAL LANGUAGE UNDERSTANDING AND PREVIOUS BENCHMARKS . In the context of unstructured data , such as textual documents , their representation plays a key role in the performance of any machine learning algorithm . Indeed , representations capable of encoding information not only about the lexicon but also about the syntax and the semantics of a sentence , provide the models with additional knowledge that can be exploited in higher-level tasks . The task of learning effective representations is called Natural Language Modelling ( NLM ) , and it is typically addressed through semi-supervised tasks ( Devlin et al. , 2019 ) . Once learned , the quality of a language model can be evaluated by using it to address more advanced NLP tasks that concern the comprehension of the text , in a set of tasks that falls under the broad definition of Natural Language Understanding ( NLU ) . Our proposal draws inspiration from the GLUE benchmark ( Wang et al. , 2019b ) , a set of 9 supervised sentence understanding tasks in the English language based on existing datasets . Its authors proposed it with the purpose of stimulating the development of a more unified language model , capable of solving a range of different linguistic tasks in different domains . Their experimental results showed how models trained in multi-task learning setting outperformed models trained on a single task , and therefore the benefits of sharing knowledge across tasks . But the interest in most of these tasks has quickly decreased with the advent of advanced language models such as BERT , which was capable of easily solving most of them . Therefore , a new benchmark called SUPERGLUE ( Wang et al. , 2019a ) has been later proposed , including new supervised learning tasks that are solvable by humans but are difficult for machines . All the tasks proposed in this benchmark regard the classification of one or multiple sequences of text , and a final score is given based on the average score obtained on every single task . Similarly , our tasks regard the classification of a single sequence , and we compute a final score in a similar fashion . Another analogy between these works and our proposal concerns the fact that they are agnostic regarding the pre-train of the architectures and do not include the language modeling task as part of the benchmark . The TAPE benchmark ( Rao et al. , 2019 ) fills the need for datasets and standardized evaluation methods for machine learning techniques applied to protein sequences , and it is another source of inspiration for our work . The authors propose to use NLP techniques in the domains of proteins , presenting the self-supervised learning task of modeling the “ languages of proteins ” using a dataset containing proteins of different organisms and absolving different functions , along with 5 supervised learning tasks concerning 3 major subfields of protein sciences . All these tasks are based on existing datasets , but they are curated and formalized by Rao et al . The experimental part shows that the selfsupervised task is beneficial for all the neural models and that they can successfully address three of the five tasks . It also highlights how the performances of each model vary across the different sub-fields . Our work differs from TAPE since we address tasks that span across four different “ biological languages ” ( human DNA , human mRNA , bacterial and archaebacterial DNA , nematoda DNA ) and specifically address each of them . Instead , TAPE ’ s tasks focus on multi-lingual settings , which requires the ability to generalize over a broad spectrum of “ protein languages ” . 3 BIOLOGY BACKGROUND . The central dogma of molecular biology ( Crick , 1970 ) states that , for every living organism , the information is stored in DNA ( deoxyribonucleic acid ) , then it flows to RNA ( ribonucleic acid ) and finally to proteins , which are the building blocks of life but can not be transferred from one generation to the next . Both DNA and RNA are composed of a sugar-phosphate scaffold and nucleotides ( nt ) , which contain the genetic information . DNA is a double helix composed of two filaments in which complementary nucleotides ( A , T , C , G ) bind to each other forming base pairs ( bp ) , while RNA is a single strand of nucleotides ( A , U , C , G ) , capable of folding in different ways1 . RNA is synthesized ( transcribed ) by making a complementary copy ( using a different alphabet , but semantically a 1:1 copy ) of a region of DNA ( a gene ) , starting from the transcription start site ( TSS ) up to a termination point . In order for the copying machinery to “ select ” the proper region , some transcription factors ( TF ) must bind to DNA in a region immediately before the TSS , called the promoter of that gene . DNA is compressed into a structure called chromatin , whose folding structure plays an important role in cell differentiation : a liver cell and a neuron share the same DNA , but thanks to different chromatin profiles they appear and behave in completely different ways . These mechanisms are fundamental for life and their malfunction is linked with cancer ( Morgan & Shilatifard , 2015 ) . RNA absolves many functions inside the cell ( e.g. , gene regulation , signaling , etc . ) and it is also correlated to cancer ( Reddy , 2015 ) and infections ( Fani et al. , 2021 ) . Three main types play universal roles across every living organism : ribosomal RNA ( rRNA ) and transfer RNA ( tRNA ) are the gears in the machinery for protein synthesis , while messenger RNA ( mRNA ) constitutes the “ recipe ” for proteins . Freshly transcribed mRNA filaments migrate each to a specific position inside the cell , known as their subcellular localization ( Holt & Bullock , 2009 ) , and then ribosomes translate them to proteins . The analysis of mRNA localization may help to better understand subcellular compartments and lead to a more detailed and nuanced understanding of cellular architecture ( Martin & Ephrussi , 2009 ) . Ribosomes translate mRNA into proteins and are made of two subunits : small ( SSU ) and large ( LSU ) . The bacterial SSU is called 16S and , since it evolves with a very slow mutation rate , it can be used to reliably classify bacteria , also for the so-called “ microbial dark matter ” , those bacteria which can not be classified using traditional methods ( Kalmbach et al. , 1997 ) , and which can have an effect , for example , on health ( Shreiner et al. , 2015 ) or climate change ( Jansson & Hofmockel , 2020 ) . Eukaryotes can be classified by SSU markers ( 18S ) as well , however popular alternatives are the Internal Transcribed Spacer 2 ( ITS2 ) , a region between the SSU and the LSU which is transcribed , but then destroyed instead of being part of ribosomes , and the mitochondrial SSU ( 12S ) . Sequencing is the process of reading a sequence of DNA , RNA , or protein , starting from a sample . Genomics , transcriptomics , and proteomics are the studies of data ( DNA , RNA , and proteins , respectively ) sequenced from a single organism . When this is done on data sequenced from multiple organisms at the same time , the studies are called metagenomics , metatranscriptomics , and metaproteomics . For example , extracting all the DNA present in an environmental sample in order to determine which bacteria live in that environment is a classical example of metagenomics . Sequencing technologies are characterized by various kinds of reading errors , an important one arising during meta-omics sequencing is the production of chimera artifacts . Chimeras are digital sequences that do not exist in the real world , instead they are composed of portions of existing sequences that have been hybridized . They are produced when sequencing with highly parallel technologies is stalled while it is reading sequences that share a similar region . For example , if 1Since base pairs are complementary , from a linguistic perspective , a single DNA strand contains the entire information , so both bp , for DNA , and nt , for RNA , can be considered the “ characters ” of nucleic acids languages . AACTCTGGA and GGGTCTTTT are both stopped and resumed when reading TCT , the sequencer may mistakenly read the chimeras AACTCTTTT and GGGTCTGGA . More complex chimeras may also arise as hybrids of more than two sequences , palindromic sequences , etc . Chimeras are a serious problem in metagenomics studies , especially on 16S genes , constituting even a large portion of sequencer outputs ( Wang & Wang , 1997 ) , and can cause misclassification of a population of organisms . Moreover , detection has been a problem and some public databases have been historically plagued by chimeras mistaken for legitimate sequences ( Hugenholtz & Huber , 2003 ) .
This contribution introduces a benchmark for the evaluation of neural networks for supervised classification of DNA and RNA molecules. The benchmark consists of six datasets covering DNA and RNA as well as different learning tasks (binary classification, multiclass, hierarchical), sequence lengths and sample sizes. The authors propose baselines on each of these tasks, one based on an LSTM, the other on a recent transformer architecture.
SP:7ee418b06ee3ff93b0b004d02442cd77873271de
BANANA: a Benchmark for the Assessment of Neural Architectures for Nucleic Acids
1 INTRODUCTION . Since the advent of sequencing techniques ( Sanger et al. , 1977 ) , there has been an exponentially increasing availability of data in the form of sequences of DNA , RNA , and proteins . Analysis of these sequences has marked many milestones in every field of biology , from the Human Genome Project ( Watson , 1990 ) to the engineering of vaccines for the SARS-COV-2 virus ( Chen et al. , 2020 ) , from climate-change studies ( Jansson & Hofmockel , 2020 ) to forensics ( Bianchi & Liò , 2007 ) . Due to the huge amount of data , these advances could have not been achieved without the support of bioinformatics algorithms . Many tasks in bioinformatics are traditionally solved by search algorithms , such as BLAST ( Altschul et al. , 1990 ) , which matches a sequence against a reference database containing annotated entries ( and so tasks are solved in terms of similarity ) . Databases are usually very large and search can be very slow , impacting fields in which a timely response is important , such as cancer diagnostics . Indexing strategies or heuristic searches can speed up the querying process , at the expense of a space or accuracy trade-off . The application of machine learning methods has provided a great contribution to this field , allowing to solve tasks in a computationally inexpensive way , with a greater robustness to noise , and to discover new associations ( Vinga , 2014 ; Larranaga et al. , 2006 ) . In particular , the recent development of Natural Language Processing ( NLP ) techniques has lead researchers to use advanced neural models for modeling biological sequences , such as proteins , DNA , and RNA ( Ji et al. , 2021 ; Zaheer et al. , 2020 ; Wahab et al. , 2021 ) . However , the heterogeneity in the databases where biological data are stored and the lack of a general consensus on the data processing makes it difficult to define machine learning tasks , and more in general to approach this domain without having a deep understanding of it . At the same time , there is a consensus in the NLP community that to properly evaluate a language model there is the necessity to test in on multiple tasks to measure whether it can be broadly applied . For this reason , multi-tasks benchmarks such as SUPERGLUE ( Wang et al. , 2019a ) have been developed . To meet these needs , Rao et al . ( 2019 ) have developed TAPE , a benchmark designed to rigorously evaluate the performance of learned protein embeddings through a multitude of tasks , encompassing the domains of structure prediction , evolutionary understanding , and protein engineering , which have similarities with NLP tasks such as named entity recognition and natural language classification . A different class of languages , not covered by TAPE , ranges over the DNA and RNA domains . These domains are crucial in bioinformatics because they enable researching tumors , subcellular structures and the environment . Accordingly , we present BANANA ( Benchmark for the Assessment of Neural Architectures for Nucleic Acids ) , a benchmark consisting of six classification tasks assessing language understanding performance in the DNA and RNA domains . The tasks are defined over three genomics ( human DNA , bacterial 16S gene , nematoda ITS2 gene ) and one transcriptomics ( human mRNA ) language and measure an architecture ’ s capability of performing whole-sequence classification in a variety of setups . We curate existing data providing datasets that do not impose any specific constraint regarding the approach , creating a benchmark that is versatile and easy to use even for those who do not have knowledge of the domain . Finally , we perform few experiments with advanced neural architecture , so as to provide baselines for future works . In Section 2 we describe existing benchmarks and draw similarities and differences with our work . Section 3 provides background for our domain of application and highlights the importance of our tasks , which are described in Section 4 . We evaluate our baselines in Section 5 , while Section 6 list related works for each task . Finally , Section 7 concludes . 2 NATURAL LANGUAGE UNDERSTANDING AND PREVIOUS BENCHMARKS . In the context of unstructured data , such as textual documents , their representation plays a key role in the performance of any machine learning algorithm . Indeed , representations capable of encoding information not only about the lexicon but also about the syntax and the semantics of a sentence , provide the models with additional knowledge that can be exploited in higher-level tasks . The task of learning effective representations is called Natural Language Modelling ( NLM ) , and it is typically addressed through semi-supervised tasks ( Devlin et al. , 2019 ) . Once learned , the quality of a language model can be evaluated by using it to address more advanced NLP tasks that concern the comprehension of the text , in a set of tasks that falls under the broad definition of Natural Language Understanding ( NLU ) . Our proposal draws inspiration from the GLUE benchmark ( Wang et al. , 2019b ) , a set of 9 supervised sentence understanding tasks in the English language based on existing datasets . Its authors proposed it with the purpose of stimulating the development of a more unified language model , capable of solving a range of different linguistic tasks in different domains . Their experimental results showed how models trained in multi-task learning setting outperformed models trained on a single task , and therefore the benefits of sharing knowledge across tasks . But the interest in most of these tasks has quickly decreased with the advent of advanced language models such as BERT , which was capable of easily solving most of them . Therefore , a new benchmark called SUPERGLUE ( Wang et al. , 2019a ) has been later proposed , including new supervised learning tasks that are solvable by humans but are difficult for machines . All the tasks proposed in this benchmark regard the classification of one or multiple sequences of text , and a final score is given based on the average score obtained on every single task . Similarly , our tasks regard the classification of a single sequence , and we compute a final score in a similar fashion . Another analogy between these works and our proposal concerns the fact that they are agnostic regarding the pre-train of the architectures and do not include the language modeling task as part of the benchmark . The TAPE benchmark ( Rao et al. , 2019 ) fills the need for datasets and standardized evaluation methods for machine learning techniques applied to protein sequences , and it is another source of inspiration for our work . The authors propose to use NLP techniques in the domains of proteins , presenting the self-supervised learning task of modeling the “ languages of proteins ” using a dataset containing proteins of different organisms and absolving different functions , along with 5 supervised learning tasks concerning 3 major subfields of protein sciences . All these tasks are based on existing datasets , but they are curated and formalized by Rao et al . The experimental part shows that the selfsupervised task is beneficial for all the neural models and that they can successfully address three of the five tasks . It also highlights how the performances of each model vary across the different sub-fields . Our work differs from TAPE since we address tasks that span across four different “ biological languages ” ( human DNA , human mRNA , bacterial and archaebacterial DNA , nematoda DNA ) and specifically address each of them . Instead , TAPE ’ s tasks focus on multi-lingual settings , which requires the ability to generalize over a broad spectrum of “ protein languages ” . 3 BIOLOGY BACKGROUND . The central dogma of molecular biology ( Crick , 1970 ) states that , for every living organism , the information is stored in DNA ( deoxyribonucleic acid ) , then it flows to RNA ( ribonucleic acid ) and finally to proteins , which are the building blocks of life but can not be transferred from one generation to the next . Both DNA and RNA are composed of a sugar-phosphate scaffold and nucleotides ( nt ) , which contain the genetic information . DNA is a double helix composed of two filaments in which complementary nucleotides ( A , T , C , G ) bind to each other forming base pairs ( bp ) , while RNA is a single strand of nucleotides ( A , U , C , G ) , capable of folding in different ways1 . RNA is synthesized ( transcribed ) by making a complementary copy ( using a different alphabet , but semantically a 1:1 copy ) of a region of DNA ( a gene ) , starting from the transcription start site ( TSS ) up to a termination point . In order for the copying machinery to “ select ” the proper region , some transcription factors ( TF ) must bind to DNA in a region immediately before the TSS , called the promoter of that gene . DNA is compressed into a structure called chromatin , whose folding structure plays an important role in cell differentiation : a liver cell and a neuron share the same DNA , but thanks to different chromatin profiles they appear and behave in completely different ways . These mechanisms are fundamental for life and their malfunction is linked with cancer ( Morgan & Shilatifard , 2015 ) . RNA absolves many functions inside the cell ( e.g. , gene regulation , signaling , etc . ) and it is also correlated to cancer ( Reddy , 2015 ) and infections ( Fani et al. , 2021 ) . Three main types play universal roles across every living organism : ribosomal RNA ( rRNA ) and transfer RNA ( tRNA ) are the gears in the machinery for protein synthesis , while messenger RNA ( mRNA ) constitutes the “ recipe ” for proteins . Freshly transcribed mRNA filaments migrate each to a specific position inside the cell , known as their subcellular localization ( Holt & Bullock , 2009 ) , and then ribosomes translate them to proteins . The analysis of mRNA localization may help to better understand subcellular compartments and lead to a more detailed and nuanced understanding of cellular architecture ( Martin & Ephrussi , 2009 ) . Ribosomes translate mRNA into proteins and are made of two subunits : small ( SSU ) and large ( LSU ) . The bacterial SSU is called 16S and , since it evolves with a very slow mutation rate , it can be used to reliably classify bacteria , also for the so-called “ microbial dark matter ” , those bacteria which can not be classified using traditional methods ( Kalmbach et al. , 1997 ) , and which can have an effect , for example , on health ( Shreiner et al. , 2015 ) or climate change ( Jansson & Hofmockel , 2020 ) . Eukaryotes can be classified by SSU markers ( 18S ) as well , however popular alternatives are the Internal Transcribed Spacer 2 ( ITS2 ) , a region between the SSU and the LSU which is transcribed , but then destroyed instead of being part of ribosomes , and the mitochondrial SSU ( 12S ) . Sequencing is the process of reading a sequence of DNA , RNA , or protein , starting from a sample . Genomics , transcriptomics , and proteomics are the studies of data ( DNA , RNA , and proteins , respectively ) sequenced from a single organism . When this is done on data sequenced from multiple organisms at the same time , the studies are called metagenomics , metatranscriptomics , and metaproteomics . For example , extracting all the DNA present in an environmental sample in order to determine which bacteria live in that environment is a classical example of metagenomics . Sequencing technologies are characterized by various kinds of reading errors , an important one arising during meta-omics sequencing is the production of chimera artifacts . Chimeras are digital sequences that do not exist in the real world , instead they are composed of portions of existing sequences that have been hybridized . They are produced when sequencing with highly parallel technologies is stalled while it is reading sequences that share a similar region . For example , if 1Since base pairs are complementary , from a linguistic perspective , a single DNA strand contains the entire information , so both bp , for DNA , and nt , for RNA , can be considered the “ characters ” of nucleic acids languages . AACTCTGGA and GGGTCTTTT are both stopped and resumed when reading TCT , the sequencer may mistakenly read the chimeras AACTCTTTT and GGGTCTGGA . More complex chimeras may also arise as hybrids of more than two sequences , palindromic sequences , etc . Chimeras are a serious problem in metagenomics studies , especially on 16S genes , constituting even a large portion of sequencer outputs ( Wang & Wang , 1997 ) , and can cause misclassification of a population of organisms . Moreover , detection has been a problem and some public databases have been historically plagued by chimeras mistaken for legitimate sequences ( Hugenholtz & Huber , 2003 ) .
This paper proposes a set of 6 benchmark tasks to assess the prediction performance of different models in genomics. The motivation is that there lacks standardized datasets and evaluation methods to seamlessly compare different models across different datasets due to the heterogeneity in the databases and the pre-processing required to get it in a form that is suitable for ML analysis. Therefore the goal is to introduce a set of diverse tasks for DNA/RNA to benchmark pre-trained models, similar to what TAPE has done for proteins. There are 3 tasks for regulatory genomics, 2 tasks based on phylogeny, and 1 task based on technical biases. The authors explore a few baseline models, including a Longformer and bi-directional LSTM, either trained directly on the task, pretrained on the task and then fine tuned on the same task, or pretrained on sequences across all tasks and fine tuned on each task individually. The prediction performance was compared using a metric that the authors thought was appropriate. This paper attempts to bridge the NLP community and the comp bio community by framing numerous comp bio tasks with analogies to NLP.
SP:7ee418b06ee3ff93b0b004d02442cd77873271de
BANANA: a Benchmark for the Assessment of Neural Architectures for Nucleic Acids
1 INTRODUCTION . Since the advent of sequencing techniques ( Sanger et al. , 1977 ) , there has been an exponentially increasing availability of data in the form of sequences of DNA , RNA , and proteins . Analysis of these sequences has marked many milestones in every field of biology , from the Human Genome Project ( Watson , 1990 ) to the engineering of vaccines for the SARS-COV-2 virus ( Chen et al. , 2020 ) , from climate-change studies ( Jansson & Hofmockel , 2020 ) to forensics ( Bianchi & Liò , 2007 ) . Due to the huge amount of data , these advances could have not been achieved without the support of bioinformatics algorithms . Many tasks in bioinformatics are traditionally solved by search algorithms , such as BLAST ( Altschul et al. , 1990 ) , which matches a sequence against a reference database containing annotated entries ( and so tasks are solved in terms of similarity ) . Databases are usually very large and search can be very slow , impacting fields in which a timely response is important , such as cancer diagnostics . Indexing strategies or heuristic searches can speed up the querying process , at the expense of a space or accuracy trade-off . The application of machine learning methods has provided a great contribution to this field , allowing to solve tasks in a computationally inexpensive way , with a greater robustness to noise , and to discover new associations ( Vinga , 2014 ; Larranaga et al. , 2006 ) . In particular , the recent development of Natural Language Processing ( NLP ) techniques has lead researchers to use advanced neural models for modeling biological sequences , such as proteins , DNA , and RNA ( Ji et al. , 2021 ; Zaheer et al. , 2020 ; Wahab et al. , 2021 ) . However , the heterogeneity in the databases where biological data are stored and the lack of a general consensus on the data processing makes it difficult to define machine learning tasks , and more in general to approach this domain without having a deep understanding of it . At the same time , there is a consensus in the NLP community that to properly evaluate a language model there is the necessity to test in on multiple tasks to measure whether it can be broadly applied . For this reason , multi-tasks benchmarks such as SUPERGLUE ( Wang et al. , 2019a ) have been developed . To meet these needs , Rao et al . ( 2019 ) have developed TAPE , a benchmark designed to rigorously evaluate the performance of learned protein embeddings through a multitude of tasks , encompassing the domains of structure prediction , evolutionary understanding , and protein engineering , which have similarities with NLP tasks such as named entity recognition and natural language classification . A different class of languages , not covered by TAPE , ranges over the DNA and RNA domains . These domains are crucial in bioinformatics because they enable researching tumors , subcellular structures and the environment . Accordingly , we present BANANA ( Benchmark for the Assessment of Neural Architectures for Nucleic Acids ) , a benchmark consisting of six classification tasks assessing language understanding performance in the DNA and RNA domains . The tasks are defined over three genomics ( human DNA , bacterial 16S gene , nematoda ITS2 gene ) and one transcriptomics ( human mRNA ) language and measure an architecture ’ s capability of performing whole-sequence classification in a variety of setups . We curate existing data providing datasets that do not impose any specific constraint regarding the approach , creating a benchmark that is versatile and easy to use even for those who do not have knowledge of the domain . Finally , we perform few experiments with advanced neural architecture , so as to provide baselines for future works . In Section 2 we describe existing benchmarks and draw similarities and differences with our work . Section 3 provides background for our domain of application and highlights the importance of our tasks , which are described in Section 4 . We evaluate our baselines in Section 5 , while Section 6 list related works for each task . Finally , Section 7 concludes . 2 NATURAL LANGUAGE UNDERSTANDING AND PREVIOUS BENCHMARKS . In the context of unstructured data , such as textual documents , their representation plays a key role in the performance of any machine learning algorithm . Indeed , representations capable of encoding information not only about the lexicon but also about the syntax and the semantics of a sentence , provide the models with additional knowledge that can be exploited in higher-level tasks . The task of learning effective representations is called Natural Language Modelling ( NLM ) , and it is typically addressed through semi-supervised tasks ( Devlin et al. , 2019 ) . Once learned , the quality of a language model can be evaluated by using it to address more advanced NLP tasks that concern the comprehension of the text , in a set of tasks that falls under the broad definition of Natural Language Understanding ( NLU ) . Our proposal draws inspiration from the GLUE benchmark ( Wang et al. , 2019b ) , a set of 9 supervised sentence understanding tasks in the English language based on existing datasets . Its authors proposed it with the purpose of stimulating the development of a more unified language model , capable of solving a range of different linguistic tasks in different domains . Their experimental results showed how models trained in multi-task learning setting outperformed models trained on a single task , and therefore the benefits of sharing knowledge across tasks . But the interest in most of these tasks has quickly decreased with the advent of advanced language models such as BERT , which was capable of easily solving most of them . Therefore , a new benchmark called SUPERGLUE ( Wang et al. , 2019a ) has been later proposed , including new supervised learning tasks that are solvable by humans but are difficult for machines . All the tasks proposed in this benchmark regard the classification of one or multiple sequences of text , and a final score is given based on the average score obtained on every single task . Similarly , our tasks regard the classification of a single sequence , and we compute a final score in a similar fashion . Another analogy between these works and our proposal concerns the fact that they are agnostic regarding the pre-train of the architectures and do not include the language modeling task as part of the benchmark . The TAPE benchmark ( Rao et al. , 2019 ) fills the need for datasets and standardized evaluation methods for machine learning techniques applied to protein sequences , and it is another source of inspiration for our work . The authors propose to use NLP techniques in the domains of proteins , presenting the self-supervised learning task of modeling the “ languages of proteins ” using a dataset containing proteins of different organisms and absolving different functions , along with 5 supervised learning tasks concerning 3 major subfields of protein sciences . All these tasks are based on existing datasets , but they are curated and formalized by Rao et al . The experimental part shows that the selfsupervised task is beneficial for all the neural models and that they can successfully address three of the five tasks . It also highlights how the performances of each model vary across the different sub-fields . Our work differs from TAPE since we address tasks that span across four different “ biological languages ” ( human DNA , human mRNA , bacterial and archaebacterial DNA , nematoda DNA ) and specifically address each of them . Instead , TAPE ’ s tasks focus on multi-lingual settings , which requires the ability to generalize over a broad spectrum of “ protein languages ” . 3 BIOLOGY BACKGROUND . The central dogma of molecular biology ( Crick , 1970 ) states that , for every living organism , the information is stored in DNA ( deoxyribonucleic acid ) , then it flows to RNA ( ribonucleic acid ) and finally to proteins , which are the building blocks of life but can not be transferred from one generation to the next . Both DNA and RNA are composed of a sugar-phosphate scaffold and nucleotides ( nt ) , which contain the genetic information . DNA is a double helix composed of two filaments in which complementary nucleotides ( A , T , C , G ) bind to each other forming base pairs ( bp ) , while RNA is a single strand of nucleotides ( A , U , C , G ) , capable of folding in different ways1 . RNA is synthesized ( transcribed ) by making a complementary copy ( using a different alphabet , but semantically a 1:1 copy ) of a region of DNA ( a gene ) , starting from the transcription start site ( TSS ) up to a termination point . In order for the copying machinery to “ select ” the proper region , some transcription factors ( TF ) must bind to DNA in a region immediately before the TSS , called the promoter of that gene . DNA is compressed into a structure called chromatin , whose folding structure plays an important role in cell differentiation : a liver cell and a neuron share the same DNA , but thanks to different chromatin profiles they appear and behave in completely different ways . These mechanisms are fundamental for life and their malfunction is linked with cancer ( Morgan & Shilatifard , 2015 ) . RNA absolves many functions inside the cell ( e.g. , gene regulation , signaling , etc . ) and it is also correlated to cancer ( Reddy , 2015 ) and infections ( Fani et al. , 2021 ) . Three main types play universal roles across every living organism : ribosomal RNA ( rRNA ) and transfer RNA ( tRNA ) are the gears in the machinery for protein synthesis , while messenger RNA ( mRNA ) constitutes the “ recipe ” for proteins . Freshly transcribed mRNA filaments migrate each to a specific position inside the cell , known as their subcellular localization ( Holt & Bullock , 2009 ) , and then ribosomes translate them to proteins . The analysis of mRNA localization may help to better understand subcellular compartments and lead to a more detailed and nuanced understanding of cellular architecture ( Martin & Ephrussi , 2009 ) . Ribosomes translate mRNA into proteins and are made of two subunits : small ( SSU ) and large ( LSU ) . The bacterial SSU is called 16S and , since it evolves with a very slow mutation rate , it can be used to reliably classify bacteria , also for the so-called “ microbial dark matter ” , those bacteria which can not be classified using traditional methods ( Kalmbach et al. , 1997 ) , and which can have an effect , for example , on health ( Shreiner et al. , 2015 ) or climate change ( Jansson & Hofmockel , 2020 ) . Eukaryotes can be classified by SSU markers ( 18S ) as well , however popular alternatives are the Internal Transcribed Spacer 2 ( ITS2 ) , a region between the SSU and the LSU which is transcribed , but then destroyed instead of being part of ribosomes , and the mitochondrial SSU ( 12S ) . Sequencing is the process of reading a sequence of DNA , RNA , or protein , starting from a sample . Genomics , transcriptomics , and proteomics are the studies of data ( DNA , RNA , and proteins , respectively ) sequenced from a single organism . When this is done on data sequenced from multiple organisms at the same time , the studies are called metagenomics , metatranscriptomics , and metaproteomics . For example , extracting all the DNA present in an environmental sample in order to determine which bacteria live in that environment is a classical example of metagenomics . Sequencing technologies are characterized by various kinds of reading errors , an important one arising during meta-omics sequencing is the production of chimera artifacts . Chimeras are digital sequences that do not exist in the real world , instead they are composed of portions of existing sequences that have been hybridized . They are produced when sequencing with highly parallel technologies is stalled while it is reading sequences that share a similar region . For example , if 1Since base pairs are complementary , from a linguistic perspective , a single DNA strand contains the entire information , so both bp , for DNA , and nt , for RNA , can be considered the “ characters ” of nucleic acids languages . AACTCTGGA and GGGTCTTTT are both stopped and resumed when reading TCT , the sequencer may mistakenly read the chimeras AACTCTTTT and GGGTCTGGA . More complex chimeras may also arise as hybrids of more than two sequences , palindromic sequences , etc . Chimeras are a serious problem in metagenomics studies , especially on 16S genes , constituting even a large portion of sequencer outputs ( Wang & Wang , 1997 ) , and can cause misclassification of a population of organisms . Moreover , detection has been a problem and some public databases have been historically plagued by chimeras mistaken for legitimate sequences ( Hugenholtz & Huber , 2003 ) .
This paper presents a benchmark consisting of six classification tasks that make predictions based on DNA or RNA sequences. The benchmark is an attempt to standardize existing datasets in terms of featurization, train/val/test splits, and performance metrics. It also reduces the amount of domain expertise required to benchmark a model on these tasks. The paper provides two neural network architecture baselines as well as different pre-training strategies and finds that no single model/strategy dominates all of the tasks.
SP:7ee418b06ee3ff93b0b004d02442cd77873271de
Greedy-based Value Representation for Efficient Coordination in Multi-agent Reinforcement Learning
1 INTRODUCTION . By taking advantage of the deep learning technique , cooperative multi-agent reinforcement learning ( MARL ) shows great scalability and excellent performance on challenging tasks ( Vorotnikov et al. , 2018 ; Wu et al. , 2020 ) such as StarCraft unit micromanagement ( Foerster et al. , 2018 ) . As an efficient paradigm of cooperative MARL , centralized training with decentralized execution ( CTDE ) ( Oliehoek et al. , 2008 ; Foerster et al. , 2016 ; Lowe et al. , 2017 ) gains growing attention . A simple and effective approach to adopt CTDE in value-based cooperative MARL is linear value decomposition ( LVD ) or monotonic value decomposition ( MVD ) . However , both LVD and MVD suffer from relative overgeneralization ( Panait et al. , 2006 ; Wei et al. , 2018 ) due to the representation limitation of the joint Q value function . As a result , they can not guarantee optimal coordination . Recent works address the problem from two different perspectives . The first kind of method aims to solve the representation limitation directly through value functions with complete expressiveness capacity ( e.g. , QTRAN ( Son et al. , 2019 ) and QPLEX ( Wang et al. , 2020 ) ) . However , learning the complete expressiveness is impractical in complicated MARL tasks because the joint action space increases exponentially with the number of agents . The other kind of method tries to overcome relative overgeneralization by learning a bias ( e.g. , WQMIX ( Rashid et al. , 2020 ) and MAVEN ( Mahajan et al. , 2019 ) ) , which lacks theoretical and quantitative analysis of the problem and is only applicable in specific tasks . As a result , these methods are insufficient to guarantee optimal coordination . More discussions about related works are provided in Appendix A . Value decomposition is a popular approach to assign credit for individual agents in fully cooperative MARL tasks , where the main concern is the optimality of coordination . In a successful case of credit assignment via value decomposition , individual agents act according to their local policies and achieve the best team ’ s performance . To evaluate the value decomposition , we propose the optimal consistency , a criterion concerning the optimality of coordination . The optimal consistency can be decomposed into two conditions : Individual-Global-Max ( IGM ) and True-Global-Max ( TGM ) . In this paper , to achieve the optimal consistency efficiently , we investigate the requirements of the TGM condition and go deep into the mechanism of the value representation for LVD and MVD , where the IGM condition always holds . We first derive the expression of the joint Q value function of LVD and MVD , by which we draw some interesting conclusions . Firstly , LVD and MVD share the same expression of the joint Q value function . Secondly , the correspondence between the joint greedy action and the maximal Q true value ( i.e. , the team ’ s best performance ) depends heavily on the task-specific reward function for LVD and MVD . Thirdly , there may be multiple stable points of the joint greedy action . As a result , the joint policy may converge to different results . More importantly , in some of the stable points , the true Q value of the joint greedy action is not maximal , which is the root cause of non-optimal coordination and relative overgeneralization . To ensure the TGM condition for LVD and MVD , the stable point satisfying the TGM condition ( we call it the optimal stable point ) is required to be the unique stable point , which is the target problem to be solved in this paper . To solve the target problem , we propose the greedy-based value representation ( GVR ) . According to previous conclusions , the stable points are task-specific due to their dependency on the reward function , for which we propose the inferior target shaping ( ITS ) . ITS dynamically modifies the true Q value of inferior samples ( i.e. , the samples worse than the current greedy ) according to current greedy Q value , which is theoretically proved to stabilize the optimal point under any reward function . Besides , under ITS , the stability of a non-optimal point depends only on the probability ratio of superior samples ( i.e. , the samples better than the current greedy ) to the non-optimal sample , where the non-optimal stable points can be eliminated under a large enough ratio ( Eq.7 ) . We prove two simple ways applied by previous works ( i.e . applying weight on the superior samples ( Rashid et al. , 2020 ) and improving exploration ( Mahajan et al. , 2019 ) ) are both inapplicable to raise the ratio because the probability of superior samples decreases exponentially with the number of agents . Therefore , we further propose the superior experience replay ( SER ) , which achieves almost constant probability of superior samples by saving them in a superior buffer . SER is theoretically proved to eliminate the non-optimal stable points under ITS . We have three contributions in this work . ( 1 ) This is the first work to derive the exact expression of the joint Q value function for LVD and MVD . ( 2 ) We point out the root cause of non-optimal coordination and further propose the target problem to be solved for LVD and MVD . ( 3 ) We propose the GVR method , which is proved theoretically to ensure the optimal consistency under sufficient exploration , and our method outperforms state-of-the-art baselines in various benchmarks . 2 PRELIMINARIES . 2.1 DEC-POMDP . We model a fully cooperative multi-agent task as a decentralized partially observable Markov decision process ( Dec-POMDP ) described by a tuple G = < S , U , P , r , Z , O , n , γ > ( Guestrin et al. , 2001 ; Oliehoek & Amato , 2016 ) . s ∈ S denotes the true state of the environment . At each time step , each agent a ∈ A ≡ { 1 , 2 , · · · , n } receives a local observation za ∈ Z produced by the observation function O : S × A → Z , and then chooses an individual action ua ∈ U according to a local policy πa ( ua|τa ) : T × U → [ 0 , 1 ] , where τa ∈ T ≡ ( Z × U ) ∗ denotes the local action-observation history . The joint action of n agents u results in a shared reward r ( s , u ) and a transition to the next state s′ ∼ P ( ·|s , u ) . γ ∈ [ 0 , 1 ) is a discount factor . We denote the joint variable of group agents with bold symbols , e.g. , the joint action u ∈ U ≡ Un , the joint action-observation history τ ∈ T ≡ Tn , and the joint interactive policy ( i.e. , the policy interacts with environment to generate trajectories ) π ( u|τ ) . The true Q value of π ( ut|τt ) is denoted by Qπ ( st , ut ) = Est+1 : ∞ , ut+1 : ∞ [ Rt|st , ut ] , whereRt = ∑∞ i=0 γ irt+1 is the discounted return . The action-state value function of agent a and the group of agents are defined as utility function Ua ( ua , τa ) and joint Q value function Q ( u , τ ) respectively . The true Q value is the target of the joint Q value in training , serving as the unique external criterion of the team ’ s performance . The greedy action u∗ : = argmaxuQ ( u , τ ) is defined as the joint action with the maximal joint Q value . The optimal action uopt : = argmaxuQ ( s , u ) is defined as the joint action with the best team ’ s performance . For brevity , we sometimes omit the prefix ” joint ” for the joint variables . 2.2 OPTIMAL CONSISTENCY AND TGM CONDITION . In CTDE paradigm , agents are expected to act individually according to their local policies ( i.e. , the individual greedy actions ) while achieve the optimal coordination ( i.e. , the maximal true Q value ) . Here we define the correspondence between the individual greedy actions and the maximal true Q value as the optimal consistency . Definition 1 ( Optimal consistency ) . Given a set of utility functions { U1 ( u1 , τ1 ) ) , · · · , Un ( un , τn ) } , and the true Q value Q ( s , u ) , if the following holds { argmax u1 U1 ( u1 , τ1 ) , · · · , argmax un Un ( un , τn ) } = argmax u Q ( s , u ) ( 1 ) then we say the set of utility functions { U1 ( u1 , τ1 ) ) , · · · , Un ( un , τn ) } satisfies the optimal consistency . For simplicity , we ignore situations with non-unique optimal actions . The optimal consistency can be decomposed into two conditions : Individual-Global-Max ( IGM ) and True-Global-Max ( TGM ) . The IGM condition proposed by QTRAN ( Son et al. , 2019 ) is defined on the correspondence between individual greedy actions and the joint greedy actions ( formally , { argmaxu1 U1 ( u1 , τ1 ) , · · · , argmaxun Un ( on , τn ) } = argmaxuQ ( u , τ ) ) . To achieve the optimal consistency , the correspondence between the joint greedy action and the maximal true Q value is required , for which we define the TGM condition : Definition 2 ( TGM ) . Given a joint value function Q ( u , τ ) , and the true Q value Q ( s , u ) , if the following holds argmax u Q ( u , τ ) = argmax u Q ( s , u ) ( 2 ) then we say the joint value function Q ( u , τ ) satisfies the TGM condition . For simplicity , we ignore situations with non-unique optimal actions . 3 INVESTIGATION OF THE TGM CONDITION FOR LVD & MVD . Linear value decomposition ( LVD ) and monotonic value decomposition ( MVD ) are simple and naturally meet the IGM condition . To achieve the optimal consistency , we investigate the requirements of the TGM condition for LVD and MVD . According to Def.2 , the TGM condition is related to the joint Q value function Q ( u , τ ) . In this section , we first derive the expression of Q ( u , τ ) for LVD and MVD under −greedy visitation . The expression indicates there may be non-optimal stable points that violate the TGM condition , which is the root cause of non-optimal coordination . 3.1 EXPRESSION OF THE JOINT Q VALUE FUNCTION FOR LVD & MVD . Firstly , take two-agent linear value decomposition as an example , where the joint Q value function Q ( u1i , u 2 j , τ ) is linearly factorized into two utility functions Q ( u 1 i , u 2 j , τ ) = U1 ( u1i , τ1 ) + U2 ( u2j , τ2 ) . u1i , u 2 j ∈ { u1 , · · · , um } denote the individual actions of agent 1,2 respectively , where { u1 , · · · , um } is the discrete individual action space . Specially , we denote the individual greedy action of agent 1,2 with u1i∗ , u 2 j∗ respectively . For brevity , Q ( u 1 i , u 2 j , τ ) and Ua ( uai , τa ) are represented by Qij and Uai ( a ∈ { 1 , 2 } ) respectively . Through the derivation provided in Appendix B.1 , Qij can be represented by the true Q values as Qij = m m∑ k=1 ( Qik +Qkj ) + ( 1− ) ( Qi∗j +Qij∗ ) − 2 m2 m∑ i=1 m∑ j=1 Qij − ( 1− ) m m∑ k=1 ( Qi∗k +Qkj∗ ) − ( 1− ) 2Qi∗j∗ ( 3 ) Verification of the expression is provided in Appendix B.2 . For monotonic value decomposition , the expression is identical to Eq.3 ( the proof is provided in Appendix C ) , which indicates the coefficients and bias on utility functions do not affect the joint Q value function . For situations with more than two agents , by referring to the derivation in Appendix B.1 and C , the expression of joint Q values can also be obtained .
The paper addresses the problem of monotonic value representations for non-monotonic true values in MARL. The authors perform a theoretical analysis of the conditions under which the greedy decentralized policy coincides with the optimal joint policy and derive a novel update scheme to destabilize incorrect fix-points. They also introduce a priority replay buffer that selects transitions with optimal actions more often and thereby stabilizing learning further. The new algorithm GVR is tested on a matrix game, a predator-prey task and StarCraft II micromanagement tasks. In the latter two GVR appears to significantly outperform decentralized baselines.
SP:c7ef12221c975972c80bb99be29f26f1ed47229b
Greedy-based Value Representation for Efficient Coordination in Multi-agent Reinforcement Learning
1 INTRODUCTION . By taking advantage of the deep learning technique , cooperative multi-agent reinforcement learning ( MARL ) shows great scalability and excellent performance on challenging tasks ( Vorotnikov et al. , 2018 ; Wu et al. , 2020 ) such as StarCraft unit micromanagement ( Foerster et al. , 2018 ) . As an efficient paradigm of cooperative MARL , centralized training with decentralized execution ( CTDE ) ( Oliehoek et al. , 2008 ; Foerster et al. , 2016 ; Lowe et al. , 2017 ) gains growing attention . A simple and effective approach to adopt CTDE in value-based cooperative MARL is linear value decomposition ( LVD ) or monotonic value decomposition ( MVD ) . However , both LVD and MVD suffer from relative overgeneralization ( Panait et al. , 2006 ; Wei et al. , 2018 ) due to the representation limitation of the joint Q value function . As a result , they can not guarantee optimal coordination . Recent works address the problem from two different perspectives . The first kind of method aims to solve the representation limitation directly through value functions with complete expressiveness capacity ( e.g. , QTRAN ( Son et al. , 2019 ) and QPLEX ( Wang et al. , 2020 ) ) . However , learning the complete expressiveness is impractical in complicated MARL tasks because the joint action space increases exponentially with the number of agents . The other kind of method tries to overcome relative overgeneralization by learning a bias ( e.g. , WQMIX ( Rashid et al. , 2020 ) and MAVEN ( Mahajan et al. , 2019 ) ) , which lacks theoretical and quantitative analysis of the problem and is only applicable in specific tasks . As a result , these methods are insufficient to guarantee optimal coordination . More discussions about related works are provided in Appendix A . Value decomposition is a popular approach to assign credit for individual agents in fully cooperative MARL tasks , where the main concern is the optimality of coordination . In a successful case of credit assignment via value decomposition , individual agents act according to their local policies and achieve the best team ’ s performance . To evaluate the value decomposition , we propose the optimal consistency , a criterion concerning the optimality of coordination . The optimal consistency can be decomposed into two conditions : Individual-Global-Max ( IGM ) and True-Global-Max ( TGM ) . In this paper , to achieve the optimal consistency efficiently , we investigate the requirements of the TGM condition and go deep into the mechanism of the value representation for LVD and MVD , where the IGM condition always holds . We first derive the expression of the joint Q value function of LVD and MVD , by which we draw some interesting conclusions . Firstly , LVD and MVD share the same expression of the joint Q value function . Secondly , the correspondence between the joint greedy action and the maximal Q true value ( i.e. , the team ’ s best performance ) depends heavily on the task-specific reward function for LVD and MVD . Thirdly , there may be multiple stable points of the joint greedy action . As a result , the joint policy may converge to different results . More importantly , in some of the stable points , the true Q value of the joint greedy action is not maximal , which is the root cause of non-optimal coordination and relative overgeneralization . To ensure the TGM condition for LVD and MVD , the stable point satisfying the TGM condition ( we call it the optimal stable point ) is required to be the unique stable point , which is the target problem to be solved in this paper . To solve the target problem , we propose the greedy-based value representation ( GVR ) . According to previous conclusions , the stable points are task-specific due to their dependency on the reward function , for which we propose the inferior target shaping ( ITS ) . ITS dynamically modifies the true Q value of inferior samples ( i.e. , the samples worse than the current greedy ) according to current greedy Q value , which is theoretically proved to stabilize the optimal point under any reward function . Besides , under ITS , the stability of a non-optimal point depends only on the probability ratio of superior samples ( i.e. , the samples better than the current greedy ) to the non-optimal sample , where the non-optimal stable points can be eliminated under a large enough ratio ( Eq.7 ) . We prove two simple ways applied by previous works ( i.e . applying weight on the superior samples ( Rashid et al. , 2020 ) and improving exploration ( Mahajan et al. , 2019 ) ) are both inapplicable to raise the ratio because the probability of superior samples decreases exponentially with the number of agents . Therefore , we further propose the superior experience replay ( SER ) , which achieves almost constant probability of superior samples by saving them in a superior buffer . SER is theoretically proved to eliminate the non-optimal stable points under ITS . We have three contributions in this work . ( 1 ) This is the first work to derive the exact expression of the joint Q value function for LVD and MVD . ( 2 ) We point out the root cause of non-optimal coordination and further propose the target problem to be solved for LVD and MVD . ( 3 ) We propose the GVR method , which is proved theoretically to ensure the optimal consistency under sufficient exploration , and our method outperforms state-of-the-art baselines in various benchmarks . 2 PRELIMINARIES . 2.1 DEC-POMDP . We model a fully cooperative multi-agent task as a decentralized partially observable Markov decision process ( Dec-POMDP ) described by a tuple G = < S , U , P , r , Z , O , n , γ > ( Guestrin et al. , 2001 ; Oliehoek & Amato , 2016 ) . s ∈ S denotes the true state of the environment . At each time step , each agent a ∈ A ≡ { 1 , 2 , · · · , n } receives a local observation za ∈ Z produced by the observation function O : S × A → Z , and then chooses an individual action ua ∈ U according to a local policy πa ( ua|τa ) : T × U → [ 0 , 1 ] , where τa ∈ T ≡ ( Z × U ) ∗ denotes the local action-observation history . The joint action of n agents u results in a shared reward r ( s , u ) and a transition to the next state s′ ∼ P ( ·|s , u ) . γ ∈ [ 0 , 1 ) is a discount factor . We denote the joint variable of group agents with bold symbols , e.g. , the joint action u ∈ U ≡ Un , the joint action-observation history τ ∈ T ≡ Tn , and the joint interactive policy ( i.e. , the policy interacts with environment to generate trajectories ) π ( u|τ ) . The true Q value of π ( ut|τt ) is denoted by Qπ ( st , ut ) = Est+1 : ∞ , ut+1 : ∞ [ Rt|st , ut ] , whereRt = ∑∞ i=0 γ irt+1 is the discounted return . The action-state value function of agent a and the group of agents are defined as utility function Ua ( ua , τa ) and joint Q value function Q ( u , τ ) respectively . The true Q value is the target of the joint Q value in training , serving as the unique external criterion of the team ’ s performance . The greedy action u∗ : = argmaxuQ ( u , τ ) is defined as the joint action with the maximal joint Q value . The optimal action uopt : = argmaxuQ ( s , u ) is defined as the joint action with the best team ’ s performance . For brevity , we sometimes omit the prefix ” joint ” for the joint variables . 2.2 OPTIMAL CONSISTENCY AND TGM CONDITION . In CTDE paradigm , agents are expected to act individually according to their local policies ( i.e. , the individual greedy actions ) while achieve the optimal coordination ( i.e. , the maximal true Q value ) . Here we define the correspondence between the individual greedy actions and the maximal true Q value as the optimal consistency . Definition 1 ( Optimal consistency ) . Given a set of utility functions { U1 ( u1 , τ1 ) ) , · · · , Un ( un , τn ) } , and the true Q value Q ( s , u ) , if the following holds { argmax u1 U1 ( u1 , τ1 ) , · · · , argmax un Un ( un , τn ) } = argmax u Q ( s , u ) ( 1 ) then we say the set of utility functions { U1 ( u1 , τ1 ) ) , · · · , Un ( un , τn ) } satisfies the optimal consistency . For simplicity , we ignore situations with non-unique optimal actions . The optimal consistency can be decomposed into two conditions : Individual-Global-Max ( IGM ) and True-Global-Max ( TGM ) . The IGM condition proposed by QTRAN ( Son et al. , 2019 ) is defined on the correspondence between individual greedy actions and the joint greedy actions ( formally , { argmaxu1 U1 ( u1 , τ1 ) , · · · , argmaxun Un ( on , τn ) } = argmaxuQ ( u , τ ) ) . To achieve the optimal consistency , the correspondence between the joint greedy action and the maximal true Q value is required , for which we define the TGM condition : Definition 2 ( TGM ) . Given a joint value function Q ( u , τ ) , and the true Q value Q ( s , u ) , if the following holds argmax u Q ( u , τ ) = argmax u Q ( s , u ) ( 2 ) then we say the joint value function Q ( u , τ ) satisfies the TGM condition . For simplicity , we ignore situations with non-unique optimal actions . 3 INVESTIGATION OF THE TGM CONDITION FOR LVD & MVD . Linear value decomposition ( LVD ) and monotonic value decomposition ( MVD ) are simple and naturally meet the IGM condition . To achieve the optimal consistency , we investigate the requirements of the TGM condition for LVD and MVD . According to Def.2 , the TGM condition is related to the joint Q value function Q ( u , τ ) . In this section , we first derive the expression of Q ( u , τ ) for LVD and MVD under −greedy visitation . The expression indicates there may be non-optimal stable points that violate the TGM condition , which is the root cause of non-optimal coordination . 3.1 EXPRESSION OF THE JOINT Q VALUE FUNCTION FOR LVD & MVD . Firstly , take two-agent linear value decomposition as an example , where the joint Q value function Q ( u1i , u 2 j , τ ) is linearly factorized into two utility functions Q ( u 1 i , u 2 j , τ ) = U1 ( u1i , τ1 ) + U2 ( u2j , τ2 ) . u1i , u 2 j ∈ { u1 , · · · , um } denote the individual actions of agent 1,2 respectively , where { u1 , · · · , um } is the discrete individual action space . Specially , we denote the individual greedy action of agent 1,2 with u1i∗ , u 2 j∗ respectively . For brevity , Q ( u 1 i , u 2 j , τ ) and Ua ( uai , τa ) are represented by Qij and Uai ( a ∈ { 1 , 2 } ) respectively . Through the derivation provided in Appendix B.1 , Qij can be represented by the true Q values as Qij = m m∑ k=1 ( Qik +Qkj ) + ( 1− ) ( Qi∗j +Qij∗ ) − 2 m2 m∑ i=1 m∑ j=1 Qij − ( 1− ) m m∑ k=1 ( Qi∗k +Qkj∗ ) − ( 1− ) 2Qi∗j∗ ( 3 ) Verification of the expression is provided in Appendix B.2 . For monotonic value decomposition , the expression is identical to Eq.3 ( the proof is provided in Appendix C ) , which indicates the coefficients and bias on utility functions do not affect the joint Q value function . For situations with more than two agents , by referring to the derivation in Appendix B.1 and C , the expression of joint Q values can also be obtained .
The paper studies the problem of value decomposition, which decomposes the joint-Q function into some linear or monotonic transformations of individual factored Q functions for each of the agents. The paper identifies limitations with previous linear/monotonic forms of the decomposition, in particular that the joint greedy action (which matches the greedy joint action for these decompositions) might not match the maximum true Q value. This condition is termed "True-Global-Max", and the paper introduces two techniques (inferior target shaping, superior experience replay) to satisfy this condition and improve upon previous suggested Q-value decompositions in literature. The paper walks through a toy matrix game example, a predator-prey experiment, and the Starcraft Multi-Agent challenge environment.
SP:c7ef12221c975972c80bb99be29f26f1ed47229b
Greedy-based Value Representation for Efficient Coordination in Multi-agent Reinforcement Learning
1 INTRODUCTION . By taking advantage of the deep learning technique , cooperative multi-agent reinforcement learning ( MARL ) shows great scalability and excellent performance on challenging tasks ( Vorotnikov et al. , 2018 ; Wu et al. , 2020 ) such as StarCraft unit micromanagement ( Foerster et al. , 2018 ) . As an efficient paradigm of cooperative MARL , centralized training with decentralized execution ( CTDE ) ( Oliehoek et al. , 2008 ; Foerster et al. , 2016 ; Lowe et al. , 2017 ) gains growing attention . A simple and effective approach to adopt CTDE in value-based cooperative MARL is linear value decomposition ( LVD ) or monotonic value decomposition ( MVD ) . However , both LVD and MVD suffer from relative overgeneralization ( Panait et al. , 2006 ; Wei et al. , 2018 ) due to the representation limitation of the joint Q value function . As a result , they can not guarantee optimal coordination . Recent works address the problem from two different perspectives . The first kind of method aims to solve the representation limitation directly through value functions with complete expressiveness capacity ( e.g. , QTRAN ( Son et al. , 2019 ) and QPLEX ( Wang et al. , 2020 ) ) . However , learning the complete expressiveness is impractical in complicated MARL tasks because the joint action space increases exponentially with the number of agents . The other kind of method tries to overcome relative overgeneralization by learning a bias ( e.g. , WQMIX ( Rashid et al. , 2020 ) and MAVEN ( Mahajan et al. , 2019 ) ) , which lacks theoretical and quantitative analysis of the problem and is only applicable in specific tasks . As a result , these methods are insufficient to guarantee optimal coordination . More discussions about related works are provided in Appendix A . Value decomposition is a popular approach to assign credit for individual agents in fully cooperative MARL tasks , where the main concern is the optimality of coordination . In a successful case of credit assignment via value decomposition , individual agents act according to their local policies and achieve the best team ’ s performance . To evaluate the value decomposition , we propose the optimal consistency , a criterion concerning the optimality of coordination . The optimal consistency can be decomposed into two conditions : Individual-Global-Max ( IGM ) and True-Global-Max ( TGM ) . In this paper , to achieve the optimal consistency efficiently , we investigate the requirements of the TGM condition and go deep into the mechanism of the value representation for LVD and MVD , where the IGM condition always holds . We first derive the expression of the joint Q value function of LVD and MVD , by which we draw some interesting conclusions . Firstly , LVD and MVD share the same expression of the joint Q value function . Secondly , the correspondence between the joint greedy action and the maximal Q true value ( i.e. , the team ’ s best performance ) depends heavily on the task-specific reward function for LVD and MVD . Thirdly , there may be multiple stable points of the joint greedy action . As a result , the joint policy may converge to different results . More importantly , in some of the stable points , the true Q value of the joint greedy action is not maximal , which is the root cause of non-optimal coordination and relative overgeneralization . To ensure the TGM condition for LVD and MVD , the stable point satisfying the TGM condition ( we call it the optimal stable point ) is required to be the unique stable point , which is the target problem to be solved in this paper . To solve the target problem , we propose the greedy-based value representation ( GVR ) . According to previous conclusions , the stable points are task-specific due to their dependency on the reward function , for which we propose the inferior target shaping ( ITS ) . ITS dynamically modifies the true Q value of inferior samples ( i.e. , the samples worse than the current greedy ) according to current greedy Q value , which is theoretically proved to stabilize the optimal point under any reward function . Besides , under ITS , the stability of a non-optimal point depends only on the probability ratio of superior samples ( i.e. , the samples better than the current greedy ) to the non-optimal sample , where the non-optimal stable points can be eliminated under a large enough ratio ( Eq.7 ) . We prove two simple ways applied by previous works ( i.e . applying weight on the superior samples ( Rashid et al. , 2020 ) and improving exploration ( Mahajan et al. , 2019 ) ) are both inapplicable to raise the ratio because the probability of superior samples decreases exponentially with the number of agents . Therefore , we further propose the superior experience replay ( SER ) , which achieves almost constant probability of superior samples by saving them in a superior buffer . SER is theoretically proved to eliminate the non-optimal stable points under ITS . We have three contributions in this work . ( 1 ) This is the first work to derive the exact expression of the joint Q value function for LVD and MVD . ( 2 ) We point out the root cause of non-optimal coordination and further propose the target problem to be solved for LVD and MVD . ( 3 ) We propose the GVR method , which is proved theoretically to ensure the optimal consistency under sufficient exploration , and our method outperforms state-of-the-art baselines in various benchmarks . 2 PRELIMINARIES . 2.1 DEC-POMDP . We model a fully cooperative multi-agent task as a decentralized partially observable Markov decision process ( Dec-POMDP ) described by a tuple G = < S , U , P , r , Z , O , n , γ > ( Guestrin et al. , 2001 ; Oliehoek & Amato , 2016 ) . s ∈ S denotes the true state of the environment . At each time step , each agent a ∈ A ≡ { 1 , 2 , · · · , n } receives a local observation za ∈ Z produced by the observation function O : S × A → Z , and then chooses an individual action ua ∈ U according to a local policy πa ( ua|τa ) : T × U → [ 0 , 1 ] , where τa ∈ T ≡ ( Z × U ) ∗ denotes the local action-observation history . The joint action of n agents u results in a shared reward r ( s , u ) and a transition to the next state s′ ∼ P ( ·|s , u ) . γ ∈ [ 0 , 1 ) is a discount factor . We denote the joint variable of group agents with bold symbols , e.g. , the joint action u ∈ U ≡ Un , the joint action-observation history τ ∈ T ≡ Tn , and the joint interactive policy ( i.e. , the policy interacts with environment to generate trajectories ) π ( u|τ ) . The true Q value of π ( ut|τt ) is denoted by Qπ ( st , ut ) = Est+1 : ∞ , ut+1 : ∞ [ Rt|st , ut ] , whereRt = ∑∞ i=0 γ irt+1 is the discounted return . The action-state value function of agent a and the group of agents are defined as utility function Ua ( ua , τa ) and joint Q value function Q ( u , τ ) respectively . The true Q value is the target of the joint Q value in training , serving as the unique external criterion of the team ’ s performance . The greedy action u∗ : = argmaxuQ ( u , τ ) is defined as the joint action with the maximal joint Q value . The optimal action uopt : = argmaxuQ ( s , u ) is defined as the joint action with the best team ’ s performance . For brevity , we sometimes omit the prefix ” joint ” for the joint variables . 2.2 OPTIMAL CONSISTENCY AND TGM CONDITION . In CTDE paradigm , agents are expected to act individually according to their local policies ( i.e. , the individual greedy actions ) while achieve the optimal coordination ( i.e. , the maximal true Q value ) . Here we define the correspondence between the individual greedy actions and the maximal true Q value as the optimal consistency . Definition 1 ( Optimal consistency ) . Given a set of utility functions { U1 ( u1 , τ1 ) ) , · · · , Un ( un , τn ) } , and the true Q value Q ( s , u ) , if the following holds { argmax u1 U1 ( u1 , τ1 ) , · · · , argmax un Un ( un , τn ) } = argmax u Q ( s , u ) ( 1 ) then we say the set of utility functions { U1 ( u1 , τ1 ) ) , · · · , Un ( un , τn ) } satisfies the optimal consistency . For simplicity , we ignore situations with non-unique optimal actions . The optimal consistency can be decomposed into two conditions : Individual-Global-Max ( IGM ) and True-Global-Max ( TGM ) . The IGM condition proposed by QTRAN ( Son et al. , 2019 ) is defined on the correspondence between individual greedy actions and the joint greedy actions ( formally , { argmaxu1 U1 ( u1 , τ1 ) , · · · , argmaxun Un ( on , τn ) } = argmaxuQ ( u , τ ) ) . To achieve the optimal consistency , the correspondence between the joint greedy action and the maximal true Q value is required , for which we define the TGM condition : Definition 2 ( TGM ) . Given a joint value function Q ( u , τ ) , and the true Q value Q ( s , u ) , if the following holds argmax u Q ( u , τ ) = argmax u Q ( s , u ) ( 2 ) then we say the joint value function Q ( u , τ ) satisfies the TGM condition . For simplicity , we ignore situations with non-unique optimal actions . 3 INVESTIGATION OF THE TGM CONDITION FOR LVD & MVD . Linear value decomposition ( LVD ) and monotonic value decomposition ( MVD ) are simple and naturally meet the IGM condition . To achieve the optimal consistency , we investigate the requirements of the TGM condition for LVD and MVD . According to Def.2 , the TGM condition is related to the joint Q value function Q ( u , τ ) . In this section , we first derive the expression of Q ( u , τ ) for LVD and MVD under −greedy visitation . The expression indicates there may be non-optimal stable points that violate the TGM condition , which is the root cause of non-optimal coordination . 3.1 EXPRESSION OF THE JOINT Q VALUE FUNCTION FOR LVD & MVD . Firstly , take two-agent linear value decomposition as an example , where the joint Q value function Q ( u1i , u 2 j , τ ) is linearly factorized into two utility functions Q ( u 1 i , u 2 j , τ ) = U1 ( u1i , τ1 ) + U2 ( u2j , τ2 ) . u1i , u 2 j ∈ { u1 , · · · , um } denote the individual actions of agent 1,2 respectively , where { u1 , · · · , um } is the discrete individual action space . Specially , we denote the individual greedy action of agent 1,2 with u1i∗ , u 2 j∗ respectively . For brevity , Q ( u 1 i , u 2 j , τ ) and Ua ( uai , τa ) are represented by Qij and Uai ( a ∈ { 1 , 2 } ) respectively . Through the derivation provided in Appendix B.1 , Qij can be represented by the true Q values as Qij = m m∑ k=1 ( Qik +Qkj ) + ( 1− ) ( Qi∗j +Qij∗ ) − 2 m2 m∑ i=1 m∑ j=1 Qij − ( 1− ) m m∑ k=1 ( Qi∗k +Qkj∗ ) − ( 1− ) 2Qi∗j∗ ( 3 ) Verification of the expression is provided in Appendix B.2 . For monotonic value decomposition , the expression is identical to Eq.3 ( the proof is provided in Appendix C ) , which indicates the coefficients and bias on utility functions do not affect the joint Q value function . For situations with more than two agents , by referring to the derivation in Appendix B.1 and C , the expression of joint Q values can also be obtained .
This paper aims to improve value-factorization in cooperative multi-agent reinforcement learning settings under centralized training and decentralized execution (CTDE) framework. The proposed method (GVR) attempts to ensure both Individual-Global-Max(IGM) and True-Global-Max(TGM) conditions without learning a completely expressive (CEC) value function (which can represent all joint- actions). IGM ensures the consistency between joint action selection and local greedy action selection (Individual-Global-Max, IGM), and TGM ensures that the joint-action value function correctly represents optimal values. The GVR method proposed by the authors claims to ensure both IGM and TGM conditions without CEC. The main contribution is greedy-value based representation (GVR) which consists of two parts. First, Inferior Target Sampling (ITS) ensures that the greedy joint action is stable such that if the greedy action corresponds to the optimal joint action, then for other joint actions, the gradient will be negative, thereby selectively focusing on representing the unique optimal joint action. If the greedy action does not correspond to the unique optimal joint action, then higher exploration is required in order to destabilize it. However, the lower bound for exploration can become quite high (close to 1) with increasing agents/joint action space, therefore the authors propose a prioritized experience replay buffer. The prioritized buffer assigns higher priority to non-greedy actions which have higher values than a state-based critic. Experimental results on matrix game, predator-prey and hard/super-hard maps from Starcraft II benchmark show improvements over baseline methods.
SP:c7ef12221c975972c80bb99be29f26f1ed47229b
Monotone deep Boltzmann machines
1 INTRODUCTION . This paper considers ( deep ) Boltzmann machines , which are pairwise energy-based probabilistic models . Theses models specify a joint distribution over variables x given by the density p ( x ) ∝ exp ∑ ( i , j ) ∈E x⊤i Φijxj + n∑ i=1 b⊤i xi , ( 1 ) where each x1 : n denotes a discrete random variable over ki possible values , represented as a onehot encoding xi ∈ { 0 , 1 } ki ; E denotes the set of edges in the model ; Φi , j ∈ Rki×kj represents pairwise potential ; and bi ∈ Rki represents unary potential . Depending on context , these models are typically referred to as pairwise Markov random fields ( MRFs ) ( Koller & Friedman , 2009 ) , or ( potentially deep ) Boltzmann machines ( Goodfellow et al. , 2016 ; Salakhutdinov & Hinton , 2009 ; Hinton , 2002 ) . In the above setting each xi may represent an observed or unobserved value , and there can be substantial structure within the variables ; for instance , the collection of variables x may ( and indeed will , in the main settings we consider in this paper ) consist of several different “ layers ” in a joint convolutional structure , leading to the deep convolutional Boltzmann machine ( Norouzi et al. , 2009 ) . In this paper , we propose a new parameterization and algorithmic approach to approximate inference of these probabilistic models . There are two main contributions : First , we define a generic parameterization of the pairwise kernel function Φ , that can represent a general Boltzmann machine . Our parametrization is flexible enough to incorporate almost all operators and network topology , including fully-connected layers , convolution operators , and skip-connections , etc . Through the lens of the recently developed monotone DEQ ( Winston & Kolter , 2020 ) , we constraint Φ to satisfy certain monotonicity conditions through training and inference ; this thereby assures that the mean-field approximation will always have a unique , globally-optimal fixed point under this parameterization . Second , although previous works ( Krähenbühl & Koltun , 2013 ; Baqué et al. , 2016 ) have made approaches to parallel mean-field updates , they either require strong conditions on ϕ , or fail to converge to the true mean-field distribution . We provide a properly-damped mean-field update method , based upon a generic proximal operator , which is guaranteed to converge to the mean-field fixed point , even if applied in parallel to all random variables simultaneously . Although there is no exact closed form solution of this proximal operator , we derive a very efficient Newton-based implementation . To estimate the parameters of our model , we follow the marginal-based loss minimization approach in Krähenbühl & Koltun ( 2013 ) ; Domke ( 2013 ) , where the objective is to directly maximize the likelihood induced by the approximated mean-field distribution . Such an approach grants us the ability to update parameters via taking gradient steps of the proposed mean-field iterations . With the proposed approaches , we perform both learning and inference for a deep convolutional , multi-resolution Boltzmann machine , and apply the network to model MNIST and CIFAR-10 pixels and their classes conditioned on partially observed images . Such joint probabilistic modelling allows us to simultaneously impute missing pixels and predict the class . While these are naturally a smallscale problem , we emphasize that performing joint probabilistic inference over a complete model of this type is a relatively high-dimensional task as far as traditional mean-field inference is concerned . We also compare our inference method to previous ones and demonstrate different convergence properties of each . We conclude by highlighting limitations and directions for future work with the method . 2 BACKGROUND AND RELATED WORK . This paper builds upon three main avenues of work : 1 ) deep equilibrium models , especially their convergent version , the monotone DEQ ; 2 ) the broad topic of energy-based deep model and Boltzmann machines in particular ; and 3 ) work on concave potentials and parallel methods for mean-field inference . We discuss each of these below . Equilibrium models and their provable convergence The DEQ model was first proposed by Bai et al . ( 2019 ) . Based on the observation that a neural network zt+1 = σ ( Wzt + Ux+ b ) with input injection x usually converges to a fixed point , they modeled an effectively infinite-depth network with input injection directly via its fixed point : z∗ = σ ( Wz∗ + Ux + b ) . Its backpropagation is done through the implicit function theorem and only requires constant memory . Bai et al . ( 2020 ) also showed that the multiscale DEQ models achieve near state-of-the-art performances on many large-scale tasks . Winston & Kolter ( 2020 ) later presented a parametrization of the DEQ ( denoted as monDEQ ) that guarantees provable convergence to a unique fixed point , using monotone operator theory . Specifically , they parameterize W in a way that I − W ⪰ mI ( called m-strongly monotone ) is always satisfied during training for some m > 0 ; they convert nonlinearities into proximal operators ( which include ReLU , tanh , etc . ) , and show that using existing splitting methods like forward-backward and Peaceman-Rachford can provably find the unique fixed point . Markov random field ( MRF ) and its variants MRF is a form of energy-based model , which model joint probabilities of the form pθ ( x ) = exp ( −Eθ ( x ) ) /Zθ for an energy function Eθ . A common type of MRF is the Boltzmann machine , the most successful variant of which is the restricted Boltzmann machines ( RBM ) ( Hinton , 2002 ) and its deep ( multi-layer ) variant ( Salakhutdinov & Hinton , 2009 ) . Particularly , RBMs define Eθ ( v , h ) = −a⊤v− b⊤h− v⊤Wh , where θ = { W , a , b } , v is the set of visible variables , and h is the set of latent variables . It is usually trained using the contrastive-divergence algorithm , and its inference can be done efficiently by a block mean-field approximation . However , a particular restriction of RBMs is that there can be no intra-layer connections , that is , each variable in v ( resp . h ) is independent conditioned on h ( resp . v ) . A deep RBM allows different layers of hidden nodes , but there can not be intra-layer connections . By contrast , our formulation allows intra-layer connections and is therefore is more expressive in this respect . See fig . 1 for the network topology of RBM , deep RBM , and general BM ( we also use the term general deep BM interchangeably to emphasize the existence of deep structure ) . Wu et al . ( 2016 ) proposed a deep parameterization of MRF , but their setting only considers a grid of hidden variables h and the connections among hidden units are restricted to the neighboring nodes . Therefore , it is a special case of our parameterization ( although their learning algorithm is orthogonal to ours ) . Numerous works also try to combine deep neural networks with conditional random fields ( CRF ) ( Krähenbühl & Koltun , 2013 ; Zheng et al. , 2015 ; Schwartz et al. , 2017 ) These models either train a pre-determined kernel as an RNN or use neural networks for producing either inputs or parameters of their CRFs . Parallel and convergent mean-field It is well-known that mean-field updates converge locally using a coordinate ascent algorithm ( Blei et al. , 2017 ) . However , local convergence is only guaranteed if the update is applied sequentially . Nonetheless , several works have proposed techniques to parallelize updates . Krähenbühl & Koltun ( 2013 ) proposed a concave-convex procedure ( CCCP ) to minimize the KL divergence between the true distribution and the mean-field variational family . To achieve efficient inference , they use a concave approximation to the pairwise kernel , and their fast update rule only converges if the kernel function is concave . Later , Baqué et al . ( 2016 ) derived a similar parallel damped forward iteration to ours that provably converges without the concave potential constraint . However , unlike our approach , they do not use a parameterization which ensures a global mean-field optimum , and their algorithm therefore may not converge to the actual fixed point of the mean-field updates . This is because Baqué et al . ( 2016 ) used the prox1f proximal operator ( described below ) , whereas we derive the proxαf operator to guarantee global convergence when doing mean-field updates in parallel . What ’ s more , Baqué et al . ( 2016 ) focused only on inference over prescribed potentials , and not on training the ( fully parameterized ) potentials as we do here . Lê-Huu & Alahari ( 2021 ) brought up a generalized Frank-Wolfe based framework for mean-field updates which include the methods proposed by Baqué et al . ( 2016 ) ; Krähenbühl & Koltun ( 2013 ) . Their results only guarantee global convergence to a local optimal . 3 MONOTONE DEEP BOLTZMANN MACHINES AND APPROXIMATE INFERENCE . In this section , we present the main technical contributions of this work . We begin by presenting a parameterization of the pairwise potential in a Boltzmann machine that guarantees the monotonicity condition . We then illustrate the connection between a ( joint ) mean-field inference fixed point and the fixed point of our monotone Boltzmann machine and discuss how deep structured networks can be implemented in this form practically ; this establishes that , under the monotonicity conditions on Φ , there exists a unique globally-optimal mean-field fixed point . Finally , we present an efficient parallel method for computing this mean-field fixed point , again motivated by the machinery of monotone DEQs and operator splitting methods . 3.1 A MONOTONE PARAMETERIZATION OF GENERAL BOLTZMANN MACHINES . In this section , we show how to parameterize our probabilistic model in a way that the pairwise potentials satisfy I − Φ ⪰ mI , which will be used later to show the existence of a unique meanfield fixed point . Additionally , since Φ defines a graphical model that has no self-loop , we further require Φ to be a block hollow matrix ( that is , the ki × ki diagonal blocks corresponding to each variable must be zero ) . While both these conditions on Φ are convex constraints , in practice it would be extremely difficult to project a generic set of weights onto this constraint set under an ordinary parameterization of the network . Thus , we instead advocate for a non-convex parameterization of the network weights , but one which guarantees that the monotonicity condition is always satisfied , without any constraint on the weights in the parameterization . Specifically , define the block matrix A = [ A1 A2 · · · An ] ( 2 ) with Ai ∈ Rd×ki matrices for each variables , and where d can be some arbitrarily chosen dimension . Then let Âi be a spectrally-normalized version of Ai Âi = Ai ·min { √ 1−m/∥Ai∥2 , 1 } ( 3 ) i.e. , a version of Ai normalized such that its largest singular value is at most √ 1−m ( note that we can compute the spectral norm of Ai as ∥Ai∥2 = ∥ATi Ai∥ 1/2 2 , which involves computing the singular values of only a ki × ki matrix , and thus is very fast in practice ) . We define the  matrix analogously as the block version of these normalized matrices . Then we propose to parameterize Φ as Φ = blkdiag ( ÂT  ) − ÂT  ( 4 ) where blkdiag denotes the block-diagonal portion of the matrix along the ki×ki block . Put another way , this parameterizes Φ as Φij = { −ÂTi Âj if i ̸= j , 0 if i = j . ( 5 ) As the following simple theorem shows , this parameterization guarantees both hollowness of the Φ matrix and monotonicity of I −Φ , for any value of the A matrix . Theorem 3.1 . For any choice of parameters A , under the parametrization equation 4 above , we have that 1 ) Φii = 0 for all i = 1 , . . . , n , and 2 ) I −Φ ⪰ mI . Proof . Block hollowness of the matrix follows immediately from construction . To establish monotonicity , note that I −Φ ⪰ mI ⇐⇒ I + ÂT Â− blkdiag ( ÂT  ) ⪰ mI ⇐= I − blkdiag ( ÂT  ) ⪰ mI ⇐⇒ I − ÂTi Âi ⪰ mI , ∀i ⇐⇒ ∥Âi∥2 ≤ √ 1−m , ∀i . ( 6 ) This last property always holds by the construction of Âi .
This paper proposes a class of model called monotone deep Boltzmann machines, where the underlying potentials are parameterized (e.g., by CNNs) such that they obey some monotonicity constraint. This constraint ensures that the inference problem has a global optimum, which can be found using some generalized variant of parallel mean field. The method is inspired from monotone DEQ, previously proposed by Winston & Kolter (2020). Experiments on a joint task of image denoising and classification show that the proposed method can effectively model complex data distributions such as images.
SP:5d6b2f3781f71ad8468e17607662fa1702ae2125
Monotone deep Boltzmann machines
1 INTRODUCTION . This paper considers ( deep ) Boltzmann machines , which are pairwise energy-based probabilistic models . Theses models specify a joint distribution over variables x given by the density p ( x ) ∝ exp ∑ ( i , j ) ∈E x⊤i Φijxj + n∑ i=1 b⊤i xi , ( 1 ) where each x1 : n denotes a discrete random variable over ki possible values , represented as a onehot encoding xi ∈ { 0 , 1 } ki ; E denotes the set of edges in the model ; Φi , j ∈ Rki×kj represents pairwise potential ; and bi ∈ Rki represents unary potential . Depending on context , these models are typically referred to as pairwise Markov random fields ( MRFs ) ( Koller & Friedman , 2009 ) , or ( potentially deep ) Boltzmann machines ( Goodfellow et al. , 2016 ; Salakhutdinov & Hinton , 2009 ; Hinton , 2002 ) . In the above setting each xi may represent an observed or unobserved value , and there can be substantial structure within the variables ; for instance , the collection of variables x may ( and indeed will , in the main settings we consider in this paper ) consist of several different “ layers ” in a joint convolutional structure , leading to the deep convolutional Boltzmann machine ( Norouzi et al. , 2009 ) . In this paper , we propose a new parameterization and algorithmic approach to approximate inference of these probabilistic models . There are two main contributions : First , we define a generic parameterization of the pairwise kernel function Φ , that can represent a general Boltzmann machine . Our parametrization is flexible enough to incorporate almost all operators and network topology , including fully-connected layers , convolution operators , and skip-connections , etc . Through the lens of the recently developed monotone DEQ ( Winston & Kolter , 2020 ) , we constraint Φ to satisfy certain monotonicity conditions through training and inference ; this thereby assures that the mean-field approximation will always have a unique , globally-optimal fixed point under this parameterization . Second , although previous works ( Krähenbühl & Koltun , 2013 ; Baqué et al. , 2016 ) have made approaches to parallel mean-field updates , they either require strong conditions on ϕ , or fail to converge to the true mean-field distribution . We provide a properly-damped mean-field update method , based upon a generic proximal operator , which is guaranteed to converge to the mean-field fixed point , even if applied in parallel to all random variables simultaneously . Although there is no exact closed form solution of this proximal operator , we derive a very efficient Newton-based implementation . To estimate the parameters of our model , we follow the marginal-based loss minimization approach in Krähenbühl & Koltun ( 2013 ) ; Domke ( 2013 ) , where the objective is to directly maximize the likelihood induced by the approximated mean-field distribution . Such an approach grants us the ability to update parameters via taking gradient steps of the proposed mean-field iterations . With the proposed approaches , we perform both learning and inference for a deep convolutional , multi-resolution Boltzmann machine , and apply the network to model MNIST and CIFAR-10 pixels and their classes conditioned on partially observed images . Such joint probabilistic modelling allows us to simultaneously impute missing pixels and predict the class . While these are naturally a smallscale problem , we emphasize that performing joint probabilistic inference over a complete model of this type is a relatively high-dimensional task as far as traditional mean-field inference is concerned . We also compare our inference method to previous ones and demonstrate different convergence properties of each . We conclude by highlighting limitations and directions for future work with the method . 2 BACKGROUND AND RELATED WORK . This paper builds upon three main avenues of work : 1 ) deep equilibrium models , especially their convergent version , the monotone DEQ ; 2 ) the broad topic of energy-based deep model and Boltzmann machines in particular ; and 3 ) work on concave potentials and parallel methods for mean-field inference . We discuss each of these below . Equilibrium models and their provable convergence The DEQ model was first proposed by Bai et al . ( 2019 ) . Based on the observation that a neural network zt+1 = σ ( Wzt + Ux+ b ) with input injection x usually converges to a fixed point , they modeled an effectively infinite-depth network with input injection directly via its fixed point : z∗ = σ ( Wz∗ + Ux + b ) . Its backpropagation is done through the implicit function theorem and only requires constant memory . Bai et al . ( 2020 ) also showed that the multiscale DEQ models achieve near state-of-the-art performances on many large-scale tasks . Winston & Kolter ( 2020 ) later presented a parametrization of the DEQ ( denoted as monDEQ ) that guarantees provable convergence to a unique fixed point , using monotone operator theory . Specifically , they parameterize W in a way that I − W ⪰ mI ( called m-strongly monotone ) is always satisfied during training for some m > 0 ; they convert nonlinearities into proximal operators ( which include ReLU , tanh , etc . ) , and show that using existing splitting methods like forward-backward and Peaceman-Rachford can provably find the unique fixed point . Markov random field ( MRF ) and its variants MRF is a form of energy-based model , which model joint probabilities of the form pθ ( x ) = exp ( −Eθ ( x ) ) /Zθ for an energy function Eθ . A common type of MRF is the Boltzmann machine , the most successful variant of which is the restricted Boltzmann machines ( RBM ) ( Hinton , 2002 ) and its deep ( multi-layer ) variant ( Salakhutdinov & Hinton , 2009 ) . Particularly , RBMs define Eθ ( v , h ) = −a⊤v− b⊤h− v⊤Wh , where θ = { W , a , b } , v is the set of visible variables , and h is the set of latent variables . It is usually trained using the contrastive-divergence algorithm , and its inference can be done efficiently by a block mean-field approximation . However , a particular restriction of RBMs is that there can be no intra-layer connections , that is , each variable in v ( resp . h ) is independent conditioned on h ( resp . v ) . A deep RBM allows different layers of hidden nodes , but there can not be intra-layer connections . By contrast , our formulation allows intra-layer connections and is therefore is more expressive in this respect . See fig . 1 for the network topology of RBM , deep RBM , and general BM ( we also use the term general deep BM interchangeably to emphasize the existence of deep structure ) . Wu et al . ( 2016 ) proposed a deep parameterization of MRF , but their setting only considers a grid of hidden variables h and the connections among hidden units are restricted to the neighboring nodes . Therefore , it is a special case of our parameterization ( although their learning algorithm is orthogonal to ours ) . Numerous works also try to combine deep neural networks with conditional random fields ( CRF ) ( Krähenbühl & Koltun , 2013 ; Zheng et al. , 2015 ; Schwartz et al. , 2017 ) These models either train a pre-determined kernel as an RNN or use neural networks for producing either inputs or parameters of their CRFs . Parallel and convergent mean-field It is well-known that mean-field updates converge locally using a coordinate ascent algorithm ( Blei et al. , 2017 ) . However , local convergence is only guaranteed if the update is applied sequentially . Nonetheless , several works have proposed techniques to parallelize updates . Krähenbühl & Koltun ( 2013 ) proposed a concave-convex procedure ( CCCP ) to minimize the KL divergence between the true distribution and the mean-field variational family . To achieve efficient inference , they use a concave approximation to the pairwise kernel , and their fast update rule only converges if the kernel function is concave . Later , Baqué et al . ( 2016 ) derived a similar parallel damped forward iteration to ours that provably converges without the concave potential constraint . However , unlike our approach , they do not use a parameterization which ensures a global mean-field optimum , and their algorithm therefore may not converge to the actual fixed point of the mean-field updates . This is because Baqué et al . ( 2016 ) used the prox1f proximal operator ( described below ) , whereas we derive the proxαf operator to guarantee global convergence when doing mean-field updates in parallel . What ’ s more , Baqué et al . ( 2016 ) focused only on inference over prescribed potentials , and not on training the ( fully parameterized ) potentials as we do here . Lê-Huu & Alahari ( 2021 ) brought up a generalized Frank-Wolfe based framework for mean-field updates which include the methods proposed by Baqué et al . ( 2016 ) ; Krähenbühl & Koltun ( 2013 ) . Their results only guarantee global convergence to a local optimal . 3 MONOTONE DEEP BOLTZMANN MACHINES AND APPROXIMATE INFERENCE . In this section , we present the main technical contributions of this work . We begin by presenting a parameterization of the pairwise potential in a Boltzmann machine that guarantees the monotonicity condition . We then illustrate the connection between a ( joint ) mean-field inference fixed point and the fixed point of our monotone Boltzmann machine and discuss how deep structured networks can be implemented in this form practically ; this establishes that , under the monotonicity conditions on Φ , there exists a unique globally-optimal mean-field fixed point . Finally , we present an efficient parallel method for computing this mean-field fixed point , again motivated by the machinery of monotone DEQs and operator splitting methods . 3.1 A MONOTONE PARAMETERIZATION OF GENERAL BOLTZMANN MACHINES . In this section , we show how to parameterize our probabilistic model in a way that the pairwise potentials satisfy I − Φ ⪰ mI , which will be used later to show the existence of a unique meanfield fixed point . Additionally , since Φ defines a graphical model that has no self-loop , we further require Φ to be a block hollow matrix ( that is , the ki × ki diagonal blocks corresponding to each variable must be zero ) . While both these conditions on Φ are convex constraints , in practice it would be extremely difficult to project a generic set of weights onto this constraint set under an ordinary parameterization of the network . Thus , we instead advocate for a non-convex parameterization of the network weights , but one which guarantees that the monotonicity condition is always satisfied , without any constraint on the weights in the parameterization . Specifically , define the block matrix A = [ A1 A2 · · · An ] ( 2 ) with Ai ∈ Rd×ki matrices for each variables , and where d can be some arbitrarily chosen dimension . Then let Âi be a spectrally-normalized version of Ai Âi = Ai ·min { √ 1−m/∥Ai∥2 , 1 } ( 3 ) i.e. , a version of Ai normalized such that its largest singular value is at most √ 1−m ( note that we can compute the spectral norm of Ai as ∥Ai∥2 = ∥ATi Ai∥ 1/2 2 , which involves computing the singular values of only a ki × ki matrix , and thus is very fast in practice ) . We define the  matrix analogously as the block version of these normalized matrices . Then we propose to parameterize Φ as Φ = blkdiag ( ÂT  ) − ÂT  ( 4 ) where blkdiag denotes the block-diagonal portion of the matrix along the ki×ki block . Put another way , this parameterizes Φ as Φij = { −ÂTi Âj if i ̸= j , 0 if i = j . ( 5 ) As the following simple theorem shows , this parameterization guarantees both hollowness of the Φ matrix and monotonicity of I −Φ , for any value of the A matrix . Theorem 3.1 . For any choice of parameters A , under the parametrization equation 4 above , we have that 1 ) Φii = 0 for all i = 1 , . . . , n , and 2 ) I −Φ ⪰ mI . Proof . Block hollowness of the matrix follows immediately from construction . To establish monotonicity , note that I −Φ ⪰ mI ⇐⇒ I + ÂT Â− blkdiag ( ÂT  ) ⪰ mI ⇐= I − blkdiag ( ÂT  ) ⪰ mI ⇐⇒ I − ÂTi Âi ⪰ mI , ∀i ⇐⇒ ∥Âi∥2 ≤ √ 1−m , ∀i . ( 6 ) This last property always holds by the construction of Âi .
In this paper the authors propose a restricted parameterization of the Boltzmann machine that guarantees that for any set of observations, the mean field objective has a single global optimum. Furthermore, that global optimum can be provably achieved using damped parallel mean-field updates, which make inference efficient. To turn inference into learning, the model is treated as a supervised learning model: some of its variables are considered to be observed inputs and some of its variables are considered to be target outputs (known at test time). The usual, marginal cross-entropy loss is the optimization target for learning.
SP:5d6b2f3781f71ad8468e17607662fa1702ae2125
Monotone deep Boltzmann machines
1 INTRODUCTION . This paper considers ( deep ) Boltzmann machines , which are pairwise energy-based probabilistic models . Theses models specify a joint distribution over variables x given by the density p ( x ) ∝ exp ∑ ( i , j ) ∈E x⊤i Φijxj + n∑ i=1 b⊤i xi , ( 1 ) where each x1 : n denotes a discrete random variable over ki possible values , represented as a onehot encoding xi ∈ { 0 , 1 } ki ; E denotes the set of edges in the model ; Φi , j ∈ Rki×kj represents pairwise potential ; and bi ∈ Rki represents unary potential . Depending on context , these models are typically referred to as pairwise Markov random fields ( MRFs ) ( Koller & Friedman , 2009 ) , or ( potentially deep ) Boltzmann machines ( Goodfellow et al. , 2016 ; Salakhutdinov & Hinton , 2009 ; Hinton , 2002 ) . In the above setting each xi may represent an observed or unobserved value , and there can be substantial structure within the variables ; for instance , the collection of variables x may ( and indeed will , in the main settings we consider in this paper ) consist of several different “ layers ” in a joint convolutional structure , leading to the deep convolutional Boltzmann machine ( Norouzi et al. , 2009 ) . In this paper , we propose a new parameterization and algorithmic approach to approximate inference of these probabilistic models . There are two main contributions : First , we define a generic parameterization of the pairwise kernel function Φ , that can represent a general Boltzmann machine . Our parametrization is flexible enough to incorporate almost all operators and network topology , including fully-connected layers , convolution operators , and skip-connections , etc . Through the lens of the recently developed monotone DEQ ( Winston & Kolter , 2020 ) , we constraint Φ to satisfy certain monotonicity conditions through training and inference ; this thereby assures that the mean-field approximation will always have a unique , globally-optimal fixed point under this parameterization . Second , although previous works ( Krähenbühl & Koltun , 2013 ; Baqué et al. , 2016 ) have made approaches to parallel mean-field updates , they either require strong conditions on ϕ , or fail to converge to the true mean-field distribution . We provide a properly-damped mean-field update method , based upon a generic proximal operator , which is guaranteed to converge to the mean-field fixed point , even if applied in parallel to all random variables simultaneously . Although there is no exact closed form solution of this proximal operator , we derive a very efficient Newton-based implementation . To estimate the parameters of our model , we follow the marginal-based loss minimization approach in Krähenbühl & Koltun ( 2013 ) ; Domke ( 2013 ) , where the objective is to directly maximize the likelihood induced by the approximated mean-field distribution . Such an approach grants us the ability to update parameters via taking gradient steps of the proposed mean-field iterations . With the proposed approaches , we perform both learning and inference for a deep convolutional , multi-resolution Boltzmann machine , and apply the network to model MNIST and CIFAR-10 pixels and their classes conditioned on partially observed images . Such joint probabilistic modelling allows us to simultaneously impute missing pixels and predict the class . While these are naturally a smallscale problem , we emphasize that performing joint probabilistic inference over a complete model of this type is a relatively high-dimensional task as far as traditional mean-field inference is concerned . We also compare our inference method to previous ones and demonstrate different convergence properties of each . We conclude by highlighting limitations and directions for future work with the method . 2 BACKGROUND AND RELATED WORK . This paper builds upon three main avenues of work : 1 ) deep equilibrium models , especially their convergent version , the monotone DEQ ; 2 ) the broad topic of energy-based deep model and Boltzmann machines in particular ; and 3 ) work on concave potentials and parallel methods for mean-field inference . We discuss each of these below . Equilibrium models and their provable convergence The DEQ model was first proposed by Bai et al . ( 2019 ) . Based on the observation that a neural network zt+1 = σ ( Wzt + Ux+ b ) with input injection x usually converges to a fixed point , they modeled an effectively infinite-depth network with input injection directly via its fixed point : z∗ = σ ( Wz∗ + Ux + b ) . Its backpropagation is done through the implicit function theorem and only requires constant memory . Bai et al . ( 2020 ) also showed that the multiscale DEQ models achieve near state-of-the-art performances on many large-scale tasks . Winston & Kolter ( 2020 ) later presented a parametrization of the DEQ ( denoted as monDEQ ) that guarantees provable convergence to a unique fixed point , using monotone operator theory . Specifically , they parameterize W in a way that I − W ⪰ mI ( called m-strongly monotone ) is always satisfied during training for some m > 0 ; they convert nonlinearities into proximal operators ( which include ReLU , tanh , etc . ) , and show that using existing splitting methods like forward-backward and Peaceman-Rachford can provably find the unique fixed point . Markov random field ( MRF ) and its variants MRF is a form of energy-based model , which model joint probabilities of the form pθ ( x ) = exp ( −Eθ ( x ) ) /Zθ for an energy function Eθ . A common type of MRF is the Boltzmann machine , the most successful variant of which is the restricted Boltzmann machines ( RBM ) ( Hinton , 2002 ) and its deep ( multi-layer ) variant ( Salakhutdinov & Hinton , 2009 ) . Particularly , RBMs define Eθ ( v , h ) = −a⊤v− b⊤h− v⊤Wh , where θ = { W , a , b } , v is the set of visible variables , and h is the set of latent variables . It is usually trained using the contrastive-divergence algorithm , and its inference can be done efficiently by a block mean-field approximation . However , a particular restriction of RBMs is that there can be no intra-layer connections , that is , each variable in v ( resp . h ) is independent conditioned on h ( resp . v ) . A deep RBM allows different layers of hidden nodes , but there can not be intra-layer connections . By contrast , our formulation allows intra-layer connections and is therefore is more expressive in this respect . See fig . 1 for the network topology of RBM , deep RBM , and general BM ( we also use the term general deep BM interchangeably to emphasize the existence of deep structure ) . Wu et al . ( 2016 ) proposed a deep parameterization of MRF , but their setting only considers a grid of hidden variables h and the connections among hidden units are restricted to the neighboring nodes . Therefore , it is a special case of our parameterization ( although their learning algorithm is orthogonal to ours ) . Numerous works also try to combine deep neural networks with conditional random fields ( CRF ) ( Krähenbühl & Koltun , 2013 ; Zheng et al. , 2015 ; Schwartz et al. , 2017 ) These models either train a pre-determined kernel as an RNN or use neural networks for producing either inputs or parameters of their CRFs . Parallel and convergent mean-field It is well-known that mean-field updates converge locally using a coordinate ascent algorithm ( Blei et al. , 2017 ) . However , local convergence is only guaranteed if the update is applied sequentially . Nonetheless , several works have proposed techniques to parallelize updates . Krähenbühl & Koltun ( 2013 ) proposed a concave-convex procedure ( CCCP ) to minimize the KL divergence between the true distribution and the mean-field variational family . To achieve efficient inference , they use a concave approximation to the pairwise kernel , and their fast update rule only converges if the kernel function is concave . Later , Baqué et al . ( 2016 ) derived a similar parallel damped forward iteration to ours that provably converges without the concave potential constraint . However , unlike our approach , they do not use a parameterization which ensures a global mean-field optimum , and their algorithm therefore may not converge to the actual fixed point of the mean-field updates . This is because Baqué et al . ( 2016 ) used the prox1f proximal operator ( described below ) , whereas we derive the proxαf operator to guarantee global convergence when doing mean-field updates in parallel . What ’ s more , Baqué et al . ( 2016 ) focused only on inference over prescribed potentials , and not on training the ( fully parameterized ) potentials as we do here . Lê-Huu & Alahari ( 2021 ) brought up a generalized Frank-Wolfe based framework for mean-field updates which include the methods proposed by Baqué et al . ( 2016 ) ; Krähenbühl & Koltun ( 2013 ) . Their results only guarantee global convergence to a local optimal . 3 MONOTONE DEEP BOLTZMANN MACHINES AND APPROXIMATE INFERENCE . In this section , we present the main technical contributions of this work . We begin by presenting a parameterization of the pairwise potential in a Boltzmann machine that guarantees the monotonicity condition . We then illustrate the connection between a ( joint ) mean-field inference fixed point and the fixed point of our monotone Boltzmann machine and discuss how deep structured networks can be implemented in this form practically ; this establishes that , under the monotonicity conditions on Φ , there exists a unique globally-optimal mean-field fixed point . Finally , we present an efficient parallel method for computing this mean-field fixed point , again motivated by the machinery of monotone DEQs and operator splitting methods . 3.1 A MONOTONE PARAMETERIZATION OF GENERAL BOLTZMANN MACHINES . In this section , we show how to parameterize our probabilistic model in a way that the pairwise potentials satisfy I − Φ ⪰ mI , which will be used later to show the existence of a unique meanfield fixed point . Additionally , since Φ defines a graphical model that has no self-loop , we further require Φ to be a block hollow matrix ( that is , the ki × ki diagonal blocks corresponding to each variable must be zero ) . While both these conditions on Φ are convex constraints , in practice it would be extremely difficult to project a generic set of weights onto this constraint set under an ordinary parameterization of the network . Thus , we instead advocate for a non-convex parameterization of the network weights , but one which guarantees that the monotonicity condition is always satisfied , without any constraint on the weights in the parameterization . Specifically , define the block matrix A = [ A1 A2 · · · An ] ( 2 ) with Ai ∈ Rd×ki matrices for each variables , and where d can be some arbitrarily chosen dimension . Then let Âi be a spectrally-normalized version of Ai Âi = Ai ·min { √ 1−m/∥Ai∥2 , 1 } ( 3 ) i.e. , a version of Ai normalized such that its largest singular value is at most √ 1−m ( note that we can compute the spectral norm of Ai as ∥Ai∥2 = ∥ATi Ai∥ 1/2 2 , which involves computing the singular values of only a ki × ki matrix , and thus is very fast in practice ) . We define the  matrix analogously as the block version of these normalized matrices . Then we propose to parameterize Φ as Φ = blkdiag ( ÂT  ) − ÂT  ( 4 ) where blkdiag denotes the block-diagonal portion of the matrix along the ki×ki block . Put another way , this parameterizes Φ as Φij = { −ÂTi Âj if i ̸= j , 0 if i = j . ( 5 ) As the following simple theorem shows , this parameterization guarantees both hollowness of the Φ matrix and monotonicity of I −Φ , for any value of the A matrix . Theorem 3.1 . For any choice of parameters A , under the parametrization equation 4 above , we have that 1 ) Φii = 0 for all i = 1 , . . . , n , and 2 ) I −Φ ⪰ mI . Proof . Block hollowness of the matrix follows immediately from construction . To establish monotonicity , note that I −Φ ⪰ mI ⇐⇒ I + ÂT Â− blkdiag ( ÂT  ) ⪰ mI ⇐= I − blkdiag ( ÂT  ) ⪰ mI ⇐⇒ I − ÂTi Âi ⪰ mI , ∀i ⇐⇒ ∥Âi∥2 ≤ √ 1−m , ∀i . ( 6 ) This last property always holds by the construction of Âi .
This paper proposes a new family of monotone deep Boltzmann machines where the pairwise potentials satisfy a monotonicity condition, giving rise to efficient mean-field iteration with provable convergence guarantees. The convergence is obtained by drawing connections with monotone deep equilibrium models. Small-scale experiments are done as proof of concept.
SP:5d6b2f3781f71ad8468e17607662fa1702ae2125
FALCON: Fast Visual Concept Learning by Integrating Images, Linguistic descriptions, and Conceptual Relations
We present a meta-learning framework for learning new visual concepts quickly , from just one or a few examples , guided by multiple naturally occurring data streams : simultaneously looking at images , reading sentences that describe the objects in the scene , and interpreting supplemental sentences that relate the novel concept with other concepts . The learned concepts support downstream applications , such as answering questions by reasoning about unseen images . Our model , namely FALCON , represents individual visual concepts , such as colors and shapes , as axis-aligned boxes in a high-dimensional space ( the “ box embedding space ” ) . Given an input image and its paired sentence , our model first resolves the referential expression in the sentence and associate the novel concept with particular objects in the scene . Next , our model interprets supplemental sentences to relate the novel concept with other known concepts , such as “ X has property Y ” or “ X is a kind of Y ” . Finally , it infers an optimal box embedding for the novel concept that jointly 1 ) maximizes the likelihood of the observed instances in the image , and 2 ) satisfies the relationships between the novel concepts and the known ones . We demonstrate the effectiveness of our model on both synthetic and real-world datasets . 1 INTRODUCTION . Humans build a cumulative knowledge repository of visual concepts throughout their lives from a diverse set of inputs : by looking at images , reading sentences that describe the properties of the concept , etc . Importantly , adding a novel concept to the knowledge repository requires only a small amount of data , such as a few images about the concept and a short textual description ( Bloom , 2000 ; Swingley , Daniel , 2010 ; Carey & Bartlett , 1978 ) . Take Fig . 1 as an example : from just a single image that contains many objects ( Fig . 1a ) , as well as a short descriptive sentence that describes a new concept red : “ the object left of the yellow cube is red ” , humans can effortlessly ground the novel word “ red ” with the visual appearance of the object being referred to ( Bloom , 2000 ) . Supplemental sentences such as “ red is a kind of color ” ( Fig . 1b ) may provide additional information : “ red ” objects should be classified based on their hue . This further supports us to generalize the learned concept “ red ” to objects of various shapes , sizes , and materials . Finally , the acquired concept can be used flexibly in other tasks such as question answering ( Fig . 1c ) . Our goal is to build machines that can learn concepts that are associated with the physical world in an incremental manner and flexibly use them to answer queries . To learn a new concept , for example , the word red in Fig . 1a , the system should 1 ) interpret the semantics of the descriptive sentence composed of other concepts , such as left , yellow , and cube , 2 ) instantiate a representation for the novel concept that is associated with the visual appearance of the referred object , 3 ) mediate the concept representation based on the supplemental sentences that describe the property of the concept or relate it with other concepts , and 4 ) use the learned concept flexibly in different concepts . A framework that can solve these challenges will allow us to build machines that can better learn from human and communicate with human . To address these challenges , in this paper , we present a unified framework , FALCON ( FAst Learning of novel visual CONcepts ) . FALCON maintains a collection of embedding vectors for individual visual concepts , which naturally grows in an incremental way as it learns more concepts . A neuro- symbolic concept learning and reasoning framework learns new concepts by looking at images and reading paired sentences , and use them to answer incoming queries . Concretely , FALCON represents individual visual concepts , such as colors and shapes , as axis-aligned boxes in a high-dimensional space ( the “ box embedding space ” ( Vilnis et al. , 2018 ) ) , while objects in different images will be embedded into the same latent space as points . We say object X has property Y if the embedding vector X is inside the embedding box of Y . Given an input image and its paired sentence , our model first resolves the referential expression in the sentence using the previously seen concepts ( e.g. , left , yellow , and cube ) and associate the novel concept with particular objects in the scene . Next , our model interprets supplemental sentences to relate the novel concept with other known concepts ( e.g. , yellow ) . To infer the box embedding of the novel concept , we train a neural network to predict the optimal box embedding for the novel concept that jointly 1 ) maximizes the data likelihood of the observed examples , and 2 ) satisfies the relationships between the novel concepts and the known ones . This module is trained with a meta-learning procedure . Our paper makes the following contributions . First , we present a unified neuro-symbolic framework for fast visual concept learning from diverse data streams . Second , we introduce a new concept embedding prediction module that learns to integrate visual examples and conceptual relations to infer a novel concept embedding . Finally , we build a protocol for generating meta-learning test cases for evaluating fast visual concept learning , by augmenting existing visual reasoning datasets and knowledge graphs . By evaluation on both synthetic and natural image datasets , we show that our model learns more accurate representations for novel concepts compared with existing baselines for fast concept learning . Systematical studies also show that our model can efficiently use the supplemental concept descriptions to resolve ambiguities in the visual examples . We also provide discussions about the design of different modules in our system . 2 RELATED WORKS . Visual concept learning and visual reasoning . Visual reasoning aims to reason about object properties and their relationships in given images , usually evaluated as the question-answering accuracy ( Johnson et al. , 2017a ; Hudson & Manning , 2018 ; Mascharka et al. , 2018 ; Hu et al. , 2018 ) . Recently , there has been an increasing amount of work has been focusing on using neuro-symbolic frameworks to bridge visual concept learning and visual reasoning ( Yi et al. , 2018 ; Mao et al. , 2019 ; Li et al. , 2020 ) . The high-level idea is to disentangle concept learning : association of linguistic units with visual representations , and reasoning : the ability to count objects or make queries . Han et al . ( 2019 ) recently shown how jointly learning concepts and metaconcepts can help each other . Our work is an novel approach towards making use of the metaconcepts in a meta-learning setting aiming at boost the learning of novel concepts based on known ones . Few-shot visual learning . Recent work has studied learning to classify visual scene with very limited labeled examples ( Vinyals et al. , 2016 ; Sung et al. , 2018 ; Snell et al. , 2017 ) or even without any example ( Wang et al. , 2018 ; Kampffmeyer et al. , 2019 ; Tian et al. , 2020 ) . For few-shot learning , existing work proposes to compare the similarity , such as cosine similarity ( Vinyals et al. , 2016 ) and Euclidean distance ( Snell et al. , 2017 ) , between examples , while ( Sung et al. , 2018 ) introduces a learnable module to predict such similarities . In addition , ( Gidaris & Komodakis , 2018 ) learns a weight generator to predict the classifier for classes with very few examples . ( Ravi & Larochelle , 2017 ; Finn et al. , 2017 ; Nichol et al. , 2018 ) address this problem by learning the initialization for gradient-based optimization .. ( Santoro et al. , 2016 ) used external memory to facilitate learning process , while ( Munkhdalai & Yu , 2017 ) uses meta-knowledge among task for rapid adaptation . Our module design is inspired by these work , but we use a language interface : novel concepts are learnt from paired images and texts and evaluated on visual reasoning tasks . Geometric embeddings . In contrast to representing concepts in vector spaces ( Kiros et al. , 2014 ) , a geometric embedding framework associates each concept with a geometric entity such as a Gaussian distribution ( Vilnis & McCallum , 2015 ) , the intersection of hyperplanes ( Vendrov et al. , 2016 ; Vilnis et al. , 2018 ) , and a hyperbolic cone ( Ganea et al. , 2018 ) . Among them , box embeddings ( Vilnis et al. , 2018 ) which map each concept to a hyper-box in the high-dimensional space , have been popular for concept representation : ( Li , Xiang and Vilnis , Luke and Zhang , Dongxu and Boratko , Michael and McCallum , Andrew , 2019 ) proposed a smooth training objective , and ( Ren et al. , 2020 ) uses box embeddings for reasoning over knowledge graphs . In this paper , we extend the box embedding from knowledge graphs to visual domains , and compare it with other concept embeddings . 3 FALCON . The proposed model , FALCON , learns visual concepts by simultaneously looking at images , reading sentences that describe the objects in the scene , and interpreting supplemental sentences that describe the properties of the novel concepts . FALCON learns to learn novel concepts quickly and in a continual manner . We start with a formal definition of our fast and continual concept learning task . Problem formulation . Each concept learning task is a 4-tuple ( c , Xc , Dc , Tc ) . Denote c as the novel concept to be learned ( e.g. , red ) . Models learn to recognize red objects by looking at paired images xi and sentences yi : Xc = { ( xi , yi ) } . Optionally , supplementary sentences Dc = { di } describe the concept c by relating it to other known concepts . After learning , the model will be tested on downstream tasks . In this paper , we specifically focus on visual reasoning : the ability to answer questions about objects in the testing set Tc , which is represented as pairs of images and questions . There are two possible options to approach this problem . One is manually specifying rules to compute the representation for the new concept . In this paper , we focus on a meta-learning approach : to build a system that can learn to learn new concept . Our training data is data tuples for a set of training concepts ( base concepts , Cbase ) . After training , the system is evaluated on a collection of novel concepts ( Ctest ) . That is , we will provide our system with Xc and Dc for a novel concept c , and test it on visual reasoning data Tc . Thus , the system works in a continual learning fashion : the description of a new concept depends on a previously learned concept . Overview . Fig . 2 gives an overview of our proposed model , FALCON . Our key idea is to represent each concept as an axis-aligned box in a high-dimensional space ( the “ box embedding space ” , Section 3.1 ) . Given example images xi and descriptions yi ( Fig . 2a ) , FALCON interprets the referential expression in yi as a symbolic program ( Fig . 2a2 ) . An neuro-symbolic reasoning module executes the inferred program to locate the object being referred to ( Fig . 2a3 ) , see Section 3.2 . Meanwhile , supplementary descriptions Dc ( Fig . 2b ) will be translated into relational representations of concepts ( Fig . 2b1 ) , i.e. , how the new concept c relates to other known concepts . Based on the examples of the novel concept and its relationships with other concepts , we formulate the task of novel concept learning as learning to infer the best concept embedding for c in the box embedding space , evaluated on downstream tasks ( Fig . 2c ) . Once the model learned , we will be using the same neuro-symbolic module for answering questions in the testing set Tc .
This paper presents a unified meta-learning neuro-symbolic framework for fast visual concept learning from diverse data streams. It introduces a new embedding prediction module to integrate visual examples and relations to infer novel concept embeddings. It’s meta-learning continuous learning approach also uses supplementary sentences to relate concepts to one another. They show improvements for the end task of question answering with novel concepts by first meta-learning those concepts during a meta-testing phase.
SP:e997a0442758fe349e2ae90129796ed560dc0200
FALCON: Fast Visual Concept Learning by Integrating Images, Linguistic descriptions, and Conceptual Relations
We present a meta-learning framework for learning new visual concepts quickly , from just one or a few examples , guided by multiple naturally occurring data streams : simultaneously looking at images , reading sentences that describe the objects in the scene , and interpreting supplemental sentences that relate the novel concept with other concepts . The learned concepts support downstream applications , such as answering questions by reasoning about unseen images . Our model , namely FALCON , represents individual visual concepts , such as colors and shapes , as axis-aligned boxes in a high-dimensional space ( the “ box embedding space ” ) . Given an input image and its paired sentence , our model first resolves the referential expression in the sentence and associate the novel concept with particular objects in the scene . Next , our model interprets supplemental sentences to relate the novel concept with other known concepts , such as “ X has property Y ” or “ X is a kind of Y ” . Finally , it infers an optimal box embedding for the novel concept that jointly 1 ) maximizes the likelihood of the observed instances in the image , and 2 ) satisfies the relationships between the novel concepts and the known ones . We demonstrate the effectiveness of our model on both synthetic and real-world datasets . 1 INTRODUCTION . Humans build a cumulative knowledge repository of visual concepts throughout their lives from a diverse set of inputs : by looking at images , reading sentences that describe the properties of the concept , etc . Importantly , adding a novel concept to the knowledge repository requires only a small amount of data , such as a few images about the concept and a short textual description ( Bloom , 2000 ; Swingley , Daniel , 2010 ; Carey & Bartlett , 1978 ) . Take Fig . 1 as an example : from just a single image that contains many objects ( Fig . 1a ) , as well as a short descriptive sentence that describes a new concept red : “ the object left of the yellow cube is red ” , humans can effortlessly ground the novel word “ red ” with the visual appearance of the object being referred to ( Bloom , 2000 ) . Supplemental sentences such as “ red is a kind of color ” ( Fig . 1b ) may provide additional information : “ red ” objects should be classified based on their hue . This further supports us to generalize the learned concept “ red ” to objects of various shapes , sizes , and materials . Finally , the acquired concept can be used flexibly in other tasks such as question answering ( Fig . 1c ) . Our goal is to build machines that can learn concepts that are associated with the physical world in an incremental manner and flexibly use them to answer queries . To learn a new concept , for example , the word red in Fig . 1a , the system should 1 ) interpret the semantics of the descriptive sentence composed of other concepts , such as left , yellow , and cube , 2 ) instantiate a representation for the novel concept that is associated with the visual appearance of the referred object , 3 ) mediate the concept representation based on the supplemental sentences that describe the property of the concept or relate it with other concepts , and 4 ) use the learned concept flexibly in different concepts . A framework that can solve these challenges will allow us to build machines that can better learn from human and communicate with human . To address these challenges , in this paper , we present a unified framework , FALCON ( FAst Learning of novel visual CONcepts ) . FALCON maintains a collection of embedding vectors for individual visual concepts , which naturally grows in an incremental way as it learns more concepts . A neuro- symbolic concept learning and reasoning framework learns new concepts by looking at images and reading paired sentences , and use them to answer incoming queries . Concretely , FALCON represents individual visual concepts , such as colors and shapes , as axis-aligned boxes in a high-dimensional space ( the “ box embedding space ” ( Vilnis et al. , 2018 ) ) , while objects in different images will be embedded into the same latent space as points . We say object X has property Y if the embedding vector X is inside the embedding box of Y . Given an input image and its paired sentence , our model first resolves the referential expression in the sentence using the previously seen concepts ( e.g. , left , yellow , and cube ) and associate the novel concept with particular objects in the scene . Next , our model interprets supplemental sentences to relate the novel concept with other known concepts ( e.g. , yellow ) . To infer the box embedding of the novel concept , we train a neural network to predict the optimal box embedding for the novel concept that jointly 1 ) maximizes the data likelihood of the observed examples , and 2 ) satisfies the relationships between the novel concepts and the known ones . This module is trained with a meta-learning procedure . Our paper makes the following contributions . First , we present a unified neuro-symbolic framework for fast visual concept learning from diverse data streams . Second , we introduce a new concept embedding prediction module that learns to integrate visual examples and conceptual relations to infer a novel concept embedding . Finally , we build a protocol for generating meta-learning test cases for evaluating fast visual concept learning , by augmenting existing visual reasoning datasets and knowledge graphs . By evaluation on both synthetic and natural image datasets , we show that our model learns more accurate representations for novel concepts compared with existing baselines for fast concept learning . Systematical studies also show that our model can efficiently use the supplemental concept descriptions to resolve ambiguities in the visual examples . We also provide discussions about the design of different modules in our system . 2 RELATED WORKS . Visual concept learning and visual reasoning . Visual reasoning aims to reason about object properties and their relationships in given images , usually evaluated as the question-answering accuracy ( Johnson et al. , 2017a ; Hudson & Manning , 2018 ; Mascharka et al. , 2018 ; Hu et al. , 2018 ) . Recently , there has been an increasing amount of work has been focusing on using neuro-symbolic frameworks to bridge visual concept learning and visual reasoning ( Yi et al. , 2018 ; Mao et al. , 2019 ; Li et al. , 2020 ) . The high-level idea is to disentangle concept learning : association of linguistic units with visual representations , and reasoning : the ability to count objects or make queries . Han et al . ( 2019 ) recently shown how jointly learning concepts and metaconcepts can help each other . Our work is an novel approach towards making use of the metaconcepts in a meta-learning setting aiming at boost the learning of novel concepts based on known ones . Few-shot visual learning . Recent work has studied learning to classify visual scene with very limited labeled examples ( Vinyals et al. , 2016 ; Sung et al. , 2018 ; Snell et al. , 2017 ) or even without any example ( Wang et al. , 2018 ; Kampffmeyer et al. , 2019 ; Tian et al. , 2020 ) . For few-shot learning , existing work proposes to compare the similarity , such as cosine similarity ( Vinyals et al. , 2016 ) and Euclidean distance ( Snell et al. , 2017 ) , between examples , while ( Sung et al. , 2018 ) introduces a learnable module to predict such similarities . In addition , ( Gidaris & Komodakis , 2018 ) learns a weight generator to predict the classifier for classes with very few examples . ( Ravi & Larochelle , 2017 ; Finn et al. , 2017 ; Nichol et al. , 2018 ) address this problem by learning the initialization for gradient-based optimization .. ( Santoro et al. , 2016 ) used external memory to facilitate learning process , while ( Munkhdalai & Yu , 2017 ) uses meta-knowledge among task for rapid adaptation . Our module design is inspired by these work , but we use a language interface : novel concepts are learnt from paired images and texts and evaluated on visual reasoning tasks . Geometric embeddings . In contrast to representing concepts in vector spaces ( Kiros et al. , 2014 ) , a geometric embedding framework associates each concept with a geometric entity such as a Gaussian distribution ( Vilnis & McCallum , 2015 ) , the intersection of hyperplanes ( Vendrov et al. , 2016 ; Vilnis et al. , 2018 ) , and a hyperbolic cone ( Ganea et al. , 2018 ) . Among them , box embeddings ( Vilnis et al. , 2018 ) which map each concept to a hyper-box in the high-dimensional space , have been popular for concept representation : ( Li , Xiang and Vilnis , Luke and Zhang , Dongxu and Boratko , Michael and McCallum , Andrew , 2019 ) proposed a smooth training objective , and ( Ren et al. , 2020 ) uses box embeddings for reasoning over knowledge graphs . In this paper , we extend the box embedding from knowledge graphs to visual domains , and compare it with other concept embeddings . 3 FALCON . The proposed model , FALCON , learns visual concepts by simultaneously looking at images , reading sentences that describe the objects in the scene , and interpreting supplemental sentences that describe the properties of the novel concepts . FALCON learns to learn novel concepts quickly and in a continual manner . We start with a formal definition of our fast and continual concept learning task . Problem formulation . Each concept learning task is a 4-tuple ( c , Xc , Dc , Tc ) . Denote c as the novel concept to be learned ( e.g. , red ) . Models learn to recognize red objects by looking at paired images xi and sentences yi : Xc = { ( xi , yi ) } . Optionally , supplementary sentences Dc = { di } describe the concept c by relating it to other known concepts . After learning , the model will be tested on downstream tasks . In this paper , we specifically focus on visual reasoning : the ability to answer questions about objects in the testing set Tc , which is represented as pairs of images and questions . There are two possible options to approach this problem . One is manually specifying rules to compute the representation for the new concept . In this paper , we focus on a meta-learning approach : to build a system that can learn to learn new concept . Our training data is data tuples for a set of training concepts ( base concepts , Cbase ) . After training , the system is evaluated on a collection of novel concepts ( Ctest ) . That is , we will provide our system with Xc and Dc for a novel concept c , and test it on visual reasoning data Tc . Thus , the system works in a continual learning fashion : the description of a new concept depends on a previously learned concept . Overview . Fig . 2 gives an overview of our proposed model , FALCON . Our key idea is to represent each concept as an axis-aligned box in a high-dimensional space ( the “ box embedding space ” , Section 3.1 ) . Given example images xi and descriptions yi ( Fig . 2a ) , FALCON interprets the referential expression in yi as a symbolic program ( Fig . 2a2 ) . An neuro-symbolic reasoning module executes the inferred program to locate the object being referred to ( Fig . 2a3 ) , see Section 3.2 . Meanwhile , supplementary descriptions Dc ( Fig . 2b ) will be translated into relational representations of concepts ( Fig . 2b1 ) , i.e. , how the new concept c relates to other known concepts . Based on the examples of the novel concept and its relationships with other concepts , we formulate the task of novel concept learning as learning to infer the best concept embedding for c in the box embedding space , evaluated on downstream tasks ( Fig . 2c ) . Once the model learned , we will be using the same neuro-symbolic module for answering questions in the testing set Tc .
This paper tackles concept learning problem. This paper designed a neural symbolic machine based approach that is able to inference the concept embedding from a given image and sentence pair. It can also mediate the concept embedding using additional text explanation. To verify this approach, this paper follows a meta-learning setting. Specifically, the concepts are split into training, validation, and testing. The model first learn the base concepts from the training set and then quickly infer the concept embedding for the testing split. The paper achieved a superior performance over three datasets against baselines.
SP:e997a0442758fe349e2ae90129796ed560dc0200
FALCON: Fast Visual Concept Learning by Integrating Images, Linguistic descriptions, and Conceptual Relations
We present a meta-learning framework for learning new visual concepts quickly , from just one or a few examples , guided by multiple naturally occurring data streams : simultaneously looking at images , reading sentences that describe the objects in the scene , and interpreting supplemental sentences that relate the novel concept with other concepts . The learned concepts support downstream applications , such as answering questions by reasoning about unseen images . Our model , namely FALCON , represents individual visual concepts , such as colors and shapes , as axis-aligned boxes in a high-dimensional space ( the “ box embedding space ” ) . Given an input image and its paired sentence , our model first resolves the referential expression in the sentence and associate the novel concept with particular objects in the scene . Next , our model interprets supplemental sentences to relate the novel concept with other known concepts , such as “ X has property Y ” or “ X is a kind of Y ” . Finally , it infers an optimal box embedding for the novel concept that jointly 1 ) maximizes the likelihood of the observed instances in the image , and 2 ) satisfies the relationships between the novel concepts and the known ones . We demonstrate the effectiveness of our model on both synthetic and real-world datasets . 1 INTRODUCTION . Humans build a cumulative knowledge repository of visual concepts throughout their lives from a diverse set of inputs : by looking at images , reading sentences that describe the properties of the concept , etc . Importantly , adding a novel concept to the knowledge repository requires only a small amount of data , such as a few images about the concept and a short textual description ( Bloom , 2000 ; Swingley , Daniel , 2010 ; Carey & Bartlett , 1978 ) . Take Fig . 1 as an example : from just a single image that contains many objects ( Fig . 1a ) , as well as a short descriptive sentence that describes a new concept red : “ the object left of the yellow cube is red ” , humans can effortlessly ground the novel word “ red ” with the visual appearance of the object being referred to ( Bloom , 2000 ) . Supplemental sentences such as “ red is a kind of color ” ( Fig . 1b ) may provide additional information : “ red ” objects should be classified based on their hue . This further supports us to generalize the learned concept “ red ” to objects of various shapes , sizes , and materials . Finally , the acquired concept can be used flexibly in other tasks such as question answering ( Fig . 1c ) . Our goal is to build machines that can learn concepts that are associated with the physical world in an incremental manner and flexibly use them to answer queries . To learn a new concept , for example , the word red in Fig . 1a , the system should 1 ) interpret the semantics of the descriptive sentence composed of other concepts , such as left , yellow , and cube , 2 ) instantiate a representation for the novel concept that is associated with the visual appearance of the referred object , 3 ) mediate the concept representation based on the supplemental sentences that describe the property of the concept or relate it with other concepts , and 4 ) use the learned concept flexibly in different concepts . A framework that can solve these challenges will allow us to build machines that can better learn from human and communicate with human . To address these challenges , in this paper , we present a unified framework , FALCON ( FAst Learning of novel visual CONcepts ) . FALCON maintains a collection of embedding vectors for individual visual concepts , which naturally grows in an incremental way as it learns more concepts . A neuro- symbolic concept learning and reasoning framework learns new concepts by looking at images and reading paired sentences , and use them to answer incoming queries . Concretely , FALCON represents individual visual concepts , such as colors and shapes , as axis-aligned boxes in a high-dimensional space ( the “ box embedding space ” ( Vilnis et al. , 2018 ) ) , while objects in different images will be embedded into the same latent space as points . We say object X has property Y if the embedding vector X is inside the embedding box of Y . Given an input image and its paired sentence , our model first resolves the referential expression in the sentence using the previously seen concepts ( e.g. , left , yellow , and cube ) and associate the novel concept with particular objects in the scene . Next , our model interprets supplemental sentences to relate the novel concept with other known concepts ( e.g. , yellow ) . To infer the box embedding of the novel concept , we train a neural network to predict the optimal box embedding for the novel concept that jointly 1 ) maximizes the data likelihood of the observed examples , and 2 ) satisfies the relationships between the novel concepts and the known ones . This module is trained with a meta-learning procedure . Our paper makes the following contributions . First , we present a unified neuro-symbolic framework for fast visual concept learning from diverse data streams . Second , we introduce a new concept embedding prediction module that learns to integrate visual examples and conceptual relations to infer a novel concept embedding . Finally , we build a protocol for generating meta-learning test cases for evaluating fast visual concept learning , by augmenting existing visual reasoning datasets and knowledge graphs . By evaluation on both synthetic and natural image datasets , we show that our model learns more accurate representations for novel concepts compared with existing baselines for fast concept learning . Systematical studies also show that our model can efficiently use the supplemental concept descriptions to resolve ambiguities in the visual examples . We also provide discussions about the design of different modules in our system . 2 RELATED WORKS . Visual concept learning and visual reasoning . Visual reasoning aims to reason about object properties and their relationships in given images , usually evaluated as the question-answering accuracy ( Johnson et al. , 2017a ; Hudson & Manning , 2018 ; Mascharka et al. , 2018 ; Hu et al. , 2018 ) . Recently , there has been an increasing amount of work has been focusing on using neuro-symbolic frameworks to bridge visual concept learning and visual reasoning ( Yi et al. , 2018 ; Mao et al. , 2019 ; Li et al. , 2020 ) . The high-level idea is to disentangle concept learning : association of linguistic units with visual representations , and reasoning : the ability to count objects or make queries . Han et al . ( 2019 ) recently shown how jointly learning concepts and metaconcepts can help each other . Our work is an novel approach towards making use of the metaconcepts in a meta-learning setting aiming at boost the learning of novel concepts based on known ones . Few-shot visual learning . Recent work has studied learning to classify visual scene with very limited labeled examples ( Vinyals et al. , 2016 ; Sung et al. , 2018 ; Snell et al. , 2017 ) or even without any example ( Wang et al. , 2018 ; Kampffmeyer et al. , 2019 ; Tian et al. , 2020 ) . For few-shot learning , existing work proposes to compare the similarity , such as cosine similarity ( Vinyals et al. , 2016 ) and Euclidean distance ( Snell et al. , 2017 ) , between examples , while ( Sung et al. , 2018 ) introduces a learnable module to predict such similarities . In addition , ( Gidaris & Komodakis , 2018 ) learns a weight generator to predict the classifier for classes with very few examples . ( Ravi & Larochelle , 2017 ; Finn et al. , 2017 ; Nichol et al. , 2018 ) address this problem by learning the initialization for gradient-based optimization .. ( Santoro et al. , 2016 ) used external memory to facilitate learning process , while ( Munkhdalai & Yu , 2017 ) uses meta-knowledge among task for rapid adaptation . Our module design is inspired by these work , but we use a language interface : novel concepts are learnt from paired images and texts and evaluated on visual reasoning tasks . Geometric embeddings . In contrast to representing concepts in vector spaces ( Kiros et al. , 2014 ) , a geometric embedding framework associates each concept with a geometric entity such as a Gaussian distribution ( Vilnis & McCallum , 2015 ) , the intersection of hyperplanes ( Vendrov et al. , 2016 ; Vilnis et al. , 2018 ) , and a hyperbolic cone ( Ganea et al. , 2018 ) . Among them , box embeddings ( Vilnis et al. , 2018 ) which map each concept to a hyper-box in the high-dimensional space , have been popular for concept representation : ( Li , Xiang and Vilnis , Luke and Zhang , Dongxu and Boratko , Michael and McCallum , Andrew , 2019 ) proposed a smooth training objective , and ( Ren et al. , 2020 ) uses box embeddings for reasoning over knowledge graphs . In this paper , we extend the box embedding from knowledge graphs to visual domains , and compare it with other concept embeddings . 3 FALCON . The proposed model , FALCON , learns visual concepts by simultaneously looking at images , reading sentences that describe the objects in the scene , and interpreting supplemental sentences that describe the properties of the novel concepts . FALCON learns to learn novel concepts quickly and in a continual manner . We start with a formal definition of our fast and continual concept learning task . Problem formulation . Each concept learning task is a 4-tuple ( c , Xc , Dc , Tc ) . Denote c as the novel concept to be learned ( e.g. , red ) . Models learn to recognize red objects by looking at paired images xi and sentences yi : Xc = { ( xi , yi ) } . Optionally , supplementary sentences Dc = { di } describe the concept c by relating it to other known concepts . After learning , the model will be tested on downstream tasks . In this paper , we specifically focus on visual reasoning : the ability to answer questions about objects in the testing set Tc , which is represented as pairs of images and questions . There are two possible options to approach this problem . One is manually specifying rules to compute the representation for the new concept . In this paper , we focus on a meta-learning approach : to build a system that can learn to learn new concept . Our training data is data tuples for a set of training concepts ( base concepts , Cbase ) . After training , the system is evaluated on a collection of novel concepts ( Ctest ) . That is , we will provide our system with Xc and Dc for a novel concept c , and test it on visual reasoning data Tc . Thus , the system works in a continual learning fashion : the description of a new concept depends on a previously learned concept . Overview . Fig . 2 gives an overview of our proposed model , FALCON . Our key idea is to represent each concept as an axis-aligned box in a high-dimensional space ( the “ box embedding space ” , Section 3.1 ) . Given example images xi and descriptions yi ( Fig . 2a ) , FALCON interprets the referential expression in yi as a symbolic program ( Fig . 2a2 ) . An neuro-symbolic reasoning module executes the inferred program to locate the object being referred to ( Fig . 2a3 ) , see Section 3.2 . Meanwhile , supplementary descriptions Dc ( Fig . 2b ) will be translated into relational representations of concepts ( Fig . 2b1 ) , i.e. , how the new concept c relates to other known concepts . Based on the examples of the novel concept and its relationships with other concepts , we formulate the task of novel concept learning as learning to infer the best concept embedding for c in the box embedding space , evaluated on downstream tasks ( Fig . 2c ) . Once the model learned , we will be using the same neuro-symbolic module for answering questions in the testing set Tc .
The paper describes an approach to learn visual concepts with a few examples. The paper considers a problem consisting of paired images and sentences, optional concept descriptions, and the target question answering task for a new concept. The proposed approach utilizes the object detector (He 2017) to map visual objects or relationship into the box embedding space (Vilnis 2018), and also utilizes a neuro-symbolic program to identify the referring object as well as relationship among concepts. The new concept representation is inferred after the two graph neural networks, and the networks are trained to solve for the downstream task, which in this paper is question answering. The proposed approach is evaluated in three benchmarks (CUB, CLEVR, GQA) and shown to outperform the recent baselines (Hudson &Manning 2018, Mao 2019).
SP:e997a0442758fe349e2ae90129796ed560dc0200
Understanding Metric Learning on Unit Hypersphere and Generating Better Examples for Adversarial Training
1 INTRODUCTION . Deep metric learning ( DML ) has been applied to various computer vision tasks ranging from face recognition ( Schroff et al. , 2015 ; Liu et al. , 2017 ) to zero-shot learning ( Romera-Paredes & Torr , 2015 ; Bucher et al. , 2016 ) and image retrieval ( Song et al. , 2016 ; Wu et al. , 2017 ) . It has been proved to be one of the most effective methods for learning the distance-preserving features of images . The intuition of DML is to pull the embedding of positive images pairs together and push the negative pairs apart , where the embedding function could be a deep neural network . Most of the metric losses in DML are tuple-based ( Schroff et al. , 2015 ; Song et al. , 2016 ; Wu et al. , 2017 ; Wang et al. , 2019 ) or classification-based ( Movshovitz-Attias et al. , 2017 ; Kim et al. , 2020 ; Boudiaf et al. , 2020 ) , these different losses have been shown to achieve similar performance in the recent reviews of DML ( Roth et al. , 2020 ; Musgrave et al. , 2020 ) . One common ground of existing DML models is that the embedding space is a unit hypersphere . It is widely known that achieving uniformity on hypersphere can increase the generalization of models and preserve as much information as possible ( Bachman et al. , 2019 ; Liu et al. , 2018 ; 2021 ; Hjelm et al. , 2018 ) , and the objective function that lead to uniformity is called uniformity regularization . Meanwhile , the downstream tasks in DML favor the models with small intra-class alignment ( Wu et al. , 2017 ; Wang et al. , 2019 ) . In this work , we investigate these two properties , intra-class alignment and hyperspherical uniformity ( Wang & Isola , 2020 ) for tuple-based metric losses . We derive the theoretical analysis for the triplet loss to prove that the triplet loss on the positive sample pairs minimizes the intra-class alignment by mapping all samples from one class to the same vector , while the triplet loss on the negative sample pairs achieves hyperspherical uniformity . We further conduct empirical studies to show that the same statement is also valid for other tuple-based metric losses . We utilize our new understanding on DML to design novel robust DML methods to enhance the performance via improved adversarial training . Adversarial training aims at improving the robustness of models towards to certain types of attacks by training with perturbed samples . However , as shown in the recent work on contrastive representation learning ( Jiang et al. , 2020 ) , adversarial training can also enhance the natural performance on the downstream classification task . Due to the similarity between contrastive learning and deep metric learning , we believe it ’ s also possible to improve the nature performance of metric learning models with adversarial samples . Following our new insights on positive and negative metric losses , we generate perturbations by attacking the alignment or uniformity objective , and create adversarial DML models augmented with both normal samples and perturbed samples . Our experimental results show that the new adversarial DML models can significantly boost the natural performance . The major contributions of our paper can be summarized as follows : • We analyze the intra-class alignment and hyperspherical uniformity for tuple-based metric losses , and establish the connections between these two properties and the positive/negative metric losses . • Based on our new analysis and understanding , we propose two new adversarial DML models , ADML+A and ADML+U , via attacking the alignment or uniformity objective . ADML+A and ADML+U improve the natural performance on benchmarks significantly . 2 RELATED WORKS . Deep metric learning . There are mainly two kind of metric losses in DML , tuple-based and classification based losses . Tuple-based losses include contrastive loss ( Hadsell et al. , 2006 ) , triplet loss ( Schroff et al. , 2015 ) , margin loss ( Wu et al. , 2017 ) , and multi-similarity loss ( Wang et al. , 2019 ) , where the objective function is based on the distance between positive pairs and negative pairs . In classification-based losses , the learning objective is not depend on the positive or negative pairs but a fixed ( Boudiaf et al. , 2020 ) or learnable proxy ( Kim et al. , 2020 ) . In the recent reviews of metric learning methods ( Roth et al. , 2020 ; Musgrave et al. , 2020 ) , it ’ s concluded the improvement on the DML performance is mainly due to different training strategies and unfair comparison . The original contrastive loss and triplet loss still achieved comparable result with other metric losses under the same network and training strategies . In experiments we apply the training framework of ( Roth et al. , 2020 ) to ensure fair comparison . Learning with hyperspherical uniformity . Hyperspherical learning regards learning tasks where the embedding space is a unit hypersphere . The uniformity of the hypersphere represents the diversity of vectors on the sphere . It encourages vectors to be spaced with angles as large as possible so that these vectors can be evenly distributed on the hypersphere ( Liu et al. , 2018 ) . Achieving hyperspherical uniformity can help with preventing overfitting and improving generalization of the neural works ( Liu et al. , 2021 ) . The objective functions which can lead to the uniformity on hypersphere are called uniformity regularization . Hyperspherical embedding is widely applied in representation learning tasks such as contrastive representation learning ( Oord et al. , 2018 ; Hjelm et al. , 2018 ) and DML ( Wu et al. , 2017 ; Liu et al. , 2017 ) . Wang & Isola ( 2020 ) showed that the objective function in contrastive representation learning optimizes for intra-class alignment and uniformity together . Adversarial examples improves natural performance . In classification tasks , it is well known that the clean accuracy of adversarially trained model is typically worse than the normal model . However , Xie et al . ( 2020 ) showed that adversarial samples can be used to improve the clean accuracy of image classification models . According to ( Jiang et al. , 2020 ) , training with adversarial samples can help improve the natural performance of contrastive learning models on the downstream classification tasks . The authors presented adversarial attacks based on the objective of contrastive learning and achieved improvement on both natural and robustness performance . It ’ s believed that adversarial examples contain extra features , thus the generalization of models augmented with adversarial example is increased ( Ilyas et al. , 2019 ; Salman et al. , 2020 ; Xie et al. , 2020 ) , which contributes to better natural performance . Duan et al . ( 2018 ) utilized the triplet loss as the attacking objective to generate adversarial examples to improve DML models . To our best knowledge , this is the only one work using adversarial example to boost the natural performance of DML . In our work , we show that alignment and uniformity loss can generate stronger adversarial examples comparing to triplet loss , and thus lead to better generalization of DML models . 3 ALIGNMENT AND HYPERSPHERICAL UNIFORMITY IN TUPLE-BASED METRIC LOSSES . In this section , we will study tuple-based metric losses on the unit hypersphere embedding space . We assume having n classes X1 , · · · , Xn in training set and denote the encoder by f : Rd → Sk−1 where Sk−1 is the surface of a k-dimensional unit ball . Let pdata ( · ) be the data distribution over Rd , ppos ( · , · ) be the distribution of positive pairs over Rd ×Rd , and ptri ( · , · , · ) be the distribution of triplet pairs over Rd × Rd × Rd , where the first two entries have the same label and the third entry is a sample from different classes . Please note that all detailed proofs are included in supplementary material Appendix E. We also conduct experiments to validate our theoretical analysis , the details is in Appendix C. The major intuition of DML is to pull the representations of similar samples together and push dissimilar samples apart . Thus , we reformulate the metric losses as the combination of two parts : • Positive metric loss : minimizes the distance between embedded positive sample pairs . • Negative metric loss : maximizes the distance between embedded negative sample pairs . Although in DML models the positive metric losses have different representations , they share one common optimal solution pattern , where samples from the same class are mapped to the same feature vector . Thus , we define the alignment loss with minimizing the intra-class distance . Definition 1 . ( Intra-class alignment ) The expectation of intra-class distance is given by : Lalignment ( f ; X , ppos ) : = E ( x , y ) ∼ppos [ ||f ( x ) − f ( y ) ||22 ] ( 1 ) the minimum of this loss is achieved when the samples with the same label are encoded to the same embedding . Proposition 1 . If the support set of the data distribution is connected and the support set of each class distribution is closed , the minimum of Lalignment is reached when all samples are projected to the same vector . In Sec . C.1 , we conduct the empirical studies to verify our analysis . Results in Table 8 show that samples are roughly projected to the same vector if only the positive metric losses are used . The negative metric losses aim at positioning the embedding of dissimilar samples as far as possible . However , because the embedding space of DML is a unit hypersphere , where the maximum distance between two points is 2 , it ’ s not possible to separate all negative embeddings with a large margin . Actually on Sk−1 , the number of points with pairwise distance larger or equal than √ 2 is at most 2k and the embedding dimension k is always much smaller than the number of feature vectors , thus it ’ s impossible to make all distances between negative pairs exceed √ 2 . Therefore investigating the properties of negative metric losses on the unit hypersphere is an interesting and important topic . We believe the negative metric losses are closely related to the uniformity on the hypersphere and our experimental results support this argument . Definition 2 . ( Hyperspherical uniformity ) The embedded samples should be evenly distributed on the spherical surface . In practice , the hyperspherical uniformity can be achieved by optimizing the uniformity regularization . There exist many different representations of the regularization , and we utilize the hyperspherical energy ( HE ) ( Liu et al. , 2018 ) : E ( s , X ) = { Ex∼pdata , y∼pdata [ ||f ( x ) − f ( y ) || −s 2 1x ̸=y ] , s > 0 Ex∼pdata , y∼pdata [ log ( ||f ( x ) − f ( y ) || −1 2 1x ̸=y ) ] , s = 0 ( 2 ) and Gaussian hyperspherical energy ( G-HE ) ( Wang & Isola , 2020 ) : EG ( s , X ) = logEx∼pdata , y∼pdata [ e−s||f ( x ) −f ( y ) || 2 2 ] , s > 0 ( 3 ) in the experiments for comparison . The values of HE and G-HE can also be used as measurements on the uniformity of the embedded samples . We expect the value to be small in order to achieve good hyperspherical uniformity . We also want to mention that simply maximizing the distance between samples will not lead to hyperspherical uniformity , and the detailed discussion is in Sec . B.2 . Because finding the optimal solution of the HE or G-HE problem is NP-hard ( Liu et al. , 2018 ) , we are not able to calculate the exact position of vectors which are evenly distributed on the sphere . We provide a primary insight about how should finite vectors be uniformly distributed on unit hypersphere , and our conclusion is consist with the empirical results . Since there exist many different tuple-based metric losses , analyzing all of them theoretically is impossible in this work . In Sec . 3.1 , we will provide the theoretical analysis of the triplet loss . The analysis of linear loss can be found in Sec . B.2 . In Appendix C we will show the empirical results on four popularly used tuple-based metric losses to verify our statement .
This work introduces novel adversarial deep metric learning algorithm based on the fact that contrastive losses promote intra-class alignment and uniformity on the unit sphere. The authors provide a theoretical proof that this is also true for the triplet loss under mild assumptions. The adversarial examples used to regularize the training are generated by targeting the alignment and uniformity terms separately. This regularization strategy results in a significant robustness/performance boost on deep metric learning benchmarks.
SP:7d4b574870c6641b61fdb758d31e8801bc8ee8c1
Understanding Metric Learning on Unit Hypersphere and Generating Better Examples for Adversarial Training
1 INTRODUCTION . Deep metric learning ( DML ) has been applied to various computer vision tasks ranging from face recognition ( Schroff et al. , 2015 ; Liu et al. , 2017 ) to zero-shot learning ( Romera-Paredes & Torr , 2015 ; Bucher et al. , 2016 ) and image retrieval ( Song et al. , 2016 ; Wu et al. , 2017 ) . It has been proved to be one of the most effective methods for learning the distance-preserving features of images . The intuition of DML is to pull the embedding of positive images pairs together and push the negative pairs apart , where the embedding function could be a deep neural network . Most of the metric losses in DML are tuple-based ( Schroff et al. , 2015 ; Song et al. , 2016 ; Wu et al. , 2017 ; Wang et al. , 2019 ) or classification-based ( Movshovitz-Attias et al. , 2017 ; Kim et al. , 2020 ; Boudiaf et al. , 2020 ) , these different losses have been shown to achieve similar performance in the recent reviews of DML ( Roth et al. , 2020 ; Musgrave et al. , 2020 ) . One common ground of existing DML models is that the embedding space is a unit hypersphere . It is widely known that achieving uniformity on hypersphere can increase the generalization of models and preserve as much information as possible ( Bachman et al. , 2019 ; Liu et al. , 2018 ; 2021 ; Hjelm et al. , 2018 ) , and the objective function that lead to uniformity is called uniformity regularization . Meanwhile , the downstream tasks in DML favor the models with small intra-class alignment ( Wu et al. , 2017 ; Wang et al. , 2019 ) . In this work , we investigate these two properties , intra-class alignment and hyperspherical uniformity ( Wang & Isola , 2020 ) for tuple-based metric losses . We derive the theoretical analysis for the triplet loss to prove that the triplet loss on the positive sample pairs minimizes the intra-class alignment by mapping all samples from one class to the same vector , while the triplet loss on the negative sample pairs achieves hyperspherical uniformity . We further conduct empirical studies to show that the same statement is also valid for other tuple-based metric losses . We utilize our new understanding on DML to design novel robust DML methods to enhance the performance via improved adversarial training . Adversarial training aims at improving the robustness of models towards to certain types of attacks by training with perturbed samples . However , as shown in the recent work on contrastive representation learning ( Jiang et al. , 2020 ) , adversarial training can also enhance the natural performance on the downstream classification task . Due to the similarity between contrastive learning and deep metric learning , we believe it ’ s also possible to improve the nature performance of metric learning models with adversarial samples . Following our new insights on positive and negative metric losses , we generate perturbations by attacking the alignment or uniformity objective , and create adversarial DML models augmented with both normal samples and perturbed samples . Our experimental results show that the new adversarial DML models can significantly boost the natural performance . The major contributions of our paper can be summarized as follows : • We analyze the intra-class alignment and hyperspherical uniformity for tuple-based metric losses , and establish the connections between these two properties and the positive/negative metric losses . • Based on our new analysis and understanding , we propose two new adversarial DML models , ADML+A and ADML+U , via attacking the alignment or uniformity objective . ADML+A and ADML+U improve the natural performance on benchmarks significantly . 2 RELATED WORKS . Deep metric learning . There are mainly two kind of metric losses in DML , tuple-based and classification based losses . Tuple-based losses include contrastive loss ( Hadsell et al. , 2006 ) , triplet loss ( Schroff et al. , 2015 ) , margin loss ( Wu et al. , 2017 ) , and multi-similarity loss ( Wang et al. , 2019 ) , where the objective function is based on the distance between positive pairs and negative pairs . In classification-based losses , the learning objective is not depend on the positive or negative pairs but a fixed ( Boudiaf et al. , 2020 ) or learnable proxy ( Kim et al. , 2020 ) . In the recent reviews of metric learning methods ( Roth et al. , 2020 ; Musgrave et al. , 2020 ) , it ’ s concluded the improvement on the DML performance is mainly due to different training strategies and unfair comparison . The original contrastive loss and triplet loss still achieved comparable result with other metric losses under the same network and training strategies . In experiments we apply the training framework of ( Roth et al. , 2020 ) to ensure fair comparison . Learning with hyperspherical uniformity . Hyperspherical learning regards learning tasks where the embedding space is a unit hypersphere . The uniformity of the hypersphere represents the diversity of vectors on the sphere . It encourages vectors to be spaced with angles as large as possible so that these vectors can be evenly distributed on the hypersphere ( Liu et al. , 2018 ) . Achieving hyperspherical uniformity can help with preventing overfitting and improving generalization of the neural works ( Liu et al. , 2021 ) . The objective functions which can lead to the uniformity on hypersphere are called uniformity regularization . Hyperspherical embedding is widely applied in representation learning tasks such as contrastive representation learning ( Oord et al. , 2018 ; Hjelm et al. , 2018 ) and DML ( Wu et al. , 2017 ; Liu et al. , 2017 ) . Wang & Isola ( 2020 ) showed that the objective function in contrastive representation learning optimizes for intra-class alignment and uniformity together . Adversarial examples improves natural performance . In classification tasks , it is well known that the clean accuracy of adversarially trained model is typically worse than the normal model . However , Xie et al . ( 2020 ) showed that adversarial samples can be used to improve the clean accuracy of image classification models . According to ( Jiang et al. , 2020 ) , training with adversarial samples can help improve the natural performance of contrastive learning models on the downstream classification tasks . The authors presented adversarial attacks based on the objective of contrastive learning and achieved improvement on both natural and robustness performance . It ’ s believed that adversarial examples contain extra features , thus the generalization of models augmented with adversarial example is increased ( Ilyas et al. , 2019 ; Salman et al. , 2020 ; Xie et al. , 2020 ) , which contributes to better natural performance . Duan et al . ( 2018 ) utilized the triplet loss as the attacking objective to generate adversarial examples to improve DML models . To our best knowledge , this is the only one work using adversarial example to boost the natural performance of DML . In our work , we show that alignment and uniformity loss can generate stronger adversarial examples comparing to triplet loss , and thus lead to better generalization of DML models . 3 ALIGNMENT AND HYPERSPHERICAL UNIFORMITY IN TUPLE-BASED METRIC LOSSES . In this section , we will study tuple-based metric losses on the unit hypersphere embedding space . We assume having n classes X1 , · · · , Xn in training set and denote the encoder by f : Rd → Sk−1 where Sk−1 is the surface of a k-dimensional unit ball . Let pdata ( · ) be the data distribution over Rd , ppos ( · , · ) be the distribution of positive pairs over Rd ×Rd , and ptri ( · , · , · ) be the distribution of triplet pairs over Rd × Rd × Rd , where the first two entries have the same label and the third entry is a sample from different classes . Please note that all detailed proofs are included in supplementary material Appendix E. We also conduct experiments to validate our theoretical analysis , the details is in Appendix C. The major intuition of DML is to pull the representations of similar samples together and push dissimilar samples apart . Thus , we reformulate the metric losses as the combination of two parts : • Positive metric loss : minimizes the distance between embedded positive sample pairs . • Negative metric loss : maximizes the distance between embedded negative sample pairs . Although in DML models the positive metric losses have different representations , they share one common optimal solution pattern , where samples from the same class are mapped to the same feature vector . Thus , we define the alignment loss with minimizing the intra-class distance . Definition 1 . ( Intra-class alignment ) The expectation of intra-class distance is given by : Lalignment ( f ; X , ppos ) : = E ( x , y ) ∼ppos [ ||f ( x ) − f ( y ) ||22 ] ( 1 ) the minimum of this loss is achieved when the samples with the same label are encoded to the same embedding . Proposition 1 . If the support set of the data distribution is connected and the support set of each class distribution is closed , the minimum of Lalignment is reached when all samples are projected to the same vector . In Sec . C.1 , we conduct the empirical studies to verify our analysis . Results in Table 8 show that samples are roughly projected to the same vector if only the positive metric losses are used . The negative metric losses aim at positioning the embedding of dissimilar samples as far as possible . However , because the embedding space of DML is a unit hypersphere , where the maximum distance between two points is 2 , it ’ s not possible to separate all negative embeddings with a large margin . Actually on Sk−1 , the number of points with pairwise distance larger or equal than √ 2 is at most 2k and the embedding dimension k is always much smaller than the number of feature vectors , thus it ’ s impossible to make all distances between negative pairs exceed √ 2 . Therefore investigating the properties of negative metric losses on the unit hypersphere is an interesting and important topic . We believe the negative metric losses are closely related to the uniformity on the hypersphere and our experimental results support this argument . Definition 2 . ( Hyperspherical uniformity ) The embedded samples should be evenly distributed on the spherical surface . In practice , the hyperspherical uniformity can be achieved by optimizing the uniformity regularization . There exist many different representations of the regularization , and we utilize the hyperspherical energy ( HE ) ( Liu et al. , 2018 ) : E ( s , X ) = { Ex∼pdata , y∼pdata [ ||f ( x ) − f ( y ) || −s 2 1x ̸=y ] , s > 0 Ex∼pdata , y∼pdata [ log ( ||f ( x ) − f ( y ) || −1 2 1x ̸=y ) ] , s = 0 ( 2 ) and Gaussian hyperspherical energy ( G-HE ) ( Wang & Isola , 2020 ) : EG ( s , X ) = logEx∼pdata , y∼pdata [ e−s||f ( x ) −f ( y ) || 2 2 ] , s > 0 ( 3 ) in the experiments for comparison . The values of HE and G-HE can also be used as measurements on the uniformity of the embedded samples . We expect the value to be small in order to achieve good hyperspherical uniformity . We also want to mention that simply maximizing the distance between samples will not lead to hyperspherical uniformity , and the detailed discussion is in Sec . B.2 . Because finding the optimal solution of the HE or G-HE problem is NP-hard ( Liu et al. , 2018 ) , we are not able to calculate the exact position of vectors which are evenly distributed on the sphere . We provide a primary insight about how should finite vectors be uniformly distributed on unit hypersphere , and our conclusion is consist with the empirical results . Since there exist many different tuple-based metric losses , analyzing all of them theoretically is impossible in this work . In Sec . 3.1 , we will provide the theoretical analysis of the triplet loss . The analysis of linear loss can be found in Sec . B.2 . In Appendix C we will show the empirical results on four popularly used tuple-based metric losses to verify our statement .
In this paper, the authors provided elegant similarities between contrastive learning and deep metric learning. They decomposed contrastive loss objectives into two quantities evaluating the geometry of the learned representation space: 1. Alignment, and, 2. Uniformity. Where Alignment is the closeness that defines how close two positive pairs are on the embedding space. While the uniformity ensures the scattered. The authors found the representation learned by optimizing contrastive objective indeed has these two properties compared to representation learned using supervised objective. They also showed that both alignment and uniformity are required for learning better examples for adversarial example tasks.
SP:7d4b574870c6641b61fdb758d31e8801bc8ee8c1
Understanding Metric Learning on Unit Hypersphere and Generating Better Examples for Adversarial Training
1 INTRODUCTION . Deep metric learning ( DML ) has been applied to various computer vision tasks ranging from face recognition ( Schroff et al. , 2015 ; Liu et al. , 2017 ) to zero-shot learning ( Romera-Paredes & Torr , 2015 ; Bucher et al. , 2016 ) and image retrieval ( Song et al. , 2016 ; Wu et al. , 2017 ) . It has been proved to be one of the most effective methods for learning the distance-preserving features of images . The intuition of DML is to pull the embedding of positive images pairs together and push the negative pairs apart , where the embedding function could be a deep neural network . Most of the metric losses in DML are tuple-based ( Schroff et al. , 2015 ; Song et al. , 2016 ; Wu et al. , 2017 ; Wang et al. , 2019 ) or classification-based ( Movshovitz-Attias et al. , 2017 ; Kim et al. , 2020 ; Boudiaf et al. , 2020 ) , these different losses have been shown to achieve similar performance in the recent reviews of DML ( Roth et al. , 2020 ; Musgrave et al. , 2020 ) . One common ground of existing DML models is that the embedding space is a unit hypersphere . It is widely known that achieving uniformity on hypersphere can increase the generalization of models and preserve as much information as possible ( Bachman et al. , 2019 ; Liu et al. , 2018 ; 2021 ; Hjelm et al. , 2018 ) , and the objective function that lead to uniformity is called uniformity regularization . Meanwhile , the downstream tasks in DML favor the models with small intra-class alignment ( Wu et al. , 2017 ; Wang et al. , 2019 ) . In this work , we investigate these two properties , intra-class alignment and hyperspherical uniformity ( Wang & Isola , 2020 ) for tuple-based metric losses . We derive the theoretical analysis for the triplet loss to prove that the triplet loss on the positive sample pairs minimizes the intra-class alignment by mapping all samples from one class to the same vector , while the triplet loss on the negative sample pairs achieves hyperspherical uniformity . We further conduct empirical studies to show that the same statement is also valid for other tuple-based metric losses . We utilize our new understanding on DML to design novel robust DML methods to enhance the performance via improved adversarial training . Adversarial training aims at improving the robustness of models towards to certain types of attacks by training with perturbed samples . However , as shown in the recent work on contrastive representation learning ( Jiang et al. , 2020 ) , adversarial training can also enhance the natural performance on the downstream classification task . Due to the similarity between contrastive learning and deep metric learning , we believe it ’ s also possible to improve the nature performance of metric learning models with adversarial samples . Following our new insights on positive and negative metric losses , we generate perturbations by attacking the alignment or uniformity objective , and create adversarial DML models augmented with both normal samples and perturbed samples . Our experimental results show that the new adversarial DML models can significantly boost the natural performance . The major contributions of our paper can be summarized as follows : • We analyze the intra-class alignment and hyperspherical uniformity for tuple-based metric losses , and establish the connections between these two properties and the positive/negative metric losses . • Based on our new analysis and understanding , we propose two new adversarial DML models , ADML+A and ADML+U , via attacking the alignment or uniformity objective . ADML+A and ADML+U improve the natural performance on benchmarks significantly . 2 RELATED WORKS . Deep metric learning . There are mainly two kind of metric losses in DML , tuple-based and classification based losses . Tuple-based losses include contrastive loss ( Hadsell et al. , 2006 ) , triplet loss ( Schroff et al. , 2015 ) , margin loss ( Wu et al. , 2017 ) , and multi-similarity loss ( Wang et al. , 2019 ) , where the objective function is based on the distance between positive pairs and negative pairs . In classification-based losses , the learning objective is not depend on the positive or negative pairs but a fixed ( Boudiaf et al. , 2020 ) or learnable proxy ( Kim et al. , 2020 ) . In the recent reviews of metric learning methods ( Roth et al. , 2020 ; Musgrave et al. , 2020 ) , it ’ s concluded the improvement on the DML performance is mainly due to different training strategies and unfair comparison . The original contrastive loss and triplet loss still achieved comparable result with other metric losses under the same network and training strategies . In experiments we apply the training framework of ( Roth et al. , 2020 ) to ensure fair comparison . Learning with hyperspherical uniformity . Hyperspherical learning regards learning tasks where the embedding space is a unit hypersphere . The uniformity of the hypersphere represents the diversity of vectors on the sphere . It encourages vectors to be spaced with angles as large as possible so that these vectors can be evenly distributed on the hypersphere ( Liu et al. , 2018 ) . Achieving hyperspherical uniformity can help with preventing overfitting and improving generalization of the neural works ( Liu et al. , 2021 ) . The objective functions which can lead to the uniformity on hypersphere are called uniformity regularization . Hyperspherical embedding is widely applied in representation learning tasks such as contrastive representation learning ( Oord et al. , 2018 ; Hjelm et al. , 2018 ) and DML ( Wu et al. , 2017 ; Liu et al. , 2017 ) . Wang & Isola ( 2020 ) showed that the objective function in contrastive representation learning optimizes for intra-class alignment and uniformity together . Adversarial examples improves natural performance . In classification tasks , it is well known that the clean accuracy of adversarially trained model is typically worse than the normal model . However , Xie et al . ( 2020 ) showed that adversarial samples can be used to improve the clean accuracy of image classification models . According to ( Jiang et al. , 2020 ) , training with adversarial samples can help improve the natural performance of contrastive learning models on the downstream classification tasks . The authors presented adversarial attacks based on the objective of contrastive learning and achieved improvement on both natural and robustness performance . It ’ s believed that adversarial examples contain extra features , thus the generalization of models augmented with adversarial example is increased ( Ilyas et al. , 2019 ; Salman et al. , 2020 ; Xie et al. , 2020 ) , which contributes to better natural performance . Duan et al . ( 2018 ) utilized the triplet loss as the attacking objective to generate adversarial examples to improve DML models . To our best knowledge , this is the only one work using adversarial example to boost the natural performance of DML . In our work , we show that alignment and uniformity loss can generate stronger adversarial examples comparing to triplet loss , and thus lead to better generalization of DML models . 3 ALIGNMENT AND HYPERSPHERICAL UNIFORMITY IN TUPLE-BASED METRIC LOSSES . In this section , we will study tuple-based metric losses on the unit hypersphere embedding space . We assume having n classes X1 , · · · , Xn in training set and denote the encoder by f : Rd → Sk−1 where Sk−1 is the surface of a k-dimensional unit ball . Let pdata ( · ) be the data distribution over Rd , ppos ( · , · ) be the distribution of positive pairs over Rd ×Rd , and ptri ( · , · , · ) be the distribution of triplet pairs over Rd × Rd × Rd , where the first two entries have the same label and the third entry is a sample from different classes . Please note that all detailed proofs are included in supplementary material Appendix E. We also conduct experiments to validate our theoretical analysis , the details is in Appendix C. The major intuition of DML is to pull the representations of similar samples together and push dissimilar samples apart . Thus , we reformulate the metric losses as the combination of two parts : • Positive metric loss : minimizes the distance between embedded positive sample pairs . • Negative metric loss : maximizes the distance between embedded negative sample pairs . Although in DML models the positive metric losses have different representations , they share one common optimal solution pattern , where samples from the same class are mapped to the same feature vector . Thus , we define the alignment loss with minimizing the intra-class distance . Definition 1 . ( Intra-class alignment ) The expectation of intra-class distance is given by : Lalignment ( f ; X , ppos ) : = E ( x , y ) ∼ppos [ ||f ( x ) − f ( y ) ||22 ] ( 1 ) the minimum of this loss is achieved when the samples with the same label are encoded to the same embedding . Proposition 1 . If the support set of the data distribution is connected and the support set of each class distribution is closed , the minimum of Lalignment is reached when all samples are projected to the same vector . In Sec . C.1 , we conduct the empirical studies to verify our analysis . Results in Table 8 show that samples are roughly projected to the same vector if only the positive metric losses are used . The negative metric losses aim at positioning the embedding of dissimilar samples as far as possible . However , because the embedding space of DML is a unit hypersphere , where the maximum distance between two points is 2 , it ’ s not possible to separate all negative embeddings with a large margin . Actually on Sk−1 , the number of points with pairwise distance larger or equal than √ 2 is at most 2k and the embedding dimension k is always much smaller than the number of feature vectors , thus it ’ s impossible to make all distances between negative pairs exceed √ 2 . Therefore investigating the properties of negative metric losses on the unit hypersphere is an interesting and important topic . We believe the negative metric losses are closely related to the uniformity on the hypersphere and our experimental results support this argument . Definition 2 . ( Hyperspherical uniformity ) The embedded samples should be evenly distributed on the spherical surface . In practice , the hyperspherical uniformity can be achieved by optimizing the uniformity regularization . There exist many different representations of the regularization , and we utilize the hyperspherical energy ( HE ) ( Liu et al. , 2018 ) : E ( s , X ) = { Ex∼pdata , y∼pdata [ ||f ( x ) − f ( y ) || −s 2 1x ̸=y ] , s > 0 Ex∼pdata , y∼pdata [ log ( ||f ( x ) − f ( y ) || −1 2 1x ̸=y ) ] , s = 0 ( 2 ) and Gaussian hyperspherical energy ( G-HE ) ( Wang & Isola , 2020 ) : EG ( s , X ) = logEx∼pdata , y∼pdata [ e−s||f ( x ) −f ( y ) || 2 2 ] , s > 0 ( 3 ) in the experiments for comparison . The values of HE and G-HE can also be used as measurements on the uniformity of the embedded samples . We expect the value to be small in order to achieve good hyperspherical uniformity . We also want to mention that simply maximizing the distance between samples will not lead to hyperspherical uniformity , and the detailed discussion is in Sec . B.2 . Because finding the optimal solution of the HE or G-HE problem is NP-hard ( Liu et al. , 2018 ) , we are not able to calculate the exact position of vectors which are evenly distributed on the sphere . We provide a primary insight about how should finite vectors be uniformly distributed on unit hypersphere , and our conclusion is consist with the empirical results . Since there exist many different tuple-based metric losses , analyzing all of them theoretically is impossible in this work . In Sec . 3.1 , we will provide the theoretical analysis of the triplet loss . The analysis of linear loss can be found in Sec . B.2 . In Appendix C we will show the empirical results on four popularly used tuple-based metric losses to verify our statement .
This paper first analyzes the tuple-based metric losses on the hyperspherical space and studies two objective functions: intra-class alignment and hyperspherical uniformity. Then based on these two objective functions, the paper develops two ways of generating adversarial examples for improving deep metric learning. The empirical results show some advantages of the proposed method.
SP:7d4b574870c6641b61fdb758d31e8801bc8ee8c1
When Vision Transformers Outperform ResNets without Pre-training or Strong Data Augmentations
1 INTRODUCTION . Transformers ( Vaswani et al. , 2017 ) have become the de-facto model of choice in natural language processing ( NLP ) ( Devlin et al. , 2018 ; Radford et al. , 2018 ) . In computer vision , there has recently been a surge of interest in end-to-end Transformers ( Dosovitskiy et al. , 2021 ; Touvron et al. , 2021b ; Liu et al. , 2021b ; Fan et al. , 2021 ; Arnab et al. , 2021 ; Bertasius et al. , 2021 ; Akbari et al. , 2021 ) and MLPs ( Tolstikhin et al. , 2021 ; Touvron et al. , 2021a ; Liu et al. , 2021a ; Melas-Kyriazi , 2021 ) , prompting the efforts to replace hand-wired features or inductive biases with general-purpose neural architectures powered by data-driven training . We envision these efforts may lead to a unified knowledge base that produces versatile representations for different data modalities , simplifying the inference and deployment of deep learning models in various application scenarios . Despite the appealing potential of moving toward general-purpose neural architectures , the lack of convolution-like inductive bias also challenges the training of vision Transformers ( ViTs ) and MLPs . When trained on ImageNet ( Deng et al. , 2009 ) with the conventional Inception-style data preprocessing ( Szegedy et al. , 2016 ) , Transformers “ yield modest accuracies of a few percentage points below ResNets of comparable size ” ( Dosovitskiy et al. , 2021 ) . To boost the performance , existing works resort to large-scale pre-training ( Dosovitskiy et al. , 2021 ; Arnab et al. , 2021 ; Akbari et al. , 2021 ) and repeated strong data augmentations ( Touvron et al. , 2021b ) , resulting in excessive demands of data , computing , and sophisticated tuning of many hyperparameters . For instance , Dosovitskiy et al . ( Dosovitskiy et al. , 2021 ) pre-train ViTs using 304M labeled images , and Touvron et al . ( 2021b ) repeatedly stack four strong image augmentations . In this paper , we show ViTs can outperform ResNets ( He et al. , 2016 ) of even bigger sizes in both accuracy and various forms of robustness by using a principled optimizer , without the need for largescale pre-training or strong data augmentations . MLP-Mixers ( Tolstikhin et al. , 2021 ) also become on par with ResNets . We first study the architectures fully trained on ImageNet from the lens of loss landscapes and draw the following findings . First , visualization and Hessian matrices of the loss landscapes reveal that Transformers and MLP-Mixers converge at extremely sharp local minima , whose largest principal curvatures are almost an order of magnitude bigger than ResNets . Such effect accumulates when the gradients backpropagate from the last layer to the first , and the initial embedding layer suffers the largest eigenvalue of the corresponding sub-diagonal Hessian . Second , the networks all have very small training errors , and MLP-Mixers are more prone to overfitting than ViTs of more parameters ( because of the difference in self-attention ) . Third , ViTs and MLP-Mixers have worse “ trainabilities ” than ResNets following the neural tangent kernel analyses ( Xiao et al. , 2020 ) . Therefore , we need improved learning algorithms to prevent the convergence to a sharp local minima when it comes to the convolution-free ViTs and and MLP-Mixers . The first-order optimizers ( e.g. , SGD and Adam ( Kingma & Ba , 2015 ) ) only seek the model parameters that minimize the training error . They dismiss the higher-order information such as flatness that correlates with the generalization ( Keskar et al. , 2017 ; Kleinberg et al. , 2018 ; Jastrzębski et al. , 2019 ; Smith & Le , 2018 ; Chaudhari et al. , 2017 ) . The above study and reasoning lead us to the recently proposed sharpness-aware minimizer ( SAM ) ( Foret et al. , 2021 ) that explicitly smooths the loss geometry during model training . SAM strives to find a solution whose entire neighborhood has low losses rather than focus on any singleton point . We show that the resultant models exhibit smoother loss landscapes , and their generalization capabilities improve tremendously across different tasks including supervised , adversarial , contrastive , and transfer learning ( e.g. , +5.3 % and +11.0 % top-1 accuracy on ImageNet for ViTB/16 and Mixer-B/16 , respectively , with the simple Inception-style preprocessing ) . The enhanced ViTs achieve better accuracy and robustness than ResNets of similar and bigger sizes when trained from scratch on ImageNet , without large-scale pre-training or strong data augmentations . Moreover , we demonstrate that SAM can even enable the ViT to be effectively trained with ( momentum ) SGD , which usually lies far behind Adam when training Transformers ( Zhang et al. , 2020 ) . By analyzing some intrinsic model properties , we observe that SAM increases the sparsity of active neurons ( especially for the first few layers ) , which contribute to the reduced Hessian eigenvalues . The weight norms increase , implying the commonly used weight decay may not be an effective regularization alone . A side observation is that , unlike ResNets and MLP-Mixers , ViTs have extremely sparse active neurons ( see Figure 2 ( right ) ) , revealing the potential for network pruning ( Akbari et al. , 2021 ) . Another interesting finding is that ViTs ’ performance gain also translates to visually more interpretable attention maps . Finally , we draw similarities between SAM and strong augmentations ( e.g. , mixup ) in that they both smooth the average loss geometry and encourage the models to behave linearly between training images . 2 BACKGROUND AND RELATED WORK . We briefly review ViTs , MLP-Mixers , and some related works in this section . Dosovitskiy et al . ( 2021 ) show that a pure Transformer architecture ( Vaswani et al. , 2017 ) can achieve state-of-the-art accuracy on image classification by pre-training it on large datasets such as ImageNet-21k ( Deng et al. , 2009 ) and JFT-300M ( Sun et al. , 2017 ) . Their vision Transformer ( ViT ) is a stack of residual blocks , each containing a multi-head self-attention , layer normalization ( Ba et al. , 2016 ) , and a MLP layer . ViT first embeds an input image x ∈ RH×W×C into a se- quence of features z ∈ RN×D by applying a linear projection overN nonoverlapping image patches xp ∈ RN× ( P 2·C ) , where D is the feature dimension , P is the patch resolution , and N = HW/P 2 is the sequence length . The self-attention layers in ViT are global and do not possess the locality and translation equivariance of convolutions . ViT is compatible with the popular architectures in NLP ( Devlin et al. , 2018 ; Radford et al. , 2018 ) and , similar to its NLP counterparts , requires pretraining over massive datasets ( Dosovitskiy et al. , 2021 ; Akbari et al. , 2021 ; Arnab et al. , 2021 ) or strong data augmentations ( Touvron et al. , 2021b ) . Some works specialize the ViT architectures for the visual data ( Liu et al. , 2021b ; Yuan et al. , 2021 ; Fan et al. , 2021 ; Bertasius et al. , 2021 ) . More recent works find that the self-attention in ViT is not vital for performance , resulting in several architectures exclusively based on MLPs ( Tolstikhin et al. , 2021 ; Touvron et al. , 2021a ; Liu et al. , 2021a ; Melas-Kyriazi , 2021 ) . Here we take MLP-Mixer ( Tolstikhin et al. , 2021 ) as an example . MLP-Mixer shares the same input layer as ViT ; namely , it partitions an image into a sequence of nonoverlapping patches/tokens . It then alternates between token and channel MLPs , where the former allows feature fusion from different spatial locations . We focus on ViTs and MLP-Mixers in this paper . We denote by “ S ” and “ B ” the small and base model sizes , respectively , and by an integer the image patch resolution . For instance , ViT-B/16 is the base ViT model taking as input a sequence of 16×16 patches . Appendices contain more details . 3 VITS AND MLP-MIXERS CONVERGE TO SHARP LOCAL MINIMA . The current training recipe of ViTs , MLP-Mixers , and related convolution-free architectures relies heavily on massive pre-training ( Dosovitskiy et al. , 2021 ; Arnab et al. , 2021 ; Akbari et al. , 2021 ) or a bag of strong data augmentations ( Touvron et al. , 2021b ; Tolstikhin et al. , 2021 ; Cubuk et al. , 2019 ; 2020 ; Zhang et al. , 2018 ; Yun et al. , 2019 ) . It highly demands data and computing , and leads to many hyperparameters to tune . Existing works report that ViTs yield inferior accuracy to the ConvNets of similar size and throughput when trained from scratch on ImageNet without the combination of those advanced data augmentations , despite using various regularization techniques ( e.g. , large weight decay , Dropout ( Srivastava et al. , 2014 ) , etc. ) . For instance , ViT-B/16 ( Dosovitskiy et al. , 2021 ) gives rise to 74.6 % top-1 accuracy on the ImageNet validation set ( 224 image resolution ) , compared with 78.5 % of ResNet-152 ( He et al. , 2016 ) . Mixer-B/16 ( Tolstikhin et al. , 2021 ) performs even worse ( 66.4 % ) . There also exists a large gap between ViTs and ResNets in robustness tests ( e.g. , against 19 corruptions in ImageNet-C ( Hendrycks & Dietterich , 2019 ) ) ( see Table 2 for ImageNet-R and ImageNet-C results ) . Moreover , Chen et al . ( 2021c ) find that the gradients can spike and cause a sudden accuracy dip when training ViTs , and Touvron et al . ( 2021b ) report the training is sensitive to initialization and hyperparameters . These all point to optimization problems . In this paper , we investigate the loss landscapes of ViTs and MLP-Mixers to understand them from the optimization perspective , intending to reduce their dependency on the large-scale pre-training or strong data augmentations . ViTs and MLP-Mixers converge to extremely sharp local minima . It has been extensively studied that the convergence to a flat region whose curvature is small benefits the generalization of neural networks ( Keskar et al. , 2017 ; Kleinberg et al. , 2018 ; Jastrzębski et al. , 2019 ; Chen & Hsieh , 2020 ; Smith & Le , 2018 ; Zela et al. , 2020 ; Chaudhari et al. , 2017 ) . Following Li et al . ( 2018 ) , we plot the loss landscapes at convergence when ResNets , ViTs , and MLP-Mixers are trained from scratch on ImageNet with the basic Inception-style preprocessing ( Szegedy et al. , 2016 ) ( see Appendices for details ) . As shown in Figures 1 ( a ) to 1 ( c ) , ViTs and MLP-Mixers converge to much sharper regions than ResNets . Besides , we calculate the training error under Gaussian perturbations on the model parameters LNtrain = E ∼N [ Ltrain ( w + ) ] in Table 1 , which reveals the average flatness . Although ViT-B/16 and Mixer-B/16 achieve lower Ltrain than ResNet-152 , their loss values after random weight perturbation become much higher . We further validate the results by computing the dominate Hessian eigenvalue λmax , which is a mathematical evaluation of the worst-case landscape curvature . The λmax values of ViT and MLP-Mixer are orders of magnitude larger than that of ResNet , and MLP-Mixer suffers the largest curvature among the three species ( see Section 4.4 for a detailed analysis ) . Small training errors . This convergence to sharp regions coincides with the training dynamics shown in Figure 2 ( left ) . Although Mixer-B/16 has fewer parameters than ViT-B/16 ( 59M vs. 87M ) , it has a smaller training error ( also seeLtrain in Table 1 ) but much worse test accuracy , implying that using the cross-token MLP to learn the interplay across image patches is more prone to overfitting than ViTs ’ self-attention mechanism whose behavior is restricted by a softmax . To validate this statement , we simply remove the softmax in ViT-B/16 , such that the query and key matrices can freely interact with each other . Although having lower Ltrain ( 0.56 vs. 0.65 ) , the obtained ViTB/16-Free performs much worse than the original ViT-B/16 ( 70.5 % vs. 74.6 % ) . Its LNtrain and λmax are 7.01 and 1236.2 , revealing that ViT-B/16-Free converges to a sharper region than ViTB/16 ( LNtrain is 6.66 and λmax is 738.8 ) both on average and in the worst-case direction . Such a difference probably explains why it is easier for MLP-Mixers to get stuck in sharp local minima . ViTs and MLP-Mixers have worse trainability . Furthermore , we discover that ViTs and MLPMixers suffer poor trainability , defined as the effectiveness of a network to be optimized by gradient descent ( Xiao et al. , 2020 ; Burkholz & Dubatovka , 2019 ; Shin & Karniadakis , 2020 ) . Xiao et al . ( 2020 ) show that the trainability of a neural network can be characterized by the condition number of the associated neural tangent kernel ( NTK ) , Θ ( x , x′ ) = J ( x ) J ( x′ ) T , where J is the Jacobian matrix . Denoting by λ1 ≥ · · · ≥ λm the eigenvalues of NTK Θtrain , the smallest eigenvalue λm converges exponentially at a rate given by the condition number κ = λ1/λm . If κ diverges then the network will become untrainable ( Xiao et al. , 2020 ; Chen et al. , 2021a ) . As shown in Table 1 , κ is pretty stable for ResNets , echoing previous results that ResNets enjoy superior trainability regardless of the depth ( Yang & Schoenholz , 2017 ; Li et al. , 2018 ) . However , we observe that the condition number diverges when it comes to ViT and MLP-Mixer , confirming that the training of ViTs desires extra care ( Chen et al. , 2021c ; Touvron et al. , 2021b ) .
The authors analyze the effects of sharpness-aware minimization (SAM) when applied to vision transformers (ViTs) and MLP-Mixers. They find that the converged loss surface of ViTs and MLP-Mixers is sharp compared to ResNets, and that SAM ameliorates this issue, yielding improved validation accuracy on ImageNet. They then show that SAM improves the performance of ViTs and MLP-Mixers in a variety of image classification scenarios including adversarial attacks, naturalistic corruptions, contrastive training, and transfer learning. They also examine the effect of SAM on activation sparsity, activation maps, and the relationships between different model architecture components and loss surface sharpness.
SP:8bc9b7782cfec66106794be59add718d70084481
When Vision Transformers Outperform ResNets without Pre-training or Strong Data Augmentations
1 INTRODUCTION . Transformers ( Vaswani et al. , 2017 ) have become the de-facto model of choice in natural language processing ( NLP ) ( Devlin et al. , 2018 ; Radford et al. , 2018 ) . In computer vision , there has recently been a surge of interest in end-to-end Transformers ( Dosovitskiy et al. , 2021 ; Touvron et al. , 2021b ; Liu et al. , 2021b ; Fan et al. , 2021 ; Arnab et al. , 2021 ; Bertasius et al. , 2021 ; Akbari et al. , 2021 ) and MLPs ( Tolstikhin et al. , 2021 ; Touvron et al. , 2021a ; Liu et al. , 2021a ; Melas-Kyriazi , 2021 ) , prompting the efforts to replace hand-wired features or inductive biases with general-purpose neural architectures powered by data-driven training . We envision these efforts may lead to a unified knowledge base that produces versatile representations for different data modalities , simplifying the inference and deployment of deep learning models in various application scenarios . Despite the appealing potential of moving toward general-purpose neural architectures , the lack of convolution-like inductive bias also challenges the training of vision Transformers ( ViTs ) and MLPs . When trained on ImageNet ( Deng et al. , 2009 ) with the conventional Inception-style data preprocessing ( Szegedy et al. , 2016 ) , Transformers “ yield modest accuracies of a few percentage points below ResNets of comparable size ” ( Dosovitskiy et al. , 2021 ) . To boost the performance , existing works resort to large-scale pre-training ( Dosovitskiy et al. , 2021 ; Arnab et al. , 2021 ; Akbari et al. , 2021 ) and repeated strong data augmentations ( Touvron et al. , 2021b ) , resulting in excessive demands of data , computing , and sophisticated tuning of many hyperparameters . For instance , Dosovitskiy et al . ( Dosovitskiy et al. , 2021 ) pre-train ViTs using 304M labeled images , and Touvron et al . ( 2021b ) repeatedly stack four strong image augmentations . In this paper , we show ViTs can outperform ResNets ( He et al. , 2016 ) of even bigger sizes in both accuracy and various forms of robustness by using a principled optimizer , without the need for largescale pre-training or strong data augmentations . MLP-Mixers ( Tolstikhin et al. , 2021 ) also become on par with ResNets . We first study the architectures fully trained on ImageNet from the lens of loss landscapes and draw the following findings . First , visualization and Hessian matrices of the loss landscapes reveal that Transformers and MLP-Mixers converge at extremely sharp local minima , whose largest principal curvatures are almost an order of magnitude bigger than ResNets . Such effect accumulates when the gradients backpropagate from the last layer to the first , and the initial embedding layer suffers the largest eigenvalue of the corresponding sub-diagonal Hessian . Second , the networks all have very small training errors , and MLP-Mixers are more prone to overfitting than ViTs of more parameters ( because of the difference in self-attention ) . Third , ViTs and MLP-Mixers have worse “ trainabilities ” than ResNets following the neural tangent kernel analyses ( Xiao et al. , 2020 ) . Therefore , we need improved learning algorithms to prevent the convergence to a sharp local minima when it comes to the convolution-free ViTs and and MLP-Mixers . The first-order optimizers ( e.g. , SGD and Adam ( Kingma & Ba , 2015 ) ) only seek the model parameters that minimize the training error . They dismiss the higher-order information such as flatness that correlates with the generalization ( Keskar et al. , 2017 ; Kleinberg et al. , 2018 ; Jastrzębski et al. , 2019 ; Smith & Le , 2018 ; Chaudhari et al. , 2017 ) . The above study and reasoning lead us to the recently proposed sharpness-aware minimizer ( SAM ) ( Foret et al. , 2021 ) that explicitly smooths the loss geometry during model training . SAM strives to find a solution whose entire neighborhood has low losses rather than focus on any singleton point . We show that the resultant models exhibit smoother loss landscapes , and their generalization capabilities improve tremendously across different tasks including supervised , adversarial , contrastive , and transfer learning ( e.g. , +5.3 % and +11.0 % top-1 accuracy on ImageNet for ViTB/16 and Mixer-B/16 , respectively , with the simple Inception-style preprocessing ) . The enhanced ViTs achieve better accuracy and robustness than ResNets of similar and bigger sizes when trained from scratch on ImageNet , without large-scale pre-training or strong data augmentations . Moreover , we demonstrate that SAM can even enable the ViT to be effectively trained with ( momentum ) SGD , which usually lies far behind Adam when training Transformers ( Zhang et al. , 2020 ) . By analyzing some intrinsic model properties , we observe that SAM increases the sparsity of active neurons ( especially for the first few layers ) , which contribute to the reduced Hessian eigenvalues . The weight norms increase , implying the commonly used weight decay may not be an effective regularization alone . A side observation is that , unlike ResNets and MLP-Mixers , ViTs have extremely sparse active neurons ( see Figure 2 ( right ) ) , revealing the potential for network pruning ( Akbari et al. , 2021 ) . Another interesting finding is that ViTs ’ performance gain also translates to visually more interpretable attention maps . Finally , we draw similarities between SAM and strong augmentations ( e.g. , mixup ) in that they both smooth the average loss geometry and encourage the models to behave linearly between training images . 2 BACKGROUND AND RELATED WORK . We briefly review ViTs , MLP-Mixers , and some related works in this section . Dosovitskiy et al . ( 2021 ) show that a pure Transformer architecture ( Vaswani et al. , 2017 ) can achieve state-of-the-art accuracy on image classification by pre-training it on large datasets such as ImageNet-21k ( Deng et al. , 2009 ) and JFT-300M ( Sun et al. , 2017 ) . Their vision Transformer ( ViT ) is a stack of residual blocks , each containing a multi-head self-attention , layer normalization ( Ba et al. , 2016 ) , and a MLP layer . ViT first embeds an input image x ∈ RH×W×C into a se- quence of features z ∈ RN×D by applying a linear projection overN nonoverlapping image patches xp ∈ RN× ( P 2·C ) , where D is the feature dimension , P is the patch resolution , and N = HW/P 2 is the sequence length . The self-attention layers in ViT are global and do not possess the locality and translation equivariance of convolutions . ViT is compatible with the popular architectures in NLP ( Devlin et al. , 2018 ; Radford et al. , 2018 ) and , similar to its NLP counterparts , requires pretraining over massive datasets ( Dosovitskiy et al. , 2021 ; Akbari et al. , 2021 ; Arnab et al. , 2021 ) or strong data augmentations ( Touvron et al. , 2021b ) . Some works specialize the ViT architectures for the visual data ( Liu et al. , 2021b ; Yuan et al. , 2021 ; Fan et al. , 2021 ; Bertasius et al. , 2021 ) . More recent works find that the self-attention in ViT is not vital for performance , resulting in several architectures exclusively based on MLPs ( Tolstikhin et al. , 2021 ; Touvron et al. , 2021a ; Liu et al. , 2021a ; Melas-Kyriazi , 2021 ) . Here we take MLP-Mixer ( Tolstikhin et al. , 2021 ) as an example . MLP-Mixer shares the same input layer as ViT ; namely , it partitions an image into a sequence of nonoverlapping patches/tokens . It then alternates between token and channel MLPs , where the former allows feature fusion from different spatial locations . We focus on ViTs and MLP-Mixers in this paper . We denote by “ S ” and “ B ” the small and base model sizes , respectively , and by an integer the image patch resolution . For instance , ViT-B/16 is the base ViT model taking as input a sequence of 16×16 patches . Appendices contain more details . 3 VITS AND MLP-MIXERS CONVERGE TO SHARP LOCAL MINIMA . The current training recipe of ViTs , MLP-Mixers , and related convolution-free architectures relies heavily on massive pre-training ( Dosovitskiy et al. , 2021 ; Arnab et al. , 2021 ; Akbari et al. , 2021 ) or a bag of strong data augmentations ( Touvron et al. , 2021b ; Tolstikhin et al. , 2021 ; Cubuk et al. , 2019 ; 2020 ; Zhang et al. , 2018 ; Yun et al. , 2019 ) . It highly demands data and computing , and leads to many hyperparameters to tune . Existing works report that ViTs yield inferior accuracy to the ConvNets of similar size and throughput when trained from scratch on ImageNet without the combination of those advanced data augmentations , despite using various regularization techniques ( e.g. , large weight decay , Dropout ( Srivastava et al. , 2014 ) , etc. ) . For instance , ViT-B/16 ( Dosovitskiy et al. , 2021 ) gives rise to 74.6 % top-1 accuracy on the ImageNet validation set ( 224 image resolution ) , compared with 78.5 % of ResNet-152 ( He et al. , 2016 ) . Mixer-B/16 ( Tolstikhin et al. , 2021 ) performs even worse ( 66.4 % ) . There also exists a large gap between ViTs and ResNets in robustness tests ( e.g. , against 19 corruptions in ImageNet-C ( Hendrycks & Dietterich , 2019 ) ) ( see Table 2 for ImageNet-R and ImageNet-C results ) . Moreover , Chen et al . ( 2021c ) find that the gradients can spike and cause a sudden accuracy dip when training ViTs , and Touvron et al . ( 2021b ) report the training is sensitive to initialization and hyperparameters . These all point to optimization problems . In this paper , we investigate the loss landscapes of ViTs and MLP-Mixers to understand them from the optimization perspective , intending to reduce their dependency on the large-scale pre-training or strong data augmentations . ViTs and MLP-Mixers converge to extremely sharp local minima . It has been extensively studied that the convergence to a flat region whose curvature is small benefits the generalization of neural networks ( Keskar et al. , 2017 ; Kleinberg et al. , 2018 ; Jastrzębski et al. , 2019 ; Chen & Hsieh , 2020 ; Smith & Le , 2018 ; Zela et al. , 2020 ; Chaudhari et al. , 2017 ) . Following Li et al . ( 2018 ) , we plot the loss landscapes at convergence when ResNets , ViTs , and MLP-Mixers are trained from scratch on ImageNet with the basic Inception-style preprocessing ( Szegedy et al. , 2016 ) ( see Appendices for details ) . As shown in Figures 1 ( a ) to 1 ( c ) , ViTs and MLP-Mixers converge to much sharper regions than ResNets . Besides , we calculate the training error under Gaussian perturbations on the model parameters LNtrain = E ∼N [ Ltrain ( w + ) ] in Table 1 , which reveals the average flatness . Although ViT-B/16 and Mixer-B/16 achieve lower Ltrain than ResNet-152 , their loss values after random weight perturbation become much higher . We further validate the results by computing the dominate Hessian eigenvalue λmax , which is a mathematical evaluation of the worst-case landscape curvature . The λmax values of ViT and MLP-Mixer are orders of magnitude larger than that of ResNet , and MLP-Mixer suffers the largest curvature among the three species ( see Section 4.4 for a detailed analysis ) . Small training errors . This convergence to sharp regions coincides with the training dynamics shown in Figure 2 ( left ) . Although Mixer-B/16 has fewer parameters than ViT-B/16 ( 59M vs. 87M ) , it has a smaller training error ( also seeLtrain in Table 1 ) but much worse test accuracy , implying that using the cross-token MLP to learn the interplay across image patches is more prone to overfitting than ViTs ’ self-attention mechanism whose behavior is restricted by a softmax . To validate this statement , we simply remove the softmax in ViT-B/16 , such that the query and key matrices can freely interact with each other . Although having lower Ltrain ( 0.56 vs. 0.65 ) , the obtained ViTB/16-Free performs much worse than the original ViT-B/16 ( 70.5 % vs. 74.6 % ) . Its LNtrain and λmax are 7.01 and 1236.2 , revealing that ViT-B/16-Free converges to a sharper region than ViTB/16 ( LNtrain is 6.66 and λmax is 738.8 ) both on average and in the worst-case direction . Such a difference probably explains why it is easier for MLP-Mixers to get stuck in sharp local minima . ViTs and MLP-Mixers have worse trainability . Furthermore , we discover that ViTs and MLPMixers suffer poor trainability , defined as the effectiveness of a network to be optimized by gradient descent ( Xiao et al. , 2020 ; Burkholz & Dubatovka , 2019 ; Shin & Karniadakis , 2020 ) . Xiao et al . ( 2020 ) show that the trainability of a neural network can be characterized by the condition number of the associated neural tangent kernel ( NTK ) , Θ ( x , x′ ) = J ( x ) J ( x′ ) T , where J is the Jacobian matrix . Denoting by λ1 ≥ · · · ≥ λm the eigenvalues of NTK Θtrain , the smallest eigenvalue λm converges exponentially at a rate given by the condition number κ = λ1/λm . If κ diverges then the network will become untrainable ( Xiao et al. , 2020 ; Chen et al. , 2021a ) . As shown in Table 1 , κ is pretty stable for ResNets , echoing previous results that ResNets enjoy superior trainability regardless of the depth ( Yang & Schoenholz , 2017 ; Li et al. , 2018 ) . However , we observe that the condition number diverges when it comes to ViT and MLP-Mixer , confirming that the training of ViTs desires extra care ( Chen et al. , 2021c ; Touvron et al. , 2021b ) .
As the success of Vision Transformer ViT has shown its potentials for computer vision tasks, this paper investigates a more effective way of training a ViT understand a standard ImageNet pre-training setting such as no extra training data and no strong data augmentation. In general, without those conditions, a typical ViT can not perform as good as widely convolutional based network architectures such as ResNet. This paper addresses the issue from the point of loss landscape and then propose to use a better optimization strategy named Sharp-aware minimizer (SAM) for ViT related architecture optimization. With the proposed SAM, ViT can achieve better accuracy significantly understand standard ImageNet training/testing protocol. In addition to the improved performance on ImageNet, this paper further shows the visualization of the attention map and the improved performance on other applications such as contrastive learning and adversarial training.
SP:8bc9b7782cfec66106794be59add718d70084481
When Vision Transformers Outperform ResNets without Pre-training or Strong Data Augmentations
1 INTRODUCTION . Transformers ( Vaswani et al. , 2017 ) have become the de-facto model of choice in natural language processing ( NLP ) ( Devlin et al. , 2018 ; Radford et al. , 2018 ) . In computer vision , there has recently been a surge of interest in end-to-end Transformers ( Dosovitskiy et al. , 2021 ; Touvron et al. , 2021b ; Liu et al. , 2021b ; Fan et al. , 2021 ; Arnab et al. , 2021 ; Bertasius et al. , 2021 ; Akbari et al. , 2021 ) and MLPs ( Tolstikhin et al. , 2021 ; Touvron et al. , 2021a ; Liu et al. , 2021a ; Melas-Kyriazi , 2021 ) , prompting the efforts to replace hand-wired features or inductive biases with general-purpose neural architectures powered by data-driven training . We envision these efforts may lead to a unified knowledge base that produces versatile representations for different data modalities , simplifying the inference and deployment of deep learning models in various application scenarios . Despite the appealing potential of moving toward general-purpose neural architectures , the lack of convolution-like inductive bias also challenges the training of vision Transformers ( ViTs ) and MLPs . When trained on ImageNet ( Deng et al. , 2009 ) with the conventional Inception-style data preprocessing ( Szegedy et al. , 2016 ) , Transformers “ yield modest accuracies of a few percentage points below ResNets of comparable size ” ( Dosovitskiy et al. , 2021 ) . To boost the performance , existing works resort to large-scale pre-training ( Dosovitskiy et al. , 2021 ; Arnab et al. , 2021 ; Akbari et al. , 2021 ) and repeated strong data augmentations ( Touvron et al. , 2021b ) , resulting in excessive demands of data , computing , and sophisticated tuning of many hyperparameters . For instance , Dosovitskiy et al . ( Dosovitskiy et al. , 2021 ) pre-train ViTs using 304M labeled images , and Touvron et al . ( 2021b ) repeatedly stack four strong image augmentations . In this paper , we show ViTs can outperform ResNets ( He et al. , 2016 ) of even bigger sizes in both accuracy and various forms of robustness by using a principled optimizer , without the need for largescale pre-training or strong data augmentations . MLP-Mixers ( Tolstikhin et al. , 2021 ) also become on par with ResNets . We first study the architectures fully trained on ImageNet from the lens of loss landscapes and draw the following findings . First , visualization and Hessian matrices of the loss landscapes reveal that Transformers and MLP-Mixers converge at extremely sharp local minima , whose largest principal curvatures are almost an order of magnitude bigger than ResNets . Such effect accumulates when the gradients backpropagate from the last layer to the first , and the initial embedding layer suffers the largest eigenvalue of the corresponding sub-diagonal Hessian . Second , the networks all have very small training errors , and MLP-Mixers are more prone to overfitting than ViTs of more parameters ( because of the difference in self-attention ) . Third , ViTs and MLP-Mixers have worse “ trainabilities ” than ResNets following the neural tangent kernel analyses ( Xiao et al. , 2020 ) . Therefore , we need improved learning algorithms to prevent the convergence to a sharp local minima when it comes to the convolution-free ViTs and and MLP-Mixers . The first-order optimizers ( e.g. , SGD and Adam ( Kingma & Ba , 2015 ) ) only seek the model parameters that minimize the training error . They dismiss the higher-order information such as flatness that correlates with the generalization ( Keskar et al. , 2017 ; Kleinberg et al. , 2018 ; Jastrzębski et al. , 2019 ; Smith & Le , 2018 ; Chaudhari et al. , 2017 ) . The above study and reasoning lead us to the recently proposed sharpness-aware minimizer ( SAM ) ( Foret et al. , 2021 ) that explicitly smooths the loss geometry during model training . SAM strives to find a solution whose entire neighborhood has low losses rather than focus on any singleton point . We show that the resultant models exhibit smoother loss landscapes , and their generalization capabilities improve tremendously across different tasks including supervised , adversarial , contrastive , and transfer learning ( e.g. , +5.3 % and +11.0 % top-1 accuracy on ImageNet for ViTB/16 and Mixer-B/16 , respectively , with the simple Inception-style preprocessing ) . The enhanced ViTs achieve better accuracy and robustness than ResNets of similar and bigger sizes when trained from scratch on ImageNet , without large-scale pre-training or strong data augmentations . Moreover , we demonstrate that SAM can even enable the ViT to be effectively trained with ( momentum ) SGD , which usually lies far behind Adam when training Transformers ( Zhang et al. , 2020 ) . By analyzing some intrinsic model properties , we observe that SAM increases the sparsity of active neurons ( especially for the first few layers ) , which contribute to the reduced Hessian eigenvalues . The weight norms increase , implying the commonly used weight decay may not be an effective regularization alone . A side observation is that , unlike ResNets and MLP-Mixers , ViTs have extremely sparse active neurons ( see Figure 2 ( right ) ) , revealing the potential for network pruning ( Akbari et al. , 2021 ) . Another interesting finding is that ViTs ’ performance gain also translates to visually more interpretable attention maps . Finally , we draw similarities between SAM and strong augmentations ( e.g. , mixup ) in that they both smooth the average loss geometry and encourage the models to behave linearly between training images . 2 BACKGROUND AND RELATED WORK . We briefly review ViTs , MLP-Mixers , and some related works in this section . Dosovitskiy et al . ( 2021 ) show that a pure Transformer architecture ( Vaswani et al. , 2017 ) can achieve state-of-the-art accuracy on image classification by pre-training it on large datasets such as ImageNet-21k ( Deng et al. , 2009 ) and JFT-300M ( Sun et al. , 2017 ) . Their vision Transformer ( ViT ) is a stack of residual blocks , each containing a multi-head self-attention , layer normalization ( Ba et al. , 2016 ) , and a MLP layer . ViT first embeds an input image x ∈ RH×W×C into a se- quence of features z ∈ RN×D by applying a linear projection overN nonoverlapping image patches xp ∈ RN× ( P 2·C ) , where D is the feature dimension , P is the patch resolution , and N = HW/P 2 is the sequence length . The self-attention layers in ViT are global and do not possess the locality and translation equivariance of convolutions . ViT is compatible with the popular architectures in NLP ( Devlin et al. , 2018 ; Radford et al. , 2018 ) and , similar to its NLP counterparts , requires pretraining over massive datasets ( Dosovitskiy et al. , 2021 ; Akbari et al. , 2021 ; Arnab et al. , 2021 ) or strong data augmentations ( Touvron et al. , 2021b ) . Some works specialize the ViT architectures for the visual data ( Liu et al. , 2021b ; Yuan et al. , 2021 ; Fan et al. , 2021 ; Bertasius et al. , 2021 ) . More recent works find that the self-attention in ViT is not vital for performance , resulting in several architectures exclusively based on MLPs ( Tolstikhin et al. , 2021 ; Touvron et al. , 2021a ; Liu et al. , 2021a ; Melas-Kyriazi , 2021 ) . Here we take MLP-Mixer ( Tolstikhin et al. , 2021 ) as an example . MLP-Mixer shares the same input layer as ViT ; namely , it partitions an image into a sequence of nonoverlapping patches/tokens . It then alternates between token and channel MLPs , where the former allows feature fusion from different spatial locations . We focus on ViTs and MLP-Mixers in this paper . We denote by “ S ” and “ B ” the small and base model sizes , respectively , and by an integer the image patch resolution . For instance , ViT-B/16 is the base ViT model taking as input a sequence of 16×16 patches . Appendices contain more details . 3 VITS AND MLP-MIXERS CONVERGE TO SHARP LOCAL MINIMA . The current training recipe of ViTs , MLP-Mixers , and related convolution-free architectures relies heavily on massive pre-training ( Dosovitskiy et al. , 2021 ; Arnab et al. , 2021 ; Akbari et al. , 2021 ) or a bag of strong data augmentations ( Touvron et al. , 2021b ; Tolstikhin et al. , 2021 ; Cubuk et al. , 2019 ; 2020 ; Zhang et al. , 2018 ; Yun et al. , 2019 ) . It highly demands data and computing , and leads to many hyperparameters to tune . Existing works report that ViTs yield inferior accuracy to the ConvNets of similar size and throughput when trained from scratch on ImageNet without the combination of those advanced data augmentations , despite using various regularization techniques ( e.g. , large weight decay , Dropout ( Srivastava et al. , 2014 ) , etc. ) . For instance , ViT-B/16 ( Dosovitskiy et al. , 2021 ) gives rise to 74.6 % top-1 accuracy on the ImageNet validation set ( 224 image resolution ) , compared with 78.5 % of ResNet-152 ( He et al. , 2016 ) . Mixer-B/16 ( Tolstikhin et al. , 2021 ) performs even worse ( 66.4 % ) . There also exists a large gap between ViTs and ResNets in robustness tests ( e.g. , against 19 corruptions in ImageNet-C ( Hendrycks & Dietterich , 2019 ) ) ( see Table 2 for ImageNet-R and ImageNet-C results ) . Moreover , Chen et al . ( 2021c ) find that the gradients can spike and cause a sudden accuracy dip when training ViTs , and Touvron et al . ( 2021b ) report the training is sensitive to initialization and hyperparameters . These all point to optimization problems . In this paper , we investigate the loss landscapes of ViTs and MLP-Mixers to understand them from the optimization perspective , intending to reduce their dependency on the large-scale pre-training or strong data augmentations . ViTs and MLP-Mixers converge to extremely sharp local minima . It has been extensively studied that the convergence to a flat region whose curvature is small benefits the generalization of neural networks ( Keskar et al. , 2017 ; Kleinberg et al. , 2018 ; Jastrzębski et al. , 2019 ; Chen & Hsieh , 2020 ; Smith & Le , 2018 ; Zela et al. , 2020 ; Chaudhari et al. , 2017 ) . Following Li et al . ( 2018 ) , we plot the loss landscapes at convergence when ResNets , ViTs , and MLP-Mixers are trained from scratch on ImageNet with the basic Inception-style preprocessing ( Szegedy et al. , 2016 ) ( see Appendices for details ) . As shown in Figures 1 ( a ) to 1 ( c ) , ViTs and MLP-Mixers converge to much sharper regions than ResNets . Besides , we calculate the training error under Gaussian perturbations on the model parameters LNtrain = E ∼N [ Ltrain ( w + ) ] in Table 1 , which reveals the average flatness . Although ViT-B/16 and Mixer-B/16 achieve lower Ltrain than ResNet-152 , their loss values after random weight perturbation become much higher . We further validate the results by computing the dominate Hessian eigenvalue λmax , which is a mathematical evaluation of the worst-case landscape curvature . The λmax values of ViT and MLP-Mixer are orders of magnitude larger than that of ResNet , and MLP-Mixer suffers the largest curvature among the three species ( see Section 4.4 for a detailed analysis ) . Small training errors . This convergence to sharp regions coincides with the training dynamics shown in Figure 2 ( left ) . Although Mixer-B/16 has fewer parameters than ViT-B/16 ( 59M vs. 87M ) , it has a smaller training error ( also seeLtrain in Table 1 ) but much worse test accuracy , implying that using the cross-token MLP to learn the interplay across image patches is more prone to overfitting than ViTs ’ self-attention mechanism whose behavior is restricted by a softmax . To validate this statement , we simply remove the softmax in ViT-B/16 , such that the query and key matrices can freely interact with each other . Although having lower Ltrain ( 0.56 vs. 0.65 ) , the obtained ViTB/16-Free performs much worse than the original ViT-B/16 ( 70.5 % vs. 74.6 % ) . Its LNtrain and λmax are 7.01 and 1236.2 , revealing that ViT-B/16-Free converges to a sharper region than ViTB/16 ( LNtrain is 6.66 and λmax is 738.8 ) both on average and in the worst-case direction . Such a difference probably explains why it is easier for MLP-Mixers to get stuck in sharp local minima . ViTs and MLP-Mixers have worse trainability . Furthermore , we discover that ViTs and MLPMixers suffer poor trainability , defined as the effectiveness of a network to be optimized by gradient descent ( Xiao et al. , 2020 ; Burkholz & Dubatovka , 2019 ; Shin & Karniadakis , 2020 ) . Xiao et al . ( 2020 ) show that the trainability of a neural network can be characterized by the condition number of the associated neural tangent kernel ( NTK ) , Θ ( x , x′ ) = J ( x ) J ( x′ ) T , where J is the Jacobian matrix . Denoting by λ1 ≥ · · · ≥ λm the eigenvalues of NTK Θtrain , the smallest eigenvalue λm converges exponentially at a rate given by the condition number κ = λ1/λm . If κ diverges then the network will become untrainable ( Xiao et al. , 2020 ; Chen et al. , 2021a ) . As shown in Table 1 , κ is pretty stable for ResNets , echoing previous results that ResNets enjoy superior trainability regardless of the depth ( Yang & Schoenholz , 2017 ; Li et al. , 2018 ) . However , we observe that the condition number diverges when it comes to ViT and MLP-Mixer , confirming that the training of ViTs desires extra care ( Chen et al. , 2021c ; Touvron et al. , 2021b ) .
This paper alleviate the dependency on massive pre-training and data augmentation. It promotes the smoothness using a recently proposed sharpness-aware optimizer to improve the accuracy and robustness of the ViTs and MLP-Mixers. This paper has demonstrated that the sharpness-aware optimizer could be leveraged to boost the performance of ViTs and MLP-Mixers without pretraining and strong augmentaitons on different tasks including supervised, adversarial, contrastive, and transfer learning.
SP:8bc9b7782cfec66106794be59add718d70084481
Model-Based Robust Adaptive Semantic Segmentation
1 INTRODUCTION . In recent years , computer vision has become one of the most promising research areas in deep learning because it has empowered a great amount of industry-level applications . In the context of computer vision , semantic segmentation is a core task formulated as a dense labeling problem Luc et al . ( 2016 ) , targeting to allocate every pixel with a label Hsin et al . ( 2019 ) of what is being represented . There are many applications now being used have made great progress with the help of semantic segmentation , such as medical image processing Xue et al . ( 2018 ) , autonomous vehicles Zhao et al . ( 2018 ) and robotics Wang et al . ( 2019 ) . However , many applications of semantic segmentation are life-critical , which means that low model accuracy may pose direct threat to human safety Oakden-Rayner et al . ( 2020 ) . Therefore , it is critical to design training algorithms that can enhance robustness of segmentation methods against input perturbations . A significant number of researches focusing on the robustness of computer vision have been conducted in recent years Arnab et al . ( 2018 ) Kamann & Rother ( 2020 ) Robey et al . ( 2020 ) Tramer et al . ( 2020 ) . However , the majority of existing works focus on image classification tasks Hendrycks & Dietterich ( 2019 ) . Robust semantic segmentation methods against adversarial attacks have been proposed in Hsin et al . ( 2019 ) Xue et al . ( 2018 ) Hung et al . ( 2018 ) Xie et al . ( 2017 ) . Work conducted by Goodfellow et al . ( 2015 ) proved that neural networks can be easily misled by some intentionally designed yet imperceptible perturbations to generate an incorrect answer with high confidence . In computer vision , adversarial attacks apply pixel-level changes onto the image that lead the model to wrong predictions , where the attacked image looks perceptually similar to the original one Ma et al . ( 2020 ) . Perturbation-based robust training algorithms have already tackled this problem . Nevertheless , in real life , there may be changes that raised by some out-of-distribution variations such as snow weather or extreme brightness that can not be represented using small pixel-level changes . Current works on robustness mainly focus on adapting the domain gap on a single side , i.e. , either from image or label side . For instance , Robey et al . ( 2020 ) proposed a model-based robust learning architecture which is applied on Convolutional Neural Networks ( CNN ) to maintain high prediction accuracy under natural variations for image classification tasks . Yet it is highly dependent on the performance of the natural variation model that capture the changes from source to target domain , which makes the algorithm less robust and less scalable in semantic segmentation task . Meanwhile , AdaptSegNet proposed by Tsai et al . ( 2020 ) minimizes the distribution gap on the output side . In this paper , we build upon Robey et al . ( 2020 ) to design a new robust training algorithm for semantic segmentation tasks . The objective is to build a segmentation model that generates high accuracy predictions under natural variation effects . Our method also utilize the idea from Tsai et al . ( 2020 ) that images from different domains with great appearance difference may share some similarity on the label side such as spatial layout and local context . We showed that the semantic feature map of an image under any natural variations remains unchanged which we refer to as semantic meaning invariance . Our proposed training algorithm minimizes the gap on both image and label side . On image side , the model-based robust training algorithm is applied to train a model using the simulated target domain images to enhance robustness . On label side , we apply generative adversarial networks ( GANs ) to minimize the feature map gap between simulated natural variation images and target domain images . We have also included extensive comparisons showing that our method outperforms related state-of-the-art works in domain adaptation . Our contributions are : 1 ) We propose MRTAdapt , a new model-based training algorithm to enhance robustness of DNN-based semantic segmentation methods against natural variations . 2 ) We build on top of generative adversarial networks and model-based robust training algorithms to minimize the gap on both image and label side to enhance robustness . 3 ) Our results on Cityscapes Cordts et al . ( 2016 ) and Synthia Ros et al . ( 2016 ) datasets show that our method outperforms multiple state-ofthe-art domain adaptation techniques , such as AdaptSegNet Tsai et al . ( 2020 ) , ADVENT Vu et al . ( 2019 ) and FDA Yang & Soatto ( 2020 ) . 2 RELATED WORK . Semantic Segmentation . In the past decades , Convolution Neural Networks ( CNN ) are widely used in semantic segmentation . Current state-of-the-art semantic segmentation frameworks are mostly developed from Fully Convolutional Network ( FCN ) by Long et al . ( 2015 ) . ResNet proposed by He et al . ( 2015 ) used a residual block to sum the nonlinear activation output and identity mapping , which is proved to improve the gradient propagation and increase the accuracy of semantic segmentation . DenseNet Huang et al . ( 2018a ) builds upon ResNet and uses the concatenation of previous feature maps called dense block . This gives each layer in DenseNet information from all preceding layers . Jégou et al . ( 2017 ) extended DenseNet into FCN architecture . SegNet proposed by Badrinarayanan et al . ( 2017 ) introduces the deep convolution encoder-decoder architecture to the field of semantic segmentation . Also , in Zhou et al . ( 2015 ) , it is proved that empirical size of receptive field is much smaller than the theoretical size . Chen et al . ( 2016 ) and Yu & Koltun ( 2016 ) used dilated convolution to enlarge the receptive field . ParseNet by Liu et al . ( 2015 ) adds global context to CNNs for semantic segmentation . He et al . ( 2014 ) introduced spatial pyramid pooling in DCNN . PSPNet introduced by Zhao et al . ( 2017 ) uses a novel global pyramid pooling module to capture both global context information . Duta et al . ( 2020 ) extended the idea by combining both local and global Pyramidal Convolution blocks in the neural network model . Chen et al . ( 2017b ) introduced atrous spatial pyramid pooling . Depth image is also used along with original RGB information for semantic segmentation by Wang et al . ( 2019 ) . For actual applications , Zhao et al . ( 2018 ) proposed ICNet for real-time semantic segmentation accomplishing fast inference without sacrificing too much quality left behind . Azimi et al . ( 2020 ) proposed aerial perspective dataset for dense semantic segmentation . Domain Adaptation . Combining with the techniques of Generative Adversarial Network ( GAN ) Goodfellow et al . ( 2014 ) , Ganin & Lempitsky ( 2015 ) proposed DANN to reduce the distribution gap between different domains by using discriminator to make the prediction can not be identified between source and target domain . Pan et al . ( 2020 ) first separate target domain into splits based on entropy-based ranking and then deploy self-supervised adaptation technique to reduce the domain gap between synthetic data and real images . PIT proposed by Lv et al . ( 2020 ) constructs pivot information shared across domains . Chen et al . ( 2019 ) used depth image as guided information to build adaptation method from synthetic to real dataset . In the field of utilizing synthetic datasets to auxiliate the training process of real-world images , MUNIT proposed by Huang et al . ( 2018b ) learn conditional distribution of target domain which can separate domain-invariant semantic content of an image from domain-specific properties . Vu proposed ADVENT model which maximize prediction certainty in target domain by introducing entropy loss Vu et al . ( 2019 ) . Zhu proposed CycleGAN Zhu et al . ( 2020 ) which was trying to learn a mapping such that the distribution of generated image is indistinguishable from the target domain distribution using adversarial loss . AdaptSegNet proposed by Tsai et al . ( 2020 ) aimed to reduce the gap between the outputs from source and target domain given that images might be very different in appearance . FDA proposed by Yang & Soatto ( 2020 ) uses Fast Fourier Transform ( FFT ) to adapt source and target domain . Robustness . As for robustness against corrupted images , Hendrycks & Dietterich ( 2019 ) established rigorous benchmarks for image classification and proposed a series of image corruption examples . Kamann & Rother ( 2020 ) showed that robustness increases with the performance of the semantic segmentation model and dense prediction cell was only designed to improve performance on clean data . Regarding robustness on semantic segmentation , Arnab et al . ( 2018 ) did the first evaluation of adversarial attacks on semantic segmentation and analyzed multi-scale processing . Robey et al . ( 2020 ) proposed model-based robust training architecture focusing on the topic of image classification . Wong & Kolter ( 2020 ) bridged the gap between real-world perturbations and adversarial defenses by learning perturbation sets from data , through common image corruptions . 3 METHOD . In this section we propose a new robust training algorithm for semantic segmentation tasks . Particularly , in section 3.1 , we define the semantic segmentation task and the natural variations . In section 3.2 , we give the outline of our proposed algorithm . In section 3.3 , we define semantic meaning invariance and clarify its connection to our algorithm . In section 3.4 , we introduce the detailed training procedure of our model-based robust adaptive training algorithm ( MRTAdapt ) . 3.1 SEMANTIC SEGMENTATION AND NATURAL VARIATION . Consider an input x ∈ RH×W×3 representing an RGB image with three channels and its corresponding label map y ∈ RH×W which is annotated for every pixel in the image . A semantic segmentation task is to train a neural network that generates pixel-wise segmentation feature map ŷ ∈ RH×W . We assume the dataset is drawn i.i.d . from distribution ( x , y ) ∼ P. The optimization objective in semantic segmentation is to find the best weight w that minimizes the loss function L ( x , y ; w ) with respect to input x , label y and weight w , which can be written as : min w 1 n n∑ j=1 [ L ( x , y ; w ) ] ( 1 ) Next we denote by δ ∈ ∆ a natural variation applied to x that is derived from a nuisance space ∆ . A model of natural variation can be learned from the difference of source and target domain images . Particularly , we denote the natural variation model that transforms the input image x from the source domain into an image in the ( perturbed ) target domain as V ( x , δ ) . Note that , in general , it is hard to write a natural variation model learned from data into an analytical form because there is no closed form expression capturing the natural perturbation . Natural variation model can be customized regarding the needs of each dataset . In this paper , our goal is to design a semantic segmentation method that is robust to natural variations δ . 3.2 ALGORITHM OVERVIEW . Our proposed model-based robust adaptive training algorithm ( MRTAdapt ) shown in Figure 1 has two modules : a segmentation network G using a model-based robust training algorithm to enhance robustness on image side , and a discriminator network D to enhance robustness on label side . Two sets of images from source and target domain will have the notation of Is and It , while the image generated using natural variation model will be denoted as Inv . After using source domain images to train the model , we transform images from source domain with natural variation model . Then we use simulated natural variation images to find the highest segmentation loss by applying the model-based robust training algorithm to optimize the segmentation network . Then we predict the segmentation softmax output for the unlabeled target domain images It by forwarding the target images into the same segmentation network . To minimize the gap between the output of natural variation images and target domain images , we use these two predictions as the input to the discriminator to distinguish whether the feature map generated by segmentation network is from natural variation model or target domain . Using an adversarial loss for discriminator , the loss will back-propagate to segmentation network to help segmentation network to generate similar distributions in target domain to natural variation . Detailed information will be covered in the following sections .
The paper proposes a discriminator-generator-based approach for robust semantic segmentation of images against natural variations such as snow, day/night (brightness). The input training image is first modified (perturbation in brightness, generating images with snow), and then fed to PSPNet to generate feature map for these perturbed images. Similarly, the original images (without perturbation) are fed to the same PSPNet to generate the original source feature map. The segmentation loss is a weighted sum of the loss computed on the original features and perturbed features. The loss on perturbed features finds the optimal perturbation parameter that maximizes the loss between predicted and original labels, while the loss on original image features is the traditional segmentation loss. The discriminator module attempts to distinguish between the features generated by perturbed images or target images. The proposed work is compared with the existing works on two standard datasets, Cityscapes and Synthia. The experimental results demonstrate the proposed approach outperforms the existing methods in terms of mIoU. The main novelty of the proposed work is the combined use of adversarial networks and model-based training (Robey et al 2020) to achieve a robust semantic segmentation in the presence of variation in brightness and snow in the scene.
SP:f33ea8f821d81104795ad54d2bafcbc534b39c19
Model-Based Robust Adaptive Semantic Segmentation
1 INTRODUCTION . In recent years , computer vision has become one of the most promising research areas in deep learning because it has empowered a great amount of industry-level applications . In the context of computer vision , semantic segmentation is a core task formulated as a dense labeling problem Luc et al . ( 2016 ) , targeting to allocate every pixel with a label Hsin et al . ( 2019 ) of what is being represented . There are many applications now being used have made great progress with the help of semantic segmentation , such as medical image processing Xue et al . ( 2018 ) , autonomous vehicles Zhao et al . ( 2018 ) and robotics Wang et al . ( 2019 ) . However , many applications of semantic segmentation are life-critical , which means that low model accuracy may pose direct threat to human safety Oakden-Rayner et al . ( 2020 ) . Therefore , it is critical to design training algorithms that can enhance robustness of segmentation methods against input perturbations . A significant number of researches focusing on the robustness of computer vision have been conducted in recent years Arnab et al . ( 2018 ) Kamann & Rother ( 2020 ) Robey et al . ( 2020 ) Tramer et al . ( 2020 ) . However , the majority of existing works focus on image classification tasks Hendrycks & Dietterich ( 2019 ) . Robust semantic segmentation methods against adversarial attacks have been proposed in Hsin et al . ( 2019 ) Xue et al . ( 2018 ) Hung et al . ( 2018 ) Xie et al . ( 2017 ) . Work conducted by Goodfellow et al . ( 2015 ) proved that neural networks can be easily misled by some intentionally designed yet imperceptible perturbations to generate an incorrect answer with high confidence . In computer vision , adversarial attacks apply pixel-level changes onto the image that lead the model to wrong predictions , where the attacked image looks perceptually similar to the original one Ma et al . ( 2020 ) . Perturbation-based robust training algorithms have already tackled this problem . Nevertheless , in real life , there may be changes that raised by some out-of-distribution variations such as snow weather or extreme brightness that can not be represented using small pixel-level changes . Current works on robustness mainly focus on adapting the domain gap on a single side , i.e. , either from image or label side . For instance , Robey et al . ( 2020 ) proposed a model-based robust learning architecture which is applied on Convolutional Neural Networks ( CNN ) to maintain high prediction accuracy under natural variations for image classification tasks . Yet it is highly dependent on the performance of the natural variation model that capture the changes from source to target domain , which makes the algorithm less robust and less scalable in semantic segmentation task . Meanwhile , AdaptSegNet proposed by Tsai et al . ( 2020 ) minimizes the distribution gap on the output side . In this paper , we build upon Robey et al . ( 2020 ) to design a new robust training algorithm for semantic segmentation tasks . The objective is to build a segmentation model that generates high accuracy predictions under natural variation effects . Our method also utilize the idea from Tsai et al . ( 2020 ) that images from different domains with great appearance difference may share some similarity on the label side such as spatial layout and local context . We showed that the semantic feature map of an image under any natural variations remains unchanged which we refer to as semantic meaning invariance . Our proposed training algorithm minimizes the gap on both image and label side . On image side , the model-based robust training algorithm is applied to train a model using the simulated target domain images to enhance robustness . On label side , we apply generative adversarial networks ( GANs ) to minimize the feature map gap between simulated natural variation images and target domain images . We have also included extensive comparisons showing that our method outperforms related state-of-the-art works in domain adaptation . Our contributions are : 1 ) We propose MRTAdapt , a new model-based training algorithm to enhance robustness of DNN-based semantic segmentation methods against natural variations . 2 ) We build on top of generative adversarial networks and model-based robust training algorithms to minimize the gap on both image and label side to enhance robustness . 3 ) Our results on Cityscapes Cordts et al . ( 2016 ) and Synthia Ros et al . ( 2016 ) datasets show that our method outperforms multiple state-ofthe-art domain adaptation techniques , such as AdaptSegNet Tsai et al . ( 2020 ) , ADVENT Vu et al . ( 2019 ) and FDA Yang & Soatto ( 2020 ) . 2 RELATED WORK . Semantic Segmentation . In the past decades , Convolution Neural Networks ( CNN ) are widely used in semantic segmentation . Current state-of-the-art semantic segmentation frameworks are mostly developed from Fully Convolutional Network ( FCN ) by Long et al . ( 2015 ) . ResNet proposed by He et al . ( 2015 ) used a residual block to sum the nonlinear activation output and identity mapping , which is proved to improve the gradient propagation and increase the accuracy of semantic segmentation . DenseNet Huang et al . ( 2018a ) builds upon ResNet and uses the concatenation of previous feature maps called dense block . This gives each layer in DenseNet information from all preceding layers . Jégou et al . ( 2017 ) extended DenseNet into FCN architecture . SegNet proposed by Badrinarayanan et al . ( 2017 ) introduces the deep convolution encoder-decoder architecture to the field of semantic segmentation . Also , in Zhou et al . ( 2015 ) , it is proved that empirical size of receptive field is much smaller than the theoretical size . Chen et al . ( 2016 ) and Yu & Koltun ( 2016 ) used dilated convolution to enlarge the receptive field . ParseNet by Liu et al . ( 2015 ) adds global context to CNNs for semantic segmentation . He et al . ( 2014 ) introduced spatial pyramid pooling in DCNN . PSPNet introduced by Zhao et al . ( 2017 ) uses a novel global pyramid pooling module to capture both global context information . Duta et al . ( 2020 ) extended the idea by combining both local and global Pyramidal Convolution blocks in the neural network model . Chen et al . ( 2017b ) introduced atrous spatial pyramid pooling . Depth image is also used along with original RGB information for semantic segmentation by Wang et al . ( 2019 ) . For actual applications , Zhao et al . ( 2018 ) proposed ICNet for real-time semantic segmentation accomplishing fast inference without sacrificing too much quality left behind . Azimi et al . ( 2020 ) proposed aerial perspective dataset for dense semantic segmentation . Domain Adaptation . Combining with the techniques of Generative Adversarial Network ( GAN ) Goodfellow et al . ( 2014 ) , Ganin & Lempitsky ( 2015 ) proposed DANN to reduce the distribution gap between different domains by using discriminator to make the prediction can not be identified between source and target domain . Pan et al . ( 2020 ) first separate target domain into splits based on entropy-based ranking and then deploy self-supervised adaptation technique to reduce the domain gap between synthetic data and real images . PIT proposed by Lv et al . ( 2020 ) constructs pivot information shared across domains . Chen et al . ( 2019 ) used depth image as guided information to build adaptation method from synthetic to real dataset . In the field of utilizing synthetic datasets to auxiliate the training process of real-world images , MUNIT proposed by Huang et al . ( 2018b ) learn conditional distribution of target domain which can separate domain-invariant semantic content of an image from domain-specific properties . Vu proposed ADVENT model which maximize prediction certainty in target domain by introducing entropy loss Vu et al . ( 2019 ) . Zhu proposed CycleGAN Zhu et al . ( 2020 ) which was trying to learn a mapping such that the distribution of generated image is indistinguishable from the target domain distribution using adversarial loss . AdaptSegNet proposed by Tsai et al . ( 2020 ) aimed to reduce the gap between the outputs from source and target domain given that images might be very different in appearance . FDA proposed by Yang & Soatto ( 2020 ) uses Fast Fourier Transform ( FFT ) to adapt source and target domain . Robustness . As for robustness against corrupted images , Hendrycks & Dietterich ( 2019 ) established rigorous benchmarks for image classification and proposed a series of image corruption examples . Kamann & Rother ( 2020 ) showed that robustness increases with the performance of the semantic segmentation model and dense prediction cell was only designed to improve performance on clean data . Regarding robustness on semantic segmentation , Arnab et al . ( 2018 ) did the first evaluation of adversarial attacks on semantic segmentation and analyzed multi-scale processing . Robey et al . ( 2020 ) proposed model-based robust training architecture focusing on the topic of image classification . Wong & Kolter ( 2020 ) bridged the gap between real-world perturbations and adversarial defenses by learning perturbation sets from data , through common image corruptions . 3 METHOD . In this section we propose a new robust training algorithm for semantic segmentation tasks . Particularly , in section 3.1 , we define the semantic segmentation task and the natural variations . In section 3.2 , we give the outline of our proposed algorithm . In section 3.3 , we define semantic meaning invariance and clarify its connection to our algorithm . In section 3.4 , we introduce the detailed training procedure of our model-based robust adaptive training algorithm ( MRTAdapt ) . 3.1 SEMANTIC SEGMENTATION AND NATURAL VARIATION . Consider an input x ∈ RH×W×3 representing an RGB image with three channels and its corresponding label map y ∈ RH×W which is annotated for every pixel in the image . A semantic segmentation task is to train a neural network that generates pixel-wise segmentation feature map ŷ ∈ RH×W . We assume the dataset is drawn i.i.d . from distribution ( x , y ) ∼ P. The optimization objective in semantic segmentation is to find the best weight w that minimizes the loss function L ( x , y ; w ) with respect to input x , label y and weight w , which can be written as : min w 1 n n∑ j=1 [ L ( x , y ; w ) ] ( 1 ) Next we denote by δ ∈ ∆ a natural variation applied to x that is derived from a nuisance space ∆ . A model of natural variation can be learned from the difference of source and target domain images . Particularly , we denote the natural variation model that transforms the input image x from the source domain into an image in the ( perturbed ) target domain as V ( x , δ ) . Note that , in general , it is hard to write a natural variation model learned from data into an analytical form because there is no closed form expression capturing the natural perturbation . Natural variation model can be customized regarding the needs of each dataset . In this paper , our goal is to design a semantic segmentation method that is robust to natural variations δ . 3.2 ALGORITHM OVERVIEW . Our proposed model-based robust adaptive training algorithm ( MRTAdapt ) shown in Figure 1 has two modules : a segmentation network G using a model-based robust training algorithm to enhance robustness on image side , and a discriminator network D to enhance robustness on label side . Two sets of images from source and target domain will have the notation of Is and It , while the image generated using natural variation model will be denoted as Inv . After using source domain images to train the model , we transform images from source domain with natural variation model . Then we use simulated natural variation images to find the highest segmentation loss by applying the model-based robust training algorithm to optimize the segmentation network . Then we predict the segmentation softmax output for the unlabeled target domain images It by forwarding the target images into the same segmentation network . To minimize the gap between the output of natural variation images and target domain images , we use these two predictions as the input to the discriminator to distinguish whether the feature map generated by segmentation network is from natural variation model or target domain . Using an adversarial loss for discriminator , the loss will back-propagate to segmentation network to help segmentation network to generate similar distributions in target domain to natural variation . Detailed information will be covered in the following sections .
This paper considers the problem of semantic image segmentation and endeavours to improve the performance of network-based approaches by enhancing model robustness to specific causes of image-space perceptual variance (eg. weather, illumination brightness). A training strategy that leverages generative (GAN) based components, data augmentation and domain adaptation ideas is employed towards encouraging models to represent generated images and target domain images, similarly. Resulting quantitative performance is reported across two standard datsets where comparisons are drawn with recent alternative works.
SP:f33ea8f821d81104795ad54d2bafcbc534b39c19
Model-Based Robust Adaptive Semantic Segmentation
1 INTRODUCTION . In recent years , computer vision has become one of the most promising research areas in deep learning because it has empowered a great amount of industry-level applications . In the context of computer vision , semantic segmentation is a core task formulated as a dense labeling problem Luc et al . ( 2016 ) , targeting to allocate every pixel with a label Hsin et al . ( 2019 ) of what is being represented . There are many applications now being used have made great progress with the help of semantic segmentation , such as medical image processing Xue et al . ( 2018 ) , autonomous vehicles Zhao et al . ( 2018 ) and robotics Wang et al . ( 2019 ) . However , many applications of semantic segmentation are life-critical , which means that low model accuracy may pose direct threat to human safety Oakden-Rayner et al . ( 2020 ) . Therefore , it is critical to design training algorithms that can enhance robustness of segmentation methods against input perturbations . A significant number of researches focusing on the robustness of computer vision have been conducted in recent years Arnab et al . ( 2018 ) Kamann & Rother ( 2020 ) Robey et al . ( 2020 ) Tramer et al . ( 2020 ) . However , the majority of existing works focus on image classification tasks Hendrycks & Dietterich ( 2019 ) . Robust semantic segmentation methods against adversarial attacks have been proposed in Hsin et al . ( 2019 ) Xue et al . ( 2018 ) Hung et al . ( 2018 ) Xie et al . ( 2017 ) . Work conducted by Goodfellow et al . ( 2015 ) proved that neural networks can be easily misled by some intentionally designed yet imperceptible perturbations to generate an incorrect answer with high confidence . In computer vision , adversarial attacks apply pixel-level changes onto the image that lead the model to wrong predictions , where the attacked image looks perceptually similar to the original one Ma et al . ( 2020 ) . Perturbation-based robust training algorithms have already tackled this problem . Nevertheless , in real life , there may be changes that raised by some out-of-distribution variations such as snow weather or extreme brightness that can not be represented using small pixel-level changes . Current works on robustness mainly focus on adapting the domain gap on a single side , i.e. , either from image or label side . For instance , Robey et al . ( 2020 ) proposed a model-based robust learning architecture which is applied on Convolutional Neural Networks ( CNN ) to maintain high prediction accuracy under natural variations for image classification tasks . Yet it is highly dependent on the performance of the natural variation model that capture the changes from source to target domain , which makes the algorithm less robust and less scalable in semantic segmentation task . Meanwhile , AdaptSegNet proposed by Tsai et al . ( 2020 ) minimizes the distribution gap on the output side . In this paper , we build upon Robey et al . ( 2020 ) to design a new robust training algorithm for semantic segmentation tasks . The objective is to build a segmentation model that generates high accuracy predictions under natural variation effects . Our method also utilize the idea from Tsai et al . ( 2020 ) that images from different domains with great appearance difference may share some similarity on the label side such as spatial layout and local context . We showed that the semantic feature map of an image under any natural variations remains unchanged which we refer to as semantic meaning invariance . Our proposed training algorithm minimizes the gap on both image and label side . On image side , the model-based robust training algorithm is applied to train a model using the simulated target domain images to enhance robustness . On label side , we apply generative adversarial networks ( GANs ) to minimize the feature map gap between simulated natural variation images and target domain images . We have also included extensive comparisons showing that our method outperforms related state-of-the-art works in domain adaptation . Our contributions are : 1 ) We propose MRTAdapt , a new model-based training algorithm to enhance robustness of DNN-based semantic segmentation methods against natural variations . 2 ) We build on top of generative adversarial networks and model-based robust training algorithms to minimize the gap on both image and label side to enhance robustness . 3 ) Our results on Cityscapes Cordts et al . ( 2016 ) and Synthia Ros et al . ( 2016 ) datasets show that our method outperforms multiple state-ofthe-art domain adaptation techniques , such as AdaptSegNet Tsai et al . ( 2020 ) , ADVENT Vu et al . ( 2019 ) and FDA Yang & Soatto ( 2020 ) . 2 RELATED WORK . Semantic Segmentation . In the past decades , Convolution Neural Networks ( CNN ) are widely used in semantic segmentation . Current state-of-the-art semantic segmentation frameworks are mostly developed from Fully Convolutional Network ( FCN ) by Long et al . ( 2015 ) . ResNet proposed by He et al . ( 2015 ) used a residual block to sum the nonlinear activation output and identity mapping , which is proved to improve the gradient propagation and increase the accuracy of semantic segmentation . DenseNet Huang et al . ( 2018a ) builds upon ResNet and uses the concatenation of previous feature maps called dense block . This gives each layer in DenseNet information from all preceding layers . Jégou et al . ( 2017 ) extended DenseNet into FCN architecture . SegNet proposed by Badrinarayanan et al . ( 2017 ) introduces the deep convolution encoder-decoder architecture to the field of semantic segmentation . Also , in Zhou et al . ( 2015 ) , it is proved that empirical size of receptive field is much smaller than the theoretical size . Chen et al . ( 2016 ) and Yu & Koltun ( 2016 ) used dilated convolution to enlarge the receptive field . ParseNet by Liu et al . ( 2015 ) adds global context to CNNs for semantic segmentation . He et al . ( 2014 ) introduced spatial pyramid pooling in DCNN . PSPNet introduced by Zhao et al . ( 2017 ) uses a novel global pyramid pooling module to capture both global context information . Duta et al . ( 2020 ) extended the idea by combining both local and global Pyramidal Convolution blocks in the neural network model . Chen et al . ( 2017b ) introduced atrous spatial pyramid pooling . Depth image is also used along with original RGB information for semantic segmentation by Wang et al . ( 2019 ) . For actual applications , Zhao et al . ( 2018 ) proposed ICNet for real-time semantic segmentation accomplishing fast inference without sacrificing too much quality left behind . Azimi et al . ( 2020 ) proposed aerial perspective dataset for dense semantic segmentation . Domain Adaptation . Combining with the techniques of Generative Adversarial Network ( GAN ) Goodfellow et al . ( 2014 ) , Ganin & Lempitsky ( 2015 ) proposed DANN to reduce the distribution gap between different domains by using discriminator to make the prediction can not be identified between source and target domain . Pan et al . ( 2020 ) first separate target domain into splits based on entropy-based ranking and then deploy self-supervised adaptation technique to reduce the domain gap between synthetic data and real images . PIT proposed by Lv et al . ( 2020 ) constructs pivot information shared across domains . Chen et al . ( 2019 ) used depth image as guided information to build adaptation method from synthetic to real dataset . In the field of utilizing synthetic datasets to auxiliate the training process of real-world images , MUNIT proposed by Huang et al . ( 2018b ) learn conditional distribution of target domain which can separate domain-invariant semantic content of an image from domain-specific properties . Vu proposed ADVENT model which maximize prediction certainty in target domain by introducing entropy loss Vu et al . ( 2019 ) . Zhu proposed CycleGAN Zhu et al . ( 2020 ) which was trying to learn a mapping such that the distribution of generated image is indistinguishable from the target domain distribution using adversarial loss . AdaptSegNet proposed by Tsai et al . ( 2020 ) aimed to reduce the gap between the outputs from source and target domain given that images might be very different in appearance . FDA proposed by Yang & Soatto ( 2020 ) uses Fast Fourier Transform ( FFT ) to adapt source and target domain . Robustness . As for robustness against corrupted images , Hendrycks & Dietterich ( 2019 ) established rigorous benchmarks for image classification and proposed a series of image corruption examples . Kamann & Rother ( 2020 ) showed that robustness increases with the performance of the semantic segmentation model and dense prediction cell was only designed to improve performance on clean data . Regarding robustness on semantic segmentation , Arnab et al . ( 2018 ) did the first evaluation of adversarial attacks on semantic segmentation and analyzed multi-scale processing . Robey et al . ( 2020 ) proposed model-based robust training architecture focusing on the topic of image classification . Wong & Kolter ( 2020 ) bridged the gap between real-world perturbations and adversarial defenses by learning perturbation sets from data , through common image corruptions . 3 METHOD . In this section we propose a new robust training algorithm for semantic segmentation tasks . Particularly , in section 3.1 , we define the semantic segmentation task and the natural variations . In section 3.2 , we give the outline of our proposed algorithm . In section 3.3 , we define semantic meaning invariance and clarify its connection to our algorithm . In section 3.4 , we introduce the detailed training procedure of our model-based robust adaptive training algorithm ( MRTAdapt ) . 3.1 SEMANTIC SEGMENTATION AND NATURAL VARIATION . Consider an input x ∈ RH×W×3 representing an RGB image with three channels and its corresponding label map y ∈ RH×W which is annotated for every pixel in the image . A semantic segmentation task is to train a neural network that generates pixel-wise segmentation feature map ŷ ∈ RH×W . We assume the dataset is drawn i.i.d . from distribution ( x , y ) ∼ P. The optimization objective in semantic segmentation is to find the best weight w that minimizes the loss function L ( x , y ; w ) with respect to input x , label y and weight w , which can be written as : min w 1 n n∑ j=1 [ L ( x , y ; w ) ] ( 1 ) Next we denote by δ ∈ ∆ a natural variation applied to x that is derived from a nuisance space ∆ . A model of natural variation can be learned from the difference of source and target domain images . Particularly , we denote the natural variation model that transforms the input image x from the source domain into an image in the ( perturbed ) target domain as V ( x , δ ) . Note that , in general , it is hard to write a natural variation model learned from data into an analytical form because there is no closed form expression capturing the natural perturbation . Natural variation model can be customized regarding the needs of each dataset . In this paper , our goal is to design a semantic segmentation method that is robust to natural variations δ . 3.2 ALGORITHM OVERVIEW . Our proposed model-based robust adaptive training algorithm ( MRTAdapt ) shown in Figure 1 has two modules : a segmentation network G using a model-based robust training algorithm to enhance robustness on image side , and a discriminator network D to enhance robustness on label side . Two sets of images from source and target domain will have the notation of Is and It , while the image generated using natural variation model will be denoted as Inv . After using source domain images to train the model , we transform images from source domain with natural variation model . Then we use simulated natural variation images to find the highest segmentation loss by applying the model-based robust training algorithm to optimize the segmentation network . Then we predict the segmentation softmax output for the unlabeled target domain images It by forwarding the target images into the same segmentation network . To minimize the gap between the output of natural variation images and target domain images , we use these two predictions as the input to the discriminator to distinguish whether the feature map generated by segmentation network is from natural variation model or target domain . Using an adversarial loss for discriminator , the loss will back-propagate to segmentation network to help segmentation network to generate similar distributions in target domain to natural variation . Detailed information will be covered in the following sections .
This work presents a new training algorithm for semantic segmentation deep neural networks (MRTAdapt) which is designed to obtain models more robust to changes in the scene due to natural variations, such as weather or lighting conditions. The work poses this problem as a domain adaptation task, from the original domain (original labeled data) to the target domain (data with appearance changes due to lighting or weather). The adaptation is achieved by training with augmented data simulating the natural variations learned from data. The training proposed combines a minimization of the segmentation loss (using the existing labels) and a maximisation of the probability of the generated images to be identified as images from the target domain, following GANs-like training, to ensure that the feature maps of the generated images are as similar as possible to target domain image feature maps. In the experiments, the lighting and weather changes are simulated by the authors using existing tools applied on two public benchmarks. The approach is compared to other domain adaptation techniques obtaining higher accuracy in the segmentation of the simulated target domains.
SP:f33ea8f821d81104795ad54d2bafcbc534b39c19
Training Transition Policies via Distribution Matching for Complex Tasks
1 INTRODUCTION . While Reinforcement Learning ( RL ) has made significant improvements for a wide variety of continuous tasks such as locomotion ( Lillicrap et al. , 2016 ; Heess et al. , 2017 ) and robotic manipulation ( Ghosh et al. , 2018 ) , direct end-to-end training on tasks that require complex behaviors often fails . When faced with a complex task , humans may solve simpler subtasks first and combine them . Analogously , hierachical reinforcement learning ( HRL ) uses multiple levels of policies , where the actions of a higher-level meta-controller represent which lower-level policy to execute ( Sutton et al. , 1999 ; Dayan & Hinton , 1992 ) . A multitude of methods has been proposed to train HRL , such as assigning subgoals for the lower-level policies ( Kulkarni et al. , 2016 ) , employing pre-trained lower-level policies ( Frans et al. , 2018 ) , and off-policy RL ( Nachum et al. , 2018 ) . All HRL methods face a common challenge : switching smoothly from one lower-level policy to another when the meta-controller directs that a switch should occur . For example , running hurdles may require switching between running and jumping repeatedly while maintaining forward momentum . Previous approaches to this challenge ( Frans et al. , 2018 ; Andreas et al. , 2017 ; Lee et al. , 2019 ) involve either retraining existing lower-level policies and/or introducing a new policy to execute the switch . We focus on the latter and call the new policy the transition policy , following Lee et al . ( 2019 ) . A transition policy needs to switch between the states produced by one lower-level policy to an appropriate starting state for another . A natural way to train such a policy is to give a reward depending on whether the transition is successfully executed or not . However , this method induces a sparse reward that is difficult to learn from due to the temporal credit assignment problem ( Sutton , 1984 ) . Instead , we use inverse reinforcement learning ( IRL ) techniques to match the distribution of states produced by the transition policy to the distribution of states expected by the next lower-level policy ( Figure 1 ) . While the goal of IRL is infer an expert ’ s reward function from demonstrations of optimal behavior ( Ng et al. , 2000 ; Ziebart et al. , 2008 ) , some recent approaches to IRL ( e.g. , Finn et al . ( 2016 ) ; Ho & Ermon ( 2016 ) ; Fu et al . ( 2018 ) ) learn a policy that imitates the expert ’ s demonstrations in the process . In particular , Ho & Ermon ( 2016 ) propose a generative adversarial network ( GAN ) structure ( Goodfellow et al. , 2014 ) that matches the distribution of the policy ( generator ) with the distribution of the given data ( expert demonstrations ) . We use this GAN structure for distribution matching , and , consequently , we avoid the problem of designing an explicit reward function for transition policies . Although the transition policy is trained to produce the distribution of states and actions that is expected by the next lower-level policy , not all states in the distribution ’ s support have equal probability of success . To increase the rate of successful execution , we introduce a deep Q-network ( DQN ) ( Mnih et al. , 2013 ) to govern the switch from the transition policy to the next lower-level policy . The DQN has two actions , switch or stay , and a simple reward function where a positive reward is obtained if the next lower-level policy is successfully executed ; otherwise , a negative reward is given . The issue of sparse rewards is present here , but it is less of an issue because of the simple decision space . The main contribution of this paper is a new method for training transition policies for transitioning between lower-level policies . The two parts of our approach , the transition policy that matches the distribution of states and the DQN that determines when to transfer control , are both essential . Without the DQN , the state selected for transition may be familiar to the next policy , but lead to a poor success rate . Without the transition policy , there may be no appropriate state for the DQN to transition from . The proposed method reduces issues with sparse and delayed rewards that are encountered by prior approaches . We demonstrate our method on bipedal locomotion and arm manipulation tasks created by Lee et al . ( 2019 ) , in which the agent requires to have diverse skills and appropriately utilize them for each of the tasks . 2 PRELIMINARIES . The problem is formulated as a infinite-horizon Markov decision process ( MDP ) ( Puterman , 2014 ; Sutton & Barto , 2018 ) defined by the tupleM = ( S , A , P , R , γ , µ ) . The agent takes action at ∈ A for the current state st ∈ S at time t , then the reward function R : S × A → R returns the reward for ( st , at ) , and the next state st+1 is determined by the transition probability P ( st+1|st , at ) . γ is the discount factor and µ denotes the initial states distribution . The agent follows a policy πθ ( at|st ) that produces a distribution of actions for each state . The objective of reinforcement learning ( RL ) is to find the optimal θ that maximizes the expected discounted reward : θ∗ = argmax θ E s0∼µ at∼πθ ( ·|st ) st+1∼P ( ·|st , at ) [ ∞∑ t=0 γtR ( st , at ) ] . ( 1 ) 2.1 INVERSE REINFORCEMENT LEARNING . Whereas standard RL trains a policy to maximize a reward function , inverse reinforcement learning ( IRL ) ( Ng et al. , 2000 ; Ziebart et al. , 2008 ) seeks to learn the reward function from expert demonstrations of an optimal policy . Several approaches to the IRL problem ( Ho & Ermon , 2016 ; Fu et al. , 2018 ) adopt a GAN structure ( Goodfellow et al. , 2014 ) —the policy ( generator ) tries to select actions that the discriminator can not distinguish from the expert ’ s . As a by-product , the generator produces a policy with the same distribution as the expert ’ s at convergence . We use the state-action discriminator ( Fu et al. , 2018 ) rather than the trajectory-centric discriminator ( Finn et al. , 2016 ; Ho & Ermon , 2016 ) : Dψ , φ ( st , at , st+1 ) = exp { fψ , φ ( st , at , st+1 ) } exp { fψ , φ ( st , at , st+1 ) } + πθ ( at|st ) , ( 2 ) where fψ , φ ( st , at , st+1 ) = gψ ( st , at ) +γhφ ( st+1 ) −hφ ( st ) at time t , gψ is the reward approximator , and φ are the parameters of a shaping term hφ , which alleviates unwanted shaping for gψ . This discriminator Dψ , φ is trained to distinguish data from the expert and the generator ’ s policy via binary logistic regression , and the policy πθ is updated with Proximal Policy Optimization ( PPO ) ( Schulman et al. , 2017 ) according to the rewards rψ , φ provided by the discriminator : rψ , φ ( st , at , st+1 ) = logDψ , φ ( st , at , st+1 ) − log ( 1−Dψ , φ ( st , at , st+1 ) ) ( 3 ) 2.2 DEEP Q-LEARNING . Deep Q-learning ( Riedmiller , 2005 ; Mnih et al. , 2013 ) is a variant of Q-learning ( Watkins & Dayan , 1992 ) that produces a neural network called a deep Q-network ( DQN ) that aims to learn a deterministic optimal action from among a discrete set of actions for each state . Deep Q-learning suffers from overestimating yt ( Thrun & Schwartz , 1993 ) because of the max term , which impedes the learning process . Double Q-learning ( van Hasselt et al. , 2016 ) addresses this problem by decoupling the networks for choosing the action and evaluating value . The target networkQθ′ makes learning more stable by providing a target yt that is fixed for long periods of time : y′t = rt + γ Qθ′ ( st+1 , argmaxat+1Qθ ( st+1 , at+1 ) ) ( 4 ) The DQN is updated using a loss function such as the mean squared error ( y′t − Qθ ( st , at ) ) 2 . We use train a DQN with double Q-learning to get a signal that tells us when to switch from a transition policy to the next lower-level policy . 3 APPROACH . In this section , we present a methodology for transitioning between lower-level policies in hierarchical reinforcement learning ( HRL ) . We assume that we receive pre-trained lower-level subtask Algorithm 1 Training Transition Policy πa , b 1 : Input : pre-trained policies { πa , πb } , transition interval 2 : Initialize transition policy ( generator ) πa , b and discriminator Dψ , φ Equation ( 2 ) 3 : Collect the states Sπa of πa at the start of the transition interval 4 : Collect the trajectories ( states and actions ) Tπb of πb during the transition interval 5 : Initialize transition policy πa , b and discriminator Dψ , φ 6 : for i = 1 to n do 7 : for j = 1 to m do 8 : Sample s ∼ Sπa and set the state of πa , b to s 9 : Collect the trajectory Tπa , b generated by the current πa , b 10 : end for 11 : Train Dψ , φ with binary logistic regression to distinguish Tπa , b and Tπb 12 : Calculate reward rψ , φ set for all ( st , at , st+1 ) ∈ Tπa , b with Equation ( 3 ) 13 : Optimize πa , b with respect to Tπa , b and rψ , φ 14 : end for policies as input along with transition intervals—windows where a transition between two specific lower-level policies should occur . We seek to maximize performance on a complex task by combining the pre-trained policies without re-training them . To do this , we train a transition policy for each pair of pre-trained policies that we must transition between . The transition policy is activated at the start of each transition interval . Then , a DQN governs the switch from the transition policy to the next prescribed pre-trained policy . The DQN improves the rate of transition success relative to simply switching at the end of the transition interval.1 In Section 3.1 , we describe our training procedure for transition policies . In Section 3.2 , we describe how we collect data and design rewards for DQNs . Our framework is summarized by Figure 2 . 3.1 TRAINING THE TRANSITION POLICY . Let { π1 , π2 , ... , πn } denote n pre-trained policies and let πa , b denote a transition policy that aims to connect policy πa to πb . The meta-controller dictates a transition interval for each transition between pre-trained policies—a period of time when the transition should take place . If we were to simply switch from πa to πb at the start of this interval , πb can easily fail because it has never been trained on the last state produced by πa . To prevent this problem , πa , b needs to be able to start from any of the last states produced by πa and lead to a state from which πb can successfully perform the next task . Which states are favorable for starting πb ? A possible answer is the states produced by πb itself . We train πa , b to have the same distribution as πb with IRL ( Ng et al. , 2000 ; Ziebart et al. , 2008 ; Ho & Ermon , 2016 ; Fu et al. , 2018 ) . We specifically choose adversarial inverse reinforcement learning ( AIRL ) ( Fu et al. , 2018 ) , which has the GAN ( Goodfellow et al. , 2014 ) structure . The training procedure for πa , b is described in Algorithm 1. πa , b is trained with two classes of data : one from πa and one from πb . From πa , we collect the states Sπa of πa at the start of the transition interval . From πb , we collect the trajectories Tπb of πb during the the transition interval . The initial state of the generator πa , b is set to s , sampled from Sπa . Then , πa , b tries to generate trajectories that fool the discriminator D ( Equation 2 ) into classifying it as an example of Tπb . The discriminator D is trained with binary logistic regression to distinguish between the data from πb vs. πa , b . WhenD can no longer distinguish between them , πa , b can be said to have a similar distribution to πb . For example , we prepared a pre-trained Walking forward policy π1 and Jumping policy π2 for one of our experimental environments , Hurdle , manually shaping rewards for these two subtask policies . We use a transition interval of 3–4 meters from the hurdle . Thus , Sπ1 is the last states of π1—the sampled set of states when the agent ’ s location is 4 meters from the hurdle . Tπ2 is the trajectories 1We assume that the environment is static enough that it is not critical that the meta-controller has the opportunity to replan after the transition policy terminates . In principle , such replanning could be allowed by introducing an additional layer of transition policies , i.e. , by training training meta-transition policies that transition between transition policies and actions . Algorithm 2 Training Deep Q Network qa , b 1 : Input : pre-trained policies { πa , πb } , transition policy πa , b , transition interval 2 : Initialize qa , b and replay buffer B 3 : for i = 1 to n do 4 : Set environment to state of πa at the start of the transition interval 5 : while the current state is in the transition interval 6 : at ∼ πa , b ( st ) 7 : Execute environment for ( st , at ) and get st+1 and success-fail-alive signal τ 8 : Run qa , b and get an action aq 9 : if aq = switch 10 : set s = st+1 and break 11 : else if aq = stay 12 : Store ( st , aq , rf , st+1 ) in B if τ = fail or st+1 is outside the transition interval 13 : Store ( st , aq , 0 , st+1 ) in B if τ = alive 14 : end if 15 : end while 16 : while πb has not achieved subgoal and has not failed 17 : at ∼ πb ( st ) 18 : Execute environment for ( st , at ) and get st+1 and signal τ 19 : end while 20 : Store ( s , aq , rs , st+1 ) in B if τ = success 21 : Store ( s , aq , rf , st+1 ) in B if τ = fail 22 : Update qa , b with a minibatch from B according to Equation ( 4 ) 23 : end for of π2 from 3–4 meters from the hurdle . The transition policy π1,2 is initialized with one of the last states of π1 and learns to match the distribution π2 just before the jump is initiated .
The paper addresses the problem of learning to subsequently execute tasks, and transitioning from a first task to a second task. The work contributes a method to train transition policies, and a method to decide when to start executing the second policy, stopping the transition policy. The approach is evaluated on a few simulated robot locomotion/manipulation tasks.
SP:d196aa46cc5913f8a1314bfcd5bf7039a4e82642
Training Transition Policies via Distribution Matching for Complex Tasks
1 INTRODUCTION . While Reinforcement Learning ( RL ) has made significant improvements for a wide variety of continuous tasks such as locomotion ( Lillicrap et al. , 2016 ; Heess et al. , 2017 ) and robotic manipulation ( Ghosh et al. , 2018 ) , direct end-to-end training on tasks that require complex behaviors often fails . When faced with a complex task , humans may solve simpler subtasks first and combine them . Analogously , hierachical reinforcement learning ( HRL ) uses multiple levels of policies , where the actions of a higher-level meta-controller represent which lower-level policy to execute ( Sutton et al. , 1999 ; Dayan & Hinton , 1992 ) . A multitude of methods has been proposed to train HRL , such as assigning subgoals for the lower-level policies ( Kulkarni et al. , 2016 ) , employing pre-trained lower-level policies ( Frans et al. , 2018 ) , and off-policy RL ( Nachum et al. , 2018 ) . All HRL methods face a common challenge : switching smoothly from one lower-level policy to another when the meta-controller directs that a switch should occur . For example , running hurdles may require switching between running and jumping repeatedly while maintaining forward momentum . Previous approaches to this challenge ( Frans et al. , 2018 ; Andreas et al. , 2017 ; Lee et al. , 2019 ) involve either retraining existing lower-level policies and/or introducing a new policy to execute the switch . We focus on the latter and call the new policy the transition policy , following Lee et al . ( 2019 ) . A transition policy needs to switch between the states produced by one lower-level policy to an appropriate starting state for another . A natural way to train such a policy is to give a reward depending on whether the transition is successfully executed or not . However , this method induces a sparse reward that is difficult to learn from due to the temporal credit assignment problem ( Sutton , 1984 ) . Instead , we use inverse reinforcement learning ( IRL ) techniques to match the distribution of states produced by the transition policy to the distribution of states expected by the next lower-level policy ( Figure 1 ) . While the goal of IRL is infer an expert ’ s reward function from demonstrations of optimal behavior ( Ng et al. , 2000 ; Ziebart et al. , 2008 ) , some recent approaches to IRL ( e.g. , Finn et al . ( 2016 ) ; Ho & Ermon ( 2016 ) ; Fu et al . ( 2018 ) ) learn a policy that imitates the expert ’ s demonstrations in the process . In particular , Ho & Ermon ( 2016 ) propose a generative adversarial network ( GAN ) structure ( Goodfellow et al. , 2014 ) that matches the distribution of the policy ( generator ) with the distribution of the given data ( expert demonstrations ) . We use this GAN structure for distribution matching , and , consequently , we avoid the problem of designing an explicit reward function for transition policies . Although the transition policy is trained to produce the distribution of states and actions that is expected by the next lower-level policy , not all states in the distribution ’ s support have equal probability of success . To increase the rate of successful execution , we introduce a deep Q-network ( DQN ) ( Mnih et al. , 2013 ) to govern the switch from the transition policy to the next lower-level policy . The DQN has two actions , switch or stay , and a simple reward function where a positive reward is obtained if the next lower-level policy is successfully executed ; otherwise , a negative reward is given . The issue of sparse rewards is present here , but it is less of an issue because of the simple decision space . The main contribution of this paper is a new method for training transition policies for transitioning between lower-level policies . The two parts of our approach , the transition policy that matches the distribution of states and the DQN that determines when to transfer control , are both essential . Without the DQN , the state selected for transition may be familiar to the next policy , but lead to a poor success rate . Without the transition policy , there may be no appropriate state for the DQN to transition from . The proposed method reduces issues with sparse and delayed rewards that are encountered by prior approaches . We demonstrate our method on bipedal locomotion and arm manipulation tasks created by Lee et al . ( 2019 ) , in which the agent requires to have diverse skills and appropriately utilize them for each of the tasks . 2 PRELIMINARIES . The problem is formulated as a infinite-horizon Markov decision process ( MDP ) ( Puterman , 2014 ; Sutton & Barto , 2018 ) defined by the tupleM = ( S , A , P , R , γ , µ ) . The agent takes action at ∈ A for the current state st ∈ S at time t , then the reward function R : S × A → R returns the reward for ( st , at ) , and the next state st+1 is determined by the transition probability P ( st+1|st , at ) . γ is the discount factor and µ denotes the initial states distribution . The agent follows a policy πθ ( at|st ) that produces a distribution of actions for each state . The objective of reinforcement learning ( RL ) is to find the optimal θ that maximizes the expected discounted reward : θ∗ = argmax θ E s0∼µ at∼πθ ( ·|st ) st+1∼P ( ·|st , at ) [ ∞∑ t=0 γtR ( st , at ) ] . ( 1 ) 2.1 INVERSE REINFORCEMENT LEARNING . Whereas standard RL trains a policy to maximize a reward function , inverse reinforcement learning ( IRL ) ( Ng et al. , 2000 ; Ziebart et al. , 2008 ) seeks to learn the reward function from expert demonstrations of an optimal policy . Several approaches to the IRL problem ( Ho & Ermon , 2016 ; Fu et al. , 2018 ) adopt a GAN structure ( Goodfellow et al. , 2014 ) —the policy ( generator ) tries to select actions that the discriminator can not distinguish from the expert ’ s . As a by-product , the generator produces a policy with the same distribution as the expert ’ s at convergence . We use the state-action discriminator ( Fu et al. , 2018 ) rather than the trajectory-centric discriminator ( Finn et al. , 2016 ; Ho & Ermon , 2016 ) : Dψ , φ ( st , at , st+1 ) = exp { fψ , φ ( st , at , st+1 ) } exp { fψ , φ ( st , at , st+1 ) } + πθ ( at|st ) , ( 2 ) where fψ , φ ( st , at , st+1 ) = gψ ( st , at ) +γhφ ( st+1 ) −hφ ( st ) at time t , gψ is the reward approximator , and φ are the parameters of a shaping term hφ , which alleviates unwanted shaping for gψ . This discriminator Dψ , φ is trained to distinguish data from the expert and the generator ’ s policy via binary logistic regression , and the policy πθ is updated with Proximal Policy Optimization ( PPO ) ( Schulman et al. , 2017 ) according to the rewards rψ , φ provided by the discriminator : rψ , φ ( st , at , st+1 ) = logDψ , φ ( st , at , st+1 ) − log ( 1−Dψ , φ ( st , at , st+1 ) ) ( 3 ) 2.2 DEEP Q-LEARNING . Deep Q-learning ( Riedmiller , 2005 ; Mnih et al. , 2013 ) is a variant of Q-learning ( Watkins & Dayan , 1992 ) that produces a neural network called a deep Q-network ( DQN ) that aims to learn a deterministic optimal action from among a discrete set of actions for each state . Deep Q-learning suffers from overestimating yt ( Thrun & Schwartz , 1993 ) because of the max term , which impedes the learning process . Double Q-learning ( van Hasselt et al. , 2016 ) addresses this problem by decoupling the networks for choosing the action and evaluating value . The target networkQθ′ makes learning more stable by providing a target yt that is fixed for long periods of time : y′t = rt + γ Qθ′ ( st+1 , argmaxat+1Qθ ( st+1 , at+1 ) ) ( 4 ) The DQN is updated using a loss function such as the mean squared error ( y′t − Qθ ( st , at ) ) 2 . We use train a DQN with double Q-learning to get a signal that tells us when to switch from a transition policy to the next lower-level policy . 3 APPROACH . In this section , we present a methodology for transitioning between lower-level policies in hierarchical reinforcement learning ( HRL ) . We assume that we receive pre-trained lower-level subtask Algorithm 1 Training Transition Policy πa , b 1 : Input : pre-trained policies { πa , πb } , transition interval 2 : Initialize transition policy ( generator ) πa , b and discriminator Dψ , φ Equation ( 2 ) 3 : Collect the states Sπa of πa at the start of the transition interval 4 : Collect the trajectories ( states and actions ) Tπb of πb during the transition interval 5 : Initialize transition policy πa , b and discriminator Dψ , φ 6 : for i = 1 to n do 7 : for j = 1 to m do 8 : Sample s ∼ Sπa and set the state of πa , b to s 9 : Collect the trajectory Tπa , b generated by the current πa , b 10 : end for 11 : Train Dψ , φ with binary logistic regression to distinguish Tπa , b and Tπb 12 : Calculate reward rψ , φ set for all ( st , at , st+1 ) ∈ Tπa , b with Equation ( 3 ) 13 : Optimize πa , b with respect to Tπa , b and rψ , φ 14 : end for policies as input along with transition intervals—windows where a transition between two specific lower-level policies should occur . We seek to maximize performance on a complex task by combining the pre-trained policies without re-training them . To do this , we train a transition policy for each pair of pre-trained policies that we must transition between . The transition policy is activated at the start of each transition interval . Then , a DQN governs the switch from the transition policy to the next prescribed pre-trained policy . The DQN improves the rate of transition success relative to simply switching at the end of the transition interval.1 In Section 3.1 , we describe our training procedure for transition policies . In Section 3.2 , we describe how we collect data and design rewards for DQNs . Our framework is summarized by Figure 2 . 3.1 TRAINING THE TRANSITION POLICY . Let { π1 , π2 , ... , πn } denote n pre-trained policies and let πa , b denote a transition policy that aims to connect policy πa to πb . The meta-controller dictates a transition interval for each transition between pre-trained policies—a period of time when the transition should take place . If we were to simply switch from πa to πb at the start of this interval , πb can easily fail because it has never been trained on the last state produced by πa . To prevent this problem , πa , b needs to be able to start from any of the last states produced by πa and lead to a state from which πb can successfully perform the next task . Which states are favorable for starting πb ? A possible answer is the states produced by πb itself . We train πa , b to have the same distribution as πb with IRL ( Ng et al. , 2000 ; Ziebart et al. , 2008 ; Ho & Ermon , 2016 ; Fu et al. , 2018 ) . We specifically choose adversarial inverse reinforcement learning ( AIRL ) ( Fu et al. , 2018 ) , which has the GAN ( Goodfellow et al. , 2014 ) structure . The training procedure for πa , b is described in Algorithm 1. πa , b is trained with two classes of data : one from πa and one from πb . From πa , we collect the states Sπa of πa at the start of the transition interval . From πb , we collect the trajectories Tπb of πb during the the transition interval . The initial state of the generator πa , b is set to s , sampled from Sπa . Then , πa , b tries to generate trajectories that fool the discriminator D ( Equation 2 ) into classifying it as an example of Tπb . The discriminator D is trained with binary logistic regression to distinguish between the data from πb vs. πa , b . WhenD can no longer distinguish between them , πa , b can be said to have a similar distribution to πb . For example , we prepared a pre-trained Walking forward policy π1 and Jumping policy π2 for one of our experimental environments , Hurdle , manually shaping rewards for these two subtask policies . We use a transition interval of 3–4 meters from the hurdle . Thus , Sπ1 is the last states of π1—the sampled set of states when the agent ’ s location is 4 meters from the hurdle . Tπ2 is the trajectories 1We assume that the environment is static enough that it is not critical that the meta-controller has the opportunity to replan after the transition policy terminates . In principle , such replanning could be allowed by introducing an additional layer of transition policies , i.e. , by training training meta-transition policies that transition between transition policies and actions . Algorithm 2 Training Deep Q Network qa , b 1 : Input : pre-trained policies { πa , πb } , transition policy πa , b , transition interval 2 : Initialize qa , b and replay buffer B 3 : for i = 1 to n do 4 : Set environment to state of πa at the start of the transition interval 5 : while the current state is in the transition interval 6 : at ∼ πa , b ( st ) 7 : Execute environment for ( st , at ) and get st+1 and success-fail-alive signal τ 8 : Run qa , b and get an action aq 9 : if aq = switch 10 : set s = st+1 and break 11 : else if aq = stay 12 : Store ( st , aq , rf , st+1 ) in B if τ = fail or st+1 is outside the transition interval 13 : Store ( st , aq , 0 , st+1 ) in B if τ = alive 14 : end if 15 : end while 16 : while πb has not achieved subgoal and has not failed 17 : at ∼ πb ( st ) 18 : Execute environment for ( st , at ) and get st+1 and signal τ 19 : end while 20 : Store ( s , aq , rs , st+1 ) in B if τ = success 21 : Store ( s , aq , rf , st+1 ) in B if τ = fail 22 : Update qa , b with a minibatch from B according to Equation ( 4 ) 23 : end for of π2 from 3–4 meters from the hurdle . The transition policy π1,2 is initialized with one of the last states of π1 and learns to match the distribution π2 just before the jump is initiated .
The paper tackles the problem of connecting pre-trained policies $\pi_a, \pi_b$ in order to solve more complex tasks through abstraction. In order to do so, they leverage inverse RL (leveraging adversarial learning) to train a transition policy $\pi_{ab}$ aiming at transitioning between the two policies $\pi_a, \pi_b$. It is trained by enforcing its state-action occupancy to match that of the next pre-trained policy $\pi_b$ via inverse RL. They also propose leveraging a DQN with simple reward structure to control the transitioning from the trained transition policy $\pi_{ab}$ to $\pi_b$. Contributions: - A relatively simple approach to transitioning between pre-trained policies, which has potential for impact when aiming to tackle complex tasks. - Empirical demonstration that their approach succeeds at tackling complex tasks by combining pre-trained policies successfully, and outperforming a single policy trained with PPO/SAC
SP:d196aa46cc5913f8a1314bfcd5bf7039a4e82642
Training Transition Policies via Distribution Matching for Complex Tasks
1 INTRODUCTION . While Reinforcement Learning ( RL ) has made significant improvements for a wide variety of continuous tasks such as locomotion ( Lillicrap et al. , 2016 ; Heess et al. , 2017 ) and robotic manipulation ( Ghosh et al. , 2018 ) , direct end-to-end training on tasks that require complex behaviors often fails . When faced with a complex task , humans may solve simpler subtasks first and combine them . Analogously , hierachical reinforcement learning ( HRL ) uses multiple levels of policies , where the actions of a higher-level meta-controller represent which lower-level policy to execute ( Sutton et al. , 1999 ; Dayan & Hinton , 1992 ) . A multitude of methods has been proposed to train HRL , such as assigning subgoals for the lower-level policies ( Kulkarni et al. , 2016 ) , employing pre-trained lower-level policies ( Frans et al. , 2018 ) , and off-policy RL ( Nachum et al. , 2018 ) . All HRL methods face a common challenge : switching smoothly from one lower-level policy to another when the meta-controller directs that a switch should occur . For example , running hurdles may require switching between running and jumping repeatedly while maintaining forward momentum . Previous approaches to this challenge ( Frans et al. , 2018 ; Andreas et al. , 2017 ; Lee et al. , 2019 ) involve either retraining existing lower-level policies and/or introducing a new policy to execute the switch . We focus on the latter and call the new policy the transition policy , following Lee et al . ( 2019 ) . A transition policy needs to switch between the states produced by one lower-level policy to an appropriate starting state for another . A natural way to train such a policy is to give a reward depending on whether the transition is successfully executed or not . However , this method induces a sparse reward that is difficult to learn from due to the temporal credit assignment problem ( Sutton , 1984 ) . Instead , we use inverse reinforcement learning ( IRL ) techniques to match the distribution of states produced by the transition policy to the distribution of states expected by the next lower-level policy ( Figure 1 ) . While the goal of IRL is infer an expert ’ s reward function from demonstrations of optimal behavior ( Ng et al. , 2000 ; Ziebart et al. , 2008 ) , some recent approaches to IRL ( e.g. , Finn et al . ( 2016 ) ; Ho & Ermon ( 2016 ) ; Fu et al . ( 2018 ) ) learn a policy that imitates the expert ’ s demonstrations in the process . In particular , Ho & Ermon ( 2016 ) propose a generative adversarial network ( GAN ) structure ( Goodfellow et al. , 2014 ) that matches the distribution of the policy ( generator ) with the distribution of the given data ( expert demonstrations ) . We use this GAN structure for distribution matching , and , consequently , we avoid the problem of designing an explicit reward function for transition policies . Although the transition policy is trained to produce the distribution of states and actions that is expected by the next lower-level policy , not all states in the distribution ’ s support have equal probability of success . To increase the rate of successful execution , we introduce a deep Q-network ( DQN ) ( Mnih et al. , 2013 ) to govern the switch from the transition policy to the next lower-level policy . The DQN has two actions , switch or stay , and a simple reward function where a positive reward is obtained if the next lower-level policy is successfully executed ; otherwise , a negative reward is given . The issue of sparse rewards is present here , but it is less of an issue because of the simple decision space . The main contribution of this paper is a new method for training transition policies for transitioning between lower-level policies . The two parts of our approach , the transition policy that matches the distribution of states and the DQN that determines when to transfer control , are both essential . Without the DQN , the state selected for transition may be familiar to the next policy , but lead to a poor success rate . Without the transition policy , there may be no appropriate state for the DQN to transition from . The proposed method reduces issues with sparse and delayed rewards that are encountered by prior approaches . We demonstrate our method on bipedal locomotion and arm manipulation tasks created by Lee et al . ( 2019 ) , in which the agent requires to have diverse skills and appropriately utilize them for each of the tasks . 2 PRELIMINARIES . The problem is formulated as a infinite-horizon Markov decision process ( MDP ) ( Puterman , 2014 ; Sutton & Barto , 2018 ) defined by the tupleM = ( S , A , P , R , γ , µ ) . The agent takes action at ∈ A for the current state st ∈ S at time t , then the reward function R : S × A → R returns the reward for ( st , at ) , and the next state st+1 is determined by the transition probability P ( st+1|st , at ) . γ is the discount factor and µ denotes the initial states distribution . The agent follows a policy πθ ( at|st ) that produces a distribution of actions for each state . The objective of reinforcement learning ( RL ) is to find the optimal θ that maximizes the expected discounted reward : θ∗ = argmax θ E s0∼µ at∼πθ ( ·|st ) st+1∼P ( ·|st , at ) [ ∞∑ t=0 γtR ( st , at ) ] . ( 1 ) 2.1 INVERSE REINFORCEMENT LEARNING . Whereas standard RL trains a policy to maximize a reward function , inverse reinforcement learning ( IRL ) ( Ng et al. , 2000 ; Ziebart et al. , 2008 ) seeks to learn the reward function from expert demonstrations of an optimal policy . Several approaches to the IRL problem ( Ho & Ermon , 2016 ; Fu et al. , 2018 ) adopt a GAN structure ( Goodfellow et al. , 2014 ) —the policy ( generator ) tries to select actions that the discriminator can not distinguish from the expert ’ s . As a by-product , the generator produces a policy with the same distribution as the expert ’ s at convergence . We use the state-action discriminator ( Fu et al. , 2018 ) rather than the trajectory-centric discriminator ( Finn et al. , 2016 ; Ho & Ermon , 2016 ) : Dψ , φ ( st , at , st+1 ) = exp { fψ , φ ( st , at , st+1 ) } exp { fψ , φ ( st , at , st+1 ) } + πθ ( at|st ) , ( 2 ) where fψ , φ ( st , at , st+1 ) = gψ ( st , at ) +γhφ ( st+1 ) −hφ ( st ) at time t , gψ is the reward approximator , and φ are the parameters of a shaping term hφ , which alleviates unwanted shaping for gψ . This discriminator Dψ , φ is trained to distinguish data from the expert and the generator ’ s policy via binary logistic regression , and the policy πθ is updated with Proximal Policy Optimization ( PPO ) ( Schulman et al. , 2017 ) according to the rewards rψ , φ provided by the discriminator : rψ , φ ( st , at , st+1 ) = logDψ , φ ( st , at , st+1 ) − log ( 1−Dψ , φ ( st , at , st+1 ) ) ( 3 ) 2.2 DEEP Q-LEARNING . Deep Q-learning ( Riedmiller , 2005 ; Mnih et al. , 2013 ) is a variant of Q-learning ( Watkins & Dayan , 1992 ) that produces a neural network called a deep Q-network ( DQN ) that aims to learn a deterministic optimal action from among a discrete set of actions for each state . Deep Q-learning suffers from overestimating yt ( Thrun & Schwartz , 1993 ) because of the max term , which impedes the learning process . Double Q-learning ( van Hasselt et al. , 2016 ) addresses this problem by decoupling the networks for choosing the action and evaluating value . The target networkQθ′ makes learning more stable by providing a target yt that is fixed for long periods of time : y′t = rt + γ Qθ′ ( st+1 , argmaxat+1Qθ ( st+1 , at+1 ) ) ( 4 ) The DQN is updated using a loss function such as the mean squared error ( y′t − Qθ ( st , at ) ) 2 . We use train a DQN with double Q-learning to get a signal that tells us when to switch from a transition policy to the next lower-level policy . 3 APPROACH . In this section , we present a methodology for transitioning between lower-level policies in hierarchical reinforcement learning ( HRL ) . We assume that we receive pre-trained lower-level subtask Algorithm 1 Training Transition Policy πa , b 1 : Input : pre-trained policies { πa , πb } , transition interval 2 : Initialize transition policy ( generator ) πa , b and discriminator Dψ , φ Equation ( 2 ) 3 : Collect the states Sπa of πa at the start of the transition interval 4 : Collect the trajectories ( states and actions ) Tπb of πb during the transition interval 5 : Initialize transition policy πa , b and discriminator Dψ , φ 6 : for i = 1 to n do 7 : for j = 1 to m do 8 : Sample s ∼ Sπa and set the state of πa , b to s 9 : Collect the trajectory Tπa , b generated by the current πa , b 10 : end for 11 : Train Dψ , φ with binary logistic regression to distinguish Tπa , b and Tπb 12 : Calculate reward rψ , φ set for all ( st , at , st+1 ) ∈ Tπa , b with Equation ( 3 ) 13 : Optimize πa , b with respect to Tπa , b and rψ , φ 14 : end for policies as input along with transition intervals—windows where a transition between two specific lower-level policies should occur . We seek to maximize performance on a complex task by combining the pre-trained policies without re-training them . To do this , we train a transition policy for each pair of pre-trained policies that we must transition between . The transition policy is activated at the start of each transition interval . Then , a DQN governs the switch from the transition policy to the next prescribed pre-trained policy . The DQN improves the rate of transition success relative to simply switching at the end of the transition interval.1 In Section 3.1 , we describe our training procedure for transition policies . In Section 3.2 , we describe how we collect data and design rewards for DQNs . Our framework is summarized by Figure 2 . 3.1 TRAINING THE TRANSITION POLICY . Let { π1 , π2 , ... , πn } denote n pre-trained policies and let πa , b denote a transition policy that aims to connect policy πa to πb . The meta-controller dictates a transition interval for each transition between pre-trained policies—a period of time when the transition should take place . If we were to simply switch from πa to πb at the start of this interval , πb can easily fail because it has never been trained on the last state produced by πa . To prevent this problem , πa , b needs to be able to start from any of the last states produced by πa and lead to a state from which πb can successfully perform the next task . Which states are favorable for starting πb ? A possible answer is the states produced by πb itself . We train πa , b to have the same distribution as πb with IRL ( Ng et al. , 2000 ; Ziebart et al. , 2008 ; Ho & Ermon , 2016 ; Fu et al. , 2018 ) . We specifically choose adversarial inverse reinforcement learning ( AIRL ) ( Fu et al. , 2018 ) , which has the GAN ( Goodfellow et al. , 2014 ) structure . The training procedure for πa , b is described in Algorithm 1. πa , b is trained with two classes of data : one from πa and one from πb . From πa , we collect the states Sπa of πa at the start of the transition interval . From πb , we collect the trajectories Tπb of πb during the the transition interval . The initial state of the generator πa , b is set to s , sampled from Sπa . Then , πa , b tries to generate trajectories that fool the discriminator D ( Equation 2 ) into classifying it as an example of Tπb . The discriminator D is trained with binary logistic regression to distinguish between the data from πb vs. πa , b . WhenD can no longer distinguish between them , πa , b can be said to have a similar distribution to πb . For example , we prepared a pre-trained Walking forward policy π1 and Jumping policy π2 for one of our experimental environments , Hurdle , manually shaping rewards for these two subtask policies . We use a transition interval of 3–4 meters from the hurdle . Thus , Sπ1 is the last states of π1—the sampled set of states when the agent ’ s location is 4 meters from the hurdle . Tπ2 is the trajectories 1We assume that the environment is static enough that it is not critical that the meta-controller has the opportunity to replan after the transition policy terminates . In principle , such replanning could be allowed by introducing an additional layer of transition policies , i.e. , by training training meta-transition policies that transition between transition policies and actions . Algorithm 2 Training Deep Q Network qa , b 1 : Input : pre-trained policies { πa , πb } , transition policy πa , b , transition interval 2 : Initialize qa , b and replay buffer B 3 : for i = 1 to n do 4 : Set environment to state of πa at the start of the transition interval 5 : while the current state is in the transition interval 6 : at ∼ πa , b ( st ) 7 : Execute environment for ( st , at ) and get st+1 and success-fail-alive signal τ 8 : Run qa , b and get an action aq 9 : if aq = switch 10 : set s = st+1 and break 11 : else if aq = stay 12 : Store ( st , aq , rf , st+1 ) in B if τ = fail or st+1 is outside the transition interval 13 : Store ( st , aq , 0 , st+1 ) in B if τ = alive 14 : end if 15 : end while 16 : while πb has not achieved subgoal and has not failed 17 : at ∼ πb ( st ) 18 : Execute environment for ( st , at ) and get st+1 and signal τ 19 : end while 20 : Store ( s , aq , rs , st+1 ) in B if τ = success 21 : Store ( s , aq , rf , st+1 ) in B if τ = fail 22 : Update qa , b with a minibatch from B according to Equation ( 4 ) 23 : end for of π2 from 3–4 meters from the hurdle . The transition policy π1,2 is initialized with one of the last states of π1 and learns to match the distribution π2 just before the jump is initiated .
The paper considers the problem of solving a complex task requiring different skills by combining "subtask" policies pretrained for each individual skill. One approach here consists in finding ways to transition smoothly between the policy $b$ for a subtask and the policy $b$ for the next subtask. The paper proposes to do that based on training a "transition policy" that starts from a state produced by $a$ and attempts to match the _distribution_ of state-action pairs associated with $b$. Additionally, a DQN controls the exact timing at which the transition policy passes the control to $b$, which improves the success rate of the transition. Experiments are conducted on some simulated arm manipulation and bipedal locomotion tasks with similar results to current baselines on the first group and superior results on the second group.
SP:d196aa46cc5913f8a1314bfcd5bf7039a4e82642
Pessimistic Model Selection for Offline Deep Reinforcement Learning
1 INTRODUCTION . The success of deep reinforcement learning ( Mnih et al. , 2013 ; Henderson et al. , 2018 ) ( DRL ) often leverages upon executive training data with considerable efforts to select effective neural architectures . Deploying online simulation to learn useful representations for DRL is not always realistic and possible especially in some high-stake environments , such as automatic navigation ( Kahn et al. , 2018 ; Hase et al. , 2020 ) , dialogue learning ( Jaques et al. , 2020 ) , and clinical applications ( Tang et al. , 2020a ) . Offline reinforcement learning ( Singh & Sutton , 1996 ; Levine et al. , 2020 ; Agarwal et al. , 2020 ) ( OffRL ) has prompted strong interests ( Paine et al. , 2020 ; Kidambi et al. , 2020 ) to empower DRL toward training tasks associated with severe potential cost and risks . The idea of OffRL is to train DRL models with only logged data and recorded trajectories . However , with given observational data , designing a successful neural architecture in OffRL is often expensive ( Levine et al. , 2020 ) , requiring intensive experiments , time , and computing resources . Unlike most aforementioned applications with online interaction , Offline tasks for reinforcement learning often suffer the challenges from insufficient observational data from offline collection to construct a universal approximated model for fully capturing the temporal dynamics . Therefore , relatively few attempts in the literature have been presented for provide a pipeline to automate the development process for model selection and neural architecture search in OffRL settings . Here , model selection refers to selecting the best model ( e.g. , the policy learned by a trained neural network ) among a set of candidate models ( e.g . different neural network hyperparameters ) . In this work , we propose a novel model selection approach to automate OffRL development process , which provides an evaluation mechanism to identify a well-performed DRL model given offline data . Our method utilizes statistical inference to provide uncertainty quantification on value functions trained by different DRL models , based on which a pessimistic idea is incorporated to select the best model/policy . In addition , two refined approaches are further proposed to address the possible biases of DRL models in identifying the optimal policy . In this work , we mainly focus on deep Q-network ( Mnih et al. , 2013 ; 2015 ) ( DQN ) based architectures , while our proposed methods can be extended to other settings . Figure 1 demonstrates the superior performance of the proposed pessimistic model selection ( PMS ) method in identifying the best model among 70 DRL models of different algorithms on one navigation task ( See Appendix C for details ) , compared with the model selection method by ( Tang & Wiens , 2021 ) which uses three offline policy evaluation ( OPE ) estimates for validation . Specifically , based on the derived confidence interval of the OPE value for each candidate model , the final selected model by our PMS method is the one that has the largest lower confidence limit , which exactly has the largest true OPE value among all candidate models . In contrast , none of three OPE estimates used for model selection by Tang & Wiens ( 2021 ) can identify the best model due to the inevitable overfitting issue during the validation procedure . To close this section , we summarize the contributions of this work as follows : • We propose a novel PMS framework , which targets finding the best policy from given candidate models ( e.g. , neural architecture , hyperparameters , etc ) with offline data for DQN learning . Unlike many existing methods , our approach essentially does not involve additional hyperparameter tuning except for two interpretable parameters . • Leveraging asymptotic analysis in statistical inference , we provide uncertainty quantification on each candidate model , based on which our method can guarantee that the worst performance of finally selected model is the best among all candidate models . See Corollary 1 for more details . • To address potential biases of candidate models in identifying the optimal policy , two refined approaches are proposed , one of which can be shown to have regret bounded by the smallest error bound among all candidate models under some technical conditions ( See Corollary 2 ) . To the best of our knowledge , this is the first model-selection method in offline DRL with such a guarantee . • The numerical results demonstrate that the proposed PMS shows superior performance in different DQN benchmark environments . 2 RELATED WORK . Model Selection for Reinforcement Learning : Model selection has been studied in online decision-making environments ( Fard & Pineau , 2010 ; Lee & Taylor , 2014 ) . Searching nearly optimal online model is a critical topic for online bandits problems with limited information feed-backs . For linear contextual bandits , Abbasi-Yadkori et al . ( 2011 ) ; Chu et al . ( 2011 ) are aiming to find the best worst-case bound when the optimal model class is given . For model-based reinforcement learning , Pacchiano et al . ( 2020 ) introduces advantages of using noise augmented Markov Decision Processes ( MDP ) to archive a competitive regret bound to select an individual model with constraints for ensemble training . Recently , Lee et al . ( 2021 ) utilized an online algorithm to select a low-complexity model based on a statistical test . However , most of the previous model selection approaches are focused on the online reinforcement learning setting . Very few works including Farahmand & Szepesvári ( 2011 ) ; Paine et al . ( 2020 ) ; Su et al . ( 2020 ) ; Yang et al . ( 2020 ) ; Kuzborskij et al . ( 2021 ) ; Tang & Wiens ( 2021 ) ; Xie & Jiang ( 2021 ) are focused on the offline setting . In particular , ( Su et al. , 2020 ; Yang et al. , 2020 ; Kuzborskij et al. , 2021 ) focus on model selection for OPE problem . ( Farahmand & Szepesvári , 2011 ; Xie & Jiang , 2021 ) select the best model/policy based on minimizing the Bellman error , while the first approach requires an additional tuning and latter does not . ( Paine et al. , 2020 ; Tang & Wiens , 2021 ) proposed several criteria to perform model selection in OffRL and mainly focused on numerical studies . In this work , we provide one of the first model selection approaches based on statistical inference for RL tasks with offline data collection . Offline-Policy Learning : Training a DRL agent with offline data collection often relies on batchwise optimization . Batch-Constrained deep Q-learning ( Fujimoto et al. , 2019 ) ( BCQ ) is considered one OffRL benchmark that uses a generative model to minimize the distance of selected actions to the batch-wise data with a perturbation model to maximize its value function . Other popular OffRL approaches , such as behavior regularized actor-critic ( BRAC ) ( Wu et al. , 2019 ) , and random ensemble mixture ( Agarwal et al. , 2020 ) ( REM ) ( as an optimistic perspective on large dataset ) , have also been studied in RL Unplugged ( RLU ) ( Gulcehre et al. , 2020 ) benchmark together with behavior cloning ( Bain & Sammut , 1995 ; Ross & Bagnell , 2010 ) ( BC ) , DQN , and DQN with quantile regression ( Dabney et al. , 2018 ) ( QR-DQN ) . RLU suggests a naive approach based on human experience for offline policy selection , which requires independent modification with shared domain expertise ( e.g. , Atari environments ) for tuning each baseline . Meanwhile , how to design a model selection algorithm for OffRL remains an open question . Motivated by the benefits and the challenges as mentioned earlier of the model selection for offline DRL , we aim to develop a unified approach for model selection in offline DRL with theoretical guarantee and interpretable tuning parameters . 3 BACKGROUND AND NOTATIONS . Consider a time-homogeneous Markov decision process ( MDP ) characterized by a tuple M = ( S , A , p , r , γ ) , where S is the state space , A is the action space , p is the transition kernel , i.e. , p ( s′|s , a ) is the probability mass ( density ) of transiting to s′ given current state-action ( s , a ) , r is the reward function , i.e. , E ( Rt|St = s , At = a ) = r ( s , a ) for t ≥ 0 , and 0 ≤ γ < 1 is a discount factor . For simplifying presentation , we assume A and S are both finite . But our method can also be applied in continuous cases . Under this MDP setting , it is sufficient to consider stationary Markovian policies for optimizing discounted sum of rewards ( Puterman , 1994 ) . Denote π as a stationary Markovian policy mapping from the state space S into a probability distribution over the action space . For example , π ( a|s ) denotes the probability of choosing action a given the state value s. One essential goal of RL is to learn an optimal policy that maximizes the value function . Define V π ( s ) = ∑+∞ t=0 γ tEπ [ Rt|S0 = s ] and then the optimal policy is defined as π∗ ∈ argmaxπ { V ( π ) , ( 1 − γ ) ∑ s∈S V π ( s ) ν ( s ) } , where ν denotes some reference distribution function over S. In addition , we denote Q-function asQπ ( s , a ) = ∑+∞ t=0 γ tEπ ( Rt|A0 = a , S0 = s ) for s ∈ S and a ∈ A . In this work , we consider the OffRL setting . The observed data consist of N trajectories , corresponding to N independent and identically distributed copies of { ( St , At , Rt ) } t≥0 . For any i ∈ { 1 , · · · , n } , data collected from the ith trajectory can be summarized by { ( Si , t , Ai , t , Ri , t , Si , t+1 ) } 0≤t < T , where T denotes the termination time . We assume that the data are generated by some fixed stationary policy denoted by b . Among many RL algorithms , we focus on Q-learning type of methods . The foundation is the optimal Bellman equation given below . Q∗ ( s , a ) = E [ Rt + γ max a′∈A Q∗ ( St+1 , a ′ ) |St = s , At = a ] , ( 1 ) where Q∗ is called optimal Q-function , i.e. , Q-function under π∗ . Among others , fitted q-iteration ( FQI ) is one of the most popular RL algorithms ( Ernst et al. , 2005 ) . FQI leverages supervised learning techniques to iteratively solve the optimal Bellman equation ( 1 ) and shows competitive performance in OffRL . To facilitate our model-selection algorithm , we introduce the discounted visitation probability , motivated by the marginal importance sampling estimator in ( Liu et al. , 2018 ) . For any t ≥ 0 , let pπt ( s , a ) denote the t-step visitation probability Pr π ( St = s , At = a ) assuming the actions are selected according to π at time 1 , · · · , t. We define the discounted visitation probability function as dπ ( s , a ) = ( 1 − γ ) ∑ t≥0 γ tpπt ( s , a ) . To adjust the distribution from behavior policy to any target policy π , we use the discounted probability ratio function defined as ωπ , ν ( s , a ) = dπ ( s ) π ( a|s ) 1 T ∑T−1 t=0 p b t ( s , a ) , ( 2 ) where pbt ( s , a ) is the t-step visitation probability under the behavior policy b , i.e. , Pr b ( St = s , At = a ) . The ratio function ωπ , ν ( s , a ) is always assumed well defined . The estimation of ratio function is motivated by the observation that for every measurable function f defined over S ×A , E [ 1 T T−1∑ t=0 ωπ , ν ( St , At ) ( f ( St , At ) − γ ∑ a′∈A π ( a′ | St+1 ) f ( St+1 , a′ ) ) ] = ( 1− γ ) ES0∼ν [ ∑ a∈A π ( a | S0 ) f ( a , S0 ) ] , ( 3 ) based on which several min-max estimation methods has been proposed such as ( Liu et al. , 2018 ; Nachum et al. , 2019 ; Uehara & Jiang , 2019 ) ; We refer to ( Uehara & Jiang , 2019 , Lemma 1 ) for a formal proof of equation ( 3 ) . Finally , because our proposed model selection algorithm relies on an efficient evaluation of any target policy using batch data , we introduce three types of offline policy evaluation estimators in the existing RL literature . The first type is called direct method via estimating Q-function , based on the relationship that V ( π ) = ( 1 − γ ) ∑ s∈S , a∈A π ( a|s ) Q ( s , a ) ν ( s ) . The second type is motivated by the importance sampling ( Precup , 2000 ) . Based on the definition of ratio function , we can see V ( π ) = E [ 1T ∑T−1 t=0 ω π , ν ( St , At ) Rt ] , from which a plugin estimator can be constructed . The last type of OPE methods combines the first two types of methods and construct a so-called doubly robust estimator ( Kallus & Uehara , 2019 ; Tang et al. , 2020b ) . This estimator is motivated by the efficient influence function of V ( π ) under a transition-sampling setting and the model that consists of the set of all observed data distributions given by arbitrarily varying the initial , transition , reward , and behavior policy distributions , subject to certain minimal regularity and identifiability conditions ( Kallus & Uehara , 2019 ) , i.e. , 1 T T−1∑ t=0 ωπ , ν ( St , At ) ( Rt + γ ∑ a∈A π ( a|St+1 ) Qπ ( St+1 , a ) −Qπ ( St , At ) ) + ( 1− γ ) ES0∼ν [ ∑ a∈A π ( a|S0 ) Qπ ( S0 , a ) ] − V ( π ) . ( 4 ) A nice property of doubly robust estimators is that as long as either the Q-function Qπ ( s , a ) or the ratio function ωπ , ν ( s , a ) can be consistently estimated , the final estimator of V ( π ) is consistent ( Robins et al. , 1994 ; Jiang & Li , 2015 ; Kallus & Uehara , 2019 ; Tang et al. , 2020b ) . Furthermore , a doubly robust estimator based on ( 4 ) can achieve semiparametric efficiency under the conditions proposed by ( Kallus & Uehara , 2019 ) , even if nuisance parameters are estimated via black box models such as deep neural networks . Therefore such an estimator is particularly suitable under the framework of DRL . Our proposed algorithm will rely on this doubly robust type of OPE estimator .
This paper considers the model selection problem in offline RL and proposes a new procedure called pessimistic model selection (PMS) that estimates performance lower bound for each candidate policy. Theoretical results show that under certain assumptions PMS can identify the best candidate policy with high probability. The proposed approach is compared to three common OPE methods used in Tang & Wiens 2021 and shows favorable performance on 6 RL domains.
SP:04d8d19a1a8868769e3e9f3566e1beda271be578
Pessimistic Model Selection for Offline Deep Reinforcement Learning
1 INTRODUCTION . The success of deep reinforcement learning ( Mnih et al. , 2013 ; Henderson et al. , 2018 ) ( DRL ) often leverages upon executive training data with considerable efforts to select effective neural architectures . Deploying online simulation to learn useful representations for DRL is not always realistic and possible especially in some high-stake environments , such as automatic navigation ( Kahn et al. , 2018 ; Hase et al. , 2020 ) , dialogue learning ( Jaques et al. , 2020 ) , and clinical applications ( Tang et al. , 2020a ) . Offline reinforcement learning ( Singh & Sutton , 1996 ; Levine et al. , 2020 ; Agarwal et al. , 2020 ) ( OffRL ) has prompted strong interests ( Paine et al. , 2020 ; Kidambi et al. , 2020 ) to empower DRL toward training tasks associated with severe potential cost and risks . The idea of OffRL is to train DRL models with only logged data and recorded trajectories . However , with given observational data , designing a successful neural architecture in OffRL is often expensive ( Levine et al. , 2020 ) , requiring intensive experiments , time , and computing resources . Unlike most aforementioned applications with online interaction , Offline tasks for reinforcement learning often suffer the challenges from insufficient observational data from offline collection to construct a universal approximated model for fully capturing the temporal dynamics . Therefore , relatively few attempts in the literature have been presented for provide a pipeline to automate the development process for model selection and neural architecture search in OffRL settings . Here , model selection refers to selecting the best model ( e.g. , the policy learned by a trained neural network ) among a set of candidate models ( e.g . different neural network hyperparameters ) . In this work , we propose a novel model selection approach to automate OffRL development process , which provides an evaluation mechanism to identify a well-performed DRL model given offline data . Our method utilizes statistical inference to provide uncertainty quantification on value functions trained by different DRL models , based on which a pessimistic idea is incorporated to select the best model/policy . In addition , two refined approaches are further proposed to address the possible biases of DRL models in identifying the optimal policy . In this work , we mainly focus on deep Q-network ( Mnih et al. , 2013 ; 2015 ) ( DQN ) based architectures , while our proposed methods can be extended to other settings . Figure 1 demonstrates the superior performance of the proposed pessimistic model selection ( PMS ) method in identifying the best model among 70 DRL models of different algorithms on one navigation task ( See Appendix C for details ) , compared with the model selection method by ( Tang & Wiens , 2021 ) which uses three offline policy evaluation ( OPE ) estimates for validation . Specifically , based on the derived confidence interval of the OPE value for each candidate model , the final selected model by our PMS method is the one that has the largest lower confidence limit , which exactly has the largest true OPE value among all candidate models . In contrast , none of three OPE estimates used for model selection by Tang & Wiens ( 2021 ) can identify the best model due to the inevitable overfitting issue during the validation procedure . To close this section , we summarize the contributions of this work as follows : • We propose a novel PMS framework , which targets finding the best policy from given candidate models ( e.g. , neural architecture , hyperparameters , etc ) with offline data for DQN learning . Unlike many existing methods , our approach essentially does not involve additional hyperparameter tuning except for two interpretable parameters . • Leveraging asymptotic analysis in statistical inference , we provide uncertainty quantification on each candidate model , based on which our method can guarantee that the worst performance of finally selected model is the best among all candidate models . See Corollary 1 for more details . • To address potential biases of candidate models in identifying the optimal policy , two refined approaches are proposed , one of which can be shown to have regret bounded by the smallest error bound among all candidate models under some technical conditions ( See Corollary 2 ) . To the best of our knowledge , this is the first model-selection method in offline DRL with such a guarantee . • The numerical results demonstrate that the proposed PMS shows superior performance in different DQN benchmark environments . 2 RELATED WORK . Model Selection for Reinforcement Learning : Model selection has been studied in online decision-making environments ( Fard & Pineau , 2010 ; Lee & Taylor , 2014 ) . Searching nearly optimal online model is a critical topic for online bandits problems with limited information feed-backs . For linear contextual bandits , Abbasi-Yadkori et al . ( 2011 ) ; Chu et al . ( 2011 ) are aiming to find the best worst-case bound when the optimal model class is given . For model-based reinforcement learning , Pacchiano et al . ( 2020 ) introduces advantages of using noise augmented Markov Decision Processes ( MDP ) to archive a competitive regret bound to select an individual model with constraints for ensemble training . Recently , Lee et al . ( 2021 ) utilized an online algorithm to select a low-complexity model based on a statistical test . However , most of the previous model selection approaches are focused on the online reinforcement learning setting . Very few works including Farahmand & Szepesvári ( 2011 ) ; Paine et al . ( 2020 ) ; Su et al . ( 2020 ) ; Yang et al . ( 2020 ) ; Kuzborskij et al . ( 2021 ) ; Tang & Wiens ( 2021 ) ; Xie & Jiang ( 2021 ) are focused on the offline setting . In particular , ( Su et al. , 2020 ; Yang et al. , 2020 ; Kuzborskij et al. , 2021 ) focus on model selection for OPE problem . ( Farahmand & Szepesvári , 2011 ; Xie & Jiang , 2021 ) select the best model/policy based on minimizing the Bellman error , while the first approach requires an additional tuning and latter does not . ( Paine et al. , 2020 ; Tang & Wiens , 2021 ) proposed several criteria to perform model selection in OffRL and mainly focused on numerical studies . In this work , we provide one of the first model selection approaches based on statistical inference for RL tasks with offline data collection . Offline-Policy Learning : Training a DRL agent with offline data collection often relies on batchwise optimization . Batch-Constrained deep Q-learning ( Fujimoto et al. , 2019 ) ( BCQ ) is considered one OffRL benchmark that uses a generative model to minimize the distance of selected actions to the batch-wise data with a perturbation model to maximize its value function . Other popular OffRL approaches , such as behavior regularized actor-critic ( BRAC ) ( Wu et al. , 2019 ) , and random ensemble mixture ( Agarwal et al. , 2020 ) ( REM ) ( as an optimistic perspective on large dataset ) , have also been studied in RL Unplugged ( RLU ) ( Gulcehre et al. , 2020 ) benchmark together with behavior cloning ( Bain & Sammut , 1995 ; Ross & Bagnell , 2010 ) ( BC ) , DQN , and DQN with quantile regression ( Dabney et al. , 2018 ) ( QR-DQN ) . RLU suggests a naive approach based on human experience for offline policy selection , which requires independent modification with shared domain expertise ( e.g. , Atari environments ) for tuning each baseline . Meanwhile , how to design a model selection algorithm for OffRL remains an open question . Motivated by the benefits and the challenges as mentioned earlier of the model selection for offline DRL , we aim to develop a unified approach for model selection in offline DRL with theoretical guarantee and interpretable tuning parameters . 3 BACKGROUND AND NOTATIONS . Consider a time-homogeneous Markov decision process ( MDP ) characterized by a tuple M = ( S , A , p , r , γ ) , where S is the state space , A is the action space , p is the transition kernel , i.e. , p ( s′|s , a ) is the probability mass ( density ) of transiting to s′ given current state-action ( s , a ) , r is the reward function , i.e. , E ( Rt|St = s , At = a ) = r ( s , a ) for t ≥ 0 , and 0 ≤ γ < 1 is a discount factor . For simplifying presentation , we assume A and S are both finite . But our method can also be applied in continuous cases . Under this MDP setting , it is sufficient to consider stationary Markovian policies for optimizing discounted sum of rewards ( Puterman , 1994 ) . Denote π as a stationary Markovian policy mapping from the state space S into a probability distribution over the action space . For example , π ( a|s ) denotes the probability of choosing action a given the state value s. One essential goal of RL is to learn an optimal policy that maximizes the value function . Define V π ( s ) = ∑+∞ t=0 γ tEπ [ Rt|S0 = s ] and then the optimal policy is defined as π∗ ∈ argmaxπ { V ( π ) , ( 1 − γ ) ∑ s∈S V π ( s ) ν ( s ) } , where ν denotes some reference distribution function over S. In addition , we denote Q-function asQπ ( s , a ) = ∑+∞ t=0 γ tEπ ( Rt|A0 = a , S0 = s ) for s ∈ S and a ∈ A . In this work , we consider the OffRL setting . The observed data consist of N trajectories , corresponding to N independent and identically distributed copies of { ( St , At , Rt ) } t≥0 . For any i ∈ { 1 , · · · , n } , data collected from the ith trajectory can be summarized by { ( Si , t , Ai , t , Ri , t , Si , t+1 ) } 0≤t < T , where T denotes the termination time . We assume that the data are generated by some fixed stationary policy denoted by b . Among many RL algorithms , we focus on Q-learning type of methods . The foundation is the optimal Bellman equation given below . Q∗ ( s , a ) = E [ Rt + γ max a′∈A Q∗ ( St+1 , a ′ ) |St = s , At = a ] , ( 1 ) where Q∗ is called optimal Q-function , i.e. , Q-function under π∗ . Among others , fitted q-iteration ( FQI ) is one of the most popular RL algorithms ( Ernst et al. , 2005 ) . FQI leverages supervised learning techniques to iteratively solve the optimal Bellman equation ( 1 ) and shows competitive performance in OffRL . To facilitate our model-selection algorithm , we introduce the discounted visitation probability , motivated by the marginal importance sampling estimator in ( Liu et al. , 2018 ) . For any t ≥ 0 , let pπt ( s , a ) denote the t-step visitation probability Pr π ( St = s , At = a ) assuming the actions are selected according to π at time 1 , · · · , t. We define the discounted visitation probability function as dπ ( s , a ) = ( 1 − γ ) ∑ t≥0 γ tpπt ( s , a ) . To adjust the distribution from behavior policy to any target policy π , we use the discounted probability ratio function defined as ωπ , ν ( s , a ) = dπ ( s ) π ( a|s ) 1 T ∑T−1 t=0 p b t ( s , a ) , ( 2 ) where pbt ( s , a ) is the t-step visitation probability under the behavior policy b , i.e. , Pr b ( St = s , At = a ) . The ratio function ωπ , ν ( s , a ) is always assumed well defined . The estimation of ratio function is motivated by the observation that for every measurable function f defined over S ×A , E [ 1 T T−1∑ t=0 ωπ , ν ( St , At ) ( f ( St , At ) − γ ∑ a′∈A π ( a′ | St+1 ) f ( St+1 , a′ ) ) ] = ( 1− γ ) ES0∼ν [ ∑ a∈A π ( a | S0 ) f ( a , S0 ) ] , ( 3 ) based on which several min-max estimation methods has been proposed such as ( Liu et al. , 2018 ; Nachum et al. , 2019 ; Uehara & Jiang , 2019 ) ; We refer to ( Uehara & Jiang , 2019 , Lemma 1 ) for a formal proof of equation ( 3 ) . Finally , because our proposed model selection algorithm relies on an efficient evaluation of any target policy using batch data , we introduce three types of offline policy evaluation estimators in the existing RL literature . The first type is called direct method via estimating Q-function , based on the relationship that V ( π ) = ( 1 − γ ) ∑ s∈S , a∈A π ( a|s ) Q ( s , a ) ν ( s ) . The second type is motivated by the importance sampling ( Precup , 2000 ) . Based on the definition of ratio function , we can see V ( π ) = E [ 1T ∑T−1 t=0 ω π , ν ( St , At ) Rt ] , from which a plugin estimator can be constructed . The last type of OPE methods combines the first two types of methods and construct a so-called doubly robust estimator ( Kallus & Uehara , 2019 ; Tang et al. , 2020b ) . This estimator is motivated by the efficient influence function of V ( π ) under a transition-sampling setting and the model that consists of the set of all observed data distributions given by arbitrarily varying the initial , transition , reward , and behavior policy distributions , subject to certain minimal regularity and identifiability conditions ( Kallus & Uehara , 2019 ) , i.e. , 1 T T−1∑ t=0 ωπ , ν ( St , At ) ( Rt + γ ∑ a∈A π ( a|St+1 ) Qπ ( St+1 , a ) −Qπ ( St , At ) ) + ( 1− γ ) ES0∼ν [ ∑ a∈A π ( a|S0 ) Qπ ( S0 , a ) ] − V ( π ) . ( 4 ) A nice property of doubly robust estimators is that as long as either the Q-function Qπ ( s , a ) or the ratio function ωπ , ν ( s , a ) can be consistently estimated , the final estimator of V ( π ) is consistent ( Robins et al. , 1994 ; Jiang & Li , 2015 ; Kallus & Uehara , 2019 ; Tang et al. , 2020b ) . Furthermore , a doubly robust estimator based on ( 4 ) can achieve semiparametric efficiency under the conditions proposed by ( Kallus & Uehara , 2019 ) , even if nuisance parameters are estimated via black box models such as deep neural networks . Therefore such an estimator is particularly suitable under the framework of DRL . Our proposed algorithm will rely on this doubly robust type of OPE estimator .
This paper proposed a new algorithm for model-section in offline RL based on adding the pessimism principle on top of existing OPE algorithms. Under strong assumptions, the paper provides an asymptotic convergence result for the proposed algorithm. It also provides empirical experiments demonstrating that the proposed algorithm outperforms existing baselines.
SP:04d8d19a1a8868769e3e9f3566e1beda271be578
Pessimistic Model Selection for Offline Deep Reinforcement Learning
1 INTRODUCTION . The success of deep reinforcement learning ( Mnih et al. , 2013 ; Henderson et al. , 2018 ) ( DRL ) often leverages upon executive training data with considerable efforts to select effective neural architectures . Deploying online simulation to learn useful representations for DRL is not always realistic and possible especially in some high-stake environments , such as automatic navigation ( Kahn et al. , 2018 ; Hase et al. , 2020 ) , dialogue learning ( Jaques et al. , 2020 ) , and clinical applications ( Tang et al. , 2020a ) . Offline reinforcement learning ( Singh & Sutton , 1996 ; Levine et al. , 2020 ; Agarwal et al. , 2020 ) ( OffRL ) has prompted strong interests ( Paine et al. , 2020 ; Kidambi et al. , 2020 ) to empower DRL toward training tasks associated with severe potential cost and risks . The idea of OffRL is to train DRL models with only logged data and recorded trajectories . However , with given observational data , designing a successful neural architecture in OffRL is often expensive ( Levine et al. , 2020 ) , requiring intensive experiments , time , and computing resources . Unlike most aforementioned applications with online interaction , Offline tasks for reinforcement learning often suffer the challenges from insufficient observational data from offline collection to construct a universal approximated model for fully capturing the temporal dynamics . Therefore , relatively few attempts in the literature have been presented for provide a pipeline to automate the development process for model selection and neural architecture search in OffRL settings . Here , model selection refers to selecting the best model ( e.g. , the policy learned by a trained neural network ) among a set of candidate models ( e.g . different neural network hyperparameters ) . In this work , we propose a novel model selection approach to automate OffRL development process , which provides an evaluation mechanism to identify a well-performed DRL model given offline data . Our method utilizes statistical inference to provide uncertainty quantification on value functions trained by different DRL models , based on which a pessimistic idea is incorporated to select the best model/policy . In addition , two refined approaches are further proposed to address the possible biases of DRL models in identifying the optimal policy . In this work , we mainly focus on deep Q-network ( Mnih et al. , 2013 ; 2015 ) ( DQN ) based architectures , while our proposed methods can be extended to other settings . Figure 1 demonstrates the superior performance of the proposed pessimistic model selection ( PMS ) method in identifying the best model among 70 DRL models of different algorithms on one navigation task ( See Appendix C for details ) , compared with the model selection method by ( Tang & Wiens , 2021 ) which uses three offline policy evaluation ( OPE ) estimates for validation . Specifically , based on the derived confidence interval of the OPE value for each candidate model , the final selected model by our PMS method is the one that has the largest lower confidence limit , which exactly has the largest true OPE value among all candidate models . In contrast , none of three OPE estimates used for model selection by Tang & Wiens ( 2021 ) can identify the best model due to the inevitable overfitting issue during the validation procedure . To close this section , we summarize the contributions of this work as follows : • We propose a novel PMS framework , which targets finding the best policy from given candidate models ( e.g. , neural architecture , hyperparameters , etc ) with offline data for DQN learning . Unlike many existing methods , our approach essentially does not involve additional hyperparameter tuning except for two interpretable parameters . • Leveraging asymptotic analysis in statistical inference , we provide uncertainty quantification on each candidate model , based on which our method can guarantee that the worst performance of finally selected model is the best among all candidate models . See Corollary 1 for more details . • To address potential biases of candidate models in identifying the optimal policy , two refined approaches are proposed , one of which can be shown to have regret bounded by the smallest error bound among all candidate models under some technical conditions ( See Corollary 2 ) . To the best of our knowledge , this is the first model-selection method in offline DRL with such a guarantee . • The numerical results demonstrate that the proposed PMS shows superior performance in different DQN benchmark environments . 2 RELATED WORK . Model Selection for Reinforcement Learning : Model selection has been studied in online decision-making environments ( Fard & Pineau , 2010 ; Lee & Taylor , 2014 ) . Searching nearly optimal online model is a critical topic for online bandits problems with limited information feed-backs . For linear contextual bandits , Abbasi-Yadkori et al . ( 2011 ) ; Chu et al . ( 2011 ) are aiming to find the best worst-case bound when the optimal model class is given . For model-based reinforcement learning , Pacchiano et al . ( 2020 ) introduces advantages of using noise augmented Markov Decision Processes ( MDP ) to archive a competitive regret bound to select an individual model with constraints for ensemble training . Recently , Lee et al . ( 2021 ) utilized an online algorithm to select a low-complexity model based on a statistical test . However , most of the previous model selection approaches are focused on the online reinforcement learning setting . Very few works including Farahmand & Szepesvári ( 2011 ) ; Paine et al . ( 2020 ) ; Su et al . ( 2020 ) ; Yang et al . ( 2020 ) ; Kuzborskij et al . ( 2021 ) ; Tang & Wiens ( 2021 ) ; Xie & Jiang ( 2021 ) are focused on the offline setting . In particular , ( Su et al. , 2020 ; Yang et al. , 2020 ; Kuzborskij et al. , 2021 ) focus on model selection for OPE problem . ( Farahmand & Szepesvári , 2011 ; Xie & Jiang , 2021 ) select the best model/policy based on minimizing the Bellman error , while the first approach requires an additional tuning and latter does not . ( Paine et al. , 2020 ; Tang & Wiens , 2021 ) proposed several criteria to perform model selection in OffRL and mainly focused on numerical studies . In this work , we provide one of the first model selection approaches based on statistical inference for RL tasks with offline data collection . Offline-Policy Learning : Training a DRL agent with offline data collection often relies on batchwise optimization . Batch-Constrained deep Q-learning ( Fujimoto et al. , 2019 ) ( BCQ ) is considered one OffRL benchmark that uses a generative model to minimize the distance of selected actions to the batch-wise data with a perturbation model to maximize its value function . Other popular OffRL approaches , such as behavior regularized actor-critic ( BRAC ) ( Wu et al. , 2019 ) , and random ensemble mixture ( Agarwal et al. , 2020 ) ( REM ) ( as an optimistic perspective on large dataset ) , have also been studied in RL Unplugged ( RLU ) ( Gulcehre et al. , 2020 ) benchmark together with behavior cloning ( Bain & Sammut , 1995 ; Ross & Bagnell , 2010 ) ( BC ) , DQN , and DQN with quantile regression ( Dabney et al. , 2018 ) ( QR-DQN ) . RLU suggests a naive approach based on human experience for offline policy selection , which requires independent modification with shared domain expertise ( e.g. , Atari environments ) for tuning each baseline . Meanwhile , how to design a model selection algorithm for OffRL remains an open question . Motivated by the benefits and the challenges as mentioned earlier of the model selection for offline DRL , we aim to develop a unified approach for model selection in offline DRL with theoretical guarantee and interpretable tuning parameters . 3 BACKGROUND AND NOTATIONS . Consider a time-homogeneous Markov decision process ( MDP ) characterized by a tuple M = ( S , A , p , r , γ ) , where S is the state space , A is the action space , p is the transition kernel , i.e. , p ( s′|s , a ) is the probability mass ( density ) of transiting to s′ given current state-action ( s , a ) , r is the reward function , i.e. , E ( Rt|St = s , At = a ) = r ( s , a ) for t ≥ 0 , and 0 ≤ γ < 1 is a discount factor . For simplifying presentation , we assume A and S are both finite . But our method can also be applied in continuous cases . Under this MDP setting , it is sufficient to consider stationary Markovian policies for optimizing discounted sum of rewards ( Puterman , 1994 ) . Denote π as a stationary Markovian policy mapping from the state space S into a probability distribution over the action space . For example , π ( a|s ) denotes the probability of choosing action a given the state value s. One essential goal of RL is to learn an optimal policy that maximizes the value function . Define V π ( s ) = ∑+∞ t=0 γ tEπ [ Rt|S0 = s ] and then the optimal policy is defined as π∗ ∈ argmaxπ { V ( π ) , ( 1 − γ ) ∑ s∈S V π ( s ) ν ( s ) } , where ν denotes some reference distribution function over S. In addition , we denote Q-function asQπ ( s , a ) = ∑+∞ t=0 γ tEπ ( Rt|A0 = a , S0 = s ) for s ∈ S and a ∈ A . In this work , we consider the OffRL setting . The observed data consist of N trajectories , corresponding to N independent and identically distributed copies of { ( St , At , Rt ) } t≥0 . For any i ∈ { 1 , · · · , n } , data collected from the ith trajectory can be summarized by { ( Si , t , Ai , t , Ri , t , Si , t+1 ) } 0≤t < T , where T denotes the termination time . We assume that the data are generated by some fixed stationary policy denoted by b . Among many RL algorithms , we focus on Q-learning type of methods . The foundation is the optimal Bellman equation given below . Q∗ ( s , a ) = E [ Rt + γ max a′∈A Q∗ ( St+1 , a ′ ) |St = s , At = a ] , ( 1 ) where Q∗ is called optimal Q-function , i.e. , Q-function under π∗ . Among others , fitted q-iteration ( FQI ) is one of the most popular RL algorithms ( Ernst et al. , 2005 ) . FQI leverages supervised learning techniques to iteratively solve the optimal Bellman equation ( 1 ) and shows competitive performance in OffRL . To facilitate our model-selection algorithm , we introduce the discounted visitation probability , motivated by the marginal importance sampling estimator in ( Liu et al. , 2018 ) . For any t ≥ 0 , let pπt ( s , a ) denote the t-step visitation probability Pr π ( St = s , At = a ) assuming the actions are selected according to π at time 1 , · · · , t. We define the discounted visitation probability function as dπ ( s , a ) = ( 1 − γ ) ∑ t≥0 γ tpπt ( s , a ) . To adjust the distribution from behavior policy to any target policy π , we use the discounted probability ratio function defined as ωπ , ν ( s , a ) = dπ ( s ) π ( a|s ) 1 T ∑T−1 t=0 p b t ( s , a ) , ( 2 ) where pbt ( s , a ) is the t-step visitation probability under the behavior policy b , i.e. , Pr b ( St = s , At = a ) . The ratio function ωπ , ν ( s , a ) is always assumed well defined . The estimation of ratio function is motivated by the observation that for every measurable function f defined over S ×A , E [ 1 T T−1∑ t=0 ωπ , ν ( St , At ) ( f ( St , At ) − γ ∑ a′∈A π ( a′ | St+1 ) f ( St+1 , a′ ) ) ] = ( 1− γ ) ES0∼ν [ ∑ a∈A π ( a | S0 ) f ( a , S0 ) ] , ( 3 ) based on which several min-max estimation methods has been proposed such as ( Liu et al. , 2018 ; Nachum et al. , 2019 ; Uehara & Jiang , 2019 ) ; We refer to ( Uehara & Jiang , 2019 , Lemma 1 ) for a formal proof of equation ( 3 ) . Finally , because our proposed model selection algorithm relies on an efficient evaluation of any target policy using batch data , we introduce three types of offline policy evaluation estimators in the existing RL literature . The first type is called direct method via estimating Q-function , based on the relationship that V ( π ) = ( 1 − γ ) ∑ s∈S , a∈A π ( a|s ) Q ( s , a ) ν ( s ) . The second type is motivated by the importance sampling ( Precup , 2000 ) . Based on the definition of ratio function , we can see V ( π ) = E [ 1T ∑T−1 t=0 ω π , ν ( St , At ) Rt ] , from which a plugin estimator can be constructed . The last type of OPE methods combines the first two types of methods and construct a so-called doubly robust estimator ( Kallus & Uehara , 2019 ; Tang et al. , 2020b ) . This estimator is motivated by the efficient influence function of V ( π ) under a transition-sampling setting and the model that consists of the set of all observed data distributions given by arbitrarily varying the initial , transition , reward , and behavior policy distributions , subject to certain minimal regularity and identifiability conditions ( Kallus & Uehara , 2019 ) , i.e. , 1 T T−1∑ t=0 ωπ , ν ( St , At ) ( Rt + γ ∑ a∈A π ( a|St+1 ) Qπ ( St+1 , a ) −Qπ ( St , At ) ) + ( 1− γ ) ES0∼ν [ ∑ a∈A π ( a|S0 ) Qπ ( S0 , a ) ] − V ( π ) . ( 4 ) A nice property of doubly robust estimators is that as long as either the Q-function Qπ ( s , a ) or the ratio function ωπ , ν ( s , a ) can be consistently estimated , the final estimator of V ( π ) is consistent ( Robins et al. , 1994 ; Jiang & Li , 2015 ; Kallus & Uehara , 2019 ; Tang et al. , 2020b ) . Furthermore , a doubly robust estimator based on ( 4 ) can achieve semiparametric efficiency under the conditions proposed by ( Kallus & Uehara , 2019 ) , even if nuisance parameters are estimated via black box models such as deep neural networks . Therefore such an estimator is particularly suitable under the framework of DRL . Our proposed algorithm will rely on this doubly robust type of OPE estimator .
The paper studies the model selection problem in offline reinforcement learning (ORL). The model selection of ORL is challenging due to insufficient observational data from offline collection. The paper proposes a novel model selection approach to automate ORL development process and to identify a well-performed model given offline data. The proposed pessimistic model selection (PMS) method leverages an uncertainty quantification on value functions and a pessimistic idea. Some experiments show the superior performance of the proposed model selection method.
SP:04d8d19a1a8868769e3e9f3566e1beda271be578
Distributional Reinforcement Learning with Monotonic Splines
1 INTRODUCTION . A fundamental problem in traditional value-based RL is to estimate the expectation of future returns ( Mnih et al. , 2015 ; Van Hasselt et al. , 2016 ) . Distributional RL differs from this by also taking into account the intrinsic randomness of returns within MDPs ( Morimura et al. , 2010 ; Bellemare et al. , 2017 ) . To do so , distributional RL algorithms characterize the total return as a random variable and estimate its underlying distribution . In contrast , traditional value-based RL algorithms focus only on the mean of the random variable . Distributional RL offers several advantages over value-based RL that computes only expected returns . The distribution of returns enables risk-sensitive RL by facilitating the optimization of other statistics than just the mean of the returns ( Dabney et al. , 2018a ; Martin et al. , 2020 ) . Even when we stick to maximizing the mean of the returns , the distribution offers a more reliable and robust way of computing the expectation , which has led to a series of records on the Atari benchmark among value-based non-distributed RL techniques ( Bellemare et al. , 2017 ; Dabney et al. , 2018a ; b ; Hessel et al. , 2018 ; Yang et al. , 2019 ; Zhou et al. , 2020 ; Nguyen et al. , 2021 ) . Intuitively , while it is sufficient to represent an expected return by a single mean value , errors due to finite samples and function approximations can be reduced by ” canceling ” each other when multiple sample returns or quantile values are used . This is similar to the benefits of ensemble learning techniques although , strictly speaking , distributional RL is not an ensemble RL technique . In fact , distributional RL has been combined with ensemble learning and truncated critic predictions to mitigate overestimation bias in continuous control ( Kuznetsov et al. , 2020 ) . One key aspect of distributional RL algorithms is the parameterization of return distributions . In Categorical DQN ( C51 ) ( Bellemare et al. , 2017 ) , the return distributions are limited to categorical distributions over a fixed set of discrete values . It is also shown that the distributional Bellman operator is a contraction under the maximal form of the Wasserstein metric , but in practice , C51 optimizes the cross-entropy loss with a Cramér-minimizing projection ( Rowland et al. , 2018 ) . To bridge the gap between theoretical analysis and algorithmic implementation , quantile regression ( QR ) -based distributional RL algorithms ( Dabney et al. , 2018a ; b ; Yang et al. , 2019 ; Zhou et al. , 2020 ) estimate a finite number of quantile values instead of the distribution of returns since quantile regression can easily use the Wasserstein metric as the objective . In fact , the Wasserstein metric is approximately minimized by optimizing the quantile Huber loss ( Huber , 1992 ) between the Bellman updated distribution and the current return distribution . Although with an infinite number of quantiles , the step quantile function in those quantile regression based methods will approximate the full quantile function arbitrarily closely , in practice , it is infeasible to have infinite quantiles in most existing architectures . In addition , the quantile crossing issue , recently pointed out and solved by ( Zhou et al. , 2020 ) , was ignored by previous distributional RL techniques . The issue is that if no global constraint is applied , the quantile values estimated by a neural network at different quantile levels are not guaranteed to satisfy monotonicity , which can distort policy search and affect exploration during training ( Zhou et al. , 2020 ) . In this work , we propose to learn a continuous representation for quantile functions based on monotonic rational-quadratic splines ( Gregory & Delbourgo , 1982 ) . The monotonic property of these splines naturally solves the quantile crossing issue described above . Furthermore , unlike step functions or piecewise linear functions that provide a crude approximation in each bin , monotonic splines provide a more flexible and smooth approximation . With sufficiently many knots , splines can approximate any quantile function arbitrarily closely . We compare empirically our spline-based technique with other quantile-based methods in stochastic environments . We demonstrate that our method offers greater accuracy in terms of quantile approximation , faster convergence during training and higher rewards at test time . 2 DISTRIBUTIONAL REINFORCEMENT LEARNING . In standard RL settings , agent-environment interactions are modeled as a MDP , represented as a tuple ( S , A , R , P , γ ) ( Puterman , 2014 ) . S and A denote state and action spaces . P ( ·|s , a ) defines the transition . R is the state and action dependent reward , and γ ∈ ( 0 , 1 ) is a discount factor . For a policy π , the discounted sum of returns is denoted as a random variable Zπ ( s , a ) =∑∞ t=0 γ tR ( st , at ) , where s0 = s , a0 = a , st+1 ∼ P ( ·|st , at ) , and at ∼ π ( ·|st ) . The Q-value ( state-action value ) is defined as Qπ ( s , a ) = E [ Zπ ( s , a ) ] . The optimal Q-value , Q∗ ( s , a ) = maxπ Q π ( s , a ) , is the unique fixed point of the Bellman optimality operator T ( Bellman , 1966 ) Q∗ ( s , a ) = T Q∗ ( s , a ) : = E [ R ( s , a ) ] + γEP max a′ Q∗ ( s′ , a′ ) ( 1 ) In most deep RL studies , Q is approximated by a neural network . To update Q , Q-learning trains the network iteratively to minimize the squared temporal difference ( TD ) error L2t = [ rt + γmax a′ Qφ− ( s ′ , a′ ) −Qφ ( s , a ) ] 2 , ( 2 ) where φ− is the target network which is updated periodically with the most recent φ . Instead of learning the scalar Q ( s , a ) , distributional RL considers the distribution over returns ( the law of Z ) to capture the aleatoric uncertainty ( intrinsic stochasticity in the environment ) . A similar distributional Bellman operator for Z can be derived as ( Bellemare et al. , 2017 ) T πZ ( s , a ) D= R ( s , a ) + γZ ( S′ , A′ ) , ( 3 ) with S′ ∼ P ( ·|s , a ) , A′ ∼ π ( ·|S′ ) , and X D= Y indicates that random variables X and Y follow the same distribution . In theory , Bellemare et al . ( 2017 ) proved the distributional Bellman operator is a contraction in the p-Wasserstein metric Wp ( X , Y ) = ( ∫ 1 0 |F−1X ( ω ) − F −1 Y ( ω ) | pdω ) 1/p , ( 4 ) where F−1 is the quantile function ( inverse cumulative distribution function ) . Following this theory , a series of distributional RL algorithms have been proposed based on quantile regression to estimate F−1 at precisely chosen quantile fractions , such that the Wasserstein metric is minimized . 2.1 QUANTILE REGRESSION FOR DISTRIBUTIONAL RL . In QR-DQN ( Dabney et al. , 2018b ) , the random return is approximated by a uniform mixture of N Diracs Zθ ( s , a ) = 1 N N∑ i=1 δθi ( s , a ) , ( 5 ) with each θi set to a fixed quantile fraction , τ̂i = τi−1+τi 2 for 1 ≤ i ≤ N , and τi = i/N . The quantile estimation is performed by minimizing the quantile Huber loss , with threshold η 1 N N∑ i=1 N∑ j=1 ρητ̂i ( δij ) ( 6 ) on the pairwise TD error δij = r + γθj ( s′ , a′ ) − θi ( s , a ) , where ρητ ( δ ) = |τ − Iδ < 0|Lη ( δ ) , with Lη ( δ ) = { 1 2δ 2 , |δ| ≤ η η ( |δ| − 12η ) , otherwise . ( 7 ) Based on QR-DQN , Dabney et al . ( 2018a ) proposed to sample quantile fractions from a base distribution , e.g . τ ∈ U ( [ 0 , 1 ] ) rather than fixing them . They built an implicit quantile network ( IQN ) to learn mappings from sampled probability embeddings to corresponding quantile values . FQF ( Yang et al. , 2019 ) further improves IQN by learning a function to propose τ ’ s . However , the quantile values generated by neural networks may not satisfy the non-decreasing property of F−1 ( known as the quantile crossing issue ) . This was recently solved by NC-QR-DQN ( Zhou et al. , 2020 ) , by applying a softmax , followed by a cumulative sum of the output logits of the neural network Ω , and then rescaling by multiplying a non-negative factor α ( s , a ) and adding an offset β ( s , a ) : θi ( s , a ) = α ( s , a ) × ιi , a + β ( s , a ) , with ιi , a = i∑ j=0 χj , a , and χj , a = softmax ( Ω ( s ) ) j , a ( 8 ) One recent method NDQFN ( Zhou et al. , 2021 ) further combines the ideas of NC-QR-DQN and IQN to learn a monotonic function for F−1 by connecting the neighboring two monotonic quantile data points with line segments . Different from NC-QR-DQN , NDQFN generates monotonic quantile values by first learning a baseline value and then adding non-negative increments . 2.2 OTHER DISTRIBUTIONAL METHODS . Other recent methods investigate different metrics for the distributional Bellman operator . Moment matching , generally parameterized as the maximum mean discrepancy ( MMD ) between two sample sets in a reproducing Hilbert kernel space ( Gretton et al. , 2012 ) , is adopted by Nguyen et al . ( 2021 ) to propose moment matching DQN ( MM-DQN ) . The MMD loss with kernel κ is derived as : d2κ ( { υi } , { ψi } ) = 1 N2 ∑ i , j κ ( υi , υj ) + 1 M2 ∑ i , j κ ( ψi , ψj ) − 2 NM ∑ i , j κ ( υi , ψj ) , ( 9 ) where { υi } Ni=1 ∼ Z ( s , a ) and { ψi } Mi=1 ∼ R ( s , a ) + γZ ( S′ , A′ ) . It is worth noting that the theoretical analysis by Nguyen et al . ( 2021 ) shows the distributional Bellman operator under MMD is not a contraction with commonly used Gaussian kernels or expprod kernels . It is a contraction only when the kernel function is shift invariant and scale sensitive . Categorical distributional RL was also combined with policy gradient to obtain the Reactor algorithm ( Gruslys et al. , 2018 ) for discrete control and the Distributed Distributional Deep Deterministic Policy Gradient ( D4PG ) algorithm ( Barth-Maron et al. , 2018 ) for continuous control . Subsequently , Singh et al . ( 2020 ) replaced categorical return distributions by samples in Sample-based Distributional Policy Gradient ( SDPG ) , yielding improved sample efficiency . The return distribution can also be represented by a generative network trained by adversarial training ( in the same way as GANs ) to minimize temporal differences between sampled returns ( Doan et al. , 2018 ; Freirich et al. , 2019 ) . While most distributional RL techniques compute state-action return distributions , Li & Faisal ( 2021 ) proposed the Bayesian Distributional Policy Gradient ( BDPG ) algorithm that computes state return distributions and uses inference to derive a curiosity bonus . In another line of work , Tessler et al . ( 2019 ) introduced the Distributional Policy Optimization ( DPO ) framework in which an agent ’ s policy evolves towards a distribution over improving actions .
This paper proposes a new neural network design to represent quantile functions for distributional reinforcement learning, based on smooth rational-quadratic splines. This representation has the advantage of being continuously differentiable. The loss is computed by evaluating the quantile loss on a set of uniformly spaced quantile levels. The benefits are shown empirically on standard continuous control environments, modified with noise to make them stochastic, by using the proposed distributional representation as critic in DDPG/SAC algorithms.
SP:89192625142719b39c8e06b42521be00e4e8fd3a
Distributional Reinforcement Learning with Monotonic Splines
1 INTRODUCTION . A fundamental problem in traditional value-based RL is to estimate the expectation of future returns ( Mnih et al. , 2015 ; Van Hasselt et al. , 2016 ) . Distributional RL differs from this by also taking into account the intrinsic randomness of returns within MDPs ( Morimura et al. , 2010 ; Bellemare et al. , 2017 ) . To do so , distributional RL algorithms characterize the total return as a random variable and estimate its underlying distribution . In contrast , traditional value-based RL algorithms focus only on the mean of the random variable . Distributional RL offers several advantages over value-based RL that computes only expected returns . The distribution of returns enables risk-sensitive RL by facilitating the optimization of other statistics than just the mean of the returns ( Dabney et al. , 2018a ; Martin et al. , 2020 ) . Even when we stick to maximizing the mean of the returns , the distribution offers a more reliable and robust way of computing the expectation , which has led to a series of records on the Atari benchmark among value-based non-distributed RL techniques ( Bellemare et al. , 2017 ; Dabney et al. , 2018a ; b ; Hessel et al. , 2018 ; Yang et al. , 2019 ; Zhou et al. , 2020 ; Nguyen et al. , 2021 ) . Intuitively , while it is sufficient to represent an expected return by a single mean value , errors due to finite samples and function approximations can be reduced by ” canceling ” each other when multiple sample returns or quantile values are used . This is similar to the benefits of ensemble learning techniques although , strictly speaking , distributional RL is not an ensemble RL technique . In fact , distributional RL has been combined with ensemble learning and truncated critic predictions to mitigate overestimation bias in continuous control ( Kuznetsov et al. , 2020 ) . One key aspect of distributional RL algorithms is the parameterization of return distributions . In Categorical DQN ( C51 ) ( Bellemare et al. , 2017 ) , the return distributions are limited to categorical distributions over a fixed set of discrete values . It is also shown that the distributional Bellman operator is a contraction under the maximal form of the Wasserstein metric , but in practice , C51 optimizes the cross-entropy loss with a Cramér-minimizing projection ( Rowland et al. , 2018 ) . To bridge the gap between theoretical analysis and algorithmic implementation , quantile regression ( QR ) -based distributional RL algorithms ( Dabney et al. , 2018a ; b ; Yang et al. , 2019 ; Zhou et al. , 2020 ) estimate a finite number of quantile values instead of the distribution of returns since quantile regression can easily use the Wasserstein metric as the objective . In fact , the Wasserstein metric is approximately minimized by optimizing the quantile Huber loss ( Huber , 1992 ) between the Bellman updated distribution and the current return distribution . Although with an infinite number of quantiles , the step quantile function in those quantile regression based methods will approximate the full quantile function arbitrarily closely , in practice , it is infeasible to have infinite quantiles in most existing architectures . In addition , the quantile crossing issue , recently pointed out and solved by ( Zhou et al. , 2020 ) , was ignored by previous distributional RL techniques . The issue is that if no global constraint is applied , the quantile values estimated by a neural network at different quantile levels are not guaranteed to satisfy monotonicity , which can distort policy search and affect exploration during training ( Zhou et al. , 2020 ) . In this work , we propose to learn a continuous representation for quantile functions based on monotonic rational-quadratic splines ( Gregory & Delbourgo , 1982 ) . The monotonic property of these splines naturally solves the quantile crossing issue described above . Furthermore , unlike step functions or piecewise linear functions that provide a crude approximation in each bin , monotonic splines provide a more flexible and smooth approximation . With sufficiently many knots , splines can approximate any quantile function arbitrarily closely . We compare empirically our spline-based technique with other quantile-based methods in stochastic environments . We demonstrate that our method offers greater accuracy in terms of quantile approximation , faster convergence during training and higher rewards at test time . 2 DISTRIBUTIONAL REINFORCEMENT LEARNING . In standard RL settings , agent-environment interactions are modeled as a MDP , represented as a tuple ( S , A , R , P , γ ) ( Puterman , 2014 ) . S and A denote state and action spaces . P ( ·|s , a ) defines the transition . R is the state and action dependent reward , and γ ∈ ( 0 , 1 ) is a discount factor . For a policy π , the discounted sum of returns is denoted as a random variable Zπ ( s , a ) =∑∞ t=0 γ tR ( st , at ) , where s0 = s , a0 = a , st+1 ∼ P ( ·|st , at ) , and at ∼ π ( ·|st ) . The Q-value ( state-action value ) is defined as Qπ ( s , a ) = E [ Zπ ( s , a ) ] . The optimal Q-value , Q∗ ( s , a ) = maxπ Q π ( s , a ) , is the unique fixed point of the Bellman optimality operator T ( Bellman , 1966 ) Q∗ ( s , a ) = T Q∗ ( s , a ) : = E [ R ( s , a ) ] + γEP max a′ Q∗ ( s′ , a′ ) ( 1 ) In most deep RL studies , Q is approximated by a neural network . To update Q , Q-learning trains the network iteratively to minimize the squared temporal difference ( TD ) error L2t = [ rt + γmax a′ Qφ− ( s ′ , a′ ) −Qφ ( s , a ) ] 2 , ( 2 ) where φ− is the target network which is updated periodically with the most recent φ . Instead of learning the scalar Q ( s , a ) , distributional RL considers the distribution over returns ( the law of Z ) to capture the aleatoric uncertainty ( intrinsic stochasticity in the environment ) . A similar distributional Bellman operator for Z can be derived as ( Bellemare et al. , 2017 ) T πZ ( s , a ) D= R ( s , a ) + γZ ( S′ , A′ ) , ( 3 ) with S′ ∼ P ( ·|s , a ) , A′ ∼ π ( ·|S′ ) , and X D= Y indicates that random variables X and Y follow the same distribution . In theory , Bellemare et al . ( 2017 ) proved the distributional Bellman operator is a contraction in the p-Wasserstein metric Wp ( X , Y ) = ( ∫ 1 0 |F−1X ( ω ) − F −1 Y ( ω ) | pdω ) 1/p , ( 4 ) where F−1 is the quantile function ( inverse cumulative distribution function ) . Following this theory , a series of distributional RL algorithms have been proposed based on quantile regression to estimate F−1 at precisely chosen quantile fractions , such that the Wasserstein metric is minimized . 2.1 QUANTILE REGRESSION FOR DISTRIBUTIONAL RL . In QR-DQN ( Dabney et al. , 2018b ) , the random return is approximated by a uniform mixture of N Diracs Zθ ( s , a ) = 1 N N∑ i=1 δθi ( s , a ) , ( 5 ) with each θi set to a fixed quantile fraction , τ̂i = τi−1+τi 2 for 1 ≤ i ≤ N , and τi = i/N . The quantile estimation is performed by minimizing the quantile Huber loss , with threshold η 1 N N∑ i=1 N∑ j=1 ρητ̂i ( δij ) ( 6 ) on the pairwise TD error δij = r + γθj ( s′ , a′ ) − θi ( s , a ) , where ρητ ( δ ) = |τ − Iδ < 0|Lη ( δ ) , with Lη ( δ ) = { 1 2δ 2 , |δ| ≤ η η ( |δ| − 12η ) , otherwise . ( 7 ) Based on QR-DQN , Dabney et al . ( 2018a ) proposed to sample quantile fractions from a base distribution , e.g . τ ∈ U ( [ 0 , 1 ] ) rather than fixing them . They built an implicit quantile network ( IQN ) to learn mappings from sampled probability embeddings to corresponding quantile values . FQF ( Yang et al. , 2019 ) further improves IQN by learning a function to propose τ ’ s . However , the quantile values generated by neural networks may not satisfy the non-decreasing property of F−1 ( known as the quantile crossing issue ) . This was recently solved by NC-QR-DQN ( Zhou et al. , 2020 ) , by applying a softmax , followed by a cumulative sum of the output logits of the neural network Ω , and then rescaling by multiplying a non-negative factor α ( s , a ) and adding an offset β ( s , a ) : θi ( s , a ) = α ( s , a ) × ιi , a + β ( s , a ) , with ιi , a = i∑ j=0 χj , a , and χj , a = softmax ( Ω ( s ) ) j , a ( 8 ) One recent method NDQFN ( Zhou et al. , 2021 ) further combines the ideas of NC-QR-DQN and IQN to learn a monotonic function for F−1 by connecting the neighboring two monotonic quantile data points with line segments . Different from NC-QR-DQN , NDQFN generates monotonic quantile values by first learning a baseline value and then adding non-negative increments . 2.2 OTHER DISTRIBUTIONAL METHODS . Other recent methods investigate different metrics for the distributional Bellman operator . Moment matching , generally parameterized as the maximum mean discrepancy ( MMD ) between two sample sets in a reproducing Hilbert kernel space ( Gretton et al. , 2012 ) , is adopted by Nguyen et al . ( 2021 ) to propose moment matching DQN ( MM-DQN ) . The MMD loss with kernel κ is derived as : d2κ ( { υi } , { ψi } ) = 1 N2 ∑ i , j κ ( υi , υj ) + 1 M2 ∑ i , j κ ( ψi , ψj ) − 2 NM ∑ i , j κ ( υi , ψj ) , ( 9 ) where { υi } Ni=1 ∼ Z ( s , a ) and { ψi } Mi=1 ∼ R ( s , a ) + γZ ( S′ , A′ ) . It is worth noting that the theoretical analysis by Nguyen et al . ( 2021 ) shows the distributional Bellman operator under MMD is not a contraction with commonly used Gaussian kernels or expprod kernels . It is a contraction only when the kernel function is shift invariant and scale sensitive . Categorical distributional RL was also combined with policy gradient to obtain the Reactor algorithm ( Gruslys et al. , 2018 ) for discrete control and the Distributed Distributional Deep Deterministic Policy Gradient ( D4PG ) algorithm ( Barth-Maron et al. , 2018 ) for continuous control . Subsequently , Singh et al . ( 2020 ) replaced categorical return distributions by samples in Sample-based Distributional Policy Gradient ( SDPG ) , yielding improved sample efficiency . The return distribution can also be represented by a generative network trained by adversarial training ( in the same way as GANs ) to minimize temporal differences between sampled returns ( Doan et al. , 2018 ; Freirich et al. , 2019 ) . While most distributional RL techniques compute state-action return distributions , Li & Faisal ( 2021 ) proposed the Bayesian Distributional Policy Gradient ( BDPG ) algorithm that computes state return distributions and uses inference to derive a curiosity bonus . In another line of work , Tessler et al . ( 2019 ) introduced the Distributional Policy Optimization ( DPO ) framework in which an agent ’ s policy evolves towards a distribution over improving actions .
This paper proposes SPL-DQN, a quantile-based distributional RL method that uses monotonic rational-quadratic splines to approximate the quantile function of the cumulative return (starting from each state-action pair), and the features of using this technique are: (i) The approximated quantile function is ensured to be monotonic; (ii) The monotonic rational-quadratic splines are continuously differentiable and can provide a more flexible class of smooth approximators for the quantile function (compared to piecewise linear or step functions). Moreover, the feature (i) resolves the quantile crossing problem of several existing distributional RL methods (e.g. QR-DQN), under which the quantiles output from the neural network may not be monotonic. By conducting experiments with a toy example, this paper also empirically discovers a few potential issues with the relevant prior works that enforce monotonicity (e.g., NC-QR-DQN and NDQFN). Experimental results in both tasks with discrete (Cartpole) and continuous action spaces (Roboschool) are provided to demonstrate the performance of SPL-DQN.
SP:89192625142719b39c8e06b42521be00e4e8fd3a
Distributional Reinforcement Learning with Monotonic Splines
1 INTRODUCTION . A fundamental problem in traditional value-based RL is to estimate the expectation of future returns ( Mnih et al. , 2015 ; Van Hasselt et al. , 2016 ) . Distributional RL differs from this by also taking into account the intrinsic randomness of returns within MDPs ( Morimura et al. , 2010 ; Bellemare et al. , 2017 ) . To do so , distributional RL algorithms characterize the total return as a random variable and estimate its underlying distribution . In contrast , traditional value-based RL algorithms focus only on the mean of the random variable . Distributional RL offers several advantages over value-based RL that computes only expected returns . The distribution of returns enables risk-sensitive RL by facilitating the optimization of other statistics than just the mean of the returns ( Dabney et al. , 2018a ; Martin et al. , 2020 ) . Even when we stick to maximizing the mean of the returns , the distribution offers a more reliable and robust way of computing the expectation , which has led to a series of records on the Atari benchmark among value-based non-distributed RL techniques ( Bellemare et al. , 2017 ; Dabney et al. , 2018a ; b ; Hessel et al. , 2018 ; Yang et al. , 2019 ; Zhou et al. , 2020 ; Nguyen et al. , 2021 ) . Intuitively , while it is sufficient to represent an expected return by a single mean value , errors due to finite samples and function approximations can be reduced by ” canceling ” each other when multiple sample returns or quantile values are used . This is similar to the benefits of ensemble learning techniques although , strictly speaking , distributional RL is not an ensemble RL technique . In fact , distributional RL has been combined with ensemble learning and truncated critic predictions to mitigate overestimation bias in continuous control ( Kuznetsov et al. , 2020 ) . One key aspect of distributional RL algorithms is the parameterization of return distributions . In Categorical DQN ( C51 ) ( Bellemare et al. , 2017 ) , the return distributions are limited to categorical distributions over a fixed set of discrete values . It is also shown that the distributional Bellman operator is a contraction under the maximal form of the Wasserstein metric , but in practice , C51 optimizes the cross-entropy loss with a Cramér-minimizing projection ( Rowland et al. , 2018 ) . To bridge the gap between theoretical analysis and algorithmic implementation , quantile regression ( QR ) -based distributional RL algorithms ( Dabney et al. , 2018a ; b ; Yang et al. , 2019 ; Zhou et al. , 2020 ) estimate a finite number of quantile values instead of the distribution of returns since quantile regression can easily use the Wasserstein metric as the objective . In fact , the Wasserstein metric is approximately minimized by optimizing the quantile Huber loss ( Huber , 1992 ) between the Bellman updated distribution and the current return distribution . Although with an infinite number of quantiles , the step quantile function in those quantile regression based methods will approximate the full quantile function arbitrarily closely , in practice , it is infeasible to have infinite quantiles in most existing architectures . In addition , the quantile crossing issue , recently pointed out and solved by ( Zhou et al. , 2020 ) , was ignored by previous distributional RL techniques . The issue is that if no global constraint is applied , the quantile values estimated by a neural network at different quantile levels are not guaranteed to satisfy monotonicity , which can distort policy search and affect exploration during training ( Zhou et al. , 2020 ) . In this work , we propose to learn a continuous representation for quantile functions based on monotonic rational-quadratic splines ( Gregory & Delbourgo , 1982 ) . The monotonic property of these splines naturally solves the quantile crossing issue described above . Furthermore , unlike step functions or piecewise linear functions that provide a crude approximation in each bin , monotonic splines provide a more flexible and smooth approximation . With sufficiently many knots , splines can approximate any quantile function arbitrarily closely . We compare empirically our spline-based technique with other quantile-based methods in stochastic environments . We demonstrate that our method offers greater accuracy in terms of quantile approximation , faster convergence during training and higher rewards at test time . 2 DISTRIBUTIONAL REINFORCEMENT LEARNING . In standard RL settings , agent-environment interactions are modeled as a MDP , represented as a tuple ( S , A , R , P , γ ) ( Puterman , 2014 ) . S and A denote state and action spaces . P ( ·|s , a ) defines the transition . R is the state and action dependent reward , and γ ∈ ( 0 , 1 ) is a discount factor . For a policy π , the discounted sum of returns is denoted as a random variable Zπ ( s , a ) =∑∞ t=0 γ tR ( st , at ) , where s0 = s , a0 = a , st+1 ∼ P ( ·|st , at ) , and at ∼ π ( ·|st ) . The Q-value ( state-action value ) is defined as Qπ ( s , a ) = E [ Zπ ( s , a ) ] . The optimal Q-value , Q∗ ( s , a ) = maxπ Q π ( s , a ) , is the unique fixed point of the Bellman optimality operator T ( Bellman , 1966 ) Q∗ ( s , a ) = T Q∗ ( s , a ) : = E [ R ( s , a ) ] + γEP max a′ Q∗ ( s′ , a′ ) ( 1 ) In most deep RL studies , Q is approximated by a neural network . To update Q , Q-learning trains the network iteratively to minimize the squared temporal difference ( TD ) error L2t = [ rt + γmax a′ Qφ− ( s ′ , a′ ) −Qφ ( s , a ) ] 2 , ( 2 ) where φ− is the target network which is updated periodically with the most recent φ . Instead of learning the scalar Q ( s , a ) , distributional RL considers the distribution over returns ( the law of Z ) to capture the aleatoric uncertainty ( intrinsic stochasticity in the environment ) . A similar distributional Bellman operator for Z can be derived as ( Bellemare et al. , 2017 ) T πZ ( s , a ) D= R ( s , a ) + γZ ( S′ , A′ ) , ( 3 ) with S′ ∼ P ( ·|s , a ) , A′ ∼ π ( ·|S′ ) , and X D= Y indicates that random variables X and Y follow the same distribution . In theory , Bellemare et al . ( 2017 ) proved the distributional Bellman operator is a contraction in the p-Wasserstein metric Wp ( X , Y ) = ( ∫ 1 0 |F−1X ( ω ) − F −1 Y ( ω ) | pdω ) 1/p , ( 4 ) where F−1 is the quantile function ( inverse cumulative distribution function ) . Following this theory , a series of distributional RL algorithms have been proposed based on quantile regression to estimate F−1 at precisely chosen quantile fractions , such that the Wasserstein metric is minimized . 2.1 QUANTILE REGRESSION FOR DISTRIBUTIONAL RL . In QR-DQN ( Dabney et al. , 2018b ) , the random return is approximated by a uniform mixture of N Diracs Zθ ( s , a ) = 1 N N∑ i=1 δθi ( s , a ) , ( 5 ) with each θi set to a fixed quantile fraction , τ̂i = τi−1+τi 2 for 1 ≤ i ≤ N , and τi = i/N . The quantile estimation is performed by minimizing the quantile Huber loss , with threshold η 1 N N∑ i=1 N∑ j=1 ρητ̂i ( δij ) ( 6 ) on the pairwise TD error δij = r + γθj ( s′ , a′ ) − θi ( s , a ) , where ρητ ( δ ) = |τ − Iδ < 0|Lη ( δ ) , with Lη ( δ ) = { 1 2δ 2 , |δ| ≤ η η ( |δ| − 12η ) , otherwise . ( 7 ) Based on QR-DQN , Dabney et al . ( 2018a ) proposed to sample quantile fractions from a base distribution , e.g . τ ∈ U ( [ 0 , 1 ] ) rather than fixing them . They built an implicit quantile network ( IQN ) to learn mappings from sampled probability embeddings to corresponding quantile values . FQF ( Yang et al. , 2019 ) further improves IQN by learning a function to propose τ ’ s . However , the quantile values generated by neural networks may not satisfy the non-decreasing property of F−1 ( known as the quantile crossing issue ) . This was recently solved by NC-QR-DQN ( Zhou et al. , 2020 ) , by applying a softmax , followed by a cumulative sum of the output logits of the neural network Ω , and then rescaling by multiplying a non-negative factor α ( s , a ) and adding an offset β ( s , a ) : θi ( s , a ) = α ( s , a ) × ιi , a + β ( s , a ) , with ιi , a = i∑ j=0 χj , a , and χj , a = softmax ( Ω ( s ) ) j , a ( 8 ) One recent method NDQFN ( Zhou et al. , 2021 ) further combines the ideas of NC-QR-DQN and IQN to learn a monotonic function for F−1 by connecting the neighboring two monotonic quantile data points with line segments . Different from NC-QR-DQN , NDQFN generates monotonic quantile values by first learning a baseline value and then adding non-negative increments . 2.2 OTHER DISTRIBUTIONAL METHODS . Other recent methods investigate different metrics for the distributional Bellman operator . Moment matching , generally parameterized as the maximum mean discrepancy ( MMD ) between two sample sets in a reproducing Hilbert kernel space ( Gretton et al. , 2012 ) , is adopted by Nguyen et al . ( 2021 ) to propose moment matching DQN ( MM-DQN ) . The MMD loss with kernel κ is derived as : d2κ ( { υi } , { ψi } ) = 1 N2 ∑ i , j κ ( υi , υj ) + 1 M2 ∑ i , j κ ( ψi , ψj ) − 2 NM ∑ i , j κ ( υi , ψj ) , ( 9 ) where { υi } Ni=1 ∼ Z ( s , a ) and { ψi } Mi=1 ∼ R ( s , a ) + γZ ( S′ , A′ ) . It is worth noting that the theoretical analysis by Nguyen et al . ( 2021 ) shows the distributional Bellman operator under MMD is not a contraction with commonly used Gaussian kernels or expprod kernels . It is a contraction only when the kernel function is shift invariant and scale sensitive . Categorical distributional RL was also combined with policy gradient to obtain the Reactor algorithm ( Gruslys et al. , 2018 ) for discrete control and the Distributed Distributional Deep Deterministic Policy Gradient ( D4PG ) algorithm ( Barth-Maron et al. , 2018 ) for continuous control . Subsequently , Singh et al . ( 2020 ) replaced categorical return distributions by samples in Sample-based Distributional Policy Gradient ( SDPG ) , yielding improved sample efficiency . The return distribution can also be represented by a generative network trained by adversarial training ( in the same way as GANs ) to minimize temporal differences between sampled returns ( Doan et al. , 2018 ; Freirich et al. , 2019 ) . While most distributional RL techniques compute state-action return distributions , Li & Faisal ( 2021 ) proposed the Bayesian Distributional Policy Gradient ( BDPG ) algorithm that computes state return distributions and uses inference to derive a curiosity bonus . In another line of work , Tessler et al . ( 2019 ) introduced the Distributional Policy Optimization ( DPO ) framework in which an agent ’ s policy evolves towards a distribution over improving actions .
The paper studies the problem of distributional reinforcement learning. It augments the traditional quantile-based algorithms with monotonic rational-quadratic splines. Such augmentation provides a natural solution to the quantile crossing issue, which exists for many other quantile-based algorithms. Extensive experiment results are performed to verify the effectiveness of the proposed method.
SP:89192625142719b39c8e06b42521be00e4e8fd3a
Flow-based Recurrent Belief State Learning for POMDPs
1 INTRODUCTION . Partially Observable Markov Decision Process ( POMDP ) ( Åström , 1965 ) provides a principled and generic framework to model real world sequential decision making processes . Unlike Markov Decision Process ( MDP ) , the observations of a POMDP are generally non-Markovian . Therefore , to make optimal decisions , the agent needs to consider all historical information , which is usually intractable . One effective solution is to obtain the belief state . The belief state is defined as the probability distribution of the unobservable environment state conditioned on the past observations and actions ( Kaelbling et al. , 1998 ) . Such belief state accurately summarizes the history . Traditional methods of calculating belief states ( Smallwood & Sondik , 1973 ; Sondik , 1971 ; Kaelbling et al. , 1998 ) assume finite discrete space with a known model . In many real world problems , however , the underlying model remains unknown , and the state space is large and even continuous . With the recent advances of deep learning technologies , a branch of works have been proposed to learn the belief states of POMDPs with unknown model and continuous state space ( Krishnan et al. , 2015 ; Gregor et al. , 2019 ; Lee et al. , 2020 ; Hafner et al. , 2019b ; a ; 2021 ) . These works solve the belief state learning problem by sequentially maximizing the observation probability at each timestep using the variational inference and achieve the state-of-the-art performance on many visual-motor control tasks ( Hafner et al. , 2019a ; Zhu et al. , 2020 ; Okada et al. , 2020 ; Ma et al. , 2020a ) . However , they still can not capture general belief states due to the intractability of complex distributions in high-dimensional continuous space and instead approximate the belief states with diagonal Gaussians . This approximation imposes strong restrictions and is problematic . As shown in Figure 1 , the blue area denotes the unobservable state space of the POMDP . Given the past information τ , the agent maintains a prior distribution of the state s , denoted as p ( s|τ ) ( the distribution in white ) . Each colored distribution corresponds to the belief state after receiving a different new observation o , denoted as the posterior distribution q ( s|τ , o ) . Consider an example of the true beliefs as shown in Figure 1 ( b ) , with their Gaussian approximations shown in Figure 1 ( a ) . The approximation error of Gaussian distributions will easily result in problems of intersecting belief which leads to a mixed-up state ( e.g. , the white triangle ) , and empty belief , which leads to a meaningless state ( e.g. , the grey triangle ) . This also explains the poor reconstruction problems in interactive environments observed by Okada & Taniguchi ( 2021 ) . Furthermore , as mentioned in Hafner et al . ( 2021 ) , the Gaussian approximation of belief states also makes it difficult to predict multi-modal future behaviours . Therefore , it is preferable to relax the Gaussian assumptions and use a more flexible family of distributions to learn accurate belief states as shown in Figure 1 ( b ) . In this paper , we propose a new method called FlOw-based Recurrent BElief State model ( FORBES ) that is able to learn general continuous belief states for POMDPs . FORBES incorporates Normalizing Flows ( Tabak & Turner , 2013 ; Rezende & Mohamed , 2015 ; Dinh et al. , 2017 ) into the variational inference step to construct flexible belief states . In experiments , we show that FORBES allows the agent to maintain flexible belief states , which result in multi-modal and precise predictions as well as higher quality reconstructions . We also demonstrate the results combining FORBES with downstream RL algorithms on challenging visual-motor control tasks ( DeepMind Control Suite , Tassa et al . ( 2018 ) ) . The results show the efficacy of FORBES in terms of improving both performance and sample efficiency . Our contributions can be summarized as follows : • We propose FORBES , the first flow-based belief state learning algorithm that is capable of learning general continuous belief states for POMDPs . • We propose a POMDP RL framework based on FORBES for visual-motor control tasks , which uses the learned belief states from FORBES as the inputs to the downstream RL algorithms . • Empirically , we show that FORBES allows the agent to learn flexible belief states that enable multi-modal predictions as well as high quality reconstructions and help improve both performance and sample efficiency for challenging visual-motor control tasks . 2 PRELIMINARIES . 2.1 PARTIALLY OBSERVABLE MARKOV DECISION PROCESS . Formally , a Partially Observable Markov Decision Process ( POMDP ) is a 7-tuple ( S , A , T , R , Ω , O , γ ) , where S is a set of states , A is a set of actions , T is a set of conditional transition probabilities between states , R is the reward function , Ω is a set of observations , O is a set of conditional observation probabilities , and γ is the discount factor . At each timestep t − 1 , the state of the environment is st−1 ∈ S. The agent takes an action at−1 ∈ A , which causes the environment to transit to state st with probability T ( st | st−1 , at−1 ) . The agent then receives an observation ot ∈ Ω which depends on the new state of the environment st with probability O ( ot | st ) . Finally , the agent receives a reward rt−1 equal to R ( st−1 ) . The agent ’ s goal is to maximize the the expected sum of discounted rewards E [ ∑∞ t=0 γ trt ] . Such a POMDP model can also be described as a probabilistic graphical model ( PGM ) as shown in Figure 2 . After having taken action at−1 and observing ot , an agent needs to update its belief state , which is defined as the probability distribution of the environment state conditioned on all historical information : b ( st ) = p ( st | τt , ot ) ( 1 ) where τt = { o1 , a1 , . . . , ot−1 , at−1 } . 2.2 NORMALIZING FLOW . Instead of using the Gaussian family to approximate the prior and posterior belief distributions , we believe it is more desirable to use a family of distributions that is highly flexible and preferably flexible enough to describe all possible true belief states . Therefore , we use Normalizing Flows ( Tabak & Turner , 2013 ; Rezende & Mohamed , 2015 ) to parameterize those distributions . Rather than directly parameterizing statistics of the distribution itself , Normalizing Flows model the transformations , or the “ flow ” progress , needed to derive such a distribution . More specifically , it describes a sequence of invertible mappings that gradually transform a relatively simple probability density to a more flexible and complex one . Let fθ : RD → RD to be an invertible and differentiable mapping in state space parameterized by θ . Given a random variable x ∈ RD with probability distribution p ( x ) , we can derive the probability of the transformed random variable z = fθ ( x ) by applying the change of variable formula : p ( z ) = p ( x ) ∣∣∣∣det ∂f−1θ∂z ∣∣∣∣ ( 2 ) log p ( z ) = log p ( x ) − log ∣∣∣∣det ∂fθ∂z ∣∣∣∣ ( 3 ) To construct a highly flexible family of distributions , we can propagate the random variable at beginning z0 through a sequence of K mappings and get zK = fθK ◦ fθK−1 ◦ · · · ◦ fθ1 ( z0 ) with the probability log pK ( zK ) = log p ( z0 ) − K∑ k=1 log ∣∣∣∣det ∂fθk∂zk−1 ∣∣∣∣ ( 4 ) Given a relatively simple distribution of z0 , say , Gaussian distribution , by iteratively applying the transformations , the flow is capable of representing a highly complex distribution with the probability that remains tractable . The parameters θ1 , . . . , θK determine the transformations of the flow . An effective transformation that is widely accepted is affine coupling layer ( Dinh et al. , 2017 ; Kingma & Dhariwal , 2018 ; Kingma et al. , 2017 ) . Given the input x ∈ RD , let s and t stand for scale and translation functions which are usually parameterized by neural networks , where s , t : Rk → RD−k , k < D. The output , y , can be viewed as a concatenation of its first k dimensions y1 : k and the remaining part yk+1 : D : y1 : k = x1 : k , yk+1 : D = xk+1 : D exp ( s ( x1 : k ) ) + t ( x1 : k ) ( 5 ) where denotes the element-wise product ( see details about affine coupling layer in Appendix A.1 ) . 3 FLOW-BASED RECURRENT BELIEF STATE LEARNING . 3.1 FLOW-BASED RECURRENT BELIEF STATE MODEL . We propose the FlOw-based Recurrent BElief State model ( FORBES ) which learns general continuous belief states via normalizing flows under the variational inference framework . Specifically , the FORBES model consists of components needed to construct the PGM of POMDP as shown in Figure 2 : State transition model : p ( st|st−1 , at−1 ) . Observation model : p ( ot|st ) Reward model : p ( rt|st ) ( 6 ) In addition , we have a belief inference model q ( st|τt , ot ) to approximate the true posterior distribution p ( st|τt , ot ) , where τt = { o1 , a1 , . . . , ot−1 , at−1 } is the past information . The above components of FORBES can be optimized jointly by maximizing the Evidence Lower BOund ( ELBO ) ( Jordan et al. , 1999 ) or more generally the variational information bottleneck ( Tishby et al. , 2000 ; Alemi et al. , 2016 ) : log p ( o1 : T , r1 : T |a1 : T ) ≥ Eq ( s1 : T |o1 : T , a1 : T−1 ) [ T∑ t=1 ( ln p ( ot|st ) + ln p ( rt|st ) −DKL ( q ( st|st−1 , at−1 , ot ) ‖p ( st|st−1 , at−1 ) ) ) ] = T∑ t=1 [ Eq ( st|st−1 , at−1 , ot ) ( ln p ( ot|st ) + ln p ( rt|st ) ) − Eq ( st−1|st−2 , at−2 , ot−1 ) ( DKL ( q ( st|st−1 , at−1 , ot ) ‖p ( st|st−1 , at−1 ) ) ) ] . = JModel ( 7 ) here we use the factorization of q ( s1 : T |o1 : T , a1 : T−1 ) = ∏ t q ( st|st−1 , at−1 , ot ) . Detailed derivations can be found in Appendix.A.9 . In practice , the state transition model , observation model , reward model , and belief inference model can be represented by stochastic deep neural networks parameterized by ψ : pψ ( st|st−1 , at−1 ) , pψ ( ot|st ) , pψ ( rt|st ) , qψ ( st|τt , ot ) ( 8 ) where their outputs usually follow simple distributions such as diagonal Gaussians . The parameterized belief inference model qψ ( st|τt , ot ) acts as an encoder that encodes the historical information using a combination of convolutional neural networks and recurrent neural networks . Note that q below is obtained through the factorization of q ( s1 : T |o1 : T , a1 : T−1 ) = ∏ t q ( st|st−1 , at−1 , ot ) . In FORBES we provide special treatments for the belief inference model and the state transition model to represent more complex and flexible posterior and prior distributions . As shown in Figure 3 ( a ) , the input images o1 : t and actions a1 : t−1 are encoded with qψ ( st|τt , ot ) ( the blue and the red path ) . Then our final inferred belief is obtained by propagating qψ ( st|τt , ot ) through a set of normalizing flow mappings denoted fθK ◦ · · · ◦ fθ1 to get a representative posterior distribution qψ , θ ( st|τt , ot ) . For convenience , we denote q0 = qψ and qK = qψ , θ . On the other hand , o1 : t−1 and a1 : t−2 are encoded with qψ ( st−1|τt−1 , ot−1 ) ( the blue path ) , then the state transition model is used to obtain the prior guess of the state pψ ( st | τt ) = Eqψ ( st−1|τt−1 , ot−1 ) [ pψ ( st | st−1 , at−1 ) ] ( the green path ) . Then our final prior is obtained by propagating pψ ( st|τt ) through another set of normalizing flow mappings denoted fωK ◦· · ·◦fω1 to get a representative prior distribution pψ , ω ( st|τt ) . For convenience , we denote p0 = pψ and pK = pψ , ω . Then as shown in Figure 3 ( b ) , we can sample the initial state st ( the yellow and purple triangles ) from the belief states qK ( st | τt , ot ) . For each sampled initial state , we can use the state transition model to predict the future states ŝt+h given the future actions at : t+h−1 , and then use the observation model to reconstruct the observations ôt+h , where h is the prediction horizon . With the above settings , we can substitute the density probability inside the KL-divergence term in Equation 7 with Normalizing Flow : DKL ( qK ( st|τt , ot ) ‖pK ( st|st−1 , at−1 ) ) = EqK ( s1 : t|τt , ot ) [ log qK ( st|τt , ot ) − log pK ( st|τt ) ] = EqK ( s1 : t|τt , ot ) [ log q0 ( st|τt , ot ) − K∑ k=1 log ∣∣∣∣det ∂fθk∂st , k−1 ∣∣∣∣− log p0 ( st|τt ) + log ∣∣∣∣det ∂fωk∂st , k−1 ∣∣∣∣ ] ( 9 ) where pK ( st | st−1 , at−1 ) = pK ( st | τt ) given the sampled st−1 from qK ( s1 : t|τt , ot ) . st , k is the state variable st transformed by k layers of normalizing flows , and st,0 = st. To further demonstrate the properties of FORBES , we provide the following theorems . Theorem 1 The approximation error of the log-likelihood when maximizing the JModel ( the derived ELBO ) defined in Equation 7 is : log p ( o1 : T , r1 : T |a1 : T ) − JModel = EqK ( s1 : T |τT , oT ) [ T∑ t=1 DKL ( q ( st|τt , ot ) ‖p ( st | τt , ot ) ) ] ( 10 ) where p ( st | τt , ot ) denotes the true belief states . Detailed proofs can be found in Appendix.A.9 . Theorem 1 suggests that , when the learning algorithm maximizes the JModel ( the derived ELBO ) , then the DKL terms in the right-hand side are minimized , which indicate the KL-divergence between the learned belief states q ( st|τt , ot ) and the true belief states p ( st | τt , ot ) . Clearly , if p ( st | τt , ot ) is a complex distribution and q ( st|τt , ot ) is chosen from a restricted distribution class such as diagonal Gaussian , then when the algorithm maximizes the JModel ( the derived ELBO ) , there will still be a potentially large KL-divergence between the learned and the true belief states . Therefore , naturally there raises the problem that is normalizing flow a universal distributional approximator that is capable of accurately representing arbitrarily complex belief states , so the KL-divergence terms in the right-hand side of Equation ( 10 ) can be minimized to approach zero ? The answer is yes for a wide range of normalizing flows . To be specific , Teshima et al . ( 2020 ) provides theoretical results for the family of the flow used in FORBES . In fact , there always exists a diffeomorphism that can turn one well-behaved distribution to another . Besides the aforementioned affine coupling flow , many works show the distributional universality of other flows ( Kong & Chaudhuri , 2020 ; Huang et al. , 2018 ) . Ideally , the universal approximation property of the flow model qK ( st | τt , ot ) allows us to approximate the true posterior p ( st | τt , ot ) with arbitrary accuracy . Thus , compared to previous methods , FORBES helps close the gap between the log-likelihood and the ELBO to obtain a more accurate belief state . Though we usually can not achieve the ideal zero KL-divergence in practice , our method can get a smaller approximation error , equally a higher ELBO than previous works . We verify this statement in section 4.1 .
This paper proposes learning belief states for POMDPs using flexible posteriors and prior distributions for the state-space model. The authors state that related work often restrict the distributions to conditional diagonal Gaussians which causes the model to underfit the data. They propose a flow-based model to solve the well known issues of using inflexible distributions (i.e. inability of the aggregate posterior to match the prior) which can cause the model to generate implausible samples. In the context of POMDPs, the authors propose using the learned model of environment dynamics to train an actor and critic by sampling trajectories, resulting in a highly sample efficient RL algorithm. Results show the benefits of using the normalizing flow compared to baselines that only use a Gaussian distribution.
SP:584f7ddab9fdabda0843cecb46bd461811c66e3e
Flow-based Recurrent Belief State Learning for POMDPs
1 INTRODUCTION . Partially Observable Markov Decision Process ( POMDP ) ( Åström , 1965 ) provides a principled and generic framework to model real world sequential decision making processes . Unlike Markov Decision Process ( MDP ) , the observations of a POMDP are generally non-Markovian . Therefore , to make optimal decisions , the agent needs to consider all historical information , which is usually intractable . One effective solution is to obtain the belief state . The belief state is defined as the probability distribution of the unobservable environment state conditioned on the past observations and actions ( Kaelbling et al. , 1998 ) . Such belief state accurately summarizes the history . Traditional methods of calculating belief states ( Smallwood & Sondik , 1973 ; Sondik , 1971 ; Kaelbling et al. , 1998 ) assume finite discrete space with a known model . In many real world problems , however , the underlying model remains unknown , and the state space is large and even continuous . With the recent advances of deep learning technologies , a branch of works have been proposed to learn the belief states of POMDPs with unknown model and continuous state space ( Krishnan et al. , 2015 ; Gregor et al. , 2019 ; Lee et al. , 2020 ; Hafner et al. , 2019b ; a ; 2021 ) . These works solve the belief state learning problem by sequentially maximizing the observation probability at each timestep using the variational inference and achieve the state-of-the-art performance on many visual-motor control tasks ( Hafner et al. , 2019a ; Zhu et al. , 2020 ; Okada et al. , 2020 ; Ma et al. , 2020a ) . However , they still can not capture general belief states due to the intractability of complex distributions in high-dimensional continuous space and instead approximate the belief states with diagonal Gaussians . This approximation imposes strong restrictions and is problematic . As shown in Figure 1 , the blue area denotes the unobservable state space of the POMDP . Given the past information τ , the agent maintains a prior distribution of the state s , denoted as p ( s|τ ) ( the distribution in white ) . Each colored distribution corresponds to the belief state after receiving a different new observation o , denoted as the posterior distribution q ( s|τ , o ) . Consider an example of the true beliefs as shown in Figure 1 ( b ) , with their Gaussian approximations shown in Figure 1 ( a ) . The approximation error of Gaussian distributions will easily result in problems of intersecting belief which leads to a mixed-up state ( e.g. , the white triangle ) , and empty belief , which leads to a meaningless state ( e.g. , the grey triangle ) . This also explains the poor reconstruction problems in interactive environments observed by Okada & Taniguchi ( 2021 ) . Furthermore , as mentioned in Hafner et al . ( 2021 ) , the Gaussian approximation of belief states also makes it difficult to predict multi-modal future behaviours . Therefore , it is preferable to relax the Gaussian assumptions and use a more flexible family of distributions to learn accurate belief states as shown in Figure 1 ( b ) . In this paper , we propose a new method called FlOw-based Recurrent BElief State model ( FORBES ) that is able to learn general continuous belief states for POMDPs . FORBES incorporates Normalizing Flows ( Tabak & Turner , 2013 ; Rezende & Mohamed , 2015 ; Dinh et al. , 2017 ) into the variational inference step to construct flexible belief states . In experiments , we show that FORBES allows the agent to maintain flexible belief states , which result in multi-modal and precise predictions as well as higher quality reconstructions . We also demonstrate the results combining FORBES with downstream RL algorithms on challenging visual-motor control tasks ( DeepMind Control Suite , Tassa et al . ( 2018 ) ) . The results show the efficacy of FORBES in terms of improving both performance and sample efficiency . Our contributions can be summarized as follows : • We propose FORBES , the first flow-based belief state learning algorithm that is capable of learning general continuous belief states for POMDPs . • We propose a POMDP RL framework based on FORBES for visual-motor control tasks , which uses the learned belief states from FORBES as the inputs to the downstream RL algorithms . • Empirically , we show that FORBES allows the agent to learn flexible belief states that enable multi-modal predictions as well as high quality reconstructions and help improve both performance and sample efficiency for challenging visual-motor control tasks . 2 PRELIMINARIES . 2.1 PARTIALLY OBSERVABLE MARKOV DECISION PROCESS . Formally , a Partially Observable Markov Decision Process ( POMDP ) is a 7-tuple ( S , A , T , R , Ω , O , γ ) , where S is a set of states , A is a set of actions , T is a set of conditional transition probabilities between states , R is the reward function , Ω is a set of observations , O is a set of conditional observation probabilities , and γ is the discount factor . At each timestep t − 1 , the state of the environment is st−1 ∈ S. The agent takes an action at−1 ∈ A , which causes the environment to transit to state st with probability T ( st | st−1 , at−1 ) . The agent then receives an observation ot ∈ Ω which depends on the new state of the environment st with probability O ( ot | st ) . Finally , the agent receives a reward rt−1 equal to R ( st−1 ) . The agent ’ s goal is to maximize the the expected sum of discounted rewards E [ ∑∞ t=0 γ trt ] . Such a POMDP model can also be described as a probabilistic graphical model ( PGM ) as shown in Figure 2 . After having taken action at−1 and observing ot , an agent needs to update its belief state , which is defined as the probability distribution of the environment state conditioned on all historical information : b ( st ) = p ( st | τt , ot ) ( 1 ) where τt = { o1 , a1 , . . . , ot−1 , at−1 } . 2.2 NORMALIZING FLOW . Instead of using the Gaussian family to approximate the prior and posterior belief distributions , we believe it is more desirable to use a family of distributions that is highly flexible and preferably flexible enough to describe all possible true belief states . Therefore , we use Normalizing Flows ( Tabak & Turner , 2013 ; Rezende & Mohamed , 2015 ) to parameterize those distributions . Rather than directly parameterizing statistics of the distribution itself , Normalizing Flows model the transformations , or the “ flow ” progress , needed to derive such a distribution . More specifically , it describes a sequence of invertible mappings that gradually transform a relatively simple probability density to a more flexible and complex one . Let fθ : RD → RD to be an invertible and differentiable mapping in state space parameterized by θ . Given a random variable x ∈ RD with probability distribution p ( x ) , we can derive the probability of the transformed random variable z = fθ ( x ) by applying the change of variable formula : p ( z ) = p ( x ) ∣∣∣∣det ∂f−1θ∂z ∣∣∣∣ ( 2 ) log p ( z ) = log p ( x ) − log ∣∣∣∣det ∂fθ∂z ∣∣∣∣ ( 3 ) To construct a highly flexible family of distributions , we can propagate the random variable at beginning z0 through a sequence of K mappings and get zK = fθK ◦ fθK−1 ◦ · · · ◦ fθ1 ( z0 ) with the probability log pK ( zK ) = log p ( z0 ) − K∑ k=1 log ∣∣∣∣det ∂fθk∂zk−1 ∣∣∣∣ ( 4 ) Given a relatively simple distribution of z0 , say , Gaussian distribution , by iteratively applying the transformations , the flow is capable of representing a highly complex distribution with the probability that remains tractable . The parameters θ1 , . . . , θK determine the transformations of the flow . An effective transformation that is widely accepted is affine coupling layer ( Dinh et al. , 2017 ; Kingma & Dhariwal , 2018 ; Kingma et al. , 2017 ) . Given the input x ∈ RD , let s and t stand for scale and translation functions which are usually parameterized by neural networks , where s , t : Rk → RD−k , k < D. The output , y , can be viewed as a concatenation of its first k dimensions y1 : k and the remaining part yk+1 : D : y1 : k = x1 : k , yk+1 : D = xk+1 : D exp ( s ( x1 : k ) ) + t ( x1 : k ) ( 5 ) where denotes the element-wise product ( see details about affine coupling layer in Appendix A.1 ) . 3 FLOW-BASED RECURRENT BELIEF STATE LEARNING . 3.1 FLOW-BASED RECURRENT BELIEF STATE MODEL . We propose the FlOw-based Recurrent BElief State model ( FORBES ) which learns general continuous belief states via normalizing flows under the variational inference framework . Specifically , the FORBES model consists of components needed to construct the PGM of POMDP as shown in Figure 2 : State transition model : p ( st|st−1 , at−1 ) . Observation model : p ( ot|st ) Reward model : p ( rt|st ) ( 6 ) In addition , we have a belief inference model q ( st|τt , ot ) to approximate the true posterior distribution p ( st|τt , ot ) , where τt = { o1 , a1 , . . . , ot−1 , at−1 } is the past information . The above components of FORBES can be optimized jointly by maximizing the Evidence Lower BOund ( ELBO ) ( Jordan et al. , 1999 ) or more generally the variational information bottleneck ( Tishby et al. , 2000 ; Alemi et al. , 2016 ) : log p ( o1 : T , r1 : T |a1 : T ) ≥ Eq ( s1 : T |o1 : T , a1 : T−1 ) [ T∑ t=1 ( ln p ( ot|st ) + ln p ( rt|st ) −DKL ( q ( st|st−1 , at−1 , ot ) ‖p ( st|st−1 , at−1 ) ) ) ] = T∑ t=1 [ Eq ( st|st−1 , at−1 , ot ) ( ln p ( ot|st ) + ln p ( rt|st ) ) − Eq ( st−1|st−2 , at−2 , ot−1 ) ( DKL ( q ( st|st−1 , at−1 , ot ) ‖p ( st|st−1 , at−1 ) ) ) ] . = JModel ( 7 ) here we use the factorization of q ( s1 : T |o1 : T , a1 : T−1 ) = ∏ t q ( st|st−1 , at−1 , ot ) . Detailed derivations can be found in Appendix.A.9 . In practice , the state transition model , observation model , reward model , and belief inference model can be represented by stochastic deep neural networks parameterized by ψ : pψ ( st|st−1 , at−1 ) , pψ ( ot|st ) , pψ ( rt|st ) , qψ ( st|τt , ot ) ( 8 ) where their outputs usually follow simple distributions such as diagonal Gaussians . The parameterized belief inference model qψ ( st|τt , ot ) acts as an encoder that encodes the historical information using a combination of convolutional neural networks and recurrent neural networks . Note that q below is obtained through the factorization of q ( s1 : T |o1 : T , a1 : T−1 ) = ∏ t q ( st|st−1 , at−1 , ot ) . In FORBES we provide special treatments for the belief inference model and the state transition model to represent more complex and flexible posterior and prior distributions . As shown in Figure 3 ( a ) , the input images o1 : t and actions a1 : t−1 are encoded with qψ ( st|τt , ot ) ( the blue and the red path ) . Then our final inferred belief is obtained by propagating qψ ( st|τt , ot ) through a set of normalizing flow mappings denoted fθK ◦ · · · ◦ fθ1 to get a representative posterior distribution qψ , θ ( st|τt , ot ) . For convenience , we denote q0 = qψ and qK = qψ , θ . On the other hand , o1 : t−1 and a1 : t−2 are encoded with qψ ( st−1|τt−1 , ot−1 ) ( the blue path ) , then the state transition model is used to obtain the prior guess of the state pψ ( st | τt ) = Eqψ ( st−1|τt−1 , ot−1 ) [ pψ ( st | st−1 , at−1 ) ] ( the green path ) . Then our final prior is obtained by propagating pψ ( st|τt ) through another set of normalizing flow mappings denoted fωK ◦· · ·◦fω1 to get a representative prior distribution pψ , ω ( st|τt ) . For convenience , we denote p0 = pψ and pK = pψ , ω . Then as shown in Figure 3 ( b ) , we can sample the initial state st ( the yellow and purple triangles ) from the belief states qK ( st | τt , ot ) . For each sampled initial state , we can use the state transition model to predict the future states ŝt+h given the future actions at : t+h−1 , and then use the observation model to reconstruct the observations ôt+h , where h is the prediction horizon . With the above settings , we can substitute the density probability inside the KL-divergence term in Equation 7 with Normalizing Flow : DKL ( qK ( st|τt , ot ) ‖pK ( st|st−1 , at−1 ) ) = EqK ( s1 : t|τt , ot ) [ log qK ( st|τt , ot ) − log pK ( st|τt ) ] = EqK ( s1 : t|τt , ot ) [ log q0 ( st|τt , ot ) − K∑ k=1 log ∣∣∣∣det ∂fθk∂st , k−1 ∣∣∣∣− log p0 ( st|τt ) + log ∣∣∣∣det ∂fωk∂st , k−1 ∣∣∣∣ ] ( 9 ) where pK ( st | st−1 , at−1 ) = pK ( st | τt ) given the sampled st−1 from qK ( s1 : t|τt , ot ) . st , k is the state variable st transformed by k layers of normalizing flows , and st,0 = st. To further demonstrate the properties of FORBES , we provide the following theorems . Theorem 1 The approximation error of the log-likelihood when maximizing the JModel ( the derived ELBO ) defined in Equation 7 is : log p ( o1 : T , r1 : T |a1 : T ) − JModel = EqK ( s1 : T |τT , oT ) [ T∑ t=1 DKL ( q ( st|τt , ot ) ‖p ( st | τt , ot ) ) ] ( 10 ) where p ( st | τt , ot ) denotes the true belief states . Detailed proofs can be found in Appendix.A.9 . Theorem 1 suggests that , when the learning algorithm maximizes the JModel ( the derived ELBO ) , then the DKL terms in the right-hand side are minimized , which indicate the KL-divergence between the learned belief states q ( st|τt , ot ) and the true belief states p ( st | τt , ot ) . Clearly , if p ( st | τt , ot ) is a complex distribution and q ( st|τt , ot ) is chosen from a restricted distribution class such as diagonal Gaussian , then when the algorithm maximizes the JModel ( the derived ELBO ) , there will still be a potentially large KL-divergence between the learned and the true belief states . Therefore , naturally there raises the problem that is normalizing flow a universal distributional approximator that is capable of accurately representing arbitrarily complex belief states , so the KL-divergence terms in the right-hand side of Equation ( 10 ) can be minimized to approach zero ? The answer is yes for a wide range of normalizing flows . To be specific , Teshima et al . ( 2020 ) provides theoretical results for the family of the flow used in FORBES . In fact , there always exists a diffeomorphism that can turn one well-behaved distribution to another . Besides the aforementioned affine coupling flow , many works show the distributional universality of other flows ( Kong & Chaudhuri , 2020 ; Huang et al. , 2018 ) . Ideally , the universal approximation property of the flow model qK ( st | τt , ot ) allows us to approximate the true posterior p ( st | τt , ot ) with arbitrary accuracy . Thus , compared to previous methods , FORBES helps close the gap between the log-likelihood and the ELBO to obtain a more accurate belief state . Though we usually can not achieve the ideal zero KL-divergence in practice , our method can get a smaller approximation error , equally a higher ELBO than previous works . We verify this statement in section 4.1 .
Belief states are a common solution to learning in POMDPs, and in recent years people have applied deep recurrent generative models to approximating belief states in complex POMDPs. In this paper, the authors go beyond the isotropic Gaussian assumption used in most deep learning works and use normalising flows to represent more flexible and multimodal distributions. The authors demonstrate that their approach is better at modelling multimodal belief states and matches/outperforms Dreamer, which is a natural baseline for their method.
SP:584f7ddab9fdabda0843cecb46bd461811c66e3e
Flow-based Recurrent Belief State Learning for POMDPs
1 INTRODUCTION . Partially Observable Markov Decision Process ( POMDP ) ( Åström , 1965 ) provides a principled and generic framework to model real world sequential decision making processes . Unlike Markov Decision Process ( MDP ) , the observations of a POMDP are generally non-Markovian . Therefore , to make optimal decisions , the agent needs to consider all historical information , which is usually intractable . One effective solution is to obtain the belief state . The belief state is defined as the probability distribution of the unobservable environment state conditioned on the past observations and actions ( Kaelbling et al. , 1998 ) . Such belief state accurately summarizes the history . Traditional methods of calculating belief states ( Smallwood & Sondik , 1973 ; Sondik , 1971 ; Kaelbling et al. , 1998 ) assume finite discrete space with a known model . In many real world problems , however , the underlying model remains unknown , and the state space is large and even continuous . With the recent advances of deep learning technologies , a branch of works have been proposed to learn the belief states of POMDPs with unknown model and continuous state space ( Krishnan et al. , 2015 ; Gregor et al. , 2019 ; Lee et al. , 2020 ; Hafner et al. , 2019b ; a ; 2021 ) . These works solve the belief state learning problem by sequentially maximizing the observation probability at each timestep using the variational inference and achieve the state-of-the-art performance on many visual-motor control tasks ( Hafner et al. , 2019a ; Zhu et al. , 2020 ; Okada et al. , 2020 ; Ma et al. , 2020a ) . However , they still can not capture general belief states due to the intractability of complex distributions in high-dimensional continuous space and instead approximate the belief states with diagonal Gaussians . This approximation imposes strong restrictions and is problematic . As shown in Figure 1 , the blue area denotes the unobservable state space of the POMDP . Given the past information τ , the agent maintains a prior distribution of the state s , denoted as p ( s|τ ) ( the distribution in white ) . Each colored distribution corresponds to the belief state after receiving a different new observation o , denoted as the posterior distribution q ( s|τ , o ) . Consider an example of the true beliefs as shown in Figure 1 ( b ) , with their Gaussian approximations shown in Figure 1 ( a ) . The approximation error of Gaussian distributions will easily result in problems of intersecting belief which leads to a mixed-up state ( e.g. , the white triangle ) , and empty belief , which leads to a meaningless state ( e.g. , the grey triangle ) . This also explains the poor reconstruction problems in interactive environments observed by Okada & Taniguchi ( 2021 ) . Furthermore , as mentioned in Hafner et al . ( 2021 ) , the Gaussian approximation of belief states also makes it difficult to predict multi-modal future behaviours . Therefore , it is preferable to relax the Gaussian assumptions and use a more flexible family of distributions to learn accurate belief states as shown in Figure 1 ( b ) . In this paper , we propose a new method called FlOw-based Recurrent BElief State model ( FORBES ) that is able to learn general continuous belief states for POMDPs . FORBES incorporates Normalizing Flows ( Tabak & Turner , 2013 ; Rezende & Mohamed , 2015 ; Dinh et al. , 2017 ) into the variational inference step to construct flexible belief states . In experiments , we show that FORBES allows the agent to maintain flexible belief states , which result in multi-modal and precise predictions as well as higher quality reconstructions . We also demonstrate the results combining FORBES with downstream RL algorithms on challenging visual-motor control tasks ( DeepMind Control Suite , Tassa et al . ( 2018 ) ) . The results show the efficacy of FORBES in terms of improving both performance and sample efficiency . Our contributions can be summarized as follows : • We propose FORBES , the first flow-based belief state learning algorithm that is capable of learning general continuous belief states for POMDPs . • We propose a POMDP RL framework based on FORBES for visual-motor control tasks , which uses the learned belief states from FORBES as the inputs to the downstream RL algorithms . • Empirically , we show that FORBES allows the agent to learn flexible belief states that enable multi-modal predictions as well as high quality reconstructions and help improve both performance and sample efficiency for challenging visual-motor control tasks . 2 PRELIMINARIES . 2.1 PARTIALLY OBSERVABLE MARKOV DECISION PROCESS . Formally , a Partially Observable Markov Decision Process ( POMDP ) is a 7-tuple ( S , A , T , R , Ω , O , γ ) , where S is a set of states , A is a set of actions , T is a set of conditional transition probabilities between states , R is the reward function , Ω is a set of observations , O is a set of conditional observation probabilities , and γ is the discount factor . At each timestep t − 1 , the state of the environment is st−1 ∈ S. The agent takes an action at−1 ∈ A , which causes the environment to transit to state st with probability T ( st | st−1 , at−1 ) . The agent then receives an observation ot ∈ Ω which depends on the new state of the environment st with probability O ( ot | st ) . Finally , the agent receives a reward rt−1 equal to R ( st−1 ) . The agent ’ s goal is to maximize the the expected sum of discounted rewards E [ ∑∞ t=0 γ trt ] . Such a POMDP model can also be described as a probabilistic graphical model ( PGM ) as shown in Figure 2 . After having taken action at−1 and observing ot , an agent needs to update its belief state , which is defined as the probability distribution of the environment state conditioned on all historical information : b ( st ) = p ( st | τt , ot ) ( 1 ) where τt = { o1 , a1 , . . . , ot−1 , at−1 } . 2.2 NORMALIZING FLOW . Instead of using the Gaussian family to approximate the prior and posterior belief distributions , we believe it is more desirable to use a family of distributions that is highly flexible and preferably flexible enough to describe all possible true belief states . Therefore , we use Normalizing Flows ( Tabak & Turner , 2013 ; Rezende & Mohamed , 2015 ) to parameterize those distributions . Rather than directly parameterizing statistics of the distribution itself , Normalizing Flows model the transformations , or the “ flow ” progress , needed to derive such a distribution . More specifically , it describes a sequence of invertible mappings that gradually transform a relatively simple probability density to a more flexible and complex one . Let fθ : RD → RD to be an invertible and differentiable mapping in state space parameterized by θ . Given a random variable x ∈ RD with probability distribution p ( x ) , we can derive the probability of the transformed random variable z = fθ ( x ) by applying the change of variable formula : p ( z ) = p ( x ) ∣∣∣∣det ∂f−1θ∂z ∣∣∣∣ ( 2 ) log p ( z ) = log p ( x ) − log ∣∣∣∣det ∂fθ∂z ∣∣∣∣ ( 3 ) To construct a highly flexible family of distributions , we can propagate the random variable at beginning z0 through a sequence of K mappings and get zK = fθK ◦ fθK−1 ◦ · · · ◦ fθ1 ( z0 ) with the probability log pK ( zK ) = log p ( z0 ) − K∑ k=1 log ∣∣∣∣det ∂fθk∂zk−1 ∣∣∣∣ ( 4 ) Given a relatively simple distribution of z0 , say , Gaussian distribution , by iteratively applying the transformations , the flow is capable of representing a highly complex distribution with the probability that remains tractable . The parameters θ1 , . . . , θK determine the transformations of the flow . An effective transformation that is widely accepted is affine coupling layer ( Dinh et al. , 2017 ; Kingma & Dhariwal , 2018 ; Kingma et al. , 2017 ) . Given the input x ∈ RD , let s and t stand for scale and translation functions which are usually parameterized by neural networks , where s , t : Rk → RD−k , k < D. The output , y , can be viewed as a concatenation of its first k dimensions y1 : k and the remaining part yk+1 : D : y1 : k = x1 : k , yk+1 : D = xk+1 : D exp ( s ( x1 : k ) ) + t ( x1 : k ) ( 5 ) where denotes the element-wise product ( see details about affine coupling layer in Appendix A.1 ) . 3 FLOW-BASED RECURRENT BELIEF STATE LEARNING . 3.1 FLOW-BASED RECURRENT BELIEF STATE MODEL . We propose the FlOw-based Recurrent BElief State model ( FORBES ) which learns general continuous belief states via normalizing flows under the variational inference framework . Specifically , the FORBES model consists of components needed to construct the PGM of POMDP as shown in Figure 2 : State transition model : p ( st|st−1 , at−1 ) . Observation model : p ( ot|st ) Reward model : p ( rt|st ) ( 6 ) In addition , we have a belief inference model q ( st|τt , ot ) to approximate the true posterior distribution p ( st|τt , ot ) , where τt = { o1 , a1 , . . . , ot−1 , at−1 } is the past information . The above components of FORBES can be optimized jointly by maximizing the Evidence Lower BOund ( ELBO ) ( Jordan et al. , 1999 ) or more generally the variational information bottleneck ( Tishby et al. , 2000 ; Alemi et al. , 2016 ) : log p ( o1 : T , r1 : T |a1 : T ) ≥ Eq ( s1 : T |o1 : T , a1 : T−1 ) [ T∑ t=1 ( ln p ( ot|st ) + ln p ( rt|st ) −DKL ( q ( st|st−1 , at−1 , ot ) ‖p ( st|st−1 , at−1 ) ) ) ] = T∑ t=1 [ Eq ( st|st−1 , at−1 , ot ) ( ln p ( ot|st ) + ln p ( rt|st ) ) − Eq ( st−1|st−2 , at−2 , ot−1 ) ( DKL ( q ( st|st−1 , at−1 , ot ) ‖p ( st|st−1 , at−1 ) ) ) ] . = JModel ( 7 ) here we use the factorization of q ( s1 : T |o1 : T , a1 : T−1 ) = ∏ t q ( st|st−1 , at−1 , ot ) . Detailed derivations can be found in Appendix.A.9 . In practice , the state transition model , observation model , reward model , and belief inference model can be represented by stochastic deep neural networks parameterized by ψ : pψ ( st|st−1 , at−1 ) , pψ ( ot|st ) , pψ ( rt|st ) , qψ ( st|τt , ot ) ( 8 ) where their outputs usually follow simple distributions such as diagonal Gaussians . The parameterized belief inference model qψ ( st|τt , ot ) acts as an encoder that encodes the historical information using a combination of convolutional neural networks and recurrent neural networks . Note that q below is obtained through the factorization of q ( s1 : T |o1 : T , a1 : T−1 ) = ∏ t q ( st|st−1 , at−1 , ot ) . In FORBES we provide special treatments for the belief inference model and the state transition model to represent more complex and flexible posterior and prior distributions . As shown in Figure 3 ( a ) , the input images o1 : t and actions a1 : t−1 are encoded with qψ ( st|τt , ot ) ( the blue and the red path ) . Then our final inferred belief is obtained by propagating qψ ( st|τt , ot ) through a set of normalizing flow mappings denoted fθK ◦ · · · ◦ fθ1 to get a representative posterior distribution qψ , θ ( st|τt , ot ) . For convenience , we denote q0 = qψ and qK = qψ , θ . On the other hand , o1 : t−1 and a1 : t−2 are encoded with qψ ( st−1|τt−1 , ot−1 ) ( the blue path ) , then the state transition model is used to obtain the prior guess of the state pψ ( st | τt ) = Eqψ ( st−1|τt−1 , ot−1 ) [ pψ ( st | st−1 , at−1 ) ] ( the green path ) . Then our final prior is obtained by propagating pψ ( st|τt ) through another set of normalizing flow mappings denoted fωK ◦· · ·◦fω1 to get a representative prior distribution pψ , ω ( st|τt ) . For convenience , we denote p0 = pψ and pK = pψ , ω . Then as shown in Figure 3 ( b ) , we can sample the initial state st ( the yellow and purple triangles ) from the belief states qK ( st | τt , ot ) . For each sampled initial state , we can use the state transition model to predict the future states ŝt+h given the future actions at : t+h−1 , and then use the observation model to reconstruct the observations ôt+h , where h is the prediction horizon . With the above settings , we can substitute the density probability inside the KL-divergence term in Equation 7 with Normalizing Flow : DKL ( qK ( st|τt , ot ) ‖pK ( st|st−1 , at−1 ) ) = EqK ( s1 : t|τt , ot ) [ log qK ( st|τt , ot ) − log pK ( st|τt ) ] = EqK ( s1 : t|τt , ot ) [ log q0 ( st|τt , ot ) − K∑ k=1 log ∣∣∣∣det ∂fθk∂st , k−1 ∣∣∣∣− log p0 ( st|τt ) + log ∣∣∣∣det ∂fωk∂st , k−1 ∣∣∣∣ ] ( 9 ) where pK ( st | st−1 , at−1 ) = pK ( st | τt ) given the sampled st−1 from qK ( s1 : t|τt , ot ) . st , k is the state variable st transformed by k layers of normalizing flows , and st,0 = st. To further demonstrate the properties of FORBES , we provide the following theorems . Theorem 1 The approximation error of the log-likelihood when maximizing the JModel ( the derived ELBO ) defined in Equation 7 is : log p ( o1 : T , r1 : T |a1 : T ) − JModel = EqK ( s1 : T |τT , oT ) [ T∑ t=1 DKL ( q ( st|τt , ot ) ‖p ( st | τt , ot ) ) ] ( 10 ) where p ( st | τt , ot ) denotes the true belief states . Detailed proofs can be found in Appendix.A.9 . Theorem 1 suggests that , when the learning algorithm maximizes the JModel ( the derived ELBO ) , then the DKL terms in the right-hand side are minimized , which indicate the KL-divergence between the learned belief states q ( st|τt , ot ) and the true belief states p ( st | τt , ot ) . Clearly , if p ( st | τt , ot ) is a complex distribution and q ( st|τt , ot ) is chosen from a restricted distribution class such as diagonal Gaussian , then when the algorithm maximizes the JModel ( the derived ELBO ) , there will still be a potentially large KL-divergence between the learned and the true belief states . Therefore , naturally there raises the problem that is normalizing flow a universal distributional approximator that is capable of accurately representing arbitrarily complex belief states , so the KL-divergence terms in the right-hand side of Equation ( 10 ) can be minimized to approach zero ? The answer is yes for a wide range of normalizing flows . To be specific , Teshima et al . ( 2020 ) provides theoretical results for the family of the flow used in FORBES . In fact , there always exists a diffeomorphism that can turn one well-behaved distribution to another . Besides the aforementioned affine coupling flow , many works show the distributional universality of other flows ( Kong & Chaudhuri , 2020 ; Huang et al. , 2018 ) . Ideally , the universal approximation property of the flow model qK ( st | τt , ot ) allows us to approximate the true posterior p ( st | τt , ot ) with arbitrary accuracy . Thus , compared to previous methods , FORBES helps close the gap between the log-likelihood and the ELBO to obtain a more accurate belief state . Though we usually can not achieve the ideal zero KL-divergence in practice , our method can get a smaller approximation error , equally a higher ELBO than previous works . We verify this statement in section 4.1 .
This work addresses model-based reinforcement learning (MBRL) in partially observable visual control tasks. The principal novelty of the work is the use of normalizing flows (NFs) in the belief inference model. The paper derives the evidence lower bound (ELBO) for the proposed inference model, and presents a related RL framework. Empirically, the proposed model's inference capabilities are tested in the sequential MNIST domain, and its control performance is evaluated in six continuous control problems. The results indicate improved belief fidelity, and improved sample complexity for learning to solve the control tasks.
SP:584f7ddab9fdabda0843cecb46bd461811c66e3e
Contextual Fusion For Adversarial Robustness
1 INTRODUCTION . 1.1 BIOLOGICAL BACKGROUND . Current deep learning networks are designed to optimally solve specific learning tasks for a particular category of inputs ( e.g. , convolutional neural networks ( CNNs ) for visual pattern recognition ) , but are limited in their ability to solve tasks that require combining different feature categories ( e.g. , visual , semantic , auditory ) into one coherent representation . Some of the challenges include finding the right alignment of unimodal representations , fusion strategy , and complexity measures for determining the efficacy of fused representationsBaltrusaitis et al . ( 2017 ) . In comparison , biological systems are excellent in their ability to form unique and coherent object representations , which is usually done in the associative cortex , by linking together different object features available from different specialized cortical networks , e.g. , primary visual or auditory cortices Gisiger et al . ( 2000 ) ; Pandya & Seltzer ( 1982 ) ; Mars et al . ( 2017 ) ; Rosen et al . ( 2017 ) . This natural strategy has many advantages including better discrimination performance , stability against adversarial attacks and better scalability Gilad & Helmchen ( 2020 ) . Indeed , if a classification decision is made based on a combination of features from different sensory categories , a noise or lack of information in one category can be compensated by another to make a correct decision . Furthermore , different types of sensory information can complement each other by being available at different times within a processing window . A good example may be human driving skill which relies on a combination of visual and auditory processing that helps to avoid mistakes and greatly enhances performance over only vision-based driving . Another example is insect navigation that depends both on visual and olfactory information to minimize classification error and to identify objects more reliably across range of distancesStrube-Bloss & Rössler ( 2018 ) . Although it seems obvious that humans and animals base their classification decisions on the complex mixture of features from different modalities using specialized classifiers in each of them , this ability is still lacking in current state of the art machine learning ( ML ) algorithms . Problems include difficulty of training because of the lack of data sets combining different types of information , and suboptimal performance of generic deep learning networks vs specialized ones . Indeed , e.g. , high performance of the CNNs designed for visual processing depends on their architecture that makes explicit assumptions that inputs are images , and the same network performs poorly for other types of data . Thus , there is a need to develop approaches that would combine strength of specialized networks with ability to integrate information across multiple streams as human and animal brain can do efficiently . 1.2 MULTI-MODAL FUSION . Multimodal fusion has been previously explored for hard classification problems . Proposed methods in literature include learning joint representations from unimodal representations that are derived using VLADGong et al . ( 2014 ) , Fisher Vector representationsDixit et al . ( 2015 ) , and deep features locally extracted from CNN ’ s with various configurationsWu et al . ( 2015 ) Yoo et al . ( 2015 ) Shen et al . ( 2019 ) . These approaches have been successfully applied for action , scene and event recognition , and object detection tasks . In Zhou et al . ( 2014 ) , the authors used features extracted from Alexnet pretrained on Places365 and Imagenet to show how internal representations of these networks perform for various scene and object centric datasets . Performance was not significantly superior to using a unimodal approach , however , some of the advantages were found to be related to reducing data bias . In Herranz et al . ( 2016 ) the authors demonstrated this by using combinations of object and scene features aggregated at different scales to build a more efficient joint representation that helped to mitigate dataset bias induced by scale . Our fusion approach aligns most closely with the methods proposed in these papers . 1.3 ADVERSARIAL ATTACKS . Image processing using deep convolutional neural nets ( CNNs ) has made historical leaps in the last decade Krizhevsky et al . ( 2012 ) ; He et al . ( 2016 ) ; Szegedy et al . ( 2015 ) . However , the same convolutional networks are susceptible to small perturbations in data , even imperceptible to humans , that can result in misclassification . There have been two main approaches for investigating ANN robustness : adversarial machine learning and training data manipulation Ford et al . ( 2019 ) . Although it has been proposed that adversarial and manipulation robustness can be increased through various mechanisms during the training phase , recent research has shown that these methods are mostly ineffective or their effectiveness is inconclusive Uesato et al . ( 2018 ) Geirhos et al . ( 2018 ) ; Athalye et al . ( 2018 ) . Fast Gradient Sign Method ( FGSM ) Goodfellow et al . ( 2014 ) is a popular one-step attack that is easier to defend compared to the iterative variants like Basic Iterative Method ( BIM ) Kurakin et al . ( 2016 ) or Projected Gradient Descent ( PGD ) . Adversarial training and its variants are defense methods commonly employed for dealing with adversarial attacks . In Tramèr et al . ( 2017 ) the authors found that adversarial training is more robust with adversarial examples generated from white box attacks ( attacks designed against the specifics of the underlying CNN architecture and weights ) but it remains vulnerable to black box transferred examples ( examples generated in architecture agnostic manner ) . To combat this , an ensemble model was proposed that combines adversarial examples created from different source models and substitute pretrained networks . In general , adversarial training on one type of attack does not generalise to other attacks and can compromise classification accuracy on clean , unperturbed data . For example , in Kurakin et al . ( 2017 ) the authors demonstrated that adversarial retraining on one step attacks do not protect against iterative attacks like PGD . Consequently , adversarial training with multi step attack is regarded as the state of the art method used for improving adversarial robustness for white box and black box attacks and was initially proposed in Madry et al . ( 2017 ) . Recently , Wong et al . ( 2020 ) showed that single-step adversarial training with an attack similar to FGSM successfully yields models robust to white-box attacks , if the stepsizes of the attack ’ s random and gradient step are appropriately tuned . Several other methods are proposed such as adversarial example detection , reconstructing adversarial inputs , network distillation etc . and are discussed in further detail in Yuan et al . ( 2018 ) . 1.4 SUMMARY OF OUR APPROACH . In this paper , we describe the fusion of two data streams , one focused on background ( context ) and another focused on the foreground ( object ) image information , and we use different types of adversarial perturbations to evaluate the efficacy of the fused representation . We explore the following main concepts : • Adversarial attacks can have divergent effects on context feature space and object feature space . • Utilizing combination of multiple modalities for the information processing can be an efficient method for combating adversarial attacks . • Context features provide additional information to object-oriented data , and can be used to improve classification , especially during adversarial attacks . 2 METHODOLOGY . 2.1 CONTEXTUAL FUSION . We developed three different image classifiers designed to extract foreground features , background features , or a fused version of both . Below we refer to these as the foreground , background , and joint classifiers , respectively . The distinction between the various classifiers is based on the underlying training data . The foreground classifier was trained on the object-centric Imagenet database , whereas the background classifier was trained on the scene-centric Places365 database similar to Zhou et al . ( 2014 ) . Each classifier was built on the Resnet18 architecture He et al . ( 2016 ) with a final fully connected layer specific to the dataset ( Figure 1 ) . Only the 512 dimensional fully connected layer was finetuned for MS COCO Lin et al . ( 2015 ) or CIFAR-10 Krizhevsky & Hinton ( 2009 ) . For the joint classifier , we adopted a late fusion strategy and concatenated features obtained from the foreground and background pre-trained networks . This 1024 dimensional representation was finetuned for the specific dataset . 2.2 DATASETS . MS COCO dataset is a large dataset with 1.6 million images that have multiple objects and multiple instances with overlapping contexts . We pruned the MS COCO dataset for images with fewer than two instances ( < =2 ) of a single object so as to minimise cases of co-occurring context . We used available bounding boxes to constrain the percentage of foreground to be less than or equal to fifty percent of the total image , where foreground was defined by the area within the bounding box . This significantly reduced the dataset size but helped create the conditions for learning a representation that had enough information for the background classifier to utilize . Our final dataset comprised of 24 classes with 7500 images . We used 75 % of the dataset for training and the rest for testing . We also used CIFAR-10 , which is a standard object recognition dataset with 10 classes . For experiments with CIFAR-10 , we used the entire dataset with 50000 images for training and tested with the remaining 10000 images . All images from have been resized and cropped to 224x224 and normalized with CIFAR-10 mean and standard deviation . 2.3 ADVERSARIAL ATTACKS . We tested the classifiers with two different types of adversarial attacks to evaluate the benefits of fusion : Gaussian blur and FGSM . Gaussian blur was applied to the test set by convolving a portion of the image within the object bounding box given in the dataset with Gaussian kernel . Differing degrees of blur were created by varying the standard deviation of the kernel . Adversarial example attacks were generated using FGSM similar to Szegedy et al . ( 2013 ) ; Goodfellow et al . ( 2014 ) . Here , small amounts of noise were added to the test images based on the gradient of the loss function with respect to the input . Following Goodfellow et al . ( 2014 ) we used the equation η = · sign ( ∇xJ ( θ , x , y ) ) where is a small real number , J is the loss as a function of the parameters ( θ ) , the input ( x ) , and the label y . 3 RESULTS . 3.1 BLUR AFFECTS FOREGROUND AND BACKGROUND CHANNELS DIFFERENTLY . The impact of adversarial attacks can vary with the CNN architecture and the underlying training data Dodge & Karam ( 2016 ) . Here , we used two distinct CNNs with the same Resnet18 architecture to serve as the background and foreground feature extractors . The background feature extractor was trained on the Places365 database Zhou et al . ( 2014 ) , a scene-centric collection of images with 365 scenes as categories ( e.g . abbey , bedroom , and library ) . The foreground feature extractor was trained on the object-centric Imagenet database with object categories ( e.g . goldfish , English setter , toaster ) . The two different feature extractors represent the same images in different ways and have a different sensitivity to the same adversarial attack . We use pretrained models readily available in Pytorch . Blur is a natural artifact common to many real-world acquired images . Therefore , it is critical for an image classifier to maintain robustness to blur . We created blurred images by convolution of the foreground of each image with a Gaussian kernel . This type of Gaussian blur is perceivable by humans , and for small standard deviations ( e.g . σ = 0.001 ) , the human visual system is able to perform a classification task with minimal mistakes . As we increase the amount of blur ( e.g . σ = 45 ) , both humans and neural networks tend towards chance level performance . In our approach , only the foreground pixels are modified leaving the context of the images intact . We first tested effect of application of the Gaussian blur on images from the MS COCO dataset . The blur was applied to the bounding box area of the image , where main object was located . Images were processed by each of the two CNNs independently and features were extracted from the batch normalization layers . To illustrate effect of blur on the high-level foreground and background features , we visualized the feature space using PCA to reduce dimensionality for few representative image classes ( see Figure 2 ) . We found that blur had differing effects between the background ( scenecentric ) and foreground ( object-centric ) features . For the foreground features , blur caused a shift of the entire statistical representation subspace , i.e. , all blurred images moved conjointly away from the non-blurred images ( compare small vs large dots in Figure 2 ) . However , for background features , blurred images were represented in the same statistical subspace as clean images . This shows , as one can expect , that blurring foreground ( object ) alone will have larger impact on the features extracted by the network focused on the foreground than on the features coming from the network that was train to recognize a background . This finding supports an idea that combined use of the foreground and background classifiers to process images in a multi-modal fashion may help to defend against adversarial attacks designed against specific image components . Specifically , if adversarial attacks affected only one channel of information ( i.e . the foreground channel ) , then multi-modal integration could overcome these attacks .
In this paper, authors studies the problem of adversarial training and tries to leverage a fusion-based method against adversarial attacks. This method fuses features from foreground and background extracted by pre-trained models and test its performance against both Gaussian blur and gradient-based attacks. The authors claim three main explorations: * Exploring the effects of adversarial attacks on both context and object feature space. * Exploring the benefits of fusing different modalities against adversarial attacks. * Exploring the benefits of context features.
SP:aafd4b162474722352787bd588218cfb4244bdbb
Contextual Fusion For Adversarial Robustness
1 INTRODUCTION . 1.1 BIOLOGICAL BACKGROUND . Current deep learning networks are designed to optimally solve specific learning tasks for a particular category of inputs ( e.g. , convolutional neural networks ( CNNs ) for visual pattern recognition ) , but are limited in their ability to solve tasks that require combining different feature categories ( e.g. , visual , semantic , auditory ) into one coherent representation . Some of the challenges include finding the right alignment of unimodal representations , fusion strategy , and complexity measures for determining the efficacy of fused representationsBaltrusaitis et al . ( 2017 ) . In comparison , biological systems are excellent in their ability to form unique and coherent object representations , which is usually done in the associative cortex , by linking together different object features available from different specialized cortical networks , e.g. , primary visual or auditory cortices Gisiger et al . ( 2000 ) ; Pandya & Seltzer ( 1982 ) ; Mars et al . ( 2017 ) ; Rosen et al . ( 2017 ) . This natural strategy has many advantages including better discrimination performance , stability against adversarial attacks and better scalability Gilad & Helmchen ( 2020 ) . Indeed , if a classification decision is made based on a combination of features from different sensory categories , a noise or lack of information in one category can be compensated by another to make a correct decision . Furthermore , different types of sensory information can complement each other by being available at different times within a processing window . A good example may be human driving skill which relies on a combination of visual and auditory processing that helps to avoid mistakes and greatly enhances performance over only vision-based driving . Another example is insect navigation that depends both on visual and olfactory information to minimize classification error and to identify objects more reliably across range of distancesStrube-Bloss & Rössler ( 2018 ) . Although it seems obvious that humans and animals base their classification decisions on the complex mixture of features from different modalities using specialized classifiers in each of them , this ability is still lacking in current state of the art machine learning ( ML ) algorithms . Problems include difficulty of training because of the lack of data sets combining different types of information , and suboptimal performance of generic deep learning networks vs specialized ones . Indeed , e.g. , high performance of the CNNs designed for visual processing depends on their architecture that makes explicit assumptions that inputs are images , and the same network performs poorly for other types of data . Thus , there is a need to develop approaches that would combine strength of specialized networks with ability to integrate information across multiple streams as human and animal brain can do efficiently . 1.2 MULTI-MODAL FUSION . Multimodal fusion has been previously explored for hard classification problems . Proposed methods in literature include learning joint representations from unimodal representations that are derived using VLADGong et al . ( 2014 ) , Fisher Vector representationsDixit et al . ( 2015 ) , and deep features locally extracted from CNN ’ s with various configurationsWu et al . ( 2015 ) Yoo et al . ( 2015 ) Shen et al . ( 2019 ) . These approaches have been successfully applied for action , scene and event recognition , and object detection tasks . In Zhou et al . ( 2014 ) , the authors used features extracted from Alexnet pretrained on Places365 and Imagenet to show how internal representations of these networks perform for various scene and object centric datasets . Performance was not significantly superior to using a unimodal approach , however , some of the advantages were found to be related to reducing data bias . In Herranz et al . ( 2016 ) the authors demonstrated this by using combinations of object and scene features aggregated at different scales to build a more efficient joint representation that helped to mitigate dataset bias induced by scale . Our fusion approach aligns most closely with the methods proposed in these papers . 1.3 ADVERSARIAL ATTACKS . Image processing using deep convolutional neural nets ( CNNs ) has made historical leaps in the last decade Krizhevsky et al . ( 2012 ) ; He et al . ( 2016 ) ; Szegedy et al . ( 2015 ) . However , the same convolutional networks are susceptible to small perturbations in data , even imperceptible to humans , that can result in misclassification . There have been two main approaches for investigating ANN robustness : adversarial machine learning and training data manipulation Ford et al . ( 2019 ) . Although it has been proposed that adversarial and manipulation robustness can be increased through various mechanisms during the training phase , recent research has shown that these methods are mostly ineffective or their effectiveness is inconclusive Uesato et al . ( 2018 ) Geirhos et al . ( 2018 ) ; Athalye et al . ( 2018 ) . Fast Gradient Sign Method ( FGSM ) Goodfellow et al . ( 2014 ) is a popular one-step attack that is easier to defend compared to the iterative variants like Basic Iterative Method ( BIM ) Kurakin et al . ( 2016 ) or Projected Gradient Descent ( PGD ) . Adversarial training and its variants are defense methods commonly employed for dealing with adversarial attacks . In Tramèr et al . ( 2017 ) the authors found that adversarial training is more robust with adversarial examples generated from white box attacks ( attacks designed against the specifics of the underlying CNN architecture and weights ) but it remains vulnerable to black box transferred examples ( examples generated in architecture agnostic manner ) . To combat this , an ensemble model was proposed that combines adversarial examples created from different source models and substitute pretrained networks . In general , adversarial training on one type of attack does not generalise to other attacks and can compromise classification accuracy on clean , unperturbed data . For example , in Kurakin et al . ( 2017 ) the authors demonstrated that adversarial retraining on one step attacks do not protect against iterative attacks like PGD . Consequently , adversarial training with multi step attack is regarded as the state of the art method used for improving adversarial robustness for white box and black box attacks and was initially proposed in Madry et al . ( 2017 ) . Recently , Wong et al . ( 2020 ) showed that single-step adversarial training with an attack similar to FGSM successfully yields models robust to white-box attacks , if the stepsizes of the attack ’ s random and gradient step are appropriately tuned . Several other methods are proposed such as adversarial example detection , reconstructing adversarial inputs , network distillation etc . and are discussed in further detail in Yuan et al . ( 2018 ) . 1.4 SUMMARY OF OUR APPROACH . In this paper , we describe the fusion of two data streams , one focused on background ( context ) and another focused on the foreground ( object ) image information , and we use different types of adversarial perturbations to evaluate the efficacy of the fused representation . We explore the following main concepts : • Adversarial attacks can have divergent effects on context feature space and object feature space . • Utilizing combination of multiple modalities for the information processing can be an efficient method for combating adversarial attacks . • Context features provide additional information to object-oriented data , and can be used to improve classification , especially during adversarial attacks . 2 METHODOLOGY . 2.1 CONTEXTUAL FUSION . We developed three different image classifiers designed to extract foreground features , background features , or a fused version of both . Below we refer to these as the foreground , background , and joint classifiers , respectively . The distinction between the various classifiers is based on the underlying training data . The foreground classifier was trained on the object-centric Imagenet database , whereas the background classifier was trained on the scene-centric Places365 database similar to Zhou et al . ( 2014 ) . Each classifier was built on the Resnet18 architecture He et al . ( 2016 ) with a final fully connected layer specific to the dataset ( Figure 1 ) . Only the 512 dimensional fully connected layer was finetuned for MS COCO Lin et al . ( 2015 ) or CIFAR-10 Krizhevsky & Hinton ( 2009 ) . For the joint classifier , we adopted a late fusion strategy and concatenated features obtained from the foreground and background pre-trained networks . This 1024 dimensional representation was finetuned for the specific dataset . 2.2 DATASETS . MS COCO dataset is a large dataset with 1.6 million images that have multiple objects and multiple instances with overlapping contexts . We pruned the MS COCO dataset for images with fewer than two instances ( < =2 ) of a single object so as to minimise cases of co-occurring context . We used available bounding boxes to constrain the percentage of foreground to be less than or equal to fifty percent of the total image , where foreground was defined by the area within the bounding box . This significantly reduced the dataset size but helped create the conditions for learning a representation that had enough information for the background classifier to utilize . Our final dataset comprised of 24 classes with 7500 images . We used 75 % of the dataset for training and the rest for testing . We also used CIFAR-10 , which is a standard object recognition dataset with 10 classes . For experiments with CIFAR-10 , we used the entire dataset with 50000 images for training and tested with the remaining 10000 images . All images from have been resized and cropped to 224x224 and normalized with CIFAR-10 mean and standard deviation . 2.3 ADVERSARIAL ATTACKS . We tested the classifiers with two different types of adversarial attacks to evaluate the benefits of fusion : Gaussian blur and FGSM . Gaussian blur was applied to the test set by convolving a portion of the image within the object bounding box given in the dataset with Gaussian kernel . Differing degrees of blur were created by varying the standard deviation of the kernel . Adversarial example attacks were generated using FGSM similar to Szegedy et al . ( 2013 ) ; Goodfellow et al . ( 2014 ) . Here , small amounts of noise were added to the test images based on the gradient of the loss function with respect to the input . Following Goodfellow et al . ( 2014 ) we used the equation η = · sign ( ∇xJ ( θ , x , y ) ) where is a small real number , J is the loss as a function of the parameters ( θ ) , the input ( x ) , and the label y . 3 RESULTS . 3.1 BLUR AFFECTS FOREGROUND AND BACKGROUND CHANNELS DIFFERENTLY . The impact of adversarial attacks can vary with the CNN architecture and the underlying training data Dodge & Karam ( 2016 ) . Here , we used two distinct CNNs with the same Resnet18 architecture to serve as the background and foreground feature extractors . The background feature extractor was trained on the Places365 database Zhou et al . ( 2014 ) , a scene-centric collection of images with 365 scenes as categories ( e.g . abbey , bedroom , and library ) . The foreground feature extractor was trained on the object-centric Imagenet database with object categories ( e.g . goldfish , English setter , toaster ) . The two different feature extractors represent the same images in different ways and have a different sensitivity to the same adversarial attack . We use pretrained models readily available in Pytorch . Blur is a natural artifact common to many real-world acquired images . Therefore , it is critical for an image classifier to maintain robustness to blur . We created blurred images by convolution of the foreground of each image with a Gaussian kernel . This type of Gaussian blur is perceivable by humans , and for small standard deviations ( e.g . σ = 0.001 ) , the human visual system is able to perform a classification task with minimal mistakes . As we increase the amount of blur ( e.g . σ = 45 ) , both humans and neural networks tend towards chance level performance . In our approach , only the foreground pixels are modified leaving the context of the images intact . We first tested effect of application of the Gaussian blur on images from the MS COCO dataset . The blur was applied to the bounding box area of the image , where main object was located . Images were processed by each of the two CNNs independently and features were extracted from the batch normalization layers . To illustrate effect of blur on the high-level foreground and background features , we visualized the feature space using PCA to reduce dimensionality for few representative image classes ( see Figure 2 ) . We found that blur had differing effects between the background ( scenecentric ) and foreground ( object-centric ) features . For the foreground features , blur caused a shift of the entire statistical representation subspace , i.e. , all blurred images moved conjointly away from the non-blurred images ( compare small vs large dots in Figure 2 ) . However , for background features , blurred images were represented in the same statistical subspace as clean images . This shows , as one can expect , that blurring foreground ( object ) alone will have larger impact on the features extracted by the network focused on the foreground than on the features coming from the network that was train to recognize a background . This finding supports an idea that combined use of the foreground and background classifiers to process images in a multi-modal fashion may help to defend against adversarial attacks designed against specific image components . Specifically , if adversarial attacks affected only one channel of information ( i.e . the foreground channel ) , then multi-modal integration could overcome these attacks .
The paper tackles the adversarial example problem. The authors propose an approach that is motivated by the way biological systems employ multi-modal information to recognize category of objects. Specifically, the approach combines two pre-train models, that are excepted to focus on foreground and background, respectively. Then the foreground module is fine-tuned for downstream tasks while the background module is left unchanged. The authors demonstrate that they obtain better performance against blur and FGSM.
SP:aafd4b162474722352787bd588218cfb4244bdbb
Contextual Fusion For Adversarial Robustness
1 INTRODUCTION . 1.1 BIOLOGICAL BACKGROUND . Current deep learning networks are designed to optimally solve specific learning tasks for a particular category of inputs ( e.g. , convolutional neural networks ( CNNs ) for visual pattern recognition ) , but are limited in their ability to solve tasks that require combining different feature categories ( e.g. , visual , semantic , auditory ) into one coherent representation . Some of the challenges include finding the right alignment of unimodal representations , fusion strategy , and complexity measures for determining the efficacy of fused representationsBaltrusaitis et al . ( 2017 ) . In comparison , biological systems are excellent in their ability to form unique and coherent object representations , which is usually done in the associative cortex , by linking together different object features available from different specialized cortical networks , e.g. , primary visual or auditory cortices Gisiger et al . ( 2000 ) ; Pandya & Seltzer ( 1982 ) ; Mars et al . ( 2017 ) ; Rosen et al . ( 2017 ) . This natural strategy has many advantages including better discrimination performance , stability against adversarial attacks and better scalability Gilad & Helmchen ( 2020 ) . Indeed , if a classification decision is made based on a combination of features from different sensory categories , a noise or lack of information in one category can be compensated by another to make a correct decision . Furthermore , different types of sensory information can complement each other by being available at different times within a processing window . A good example may be human driving skill which relies on a combination of visual and auditory processing that helps to avoid mistakes and greatly enhances performance over only vision-based driving . Another example is insect navigation that depends both on visual and olfactory information to minimize classification error and to identify objects more reliably across range of distancesStrube-Bloss & Rössler ( 2018 ) . Although it seems obvious that humans and animals base their classification decisions on the complex mixture of features from different modalities using specialized classifiers in each of them , this ability is still lacking in current state of the art machine learning ( ML ) algorithms . Problems include difficulty of training because of the lack of data sets combining different types of information , and suboptimal performance of generic deep learning networks vs specialized ones . Indeed , e.g. , high performance of the CNNs designed for visual processing depends on their architecture that makes explicit assumptions that inputs are images , and the same network performs poorly for other types of data . Thus , there is a need to develop approaches that would combine strength of specialized networks with ability to integrate information across multiple streams as human and animal brain can do efficiently . 1.2 MULTI-MODAL FUSION . Multimodal fusion has been previously explored for hard classification problems . Proposed methods in literature include learning joint representations from unimodal representations that are derived using VLADGong et al . ( 2014 ) , Fisher Vector representationsDixit et al . ( 2015 ) , and deep features locally extracted from CNN ’ s with various configurationsWu et al . ( 2015 ) Yoo et al . ( 2015 ) Shen et al . ( 2019 ) . These approaches have been successfully applied for action , scene and event recognition , and object detection tasks . In Zhou et al . ( 2014 ) , the authors used features extracted from Alexnet pretrained on Places365 and Imagenet to show how internal representations of these networks perform for various scene and object centric datasets . Performance was not significantly superior to using a unimodal approach , however , some of the advantages were found to be related to reducing data bias . In Herranz et al . ( 2016 ) the authors demonstrated this by using combinations of object and scene features aggregated at different scales to build a more efficient joint representation that helped to mitigate dataset bias induced by scale . Our fusion approach aligns most closely with the methods proposed in these papers . 1.3 ADVERSARIAL ATTACKS . Image processing using deep convolutional neural nets ( CNNs ) has made historical leaps in the last decade Krizhevsky et al . ( 2012 ) ; He et al . ( 2016 ) ; Szegedy et al . ( 2015 ) . However , the same convolutional networks are susceptible to small perturbations in data , even imperceptible to humans , that can result in misclassification . There have been two main approaches for investigating ANN robustness : adversarial machine learning and training data manipulation Ford et al . ( 2019 ) . Although it has been proposed that adversarial and manipulation robustness can be increased through various mechanisms during the training phase , recent research has shown that these methods are mostly ineffective or their effectiveness is inconclusive Uesato et al . ( 2018 ) Geirhos et al . ( 2018 ) ; Athalye et al . ( 2018 ) . Fast Gradient Sign Method ( FGSM ) Goodfellow et al . ( 2014 ) is a popular one-step attack that is easier to defend compared to the iterative variants like Basic Iterative Method ( BIM ) Kurakin et al . ( 2016 ) or Projected Gradient Descent ( PGD ) . Adversarial training and its variants are defense methods commonly employed for dealing with adversarial attacks . In Tramèr et al . ( 2017 ) the authors found that adversarial training is more robust with adversarial examples generated from white box attacks ( attacks designed against the specifics of the underlying CNN architecture and weights ) but it remains vulnerable to black box transferred examples ( examples generated in architecture agnostic manner ) . To combat this , an ensemble model was proposed that combines adversarial examples created from different source models and substitute pretrained networks . In general , adversarial training on one type of attack does not generalise to other attacks and can compromise classification accuracy on clean , unperturbed data . For example , in Kurakin et al . ( 2017 ) the authors demonstrated that adversarial retraining on one step attacks do not protect against iterative attacks like PGD . Consequently , adversarial training with multi step attack is regarded as the state of the art method used for improving adversarial robustness for white box and black box attacks and was initially proposed in Madry et al . ( 2017 ) . Recently , Wong et al . ( 2020 ) showed that single-step adversarial training with an attack similar to FGSM successfully yields models robust to white-box attacks , if the stepsizes of the attack ’ s random and gradient step are appropriately tuned . Several other methods are proposed such as adversarial example detection , reconstructing adversarial inputs , network distillation etc . and are discussed in further detail in Yuan et al . ( 2018 ) . 1.4 SUMMARY OF OUR APPROACH . In this paper , we describe the fusion of two data streams , one focused on background ( context ) and another focused on the foreground ( object ) image information , and we use different types of adversarial perturbations to evaluate the efficacy of the fused representation . We explore the following main concepts : • Adversarial attacks can have divergent effects on context feature space and object feature space . • Utilizing combination of multiple modalities for the information processing can be an efficient method for combating adversarial attacks . • Context features provide additional information to object-oriented data , and can be used to improve classification , especially during adversarial attacks . 2 METHODOLOGY . 2.1 CONTEXTUAL FUSION . We developed three different image classifiers designed to extract foreground features , background features , or a fused version of both . Below we refer to these as the foreground , background , and joint classifiers , respectively . The distinction between the various classifiers is based on the underlying training data . The foreground classifier was trained on the object-centric Imagenet database , whereas the background classifier was trained on the scene-centric Places365 database similar to Zhou et al . ( 2014 ) . Each classifier was built on the Resnet18 architecture He et al . ( 2016 ) with a final fully connected layer specific to the dataset ( Figure 1 ) . Only the 512 dimensional fully connected layer was finetuned for MS COCO Lin et al . ( 2015 ) or CIFAR-10 Krizhevsky & Hinton ( 2009 ) . For the joint classifier , we adopted a late fusion strategy and concatenated features obtained from the foreground and background pre-trained networks . This 1024 dimensional representation was finetuned for the specific dataset . 2.2 DATASETS . MS COCO dataset is a large dataset with 1.6 million images that have multiple objects and multiple instances with overlapping contexts . We pruned the MS COCO dataset for images with fewer than two instances ( < =2 ) of a single object so as to minimise cases of co-occurring context . We used available bounding boxes to constrain the percentage of foreground to be less than or equal to fifty percent of the total image , where foreground was defined by the area within the bounding box . This significantly reduced the dataset size but helped create the conditions for learning a representation that had enough information for the background classifier to utilize . Our final dataset comprised of 24 classes with 7500 images . We used 75 % of the dataset for training and the rest for testing . We also used CIFAR-10 , which is a standard object recognition dataset with 10 classes . For experiments with CIFAR-10 , we used the entire dataset with 50000 images for training and tested with the remaining 10000 images . All images from have been resized and cropped to 224x224 and normalized with CIFAR-10 mean and standard deviation . 2.3 ADVERSARIAL ATTACKS . We tested the classifiers with two different types of adversarial attacks to evaluate the benefits of fusion : Gaussian blur and FGSM . Gaussian blur was applied to the test set by convolving a portion of the image within the object bounding box given in the dataset with Gaussian kernel . Differing degrees of blur were created by varying the standard deviation of the kernel . Adversarial example attacks were generated using FGSM similar to Szegedy et al . ( 2013 ) ; Goodfellow et al . ( 2014 ) . Here , small amounts of noise were added to the test images based on the gradient of the loss function with respect to the input . Following Goodfellow et al . ( 2014 ) we used the equation η = · sign ( ∇xJ ( θ , x , y ) ) where is a small real number , J is the loss as a function of the parameters ( θ ) , the input ( x ) , and the label y . 3 RESULTS . 3.1 BLUR AFFECTS FOREGROUND AND BACKGROUND CHANNELS DIFFERENTLY . The impact of adversarial attacks can vary with the CNN architecture and the underlying training data Dodge & Karam ( 2016 ) . Here , we used two distinct CNNs with the same Resnet18 architecture to serve as the background and foreground feature extractors . The background feature extractor was trained on the Places365 database Zhou et al . ( 2014 ) , a scene-centric collection of images with 365 scenes as categories ( e.g . abbey , bedroom , and library ) . The foreground feature extractor was trained on the object-centric Imagenet database with object categories ( e.g . goldfish , English setter , toaster ) . The two different feature extractors represent the same images in different ways and have a different sensitivity to the same adversarial attack . We use pretrained models readily available in Pytorch . Blur is a natural artifact common to many real-world acquired images . Therefore , it is critical for an image classifier to maintain robustness to blur . We created blurred images by convolution of the foreground of each image with a Gaussian kernel . This type of Gaussian blur is perceivable by humans , and for small standard deviations ( e.g . σ = 0.001 ) , the human visual system is able to perform a classification task with minimal mistakes . As we increase the amount of blur ( e.g . σ = 45 ) , both humans and neural networks tend towards chance level performance . In our approach , only the foreground pixels are modified leaving the context of the images intact . We first tested effect of application of the Gaussian blur on images from the MS COCO dataset . The blur was applied to the bounding box area of the image , where main object was located . Images were processed by each of the two CNNs independently and features were extracted from the batch normalization layers . To illustrate effect of blur on the high-level foreground and background features , we visualized the feature space using PCA to reduce dimensionality for few representative image classes ( see Figure 2 ) . We found that blur had differing effects between the background ( scenecentric ) and foreground ( object-centric ) features . For the foreground features , blur caused a shift of the entire statistical representation subspace , i.e. , all blurred images moved conjointly away from the non-blurred images ( compare small vs large dots in Figure 2 ) . However , for background features , blurred images were represented in the same statistical subspace as clean images . This shows , as one can expect , that blurring foreground ( object ) alone will have larger impact on the features extracted by the network focused on the foreground than on the features coming from the network that was train to recognize a background . This finding supports an idea that combined use of the foreground and background classifiers to process images in a multi-modal fashion may help to defend against adversarial attacks designed against specific image components . Specifically , if adversarial attacks affected only one channel of information ( i.e . the foreground channel ) , then multi-modal integration could overcome these attacks .
This work proposed to enhance the robustness of DNNs by fusing context information from the background. It first studied the blur effects to the foreground and background-based DNNs and observed that fusing the two information helps accuracy improvements under different blur effects. Then, it further extends to the adversarial attacks via FGSM, and observes the advantages of using background information on MSCOCO and CIFAR-10 datasets. Finally, it proposed a regularization method to reweigh the foreground-related weights during training.
SP:aafd4b162474722352787bd588218cfb4244bdbb
Subjective Learning for Open-Ended Data
Conventional supervised learning typically assumes that the learning task can be solved by learning a single function since the data is sampled from a fixed distribution . However , this assumption is invalid in open-ended environments where no task-level data partitioning is available . In this paper , we present a novel supervised learning framework of learning from open-ended data , which is modeled as data implicitly sampled from multiple domains with the data in each domain obeying a domain-specific target function . Since different domains may possess distinct target functions , open-ended data inherently requires multiple functions to capture all its input-output relations , rendering training a single global model problematic . To address this issue , we devise an Open-ended Supervised Learning ( OSL ) framework , of which the key component is a subjective function that allocates the data among multiple candidate models to resolve the “ conflict ” between the data from different domains , exhibiting a natural hierarchy . We theoretically analyze the learnability and the generalization error of OSL , and empirically validate its efficacy in both open-ended regression and classification tasks . 1 INTRODUCTION . A hallmark of general intelligence is the ability of handling open-ended environments , which roughly means complex , diverse environments with no manual task specification ( Adams et al. , 2012 ; Clune , 2019 ; Colas et al. , 2019 ; Wang et al. , 2020 ) . Conventional supervised learning typically assumes that the learning task can be solved by approximating a single ground-truth target function ( Vapnik , 2013 ) . However , this assumption is invalid in open-ended environments where the data may implicitly belong to multiple , disparate domains with potentially different target functions since no manual task-level data partitioning is available . For instance , when collecting image-label pairs from the Internet , an image of a red sphere can correlate with the label of both “ red ” and “ sphere ” , implicitly representing two distinct domains or “ metaconcepts ” ( Han et al. , 2019 ) : “ color ” and “ shape ” . While being generic , this setting also characterizes many practical scenarios where the data comes from multiple sources , contexts or groups : for example , in federated learning the data is distributed on multiple clients , and in algorithmic fairness research the data is from different populations . In these scenarios , the input-conditional label distribution may vary in different domains ( also referred to as concept shift ( Kairouz et al. , 2021 ) ) due to personal preferences or other latent factors , corresponding to different target functions . Since different domains may possess different target functions , training a single global model by running Empirical Risk Minimization ( ERM ) using all data is problematic due to the potential “ conflict ” between the data from different domains : in the “ red sphere ” example above , directly training on all data will lead to the unfavorable result of “ 50 % red , 50 % sphere ” . Similar phenomena have also been observed by prior works ( Finn et al. , 2019 ; Su et al. , 2020 ) , where a learner simultaneously regressing from multiple target functions trivially outputs their mean . This indicates that the data sampled from open-ended environments , which we refer to as open-ended data , exhibits a structural difference from conventional supervised data . Formally , we introduce a novel , dataset-level measure named mapping rank , which represents the minimal number of functions required to “ fully express ” all input-output relations in the data and can be used to expound such difference more clearly . Definition 1 ( Mapping rank ) . Let X be an input space , Y an output space , and Z = { ( xi , yi ) } li=1 a dataset with cardinality l. Let F ( r ) = { fi } ri=1 be a function set with cardinality r , where each element is a single-valued deterministic function fromX to Y . Then , the mapping rank ofZ , denoted by R : = R ( Z ) , is defined as the minimal positive integer r , satisfying that there exists a function set F ( r ) such that for every ( x , y ) ∈ Z , there exists f ∈ F ( r ) with f ( x ) = y . Note that here we assume that there exist deterministic relations between inputs and outputs in the same domain , which is generally a mild assumption and is satisfied in many practical applications . Under Definition 1 , conventional supervised data yields a mapping rank R = 1 as it assumes that the whole dataset can be expressed by a single function . In contrast , open-ended data has a mapping rank R > 1 since for the same input different outputs exist , manifested as the conflict between data samples that renders training a single model problematic . Hence , it is natural to consider allocating the data to multiple models , so that the data processed by each model has a mapping rank R = 1 and thus can be handled with ERM . Although in some scenarios , apart from data samples there also exists side-information or metadata that can be exploited to identify the domains , this information may be difficult to define or collect in practice ( Hanna et al. , 2020 ; Creager et al. , 2021 ) ; even when such side-information is available , in many cases it still remains unclear how to leverage such information to detect and resolve the potential conflict between domains . Therefore , the problem of how to properly allocate open-ended data among the models is highly non-trivial . To tackle the aforementioned challenge , we present an Open-ended Supervised Learning ( OSL ) framework to enable effective learning from open-ended data . Concretely , OSL maintains a set of low-level models and a high-level subjective function that automatically allocates the data among these models so that the data processed by each model exhibits no conflict . The term “ subjective ” is used since in conventional supervised learning such allocation is manually performed during the data collecting process and thus conforms to human subjectivity . The motivation of such process is that if the subjective function yields an inappropriate allocation , i.e. , assigning conflicting data samples to the same model , then it will hinder the global minimization of the training error due to the conflict , which in turn drives the subjective function to alter its allocation strategy . Using a probablistic reformulation of OSL , we establish the connection between the data allocation and the posterior maximization using a variant of Expectation-Maximization ( EM ) algorithm ( Dempster et al. , 1977 ) , and show that the optimal form of the subjective function can be explicitly derived . Theoretically , we respectively analyse the Probably Approximately Correct ( PAC ) learnability ( Valiant , 1984 ) and the generalization error of OSL . Using the tools from statistical learning theory ( Vapnik , 2013 ) , we show that the relation between the number of low-level models and the mapping rank of data plays a key role in the learnability of OSL , and the generalization error of OSL can be decomposed into terms that respectively reflect high-level data allocation and lowlevel prediction errors . Empirically , we conduct extensive experiments including simulated openended regression and classification tasks to verify the efficacy of OSL . Our results show that OSL can effectively allocate and learn from open-ended data without additional human intervention . In summary , our contributions are three-fold : Open-ended data and mapping rank . We formalize a new problem of learning from open-ended data , and introduce a novel measure termed as mapping rank to outline the structural difference between open-ended data and conventional supervised data . OSL framework with theoretical guarantee . We present an OSL framework to enable effective learning from open-ended data ( Section 2 ) , and theoretically justify its learnability ( Section 3.1 ) and generalizability ( Section 3.2 ) respectively . Empirical validation of efficacy . We conduct extensive experiments on both open-ended regression and classification tasks . Experimental results validate our theoretical claims and demonstrate the efficacy of OSL ( Section 4 ) . 2 OPEN-ENDED SUPERVISED LEARNING . In this section , we present the overall formulation and the algorithm of OSL . We adhere to the conventional terminology in supervised learning , and let X be an input space , Y an output space , H a hypothesis space where each hypothesis ( model ) is a function from X to Y , and ` : Y×Y → [ 0 , 1 ] a non-negative and bounded loss function without loss of generality . We use [ k ] = { 1 , 2 , · · · , k } for positive integers k , and denote by 1 ( · ) the indicator function . We use superscripts to denote sampling indices ( e.g. , di and xij ) and subscripts as element indices ( e.g. , di ) . 2.1 PROBLEM STATEMENT . We begin by introducing the notion of domain to formulate the generation process of open-ended data . Inspired by Ben-David et al . ( 2010 ) , we define a domain d as a pair 〈P , c〉 consisting of a distribution P on X and a deterministic target function c : X → Y , and assume that the open-ended data is generated by a domain set D = { di } Ni=1 = { 〈Pi , ci〉 } Ni=1 containing N ( agnostic to the learner ) domains . Each domain has its own sub-dataset Zi = { ( xij , yij ) } lij=1 with cardinality li , where xi1 , · · · , xili are i.i.d . drawn from Pi and yij = ci ( xij ) . The whole dataset is the union of these sub-datasets : Z = ⋃N i=1 Zi with cardinality l = ∑N i=1 li and mapping rank 1 < R ≤ N . We then consider a bilevel sampling procedure : first , m domain samples d1 , · · · , dm are i.i.d . drawn from a distribution Q defined on D ( the same domain may be sampled multiple times ) , resulting in m sampling episodes ; second , in each sampling episode n data samples are i.i.d . drawn from the sub-dataset corresponding to the sampled domain . Hence , the dataset or any sub-datasets may be sampled multiple times during training . This sampling regime is analagous to the bilevel sampling process adopted by meta-learning . However , meta-learning usually assumes a dense distribution of related domains to enable task-level generalization ( Pentina & Lampert , 2014 ; Amit & Meir , 2018 ) , while OSL is compatible with scarce and disparate domains and inter-domain transfer is orthogonal . As we have mentioned in Section 1 , a single model is not sufficient in this setting whenR > 1 . Thus , we equip the learner with a hypothesis set H = { hi } Ki=1 consisting ofK > 1 hypotheses , enhancing its expressive capability . Although both N and K are assumed to be unknown , we will show that in general K ≥ R suffices ( Section 3.1 ) , which eases the difficulty of setting the hyperparameter K. In the above setting , an episodic sample number parameter n is introduced to maintain the local consistency of data , implicitly assuming that we are able to sample a size-n data batch at a time from each domain . While this formulation subsumes the fully online case of n = 1 , we note that although sometimes setting n = 1 works in practice , it also tends to be risky since it may raise difficulties in controlling the generalization error , as we will both theoretically and empirically demonstrate in the following sections ( see Section 3.2 and Section 4.3 ) .
The paper introduces "Open-ended Supervised Learning (OSL)", a method that handles data form multiple domains (open-ended data). OSL leverages an Expectation-Maximization (EM) algorithm to train the "subjective function" that allocates models to data domains. The paper presents the theoretical foundations and empirical results in which it outperforms existing baselines for (generated) regression and classification tasks.
SP:0e3c77cb62e9e6641dc49dc5644392c6406d2724
Subjective Learning for Open-Ended Data
Conventional supervised learning typically assumes that the learning task can be solved by learning a single function since the data is sampled from a fixed distribution . However , this assumption is invalid in open-ended environments where no task-level data partitioning is available . In this paper , we present a novel supervised learning framework of learning from open-ended data , which is modeled as data implicitly sampled from multiple domains with the data in each domain obeying a domain-specific target function . Since different domains may possess distinct target functions , open-ended data inherently requires multiple functions to capture all its input-output relations , rendering training a single global model problematic . To address this issue , we devise an Open-ended Supervised Learning ( OSL ) framework , of which the key component is a subjective function that allocates the data among multiple candidate models to resolve the “ conflict ” between the data from different domains , exhibiting a natural hierarchy . We theoretically analyze the learnability and the generalization error of OSL , and empirically validate its efficacy in both open-ended regression and classification tasks . 1 INTRODUCTION . A hallmark of general intelligence is the ability of handling open-ended environments , which roughly means complex , diverse environments with no manual task specification ( Adams et al. , 2012 ; Clune , 2019 ; Colas et al. , 2019 ; Wang et al. , 2020 ) . Conventional supervised learning typically assumes that the learning task can be solved by approximating a single ground-truth target function ( Vapnik , 2013 ) . However , this assumption is invalid in open-ended environments where the data may implicitly belong to multiple , disparate domains with potentially different target functions since no manual task-level data partitioning is available . For instance , when collecting image-label pairs from the Internet , an image of a red sphere can correlate with the label of both “ red ” and “ sphere ” , implicitly representing two distinct domains or “ metaconcepts ” ( Han et al. , 2019 ) : “ color ” and “ shape ” . While being generic , this setting also characterizes many practical scenarios where the data comes from multiple sources , contexts or groups : for example , in federated learning the data is distributed on multiple clients , and in algorithmic fairness research the data is from different populations . In these scenarios , the input-conditional label distribution may vary in different domains ( also referred to as concept shift ( Kairouz et al. , 2021 ) ) due to personal preferences or other latent factors , corresponding to different target functions . Since different domains may possess different target functions , training a single global model by running Empirical Risk Minimization ( ERM ) using all data is problematic due to the potential “ conflict ” between the data from different domains : in the “ red sphere ” example above , directly training on all data will lead to the unfavorable result of “ 50 % red , 50 % sphere ” . Similar phenomena have also been observed by prior works ( Finn et al. , 2019 ; Su et al. , 2020 ) , where a learner simultaneously regressing from multiple target functions trivially outputs their mean . This indicates that the data sampled from open-ended environments , which we refer to as open-ended data , exhibits a structural difference from conventional supervised data . Formally , we introduce a novel , dataset-level measure named mapping rank , which represents the minimal number of functions required to “ fully express ” all input-output relations in the data and can be used to expound such difference more clearly . Definition 1 ( Mapping rank ) . Let X be an input space , Y an output space , and Z = { ( xi , yi ) } li=1 a dataset with cardinality l. Let F ( r ) = { fi } ri=1 be a function set with cardinality r , where each element is a single-valued deterministic function fromX to Y . Then , the mapping rank ofZ , denoted by R : = R ( Z ) , is defined as the minimal positive integer r , satisfying that there exists a function set F ( r ) such that for every ( x , y ) ∈ Z , there exists f ∈ F ( r ) with f ( x ) = y . Note that here we assume that there exist deterministic relations between inputs and outputs in the same domain , which is generally a mild assumption and is satisfied in many practical applications . Under Definition 1 , conventional supervised data yields a mapping rank R = 1 as it assumes that the whole dataset can be expressed by a single function . In contrast , open-ended data has a mapping rank R > 1 since for the same input different outputs exist , manifested as the conflict between data samples that renders training a single model problematic . Hence , it is natural to consider allocating the data to multiple models , so that the data processed by each model has a mapping rank R = 1 and thus can be handled with ERM . Although in some scenarios , apart from data samples there also exists side-information or metadata that can be exploited to identify the domains , this information may be difficult to define or collect in practice ( Hanna et al. , 2020 ; Creager et al. , 2021 ) ; even when such side-information is available , in many cases it still remains unclear how to leverage such information to detect and resolve the potential conflict between domains . Therefore , the problem of how to properly allocate open-ended data among the models is highly non-trivial . To tackle the aforementioned challenge , we present an Open-ended Supervised Learning ( OSL ) framework to enable effective learning from open-ended data . Concretely , OSL maintains a set of low-level models and a high-level subjective function that automatically allocates the data among these models so that the data processed by each model exhibits no conflict . The term “ subjective ” is used since in conventional supervised learning such allocation is manually performed during the data collecting process and thus conforms to human subjectivity . The motivation of such process is that if the subjective function yields an inappropriate allocation , i.e. , assigning conflicting data samples to the same model , then it will hinder the global minimization of the training error due to the conflict , which in turn drives the subjective function to alter its allocation strategy . Using a probablistic reformulation of OSL , we establish the connection between the data allocation and the posterior maximization using a variant of Expectation-Maximization ( EM ) algorithm ( Dempster et al. , 1977 ) , and show that the optimal form of the subjective function can be explicitly derived . Theoretically , we respectively analyse the Probably Approximately Correct ( PAC ) learnability ( Valiant , 1984 ) and the generalization error of OSL . Using the tools from statistical learning theory ( Vapnik , 2013 ) , we show that the relation between the number of low-level models and the mapping rank of data plays a key role in the learnability of OSL , and the generalization error of OSL can be decomposed into terms that respectively reflect high-level data allocation and lowlevel prediction errors . Empirically , we conduct extensive experiments including simulated openended regression and classification tasks to verify the efficacy of OSL . Our results show that OSL can effectively allocate and learn from open-ended data without additional human intervention . In summary , our contributions are three-fold : Open-ended data and mapping rank . We formalize a new problem of learning from open-ended data , and introduce a novel measure termed as mapping rank to outline the structural difference between open-ended data and conventional supervised data . OSL framework with theoretical guarantee . We present an OSL framework to enable effective learning from open-ended data ( Section 2 ) , and theoretically justify its learnability ( Section 3.1 ) and generalizability ( Section 3.2 ) respectively . Empirical validation of efficacy . We conduct extensive experiments on both open-ended regression and classification tasks . Experimental results validate our theoretical claims and demonstrate the efficacy of OSL ( Section 4 ) . 2 OPEN-ENDED SUPERVISED LEARNING . In this section , we present the overall formulation and the algorithm of OSL . We adhere to the conventional terminology in supervised learning , and let X be an input space , Y an output space , H a hypothesis space where each hypothesis ( model ) is a function from X to Y , and ` : Y×Y → [ 0 , 1 ] a non-negative and bounded loss function without loss of generality . We use [ k ] = { 1 , 2 , · · · , k } for positive integers k , and denote by 1 ( · ) the indicator function . We use superscripts to denote sampling indices ( e.g. , di and xij ) and subscripts as element indices ( e.g. , di ) . 2.1 PROBLEM STATEMENT . We begin by introducing the notion of domain to formulate the generation process of open-ended data . Inspired by Ben-David et al . ( 2010 ) , we define a domain d as a pair 〈P , c〉 consisting of a distribution P on X and a deterministic target function c : X → Y , and assume that the open-ended data is generated by a domain set D = { di } Ni=1 = { 〈Pi , ci〉 } Ni=1 containing N ( agnostic to the learner ) domains . Each domain has its own sub-dataset Zi = { ( xij , yij ) } lij=1 with cardinality li , where xi1 , · · · , xili are i.i.d . drawn from Pi and yij = ci ( xij ) . The whole dataset is the union of these sub-datasets : Z = ⋃N i=1 Zi with cardinality l = ∑N i=1 li and mapping rank 1 < R ≤ N . We then consider a bilevel sampling procedure : first , m domain samples d1 , · · · , dm are i.i.d . drawn from a distribution Q defined on D ( the same domain may be sampled multiple times ) , resulting in m sampling episodes ; second , in each sampling episode n data samples are i.i.d . drawn from the sub-dataset corresponding to the sampled domain . Hence , the dataset or any sub-datasets may be sampled multiple times during training . This sampling regime is analagous to the bilevel sampling process adopted by meta-learning . However , meta-learning usually assumes a dense distribution of related domains to enable task-level generalization ( Pentina & Lampert , 2014 ; Amit & Meir , 2018 ) , while OSL is compatible with scarce and disparate domains and inter-domain transfer is orthogonal . As we have mentioned in Section 1 , a single model is not sufficient in this setting whenR > 1 . Thus , we equip the learner with a hypothesis set H = { hi } Ki=1 consisting ofK > 1 hypotheses , enhancing its expressive capability . Although both N and K are assumed to be unknown , we will show that in general K ≥ R suffices ( Section 3.1 ) , which eases the difficulty of setting the hyperparameter K. In the above setting , an episodic sample number parameter n is introduced to maintain the local consistency of data , implicitly assuming that we are able to sample a size-n data batch at a time from each domain . While this formulation subsumes the fully online case of n = 1 , we note that although sometimes setting n = 1 works in practice , it also tends to be risky since it may raise difficulties in controlling the generalization error , as we will both theoretically and empirically demonstrate in the following sections ( see Section 3.2 and Section 4.3 ) .
This paper proposes a framework for open-ended data by learning a subjective functions that allows to represent multiple domains without interference. The framework works in two stages: 1) evaluating a set of candidate hypotheses for each domain using a batch of data for that domain, 2) training the hypothesis with the smallest error for each domain. The paper also proposes two new evaluation metrics, one to determine the error of the subjective function and one for calculating the model error in domain prediction. The authors provide both theoretical and experimental analyses of the proposed framework. In terms of theoretical analyses, the authors provide some guarantees in terms of learnability and generalisation error. In terms of experimental results, the authors test both regression and classification tasks with data of multiple labels and hierarchical labels. Comparisons to other approaches such as ProbCon, Pseudo-L and LabelProp in Colored MNIST, CIFAR-100 and Fashion Product Images datasets demonstrate gains of the proposed approach versus counterparts.
SP:0e3c77cb62e9e6641dc49dc5644392c6406d2724
Subjective Learning for Open-Ended Data
Conventional supervised learning typically assumes that the learning task can be solved by learning a single function since the data is sampled from a fixed distribution . However , this assumption is invalid in open-ended environments where no task-level data partitioning is available . In this paper , we present a novel supervised learning framework of learning from open-ended data , which is modeled as data implicitly sampled from multiple domains with the data in each domain obeying a domain-specific target function . Since different domains may possess distinct target functions , open-ended data inherently requires multiple functions to capture all its input-output relations , rendering training a single global model problematic . To address this issue , we devise an Open-ended Supervised Learning ( OSL ) framework , of which the key component is a subjective function that allocates the data among multiple candidate models to resolve the “ conflict ” between the data from different domains , exhibiting a natural hierarchy . We theoretically analyze the learnability and the generalization error of OSL , and empirically validate its efficacy in both open-ended regression and classification tasks . 1 INTRODUCTION . A hallmark of general intelligence is the ability of handling open-ended environments , which roughly means complex , diverse environments with no manual task specification ( Adams et al. , 2012 ; Clune , 2019 ; Colas et al. , 2019 ; Wang et al. , 2020 ) . Conventional supervised learning typically assumes that the learning task can be solved by approximating a single ground-truth target function ( Vapnik , 2013 ) . However , this assumption is invalid in open-ended environments where the data may implicitly belong to multiple , disparate domains with potentially different target functions since no manual task-level data partitioning is available . For instance , when collecting image-label pairs from the Internet , an image of a red sphere can correlate with the label of both “ red ” and “ sphere ” , implicitly representing two distinct domains or “ metaconcepts ” ( Han et al. , 2019 ) : “ color ” and “ shape ” . While being generic , this setting also characterizes many practical scenarios where the data comes from multiple sources , contexts or groups : for example , in federated learning the data is distributed on multiple clients , and in algorithmic fairness research the data is from different populations . In these scenarios , the input-conditional label distribution may vary in different domains ( also referred to as concept shift ( Kairouz et al. , 2021 ) ) due to personal preferences or other latent factors , corresponding to different target functions . Since different domains may possess different target functions , training a single global model by running Empirical Risk Minimization ( ERM ) using all data is problematic due to the potential “ conflict ” between the data from different domains : in the “ red sphere ” example above , directly training on all data will lead to the unfavorable result of “ 50 % red , 50 % sphere ” . Similar phenomena have also been observed by prior works ( Finn et al. , 2019 ; Su et al. , 2020 ) , where a learner simultaneously regressing from multiple target functions trivially outputs their mean . This indicates that the data sampled from open-ended environments , which we refer to as open-ended data , exhibits a structural difference from conventional supervised data . Formally , we introduce a novel , dataset-level measure named mapping rank , which represents the minimal number of functions required to “ fully express ” all input-output relations in the data and can be used to expound such difference more clearly . Definition 1 ( Mapping rank ) . Let X be an input space , Y an output space , and Z = { ( xi , yi ) } li=1 a dataset with cardinality l. Let F ( r ) = { fi } ri=1 be a function set with cardinality r , where each element is a single-valued deterministic function fromX to Y . Then , the mapping rank ofZ , denoted by R : = R ( Z ) , is defined as the minimal positive integer r , satisfying that there exists a function set F ( r ) such that for every ( x , y ) ∈ Z , there exists f ∈ F ( r ) with f ( x ) = y . Note that here we assume that there exist deterministic relations between inputs and outputs in the same domain , which is generally a mild assumption and is satisfied in many practical applications . Under Definition 1 , conventional supervised data yields a mapping rank R = 1 as it assumes that the whole dataset can be expressed by a single function . In contrast , open-ended data has a mapping rank R > 1 since for the same input different outputs exist , manifested as the conflict between data samples that renders training a single model problematic . Hence , it is natural to consider allocating the data to multiple models , so that the data processed by each model has a mapping rank R = 1 and thus can be handled with ERM . Although in some scenarios , apart from data samples there also exists side-information or metadata that can be exploited to identify the domains , this information may be difficult to define or collect in practice ( Hanna et al. , 2020 ; Creager et al. , 2021 ) ; even when such side-information is available , in many cases it still remains unclear how to leverage such information to detect and resolve the potential conflict between domains . Therefore , the problem of how to properly allocate open-ended data among the models is highly non-trivial . To tackle the aforementioned challenge , we present an Open-ended Supervised Learning ( OSL ) framework to enable effective learning from open-ended data . Concretely , OSL maintains a set of low-level models and a high-level subjective function that automatically allocates the data among these models so that the data processed by each model exhibits no conflict . The term “ subjective ” is used since in conventional supervised learning such allocation is manually performed during the data collecting process and thus conforms to human subjectivity . The motivation of such process is that if the subjective function yields an inappropriate allocation , i.e. , assigning conflicting data samples to the same model , then it will hinder the global minimization of the training error due to the conflict , which in turn drives the subjective function to alter its allocation strategy . Using a probablistic reformulation of OSL , we establish the connection between the data allocation and the posterior maximization using a variant of Expectation-Maximization ( EM ) algorithm ( Dempster et al. , 1977 ) , and show that the optimal form of the subjective function can be explicitly derived . Theoretically , we respectively analyse the Probably Approximately Correct ( PAC ) learnability ( Valiant , 1984 ) and the generalization error of OSL . Using the tools from statistical learning theory ( Vapnik , 2013 ) , we show that the relation between the number of low-level models and the mapping rank of data plays a key role in the learnability of OSL , and the generalization error of OSL can be decomposed into terms that respectively reflect high-level data allocation and lowlevel prediction errors . Empirically , we conduct extensive experiments including simulated openended regression and classification tasks to verify the efficacy of OSL . Our results show that OSL can effectively allocate and learn from open-ended data without additional human intervention . In summary , our contributions are three-fold : Open-ended data and mapping rank . We formalize a new problem of learning from open-ended data , and introduce a novel measure termed as mapping rank to outline the structural difference between open-ended data and conventional supervised data . OSL framework with theoretical guarantee . We present an OSL framework to enable effective learning from open-ended data ( Section 2 ) , and theoretically justify its learnability ( Section 3.1 ) and generalizability ( Section 3.2 ) respectively . Empirical validation of efficacy . We conduct extensive experiments on both open-ended regression and classification tasks . Experimental results validate our theoretical claims and demonstrate the efficacy of OSL ( Section 4 ) . 2 OPEN-ENDED SUPERVISED LEARNING . In this section , we present the overall formulation and the algorithm of OSL . We adhere to the conventional terminology in supervised learning , and let X be an input space , Y an output space , H a hypothesis space where each hypothesis ( model ) is a function from X to Y , and ` : Y×Y → [ 0 , 1 ] a non-negative and bounded loss function without loss of generality . We use [ k ] = { 1 , 2 , · · · , k } for positive integers k , and denote by 1 ( · ) the indicator function . We use superscripts to denote sampling indices ( e.g. , di and xij ) and subscripts as element indices ( e.g. , di ) . 2.1 PROBLEM STATEMENT . We begin by introducing the notion of domain to formulate the generation process of open-ended data . Inspired by Ben-David et al . ( 2010 ) , we define a domain d as a pair 〈P , c〉 consisting of a distribution P on X and a deterministic target function c : X → Y , and assume that the open-ended data is generated by a domain set D = { di } Ni=1 = { 〈Pi , ci〉 } Ni=1 containing N ( agnostic to the learner ) domains . Each domain has its own sub-dataset Zi = { ( xij , yij ) } lij=1 with cardinality li , where xi1 , · · · , xili are i.i.d . drawn from Pi and yij = ci ( xij ) . The whole dataset is the union of these sub-datasets : Z = ⋃N i=1 Zi with cardinality l = ∑N i=1 li and mapping rank 1 < R ≤ N . We then consider a bilevel sampling procedure : first , m domain samples d1 , · · · , dm are i.i.d . drawn from a distribution Q defined on D ( the same domain may be sampled multiple times ) , resulting in m sampling episodes ; second , in each sampling episode n data samples are i.i.d . drawn from the sub-dataset corresponding to the sampled domain . Hence , the dataset or any sub-datasets may be sampled multiple times during training . This sampling regime is analagous to the bilevel sampling process adopted by meta-learning . However , meta-learning usually assumes a dense distribution of related domains to enable task-level generalization ( Pentina & Lampert , 2014 ; Amit & Meir , 2018 ) , while OSL is compatible with scarce and disparate domains and inter-domain transfer is orthogonal . As we have mentioned in Section 1 , a single model is not sufficient in this setting whenR > 1 . Thus , we equip the learner with a hypothesis set H = { hi } Ki=1 consisting ofK > 1 hypotheses , enhancing its expressive capability . Although both N and K are assumed to be unknown , we will show that in general K ≥ R suffices ( Section 3.1 ) , which eases the difficulty of setting the hyperparameter K. In the above setting , an episodic sample number parameter n is introduced to maintain the local consistency of data , implicitly assuming that we are able to sample a size-n data batch at a time from each domain . While this formulation subsumes the fully online case of n = 1 , we note that although sometimes setting n = 1 works in practice , it also tends to be risky since it may raise difficulties in controlling the generalization error , as we will both theoretically and empirically demonstrate in the following sections ( see Section 3.2 and Section 4.3 ) .
The authors present a novel framework for learning different target concepts. They argue that so far, a single classifier is supposed to learn mixed concepts but usually fail. Hence, they propose a framework for sampling instances according to only a single target concept and solving this problem with classical ERM and repeating for other concepts. They provide theoretical analyses and empirical insights.
SP:0e3c77cb62e9e6641dc49dc5644392c6406d2724
$f$-Mutual Information Contrastive Learning
1 INTRODUCTION . Contrastive learning has attracted a surge of attention recently due to its success in learning informative representation for image recognition , natural language understanding , and reinforcement learning ( Chen et al. , 2020 ; He et al. , 2020 ; Logeswaran & Lee , 2018 ; Srinivas et al. , 2020 ) . Such learning paradigm is fully unsupervised by encouraging the contrastiveness between similar and dissimilar sample pairs . Specifically , the feature embeddings of similar sample pairs are expected to be close while those of dissimilar sample pairs are expected to be far apart . To attain this goal , a softmax cross-entropy loss , a.k.a . InfoNCE , has been widely used ( Wu et al. , 2018 ; van den Oord et al. , 2018 ; Chen et al. , 2020 ; Hénaff et al. , 2020 ; He et al. , 2020 ) , which aims to maximize the probability of picking a similar sample pair among a batch of sample pairs . InfoNCE can be interpreted as a lower bound of the mutual information ( MI ) between two views of data samples ( van den Oord et al. , 2018 ; Bachman et al. , 2019 ; Tian et al. , 2020a ; Tschannen et al. , 2020 ) . This explanation is consistent with the well-known “ InfoMax principle ” ( Linsker , 1988 ) . Nevertheless , it has been shown that maximizing a tighter bound on the MI can result in worse representations ( Tschannen et al. , 2020 ) ; and reducing the MI between views while only keeping task-relevant information can improve the downstream performance ( Tian et al. , 2020b ) . These observations suggest that maximizing the MI may be insufficient in contrastive learning and thus a better objective design is required . To attain the aforementioned goal , we propose a novel contrastive learning framework , coined as f -MICL . In a nutshell , leveraging the fact that MI can be formulated as the Kullback–Leibler ( KL ) divergence between the joint distribution and the product of the marginal distributions , we replace the KL divergence with the general f -divergence family ( Ali & Silvey , 1966 ; Csiszár , 1967 ) . Doing so , we obtain a generalization of mutual information , called f -mutual information ( f -MI , Csiszár , 1967 ) . Notably , by maximizing a lower bound of f -mutual information we naturally decompose the objective function into two terms , which correspond to the properties of the alignment and the uniformity . Such characterization has been revealed in Wang & Isola ( 2020 , Theorem 1 ) for the InfoNCE loss . Compared with Wang & Isola ( 2020 ) , our result applies to a wide range of the f - divergence family such as KL , Jensen–Shannon ( JS ) , Pearson χ2 and Vincze–Le Cam . and it does not rely on the limit of an infinite number of dissimilar samples . This allows us to explore the space of f -MI and improve the performance of InfoNCE-based contrastive learning . The similarity function is crucial for the evaluation of the contrastiveness of similar and dissimilar sample pairs . Commonly used similarity functions include the cosine similarity ( Chen et al. , 2020 ; He et al. , 2020 ) , the bilinear functions ( van den Oord et al. , 2018 ; Tian et al. , 2020a ; Hénaff et al. , 2020 ) , and the neural network based scores ( Hjelm et al. , 2018 ) . While most aforementioned similarity functions for contrastive learning are heuristic and pre-designed , in this work , we provide a principled way to design the similarity function . By assuming that the joint feature distribution of two similar samples is proportional to a Gaussian kernel , we derive an optimal similarity function for practical use , which resembles the well-known radial basis functions ( Powell , 1987 ) . Figure 1 gives a high-level summary of our f -MICL framework . Given a batch of samples ( e.g. , images ) we generate positive pairs via data augmentation and negative pairs using other augmented samples in the current batch . With the optimization of our f -mutual information objective the positive pairs are aligned with each other and the data representations are uniformly distributed . Our contributions can be summarized as follows : • We propose a novel framework for contrastive learning ( called f -MICL ) by encouraging the contrastiveness of positive and negative pairs with a general f -divergence family . • With an assumption on the joint feature distribution we provide an optimal design for the similarity function with Gaussian kernels , which shows interesting connection between contrastive learning and kernel methods . • We characterize the properties of alignment and uniformity for f -MICL and provide guidance on choosing proper f -divergences . Our f -MICL objective can be estimated with finite samples and we give the corresponding error bound . • Experimentally , our framework is better or on par with popular baselines , by simply replacing , e.g. , the InfoNCE loss function with our theoretically grounded f -MICL objectives . Notations We assume a dominating measure λ ( e.g . Lebesgue ) is given and all other probability measures are represented as some density w.r.t . λ . We denote Df ( p‖q ) as the f -divergence between two densities functions p and q . Given the joint density p ( x , y ) , we denote p ( x ) = ∫ p ( x , y ) dλ ( y ) and p ( y ) = ∫ p ( x , y ) dλ ( x ) as the marginals . We use supp ( · ) to denote the support of a distribution , and f∗ to denote the Fenchel conjugate of a convex function f . Every norm presented is Euclidean . 2 PRELIMINARIES . We provide some preliminaries for our framework in the context of contrastive learning . Contrastive learning is a popular unsupervised method for learning data representations . In contrastive learning , we expect that similar sample pairs to be close to each other in the embedding space while uncorrelated pairs to be far away . Denote ppos as the distribution of positive pairs , i.e. , two samples that have similar representations . Assume that this distribution is symmetric w.r.t . the two random variables , then the resultant two marginals both follow the data distribution pdata ( Wang & Isola , 2020 ) . In this work we propose the f -mutual information framework for contrastive learning . First recall the f -mutual information ( f -MI ) between a pair of random variables X and Y : Definition 1 ( f -mutual information , Csiszár 1967 ) . Consider a pair of random variables ( X , Y ) with density function p ( x , y ) . The f -mutual information If between X and Y is defined as If ( X ; Y ) : = Df ( p ( x , y ) ‖p ( x ) p ( y ) ) = ∫ f ( p ( x , y ) p ( x ) p ( y ) ) p ( x ) p ( y ) · dλ ( x , y ) , ( 1 ) where f : R+ → R is ( closed ) convex with f ( 1 ) = 0 , and recall that p ( x ) and p ( y ) are the marginal densities of p ( x , y ) , whereas λ is a dominating measure ( e.g . Lebesgue ) . Common choices of f can be found in Table 1 and Table 4 ( Appendix A ) , which we will discuss in more details in §3 . It is well-known that f -mutual information is non-negative and symmetric , and provided that f is strictly convex , If ( X ; Y ) = 0 iff X and Y are independent ( Ali & Silvey , 1966 ) . When X and Y are of high dimension , it is quite challenging to estimate the f -divergence directly . Instead , Nguyen et al . ( 2010 ) derived a variational method by maximizing the dual problem : If ( X ; Y ) ≥ sup T∈T if ( X ; Y ) : = E ( x , y ) ∼ppos [ T ( x , y ) ] − E ( x , y ) ∼pdata⊗pdata [ f ∗ ( T ( x , y ) ) ] , ( 2 ) where f∗ ( t ) : = supx∈R+ ( xt − f ( x ) ) is the ( monotone ) Fenchel conjugate of f , and is always monotonically increasing . Here T is a class of functions T : supp ( pdata ) × supp ( pdata ) → dom f∗ . Nguyen et al . ( 2010 ) showed that the bound in eq . ( 2 ) is tight if there exists T ∗ ∈ T such that T ∗ ( x , y ) = f ′ ( p ( x , y ) / ( p ( x ) p ( y ) ) ) , for any ( x , y ) ∈ supp ( pdata ) × supp ( pdata ) , ( 3 ) and in particular , if T comprises of all ( measurable ) functions . 3 DESIGN OF f -MICL Based on the f -MI introduced in §2 , we propose a novel framework for contrastive learning . Furthermore , we characterize the properties of alignment and uniformity theoretically for general f - divergences . Following Chen et al . ( 2020 ) , we design the strcture of function T as follows : T ( x , y ) : = k ( g ( x ) , g ( y ) ) , where ‖g ( x ) ‖ = 1 for any sample x . ( 4 ) The function g produces a d-dimensional normalized feature encoding on the hypersphere Sd−1 and k is a similarity function that measures the similarity between two embeddings g ( x ) and g ( y ) . With the above interpretation , we can rewrite our objective of f -mutual information , equation 2 , as : sup g∈G , k∈K if ( X ; Y ) : = E ( x , y ) ∼ppos [ k ( g ( x ) , g ( y ) ) ] − E ( x , y ) ∼pdata⊗pdata [ f ∗ ( k ( g ( x ) , g ( y ) ) ) ] , ( 5 ) where G andK are the function classes of the feature encoder g and the similarity function k. We can treat the first term as the similarity score between positive pairs in the feature space , and the second term as the similarity score between two random samples , a.k.a . negative pairs , in the feature space . As f∗ is increasing , maximizing f -MI is equivalent to simultaneously maximizing the similarity between positive pairs and minimizing the similarity between negative pairs . 3.1 OPTIMIZED SIMILARITY FUNCTION AND IMPLEMENTATION . Let us now study how to search for the optimal similarity function k. To our best knowledge , there has been no theoretical study on the choice of similarity functions . Most existing contrastive learning methods ( e.g . Chen et al. , 2020 ; Tsai et al. , 2020 ; He et al. , 2020 ) adopt a pre-designed similarity function , such as the cosine similarity . For the ease of notation , from now on we define xg : = g ( x ) and yg : = g ( y ) . Suppose ( x , y ) ∼ ppos , then we denote pgpos as the distribution of ( xg , yg ) , and p g data as the marginal feature distribution of xg or yg . The corresponding density functions are written as pg ( x g ) , pg ( y g ) and pg ( xg , yg ) . We remind the reader of the following result : Lemma 2 ( e.g. , Nguyen et al . 2010 , Lemma 1 ) . Suppose f is differentiable , and the encoder function g is fixed . The similarity function k∗ ( xg , yg ) = f ′ ( pg ( x g , yg ) pg ( xg ) pg ( yg ) ) ( 6 ) maximizes if ( X ; Y ) in eq . ( 5 ) as long as it is contained in the function class K. Equation 6 provides an optimal similarity function , which nevertheless depends on the density functions . Comparing equation 6 with equation 5 , we realize that the optimal k∗ in fact gives the f -MI on the feature space , If ( g ( X ) , g ( Y ) ) , which is a low bound of the original f -MI , If ( X ; Y ) . To use k∗ practically we make the following assumption on the joint density : Assumption 3 . The joint feature distribution is proportional to a radial basis function ( RBF ) , i.e. , pg ( x g , yg ) ∝ ϕ ( ‖xg − yg‖2 ) for a real-valued function ϕ . Radial basis functions are widely used in kernel methods ( Powell , 1987 ; Murphy , 2012 ) , and the Gaussian kernel is perhaps the most well-known RBF . Throughout this work we mainly consider ϕ as a Gaussian kernel : ϕ ( ‖xg − yg‖2 ) = Gσ ( ‖xg − yg‖2 ) : = µ exp ( −‖x g − yg‖2 2σ2 ) , ( 7 ) with µ a constant left to be determined . Fixing yg , then pg ( · , yg ) is known as the von Mises–Fisher distribution ( von Mises , 1918 ; Fisher , 1953 ; Bingham & Mardia , 1975 ) , since xg and yg are unit vectors . With Assumption 3 on the joint density , the resultant marginal feature distribution pgdata is uniform on the hypersphere Sd−1 , where d is the dimension of the feature space ( see Prop . 8 in App . B ) . Additionally , for positive pairs the distance in the feature space , ‖xg − yg‖ , is more likely to be small . If the variance σ2 → 0 , then the Gaussian kernel becomes the Dirac delta distribution , δxg=yg . This requires that the two features xg and yg to be the same , which is desirable . In general , the radial basis function ϕ should be decreasing since a positive pair should be more likely to be adjacent in the feature space . For example , with ϕ ( t ) = 1− t/2 we obtain the cosine similarity . Based on Assumption 3 we propose the following similarity function between pairs of features : Theorem 4 ( Gaussian similarity ) . Under Assumption 3 with Gaussian kernels and the same settings as Lemma 2 , the optimal similarity function k∗ satisfies that for any xg , yg ∈ Sd−1 : k∗ ( xg , yg ) = f ′ ( CGσ ( ‖xg − yg‖2 ) ) , ( 8 ) where d is the feature dimension and C is an absolute constant . For simplicity we will rewrite k∗ ( xg , yg ) = f ′ ◦ Gσ ( ‖xg − yg‖2 ) by absorbing the constant C into Gσ , since we have left some flexibility in equation 7 . Although Assumption 3 with Gaussian kernels may not always reflect the real feature distribution , we can still use the similarity function in equation 8 , even if it might not be optimal . In our experiments in §5 , the Gaussian similarity equation 8 consistently outperforms the default cosine similarity in contrastive learning . Algorithm 1 : f -mutual information contrastive learning ( f -MICL ) Input : batch size N , function f , weighting parameter α , constant µ ( in Gσ ) , variance σ2 , optimizer 1 for each batch { zi } Ni=1 do 2 forall k ∈ [ 1 , N ] do 3 randomly sample two augmentation functions t1 , t2 4 yk ← t1 ( zk ) , xk ← t2 ( zk ) 5 compute if = 1N ∑N i=1 [ f ′ ◦Gσ ( ‖xgi − y g i ‖2 ) ] − αN ( N−1 ) ∑ i6=j f ∗ ◦ f ′ ◦Gσ ( ‖xgi − x g j‖ ) 6 update g by taking a step to maximizing if using the optimizer Bringing the optimal k∗ in equation 8 into our objective equation 5 we have the following objective : sup g∈G E ( x , y ) ∼ppos [ f ′ ◦Gσ ( ‖xg − yg‖2 ) ] − E ( x , y ) ∼pdata⊗pdata [ f∗ ◦ f ′ ◦Gσ ( ‖xg − yg‖2 ) ] , ( 9 ) where Gσ is defined in equation 7 . With a similar sampling method of positive and negative pairs in Chen et al . ( 2020 ) , given a batch of N samples we can estimate the objective in equation 9 as : îf ( X ; Y ) = 1 N N∑ i=1 f ′ ◦Gσ ( ‖xgi − y g i ‖ 2 ) − 1 N ( N−1 ) ∑ i 6=j f∗ ◦ f ′ ◦Gσ ( ‖xgi − x g j‖ 2 ) , ( 10 ) where xi and yi are two different kinds of data augmentation of the i-th sample , and xi and xj are different samples of the same kind of data augmentation . With the objective in equation 10 we propose our algorithm for contrastive learning in Algorithm 1 . Note that we treat µ and σ2 in our Gaussian kernel equation 7 as hyperparameters . To balance the two terms in our objective , we additionally include a weighting parameter α in front of the second term . We can prove that rescaling the second term with the factor α is equivalent to changing the function f to another convex function fα ( see Prop . 7 in Appendix A ) .
This paper makes two contributions to contrastive representation learning: 1. Using the more general f-mutual information rather than using Shannon mutual information for contrastive learning 2. Experimental results to compare the possible options given the new design freedom.
SP:70798a8a2ed7aa45026eb72de35d1029aee6ca64
$f$-Mutual Information Contrastive Learning
1 INTRODUCTION . Contrastive learning has attracted a surge of attention recently due to its success in learning informative representation for image recognition , natural language understanding , and reinforcement learning ( Chen et al. , 2020 ; He et al. , 2020 ; Logeswaran & Lee , 2018 ; Srinivas et al. , 2020 ) . Such learning paradigm is fully unsupervised by encouraging the contrastiveness between similar and dissimilar sample pairs . Specifically , the feature embeddings of similar sample pairs are expected to be close while those of dissimilar sample pairs are expected to be far apart . To attain this goal , a softmax cross-entropy loss , a.k.a . InfoNCE , has been widely used ( Wu et al. , 2018 ; van den Oord et al. , 2018 ; Chen et al. , 2020 ; Hénaff et al. , 2020 ; He et al. , 2020 ) , which aims to maximize the probability of picking a similar sample pair among a batch of sample pairs . InfoNCE can be interpreted as a lower bound of the mutual information ( MI ) between two views of data samples ( van den Oord et al. , 2018 ; Bachman et al. , 2019 ; Tian et al. , 2020a ; Tschannen et al. , 2020 ) . This explanation is consistent with the well-known “ InfoMax principle ” ( Linsker , 1988 ) . Nevertheless , it has been shown that maximizing a tighter bound on the MI can result in worse representations ( Tschannen et al. , 2020 ) ; and reducing the MI between views while only keeping task-relevant information can improve the downstream performance ( Tian et al. , 2020b ) . These observations suggest that maximizing the MI may be insufficient in contrastive learning and thus a better objective design is required . To attain the aforementioned goal , we propose a novel contrastive learning framework , coined as f -MICL . In a nutshell , leveraging the fact that MI can be formulated as the Kullback–Leibler ( KL ) divergence between the joint distribution and the product of the marginal distributions , we replace the KL divergence with the general f -divergence family ( Ali & Silvey , 1966 ; Csiszár , 1967 ) . Doing so , we obtain a generalization of mutual information , called f -mutual information ( f -MI , Csiszár , 1967 ) . Notably , by maximizing a lower bound of f -mutual information we naturally decompose the objective function into two terms , which correspond to the properties of the alignment and the uniformity . Such characterization has been revealed in Wang & Isola ( 2020 , Theorem 1 ) for the InfoNCE loss . Compared with Wang & Isola ( 2020 ) , our result applies to a wide range of the f - divergence family such as KL , Jensen–Shannon ( JS ) , Pearson χ2 and Vincze–Le Cam . and it does not rely on the limit of an infinite number of dissimilar samples . This allows us to explore the space of f -MI and improve the performance of InfoNCE-based contrastive learning . The similarity function is crucial for the evaluation of the contrastiveness of similar and dissimilar sample pairs . Commonly used similarity functions include the cosine similarity ( Chen et al. , 2020 ; He et al. , 2020 ) , the bilinear functions ( van den Oord et al. , 2018 ; Tian et al. , 2020a ; Hénaff et al. , 2020 ) , and the neural network based scores ( Hjelm et al. , 2018 ) . While most aforementioned similarity functions for contrastive learning are heuristic and pre-designed , in this work , we provide a principled way to design the similarity function . By assuming that the joint feature distribution of two similar samples is proportional to a Gaussian kernel , we derive an optimal similarity function for practical use , which resembles the well-known radial basis functions ( Powell , 1987 ) . Figure 1 gives a high-level summary of our f -MICL framework . Given a batch of samples ( e.g. , images ) we generate positive pairs via data augmentation and negative pairs using other augmented samples in the current batch . With the optimization of our f -mutual information objective the positive pairs are aligned with each other and the data representations are uniformly distributed . Our contributions can be summarized as follows : • We propose a novel framework for contrastive learning ( called f -MICL ) by encouraging the contrastiveness of positive and negative pairs with a general f -divergence family . • With an assumption on the joint feature distribution we provide an optimal design for the similarity function with Gaussian kernels , which shows interesting connection between contrastive learning and kernel methods . • We characterize the properties of alignment and uniformity for f -MICL and provide guidance on choosing proper f -divergences . Our f -MICL objective can be estimated with finite samples and we give the corresponding error bound . • Experimentally , our framework is better or on par with popular baselines , by simply replacing , e.g. , the InfoNCE loss function with our theoretically grounded f -MICL objectives . Notations We assume a dominating measure λ ( e.g . Lebesgue ) is given and all other probability measures are represented as some density w.r.t . λ . We denote Df ( p‖q ) as the f -divergence between two densities functions p and q . Given the joint density p ( x , y ) , we denote p ( x ) = ∫ p ( x , y ) dλ ( y ) and p ( y ) = ∫ p ( x , y ) dλ ( x ) as the marginals . We use supp ( · ) to denote the support of a distribution , and f∗ to denote the Fenchel conjugate of a convex function f . Every norm presented is Euclidean . 2 PRELIMINARIES . We provide some preliminaries for our framework in the context of contrastive learning . Contrastive learning is a popular unsupervised method for learning data representations . In contrastive learning , we expect that similar sample pairs to be close to each other in the embedding space while uncorrelated pairs to be far away . Denote ppos as the distribution of positive pairs , i.e. , two samples that have similar representations . Assume that this distribution is symmetric w.r.t . the two random variables , then the resultant two marginals both follow the data distribution pdata ( Wang & Isola , 2020 ) . In this work we propose the f -mutual information framework for contrastive learning . First recall the f -mutual information ( f -MI ) between a pair of random variables X and Y : Definition 1 ( f -mutual information , Csiszár 1967 ) . Consider a pair of random variables ( X , Y ) with density function p ( x , y ) . The f -mutual information If between X and Y is defined as If ( X ; Y ) : = Df ( p ( x , y ) ‖p ( x ) p ( y ) ) = ∫ f ( p ( x , y ) p ( x ) p ( y ) ) p ( x ) p ( y ) · dλ ( x , y ) , ( 1 ) where f : R+ → R is ( closed ) convex with f ( 1 ) = 0 , and recall that p ( x ) and p ( y ) are the marginal densities of p ( x , y ) , whereas λ is a dominating measure ( e.g . Lebesgue ) . Common choices of f can be found in Table 1 and Table 4 ( Appendix A ) , which we will discuss in more details in §3 . It is well-known that f -mutual information is non-negative and symmetric , and provided that f is strictly convex , If ( X ; Y ) = 0 iff X and Y are independent ( Ali & Silvey , 1966 ) . When X and Y are of high dimension , it is quite challenging to estimate the f -divergence directly . Instead , Nguyen et al . ( 2010 ) derived a variational method by maximizing the dual problem : If ( X ; Y ) ≥ sup T∈T if ( X ; Y ) : = E ( x , y ) ∼ppos [ T ( x , y ) ] − E ( x , y ) ∼pdata⊗pdata [ f ∗ ( T ( x , y ) ) ] , ( 2 ) where f∗ ( t ) : = supx∈R+ ( xt − f ( x ) ) is the ( monotone ) Fenchel conjugate of f , and is always monotonically increasing . Here T is a class of functions T : supp ( pdata ) × supp ( pdata ) → dom f∗ . Nguyen et al . ( 2010 ) showed that the bound in eq . ( 2 ) is tight if there exists T ∗ ∈ T such that T ∗ ( x , y ) = f ′ ( p ( x , y ) / ( p ( x ) p ( y ) ) ) , for any ( x , y ) ∈ supp ( pdata ) × supp ( pdata ) , ( 3 ) and in particular , if T comprises of all ( measurable ) functions . 3 DESIGN OF f -MICL Based on the f -MI introduced in §2 , we propose a novel framework for contrastive learning . Furthermore , we characterize the properties of alignment and uniformity theoretically for general f - divergences . Following Chen et al . ( 2020 ) , we design the strcture of function T as follows : T ( x , y ) : = k ( g ( x ) , g ( y ) ) , where ‖g ( x ) ‖ = 1 for any sample x . ( 4 ) The function g produces a d-dimensional normalized feature encoding on the hypersphere Sd−1 and k is a similarity function that measures the similarity between two embeddings g ( x ) and g ( y ) . With the above interpretation , we can rewrite our objective of f -mutual information , equation 2 , as : sup g∈G , k∈K if ( X ; Y ) : = E ( x , y ) ∼ppos [ k ( g ( x ) , g ( y ) ) ] − E ( x , y ) ∼pdata⊗pdata [ f ∗ ( k ( g ( x ) , g ( y ) ) ) ] , ( 5 ) where G andK are the function classes of the feature encoder g and the similarity function k. We can treat the first term as the similarity score between positive pairs in the feature space , and the second term as the similarity score between two random samples , a.k.a . negative pairs , in the feature space . As f∗ is increasing , maximizing f -MI is equivalent to simultaneously maximizing the similarity between positive pairs and minimizing the similarity between negative pairs . 3.1 OPTIMIZED SIMILARITY FUNCTION AND IMPLEMENTATION . Let us now study how to search for the optimal similarity function k. To our best knowledge , there has been no theoretical study on the choice of similarity functions . Most existing contrastive learning methods ( e.g . Chen et al. , 2020 ; Tsai et al. , 2020 ; He et al. , 2020 ) adopt a pre-designed similarity function , such as the cosine similarity . For the ease of notation , from now on we define xg : = g ( x ) and yg : = g ( y ) . Suppose ( x , y ) ∼ ppos , then we denote pgpos as the distribution of ( xg , yg ) , and p g data as the marginal feature distribution of xg or yg . The corresponding density functions are written as pg ( x g ) , pg ( y g ) and pg ( xg , yg ) . We remind the reader of the following result : Lemma 2 ( e.g. , Nguyen et al . 2010 , Lemma 1 ) . Suppose f is differentiable , and the encoder function g is fixed . The similarity function k∗ ( xg , yg ) = f ′ ( pg ( x g , yg ) pg ( xg ) pg ( yg ) ) ( 6 ) maximizes if ( X ; Y ) in eq . ( 5 ) as long as it is contained in the function class K. Equation 6 provides an optimal similarity function , which nevertheless depends on the density functions . Comparing equation 6 with equation 5 , we realize that the optimal k∗ in fact gives the f -MI on the feature space , If ( g ( X ) , g ( Y ) ) , which is a low bound of the original f -MI , If ( X ; Y ) . To use k∗ practically we make the following assumption on the joint density : Assumption 3 . The joint feature distribution is proportional to a radial basis function ( RBF ) , i.e. , pg ( x g , yg ) ∝ ϕ ( ‖xg − yg‖2 ) for a real-valued function ϕ . Radial basis functions are widely used in kernel methods ( Powell , 1987 ; Murphy , 2012 ) , and the Gaussian kernel is perhaps the most well-known RBF . Throughout this work we mainly consider ϕ as a Gaussian kernel : ϕ ( ‖xg − yg‖2 ) = Gσ ( ‖xg − yg‖2 ) : = µ exp ( −‖x g − yg‖2 2σ2 ) , ( 7 ) with µ a constant left to be determined . Fixing yg , then pg ( · , yg ) is known as the von Mises–Fisher distribution ( von Mises , 1918 ; Fisher , 1953 ; Bingham & Mardia , 1975 ) , since xg and yg are unit vectors . With Assumption 3 on the joint density , the resultant marginal feature distribution pgdata is uniform on the hypersphere Sd−1 , where d is the dimension of the feature space ( see Prop . 8 in App . B ) . Additionally , for positive pairs the distance in the feature space , ‖xg − yg‖ , is more likely to be small . If the variance σ2 → 0 , then the Gaussian kernel becomes the Dirac delta distribution , δxg=yg . This requires that the two features xg and yg to be the same , which is desirable . In general , the radial basis function ϕ should be decreasing since a positive pair should be more likely to be adjacent in the feature space . For example , with ϕ ( t ) = 1− t/2 we obtain the cosine similarity . Based on Assumption 3 we propose the following similarity function between pairs of features : Theorem 4 ( Gaussian similarity ) . Under Assumption 3 with Gaussian kernels and the same settings as Lemma 2 , the optimal similarity function k∗ satisfies that for any xg , yg ∈ Sd−1 : k∗ ( xg , yg ) = f ′ ( CGσ ( ‖xg − yg‖2 ) ) , ( 8 ) where d is the feature dimension and C is an absolute constant . For simplicity we will rewrite k∗ ( xg , yg ) = f ′ ◦ Gσ ( ‖xg − yg‖2 ) by absorbing the constant C into Gσ , since we have left some flexibility in equation 7 . Although Assumption 3 with Gaussian kernels may not always reflect the real feature distribution , we can still use the similarity function in equation 8 , even if it might not be optimal . In our experiments in §5 , the Gaussian similarity equation 8 consistently outperforms the default cosine similarity in contrastive learning . Algorithm 1 : f -mutual information contrastive learning ( f -MICL ) Input : batch size N , function f , weighting parameter α , constant µ ( in Gσ ) , variance σ2 , optimizer 1 for each batch { zi } Ni=1 do 2 forall k ∈ [ 1 , N ] do 3 randomly sample two augmentation functions t1 , t2 4 yk ← t1 ( zk ) , xk ← t2 ( zk ) 5 compute if = 1N ∑N i=1 [ f ′ ◦Gσ ( ‖xgi − y g i ‖2 ) ] − αN ( N−1 ) ∑ i6=j f ∗ ◦ f ′ ◦Gσ ( ‖xgi − x g j‖ ) 6 update g by taking a step to maximizing if using the optimizer Bringing the optimal k∗ in equation 8 into our objective equation 5 we have the following objective : sup g∈G E ( x , y ) ∼ppos [ f ′ ◦Gσ ( ‖xg − yg‖2 ) ] − E ( x , y ) ∼pdata⊗pdata [ f∗ ◦ f ′ ◦Gσ ( ‖xg − yg‖2 ) ] , ( 9 ) where Gσ is defined in equation 7 . With a similar sampling method of positive and negative pairs in Chen et al . ( 2020 ) , given a batch of N samples we can estimate the objective in equation 9 as : îf ( X ; Y ) = 1 N N∑ i=1 f ′ ◦Gσ ( ‖xgi − y g i ‖ 2 ) − 1 N ( N−1 ) ∑ i 6=j f∗ ◦ f ′ ◦Gσ ( ‖xgi − x g j‖ 2 ) , ( 10 ) where xi and yi are two different kinds of data augmentation of the i-th sample , and xi and xj are different samples of the same kind of data augmentation . With the objective in equation 10 we propose our algorithm for contrastive learning in Algorithm 1 . Note that we treat µ and σ2 in our Gaussian kernel equation 7 as hyperparameters . To balance the two terms in our objective , we additionally include a weighting parameter α in front of the second term . We can prove that rescaling the second term with the factor α is equivalent to changing the function f to another convex function fα ( see Prop . 7 in Appendix A ) .
This paper proposes the f-mutual information objective for contrastive learning, which generalizes the existing mutual information framework. Theoretically, it makes a connection with alignment and uniformity in Wang & Isola (2020) when the joint feature distribution can be represented by a radial basis function, and derives its estimation error. Numerically, it demonstrates the efficacy of f-mutual information with Gaussian similarity.
SP:70798a8a2ed7aa45026eb72de35d1029aee6ca64
$f$-Mutual Information Contrastive Learning
1 INTRODUCTION . Contrastive learning has attracted a surge of attention recently due to its success in learning informative representation for image recognition , natural language understanding , and reinforcement learning ( Chen et al. , 2020 ; He et al. , 2020 ; Logeswaran & Lee , 2018 ; Srinivas et al. , 2020 ) . Such learning paradigm is fully unsupervised by encouraging the contrastiveness between similar and dissimilar sample pairs . Specifically , the feature embeddings of similar sample pairs are expected to be close while those of dissimilar sample pairs are expected to be far apart . To attain this goal , a softmax cross-entropy loss , a.k.a . InfoNCE , has been widely used ( Wu et al. , 2018 ; van den Oord et al. , 2018 ; Chen et al. , 2020 ; Hénaff et al. , 2020 ; He et al. , 2020 ) , which aims to maximize the probability of picking a similar sample pair among a batch of sample pairs . InfoNCE can be interpreted as a lower bound of the mutual information ( MI ) between two views of data samples ( van den Oord et al. , 2018 ; Bachman et al. , 2019 ; Tian et al. , 2020a ; Tschannen et al. , 2020 ) . This explanation is consistent with the well-known “ InfoMax principle ” ( Linsker , 1988 ) . Nevertheless , it has been shown that maximizing a tighter bound on the MI can result in worse representations ( Tschannen et al. , 2020 ) ; and reducing the MI between views while only keeping task-relevant information can improve the downstream performance ( Tian et al. , 2020b ) . These observations suggest that maximizing the MI may be insufficient in contrastive learning and thus a better objective design is required . To attain the aforementioned goal , we propose a novel contrastive learning framework , coined as f -MICL . In a nutshell , leveraging the fact that MI can be formulated as the Kullback–Leibler ( KL ) divergence between the joint distribution and the product of the marginal distributions , we replace the KL divergence with the general f -divergence family ( Ali & Silvey , 1966 ; Csiszár , 1967 ) . Doing so , we obtain a generalization of mutual information , called f -mutual information ( f -MI , Csiszár , 1967 ) . Notably , by maximizing a lower bound of f -mutual information we naturally decompose the objective function into two terms , which correspond to the properties of the alignment and the uniformity . Such characterization has been revealed in Wang & Isola ( 2020 , Theorem 1 ) for the InfoNCE loss . Compared with Wang & Isola ( 2020 ) , our result applies to a wide range of the f - divergence family such as KL , Jensen–Shannon ( JS ) , Pearson χ2 and Vincze–Le Cam . and it does not rely on the limit of an infinite number of dissimilar samples . This allows us to explore the space of f -MI and improve the performance of InfoNCE-based contrastive learning . The similarity function is crucial for the evaluation of the contrastiveness of similar and dissimilar sample pairs . Commonly used similarity functions include the cosine similarity ( Chen et al. , 2020 ; He et al. , 2020 ) , the bilinear functions ( van den Oord et al. , 2018 ; Tian et al. , 2020a ; Hénaff et al. , 2020 ) , and the neural network based scores ( Hjelm et al. , 2018 ) . While most aforementioned similarity functions for contrastive learning are heuristic and pre-designed , in this work , we provide a principled way to design the similarity function . By assuming that the joint feature distribution of two similar samples is proportional to a Gaussian kernel , we derive an optimal similarity function for practical use , which resembles the well-known radial basis functions ( Powell , 1987 ) . Figure 1 gives a high-level summary of our f -MICL framework . Given a batch of samples ( e.g. , images ) we generate positive pairs via data augmentation and negative pairs using other augmented samples in the current batch . With the optimization of our f -mutual information objective the positive pairs are aligned with each other and the data representations are uniformly distributed . Our contributions can be summarized as follows : • We propose a novel framework for contrastive learning ( called f -MICL ) by encouraging the contrastiveness of positive and negative pairs with a general f -divergence family . • With an assumption on the joint feature distribution we provide an optimal design for the similarity function with Gaussian kernels , which shows interesting connection between contrastive learning and kernel methods . • We characterize the properties of alignment and uniformity for f -MICL and provide guidance on choosing proper f -divergences . Our f -MICL objective can be estimated with finite samples and we give the corresponding error bound . • Experimentally , our framework is better or on par with popular baselines , by simply replacing , e.g. , the InfoNCE loss function with our theoretically grounded f -MICL objectives . Notations We assume a dominating measure λ ( e.g . Lebesgue ) is given and all other probability measures are represented as some density w.r.t . λ . We denote Df ( p‖q ) as the f -divergence between two densities functions p and q . Given the joint density p ( x , y ) , we denote p ( x ) = ∫ p ( x , y ) dλ ( y ) and p ( y ) = ∫ p ( x , y ) dλ ( x ) as the marginals . We use supp ( · ) to denote the support of a distribution , and f∗ to denote the Fenchel conjugate of a convex function f . Every norm presented is Euclidean . 2 PRELIMINARIES . We provide some preliminaries for our framework in the context of contrastive learning . Contrastive learning is a popular unsupervised method for learning data representations . In contrastive learning , we expect that similar sample pairs to be close to each other in the embedding space while uncorrelated pairs to be far away . Denote ppos as the distribution of positive pairs , i.e. , two samples that have similar representations . Assume that this distribution is symmetric w.r.t . the two random variables , then the resultant two marginals both follow the data distribution pdata ( Wang & Isola , 2020 ) . In this work we propose the f -mutual information framework for contrastive learning . First recall the f -mutual information ( f -MI ) between a pair of random variables X and Y : Definition 1 ( f -mutual information , Csiszár 1967 ) . Consider a pair of random variables ( X , Y ) with density function p ( x , y ) . The f -mutual information If between X and Y is defined as If ( X ; Y ) : = Df ( p ( x , y ) ‖p ( x ) p ( y ) ) = ∫ f ( p ( x , y ) p ( x ) p ( y ) ) p ( x ) p ( y ) · dλ ( x , y ) , ( 1 ) where f : R+ → R is ( closed ) convex with f ( 1 ) = 0 , and recall that p ( x ) and p ( y ) are the marginal densities of p ( x , y ) , whereas λ is a dominating measure ( e.g . Lebesgue ) . Common choices of f can be found in Table 1 and Table 4 ( Appendix A ) , which we will discuss in more details in §3 . It is well-known that f -mutual information is non-negative and symmetric , and provided that f is strictly convex , If ( X ; Y ) = 0 iff X and Y are independent ( Ali & Silvey , 1966 ) . When X and Y are of high dimension , it is quite challenging to estimate the f -divergence directly . Instead , Nguyen et al . ( 2010 ) derived a variational method by maximizing the dual problem : If ( X ; Y ) ≥ sup T∈T if ( X ; Y ) : = E ( x , y ) ∼ppos [ T ( x , y ) ] − E ( x , y ) ∼pdata⊗pdata [ f ∗ ( T ( x , y ) ) ] , ( 2 ) where f∗ ( t ) : = supx∈R+ ( xt − f ( x ) ) is the ( monotone ) Fenchel conjugate of f , and is always monotonically increasing . Here T is a class of functions T : supp ( pdata ) × supp ( pdata ) → dom f∗ . Nguyen et al . ( 2010 ) showed that the bound in eq . ( 2 ) is tight if there exists T ∗ ∈ T such that T ∗ ( x , y ) = f ′ ( p ( x , y ) / ( p ( x ) p ( y ) ) ) , for any ( x , y ) ∈ supp ( pdata ) × supp ( pdata ) , ( 3 ) and in particular , if T comprises of all ( measurable ) functions . 3 DESIGN OF f -MICL Based on the f -MI introduced in §2 , we propose a novel framework for contrastive learning . Furthermore , we characterize the properties of alignment and uniformity theoretically for general f - divergences . Following Chen et al . ( 2020 ) , we design the strcture of function T as follows : T ( x , y ) : = k ( g ( x ) , g ( y ) ) , where ‖g ( x ) ‖ = 1 for any sample x . ( 4 ) The function g produces a d-dimensional normalized feature encoding on the hypersphere Sd−1 and k is a similarity function that measures the similarity between two embeddings g ( x ) and g ( y ) . With the above interpretation , we can rewrite our objective of f -mutual information , equation 2 , as : sup g∈G , k∈K if ( X ; Y ) : = E ( x , y ) ∼ppos [ k ( g ( x ) , g ( y ) ) ] − E ( x , y ) ∼pdata⊗pdata [ f ∗ ( k ( g ( x ) , g ( y ) ) ) ] , ( 5 ) where G andK are the function classes of the feature encoder g and the similarity function k. We can treat the first term as the similarity score between positive pairs in the feature space , and the second term as the similarity score between two random samples , a.k.a . negative pairs , in the feature space . As f∗ is increasing , maximizing f -MI is equivalent to simultaneously maximizing the similarity between positive pairs and minimizing the similarity between negative pairs . 3.1 OPTIMIZED SIMILARITY FUNCTION AND IMPLEMENTATION . Let us now study how to search for the optimal similarity function k. To our best knowledge , there has been no theoretical study on the choice of similarity functions . Most existing contrastive learning methods ( e.g . Chen et al. , 2020 ; Tsai et al. , 2020 ; He et al. , 2020 ) adopt a pre-designed similarity function , such as the cosine similarity . For the ease of notation , from now on we define xg : = g ( x ) and yg : = g ( y ) . Suppose ( x , y ) ∼ ppos , then we denote pgpos as the distribution of ( xg , yg ) , and p g data as the marginal feature distribution of xg or yg . The corresponding density functions are written as pg ( x g ) , pg ( y g ) and pg ( xg , yg ) . We remind the reader of the following result : Lemma 2 ( e.g. , Nguyen et al . 2010 , Lemma 1 ) . Suppose f is differentiable , and the encoder function g is fixed . The similarity function k∗ ( xg , yg ) = f ′ ( pg ( x g , yg ) pg ( xg ) pg ( yg ) ) ( 6 ) maximizes if ( X ; Y ) in eq . ( 5 ) as long as it is contained in the function class K. Equation 6 provides an optimal similarity function , which nevertheless depends on the density functions . Comparing equation 6 with equation 5 , we realize that the optimal k∗ in fact gives the f -MI on the feature space , If ( g ( X ) , g ( Y ) ) , which is a low bound of the original f -MI , If ( X ; Y ) . To use k∗ practically we make the following assumption on the joint density : Assumption 3 . The joint feature distribution is proportional to a radial basis function ( RBF ) , i.e. , pg ( x g , yg ) ∝ ϕ ( ‖xg − yg‖2 ) for a real-valued function ϕ . Radial basis functions are widely used in kernel methods ( Powell , 1987 ; Murphy , 2012 ) , and the Gaussian kernel is perhaps the most well-known RBF . Throughout this work we mainly consider ϕ as a Gaussian kernel : ϕ ( ‖xg − yg‖2 ) = Gσ ( ‖xg − yg‖2 ) : = µ exp ( −‖x g − yg‖2 2σ2 ) , ( 7 ) with µ a constant left to be determined . Fixing yg , then pg ( · , yg ) is known as the von Mises–Fisher distribution ( von Mises , 1918 ; Fisher , 1953 ; Bingham & Mardia , 1975 ) , since xg and yg are unit vectors . With Assumption 3 on the joint density , the resultant marginal feature distribution pgdata is uniform on the hypersphere Sd−1 , where d is the dimension of the feature space ( see Prop . 8 in App . B ) . Additionally , for positive pairs the distance in the feature space , ‖xg − yg‖ , is more likely to be small . If the variance σ2 → 0 , then the Gaussian kernel becomes the Dirac delta distribution , δxg=yg . This requires that the two features xg and yg to be the same , which is desirable . In general , the radial basis function ϕ should be decreasing since a positive pair should be more likely to be adjacent in the feature space . For example , with ϕ ( t ) = 1− t/2 we obtain the cosine similarity . Based on Assumption 3 we propose the following similarity function between pairs of features : Theorem 4 ( Gaussian similarity ) . Under Assumption 3 with Gaussian kernels and the same settings as Lemma 2 , the optimal similarity function k∗ satisfies that for any xg , yg ∈ Sd−1 : k∗ ( xg , yg ) = f ′ ( CGσ ( ‖xg − yg‖2 ) ) , ( 8 ) where d is the feature dimension and C is an absolute constant . For simplicity we will rewrite k∗ ( xg , yg ) = f ′ ◦ Gσ ( ‖xg − yg‖2 ) by absorbing the constant C into Gσ , since we have left some flexibility in equation 7 . Although Assumption 3 with Gaussian kernels may not always reflect the real feature distribution , we can still use the similarity function in equation 8 , even if it might not be optimal . In our experiments in §5 , the Gaussian similarity equation 8 consistently outperforms the default cosine similarity in contrastive learning . Algorithm 1 : f -mutual information contrastive learning ( f -MICL ) Input : batch size N , function f , weighting parameter α , constant µ ( in Gσ ) , variance σ2 , optimizer 1 for each batch { zi } Ni=1 do 2 forall k ∈ [ 1 , N ] do 3 randomly sample two augmentation functions t1 , t2 4 yk ← t1 ( zk ) , xk ← t2 ( zk ) 5 compute if = 1N ∑N i=1 [ f ′ ◦Gσ ( ‖xgi − y g i ‖2 ) ] − αN ( N−1 ) ∑ i6=j f ∗ ◦ f ′ ◦Gσ ( ‖xgi − x g j‖ ) 6 update g by taking a step to maximizing if using the optimizer Bringing the optimal k∗ in equation 8 into our objective equation 5 we have the following objective : sup g∈G E ( x , y ) ∼ppos [ f ′ ◦Gσ ( ‖xg − yg‖2 ) ] − E ( x , y ) ∼pdata⊗pdata [ f∗ ◦ f ′ ◦Gσ ( ‖xg − yg‖2 ) ] , ( 9 ) where Gσ is defined in equation 7 . With a similar sampling method of positive and negative pairs in Chen et al . ( 2020 ) , given a batch of N samples we can estimate the objective in equation 9 as : îf ( X ; Y ) = 1 N N∑ i=1 f ′ ◦Gσ ( ‖xgi − y g i ‖ 2 ) − 1 N ( N−1 ) ∑ i 6=j f∗ ◦ f ′ ◦Gσ ( ‖xgi − x g j‖ 2 ) , ( 10 ) where xi and yi are two different kinds of data augmentation of the i-th sample , and xi and xj are different samples of the same kind of data augmentation . With the objective in equation 10 we propose our algorithm for contrastive learning in Algorithm 1 . Note that we treat µ and σ2 in our Gaussian kernel equation 7 as hyperparameters . To balance the two terms in our objective , we additionally include a weighting parameter α in front of the second term . We can prove that rescaling the second term with the factor α is equivalent to changing the function f to another convex function fα ( see Prop . 7 in Appendix A ) .
This paper proposed to combine contrastive learning with $f$-divergence, which naturally attains the alignment for positive pairs and the uniformity for data representations. The authors provided some theoretical results on choosing the correct function f and the upper bound of the estimation error. Finally, the authors carried out extensive experimental results to validate the effectiveness of the method.
SP:70798a8a2ed7aa45026eb72de35d1029aee6ca64
Incremental False Negative Detection for Contrastive Learning
1 INTRODUCTION . Self-supervised learning of visual representation ( Doersch et al. , 2015 ; Pathak et al. , 2016 ; Noroozi & Favaro , 2016 ; Oord et al. , 2018 ; Gidaris et al. , 2018 ; Chen et al. , 2020a ) aims to learn a semanticaware embedding space based on the image data without the supervision of human-labeled annotations . Recently , significant advances have been made by contrastive learning approaches ( Hjelm et al. , 2019 ; Tian et al. , 2019 ; Chen et al. , 2020b ; c ; He et al. , 2020 ; Chen et al. , 2020d ) to reduce the performance gap with the supervised counterparts . Most unsupervised contrastive learning methods are developed based on the instance discrimination assumption . These approaches treat each training image as an individual instance and learn the representations that discriminate every single sample . Specifically , considering an arbitrary image as an anchor , the only positive sample is generated by applying a different data augmentation to the anchor image , while all other images are treated as negative samples . The training objective is to attract the positive to the anchor while repelling the negative samples from the anchor . While instance-level contrastive learning has shown impressive performance , these methods do not take the semantic relationship among images into consideration . Although some images share similar semantic concepts with the anchor , they are still considered as negative samples and are equally pushed away from the anchor with all other negatives . We define these samples as “ false negatives ” in self-supervised contrastive learning , which would adversely affect the representation learning ( Saunshi et al. , 2019 ) . One might argue that such undesirable effects might be minor for the datasets with diverse semantic concepts since the probabilities of drawing false negatives are relatively low . However , as shown in Figure 1 , we empirically find the opposite results that the performance drops due to training with false negative samples are more significant on large-scale datasets with more semantic categories . These results bring up the issue of instance-level contrastive learning when it is applied to datasets with more complex semantic contents . Figure 1 : Effect of false negative for contrastive learning . To study the effect of false negatives , we compare two frameworks : SimCLR ( Chen et al . ( 2020b ) , blue ) representing instance-level contrastive learning which is trained with false negatives , and SupCon ( Khosla et al . ( 2020 ) , red ) benefiting from human-labeled annotations to exclude false negatives . We observe that training with false negatives leads to larger performance gaps ( orange ) on the datasets with more semantic categories . The proposed approach ( green ) effectively alleviates such adverse effects by explicitly removing the detected false negatives for self-supervised contrastive learning . See Section 4.3 for experimental details . To handle the false negative issue , we propose a novel framework to incrementally detect and explicitly remove false negatives for self-supervised contrastive learning . During training , we cluster samples in the embedding space and assign the cluster indices as the pseudo labels to the training images . Instances with an identical label to the anchor are then detected as false negatives . However , we notice that the pseudo labels generated in the earlier training stages are comparably unreliable to represent the semantic relationship among instances since the semantic structure of the embedding space is still under development . Therefore , we propose a novel strategy to assign the pseudo labels in an incremental manner . In the early training stage , we only use a small portion of pseudo labels with higher confidence while treating other samples as individual instances . In the later training stage , as the pseudo labels become more reliable , we dynamically include more confident labels to detect and remove false negatives and hence , can benefit semantic-aware representation learning . Furthermore , we discuss two types of training objectives to explicitly address the detected false negatives during contrastive learning : elimination and attraction . We theoretically show that they are the generalization of triplet loss ( Schroff et al. , 2015 ) . While both objectives avoid discriminating the anchor and its false negatives , the attraction objective further minimizes the distances between them . Empirically , we find that such a more aggressive strategy is less tolerant to noisy pseudo labels and unsuitable to our self-supervised framework . The main contributions of this paper are summarized as follows : • We highlight the issue of false negatives in contrastive learning , especially on the largescale datasets with more diverse semantic contents . • We propose a novel contrastive learning framework with incremental false negative detection ( IFND ) that smoothly bridges instance-level and semantic-aware contrastive learning . Our approach explicitly detects and incrementally removes false negatives as the embedding space becomes more semantically structural through the training process . • Our approach performs favorably against the existing self-supervised contrastive learning frameworks on multiple benchmarks under a limited training resource setup . Besides , we introduce two metrics : mean true positive/negative rates to evaluate the clustering quality . 2 RELATED WORK . Instance-level contrastive learning . Learning semantic-aware visual representation without human supervision is an essential but challenging task . Numerous approaches are developed based on the instance discrimination task ( Dosovitskiy et al. , 2015 ; Wu et al. , 2018 ; Ye et al. , 2019 ; Misra & Maaten , 2020 ) , where each instance in the dataset is treated as an individual sample and a representation is learned to classify or contrastively separate samples . Recently , with the contrastive loss ( Gutmann & Hyvärinen , 2010 ) and a set of image transformations or augmentations ( Chen et al. , 2020b ) , the instance-level contrastive learning methods ( Hjelm et al. , 2019 ; Tian et al. , 2019 ; Chen et al. , 2020b ; c ; He et al. , 2020 ; Chen et al. , 2020d ) achieve state-of-the-art results and even outperform some supervised pre-training approaches . While significant improvement is achieved , instance-level contrastive learning frameworks typically do not take high-level semantics into ac- count . For example , any two samples in the dataset would be considered as a negative pair and be pushed apart by the contrastive loss although some of them are semantically similar and should be nearby in the embedding space . Especially when the huge amounts of negative samples ( 8192 for Chen et al . ( 2020b ) , 65536 for He et al . ( 2020 ) ) play a critical role in the success of contrastive learning , these instance-level approaches inevitably draw some “ false negatives ” and learn less effective representation models as shown by a recent study ( Saunshi et al. , 2019 ) . In this paper , we further show that the performance gap between the contrastive learning trained with and without false negatives is more significant on the datasets with more semantic classes . Semantic-aware contrastive learning . To address the limitation of instance-level contrastive learning , several methods are developed to exploit the semantic relationship among images . Chuang et al . ( 2020 ) show that the original instance-level sampling strategy includes a sampling bias and propose a debiased contrastive loss . However , this method does not explicitly handle false negative samples . Huynh et al . ( 2020 ) determine false negatives of an anchor by finding top k similar samples without referring to global embedding distribution . Khosla et al . ( 2020 ) propose a supervised contrastive loss that utilizes label information and treats images of the same class ( i.e. , false negatives ) as positives . However , manually annotated labels can not be acquired in the unsupervised setting . Closely related to our method , PCL ( Li et al. , 2021 ) discovers the representative prototypes for each semantic concept and encourages an image embedding to be closer to its belonging prototype . There are two fundamental differences between PCL and the proposed method : a ) PCL uses all assigned prototypes regardless of inferior clustering results in early stages , which can not properly reflect the semantic relationship among images , b ) without treating semantically similar samples as false negatives , PCL applies instance-level InfoNCE loss ( Oord et al. , 2018 ) as the primary supervision , which fails to avoid the images within the same prototype being pushed apart . In contrast , leveraging the progressive detection and explicit removal of false negatives , our framework achieves greater clustering quality and representation learning . More comparisons are in Section 4.2 and Appendix E. Clustering for deep unsupervised learning . A few unsupervised learning methods have recently benefited from clustering techniques to construct more effective representation models ( Caron et al. , 2018 ; Yang et al. , 2016 ; Xie et al. , 2016 ; Caron et al. , 2019 ; Zhuang et al. , 2019 ; Asano et al. , 2020 ) . The main idea is to use cluster indices as pseudo labels and learn visual representations in a supervised manner . However , most existing methods require all pseudo labels to optimize the supervised loss , e.g. , cross-entropy . In this work , we show that the pseudo labels obtained in earlier training processes are relatively unreliable , and the full adoption of pseudo labels in the early stage would further disrupt the representation learning . To handle this issue , we incorporate instance-level learning with clustering which allows us to only use a set of pseudo labels with sufficient confidence while treating the others as individual instances . 3 METHODOLOGY . 3.1 INSTANCE-LEVEL CONTRASTIVE LEARNING . An instance-level contrastive learning method learns a representation that discriminates one sample from every other . Given M randomly sampled images from a training set X , a contrastive training mini-batch I consists of 2M images obtained by applying two sets of data augmentation on each sampled image . For any anchor image i ∈ I , the only positive sample is another view ( or transformation ) of the same image , denoted as i′ , while the other 2 ( M − 1 ) images jointly constitute the set of negative samples N ( i ) . The instance-level discrimination is then optimized by the following contrastive loss : Linst = ∑ i∈I − log sim ( zi , zi ′ ) ∑ s∈S ( i ) sim ( zi , zs ) , S ( i ) ≡ { i′ , n | n ∈ N ( i ) } , ( 1 ) where zi = g ( f ( i ) ) is the embedding of the image i from an encoder f and a projection head g , sim ( u , v ) = exp ( 1τ ( u·v ) ‖u‖‖v‖ ) is the similarity of two input vectors , and τ represents a temperature hyper-parameter . For instance-level contrastive learning , the negative sample set N ( i ) inevitably includes some samples with similar semantic content as the anchor i , which we term as false negatives , especially when a larger M is commonly used . Consequently , it would separate semantically similar image pairs , which is suboptimal for learning good semantic-aware visual representations . 3.2 INCREMENTAL FALSE NEGATIVE DETECTION . To learn an effective semantic-aware representation by self-supervised contrastive learning , our method explicitly detects and removes the false negative samples . Specifically , we follow the same procedure in PCL ( Li et al. , 2021 ) to perform k-means clustering on the features f ( i ) of all training images { i ∈ X } and cluster the features into k groups . We use the centroids to represent the embeddings of the discovered semantic concepts and denote the centroid representation of k-th cluster as ck . The pseudo label yi of the image i is assigned based on the closest centroid , formally yi = arg mink ‖f ( i ) − ck‖ . In the learning process , two images with an identical assigned pseudo label would be treated as a false negative pair . Nonetheless , as illustrated in the leftmost of Figure 2 ( a ) ( or Figure 3 for a realistic case ) , we observe that the semantic structure of early embedding space is less reliable and could generate noisy pseudo labels , which would disrupt the representation learning . We provide a quantitative analysis of this effect in Section 4.4 and Appendix F. To tackle this problem , in early training stages , we only adopt the pseudo labels with higher confidence while treating the other images as individual samples . For an arbitrary image i , the desired confidence κi should be larger when the image embedding f ( i ) is not only closer to the centroid of the belonging group , i.e. , cyi , but also farther to the other centroids . To this end , we measure the confidence of an assigned pseudo label by : κi = sim ( zi , cyi ) ∑k j=1 sim ( zi , cj ) , ( 2 ) which is the softmax of cosine similarities between the image representation and every centroid . We then only assign a specific rate ( termed as acceptance rate ) of pseudo labels with larger confidence . As plotted in the rest part of Figure 2 ( or Figure 3 ) , following the training process , the encoder is better trained and the semantic structure of embedding space is more clear which can generate more reliable pseudo labels . Hence , we propose to incrementally increase the acceptance rate and leverage semantic-aware representation learning . In Section 4.4 , we demonstrate that a simple strategy that linearly increases the acceptance rate from 0 % to 100 % throughout the whole training process can achieve a significant improvement . Hierarchical semantic definition . In an unsupervised setting , the precise class number of a dataset is usually unknown , and also , a different number of classes can be selected by choosing a different level of granularity . To enhance the flexibility and robustness of our method , we incorporate hierarchical clustering techniques ( Johnson , 1967 ; Corpet , 1988 ; Murtagh & Legendre , 2014 ; Li et al. , 2021 ) into our framework . Specifically , we perform multiple times of k-means with different cluster numbers to define the false negatives in the different levels of granularity . As such , the objective function ( will be introduced in Section 3.3 ) is revised as the average of the original ones computed by the false negatives defined in different levels of granularity .
This paper deals with the very important topic of “false negatives” in SSL and shows that “false negatives” have a huge impact on performance of SSL methods. One of the most interesting experiments they show is that as they increase the number of classes in the dataset the performance drops more and more. They propose a clustering based method which reduces the “false negatives” and shows improved performances as compared to other state-of-the-art baselines.
SP:db39f8ba63c9cbc28bd185c3fddfdcd31a05a1a2
Incremental False Negative Detection for Contrastive Learning
1 INTRODUCTION . Self-supervised learning of visual representation ( Doersch et al. , 2015 ; Pathak et al. , 2016 ; Noroozi & Favaro , 2016 ; Oord et al. , 2018 ; Gidaris et al. , 2018 ; Chen et al. , 2020a ) aims to learn a semanticaware embedding space based on the image data without the supervision of human-labeled annotations . Recently , significant advances have been made by contrastive learning approaches ( Hjelm et al. , 2019 ; Tian et al. , 2019 ; Chen et al. , 2020b ; c ; He et al. , 2020 ; Chen et al. , 2020d ) to reduce the performance gap with the supervised counterparts . Most unsupervised contrastive learning methods are developed based on the instance discrimination assumption . These approaches treat each training image as an individual instance and learn the representations that discriminate every single sample . Specifically , considering an arbitrary image as an anchor , the only positive sample is generated by applying a different data augmentation to the anchor image , while all other images are treated as negative samples . The training objective is to attract the positive to the anchor while repelling the negative samples from the anchor . While instance-level contrastive learning has shown impressive performance , these methods do not take the semantic relationship among images into consideration . Although some images share similar semantic concepts with the anchor , they are still considered as negative samples and are equally pushed away from the anchor with all other negatives . We define these samples as “ false negatives ” in self-supervised contrastive learning , which would adversely affect the representation learning ( Saunshi et al. , 2019 ) . One might argue that such undesirable effects might be minor for the datasets with diverse semantic concepts since the probabilities of drawing false negatives are relatively low . However , as shown in Figure 1 , we empirically find the opposite results that the performance drops due to training with false negative samples are more significant on large-scale datasets with more semantic categories . These results bring up the issue of instance-level contrastive learning when it is applied to datasets with more complex semantic contents . Figure 1 : Effect of false negative for contrastive learning . To study the effect of false negatives , we compare two frameworks : SimCLR ( Chen et al . ( 2020b ) , blue ) representing instance-level contrastive learning which is trained with false negatives , and SupCon ( Khosla et al . ( 2020 ) , red ) benefiting from human-labeled annotations to exclude false negatives . We observe that training with false negatives leads to larger performance gaps ( orange ) on the datasets with more semantic categories . The proposed approach ( green ) effectively alleviates such adverse effects by explicitly removing the detected false negatives for self-supervised contrastive learning . See Section 4.3 for experimental details . To handle the false negative issue , we propose a novel framework to incrementally detect and explicitly remove false negatives for self-supervised contrastive learning . During training , we cluster samples in the embedding space and assign the cluster indices as the pseudo labels to the training images . Instances with an identical label to the anchor are then detected as false negatives . However , we notice that the pseudo labels generated in the earlier training stages are comparably unreliable to represent the semantic relationship among instances since the semantic structure of the embedding space is still under development . Therefore , we propose a novel strategy to assign the pseudo labels in an incremental manner . In the early training stage , we only use a small portion of pseudo labels with higher confidence while treating other samples as individual instances . In the later training stage , as the pseudo labels become more reliable , we dynamically include more confident labels to detect and remove false negatives and hence , can benefit semantic-aware representation learning . Furthermore , we discuss two types of training objectives to explicitly address the detected false negatives during contrastive learning : elimination and attraction . We theoretically show that they are the generalization of triplet loss ( Schroff et al. , 2015 ) . While both objectives avoid discriminating the anchor and its false negatives , the attraction objective further minimizes the distances between them . Empirically , we find that such a more aggressive strategy is less tolerant to noisy pseudo labels and unsuitable to our self-supervised framework . The main contributions of this paper are summarized as follows : • We highlight the issue of false negatives in contrastive learning , especially on the largescale datasets with more diverse semantic contents . • We propose a novel contrastive learning framework with incremental false negative detection ( IFND ) that smoothly bridges instance-level and semantic-aware contrastive learning . Our approach explicitly detects and incrementally removes false negatives as the embedding space becomes more semantically structural through the training process . • Our approach performs favorably against the existing self-supervised contrastive learning frameworks on multiple benchmarks under a limited training resource setup . Besides , we introduce two metrics : mean true positive/negative rates to evaluate the clustering quality . 2 RELATED WORK . Instance-level contrastive learning . Learning semantic-aware visual representation without human supervision is an essential but challenging task . Numerous approaches are developed based on the instance discrimination task ( Dosovitskiy et al. , 2015 ; Wu et al. , 2018 ; Ye et al. , 2019 ; Misra & Maaten , 2020 ) , where each instance in the dataset is treated as an individual sample and a representation is learned to classify or contrastively separate samples . Recently , with the contrastive loss ( Gutmann & Hyvärinen , 2010 ) and a set of image transformations or augmentations ( Chen et al. , 2020b ) , the instance-level contrastive learning methods ( Hjelm et al. , 2019 ; Tian et al. , 2019 ; Chen et al. , 2020b ; c ; He et al. , 2020 ; Chen et al. , 2020d ) achieve state-of-the-art results and even outperform some supervised pre-training approaches . While significant improvement is achieved , instance-level contrastive learning frameworks typically do not take high-level semantics into ac- count . For example , any two samples in the dataset would be considered as a negative pair and be pushed apart by the contrastive loss although some of them are semantically similar and should be nearby in the embedding space . Especially when the huge amounts of negative samples ( 8192 for Chen et al . ( 2020b ) , 65536 for He et al . ( 2020 ) ) play a critical role in the success of contrastive learning , these instance-level approaches inevitably draw some “ false negatives ” and learn less effective representation models as shown by a recent study ( Saunshi et al. , 2019 ) . In this paper , we further show that the performance gap between the contrastive learning trained with and without false negatives is more significant on the datasets with more semantic classes . Semantic-aware contrastive learning . To address the limitation of instance-level contrastive learning , several methods are developed to exploit the semantic relationship among images . Chuang et al . ( 2020 ) show that the original instance-level sampling strategy includes a sampling bias and propose a debiased contrastive loss . However , this method does not explicitly handle false negative samples . Huynh et al . ( 2020 ) determine false negatives of an anchor by finding top k similar samples without referring to global embedding distribution . Khosla et al . ( 2020 ) propose a supervised contrastive loss that utilizes label information and treats images of the same class ( i.e. , false negatives ) as positives . However , manually annotated labels can not be acquired in the unsupervised setting . Closely related to our method , PCL ( Li et al. , 2021 ) discovers the representative prototypes for each semantic concept and encourages an image embedding to be closer to its belonging prototype . There are two fundamental differences between PCL and the proposed method : a ) PCL uses all assigned prototypes regardless of inferior clustering results in early stages , which can not properly reflect the semantic relationship among images , b ) without treating semantically similar samples as false negatives , PCL applies instance-level InfoNCE loss ( Oord et al. , 2018 ) as the primary supervision , which fails to avoid the images within the same prototype being pushed apart . In contrast , leveraging the progressive detection and explicit removal of false negatives , our framework achieves greater clustering quality and representation learning . More comparisons are in Section 4.2 and Appendix E. Clustering for deep unsupervised learning . A few unsupervised learning methods have recently benefited from clustering techniques to construct more effective representation models ( Caron et al. , 2018 ; Yang et al. , 2016 ; Xie et al. , 2016 ; Caron et al. , 2019 ; Zhuang et al. , 2019 ; Asano et al. , 2020 ) . The main idea is to use cluster indices as pseudo labels and learn visual representations in a supervised manner . However , most existing methods require all pseudo labels to optimize the supervised loss , e.g. , cross-entropy . In this work , we show that the pseudo labels obtained in earlier training processes are relatively unreliable , and the full adoption of pseudo labels in the early stage would further disrupt the representation learning . To handle this issue , we incorporate instance-level learning with clustering which allows us to only use a set of pseudo labels with sufficient confidence while treating the others as individual instances . 3 METHODOLOGY . 3.1 INSTANCE-LEVEL CONTRASTIVE LEARNING . An instance-level contrastive learning method learns a representation that discriminates one sample from every other . Given M randomly sampled images from a training set X , a contrastive training mini-batch I consists of 2M images obtained by applying two sets of data augmentation on each sampled image . For any anchor image i ∈ I , the only positive sample is another view ( or transformation ) of the same image , denoted as i′ , while the other 2 ( M − 1 ) images jointly constitute the set of negative samples N ( i ) . The instance-level discrimination is then optimized by the following contrastive loss : Linst = ∑ i∈I − log sim ( zi , zi ′ ) ∑ s∈S ( i ) sim ( zi , zs ) , S ( i ) ≡ { i′ , n | n ∈ N ( i ) } , ( 1 ) where zi = g ( f ( i ) ) is the embedding of the image i from an encoder f and a projection head g , sim ( u , v ) = exp ( 1τ ( u·v ) ‖u‖‖v‖ ) is the similarity of two input vectors , and τ represents a temperature hyper-parameter . For instance-level contrastive learning , the negative sample set N ( i ) inevitably includes some samples with similar semantic content as the anchor i , which we term as false negatives , especially when a larger M is commonly used . Consequently , it would separate semantically similar image pairs , which is suboptimal for learning good semantic-aware visual representations . 3.2 INCREMENTAL FALSE NEGATIVE DETECTION . To learn an effective semantic-aware representation by self-supervised contrastive learning , our method explicitly detects and removes the false negative samples . Specifically , we follow the same procedure in PCL ( Li et al. , 2021 ) to perform k-means clustering on the features f ( i ) of all training images { i ∈ X } and cluster the features into k groups . We use the centroids to represent the embeddings of the discovered semantic concepts and denote the centroid representation of k-th cluster as ck . The pseudo label yi of the image i is assigned based on the closest centroid , formally yi = arg mink ‖f ( i ) − ck‖ . In the learning process , two images with an identical assigned pseudo label would be treated as a false negative pair . Nonetheless , as illustrated in the leftmost of Figure 2 ( a ) ( or Figure 3 for a realistic case ) , we observe that the semantic structure of early embedding space is less reliable and could generate noisy pseudo labels , which would disrupt the representation learning . We provide a quantitative analysis of this effect in Section 4.4 and Appendix F. To tackle this problem , in early training stages , we only adopt the pseudo labels with higher confidence while treating the other images as individual samples . For an arbitrary image i , the desired confidence κi should be larger when the image embedding f ( i ) is not only closer to the centroid of the belonging group , i.e. , cyi , but also farther to the other centroids . To this end , we measure the confidence of an assigned pseudo label by : κi = sim ( zi , cyi ) ∑k j=1 sim ( zi , cj ) , ( 2 ) which is the softmax of cosine similarities between the image representation and every centroid . We then only assign a specific rate ( termed as acceptance rate ) of pseudo labels with larger confidence . As plotted in the rest part of Figure 2 ( or Figure 3 ) , following the training process , the encoder is better trained and the semantic structure of embedding space is more clear which can generate more reliable pseudo labels . Hence , we propose to incrementally increase the acceptance rate and leverage semantic-aware representation learning . In Section 4.4 , we demonstrate that a simple strategy that linearly increases the acceptance rate from 0 % to 100 % throughout the whole training process can achieve a significant improvement . Hierarchical semantic definition . In an unsupervised setting , the precise class number of a dataset is usually unknown , and also , a different number of classes can be selected by choosing a different level of granularity . To enhance the flexibility and robustness of our method , we incorporate hierarchical clustering techniques ( Johnson , 1967 ; Corpet , 1988 ; Murtagh & Legendre , 2014 ; Li et al. , 2021 ) into our framework . Specifically , we perform multiple times of k-means with different cluster numbers to define the false negatives in the different levels of granularity . As such , the objective function ( will be introduced in Section 3.3 ) is revised as the average of the original ones computed by the false negatives defined in different levels of granularity .
Briefly, this paper presents a simple yet effective method (i.e., IFND) for self-supervised contrastive learning by effectively handling the false-negative samples. Specifically, the authors propose to cluster samples in the embedding space and assign the cluster indices as pseudo labels in an incremental manner during training. The experimental results are extensive and demonstrate the effectiveness of the proposed method.
SP:db39f8ba63c9cbc28bd185c3fddfdcd31a05a1a2
Incremental False Negative Detection for Contrastive Learning
1 INTRODUCTION . Self-supervised learning of visual representation ( Doersch et al. , 2015 ; Pathak et al. , 2016 ; Noroozi & Favaro , 2016 ; Oord et al. , 2018 ; Gidaris et al. , 2018 ; Chen et al. , 2020a ) aims to learn a semanticaware embedding space based on the image data without the supervision of human-labeled annotations . Recently , significant advances have been made by contrastive learning approaches ( Hjelm et al. , 2019 ; Tian et al. , 2019 ; Chen et al. , 2020b ; c ; He et al. , 2020 ; Chen et al. , 2020d ) to reduce the performance gap with the supervised counterparts . Most unsupervised contrastive learning methods are developed based on the instance discrimination assumption . These approaches treat each training image as an individual instance and learn the representations that discriminate every single sample . Specifically , considering an arbitrary image as an anchor , the only positive sample is generated by applying a different data augmentation to the anchor image , while all other images are treated as negative samples . The training objective is to attract the positive to the anchor while repelling the negative samples from the anchor . While instance-level contrastive learning has shown impressive performance , these methods do not take the semantic relationship among images into consideration . Although some images share similar semantic concepts with the anchor , they are still considered as negative samples and are equally pushed away from the anchor with all other negatives . We define these samples as “ false negatives ” in self-supervised contrastive learning , which would adversely affect the representation learning ( Saunshi et al. , 2019 ) . One might argue that such undesirable effects might be minor for the datasets with diverse semantic concepts since the probabilities of drawing false negatives are relatively low . However , as shown in Figure 1 , we empirically find the opposite results that the performance drops due to training with false negative samples are more significant on large-scale datasets with more semantic categories . These results bring up the issue of instance-level contrastive learning when it is applied to datasets with more complex semantic contents . Figure 1 : Effect of false negative for contrastive learning . To study the effect of false negatives , we compare two frameworks : SimCLR ( Chen et al . ( 2020b ) , blue ) representing instance-level contrastive learning which is trained with false negatives , and SupCon ( Khosla et al . ( 2020 ) , red ) benefiting from human-labeled annotations to exclude false negatives . We observe that training with false negatives leads to larger performance gaps ( orange ) on the datasets with more semantic categories . The proposed approach ( green ) effectively alleviates such adverse effects by explicitly removing the detected false negatives for self-supervised contrastive learning . See Section 4.3 for experimental details . To handle the false negative issue , we propose a novel framework to incrementally detect and explicitly remove false negatives for self-supervised contrastive learning . During training , we cluster samples in the embedding space and assign the cluster indices as the pseudo labels to the training images . Instances with an identical label to the anchor are then detected as false negatives . However , we notice that the pseudo labels generated in the earlier training stages are comparably unreliable to represent the semantic relationship among instances since the semantic structure of the embedding space is still under development . Therefore , we propose a novel strategy to assign the pseudo labels in an incremental manner . In the early training stage , we only use a small portion of pseudo labels with higher confidence while treating other samples as individual instances . In the later training stage , as the pseudo labels become more reliable , we dynamically include more confident labels to detect and remove false negatives and hence , can benefit semantic-aware representation learning . Furthermore , we discuss two types of training objectives to explicitly address the detected false negatives during contrastive learning : elimination and attraction . We theoretically show that they are the generalization of triplet loss ( Schroff et al. , 2015 ) . While both objectives avoid discriminating the anchor and its false negatives , the attraction objective further minimizes the distances between them . Empirically , we find that such a more aggressive strategy is less tolerant to noisy pseudo labels and unsuitable to our self-supervised framework . The main contributions of this paper are summarized as follows : • We highlight the issue of false negatives in contrastive learning , especially on the largescale datasets with more diverse semantic contents . • We propose a novel contrastive learning framework with incremental false negative detection ( IFND ) that smoothly bridges instance-level and semantic-aware contrastive learning . Our approach explicitly detects and incrementally removes false negatives as the embedding space becomes more semantically structural through the training process . • Our approach performs favorably against the existing self-supervised contrastive learning frameworks on multiple benchmarks under a limited training resource setup . Besides , we introduce two metrics : mean true positive/negative rates to evaluate the clustering quality . 2 RELATED WORK . Instance-level contrastive learning . Learning semantic-aware visual representation without human supervision is an essential but challenging task . Numerous approaches are developed based on the instance discrimination task ( Dosovitskiy et al. , 2015 ; Wu et al. , 2018 ; Ye et al. , 2019 ; Misra & Maaten , 2020 ) , where each instance in the dataset is treated as an individual sample and a representation is learned to classify or contrastively separate samples . Recently , with the contrastive loss ( Gutmann & Hyvärinen , 2010 ) and a set of image transformations or augmentations ( Chen et al. , 2020b ) , the instance-level contrastive learning methods ( Hjelm et al. , 2019 ; Tian et al. , 2019 ; Chen et al. , 2020b ; c ; He et al. , 2020 ; Chen et al. , 2020d ) achieve state-of-the-art results and even outperform some supervised pre-training approaches . While significant improvement is achieved , instance-level contrastive learning frameworks typically do not take high-level semantics into ac- count . For example , any two samples in the dataset would be considered as a negative pair and be pushed apart by the contrastive loss although some of them are semantically similar and should be nearby in the embedding space . Especially when the huge amounts of negative samples ( 8192 for Chen et al . ( 2020b ) , 65536 for He et al . ( 2020 ) ) play a critical role in the success of contrastive learning , these instance-level approaches inevitably draw some “ false negatives ” and learn less effective representation models as shown by a recent study ( Saunshi et al. , 2019 ) . In this paper , we further show that the performance gap between the contrastive learning trained with and without false negatives is more significant on the datasets with more semantic classes . Semantic-aware contrastive learning . To address the limitation of instance-level contrastive learning , several methods are developed to exploit the semantic relationship among images . Chuang et al . ( 2020 ) show that the original instance-level sampling strategy includes a sampling bias and propose a debiased contrastive loss . However , this method does not explicitly handle false negative samples . Huynh et al . ( 2020 ) determine false negatives of an anchor by finding top k similar samples without referring to global embedding distribution . Khosla et al . ( 2020 ) propose a supervised contrastive loss that utilizes label information and treats images of the same class ( i.e. , false negatives ) as positives . However , manually annotated labels can not be acquired in the unsupervised setting . Closely related to our method , PCL ( Li et al. , 2021 ) discovers the representative prototypes for each semantic concept and encourages an image embedding to be closer to its belonging prototype . There are two fundamental differences between PCL and the proposed method : a ) PCL uses all assigned prototypes regardless of inferior clustering results in early stages , which can not properly reflect the semantic relationship among images , b ) without treating semantically similar samples as false negatives , PCL applies instance-level InfoNCE loss ( Oord et al. , 2018 ) as the primary supervision , which fails to avoid the images within the same prototype being pushed apart . In contrast , leveraging the progressive detection and explicit removal of false negatives , our framework achieves greater clustering quality and representation learning . More comparisons are in Section 4.2 and Appendix E. Clustering for deep unsupervised learning . A few unsupervised learning methods have recently benefited from clustering techniques to construct more effective representation models ( Caron et al. , 2018 ; Yang et al. , 2016 ; Xie et al. , 2016 ; Caron et al. , 2019 ; Zhuang et al. , 2019 ; Asano et al. , 2020 ) . The main idea is to use cluster indices as pseudo labels and learn visual representations in a supervised manner . However , most existing methods require all pseudo labels to optimize the supervised loss , e.g. , cross-entropy . In this work , we show that the pseudo labels obtained in earlier training processes are relatively unreliable , and the full adoption of pseudo labels in the early stage would further disrupt the representation learning . To handle this issue , we incorporate instance-level learning with clustering which allows us to only use a set of pseudo labels with sufficient confidence while treating the others as individual instances . 3 METHODOLOGY . 3.1 INSTANCE-LEVEL CONTRASTIVE LEARNING . An instance-level contrastive learning method learns a representation that discriminates one sample from every other . Given M randomly sampled images from a training set X , a contrastive training mini-batch I consists of 2M images obtained by applying two sets of data augmentation on each sampled image . For any anchor image i ∈ I , the only positive sample is another view ( or transformation ) of the same image , denoted as i′ , while the other 2 ( M − 1 ) images jointly constitute the set of negative samples N ( i ) . The instance-level discrimination is then optimized by the following contrastive loss : Linst = ∑ i∈I − log sim ( zi , zi ′ ) ∑ s∈S ( i ) sim ( zi , zs ) , S ( i ) ≡ { i′ , n | n ∈ N ( i ) } , ( 1 ) where zi = g ( f ( i ) ) is the embedding of the image i from an encoder f and a projection head g , sim ( u , v ) = exp ( 1τ ( u·v ) ‖u‖‖v‖ ) is the similarity of two input vectors , and τ represents a temperature hyper-parameter . For instance-level contrastive learning , the negative sample set N ( i ) inevitably includes some samples with similar semantic content as the anchor i , which we term as false negatives , especially when a larger M is commonly used . Consequently , it would separate semantically similar image pairs , which is suboptimal for learning good semantic-aware visual representations . 3.2 INCREMENTAL FALSE NEGATIVE DETECTION . To learn an effective semantic-aware representation by self-supervised contrastive learning , our method explicitly detects and removes the false negative samples . Specifically , we follow the same procedure in PCL ( Li et al. , 2021 ) to perform k-means clustering on the features f ( i ) of all training images { i ∈ X } and cluster the features into k groups . We use the centroids to represent the embeddings of the discovered semantic concepts and denote the centroid representation of k-th cluster as ck . The pseudo label yi of the image i is assigned based on the closest centroid , formally yi = arg mink ‖f ( i ) − ck‖ . In the learning process , two images with an identical assigned pseudo label would be treated as a false negative pair . Nonetheless , as illustrated in the leftmost of Figure 2 ( a ) ( or Figure 3 for a realistic case ) , we observe that the semantic structure of early embedding space is less reliable and could generate noisy pseudo labels , which would disrupt the representation learning . We provide a quantitative analysis of this effect in Section 4.4 and Appendix F. To tackle this problem , in early training stages , we only adopt the pseudo labels with higher confidence while treating the other images as individual samples . For an arbitrary image i , the desired confidence κi should be larger when the image embedding f ( i ) is not only closer to the centroid of the belonging group , i.e. , cyi , but also farther to the other centroids . To this end , we measure the confidence of an assigned pseudo label by : κi = sim ( zi , cyi ) ∑k j=1 sim ( zi , cj ) , ( 2 ) which is the softmax of cosine similarities between the image representation and every centroid . We then only assign a specific rate ( termed as acceptance rate ) of pseudo labels with larger confidence . As plotted in the rest part of Figure 2 ( or Figure 3 ) , following the training process , the encoder is better trained and the semantic structure of embedding space is more clear which can generate more reliable pseudo labels . Hence , we propose to incrementally increase the acceptance rate and leverage semantic-aware representation learning . In Section 4.4 , we demonstrate that a simple strategy that linearly increases the acceptance rate from 0 % to 100 % throughout the whole training process can achieve a significant improvement . Hierarchical semantic definition . In an unsupervised setting , the precise class number of a dataset is usually unknown , and also , a different number of classes can be selected by choosing a different level of granularity . To enhance the flexibility and robustness of our method , we incorporate hierarchical clustering techniques ( Johnson , 1967 ; Corpet , 1988 ; Murtagh & Legendre , 2014 ; Li et al. , 2021 ) into our framework . Specifically , we perform multiple times of k-means with different cluster numbers to define the false negatives in the different levels of granularity . As such , the objective function ( will be introduced in Section 3.3 ) is revised as the average of the original ones computed by the false negatives defined in different levels of granularity .
The paper proposes incremental false-negative detection (IFND), which has several improvements over prototypical contrastive learning (PCL). The key idea of PCL is to alternatively update (a) the pseudo-labels based on the current encoder and (b) update the encoder based on the current pseudo-labels. However, PCL often converges to the local minima since the bad encoder produces falsy pseudo-labels, further harming the encoder. To tackle the issue, INFD suggests including the confident pseudo-labels while uncertain ones incrementally. IFND consistently improves the PCL in all considered scenarios.
SP:db39f8ba63c9cbc28bd185c3fddfdcd31a05a1a2
Towards understanding how momentum improves generalization in deep learning
1 INTRODUCTION . It is commonly accepted that adding momentum to an optimization algorithm is required to optimally train a large-scale deep network . Most of the modern architectures maintain during the training process a heavy momentum close to 1 ( Krizhevsky et al. , 2012 ; Simonyan & Zisserman , 2014 ; He et al. , 2016 ; Zagoruyko & Komodakis , 2016 ) . Indeed , it has been empirically observed that architectures trained with momentum outperform those which are trained without ( Sutskever et al. , 2013 ) . Several papers have attempted to explain this phenomenon . From the optimization perspective , Defazio ( 2020 ) assert that momentum yields faster convergence of the training loss since , at the early stages , it cancels out the noise from the stochastic gradients . On the other hand , Leclerc & Madry ( 2020 ) empirically observes that momentum yields faster training convergence only when the learning rate is small . While these works shed light on how momentum acts on neural network training , they fail to capture the generalization improvement induced by momentum ( Sutskever et al. , 2013 ) . Besides , the noise reduction property of momentum advocated by Defazio ( 2020 ) seems to even contradict the observation that , in deep learning , having a large noise in the training improves generalization ( Li et al. , 2019 ; HaoChen et al. , 2020 ) . To the best of our knowledge , there is no existing work which theoretically explains how momentum improves generalization in deep learning . Therefore , this paper aims to close this gap and addresses the following question : Is the higher generalization induced by momentum tied to the stochastic noise of the gradient ? If not , what is the underlying mechanism of momentum improving generalization in deep learning ? In this paper , we empirically verify that the generalization improvement induced by momentum is not tied to the stochasticity of the gradient . Indeed , as reported in Figure 1 , momentum improves generalization more significantly for full batch GD than for SGD in CIFAR object recognition tasks . Motivated by this empirical observation and the fact that the stochastic noise influences generalization , we theoretically study how gradient descent with momentum ( GD+M ) can generalize better than vanilla gradient descent ( GD ) . We therefore only focus on the contribution of momentum of the true gradient on generalization . The question we address concerns algorithmic regularization which characterizes the generalization of an optimization algorithm when multiple global solutions exist in over-parameterized deep learning model Soudry et al . ( 2018 ) ; Lyu & Li ( 2019 ) ; Ji & Telgarsky ( 2019 ) ; Chizat & Bach ( 2020 ) ; Gunasekar et al . ( 2018 ) ; Arora et al . ( 2019 ) . This regularization arises in deep learning mainly due to the nonconvexity of the objective function . Indeed , this latter can create multiple global minima scattered in the space that vastly differ in terms of generalization . Algorithmic regularization is induced by and depends on many factors such as learning rate and batch size ( Goyal et al. , 2017 ; Hoffer et al. , 2017 ; Keskar et al. , 2016 ; Smith et al. , 2018 ) , initialization Allen-Zhu & Li ( 2020 ) , adaptive step-size ( Kingma & Ba , 2014 ; Neyshabur et al. , 2015 ; Wilson et al. , 2017 ) , batch normalization ( Arora et al. , 2018 ; Hoffer et al. , 2019 ; Ioffe & Szegedy , 2015 ) and dropout ( Srivastava et al. , 2014 ; Wei et al. , 2020 ) . However , none of these works theoretically analyzes the regularization induced by momentum . We therefore start our investigation by raising the following question : Does momentum unconditionally improve generalization in deep learning ? This question could be positively answered given the success of momentum for learning distinct architectures such as ResNets ( He et al. , 2016 ) or BERT ( Devlin et al. , 2018 ) . However , we here empirically give a negative answer through the following synthetic example in deep learning . We consider a binary classification problem where data-points are generated from a standard normal distribution and labels are outputs of teacher networks . Starting from the same initialization , we train different over-parametrized student networks using GD and GD+M . Based on Table 1 , whether the target function is simple ( linear ) or complex ( neural network ) , momentum does not improve generalization even when using a non-linear neural network as learner . The same observation holds for SGD/SGD+M as shown in the Appendix . Therefore , momentum does not always lead to a higher generalization in deep learning . Instead , such benefit seems to heavily depend on both the structure of the data and the learning problem . On which data set does momentum help generalization ? In this paper , in order to determine the underlying mechanism produced by momentum to improve generalization , we design a binary classification problem with a simple data structure where training a two-layer ( overparameterized ) convolutional network with momentum provably improves generalization in deep learning . It is built upon a data distribution that relies on the concepts of feature and margin . Informally , each example in this distribution is a 1D image having P patches . One of the patches ( the signal patch ) contains a feature we want to learn and all the others are Gaussian random noise with small variance . Mathematically , one can think of a feature as a vectorw∗ ∈ Rd.We assume that our training examples are divided into large margin data where the signal is αw∗ with α constant and small margin data where the signal is βw∗ with β 1 . Intuitively , the second type of data is inherently noisier as the margin is small and therefore , a classifier would struggle more to generalize on this type of data . We underline that all the examples share the same feature but differ in the intensity of the signal . We consider a training dataset of size N with the following split for µ̂ 1 : ( 1− µ̂ ) N datapoints are with large margin , µ̂N datapoints are with small margin data . ( D ) Figure 2 sketches equation ( D ) in a 2D setting . We emphasize that datasets having similar features and different margins are common in the real-world . Examples include object-recognition datasets such as CIFAR ( Krizhevsky et al. , 2009 ) or Imagenet ( Deng et al. , 2009 ) ( for example , the “ wheel feature ” of a car can be strong or weak depending on the orientation of the car ) . More specifically , we believe that the dataset ( D ) can be viewed as a simplified model of these object-recognition datasets . In this context , the following informal theorems characterize the generalization of the GD and GD+M models . They dramatically simplify Theorem 3.1 and Theorem 3.2 but highlight the intuitions behind our results . Theorem 1.1 ( Informal , GD+M ) . There exists a dataset of the form ( D ) with size N such that a two-layer ( over-parameterized ) convolutional network trained with GD+M : 1. initially only learns large margin data from the ( 1− µ̂ ) N examples . 2. has large historical gradients that contain the feature w∗ present in small margin data . 3. keeps learning the feature in the small margin data using its momentum historical gradients . The model thus reaches zero training error and perfectly classify large and small margin data at test . Theorem 1.2 ( Informal , GD ) . There exists a dataset of the form ( D ) with sizeN such that a two-layer ( over-parameterized ) convolutional network trained with GD : 1. initially only learns large margin data from the from the ( 1− µ̂ ) N examples . 2. has small gradient after learning these data . 3. memorizes the remaining small margin data from the µ̂N examples using the noises . The model thus reaches zero training and manages to classify the large margin data at test . However , it fails to classify the small margin data because of the memorization step during training . Why does GD+M generalize better than GD ? Since the large margin data are dominant , GD focus in priority on these examples to decrease its training loss . However , after fitting this data , it significantly lowers its gradient . The gradient is thus not large enough for learning the small margin data . Similarly , GD+M fits the large margin data and subsequently gets a small gradient . However , contrary to GD , GD+M has large historical gradients in his momentum gradient . These gradients helped to learn the feature in the large margin data . They also help to learn small margin data since all the examples share the same feature . GD+M therefore uses his momentum to learn the small margin data . We name this process historical feature amplification and believe that it is key to understand why momentum improves generalization . Empirical justification . We also provide an empirical justification that such phenomenon does happen in a real-world setting as reported in Figure 4 . In this experiment , we create small margin data in the CIFAR-10 dataset by respectively lowering the resolution of 10 % of the training and test images , adding Gaussian noise of variance 0.005 and randomly shuffling the RGB channels . Figure 4 shows that even though both algortihms reach zero training error and 100 % training accuracy , GD+M gets higher generalization than GD on this decimated dataset . Above all , at test , GD+M performs as well on small and large margin data while GD does relatively worse on small margin data.Indeed , the relative accuracy drop for GD+M is 80.36/83.32 = 0.97 while for GD is equal to 65.14/73.69 = 0.88 . Our paper is organized as follows . In Section 2 , we formally define the data distribution equation ( D ) , the model and algorithms we use to learn it . Lastly , Section 3 presents our main theorems and provide a proof sketch in Section 4 and Section 5 . Additional experiments can be found in the Appendix . MORE RELATED WORK Momentum in convex setting . GD+M ( a.k.a . heavy ball or Polyak momentum ) consists in calculating the exponentially weighted average of the past gradients and using it to update the weights . For convex functions near a strict twice-differentiable minimum , GD+M is optimal regarding local convergence rate Polyak ( 1963 ; 1964 ) ; Nemirovskij & Yudin ( 1983 ) ; Nesterov ( 2003 ) . However , it may fail to converge globally for general strongly convex twice-differentiable functions Lessard et al . ( 2015 ) and is no longer optimal for the class of smooth convex functions . In the stochastic setting , GD+M is more sensitive to noise in the gradients ; that is , to preserve their improved convergence rates , significantly less noise is required d ’ Aspremont ( 2008 ) ; Schmidt et al . ( 2011 ) ; Devolder et al . ( 2014 ) ; Kidambi et al . ( 2018 ) . Finally , other momentum methods are extensively used for convex functions such as Nesterov ’ s accelerated gradient Nesterov ( 1983 ) . Our paper focuses on the use of GD+M and contrary to the aforementioned papers , our setting is non-convex and we mainly focus on the generalization of the model learned by GD and GD+M when both methods converge to global optimal . We underline that contrary to the non-convex world , generalization is typically disentangled with optimization for ( strictly ) convex functions . Non-convex optimization with momentum . A long line of work consists in understanding the convergence speed of momentum methods when optimizing non-convex functions . Mai & Johansson ( 2020 ) ; Liu et al . ( 2020 ) ; Cutkosky & Mehta ( 2020 ) ; Defazio ( 2020 ) show that SGD+M reaches a stationary point as fast as SGD under diverse assumptions . Besides , Leclerc & Madry ( 2020 ) empirically shows that momentum accelerates neural network training for small learning rates and slows it down otherwise . Our paper differs from these works as we work in the batch setting and theoretically investigate the generalization benefits brought by momentum ( and not the training ones ) . Generalization with momentum . Momentum-based methods such as SGD+M , RMSProp ( Tieleman & Hinton , 2012 ) and Adam ( Kingma & Ba , 2014 ) are standard in deep learning training since the seminal work of Sutskever et al . ( 2013 ) . Although its well accepted that Momentum improve generalization in deep learning , only a few works formally investigate the role of momentum in generalization . Leclerc & Madry ( 2020 ) empirically reports that momentum yields higher generalization when using a large learning rate . However , they assert that this benefit can be obtained by applying an even larger learning rate on vanilla SGD . We suspect that this observation is due to batch normalization ( BN ) which is known to dramatically bias the algorithm ’ s generalization ( Lyu & Li , 2019 ) . In Appendix , we report that BN reduces the generalization gain of momentum comparing to without BN . To our knowledge , our work is first that theoretically investigate the generalization of momentum in deep learning .
This paper investigates the generalization benefits of using momentum when training neural networks with gradient descent. In contrast with existing literature, which studies momentum mostly empirically and in the stochastic setting, the authors develop a theoretical explanation for why generalization improves when optimization is performed using full-batch gradient descent with momentum (GD+M) than without it (GD). Their analysis focuses on a specific structure of the data and the learning problem, and the authors argue that similar assumptions apply to the real-world datasets used in practice. The authors prove two main results: one about GD learning large-margin data and overfitting to small-margin data and the other about GD+M successfully learning all the data thanks to historical gradients. Interestingly, the authors provide a counterexample where momentum does not aid generalization (or even worsen it), which offers good food for thought.
SP:a61371a46f25f449ee58bc1c0546f4dd174aa0f9
Towards understanding how momentum improves generalization in deep learning
1 INTRODUCTION . It is commonly accepted that adding momentum to an optimization algorithm is required to optimally train a large-scale deep network . Most of the modern architectures maintain during the training process a heavy momentum close to 1 ( Krizhevsky et al. , 2012 ; Simonyan & Zisserman , 2014 ; He et al. , 2016 ; Zagoruyko & Komodakis , 2016 ) . Indeed , it has been empirically observed that architectures trained with momentum outperform those which are trained without ( Sutskever et al. , 2013 ) . Several papers have attempted to explain this phenomenon . From the optimization perspective , Defazio ( 2020 ) assert that momentum yields faster convergence of the training loss since , at the early stages , it cancels out the noise from the stochastic gradients . On the other hand , Leclerc & Madry ( 2020 ) empirically observes that momentum yields faster training convergence only when the learning rate is small . While these works shed light on how momentum acts on neural network training , they fail to capture the generalization improvement induced by momentum ( Sutskever et al. , 2013 ) . Besides , the noise reduction property of momentum advocated by Defazio ( 2020 ) seems to even contradict the observation that , in deep learning , having a large noise in the training improves generalization ( Li et al. , 2019 ; HaoChen et al. , 2020 ) . To the best of our knowledge , there is no existing work which theoretically explains how momentum improves generalization in deep learning . Therefore , this paper aims to close this gap and addresses the following question : Is the higher generalization induced by momentum tied to the stochastic noise of the gradient ? If not , what is the underlying mechanism of momentum improving generalization in deep learning ? In this paper , we empirically verify that the generalization improvement induced by momentum is not tied to the stochasticity of the gradient . Indeed , as reported in Figure 1 , momentum improves generalization more significantly for full batch GD than for SGD in CIFAR object recognition tasks . Motivated by this empirical observation and the fact that the stochastic noise influences generalization , we theoretically study how gradient descent with momentum ( GD+M ) can generalize better than vanilla gradient descent ( GD ) . We therefore only focus on the contribution of momentum of the true gradient on generalization . The question we address concerns algorithmic regularization which characterizes the generalization of an optimization algorithm when multiple global solutions exist in over-parameterized deep learning model Soudry et al . ( 2018 ) ; Lyu & Li ( 2019 ) ; Ji & Telgarsky ( 2019 ) ; Chizat & Bach ( 2020 ) ; Gunasekar et al . ( 2018 ) ; Arora et al . ( 2019 ) . This regularization arises in deep learning mainly due to the nonconvexity of the objective function . Indeed , this latter can create multiple global minima scattered in the space that vastly differ in terms of generalization . Algorithmic regularization is induced by and depends on many factors such as learning rate and batch size ( Goyal et al. , 2017 ; Hoffer et al. , 2017 ; Keskar et al. , 2016 ; Smith et al. , 2018 ) , initialization Allen-Zhu & Li ( 2020 ) , adaptive step-size ( Kingma & Ba , 2014 ; Neyshabur et al. , 2015 ; Wilson et al. , 2017 ) , batch normalization ( Arora et al. , 2018 ; Hoffer et al. , 2019 ; Ioffe & Szegedy , 2015 ) and dropout ( Srivastava et al. , 2014 ; Wei et al. , 2020 ) . However , none of these works theoretically analyzes the regularization induced by momentum . We therefore start our investigation by raising the following question : Does momentum unconditionally improve generalization in deep learning ? This question could be positively answered given the success of momentum for learning distinct architectures such as ResNets ( He et al. , 2016 ) or BERT ( Devlin et al. , 2018 ) . However , we here empirically give a negative answer through the following synthetic example in deep learning . We consider a binary classification problem where data-points are generated from a standard normal distribution and labels are outputs of teacher networks . Starting from the same initialization , we train different over-parametrized student networks using GD and GD+M . Based on Table 1 , whether the target function is simple ( linear ) or complex ( neural network ) , momentum does not improve generalization even when using a non-linear neural network as learner . The same observation holds for SGD/SGD+M as shown in the Appendix . Therefore , momentum does not always lead to a higher generalization in deep learning . Instead , such benefit seems to heavily depend on both the structure of the data and the learning problem . On which data set does momentum help generalization ? In this paper , in order to determine the underlying mechanism produced by momentum to improve generalization , we design a binary classification problem with a simple data structure where training a two-layer ( overparameterized ) convolutional network with momentum provably improves generalization in deep learning . It is built upon a data distribution that relies on the concepts of feature and margin . Informally , each example in this distribution is a 1D image having P patches . One of the patches ( the signal patch ) contains a feature we want to learn and all the others are Gaussian random noise with small variance . Mathematically , one can think of a feature as a vectorw∗ ∈ Rd.We assume that our training examples are divided into large margin data where the signal is αw∗ with α constant and small margin data where the signal is βw∗ with β 1 . Intuitively , the second type of data is inherently noisier as the margin is small and therefore , a classifier would struggle more to generalize on this type of data . We underline that all the examples share the same feature but differ in the intensity of the signal . We consider a training dataset of size N with the following split for µ̂ 1 : ( 1− µ̂ ) N datapoints are with large margin , µ̂N datapoints are with small margin data . ( D ) Figure 2 sketches equation ( D ) in a 2D setting . We emphasize that datasets having similar features and different margins are common in the real-world . Examples include object-recognition datasets such as CIFAR ( Krizhevsky et al. , 2009 ) or Imagenet ( Deng et al. , 2009 ) ( for example , the “ wheel feature ” of a car can be strong or weak depending on the orientation of the car ) . More specifically , we believe that the dataset ( D ) can be viewed as a simplified model of these object-recognition datasets . In this context , the following informal theorems characterize the generalization of the GD and GD+M models . They dramatically simplify Theorem 3.1 and Theorem 3.2 but highlight the intuitions behind our results . Theorem 1.1 ( Informal , GD+M ) . There exists a dataset of the form ( D ) with size N such that a two-layer ( over-parameterized ) convolutional network trained with GD+M : 1. initially only learns large margin data from the ( 1− µ̂ ) N examples . 2. has large historical gradients that contain the feature w∗ present in small margin data . 3. keeps learning the feature in the small margin data using its momentum historical gradients . The model thus reaches zero training error and perfectly classify large and small margin data at test . Theorem 1.2 ( Informal , GD ) . There exists a dataset of the form ( D ) with sizeN such that a two-layer ( over-parameterized ) convolutional network trained with GD : 1. initially only learns large margin data from the from the ( 1− µ̂ ) N examples . 2. has small gradient after learning these data . 3. memorizes the remaining small margin data from the µ̂N examples using the noises . The model thus reaches zero training and manages to classify the large margin data at test . However , it fails to classify the small margin data because of the memorization step during training . Why does GD+M generalize better than GD ? Since the large margin data are dominant , GD focus in priority on these examples to decrease its training loss . However , after fitting this data , it significantly lowers its gradient . The gradient is thus not large enough for learning the small margin data . Similarly , GD+M fits the large margin data and subsequently gets a small gradient . However , contrary to GD , GD+M has large historical gradients in his momentum gradient . These gradients helped to learn the feature in the large margin data . They also help to learn small margin data since all the examples share the same feature . GD+M therefore uses his momentum to learn the small margin data . We name this process historical feature amplification and believe that it is key to understand why momentum improves generalization . Empirical justification . We also provide an empirical justification that such phenomenon does happen in a real-world setting as reported in Figure 4 . In this experiment , we create small margin data in the CIFAR-10 dataset by respectively lowering the resolution of 10 % of the training and test images , adding Gaussian noise of variance 0.005 and randomly shuffling the RGB channels . Figure 4 shows that even though both algortihms reach zero training error and 100 % training accuracy , GD+M gets higher generalization than GD on this decimated dataset . Above all , at test , GD+M performs as well on small and large margin data while GD does relatively worse on small margin data.Indeed , the relative accuracy drop for GD+M is 80.36/83.32 = 0.97 while for GD is equal to 65.14/73.69 = 0.88 . Our paper is organized as follows . In Section 2 , we formally define the data distribution equation ( D ) , the model and algorithms we use to learn it . Lastly , Section 3 presents our main theorems and provide a proof sketch in Section 4 and Section 5 . Additional experiments can be found in the Appendix . MORE RELATED WORK Momentum in convex setting . GD+M ( a.k.a . heavy ball or Polyak momentum ) consists in calculating the exponentially weighted average of the past gradients and using it to update the weights . For convex functions near a strict twice-differentiable minimum , GD+M is optimal regarding local convergence rate Polyak ( 1963 ; 1964 ) ; Nemirovskij & Yudin ( 1983 ) ; Nesterov ( 2003 ) . However , it may fail to converge globally for general strongly convex twice-differentiable functions Lessard et al . ( 2015 ) and is no longer optimal for the class of smooth convex functions . In the stochastic setting , GD+M is more sensitive to noise in the gradients ; that is , to preserve their improved convergence rates , significantly less noise is required d ’ Aspremont ( 2008 ) ; Schmidt et al . ( 2011 ) ; Devolder et al . ( 2014 ) ; Kidambi et al . ( 2018 ) . Finally , other momentum methods are extensively used for convex functions such as Nesterov ’ s accelerated gradient Nesterov ( 1983 ) . Our paper focuses on the use of GD+M and contrary to the aforementioned papers , our setting is non-convex and we mainly focus on the generalization of the model learned by GD and GD+M when both methods converge to global optimal . We underline that contrary to the non-convex world , generalization is typically disentangled with optimization for ( strictly ) convex functions . Non-convex optimization with momentum . A long line of work consists in understanding the convergence speed of momentum methods when optimizing non-convex functions . Mai & Johansson ( 2020 ) ; Liu et al . ( 2020 ) ; Cutkosky & Mehta ( 2020 ) ; Defazio ( 2020 ) show that SGD+M reaches a stationary point as fast as SGD under diverse assumptions . Besides , Leclerc & Madry ( 2020 ) empirically shows that momentum accelerates neural network training for small learning rates and slows it down otherwise . Our paper differs from these works as we work in the batch setting and theoretically investigate the generalization benefits brought by momentum ( and not the training ones ) . Generalization with momentum . Momentum-based methods such as SGD+M , RMSProp ( Tieleman & Hinton , 2012 ) and Adam ( Kingma & Ba , 2014 ) are standard in deep learning training since the seminal work of Sutskever et al . ( 2013 ) . Although its well accepted that Momentum improve generalization in deep learning , only a few works formally investigate the role of momentum in generalization . Leclerc & Madry ( 2020 ) empirically reports that momentum yields higher generalization when using a large learning rate . However , they assert that this benefit can be obtained by applying an even larger learning rate on vanilla SGD . We suspect that this observation is due to batch normalization ( BN ) which is known to dramatically bias the algorithm ’ s generalization ( Lyu & Li , 2019 ) . In Appendix , we report that BN reduces the generalization gain of momentum comparing to without BN . To our knowledge , our work is first that theoretically investigate the generalization of momentum in deep learning .
The authors provide a new perspective on the why momentum is useful for generalization in neural networks. They provide motivating intuition around why momentum is not always useful (including a great toy example), as well as empirical experiments on CIFAR-10. Finally, the authors prove a variety of theorems on a synthetic problem where momentum provably results in greater generalization.
SP:a61371a46f25f449ee58bc1c0546f4dd174aa0f9
Towards understanding how momentum improves generalization in deep learning
1 INTRODUCTION . It is commonly accepted that adding momentum to an optimization algorithm is required to optimally train a large-scale deep network . Most of the modern architectures maintain during the training process a heavy momentum close to 1 ( Krizhevsky et al. , 2012 ; Simonyan & Zisserman , 2014 ; He et al. , 2016 ; Zagoruyko & Komodakis , 2016 ) . Indeed , it has been empirically observed that architectures trained with momentum outperform those which are trained without ( Sutskever et al. , 2013 ) . Several papers have attempted to explain this phenomenon . From the optimization perspective , Defazio ( 2020 ) assert that momentum yields faster convergence of the training loss since , at the early stages , it cancels out the noise from the stochastic gradients . On the other hand , Leclerc & Madry ( 2020 ) empirically observes that momentum yields faster training convergence only when the learning rate is small . While these works shed light on how momentum acts on neural network training , they fail to capture the generalization improvement induced by momentum ( Sutskever et al. , 2013 ) . Besides , the noise reduction property of momentum advocated by Defazio ( 2020 ) seems to even contradict the observation that , in deep learning , having a large noise in the training improves generalization ( Li et al. , 2019 ; HaoChen et al. , 2020 ) . To the best of our knowledge , there is no existing work which theoretically explains how momentum improves generalization in deep learning . Therefore , this paper aims to close this gap and addresses the following question : Is the higher generalization induced by momentum tied to the stochastic noise of the gradient ? If not , what is the underlying mechanism of momentum improving generalization in deep learning ? In this paper , we empirically verify that the generalization improvement induced by momentum is not tied to the stochasticity of the gradient . Indeed , as reported in Figure 1 , momentum improves generalization more significantly for full batch GD than for SGD in CIFAR object recognition tasks . Motivated by this empirical observation and the fact that the stochastic noise influences generalization , we theoretically study how gradient descent with momentum ( GD+M ) can generalize better than vanilla gradient descent ( GD ) . We therefore only focus on the contribution of momentum of the true gradient on generalization . The question we address concerns algorithmic regularization which characterizes the generalization of an optimization algorithm when multiple global solutions exist in over-parameterized deep learning model Soudry et al . ( 2018 ) ; Lyu & Li ( 2019 ) ; Ji & Telgarsky ( 2019 ) ; Chizat & Bach ( 2020 ) ; Gunasekar et al . ( 2018 ) ; Arora et al . ( 2019 ) . This regularization arises in deep learning mainly due to the nonconvexity of the objective function . Indeed , this latter can create multiple global minima scattered in the space that vastly differ in terms of generalization . Algorithmic regularization is induced by and depends on many factors such as learning rate and batch size ( Goyal et al. , 2017 ; Hoffer et al. , 2017 ; Keskar et al. , 2016 ; Smith et al. , 2018 ) , initialization Allen-Zhu & Li ( 2020 ) , adaptive step-size ( Kingma & Ba , 2014 ; Neyshabur et al. , 2015 ; Wilson et al. , 2017 ) , batch normalization ( Arora et al. , 2018 ; Hoffer et al. , 2019 ; Ioffe & Szegedy , 2015 ) and dropout ( Srivastava et al. , 2014 ; Wei et al. , 2020 ) . However , none of these works theoretically analyzes the regularization induced by momentum . We therefore start our investigation by raising the following question : Does momentum unconditionally improve generalization in deep learning ? This question could be positively answered given the success of momentum for learning distinct architectures such as ResNets ( He et al. , 2016 ) or BERT ( Devlin et al. , 2018 ) . However , we here empirically give a negative answer through the following synthetic example in deep learning . We consider a binary classification problem where data-points are generated from a standard normal distribution and labels are outputs of teacher networks . Starting from the same initialization , we train different over-parametrized student networks using GD and GD+M . Based on Table 1 , whether the target function is simple ( linear ) or complex ( neural network ) , momentum does not improve generalization even when using a non-linear neural network as learner . The same observation holds for SGD/SGD+M as shown in the Appendix . Therefore , momentum does not always lead to a higher generalization in deep learning . Instead , such benefit seems to heavily depend on both the structure of the data and the learning problem . On which data set does momentum help generalization ? In this paper , in order to determine the underlying mechanism produced by momentum to improve generalization , we design a binary classification problem with a simple data structure where training a two-layer ( overparameterized ) convolutional network with momentum provably improves generalization in deep learning . It is built upon a data distribution that relies on the concepts of feature and margin . Informally , each example in this distribution is a 1D image having P patches . One of the patches ( the signal patch ) contains a feature we want to learn and all the others are Gaussian random noise with small variance . Mathematically , one can think of a feature as a vectorw∗ ∈ Rd.We assume that our training examples are divided into large margin data where the signal is αw∗ with α constant and small margin data where the signal is βw∗ with β 1 . Intuitively , the second type of data is inherently noisier as the margin is small and therefore , a classifier would struggle more to generalize on this type of data . We underline that all the examples share the same feature but differ in the intensity of the signal . We consider a training dataset of size N with the following split for µ̂ 1 : ( 1− µ̂ ) N datapoints are with large margin , µ̂N datapoints are with small margin data . ( D ) Figure 2 sketches equation ( D ) in a 2D setting . We emphasize that datasets having similar features and different margins are common in the real-world . Examples include object-recognition datasets such as CIFAR ( Krizhevsky et al. , 2009 ) or Imagenet ( Deng et al. , 2009 ) ( for example , the “ wheel feature ” of a car can be strong or weak depending on the orientation of the car ) . More specifically , we believe that the dataset ( D ) can be viewed as a simplified model of these object-recognition datasets . In this context , the following informal theorems characterize the generalization of the GD and GD+M models . They dramatically simplify Theorem 3.1 and Theorem 3.2 but highlight the intuitions behind our results . Theorem 1.1 ( Informal , GD+M ) . There exists a dataset of the form ( D ) with size N such that a two-layer ( over-parameterized ) convolutional network trained with GD+M : 1. initially only learns large margin data from the ( 1− µ̂ ) N examples . 2. has large historical gradients that contain the feature w∗ present in small margin data . 3. keeps learning the feature in the small margin data using its momentum historical gradients . The model thus reaches zero training error and perfectly classify large and small margin data at test . Theorem 1.2 ( Informal , GD ) . There exists a dataset of the form ( D ) with sizeN such that a two-layer ( over-parameterized ) convolutional network trained with GD : 1. initially only learns large margin data from the from the ( 1− µ̂ ) N examples . 2. has small gradient after learning these data . 3. memorizes the remaining small margin data from the µ̂N examples using the noises . The model thus reaches zero training and manages to classify the large margin data at test . However , it fails to classify the small margin data because of the memorization step during training . Why does GD+M generalize better than GD ? Since the large margin data are dominant , GD focus in priority on these examples to decrease its training loss . However , after fitting this data , it significantly lowers its gradient . The gradient is thus not large enough for learning the small margin data . Similarly , GD+M fits the large margin data and subsequently gets a small gradient . However , contrary to GD , GD+M has large historical gradients in his momentum gradient . These gradients helped to learn the feature in the large margin data . They also help to learn small margin data since all the examples share the same feature . GD+M therefore uses his momentum to learn the small margin data . We name this process historical feature amplification and believe that it is key to understand why momentum improves generalization . Empirical justification . We also provide an empirical justification that such phenomenon does happen in a real-world setting as reported in Figure 4 . In this experiment , we create small margin data in the CIFAR-10 dataset by respectively lowering the resolution of 10 % of the training and test images , adding Gaussian noise of variance 0.005 and randomly shuffling the RGB channels . Figure 4 shows that even though both algortihms reach zero training error and 100 % training accuracy , GD+M gets higher generalization than GD on this decimated dataset . Above all , at test , GD+M performs as well on small and large margin data while GD does relatively worse on small margin data.Indeed , the relative accuracy drop for GD+M is 80.36/83.32 = 0.97 while for GD is equal to 65.14/73.69 = 0.88 . Our paper is organized as follows . In Section 2 , we formally define the data distribution equation ( D ) , the model and algorithms we use to learn it . Lastly , Section 3 presents our main theorems and provide a proof sketch in Section 4 and Section 5 . Additional experiments can be found in the Appendix . MORE RELATED WORK Momentum in convex setting . GD+M ( a.k.a . heavy ball or Polyak momentum ) consists in calculating the exponentially weighted average of the past gradients and using it to update the weights . For convex functions near a strict twice-differentiable minimum , GD+M is optimal regarding local convergence rate Polyak ( 1963 ; 1964 ) ; Nemirovskij & Yudin ( 1983 ) ; Nesterov ( 2003 ) . However , it may fail to converge globally for general strongly convex twice-differentiable functions Lessard et al . ( 2015 ) and is no longer optimal for the class of smooth convex functions . In the stochastic setting , GD+M is more sensitive to noise in the gradients ; that is , to preserve their improved convergence rates , significantly less noise is required d ’ Aspremont ( 2008 ) ; Schmidt et al . ( 2011 ) ; Devolder et al . ( 2014 ) ; Kidambi et al . ( 2018 ) . Finally , other momentum methods are extensively used for convex functions such as Nesterov ’ s accelerated gradient Nesterov ( 1983 ) . Our paper focuses on the use of GD+M and contrary to the aforementioned papers , our setting is non-convex and we mainly focus on the generalization of the model learned by GD and GD+M when both methods converge to global optimal . We underline that contrary to the non-convex world , generalization is typically disentangled with optimization for ( strictly ) convex functions . Non-convex optimization with momentum . A long line of work consists in understanding the convergence speed of momentum methods when optimizing non-convex functions . Mai & Johansson ( 2020 ) ; Liu et al . ( 2020 ) ; Cutkosky & Mehta ( 2020 ) ; Defazio ( 2020 ) show that SGD+M reaches a stationary point as fast as SGD under diverse assumptions . Besides , Leclerc & Madry ( 2020 ) empirically shows that momentum accelerates neural network training for small learning rates and slows it down otherwise . Our paper differs from these works as we work in the batch setting and theoretically investigate the generalization benefits brought by momentum ( and not the training ones ) . Generalization with momentum . Momentum-based methods such as SGD+M , RMSProp ( Tieleman & Hinton , 2012 ) and Adam ( Kingma & Ba , 2014 ) are standard in deep learning training since the seminal work of Sutskever et al . ( 2013 ) . Although its well accepted that Momentum improve generalization in deep learning , only a few works formally investigate the role of momentum in generalization . Leclerc & Madry ( 2020 ) empirically reports that momentum yields higher generalization when using a large learning rate . However , they assert that this benefit can be obtained by applying an even larger learning rate on vanilla SGD . We suspect that this observation is due to batch normalization ( BN ) which is known to dramatically bias the algorithm ’ s generalization ( Lyu & Li , 2019 ) . In Appendix , we report that BN reduces the generalization gain of momentum comparing to without BN . To our knowledge , our work is first that theoretically investigate the generalization of momentum in deep learning .
Through some experiments, this paper claims that momentum does not always lead to a higher generalization in deep learning and such benefit seems to heavily depend on both the structure of the data and the learning problem. Then, the authors considered a certain data structure (large and small margin data) and learning problem (binary classification problem with 2-layer CNN model and logistic loss). Under this special case, the authors shown that both GD and GDM reach zero training error and perfectly classify large margin data, but GD fails to classify the small margin data while GDM can still perfect classify small margin data due to the historical gradients caused by the momentum.
SP:a61371a46f25f449ee58bc1c0546f4dd174aa0f9
Instance-Adaptive Video Compression: Improving Neural Codecs by Training on the Test Set
1 INTRODUCTION . Neural compression methods have enormous potential to improve the efficiency of video coding . With video constituting the large majority of internet traffic , this has significant implications for the internet at large ( Sandvine , 2019 ) . State-of-the-art algorithms model each frame by warping the previous one with a neural estimate of the optical flow ( Lu et al. , 2019 ) or scale-space flow ( Agustsson et al. , 2020 ) and adding residuals modeled by another network . Both the optical flow and the residuals are compressed with variational autoencoders . Such neural codecs have recently achieved results on par with popular classical codecs ( Agustsson et al. , 2020 ; Rippel et al. , 2021 ; Pourreza & Cohen , 2021 ) such as H.264 / AVC ( Wiegand et al. , 2003 ) and H.265 / HEVC ( Sullivan et al. , 2012 ) . However , relatively little research has focused on their computational complexity , and matching the rate-distortion performance of H.266 / VVC ( Bross et al. , 2018 ) is still an open problem . Neural video codecs depend critically on generalization : they are developed assuming that a good performance on training and validation datasets translates to a good performance at test time . However , this assumption does not always hold in practice , for instance because of limited training data or imperfect optimization . Domain shift is a particularly challenging problem given the variety in video content and styles ; for instance , neural video codecs trained on natural scene video data often perform poorly on animated sequences ( Agustsson et al. , 2020 ) . Here we address this problem by optimizing the autoencoder — finetuning its weights — for each single video to be compressed at test time . After training on the test set in this way , the finetuned network parameters need to be made available on the receiver side : they are compressed , quantized , and entropy-coded under a suitable prior to the bitstream along with the latent code . Optimizing the compression network for every video in this way relaxes the requirement of training data that closely matches the test distribution as well as the necessary model capacity . It also allows trading off encoding compute for better compression efficiency . The essential idea of instance-adaptive finetuning was recently proposed by van Rozendaal et al . ( 2021 ) . The authors demonstrated the idea on I-frame compression , i. e. compressing a set of similar images , but did not apply it to video sequences yet . In this work we extend the idea to the compression of full videos , in which only periodic key frames are compressed as images and most frames are encoded relative to one or two reference frames . Our method is general and can be applied to various settings and base models . We first demonstrate it in a low-latency setting with I-frames and P-frames using a scale-space flow architecture ( Agustsson et al. , 2020 ) as base model . Next we show its performance in a B-frame setting , using the base model proposed by Pourreza & Cohen ( 2021 ) . On the UVG-1k , HEVC class-B , and Xiph-5N datasets , our new instance-adaptive video compression codec yields BD-rate savings of 17 to 26 % over the respective base models and 5 to 44 % over the popular ffmpeg ( x265 ) implementation of the H.265 codec ( FFmpeg ; VideoLAN , b ) . In addition , instance-adaptive finetuning lends itself to a possible reduction in model size , because a smaller network may suffice to model a single instance . We show that in this framework smaller models can still outperform most neural codecs while reducing the computational complexity of the decoder by 72 % . Overall , we demonstrate that unlike other neural video codecs , our method can trade off encoding compute against compression performance , and that this trade-off is more effective than for classical codecs . 2 RELATED WORK . Neural video compression The standard framework used by most neural compression codecs ( either implicitly or explicitly ) is that of the variational ( Kingma & Welling , 2014 ) or compressive ( Theis et al. , 2017 ) autoencoder . An encoder ( or approximate posterior ) qφ ( z|x ) maps a data point x to a latent representation z . This latent is transmitted to the decoding party by means of entropy coding under a latent prior pθ ( z ) . The receiver can then reconstruct the sample with a decoder ( or likelihood ) pθ ( x|z ) . The encoder , prior , and decoder are neural networks , parameterized by weights φ , θ as indicated by the subscripts . These models are trained by minimizing the rate-distortion loss LRD ( φ , θ ) = Ex∼p ( x ) [ β Ez∼qφ ( z|x ) [ − log pθ ( z ) ] ︸ ︷︷ ︸ Rz +Ez∼qφ ( z|x ) [ − log pθ ( x|z ) ] ︸ ︷︷ ︸ D ] , ( 1 ) which combines a distortion metric D and a rate term Rz that approximates the bitrate necessary to transmit the latent code z . Up to a constant entropy term H [ qφ ] , this loss equals the β-weighted VAE loss ( Habibian et al. , 2019 ; Higgins et al. , 2017 ) . Much research has focused on the design of efficient network architectures for neural video codecs , in particular with respect to the temporal structure . While some earlier works were based on 3D convolutions ( Habibian et al. , 2019 ; Pessoa et al. , 2020 ) , recent models use optical flow and residual modeling to exploit similarities between frames . The latter class of approaches can be divided into predictive or P-frame temporal modeling , where the model for each frame xt is conditional on the previous frame ( s ) ( Agustsson et al. , 2020 ; Chen et al. , 2019 ; Liu et al. , 2020 ; Lombardo et al. , 2019 ; Lu et al. , 2019 ; Rippel et al. , 2019 ; Golinski et al. , 2020 ; Rippel et al. , 2021 ; Hu et al. , 2020 ; Yang et al. , 2020b ) , and bidirectional or B-frame modeling , where each frame is conditioned on past as well as future reference frames ( Cheng et al. , 2019 ; Choi & Bajić , 2019 ; Djelouah et al. , 2019 ; Wu et al. , 2018 ; Park & Kim , 2021 ; Pourreza & Cohen , 2021 ; Yang et al. , 2020a ) . Agustsson et al . ( 2020 ) generalize optical flow to scale-space flow by adding dynamic blurring to the warping operation , improving the modeling of uncertainty and leading to state-of-the-art results . Instance-adaptive compression Rate-distortion autoencoders are trained by minimizing the RD loss in Eq . ( 1 ) over a training dataset D. This approach relies on the assumptions that the model is not only able to fit the training data well , but also generalizes to unseen datapoints at inference time . In practice , however , finite training data , limited model capacity , optimization imperfections , and domain shift — differences between train and test distributions — can degrade the performance . This problem can be solved by adapting video codecs to each sequence at test time . Several such methods have been proposed , see Appendix A for an in-depth overview that also covers image compression . These works can be roughly categorized into encoder-only finetuning , limited decoder finetuning , and hybrid classical-neural codecs . Works in the first category ( e. g. Lu et al . ( 2020 ) ) optimize the encoder parameters φ for each data point . Such an update does not have to be communicated to the receiver side . This approach alleviates the generalization problem for the encoder , but does not solve it for the decoder and prior . We will demonstrate later that encoder-only finetuning leads to a limited improvement in the compression performance . The second category of works also adapt parts of the prior and decoder for each video instance . Since these modules need to be known on the receiver side , such an update needs to be signalled in the bitstream . Depending on the implementation , this may increase the bitrate substantially . Aytekin et al . ( 2018 ) ; Zou et al . ( 2020 ) ; Wang et al . ( 2021 ) address this by only allowing limited changes to the decoder-side models , for instance choosing one out of a number of fixed decoder networks , thus limiting the potentialRD gains of these methods . Finally , the third category of works propose a hybrid approach , where a video is first compressed by a classical codec and a finetuned enhancement network is added to the bitstream ( He et al. , 2020 ; 2021 ; Klopp et al. , 2020 ; 2021 ; Liu et al. , 2021 ) . Although these methods have shown great performance at low bitrates , they tend to perform less well at higher bitrates , and do not benefit from developments in end-to-end neural compression . van Rozendaal et al . ( 2021 ) suggest a method to adapt the full model to a single datapoint . The key idea is that the parameter updates δ = θ − θD , where θD are the global model parameters resulting from training onD , can be be transmitted very efficiently . After discretization , the quantized updates δ̄ are entropy-coded under a parameter update prior p [ δ̄ ] that assigns high probability mass ( and thus low transmission cost ) to zero-updates δ̄ = 0 . This procedure enables a neural codec in which the full model — encoder , decoder , and prior — is finetuned on each data sample at test time by minimizing the loss LInstA ( φ , δ ) = LRD ( φ , θD + δ̄ ) + β ( − log p ( δ ) ) ︸ ︷︷ ︸ Rθ . ( 2 ) The Rθ term reflects the increased bitstream length from coding the parameter updates δ̄ . In van Rozendaal et al . ( 2021 ) , this approach was successfully demonstrated on I-frame compression , essentially compressing a set of images with similar content . In this work we adapt it to the compression of full video sequences , as we will describe in the following section . 3 INSTANCE-ADAPTIVE VIDEO COMPRESSION . We now introduce our instance-adaptive compression codec for full video sequences , or InstA for short . The key idea is to optimize the parameters of a rate-distortion VAE for each video sequence to be transmitted , and to send the relevant network parameters in a rate-efficient way to the decoder . This approach can be beneficial whenever a standard rate-distortion autoencoder would not generalize well , for instance because of limited training data or domain shift . In addition , instance adaptation allows us to use smaller models while maintaining most of the compression performance . While encoding the network parameters to the bitstream increases the length of the code , we describe a compression scheme in which this cost is negligible , especially when amortized over many frames of a video sequence . Our approach is agnostic about the base model and we demonstrate it on two different architectures : a scale-space flow model in the low-latency setting and the B-EPIC model in the B-frame setting . In the following , we first describe the base models , before describing how InstA compresses and decompresses video sequences . Low-latency base model : Scale-space flow ( SSF ) We first focus on the low-latency setting , which we define as having only access to current or previous frames when decoding a frame . As a base model for this setting , we use the scale-space-flow architecture introduced by Agustsson et al . ( 2020 ) . Any video sequence is first split into groups of pictures ( GoP ) . The first frame in each GoP is modeled as an image without any dependency on previous frames , i. e. as an I-frame . All other frames are P-frames , modeled as xi = Scale-Space-Warp ( xi−1 , gi ) + ri , ( 3 ) where xi−1 is the reconstructed previous frame , gi is the estimated scale-space flow field , ri is the estimated residual , and the scale-space warping operation performs optical-flow warping of the previous frame with a dynamic , position-dependent amount of Gaussian blur . The I-frame images , P-frame scale-space flow gi , and P-frame residuals ri are compressed with separate hyperprior models ( Ballé et al. , 2018 ) , a hierarchical variational autoencoder architecture . We largely follow the architecture choices of Agustsson et al . ( 2020 ) and refer to this model as SSF18 after its number of decoder-side parameters ( in millions ) . In Appendix C we describe the architecture in detail and highlight the differences to Agustsson et al . ( 2020 ) . Smaller low-latency base models As our instance-adaptive approach is based on finetuning the compression model on a low-entropy “ dataset ” ( a single video sequence ) , we hypothesize that it does not require the full expressivity of the computationally complex SSF18 model . We propose three alternative scale-space flow architectures with a reduced computational complexity . In Tbl . 1 we list the parameter counts and the number of multiply-accumulate ( MAC ) operations required for decoding a sequence , which are reduced by 43–84 % compared to the SSF18 baseline . The architectures of the four SSF models are described in detail in Appendix C. B-frame base model : B-EPIC We also consider a less constrained setting , in which frames can be compressed as B-frames as well , i. e. using both a previous frame and a future frame as reference points . This flexibility allows for even more efficient compression and is used for instance for ondemand video streaming . As a base model we choose the B-EPIC architecture ( Pourreza & Cohen , 2021 ) . Again , the video is split into GoPs . The very first frame of a video is modeled as an Iframe , while the last frame in each GoP is a P-frame , using the last frame of the preceeding GoP as reference ; both I-frame and P-frames are compressed as in the SSF model . Any other frame xi is modeled as a B-frame : it is assigned a past reference frame xj ( j < i ) and a future reference frame xk ( k > i ) ; an off-the-shelf Super-SloMo frame interpolator ( Jiang et al. , 2018 ) is used to interpolate between these two reference frames . The interpolated frame is then used as a basis for scale-space flow warping : xi = Scale-Space-Warp ( Super-SloMo ( xj , xk ) , gi ) + ri . ( 4 ) The interpolated frame provides a more useful starting point for optical-flow warping than the previous frame , e. g. because the combination of past and future knowledge may avoid occlusion effects . Again , I-frames , optical flow , and residuals are modeled with three separate hyperprior models and the model is trained on the RD loss in Eq . ( 1 ) . We only consider a single configuration and use hyperparameters and checkpoints from Pourreza & Cohen ( 2021 ) . This model has 38.5 million parameters , 23.2 million of which are on the decoder side . Encoding a video sequence Our procedure conceptually follows van Rozendaal et al . ( 2021 ) . For completeness we shall describe the full method here . A video sequence x is compressed by : 1 . Finetuning the model parameters ( θ , φ ) of the base model on the sequence x using Eq . ( 2 ) , 2. computing the latent codes z ∼ qφ ( z|x ) , 3. parameterizing the finetuned decoder and prior parameters as updates δ = θ − θD , 4. quantizing latent codes z and network updates δ , and 5. compressing the quantized latents z̄ and updates δ̄ with entropy coding to the bitstream . To finetune a pretrained base compression model , we start with the global model with parameters ( θD , φD ) and minimize the rate-distortion loss given in Eq . ( 2 ) — but only over the single video sequence x . This modified rate-distortion loss explicitly includes the bitrate required to send model updates δ under an update prior p ( δ ) . We compute the regularizing Rθ loss with the unquantized updates δ , but use the quantized parameter updates θD + δ̄ to calculate the D and Rz loss terms , using a straight-trough estimator ( Bengio et al. , 2013 ) in the backward pass . Sending the updated network parameters of course adds to the length of the bitstream . This is even the case when finetuning does not lead to changed parameters ( δ̄ = 0 ) . Given the large size of the neural model we consider , it is therefore essential to choose an update prior that assigns a large probability mass to zero-updates δ̄ = 0 . This allows the network to transmit trivial updates at a negligible rate cost , while giving it the freedom to invest bit cost in non-trivial parameter updates that improve the performance substantially . We use a spike-and-slab prior ( Johnstone & Titterington , 2009 ; van Rozendaal et al. , 2021 ) , a mixture model of a narrow and a wide Gaussian distribution given by p ( δ ) = N ( δ|0 , σ21 ) + αN ( δ ∣∣0 , s21 ) 1 + α , ( 5 ) where the “ slab ” component with variance σ2 keeps the bitrate cost for sizable updates down , and the “ spike ” component with the narrow standard deviation s σ ensures cheap zero-updates . The mixing weight α is a tunable hyperparameter . At the beginning of the finetuning procedure , our neural model is equal to the global model . Because of the spike-slab update prior , the rate cost is only marginally increased and the compression performance essentially equal to the global model . During finetuning , the rate-distortion performance gradually improves , giving us an anytime algorithm that we can stop prematurely to get the best compression performance within a given encoder compute budget . After the model has converged or a compute budget has been exhausted , we use the finetuned encoder qφ to find the latent code z corresponding to the video sequence x . Both z and the updates to prior and decoder δ , which will be necessary to decode the video sequence , are quantized . To discretize the updates δ , we use a fixed grid of n equal-sized bins of width t centered around δ = 0 . We choose n such that p ( −n/t < δ < n/t ) ≈ 1− and clip values at the tails . The quantization of z is analogous , except that we use a bin width of t = 1 and do not clip the values at the tails ( in line with Ballé et al . ( 2018 ) ) . Finally , we write the quantized updates δ̄ and quantized codes z̄ to the bitstream . We use entropy coding under the quantized update prior p ( δ̄ ) and finetuned prior pθD+δ̄ ( z̄ ) , respectively . For latent codes in the tail region we use Exp-Golomb coding ( Wiegand et al. , 2003 ) . Decoding a video sequence The receiver first decodes the prior and decoder updates δ̄ from the bitstream . Once θ̄ = θD + δ̄ is known on the decoder side , the latents z are decoded with the prior pθ̄ ( z ) and the video sequence is reconstructed with the decoder pθ̄ ( x|z ) following standard VAE protocol . The only overhead on the decoder side is therefore the initial decoding of δ̄ . While this results in a small delay before the first frame can be decoded , in practice this delay is very short ( below 0.2 seconds in our experiments ) .
This paper tried to close the domain gap between the training and testing dataset for the learned video compression. An instance-adaptive video compression approach is proposed by updating the model parameters of the video codecs and the optimal parameters are transmitted to the decoder. Besides, the authors modeled the updated model parameters under a mixture prior model, which further reduces the bit cost. Experimental results on several datasets demonstrated the effectiveness of this approach.
SP:504ee69e2327b3ee363f1c9eeb779654c8e3925f
Instance-Adaptive Video Compression: Improving Neural Codecs by Training on the Test Set
1 INTRODUCTION . Neural compression methods have enormous potential to improve the efficiency of video coding . With video constituting the large majority of internet traffic , this has significant implications for the internet at large ( Sandvine , 2019 ) . State-of-the-art algorithms model each frame by warping the previous one with a neural estimate of the optical flow ( Lu et al. , 2019 ) or scale-space flow ( Agustsson et al. , 2020 ) and adding residuals modeled by another network . Both the optical flow and the residuals are compressed with variational autoencoders . Such neural codecs have recently achieved results on par with popular classical codecs ( Agustsson et al. , 2020 ; Rippel et al. , 2021 ; Pourreza & Cohen , 2021 ) such as H.264 / AVC ( Wiegand et al. , 2003 ) and H.265 / HEVC ( Sullivan et al. , 2012 ) . However , relatively little research has focused on their computational complexity , and matching the rate-distortion performance of H.266 / VVC ( Bross et al. , 2018 ) is still an open problem . Neural video codecs depend critically on generalization : they are developed assuming that a good performance on training and validation datasets translates to a good performance at test time . However , this assumption does not always hold in practice , for instance because of limited training data or imperfect optimization . Domain shift is a particularly challenging problem given the variety in video content and styles ; for instance , neural video codecs trained on natural scene video data often perform poorly on animated sequences ( Agustsson et al. , 2020 ) . Here we address this problem by optimizing the autoencoder — finetuning its weights — for each single video to be compressed at test time . After training on the test set in this way , the finetuned network parameters need to be made available on the receiver side : they are compressed , quantized , and entropy-coded under a suitable prior to the bitstream along with the latent code . Optimizing the compression network for every video in this way relaxes the requirement of training data that closely matches the test distribution as well as the necessary model capacity . It also allows trading off encoding compute for better compression efficiency . The essential idea of instance-adaptive finetuning was recently proposed by van Rozendaal et al . ( 2021 ) . The authors demonstrated the idea on I-frame compression , i. e. compressing a set of similar images , but did not apply it to video sequences yet . In this work we extend the idea to the compression of full videos , in which only periodic key frames are compressed as images and most frames are encoded relative to one or two reference frames . Our method is general and can be applied to various settings and base models . We first demonstrate it in a low-latency setting with I-frames and P-frames using a scale-space flow architecture ( Agustsson et al. , 2020 ) as base model . Next we show its performance in a B-frame setting , using the base model proposed by Pourreza & Cohen ( 2021 ) . On the UVG-1k , HEVC class-B , and Xiph-5N datasets , our new instance-adaptive video compression codec yields BD-rate savings of 17 to 26 % over the respective base models and 5 to 44 % over the popular ffmpeg ( x265 ) implementation of the H.265 codec ( FFmpeg ; VideoLAN , b ) . In addition , instance-adaptive finetuning lends itself to a possible reduction in model size , because a smaller network may suffice to model a single instance . We show that in this framework smaller models can still outperform most neural codecs while reducing the computational complexity of the decoder by 72 % . Overall , we demonstrate that unlike other neural video codecs , our method can trade off encoding compute against compression performance , and that this trade-off is more effective than for classical codecs . 2 RELATED WORK . Neural video compression The standard framework used by most neural compression codecs ( either implicitly or explicitly ) is that of the variational ( Kingma & Welling , 2014 ) or compressive ( Theis et al. , 2017 ) autoencoder . An encoder ( or approximate posterior ) qφ ( z|x ) maps a data point x to a latent representation z . This latent is transmitted to the decoding party by means of entropy coding under a latent prior pθ ( z ) . The receiver can then reconstruct the sample with a decoder ( or likelihood ) pθ ( x|z ) . The encoder , prior , and decoder are neural networks , parameterized by weights φ , θ as indicated by the subscripts . These models are trained by minimizing the rate-distortion loss LRD ( φ , θ ) = Ex∼p ( x ) [ β Ez∼qφ ( z|x ) [ − log pθ ( z ) ] ︸ ︷︷ ︸ Rz +Ez∼qφ ( z|x ) [ − log pθ ( x|z ) ] ︸ ︷︷ ︸ D ] , ( 1 ) which combines a distortion metric D and a rate term Rz that approximates the bitrate necessary to transmit the latent code z . Up to a constant entropy term H [ qφ ] , this loss equals the β-weighted VAE loss ( Habibian et al. , 2019 ; Higgins et al. , 2017 ) . Much research has focused on the design of efficient network architectures for neural video codecs , in particular with respect to the temporal structure . While some earlier works were based on 3D convolutions ( Habibian et al. , 2019 ; Pessoa et al. , 2020 ) , recent models use optical flow and residual modeling to exploit similarities between frames . The latter class of approaches can be divided into predictive or P-frame temporal modeling , where the model for each frame xt is conditional on the previous frame ( s ) ( Agustsson et al. , 2020 ; Chen et al. , 2019 ; Liu et al. , 2020 ; Lombardo et al. , 2019 ; Lu et al. , 2019 ; Rippel et al. , 2019 ; Golinski et al. , 2020 ; Rippel et al. , 2021 ; Hu et al. , 2020 ; Yang et al. , 2020b ) , and bidirectional or B-frame modeling , where each frame is conditioned on past as well as future reference frames ( Cheng et al. , 2019 ; Choi & Bajić , 2019 ; Djelouah et al. , 2019 ; Wu et al. , 2018 ; Park & Kim , 2021 ; Pourreza & Cohen , 2021 ; Yang et al. , 2020a ) . Agustsson et al . ( 2020 ) generalize optical flow to scale-space flow by adding dynamic blurring to the warping operation , improving the modeling of uncertainty and leading to state-of-the-art results . Instance-adaptive compression Rate-distortion autoencoders are trained by minimizing the RD loss in Eq . ( 1 ) over a training dataset D. This approach relies on the assumptions that the model is not only able to fit the training data well , but also generalizes to unseen datapoints at inference time . In practice , however , finite training data , limited model capacity , optimization imperfections , and domain shift — differences between train and test distributions — can degrade the performance . This problem can be solved by adapting video codecs to each sequence at test time . Several such methods have been proposed , see Appendix A for an in-depth overview that also covers image compression . These works can be roughly categorized into encoder-only finetuning , limited decoder finetuning , and hybrid classical-neural codecs . Works in the first category ( e. g. Lu et al . ( 2020 ) ) optimize the encoder parameters φ for each data point . Such an update does not have to be communicated to the receiver side . This approach alleviates the generalization problem for the encoder , but does not solve it for the decoder and prior . We will demonstrate later that encoder-only finetuning leads to a limited improvement in the compression performance . The second category of works also adapt parts of the prior and decoder for each video instance . Since these modules need to be known on the receiver side , such an update needs to be signalled in the bitstream . Depending on the implementation , this may increase the bitrate substantially . Aytekin et al . ( 2018 ) ; Zou et al . ( 2020 ) ; Wang et al . ( 2021 ) address this by only allowing limited changes to the decoder-side models , for instance choosing one out of a number of fixed decoder networks , thus limiting the potentialRD gains of these methods . Finally , the third category of works propose a hybrid approach , where a video is first compressed by a classical codec and a finetuned enhancement network is added to the bitstream ( He et al. , 2020 ; 2021 ; Klopp et al. , 2020 ; 2021 ; Liu et al. , 2021 ) . Although these methods have shown great performance at low bitrates , they tend to perform less well at higher bitrates , and do not benefit from developments in end-to-end neural compression . van Rozendaal et al . ( 2021 ) suggest a method to adapt the full model to a single datapoint . The key idea is that the parameter updates δ = θ − θD , where θD are the global model parameters resulting from training onD , can be be transmitted very efficiently . After discretization , the quantized updates δ̄ are entropy-coded under a parameter update prior p [ δ̄ ] that assigns high probability mass ( and thus low transmission cost ) to zero-updates δ̄ = 0 . This procedure enables a neural codec in which the full model — encoder , decoder , and prior — is finetuned on each data sample at test time by minimizing the loss LInstA ( φ , δ ) = LRD ( φ , θD + δ̄ ) + β ( − log p ( δ ) ) ︸ ︷︷ ︸ Rθ . ( 2 ) The Rθ term reflects the increased bitstream length from coding the parameter updates δ̄ . In van Rozendaal et al . ( 2021 ) , this approach was successfully demonstrated on I-frame compression , essentially compressing a set of images with similar content . In this work we adapt it to the compression of full video sequences , as we will describe in the following section . 3 INSTANCE-ADAPTIVE VIDEO COMPRESSION . We now introduce our instance-adaptive compression codec for full video sequences , or InstA for short . The key idea is to optimize the parameters of a rate-distortion VAE for each video sequence to be transmitted , and to send the relevant network parameters in a rate-efficient way to the decoder . This approach can be beneficial whenever a standard rate-distortion autoencoder would not generalize well , for instance because of limited training data or domain shift . In addition , instance adaptation allows us to use smaller models while maintaining most of the compression performance . While encoding the network parameters to the bitstream increases the length of the code , we describe a compression scheme in which this cost is negligible , especially when amortized over many frames of a video sequence . Our approach is agnostic about the base model and we demonstrate it on two different architectures : a scale-space flow model in the low-latency setting and the B-EPIC model in the B-frame setting . In the following , we first describe the base models , before describing how InstA compresses and decompresses video sequences . Low-latency base model : Scale-space flow ( SSF ) We first focus on the low-latency setting , which we define as having only access to current or previous frames when decoding a frame . As a base model for this setting , we use the scale-space-flow architecture introduced by Agustsson et al . ( 2020 ) . Any video sequence is first split into groups of pictures ( GoP ) . The first frame in each GoP is modeled as an image without any dependency on previous frames , i. e. as an I-frame . All other frames are P-frames , modeled as xi = Scale-Space-Warp ( xi−1 , gi ) + ri , ( 3 ) where xi−1 is the reconstructed previous frame , gi is the estimated scale-space flow field , ri is the estimated residual , and the scale-space warping operation performs optical-flow warping of the previous frame with a dynamic , position-dependent amount of Gaussian blur . The I-frame images , P-frame scale-space flow gi , and P-frame residuals ri are compressed with separate hyperprior models ( Ballé et al. , 2018 ) , a hierarchical variational autoencoder architecture . We largely follow the architecture choices of Agustsson et al . ( 2020 ) and refer to this model as SSF18 after its number of decoder-side parameters ( in millions ) . In Appendix C we describe the architecture in detail and highlight the differences to Agustsson et al . ( 2020 ) . Smaller low-latency base models As our instance-adaptive approach is based on finetuning the compression model on a low-entropy “ dataset ” ( a single video sequence ) , we hypothesize that it does not require the full expressivity of the computationally complex SSF18 model . We propose three alternative scale-space flow architectures with a reduced computational complexity . In Tbl . 1 we list the parameter counts and the number of multiply-accumulate ( MAC ) operations required for decoding a sequence , which are reduced by 43–84 % compared to the SSF18 baseline . The architectures of the four SSF models are described in detail in Appendix C. B-frame base model : B-EPIC We also consider a less constrained setting , in which frames can be compressed as B-frames as well , i. e. using both a previous frame and a future frame as reference points . This flexibility allows for even more efficient compression and is used for instance for ondemand video streaming . As a base model we choose the B-EPIC architecture ( Pourreza & Cohen , 2021 ) . Again , the video is split into GoPs . The very first frame of a video is modeled as an Iframe , while the last frame in each GoP is a P-frame , using the last frame of the preceeding GoP as reference ; both I-frame and P-frames are compressed as in the SSF model . Any other frame xi is modeled as a B-frame : it is assigned a past reference frame xj ( j < i ) and a future reference frame xk ( k > i ) ; an off-the-shelf Super-SloMo frame interpolator ( Jiang et al. , 2018 ) is used to interpolate between these two reference frames . The interpolated frame is then used as a basis for scale-space flow warping : xi = Scale-Space-Warp ( Super-SloMo ( xj , xk ) , gi ) + ri . ( 4 ) The interpolated frame provides a more useful starting point for optical-flow warping than the previous frame , e. g. because the combination of past and future knowledge may avoid occlusion effects . Again , I-frames , optical flow , and residuals are modeled with three separate hyperprior models and the model is trained on the RD loss in Eq . ( 1 ) . We only consider a single configuration and use hyperparameters and checkpoints from Pourreza & Cohen ( 2021 ) . This model has 38.5 million parameters , 23.2 million of which are on the decoder side . Encoding a video sequence Our procedure conceptually follows van Rozendaal et al . ( 2021 ) . For completeness we shall describe the full method here . A video sequence x is compressed by : 1 . Finetuning the model parameters ( θ , φ ) of the base model on the sequence x using Eq . ( 2 ) , 2. computing the latent codes z ∼ qφ ( z|x ) , 3. parameterizing the finetuned decoder and prior parameters as updates δ = θ − θD , 4. quantizing latent codes z and network updates δ , and 5. compressing the quantized latents z̄ and updates δ̄ with entropy coding to the bitstream . To finetune a pretrained base compression model , we start with the global model with parameters ( θD , φD ) and minimize the rate-distortion loss given in Eq . ( 2 ) — but only over the single video sequence x . This modified rate-distortion loss explicitly includes the bitrate required to send model updates δ under an update prior p ( δ ) . We compute the regularizing Rθ loss with the unquantized updates δ , but use the quantized parameter updates θD + δ̄ to calculate the D and Rz loss terms , using a straight-trough estimator ( Bengio et al. , 2013 ) in the backward pass . Sending the updated network parameters of course adds to the length of the bitstream . This is even the case when finetuning does not lead to changed parameters ( δ̄ = 0 ) . Given the large size of the neural model we consider , it is therefore essential to choose an update prior that assigns a large probability mass to zero-updates δ̄ = 0 . This allows the network to transmit trivial updates at a negligible rate cost , while giving it the freedom to invest bit cost in non-trivial parameter updates that improve the performance substantially . We use a spike-and-slab prior ( Johnstone & Titterington , 2009 ; van Rozendaal et al. , 2021 ) , a mixture model of a narrow and a wide Gaussian distribution given by p ( δ ) = N ( δ|0 , σ21 ) + αN ( δ ∣∣0 , s21 ) 1 + α , ( 5 ) where the “ slab ” component with variance σ2 keeps the bitrate cost for sizable updates down , and the “ spike ” component with the narrow standard deviation s σ ensures cheap zero-updates . The mixing weight α is a tunable hyperparameter . At the beginning of the finetuning procedure , our neural model is equal to the global model . Because of the spike-slab update prior , the rate cost is only marginally increased and the compression performance essentially equal to the global model . During finetuning , the rate-distortion performance gradually improves , giving us an anytime algorithm that we can stop prematurely to get the best compression performance within a given encoder compute budget . After the model has converged or a compute budget has been exhausted , we use the finetuned encoder qφ to find the latent code z corresponding to the video sequence x . Both z and the updates to prior and decoder δ , which will be necessary to decode the video sequence , are quantized . To discretize the updates δ , we use a fixed grid of n equal-sized bins of width t centered around δ = 0 . We choose n such that p ( −n/t < δ < n/t ) ≈ 1− and clip values at the tails . The quantization of z is analogous , except that we use a bin width of t = 1 and do not clip the values at the tails ( in line with Ballé et al . ( 2018 ) ) . Finally , we write the quantized updates δ̄ and quantized codes z̄ to the bitstream . We use entropy coding under the quantized update prior p ( δ̄ ) and finetuned prior pθD+δ̄ ( z̄ ) , respectively . For latent codes in the tail region we use Exp-Golomb coding ( Wiegand et al. , 2003 ) . Decoding a video sequence The receiver first decodes the prior and decoder updates δ̄ from the bitstream . Once θ̄ = θD + δ̄ is known on the decoder side , the latents z are decoded with the prior pθ̄ ( z ) and the video sequence is reconstructed with the decoder pθ̄ ( x|z ) following standard VAE protocol . The only overhead on the decoder side is therefore the initial decoding of δ̄ . While this results in a small delay before the first frame can be decoded , in practice this delay is very short ( below 0.2 seconds in our experiments ) .
This paper proposes a video compression algorithm based on instance-adaptive learning. On each video sequence to be transmitted, the proposed method finetunes a pretrained compression model. The parameters' change are transmitted to the decoder with little bit-rate overhead. The experiments show the outstanding performance of the proposed method.
SP:504ee69e2327b3ee363f1c9eeb779654c8e3925f
Instance-Adaptive Video Compression: Improving Neural Codecs by Training on the Test Set
1 INTRODUCTION . Neural compression methods have enormous potential to improve the efficiency of video coding . With video constituting the large majority of internet traffic , this has significant implications for the internet at large ( Sandvine , 2019 ) . State-of-the-art algorithms model each frame by warping the previous one with a neural estimate of the optical flow ( Lu et al. , 2019 ) or scale-space flow ( Agustsson et al. , 2020 ) and adding residuals modeled by another network . Both the optical flow and the residuals are compressed with variational autoencoders . Such neural codecs have recently achieved results on par with popular classical codecs ( Agustsson et al. , 2020 ; Rippel et al. , 2021 ; Pourreza & Cohen , 2021 ) such as H.264 / AVC ( Wiegand et al. , 2003 ) and H.265 / HEVC ( Sullivan et al. , 2012 ) . However , relatively little research has focused on their computational complexity , and matching the rate-distortion performance of H.266 / VVC ( Bross et al. , 2018 ) is still an open problem . Neural video codecs depend critically on generalization : they are developed assuming that a good performance on training and validation datasets translates to a good performance at test time . However , this assumption does not always hold in practice , for instance because of limited training data or imperfect optimization . Domain shift is a particularly challenging problem given the variety in video content and styles ; for instance , neural video codecs trained on natural scene video data often perform poorly on animated sequences ( Agustsson et al. , 2020 ) . Here we address this problem by optimizing the autoencoder — finetuning its weights — for each single video to be compressed at test time . After training on the test set in this way , the finetuned network parameters need to be made available on the receiver side : they are compressed , quantized , and entropy-coded under a suitable prior to the bitstream along with the latent code . Optimizing the compression network for every video in this way relaxes the requirement of training data that closely matches the test distribution as well as the necessary model capacity . It also allows trading off encoding compute for better compression efficiency . The essential idea of instance-adaptive finetuning was recently proposed by van Rozendaal et al . ( 2021 ) . The authors demonstrated the idea on I-frame compression , i. e. compressing a set of similar images , but did not apply it to video sequences yet . In this work we extend the idea to the compression of full videos , in which only periodic key frames are compressed as images and most frames are encoded relative to one or two reference frames . Our method is general and can be applied to various settings and base models . We first demonstrate it in a low-latency setting with I-frames and P-frames using a scale-space flow architecture ( Agustsson et al. , 2020 ) as base model . Next we show its performance in a B-frame setting , using the base model proposed by Pourreza & Cohen ( 2021 ) . On the UVG-1k , HEVC class-B , and Xiph-5N datasets , our new instance-adaptive video compression codec yields BD-rate savings of 17 to 26 % over the respective base models and 5 to 44 % over the popular ffmpeg ( x265 ) implementation of the H.265 codec ( FFmpeg ; VideoLAN , b ) . In addition , instance-adaptive finetuning lends itself to a possible reduction in model size , because a smaller network may suffice to model a single instance . We show that in this framework smaller models can still outperform most neural codecs while reducing the computational complexity of the decoder by 72 % . Overall , we demonstrate that unlike other neural video codecs , our method can trade off encoding compute against compression performance , and that this trade-off is more effective than for classical codecs . 2 RELATED WORK . Neural video compression The standard framework used by most neural compression codecs ( either implicitly or explicitly ) is that of the variational ( Kingma & Welling , 2014 ) or compressive ( Theis et al. , 2017 ) autoencoder . An encoder ( or approximate posterior ) qφ ( z|x ) maps a data point x to a latent representation z . This latent is transmitted to the decoding party by means of entropy coding under a latent prior pθ ( z ) . The receiver can then reconstruct the sample with a decoder ( or likelihood ) pθ ( x|z ) . The encoder , prior , and decoder are neural networks , parameterized by weights φ , θ as indicated by the subscripts . These models are trained by minimizing the rate-distortion loss LRD ( φ , θ ) = Ex∼p ( x ) [ β Ez∼qφ ( z|x ) [ − log pθ ( z ) ] ︸ ︷︷ ︸ Rz +Ez∼qφ ( z|x ) [ − log pθ ( x|z ) ] ︸ ︷︷ ︸ D ] , ( 1 ) which combines a distortion metric D and a rate term Rz that approximates the bitrate necessary to transmit the latent code z . Up to a constant entropy term H [ qφ ] , this loss equals the β-weighted VAE loss ( Habibian et al. , 2019 ; Higgins et al. , 2017 ) . Much research has focused on the design of efficient network architectures for neural video codecs , in particular with respect to the temporal structure . While some earlier works were based on 3D convolutions ( Habibian et al. , 2019 ; Pessoa et al. , 2020 ) , recent models use optical flow and residual modeling to exploit similarities between frames . The latter class of approaches can be divided into predictive or P-frame temporal modeling , where the model for each frame xt is conditional on the previous frame ( s ) ( Agustsson et al. , 2020 ; Chen et al. , 2019 ; Liu et al. , 2020 ; Lombardo et al. , 2019 ; Lu et al. , 2019 ; Rippel et al. , 2019 ; Golinski et al. , 2020 ; Rippel et al. , 2021 ; Hu et al. , 2020 ; Yang et al. , 2020b ) , and bidirectional or B-frame modeling , where each frame is conditioned on past as well as future reference frames ( Cheng et al. , 2019 ; Choi & Bajić , 2019 ; Djelouah et al. , 2019 ; Wu et al. , 2018 ; Park & Kim , 2021 ; Pourreza & Cohen , 2021 ; Yang et al. , 2020a ) . Agustsson et al . ( 2020 ) generalize optical flow to scale-space flow by adding dynamic blurring to the warping operation , improving the modeling of uncertainty and leading to state-of-the-art results . Instance-adaptive compression Rate-distortion autoencoders are trained by minimizing the RD loss in Eq . ( 1 ) over a training dataset D. This approach relies on the assumptions that the model is not only able to fit the training data well , but also generalizes to unseen datapoints at inference time . In practice , however , finite training data , limited model capacity , optimization imperfections , and domain shift — differences between train and test distributions — can degrade the performance . This problem can be solved by adapting video codecs to each sequence at test time . Several such methods have been proposed , see Appendix A for an in-depth overview that also covers image compression . These works can be roughly categorized into encoder-only finetuning , limited decoder finetuning , and hybrid classical-neural codecs . Works in the first category ( e. g. Lu et al . ( 2020 ) ) optimize the encoder parameters φ for each data point . Such an update does not have to be communicated to the receiver side . This approach alleviates the generalization problem for the encoder , but does not solve it for the decoder and prior . We will demonstrate later that encoder-only finetuning leads to a limited improvement in the compression performance . The second category of works also adapt parts of the prior and decoder for each video instance . Since these modules need to be known on the receiver side , such an update needs to be signalled in the bitstream . Depending on the implementation , this may increase the bitrate substantially . Aytekin et al . ( 2018 ) ; Zou et al . ( 2020 ) ; Wang et al . ( 2021 ) address this by only allowing limited changes to the decoder-side models , for instance choosing one out of a number of fixed decoder networks , thus limiting the potentialRD gains of these methods . Finally , the third category of works propose a hybrid approach , where a video is first compressed by a classical codec and a finetuned enhancement network is added to the bitstream ( He et al. , 2020 ; 2021 ; Klopp et al. , 2020 ; 2021 ; Liu et al. , 2021 ) . Although these methods have shown great performance at low bitrates , they tend to perform less well at higher bitrates , and do not benefit from developments in end-to-end neural compression . van Rozendaal et al . ( 2021 ) suggest a method to adapt the full model to a single datapoint . The key idea is that the parameter updates δ = θ − θD , where θD are the global model parameters resulting from training onD , can be be transmitted very efficiently . After discretization , the quantized updates δ̄ are entropy-coded under a parameter update prior p [ δ̄ ] that assigns high probability mass ( and thus low transmission cost ) to zero-updates δ̄ = 0 . This procedure enables a neural codec in which the full model — encoder , decoder , and prior — is finetuned on each data sample at test time by minimizing the loss LInstA ( φ , δ ) = LRD ( φ , θD + δ̄ ) + β ( − log p ( δ ) ) ︸ ︷︷ ︸ Rθ . ( 2 ) The Rθ term reflects the increased bitstream length from coding the parameter updates δ̄ . In van Rozendaal et al . ( 2021 ) , this approach was successfully demonstrated on I-frame compression , essentially compressing a set of images with similar content . In this work we adapt it to the compression of full video sequences , as we will describe in the following section . 3 INSTANCE-ADAPTIVE VIDEO COMPRESSION . We now introduce our instance-adaptive compression codec for full video sequences , or InstA for short . The key idea is to optimize the parameters of a rate-distortion VAE for each video sequence to be transmitted , and to send the relevant network parameters in a rate-efficient way to the decoder . This approach can be beneficial whenever a standard rate-distortion autoencoder would not generalize well , for instance because of limited training data or domain shift . In addition , instance adaptation allows us to use smaller models while maintaining most of the compression performance . While encoding the network parameters to the bitstream increases the length of the code , we describe a compression scheme in which this cost is negligible , especially when amortized over many frames of a video sequence . Our approach is agnostic about the base model and we demonstrate it on two different architectures : a scale-space flow model in the low-latency setting and the B-EPIC model in the B-frame setting . In the following , we first describe the base models , before describing how InstA compresses and decompresses video sequences . Low-latency base model : Scale-space flow ( SSF ) We first focus on the low-latency setting , which we define as having only access to current or previous frames when decoding a frame . As a base model for this setting , we use the scale-space-flow architecture introduced by Agustsson et al . ( 2020 ) . Any video sequence is first split into groups of pictures ( GoP ) . The first frame in each GoP is modeled as an image without any dependency on previous frames , i. e. as an I-frame . All other frames are P-frames , modeled as xi = Scale-Space-Warp ( xi−1 , gi ) + ri , ( 3 ) where xi−1 is the reconstructed previous frame , gi is the estimated scale-space flow field , ri is the estimated residual , and the scale-space warping operation performs optical-flow warping of the previous frame with a dynamic , position-dependent amount of Gaussian blur . The I-frame images , P-frame scale-space flow gi , and P-frame residuals ri are compressed with separate hyperprior models ( Ballé et al. , 2018 ) , a hierarchical variational autoencoder architecture . We largely follow the architecture choices of Agustsson et al . ( 2020 ) and refer to this model as SSF18 after its number of decoder-side parameters ( in millions ) . In Appendix C we describe the architecture in detail and highlight the differences to Agustsson et al . ( 2020 ) . Smaller low-latency base models As our instance-adaptive approach is based on finetuning the compression model on a low-entropy “ dataset ” ( a single video sequence ) , we hypothesize that it does not require the full expressivity of the computationally complex SSF18 model . We propose three alternative scale-space flow architectures with a reduced computational complexity . In Tbl . 1 we list the parameter counts and the number of multiply-accumulate ( MAC ) operations required for decoding a sequence , which are reduced by 43–84 % compared to the SSF18 baseline . The architectures of the four SSF models are described in detail in Appendix C. B-frame base model : B-EPIC We also consider a less constrained setting , in which frames can be compressed as B-frames as well , i. e. using both a previous frame and a future frame as reference points . This flexibility allows for even more efficient compression and is used for instance for ondemand video streaming . As a base model we choose the B-EPIC architecture ( Pourreza & Cohen , 2021 ) . Again , the video is split into GoPs . The very first frame of a video is modeled as an Iframe , while the last frame in each GoP is a P-frame , using the last frame of the preceeding GoP as reference ; both I-frame and P-frames are compressed as in the SSF model . Any other frame xi is modeled as a B-frame : it is assigned a past reference frame xj ( j < i ) and a future reference frame xk ( k > i ) ; an off-the-shelf Super-SloMo frame interpolator ( Jiang et al. , 2018 ) is used to interpolate between these two reference frames . The interpolated frame is then used as a basis for scale-space flow warping : xi = Scale-Space-Warp ( Super-SloMo ( xj , xk ) , gi ) + ri . ( 4 ) The interpolated frame provides a more useful starting point for optical-flow warping than the previous frame , e. g. because the combination of past and future knowledge may avoid occlusion effects . Again , I-frames , optical flow , and residuals are modeled with three separate hyperprior models and the model is trained on the RD loss in Eq . ( 1 ) . We only consider a single configuration and use hyperparameters and checkpoints from Pourreza & Cohen ( 2021 ) . This model has 38.5 million parameters , 23.2 million of which are on the decoder side . Encoding a video sequence Our procedure conceptually follows van Rozendaal et al . ( 2021 ) . For completeness we shall describe the full method here . A video sequence x is compressed by : 1 . Finetuning the model parameters ( θ , φ ) of the base model on the sequence x using Eq . ( 2 ) , 2. computing the latent codes z ∼ qφ ( z|x ) , 3. parameterizing the finetuned decoder and prior parameters as updates δ = θ − θD , 4. quantizing latent codes z and network updates δ , and 5. compressing the quantized latents z̄ and updates δ̄ with entropy coding to the bitstream . To finetune a pretrained base compression model , we start with the global model with parameters ( θD , φD ) and minimize the rate-distortion loss given in Eq . ( 2 ) — but only over the single video sequence x . This modified rate-distortion loss explicitly includes the bitrate required to send model updates δ under an update prior p ( δ ) . We compute the regularizing Rθ loss with the unquantized updates δ , but use the quantized parameter updates θD + δ̄ to calculate the D and Rz loss terms , using a straight-trough estimator ( Bengio et al. , 2013 ) in the backward pass . Sending the updated network parameters of course adds to the length of the bitstream . This is even the case when finetuning does not lead to changed parameters ( δ̄ = 0 ) . Given the large size of the neural model we consider , it is therefore essential to choose an update prior that assigns a large probability mass to zero-updates δ̄ = 0 . This allows the network to transmit trivial updates at a negligible rate cost , while giving it the freedom to invest bit cost in non-trivial parameter updates that improve the performance substantially . We use a spike-and-slab prior ( Johnstone & Titterington , 2009 ; van Rozendaal et al. , 2021 ) , a mixture model of a narrow and a wide Gaussian distribution given by p ( δ ) = N ( δ|0 , σ21 ) + αN ( δ ∣∣0 , s21 ) 1 + α , ( 5 ) where the “ slab ” component with variance σ2 keeps the bitrate cost for sizable updates down , and the “ spike ” component with the narrow standard deviation s σ ensures cheap zero-updates . The mixing weight α is a tunable hyperparameter . At the beginning of the finetuning procedure , our neural model is equal to the global model . Because of the spike-slab update prior , the rate cost is only marginally increased and the compression performance essentially equal to the global model . During finetuning , the rate-distortion performance gradually improves , giving us an anytime algorithm that we can stop prematurely to get the best compression performance within a given encoder compute budget . After the model has converged or a compute budget has been exhausted , we use the finetuned encoder qφ to find the latent code z corresponding to the video sequence x . Both z and the updates to prior and decoder δ , which will be necessary to decode the video sequence , are quantized . To discretize the updates δ , we use a fixed grid of n equal-sized bins of width t centered around δ = 0 . We choose n such that p ( −n/t < δ < n/t ) ≈ 1− and clip values at the tails . The quantization of z is analogous , except that we use a bin width of t = 1 and do not clip the values at the tails ( in line with Ballé et al . ( 2018 ) ) . Finally , we write the quantized updates δ̄ and quantized codes z̄ to the bitstream . We use entropy coding under the quantized update prior p ( δ̄ ) and finetuned prior pθD+δ̄ ( z̄ ) , respectively . For latent codes in the tail region we use Exp-Golomb coding ( Wiegand et al. , 2003 ) . Decoding a video sequence The receiver first decodes the prior and decoder updates δ̄ from the bitstream . Once θ̄ = θD + δ̄ is known on the decoder side , the latents z are decoded with the prior pθ̄ ( z ) and the video sequence is reconstructed with the decoder pθ̄ ( x|z ) following standard VAE protocol . The only overhead on the decoder side is therefore the initial decoding of δ̄ . While this results in a small delay before the first frame can be decoded , in practice this delay is very short ( below 0.2 seconds in our experiments ) .
This paper mainly introduces a video compression algorithm. The main feature is that it can simultaneously optimize the codec model parameters while compressing the transmitted video, and dynamically adapt to different video styles. The author's main contributions are: a. In this paper, the instance-adaptive data compression method is applied to the compression of complete video sequences. During the test of each video, by fine tuning the model parameters of the codec, the robustness to deal with various fields of video is improved. This method can reduce the model capacity, because a smaller network may suffice to model a single instance, and relax the assumption that the distribution of training set and test set always match. It can be applied to any neural network video codec model. b. This paper demonstrates the effectiveness of the method through experiments on two different architectures: scale-space flow with low delay setting and B-frame based model.
SP:504ee69e2327b3ee363f1c9eeb779654c8e3925f
Understanding Latent Correlation-Based Multiview Learning and Self-Supervision: An Identifiability Perspective
1 INTRODUCTION . One pillar of unsupervised representation learning is multiview learning . Extracting shared information from multiple “ views ” ( e.g. , image and audio ) of data entities has been considered a major means to fend against noise and data scarcity . A key computational tool for multiview learning is canonical correlation analysis ( CCA ) ( Hotelling , 1936 ) . The classic CCA seeks linear transformation matrices such that transformed views are maximally correlated . A number of works studied nonlinear extensions of CCA ; see kernel CCA in ( Lai & Fyfe , 2000 ) and deep learning-based CCA ( DCCA ) in ( Andrew et al. , 2013 ; Wang et al. , 2015 ) . DCCA and its variants were shown to largely outperform the classical linear CCA in many tasks . In recent years , a series of self-supervised learning ( SSL ) paradigms were proposed . These SSL approaches exhibit a lot of similarities with DCCA approaches , except that the “ views ” are noisy data “ augmenented ” from the original clean data . To be specific , different views are generated by distorting data—e.g. , using rotating , cropping , and/or adding noise to data samples ( Dosovitskiy et al. , 2015 ; Gidaris et al. , 2018 ; Chen et al. , 2020 ; Grill et al. , 2020 ) . Then , neural encoders are employed to map these artificial views to embeddings that are highly correlated across views . This genre—which will be referred to as artificial multiview SSL ( AM-SSL ) —includes some empirically successful frameworks , e.g. , BYOL ( Grill et al. , 2020 ) and Barlow Twins ( Zbontar et al. , 2021 ) . Notably , many DCCA and AM-SSL approaches involve ( explicitly or implicitly ) searching for highly correlated representations from multiple views , using neural feature extractors ( encoders ) . The empirical success of DCCA and AM-SSL bears an important research question : How to under- stand the role of cross-view correlation in deep multiview learning ? Furthermore , how to use such understanding to design theory-backed learning criteria to serve various purposes ? Intuitively , it makes sense that many DCCA and AM-SSL paradigms involve latent correlation maximization in their loss functions , as such loss functions lead to similar/identical representations from different views—which identifies view-invariant essential information that is often identityrevealing . However , beyond intuition , theoretical support of latent correlation-based deep multiview learning had been less studied , until recent works started exploring this direction in both nonlinear CCA and AM-SSL ( see , e.g. , ( Lyu & Fu , 2020 ; von Kügelgen et al. , 2021 ; Zimmermann et al. , 2021 ; Tian et al. , 2021 ; Saunshi et al. , 2019 ; Tosh et al. , 2021 ) ) , but more insights and theoretical underpinnings remain to be discovered under more realistic and challenging settings . In this work , we offer an understanding to the role of latent correlation maximization that is seen in a number of DCCA and AM-SSL systems from a nonlinear mixture learning viewpoint—and use such understanding to assist various learning tasks , e.g. , clustering , cross-view translation , and cross-sample generation . Our detailed contributions are : ( i ) Understanding Latent Correlation Maximization - Shared Component Identification . We start with a concept that has been advocated in many multiview learning works . In particular , the views are nonlinear mixtures of shared and private latent components ; see , e.g. , ( Huang et al. , 2018 ; Lee et al. , 2018 ; Wang et al. , 2016 ) . The shared components are distortion/view invariant and identity-revealing . The private components and view-specific nonlinear mixing processes determine the different appearances of the views . By assuming independence between the shared and private components and invertibility of the data generating process , we show that maximizing the correlation of latent representations extracted from different views leads to identification of the ground-truth shared components up to invertible transformations . ( ii ) Imposing Additional Constraints - Private Component Identification . Using the understanding to latent correlation maximization-type loss functions in DCCA and AM-SSL , we take a step further . We show that with carefully imposed constraints , the private components in the views can also be identified , under reasonable assumptions . Learning private components can facilitate tasks such as cross-view and cross-sample data generation ( Huang et al. , 2018 ; Lee et al. , 2018 ) . ( iii ) Finite-Sample Analysis . Most existing unsupervised nonlinear mixture identification works , e.g. , those from the nonlinear independent component analysis ( ICA ) literature ( Hyvarinen & Morioka , 2016 ; 2017 ; Hyvarinen et al. , 2019 ; Khemakhem et al. , 2020 ; Locatello et al. , 2020 ; Gresele et al. , 2020 ) , are based on infinite data . This is perhaps because finite sample analysis for unsupervised learning is generally much more challenging relative to supervised cases—and there is no existing “ universal ” analytical tools . In this work , we provide sample complexity analysis for the proposed unsupervised multiview learning criterion . We come up with a success metric for characterizing the performance of latent component extraction , and integrate generalization analysis and numerical differentiation to quantify this metric . To our best knowledge , this is the first finite-sample analysis of nonlinear mixture model-based multiview unsupervised learning . ( iv ) Practical Implementation . Based on the theoretical understanding , we propose a latent correlation-maximization based multiview learning criterion for extracting both the shared components and private components . To realize the criterion , a notable innovation is a minimax neural regularizer that serves for extracting the private components . The regularizer shares the same purpose of some known independence promoters ( e.g. , Hilbert-Schmidt Independence Criterion ( HSIC ) ( Gretton et al. , 2005a ) ) but is arguably easier to implement using stochastic gradient algorithms . Notation . The notations used in this work are summarized in the supplementary material . 2 BACKGROUND : LATENT CORRELATION IN DCCA AND AM-SSL . In this section , we briefly review some deep multiview learning paradigms that use latent correlation maximization and its close relatives . 2.1 LATENT CORRELATION MAXIMIZATION IN DCCA . DCCA methods aim at extracting common information from multiple views of data samples . Such information is expected to be informative and essential in representing the data . • DCCA . The objective of DCCA can be summarized as follows ( Andrew et al. , 2013 ) : maximize f ( 1 ) , f ( 2 ) Tr ( E [ f ( 1 ) ( x ( 1 ) ) f ( 2 ) ( x ( 2 ) ) ⊤ ] ) , s.t . E [ f ( q ) ( x ( q ) ) f ( q ) ( x ( q ) ) ⊤ ] = I , ( 1 ) where x ( q ) ∈ RMq ∼ Dq is a data sample from view q for q = 1 , 2 , Dq is the underlying distribution of the qth view , f ( 1 ) : RM1 → RD and f ( 2 ) : RM2 → RD are two neural networks . CCA was found particularly useful in fending against unknown and strong view-specific ( private ) interference ( see theoretical supports in ( Bach & Jordan , 2005 ; Ibrahim & Sidiropoulos , 2020 ) ) . Such properties were also observed in DCCA research ( Wang et al. , 2015 ) , while theoretical analysis is mostly elusive . An equivalent representation of ( 1 ) is as follows minimize f ( 1 ) , f ( 2 ) E [ ∥∥∥f ( 1 ) ( x ( 1 ) ) − f ( 2 ) ( x ( 2 ) ) ∥∥∥2 2 ] , s.t . E [ f ( q ) ( x ( q ) ) f ( q ) ( x ( q ) ) ⊤ ] = I , ( 2 ) which is expressed from latent component matching perspective . Both the correlation maximization form in ( 1 ) and the component matching form in ( 2 ) are widely used in the literature . As we will see in our proofs , although the former is popular in the literature ( Andrew et al. , 2013 ; Wang et al. , 2015 ; Chen et al. , 2020 ) , the latter is handier for theoretical analysis . • Slack Variable-Based DCCA . In ( Benton et al. , 2017 ) and ( Lyu & Fu , 2020 ) , a deep multiview learning criterion is used : minimize f ( q ) 2∑ q=1 E [ ∥∥∥f ( q ) ( x ( q ) ) − g∥∥∥2 ] , s.t . E [ |gi|2 ] = 1 , E [ gigj ] = 0 . ( 3 ) The slack variable g represents the common latent embedding learned from the two views . Conceptually , this is also latent correlation maximization ( or latent component matching ) . To see this , assume that there exists f ( q ) ( x ( q ) ) = g for all x ( q ) . The criterion amounts to learning [ f ( 1 ) ( x ( 1 ) ) ] k = [ f ( 2 ) ( x ( 2 ) ) ] k—which has the maximally attainable correlation . 2.2 LATENT CORRELATION MAXIMIZATION/COMPONENT MATCHING IN AM-SSL . Similar to DCCA , the goal of AM-SSL is also to find identity-revealing embeddings of data samples without using labels . The idea is often realized via intentionally distorting the data to create multiple artificial views . Then , the encoders are require to produce highly correlated ( or closely matched ) embeddings from such views . In AM-SSL , the views x ( 1 ) and x ( 2 ) are different augmentations ( e.g. , by adding noise , cropping , and rotation ) of the sample x . • Barlow Twins . The most recent development , namely , the Barlow Twins network ( Zbontar et al. , 2021 ) is appealing since it entails a succinct implementation . Specifically , the Barlow Twins network aims to learn a single encoder f : RM → RD for two distorted views . The cost function is as follows : minimize f D∑ i=1 ( 1− Cii ) 2 + λ D∑ i=1 D∑ j ̸=i C2ij , where Cij = E [ [ f ( x ( 1 ) ) ] i [ f ( x ( 2 ) ) ] j ] √ E [ [ f ( x ( 1 ) ) ] 2i ] √ E [ [ f ( x ( 2 ) ) ] 2j ] . When the learned embeddings are constrained to have zero mean , i.e. , E [ f ( x ( q ) ) ] = 0 , Cij is the cross-correlation between f ( x ( 1 ) ) and f ( x ( 2 ) ) . Note that the normalized representation of crosscorrelation in Cij is equivalent to the objective in ( 1 ) with the orthogonality constraints . • BYOL . The BYOL method ( Grill et al. , 2020 ) uses a cross-view matching criterion that can be distilled as follows : minimize f ( 1 ) , f ( 2 ) E [ ∥∥∥f ( 1 ) ( x ( 1 ) ) − f ( 2 ) ( x ( 2 ) ) ∥∥∥2 2 ] ( 4 ) where f ( q ) ( · ) means that the output of the network is normalized . In BYOL , the networks are constructed in a special way ( e.g. , part of f ( 2 ) ’ s weights are moving averages of the correspond part of f ( 1 ) ’ s weights ) . Nonetheless , the cross-view matching perspective is still very similar to that in latent component matching in ( 2 ) . • SimSiam . The loss function of SimSiam ( Chen & He , 2021 ) has a similar structure as that of BYOL , but with a Siamese network , which , essentially , is also latent component matching .
The paper offers a theoretical analysis of neural canonical correlation analysis (CCA) type methods. This reveals conditions under which these methods may work. The paper then proposes regularizers that approximately realize these conditions, which result in a new CCA-type algorithm. Empirical results indicate that the approximate algorithm behaves as dictated by the theory.
SP:3b458f8cf501e345246b846b2d26a7526abec53f
Understanding Latent Correlation-Based Multiview Learning and Self-Supervision: An Identifiability Perspective
1 INTRODUCTION . One pillar of unsupervised representation learning is multiview learning . Extracting shared information from multiple “ views ” ( e.g. , image and audio ) of data entities has been considered a major means to fend against noise and data scarcity . A key computational tool for multiview learning is canonical correlation analysis ( CCA ) ( Hotelling , 1936 ) . The classic CCA seeks linear transformation matrices such that transformed views are maximally correlated . A number of works studied nonlinear extensions of CCA ; see kernel CCA in ( Lai & Fyfe , 2000 ) and deep learning-based CCA ( DCCA ) in ( Andrew et al. , 2013 ; Wang et al. , 2015 ) . DCCA and its variants were shown to largely outperform the classical linear CCA in many tasks . In recent years , a series of self-supervised learning ( SSL ) paradigms were proposed . These SSL approaches exhibit a lot of similarities with DCCA approaches , except that the “ views ” are noisy data “ augmenented ” from the original clean data . To be specific , different views are generated by distorting data—e.g. , using rotating , cropping , and/or adding noise to data samples ( Dosovitskiy et al. , 2015 ; Gidaris et al. , 2018 ; Chen et al. , 2020 ; Grill et al. , 2020 ) . Then , neural encoders are employed to map these artificial views to embeddings that are highly correlated across views . This genre—which will be referred to as artificial multiview SSL ( AM-SSL ) —includes some empirically successful frameworks , e.g. , BYOL ( Grill et al. , 2020 ) and Barlow Twins ( Zbontar et al. , 2021 ) . Notably , many DCCA and AM-SSL approaches involve ( explicitly or implicitly ) searching for highly correlated representations from multiple views , using neural feature extractors ( encoders ) . The empirical success of DCCA and AM-SSL bears an important research question : How to under- stand the role of cross-view correlation in deep multiview learning ? Furthermore , how to use such understanding to design theory-backed learning criteria to serve various purposes ? Intuitively , it makes sense that many DCCA and AM-SSL paradigms involve latent correlation maximization in their loss functions , as such loss functions lead to similar/identical representations from different views—which identifies view-invariant essential information that is often identityrevealing . However , beyond intuition , theoretical support of latent correlation-based deep multiview learning had been less studied , until recent works started exploring this direction in both nonlinear CCA and AM-SSL ( see , e.g. , ( Lyu & Fu , 2020 ; von Kügelgen et al. , 2021 ; Zimmermann et al. , 2021 ; Tian et al. , 2021 ; Saunshi et al. , 2019 ; Tosh et al. , 2021 ) ) , but more insights and theoretical underpinnings remain to be discovered under more realistic and challenging settings . In this work , we offer an understanding to the role of latent correlation maximization that is seen in a number of DCCA and AM-SSL systems from a nonlinear mixture learning viewpoint—and use such understanding to assist various learning tasks , e.g. , clustering , cross-view translation , and cross-sample generation . Our detailed contributions are : ( i ) Understanding Latent Correlation Maximization - Shared Component Identification . We start with a concept that has been advocated in many multiview learning works . In particular , the views are nonlinear mixtures of shared and private latent components ; see , e.g. , ( Huang et al. , 2018 ; Lee et al. , 2018 ; Wang et al. , 2016 ) . The shared components are distortion/view invariant and identity-revealing . The private components and view-specific nonlinear mixing processes determine the different appearances of the views . By assuming independence between the shared and private components and invertibility of the data generating process , we show that maximizing the correlation of latent representations extracted from different views leads to identification of the ground-truth shared components up to invertible transformations . ( ii ) Imposing Additional Constraints - Private Component Identification . Using the understanding to latent correlation maximization-type loss functions in DCCA and AM-SSL , we take a step further . We show that with carefully imposed constraints , the private components in the views can also be identified , under reasonable assumptions . Learning private components can facilitate tasks such as cross-view and cross-sample data generation ( Huang et al. , 2018 ; Lee et al. , 2018 ) . ( iii ) Finite-Sample Analysis . Most existing unsupervised nonlinear mixture identification works , e.g. , those from the nonlinear independent component analysis ( ICA ) literature ( Hyvarinen & Morioka , 2016 ; 2017 ; Hyvarinen et al. , 2019 ; Khemakhem et al. , 2020 ; Locatello et al. , 2020 ; Gresele et al. , 2020 ) , are based on infinite data . This is perhaps because finite sample analysis for unsupervised learning is generally much more challenging relative to supervised cases—and there is no existing “ universal ” analytical tools . In this work , we provide sample complexity analysis for the proposed unsupervised multiview learning criterion . We come up with a success metric for characterizing the performance of latent component extraction , and integrate generalization analysis and numerical differentiation to quantify this metric . To our best knowledge , this is the first finite-sample analysis of nonlinear mixture model-based multiview unsupervised learning . ( iv ) Practical Implementation . Based on the theoretical understanding , we propose a latent correlation-maximization based multiview learning criterion for extracting both the shared components and private components . To realize the criterion , a notable innovation is a minimax neural regularizer that serves for extracting the private components . The regularizer shares the same purpose of some known independence promoters ( e.g. , Hilbert-Schmidt Independence Criterion ( HSIC ) ( Gretton et al. , 2005a ) ) but is arguably easier to implement using stochastic gradient algorithms . Notation . The notations used in this work are summarized in the supplementary material . 2 BACKGROUND : LATENT CORRELATION IN DCCA AND AM-SSL . In this section , we briefly review some deep multiview learning paradigms that use latent correlation maximization and its close relatives . 2.1 LATENT CORRELATION MAXIMIZATION IN DCCA . DCCA methods aim at extracting common information from multiple views of data samples . Such information is expected to be informative and essential in representing the data . • DCCA . The objective of DCCA can be summarized as follows ( Andrew et al. , 2013 ) : maximize f ( 1 ) , f ( 2 ) Tr ( E [ f ( 1 ) ( x ( 1 ) ) f ( 2 ) ( x ( 2 ) ) ⊤ ] ) , s.t . E [ f ( q ) ( x ( q ) ) f ( q ) ( x ( q ) ) ⊤ ] = I , ( 1 ) where x ( q ) ∈ RMq ∼ Dq is a data sample from view q for q = 1 , 2 , Dq is the underlying distribution of the qth view , f ( 1 ) : RM1 → RD and f ( 2 ) : RM2 → RD are two neural networks . CCA was found particularly useful in fending against unknown and strong view-specific ( private ) interference ( see theoretical supports in ( Bach & Jordan , 2005 ; Ibrahim & Sidiropoulos , 2020 ) ) . Such properties were also observed in DCCA research ( Wang et al. , 2015 ) , while theoretical analysis is mostly elusive . An equivalent representation of ( 1 ) is as follows minimize f ( 1 ) , f ( 2 ) E [ ∥∥∥f ( 1 ) ( x ( 1 ) ) − f ( 2 ) ( x ( 2 ) ) ∥∥∥2 2 ] , s.t . E [ f ( q ) ( x ( q ) ) f ( q ) ( x ( q ) ) ⊤ ] = I , ( 2 ) which is expressed from latent component matching perspective . Both the correlation maximization form in ( 1 ) and the component matching form in ( 2 ) are widely used in the literature . As we will see in our proofs , although the former is popular in the literature ( Andrew et al. , 2013 ; Wang et al. , 2015 ; Chen et al. , 2020 ) , the latter is handier for theoretical analysis . • Slack Variable-Based DCCA . In ( Benton et al. , 2017 ) and ( Lyu & Fu , 2020 ) , a deep multiview learning criterion is used : minimize f ( q ) 2∑ q=1 E [ ∥∥∥f ( q ) ( x ( q ) ) − g∥∥∥2 ] , s.t . E [ |gi|2 ] = 1 , E [ gigj ] = 0 . ( 3 ) The slack variable g represents the common latent embedding learned from the two views . Conceptually , this is also latent correlation maximization ( or latent component matching ) . To see this , assume that there exists f ( q ) ( x ( q ) ) = g for all x ( q ) . The criterion amounts to learning [ f ( 1 ) ( x ( 1 ) ) ] k = [ f ( 2 ) ( x ( 2 ) ) ] k—which has the maximally attainable correlation . 2.2 LATENT CORRELATION MAXIMIZATION/COMPONENT MATCHING IN AM-SSL . Similar to DCCA , the goal of AM-SSL is also to find identity-revealing embeddings of data samples without using labels . The idea is often realized via intentionally distorting the data to create multiple artificial views . Then , the encoders are require to produce highly correlated ( or closely matched ) embeddings from such views . In AM-SSL , the views x ( 1 ) and x ( 2 ) are different augmentations ( e.g. , by adding noise , cropping , and rotation ) of the sample x . • Barlow Twins . The most recent development , namely , the Barlow Twins network ( Zbontar et al. , 2021 ) is appealing since it entails a succinct implementation . Specifically , the Barlow Twins network aims to learn a single encoder f : RM → RD for two distorted views . The cost function is as follows : minimize f D∑ i=1 ( 1− Cii ) 2 + λ D∑ i=1 D∑ j ̸=i C2ij , where Cij = E [ [ f ( x ( 1 ) ) ] i [ f ( x ( 2 ) ) ] j ] √ E [ [ f ( x ( 1 ) ) ] 2i ] √ E [ [ f ( x ( 2 ) ) ] 2j ] . When the learned embeddings are constrained to have zero mean , i.e. , E [ f ( x ( q ) ) ] = 0 , Cij is the cross-correlation between f ( x ( 1 ) ) and f ( x ( 2 ) ) . Note that the normalized representation of crosscorrelation in Cij is equivalent to the objective in ( 1 ) with the orthogonality constraints . • BYOL . The BYOL method ( Grill et al. , 2020 ) uses a cross-view matching criterion that can be distilled as follows : minimize f ( 1 ) , f ( 2 ) E [ ∥∥∥f ( 1 ) ( x ( 1 ) ) − f ( 2 ) ( x ( 2 ) ) ∥∥∥2 2 ] ( 4 ) where f ( q ) ( · ) means that the output of the network is normalized . In BYOL , the networks are constructed in a special way ( e.g. , part of f ( 2 ) ’ s weights are moving averages of the correspond part of f ( 1 ) ’ s weights ) . Nonetheless , the cross-view matching perspective is still very similar to that in latent component matching in ( 2 ) . • SimSiam . The loss function of SimSiam ( Chen & He , 2021 ) has a similar structure as that of BYOL , but with a Siamese network , which , essentially , is also latent component matching .
### Scope & Problem setting The paper studies the problem of representation learning from multi-view data from an identifiability perspective. In particular, the focus is on latent correlation maximisation approaches as commonly used in (nonlinear) canonical correlation analysis (CCA) and artificial multi-view self-supervised learning (AM-SSL). The paper postulates a generative model by which views $(x^1,x^2)$ are generated by invertible functions $f_i$ applied to a mixture of independent shared $z$ and private $c^i$ components, $x^i=f^i(z,c^i)$, for $i=1,2$. ### Theory It is shown that latent correlation maximisation (with a suitable objective and constraints, as well as with invertible encoders) identifies, or separates, both (i) the shared component $z$ and (ii) the private components $c^1,c^2$ up to arbitrary invertible functions. Further, (iii) a finite sample analysis is provided. ### Algorithm & Experiments The paper proposes a learning objective that combines latent correlation maximisation with a regulariser and a reconstruction objective to encourage independence among $(z,c^1,c^2)$ and invertibility of the encoders. Several experiments on synthetic data and image benchmarks are used to validate the theory and compare the proposed method against DCCA, BarlowTwins, and BYOL.
SP:3b458f8cf501e345246b846b2d26a7526abec53f
Understanding Latent Correlation-Based Multiview Learning and Self-Supervision: An Identifiability Perspective
1 INTRODUCTION . One pillar of unsupervised representation learning is multiview learning . Extracting shared information from multiple “ views ” ( e.g. , image and audio ) of data entities has been considered a major means to fend against noise and data scarcity . A key computational tool for multiview learning is canonical correlation analysis ( CCA ) ( Hotelling , 1936 ) . The classic CCA seeks linear transformation matrices such that transformed views are maximally correlated . A number of works studied nonlinear extensions of CCA ; see kernel CCA in ( Lai & Fyfe , 2000 ) and deep learning-based CCA ( DCCA ) in ( Andrew et al. , 2013 ; Wang et al. , 2015 ) . DCCA and its variants were shown to largely outperform the classical linear CCA in many tasks . In recent years , a series of self-supervised learning ( SSL ) paradigms were proposed . These SSL approaches exhibit a lot of similarities with DCCA approaches , except that the “ views ” are noisy data “ augmenented ” from the original clean data . To be specific , different views are generated by distorting data—e.g. , using rotating , cropping , and/or adding noise to data samples ( Dosovitskiy et al. , 2015 ; Gidaris et al. , 2018 ; Chen et al. , 2020 ; Grill et al. , 2020 ) . Then , neural encoders are employed to map these artificial views to embeddings that are highly correlated across views . This genre—which will be referred to as artificial multiview SSL ( AM-SSL ) —includes some empirically successful frameworks , e.g. , BYOL ( Grill et al. , 2020 ) and Barlow Twins ( Zbontar et al. , 2021 ) . Notably , many DCCA and AM-SSL approaches involve ( explicitly or implicitly ) searching for highly correlated representations from multiple views , using neural feature extractors ( encoders ) . The empirical success of DCCA and AM-SSL bears an important research question : How to under- stand the role of cross-view correlation in deep multiview learning ? Furthermore , how to use such understanding to design theory-backed learning criteria to serve various purposes ? Intuitively , it makes sense that many DCCA and AM-SSL paradigms involve latent correlation maximization in their loss functions , as such loss functions lead to similar/identical representations from different views—which identifies view-invariant essential information that is often identityrevealing . However , beyond intuition , theoretical support of latent correlation-based deep multiview learning had been less studied , until recent works started exploring this direction in both nonlinear CCA and AM-SSL ( see , e.g. , ( Lyu & Fu , 2020 ; von Kügelgen et al. , 2021 ; Zimmermann et al. , 2021 ; Tian et al. , 2021 ; Saunshi et al. , 2019 ; Tosh et al. , 2021 ) ) , but more insights and theoretical underpinnings remain to be discovered under more realistic and challenging settings . In this work , we offer an understanding to the role of latent correlation maximization that is seen in a number of DCCA and AM-SSL systems from a nonlinear mixture learning viewpoint—and use such understanding to assist various learning tasks , e.g. , clustering , cross-view translation , and cross-sample generation . Our detailed contributions are : ( i ) Understanding Latent Correlation Maximization - Shared Component Identification . We start with a concept that has been advocated in many multiview learning works . In particular , the views are nonlinear mixtures of shared and private latent components ; see , e.g. , ( Huang et al. , 2018 ; Lee et al. , 2018 ; Wang et al. , 2016 ) . The shared components are distortion/view invariant and identity-revealing . The private components and view-specific nonlinear mixing processes determine the different appearances of the views . By assuming independence between the shared and private components and invertibility of the data generating process , we show that maximizing the correlation of latent representations extracted from different views leads to identification of the ground-truth shared components up to invertible transformations . ( ii ) Imposing Additional Constraints - Private Component Identification . Using the understanding to latent correlation maximization-type loss functions in DCCA and AM-SSL , we take a step further . We show that with carefully imposed constraints , the private components in the views can also be identified , under reasonable assumptions . Learning private components can facilitate tasks such as cross-view and cross-sample data generation ( Huang et al. , 2018 ; Lee et al. , 2018 ) . ( iii ) Finite-Sample Analysis . Most existing unsupervised nonlinear mixture identification works , e.g. , those from the nonlinear independent component analysis ( ICA ) literature ( Hyvarinen & Morioka , 2016 ; 2017 ; Hyvarinen et al. , 2019 ; Khemakhem et al. , 2020 ; Locatello et al. , 2020 ; Gresele et al. , 2020 ) , are based on infinite data . This is perhaps because finite sample analysis for unsupervised learning is generally much more challenging relative to supervised cases—and there is no existing “ universal ” analytical tools . In this work , we provide sample complexity analysis for the proposed unsupervised multiview learning criterion . We come up with a success metric for characterizing the performance of latent component extraction , and integrate generalization analysis and numerical differentiation to quantify this metric . To our best knowledge , this is the first finite-sample analysis of nonlinear mixture model-based multiview unsupervised learning . ( iv ) Practical Implementation . Based on the theoretical understanding , we propose a latent correlation-maximization based multiview learning criterion for extracting both the shared components and private components . To realize the criterion , a notable innovation is a minimax neural regularizer that serves for extracting the private components . The regularizer shares the same purpose of some known independence promoters ( e.g. , Hilbert-Schmidt Independence Criterion ( HSIC ) ( Gretton et al. , 2005a ) ) but is arguably easier to implement using stochastic gradient algorithms . Notation . The notations used in this work are summarized in the supplementary material . 2 BACKGROUND : LATENT CORRELATION IN DCCA AND AM-SSL . In this section , we briefly review some deep multiview learning paradigms that use latent correlation maximization and its close relatives . 2.1 LATENT CORRELATION MAXIMIZATION IN DCCA . DCCA methods aim at extracting common information from multiple views of data samples . Such information is expected to be informative and essential in representing the data . • DCCA . The objective of DCCA can be summarized as follows ( Andrew et al. , 2013 ) : maximize f ( 1 ) , f ( 2 ) Tr ( E [ f ( 1 ) ( x ( 1 ) ) f ( 2 ) ( x ( 2 ) ) ⊤ ] ) , s.t . E [ f ( q ) ( x ( q ) ) f ( q ) ( x ( q ) ) ⊤ ] = I , ( 1 ) where x ( q ) ∈ RMq ∼ Dq is a data sample from view q for q = 1 , 2 , Dq is the underlying distribution of the qth view , f ( 1 ) : RM1 → RD and f ( 2 ) : RM2 → RD are two neural networks . CCA was found particularly useful in fending against unknown and strong view-specific ( private ) interference ( see theoretical supports in ( Bach & Jordan , 2005 ; Ibrahim & Sidiropoulos , 2020 ) ) . Such properties were also observed in DCCA research ( Wang et al. , 2015 ) , while theoretical analysis is mostly elusive . An equivalent representation of ( 1 ) is as follows minimize f ( 1 ) , f ( 2 ) E [ ∥∥∥f ( 1 ) ( x ( 1 ) ) − f ( 2 ) ( x ( 2 ) ) ∥∥∥2 2 ] , s.t . E [ f ( q ) ( x ( q ) ) f ( q ) ( x ( q ) ) ⊤ ] = I , ( 2 ) which is expressed from latent component matching perspective . Both the correlation maximization form in ( 1 ) and the component matching form in ( 2 ) are widely used in the literature . As we will see in our proofs , although the former is popular in the literature ( Andrew et al. , 2013 ; Wang et al. , 2015 ; Chen et al. , 2020 ) , the latter is handier for theoretical analysis . • Slack Variable-Based DCCA . In ( Benton et al. , 2017 ) and ( Lyu & Fu , 2020 ) , a deep multiview learning criterion is used : minimize f ( q ) 2∑ q=1 E [ ∥∥∥f ( q ) ( x ( q ) ) − g∥∥∥2 ] , s.t . E [ |gi|2 ] = 1 , E [ gigj ] = 0 . ( 3 ) The slack variable g represents the common latent embedding learned from the two views . Conceptually , this is also latent correlation maximization ( or latent component matching ) . To see this , assume that there exists f ( q ) ( x ( q ) ) = g for all x ( q ) . The criterion amounts to learning [ f ( 1 ) ( x ( 1 ) ) ] k = [ f ( 2 ) ( x ( 2 ) ) ] k—which has the maximally attainable correlation . 2.2 LATENT CORRELATION MAXIMIZATION/COMPONENT MATCHING IN AM-SSL . Similar to DCCA , the goal of AM-SSL is also to find identity-revealing embeddings of data samples without using labels . The idea is often realized via intentionally distorting the data to create multiple artificial views . Then , the encoders are require to produce highly correlated ( or closely matched ) embeddings from such views . In AM-SSL , the views x ( 1 ) and x ( 2 ) are different augmentations ( e.g. , by adding noise , cropping , and rotation ) of the sample x . • Barlow Twins . The most recent development , namely , the Barlow Twins network ( Zbontar et al. , 2021 ) is appealing since it entails a succinct implementation . Specifically , the Barlow Twins network aims to learn a single encoder f : RM → RD for two distorted views . The cost function is as follows : minimize f D∑ i=1 ( 1− Cii ) 2 + λ D∑ i=1 D∑ j ̸=i C2ij , where Cij = E [ [ f ( x ( 1 ) ) ] i [ f ( x ( 2 ) ) ] j ] √ E [ [ f ( x ( 1 ) ) ] 2i ] √ E [ [ f ( x ( 2 ) ) ] 2j ] . When the learned embeddings are constrained to have zero mean , i.e. , E [ f ( x ( q ) ) ] = 0 , Cij is the cross-correlation between f ( x ( 1 ) ) and f ( x ( 2 ) ) . Note that the normalized representation of crosscorrelation in Cij is equivalent to the objective in ( 1 ) with the orthogonality constraints . • BYOL . The BYOL method ( Grill et al. , 2020 ) uses a cross-view matching criterion that can be distilled as follows : minimize f ( 1 ) , f ( 2 ) E [ ∥∥∥f ( 1 ) ( x ( 1 ) ) − f ( 2 ) ( x ( 2 ) ) ∥∥∥2 2 ] ( 4 ) where f ( q ) ( · ) means that the output of the network is normalized . In BYOL , the networks are constructed in a special way ( e.g. , part of f ( 2 ) ’ s weights are moving averages of the correspond part of f ( 1 ) ’ s weights ) . Nonetheless , the cross-view matching perspective is still very similar to that in latent component matching in ( 2 ) . • SimSiam . The loss function of SimSiam ( Chen & He , 2021 ) has a similar structure as that of BYOL , but with a Siamese network , which , essentially , is also latent component matching .
This paper proposed a general multi-view learning approach and provides a theoretical analysis for the proposed method. Specifically, each view is considered as a common/shared and private/view-specific components. Then, the multi-view learn problem is converted to a identification and disentanglement problems. The theoretical analysis provides the bounds of the proposed model. Experimental results demonstrate the effectiveness for downstream tasks.
SP:3b458f8cf501e345246b846b2d26a7526abec53f
Learning When and What to Ask: a Hierarchical Reinforcement Learning Framework
1 INTRODUCTION . Human-agent communication at deployment time has been under-explored in machine learning , where the traditional focus has been on building agents that can accomplish tasks on their own ( full autonomy ) . Nevertheless , enabling an agent to exchange information with humans during its operation can potentially enhance its helpfulness and trustworthiness . The ability to request and interpret human advice would help the agent accomplish tasks beyond its built-in knowledge , while the ability to accurately convey when and why it is about to fail would make the agent safer to use . In his classical work , Grice ( 1975 ) outlines the desired characteristics of cooperative communication , commonly known as the Gricean maxims of cooperation . Among these characteristics are informativeness ( the maxim of quantity ) and faithfulness ( the maxim of quality ) . Human-agent communication in current work has fallen short in these two aspects . Traditional frameworks like imitation learning and reinforcement learning employ limited communication protocols where the agent and the human can only exchange simple intentions ( requesting low-level actions or rewards Torrey & Taylor ( 2013 ) ; Knox & Stone ( 2009 ) ) . More powerful frameworks like ( Nguyen & Daumé III , 2019 ; Nguyen et al. , 2019 ; Kim et al. , 2019 ) allow the agent to process high-level instructions from humans , but the agent still only requests generic help . Recent work in natural language processing endows the agent with the ability to generate rich natural language utterances ( Camburu et al. , 2018 ; Rao & Daumé III , 2018 ; De Vries et al. , 2017 ; Das et al. , 2017 ) , but the communication is not faithful in the sense that the agent only mirrors human-generated utterances without grounding its communication in self-perception of its ( in ) capabilities and ( un ) certainties . Essentially it learns to convey what a human may be concerned about , not what it is concerned about . This paper presents a hierarchical reinforcement learning framework named HARI ( Human-Assisted Reinforced Interaction ) , which supports richer and more faithful human-agent communication . Our framework allows the agent to learn to convey intrinstic needs for specific information and to incorporate diverse types of information from humans to make better decisions . Specifically , the agent in HARI is equipped with three information-seeking intentions : in every step , it can choose to request more information about ( i ) its current state , ( ii ) the goal state , or ( iii ) a subgoal state which , if reached , helps it make progress on the current task . Upon receiving a request , the human can transfer new information to the agent by giving new descriptions of the requested state . These de- scriptions will be incorporated as new inputs to the agent ’ s decision-making policy . The human thus can transfer any form of information that can be interpreted by the policy ( e.g. , asking the agent to execute skills that it has learned , giving side information that connects the agent to a situation it is more familiar with ) . Because the agent ’ s policy can implement a variety of model architectures and learning algorithms , our framework opens up many possibilities for human-agent communication . To enable faithful communication , we teach the agent to understand its intrinsic needs by interacting with the human and the environment ( rather than imitating human behaviors ) . By requesting different types of information and observing how much each type of information enhances its decisions , the agent gradually learns to determine which information is most useful to obtain in a given situation . With this capability , at deployment time , it can choose when and what information to ask from the human to improve its task performance . To demonstrate the effectiveness of HARI , we simulate a human-assisted navigation problem where an agent has access to only sparse information about its current state and the goal , and can request additional information about these states . On tasks that take place in previously unseen environments , the ability to ask for help improves the agent ’ s success rate by 7× higher compared to performing tasks only by itself . This human-assisted agent even outperforms an agent that always has access to dense information in unseen environments , thanks to the ability to request subgoals . We show that performance of the agent can be further improved by recursively asking for subgoals of subgoals . We discuss limitations of the policy ’ s model and feature representation , which suggest room for future improvements . 2 MOTIVATION : LIMITATIONS OF THE STANDARD POMDP FRAMEWORK . We consider an environment defined by a partially-observed Markov decision process ( POMDP ) E = ( S , A , T , c , D , ρ ) with state space S , action space A , state-transition function T : S × A → ∆ ( S ) , cost function c : S ×A → R , description space D , and description function ρ : S → ∆ ( D ) .1 Here , ∆ ( Y ) denotes the set of all probability distributions over a set Y . We refer to this environment as the operation environment because it is where the agent operates to accomplish tasks . Each task in the environment is defined as a tuple ( s1 , g1 , d g 1 ) where s1 is the start state , g1 is the goal state , and dg1 is a limited description of g1 . Initially , a task ( s1 , g1 , d g 1 ) is sampled from a task 1We use the term “ description ” in lieu of “ observation ” in the POMDP formulation to emphasize two properties of the information the agent has access to for making decisions : ( i ) the information can be in various modalities and ( ii ) the information can be obtained via not only perception , but also communication . distribution T. An agent starts in s1 and is only given the goal description d g 1 . It has to reach the goal state g1 within H time steps . Let gt and d g t be the goal state and goal description being executed at time step t , respectively . In a standard POMDP , gt = g1 and d g t = d g 1 for 1 ≤ t ≤ H . But later , we will enable the agent to set new goals via communication with humans . At any time step t , the agent does not know its true state st but only receives a description dst ∼ ρ ( st ) of the state . Generally , the description can include any information coming from any knowledge source ( e.g. , an RGB image and/or a verbal description describing the current view ) . Given dst and dgt , the agent then makes a decision at ∈ A , transitions to the next state st+1 ∼ T ( st , at ) , and receives a cost ct , c ( st , at ) . A special action adone ∈ A is taken when the agent decides to terminate its execution . The goal of the agent is to reach g1 with minimum cumulative cost C ( τ ) = ∑H t=1 ct , where τ = ( s1 , d s 1 , a1 , s2 , d s 2 , a2 , . . . , sH , d s H ) is an execution of the task . As the agent does not have access to its true state , it can only make decisions based on the ( observable ) partial execution τ1 : t = ( ds1 , a1 , . . . , d s t ) . Kaelbling et al . ( 1998 ) introduce the notion of a belief state b ∈ ∆ ( S ) , which sufficiently summarizes a partial execution as a distribution over the state space S. In practice , when S is continuous or high-dimensional , representing and updating a full belief state ( whose dimension is |S| ) is intractable . We follow Hausknecht & Stone ( 2015 ) , using recurrent neural networks to learn compact representation of partial executions . We denote by bst a representation of the partial execution τ1 : t and by B the set of all possible representations . The agent maintains an operation policy π̂ : B × D → ∆ ( A ) that maps a belief state bs and a goal description dg to a distribution over A . The learning objective for solving a standard POMDP is to estimate an operation policy that minimizes the expected cumulative cost of performing tasks : min π E ( s1 , g1 , dg1 ) ∼T , τ∼Pπ ( ·|s1 , dg1 ) [ C ( τ ) ] ( 1 ) where Pπ ( · | s1 , dg1 ) is the distribution over executions generated by a policy π given start state s1 and goal description d g 1 . In a standard POMDP , an agent performs tasks by executing its own operation policy without asking for any external assistance . Moreover , the description function ρ and the goal description dg1 are assumed to be fixed during a task execution . As seen from Equation 1 , given a fixed environment and task distribution , the expected performance of the agent is solely determined by the operation policy π̂ . Thus , the standard POMDP framework does not provide any mechanism for improving the agent ’ s performance other than enhancing the operation policy . 3 LEVERAGING HUMAN KNOWLEDGE TO BETTER ACCOMPLISH TASKS . We introduce an assistant into the operation environment , who can provide information about the environment ’ s states . We assume the agent possesses a pre-learned operation policy π̂ . This policy serves as the common ground between the agent and the assistant , which is a prerequisite for communication between them to occur . For example , this policy represents a set of basic tasks that agent has mastered and the assistant can ask the agent to perform . In general , the more knowledge encoded in this policy , the more effectively the agent can communicate with and leverage help from the assistant . Our goal is to learn an interaction policy ψθ ( parametrized by θ ) that controls how the agent communicates with the assistant to gather additional information . The operation policy π̂ will be invoked by the interaction policy if the latter decides that the agent does not need new information and wants to take an operating action . The assistant aids the agent by giving new ( current or goal ) state descriptions , connecting the agent to situations on which it can make better decisions . Consider an object-finding navigation problem , where a robot has been trained to reliably navigate to the kitchen from the living room of a house . Suppose the robot is then asked to “ find a mug ” , an object that it has never heard of . The assistant can help the robot accomplish this task by giving a more informative goal description “ find a mug in the kitchen ” , relating the current task to the kitchen-finding task that the robot has been familiar with . The robot may also have problems with localization : it knows how to get the kitchen from the living room but it may not realize that it is currently the living room . In this case , giving a currentstate description that specifies this information provides the robot with a useful hint on what actions to take next . Our framework allows the assistant to convey any form of information that the agent can incorporate into its input . As discussed in §2 , the notion of “ state description ” in our framework is general , capturing various types of information , including but not limited to visual perception and verbal description . Communication between the agent and the assistant can be flexibly enriched by designing the agent ’ s operation policy to be able to consume the forms of information of interest ( e.g. , a policy that takes natural language as input ) . Communication with the Assistant . The assistant is present all the time and knows the agent ’ s current state st and the goal state gt . It is specified by two functions : a description function ρA : S ×D → ∆ ( D ) and a subgoal function ωA : S ×S → ∆ ( S ) . ρA ( d′ | s , d ) specifies the probability of giving d′ as the new description of state s given a current description d. ωA ( g′ | s , g ) indicates the probability of proposing g′ as a subgoal given a current state s and a goal state g. At time step t , the assistant accepts three types of request from the agent : ( a ) CUR : requests a new description of st and receives dst+1 ∼ ρA ( · | st , dst ) ; ( b ) GOAL : requests a new description of gt and receives d g t+1 ∼ ρA ( · | gt , d g t ) ; ( c ) SUB : requests a description of a subgoal gt+1 and receives d g t+1 ∼ ρA ( · | gt+1 , ∅ ) where gt+1 ∼ ωA ( · | st , gt ) and ∅ is an empty description . Interaction Policy . The action space of the interaction policy ψθ consists of five actions : { CUR , GOAL , SUB , DO , DONE } . The first three actions correspond to making the three types of request that the assistants accepts . The remaining two actions are used to traverse in the operation environment : ( d ) DO : executes the action adot , arg maxa∈A π̂ ( a | bst , d g t ) . The agent transitions to a new operation state st+1 ∼ T ( st , adot ) ; ( e ) DONE : determines that the current goal gt has been reached.2 If gt is a main goal ( gt = g1 ) , the task episode ends . If gt is a subgoal ( gt 6= g1 ) , the agent may choose a new goal to follow . Our problem formulation leaves it open on what goal should be selected next . By selecting among these actions , the interaction policy essentially decides when to ask the assistant for additional information , and what types of information to ask for . Our formulation does not specify the input space of the interaction policy , as this space depends on how the agent implements its goal memory ( i.e . how it stores and retrieves the subgoals ) . In the next section , we introduce an instantiation where the agent uses a stack data structure to manage ( sub ) goals .
The paper presents a reinforcement learning framework where the agent is able to "ask for help" to receive from a human additional information to more easily solve the task. The paper is kinda Robotic Navigation-oriented by the way tasks and "additional information" about the environment are described, as well as in the empirical evaluation. It's uncertain if the paper presents any significant contribution due to major omissions on the related works list (explanation in the main review)
SP:b945fbdb2f2b8e1045366cbe89d4ac95c690c120
Learning When and What to Ask: a Hierarchical Reinforcement Learning Framework
1 INTRODUCTION . Human-agent communication at deployment time has been under-explored in machine learning , where the traditional focus has been on building agents that can accomplish tasks on their own ( full autonomy ) . Nevertheless , enabling an agent to exchange information with humans during its operation can potentially enhance its helpfulness and trustworthiness . The ability to request and interpret human advice would help the agent accomplish tasks beyond its built-in knowledge , while the ability to accurately convey when and why it is about to fail would make the agent safer to use . In his classical work , Grice ( 1975 ) outlines the desired characteristics of cooperative communication , commonly known as the Gricean maxims of cooperation . Among these characteristics are informativeness ( the maxim of quantity ) and faithfulness ( the maxim of quality ) . Human-agent communication in current work has fallen short in these two aspects . Traditional frameworks like imitation learning and reinforcement learning employ limited communication protocols where the agent and the human can only exchange simple intentions ( requesting low-level actions or rewards Torrey & Taylor ( 2013 ) ; Knox & Stone ( 2009 ) ) . More powerful frameworks like ( Nguyen & Daumé III , 2019 ; Nguyen et al. , 2019 ; Kim et al. , 2019 ) allow the agent to process high-level instructions from humans , but the agent still only requests generic help . Recent work in natural language processing endows the agent with the ability to generate rich natural language utterances ( Camburu et al. , 2018 ; Rao & Daumé III , 2018 ; De Vries et al. , 2017 ; Das et al. , 2017 ) , but the communication is not faithful in the sense that the agent only mirrors human-generated utterances without grounding its communication in self-perception of its ( in ) capabilities and ( un ) certainties . Essentially it learns to convey what a human may be concerned about , not what it is concerned about . This paper presents a hierarchical reinforcement learning framework named HARI ( Human-Assisted Reinforced Interaction ) , which supports richer and more faithful human-agent communication . Our framework allows the agent to learn to convey intrinstic needs for specific information and to incorporate diverse types of information from humans to make better decisions . Specifically , the agent in HARI is equipped with three information-seeking intentions : in every step , it can choose to request more information about ( i ) its current state , ( ii ) the goal state , or ( iii ) a subgoal state which , if reached , helps it make progress on the current task . Upon receiving a request , the human can transfer new information to the agent by giving new descriptions of the requested state . These de- scriptions will be incorporated as new inputs to the agent ’ s decision-making policy . The human thus can transfer any form of information that can be interpreted by the policy ( e.g. , asking the agent to execute skills that it has learned , giving side information that connects the agent to a situation it is more familiar with ) . Because the agent ’ s policy can implement a variety of model architectures and learning algorithms , our framework opens up many possibilities for human-agent communication . To enable faithful communication , we teach the agent to understand its intrinsic needs by interacting with the human and the environment ( rather than imitating human behaviors ) . By requesting different types of information and observing how much each type of information enhances its decisions , the agent gradually learns to determine which information is most useful to obtain in a given situation . With this capability , at deployment time , it can choose when and what information to ask from the human to improve its task performance . To demonstrate the effectiveness of HARI , we simulate a human-assisted navigation problem where an agent has access to only sparse information about its current state and the goal , and can request additional information about these states . On tasks that take place in previously unseen environments , the ability to ask for help improves the agent ’ s success rate by 7× higher compared to performing tasks only by itself . This human-assisted agent even outperforms an agent that always has access to dense information in unseen environments , thanks to the ability to request subgoals . We show that performance of the agent can be further improved by recursively asking for subgoals of subgoals . We discuss limitations of the policy ’ s model and feature representation , which suggest room for future improvements . 2 MOTIVATION : LIMITATIONS OF THE STANDARD POMDP FRAMEWORK . We consider an environment defined by a partially-observed Markov decision process ( POMDP ) E = ( S , A , T , c , D , ρ ) with state space S , action space A , state-transition function T : S × A → ∆ ( S ) , cost function c : S ×A → R , description space D , and description function ρ : S → ∆ ( D ) .1 Here , ∆ ( Y ) denotes the set of all probability distributions over a set Y . We refer to this environment as the operation environment because it is where the agent operates to accomplish tasks . Each task in the environment is defined as a tuple ( s1 , g1 , d g 1 ) where s1 is the start state , g1 is the goal state , and dg1 is a limited description of g1 . Initially , a task ( s1 , g1 , d g 1 ) is sampled from a task 1We use the term “ description ” in lieu of “ observation ” in the POMDP formulation to emphasize two properties of the information the agent has access to for making decisions : ( i ) the information can be in various modalities and ( ii ) the information can be obtained via not only perception , but also communication . distribution T. An agent starts in s1 and is only given the goal description d g 1 . It has to reach the goal state g1 within H time steps . Let gt and d g t be the goal state and goal description being executed at time step t , respectively . In a standard POMDP , gt = g1 and d g t = d g 1 for 1 ≤ t ≤ H . But later , we will enable the agent to set new goals via communication with humans . At any time step t , the agent does not know its true state st but only receives a description dst ∼ ρ ( st ) of the state . Generally , the description can include any information coming from any knowledge source ( e.g. , an RGB image and/or a verbal description describing the current view ) . Given dst and dgt , the agent then makes a decision at ∈ A , transitions to the next state st+1 ∼ T ( st , at ) , and receives a cost ct , c ( st , at ) . A special action adone ∈ A is taken when the agent decides to terminate its execution . The goal of the agent is to reach g1 with minimum cumulative cost C ( τ ) = ∑H t=1 ct , where τ = ( s1 , d s 1 , a1 , s2 , d s 2 , a2 , . . . , sH , d s H ) is an execution of the task . As the agent does not have access to its true state , it can only make decisions based on the ( observable ) partial execution τ1 : t = ( ds1 , a1 , . . . , d s t ) . Kaelbling et al . ( 1998 ) introduce the notion of a belief state b ∈ ∆ ( S ) , which sufficiently summarizes a partial execution as a distribution over the state space S. In practice , when S is continuous or high-dimensional , representing and updating a full belief state ( whose dimension is |S| ) is intractable . We follow Hausknecht & Stone ( 2015 ) , using recurrent neural networks to learn compact representation of partial executions . We denote by bst a representation of the partial execution τ1 : t and by B the set of all possible representations . The agent maintains an operation policy π̂ : B × D → ∆ ( A ) that maps a belief state bs and a goal description dg to a distribution over A . The learning objective for solving a standard POMDP is to estimate an operation policy that minimizes the expected cumulative cost of performing tasks : min π E ( s1 , g1 , dg1 ) ∼T , τ∼Pπ ( ·|s1 , dg1 ) [ C ( τ ) ] ( 1 ) where Pπ ( · | s1 , dg1 ) is the distribution over executions generated by a policy π given start state s1 and goal description d g 1 . In a standard POMDP , an agent performs tasks by executing its own operation policy without asking for any external assistance . Moreover , the description function ρ and the goal description dg1 are assumed to be fixed during a task execution . As seen from Equation 1 , given a fixed environment and task distribution , the expected performance of the agent is solely determined by the operation policy π̂ . Thus , the standard POMDP framework does not provide any mechanism for improving the agent ’ s performance other than enhancing the operation policy . 3 LEVERAGING HUMAN KNOWLEDGE TO BETTER ACCOMPLISH TASKS . We introduce an assistant into the operation environment , who can provide information about the environment ’ s states . We assume the agent possesses a pre-learned operation policy π̂ . This policy serves as the common ground between the agent and the assistant , which is a prerequisite for communication between them to occur . For example , this policy represents a set of basic tasks that agent has mastered and the assistant can ask the agent to perform . In general , the more knowledge encoded in this policy , the more effectively the agent can communicate with and leverage help from the assistant . Our goal is to learn an interaction policy ψθ ( parametrized by θ ) that controls how the agent communicates with the assistant to gather additional information . The operation policy π̂ will be invoked by the interaction policy if the latter decides that the agent does not need new information and wants to take an operating action . The assistant aids the agent by giving new ( current or goal ) state descriptions , connecting the agent to situations on which it can make better decisions . Consider an object-finding navigation problem , where a robot has been trained to reliably navigate to the kitchen from the living room of a house . Suppose the robot is then asked to “ find a mug ” , an object that it has never heard of . The assistant can help the robot accomplish this task by giving a more informative goal description “ find a mug in the kitchen ” , relating the current task to the kitchen-finding task that the robot has been familiar with . The robot may also have problems with localization : it knows how to get the kitchen from the living room but it may not realize that it is currently the living room . In this case , giving a currentstate description that specifies this information provides the robot with a useful hint on what actions to take next . Our framework allows the assistant to convey any form of information that the agent can incorporate into its input . As discussed in §2 , the notion of “ state description ” in our framework is general , capturing various types of information , including but not limited to visual perception and verbal description . Communication between the agent and the assistant can be flexibly enriched by designing the agent ’ s operation policy to be able to consume the forms of information of interest ( e.g. , a policy that takes natural language as input ) . Communication with the Assistant . The assistant is present all the time and knows the agent ’ s current state st and the goal state gt . It is specified by two functions : a description function ρA : S ×D → ∆ ( D ) and a subgoal function ωA : S ×S → ∆ ( S ) . ρA ( d′ | s , d ) specifies the probability of giving d′ as the new description of state s given a current description d. ωA ( g′ | s , g ) indicates the probability of proposing g′ as a subgoal given a current state s and a goal state g. At time step t , the assistant accepts three types of request from the agent : ( a ) CUR : requests a new description of st and receives dst+1 ∼ ρA ( · | st , dst ) ; ( b ) GOAL : requests a new description of gt and receives d g t+1 ∼ ρA ( · | gt , d g t ) ; ( c ) SUB : requests a description of a subgoal gt+1 and receives d g t+1 ∼ ρA ( · | gt+1 , ∅ ) where gt+1 ∼ ωA ( · | st , gt ) and ∅ is an empty description . Interaction Policy . The action space of the interaction policy ψθ consists of five actions : { CUR , GOAL , SUB , DO , DONE } . The first three actions correspond to making the three types of request that the assistants accepts . The remaining two actions are used to traverse in the operation environment : ( d ) DO : executes the action adot , arg maxa∈A π̂ ( a | bst , d g t ) . The agent transitions to a new operation state st+1 ∼ T ( st , adot ) ; ( e ) DONE : determines that the current goal gt has been reached.2 If gt is a main goal ( gt = g1 ) , the task episode ends . If gt is a subgoal ( gt 6= g1 ) , the agent may choose a new goal to follow . Our problem formulation leaves it open on what goal should be selected next . By selecting among these actions , the interaction policy essentially decides when to ask the assistant for additional information , and what types of information to ask for . Our formulation does not specify the input space of the interaction policy , as this space depends on how the agent implements its goal memory ( i.e . how it stores and retrieves the subgoals ) . In the next section , we introduce an instantiation where the agent uses a stack data structure to manage ( sub ) goals .
The paper operates in a 2-agent setting, where one agent is a learning agent and the other agent is the assistant. The objective is for the learning agent to seek help from the assistant while solving a task, and the decision of what to ask the assistant and when to do so is made by learning an interaction policy using hierarchical reinforcement learning -- in particular using a variant of POMDPs. The assumption is that the learning agent's operational policy on the task environment is not changed and an additional interaction (hierarchical) policy is learned on top of the operational policy which dictates when and what to ask the assistant. The authors have empirically evaluated their approach on a (simulated) human-assisted navigation task, and show that the proposed method achieves close to seven times an increase in the success rate of solving the task compared to the policy obtained by learning without assistance. Additionally, the results also show that the frequency of seeking assistance was only 25 percent of all actions executed to solve the task.
SP:b945fbdb2f2b8e1045366cbe89d4ac95c690c120
Learning When and What to Ask: a Hierarchical Reinforcement Learning Framework
1 INTRODUCTION . Human-agent communication at deployment time has been under-explored in machine learning , where the traditional focus has been on building agents that can accomplish tasks on their own ( full autonomy ) . Nevertheless , enabling an agent to exchange information with humans during its operation can potentially enhance its helpfulness and trustworthiness . The ability to request and interpret human advice would help the agent accomplish tasks beyond its built-in knowledge , while the ability to accurately convey when and why it is about to fail would make the agent safer to use . In his classical work , Grice ( 1975 ) outlines the desired characteristics of cooperative communication , commonly known as the Gricean maxims of cooperation . Among these characteristics are informativeness ( the maxim of quantity ) and faithfulness ( the maxim of quality ) . Human-agent communication in current work has fallen short in these two aspects . Traditional frameworks like imitation learning and reinforcement learning employ limited communication protocols where the agent and the human can only exchange simple intentions ( requesting low-level actions or rewards Torrey & Taylor ( 2013 ) ; Knox & Stone ( 2009 ) ) . More powerful frameworks like ( Nguyen & Daumé III , 2019 ; Nguyen et al. , 2019 ; Kim et al. , 2019 ) allow the agent to process high-level instructions from humans , but the agent still only requests generic help . Recent work in natural language processing endows the agent with the ability to generate rich natural language utterances ( Camburu et al. , 2018 ; Rao & Daumé III , 2018 ; De Vries et al. , 2017 ; Das et al. , 2017 ) , but the communication is not faithful in the sense that the agent only mirrors human-generated utterances without grounding its communication in self-perception of its ( in ) capabilities and ( un ) certainties . Essentially it learns to convey what a human may be concerned about , not what it is concerned about . This paper presents a hierarchical reinforcement learning framework named HARI ( Human-Assisted Reinforced Interaction ) , which supports richer and more faithful human-agent communication . Our framework allows the agent to learn to convey intrinstic needs for specific information and to incorporate diverse types of information from humans to make better decisions . Specifically , the agent in HARI is equipped with three information-seeking intentions : in every step , it can choose to request more information about ( i ) its current state , ( ii ) the goal state , or ( iii ) a subgoal state which , if reached , helps it make progress on the current task . Upon receiving a request , the human can transfer new information to the agent by giving new descriptions of the requested state . These de- scriptions will be incorporated as new inputs to the agent ’ s decision-making policy . The human thus can transfer any form of information that can be interpreted by the policy ( e.g. , asking the agent to execute skills that it has learned , giving side information that connects the agent to a situation it is more familiar with ) . Because the agent ’ s policy can implement a variety of model architectures and learning algorithms , our framework opens up many possibilities for human-agent communication . To enable faithful communication , we teach the agent to understand its intrinsic needs by interacting with the human and the environment ( rather than imitating human behaviors ) . By requesting different types of information and observing how much each type of information enhances its decisions , the agent gradually learns to determine which information is most useful to obtain in a given situation . With this capability , at deployment time , it can choose when and what information to ask from the human to improve its task performance . To demonstrate the effectiveness of HARI , we simulate a human-assisted navigation problem where an agent has access to only sparse information about its current state and the goal , and can request additional information about these states . On tasks that take place in previously unseen environments , the ability to ask for help improves the agent ’ s success rate by 7× higher compared to performing tasks only by itself . This human-assisted agent even outperforms an agent that always has access to dense information in unseen environments , thanks to the ability to request subgoals . We show that performance of the agent can be further improved by recursively asking for subgoals of subgoals . We discuss limitations of the policy ’ s model and feature representation , which suggest room for future improvements . 2 MOTIVATION : LIMITATIONS OF THE STANDARD POMDP FRAMEWORK . We consider an environment defined by a partially-observed Markov decision process ( POMDP ) E = ( S , A , T , c , D , ρ ) with state space S , action space A , state-transition function T : S × A → ∆ ( S ) , cost function c : S ×A → R , description space D , and description function ρ : S → ∆ ( D ) .1 Here , ∆ ( Y ) denotes the set of all probability distributions over a set Y . We refer to this environment as the operation environment because it is where the agent operates to accomplish tasks . Each task in the environment is defined as a tuple ( s1 , g1 , d g 1 ) where s1 is the start state , g1 is the goal state , and dg1 is a limited description of g1 . Initially , a task ( s1 , g1 , d g 1 ) is sampled from a task 1We use the term “ description ” in lieu of “ observation ” in the POMDP formulation to emphasize two properties of the information the agent has access to for making decisions : ( i ) the information can be in various modalities and ( ii ) the information can be obtained via not only perception , but also communication . distribution T. An agent starts in s1 and is only given the goal description d g 1 . It has to reach the goal state g1 within H time steps . Let gt and d g t be the goal state and goal description being executed at time step t , respectively . In a standard POMDP , gt = g1 and d g t = d g 1 for 1 ≤ t ≤ H . But later , we will enable the agent to set new goals via communication with humans . At any time step t , the agent does not know its true state st but only receives a description dst ∼ ρ ( st ) of the state . Generally , the description can include any information coming from any knowledge source ( e.g. , an RGB image and/or a verbal description describing the current view ) . Given dst and dgt , the agent then makes a decision at ∈ A , transitions to the next state st+1 ∼ T ( st , at ) , and receives a cost ct , c ( st , at ) . A special action adone ∈ A is taken when the agent decides to terminate its execution . The goal of the agent is to reach g1 with minimum cumulative cost C ( τ ) = ∑H t=1 ct , where τ = ( s1 , d s 1 , a1 , s2 , d s 2 , a2 , . . . , sH , d s H ) is an execution of the task . As the agent does not have access to its true state , it can only make decisions based on the ( observable ) partial execution τ1 : t = ( ds1 , a1 , . . . , d s t ) . Kaelbling et al . ( 1998 ) introduce the notion of a belief state b ∈ ∆ ( S ) , which sufficiently summarizes a partial execution as a distribution over the state space S. In practice , when S is continuous or high-dimensional , representing and updating a full belief state ( whose dimension is |S| ) is intractable . We follow Hausknecht & Stone ( 2015 ) , using recurrent neural networks to learn compact representation of partial executions . We denote by bst a representation of the partial execution τ1 : t and by B the set of all possible representations . The agent maintains an operation policy π̂ : B × D → ∆ ( A ) that maps a belief state bs and a goal description dg to a distribution over A . The learning objective for solving a standard POMDP is to estimate an operation policy that minimizes the expected cumulative cost of performing tasks : min π E ( s1 , g1 , dg1 ) ∼T , τ∼Pπ ( ·|s1 , dg1 ) [ C ( τ ) ] ( 1 ) where Pπ ( · | s1 , dg1 ) is the distribution over executions generated by a policy π given start state s1 and goal description d g 1 . In a standard POMDP , an agent performs tasks by executing its own operation policy without asking for any external assistance . Moreover , the description function ρ and the goal description dg1 are assumed to be fixed during a task execution . As seen from Equation 1 , given a fixed environment and task distribution , the expected performance of the agent is solely determined by the operation policy π̂ . Thus , the standard POMDP framework does not provide any mechanism for improving the agent ’ s performance other than enhancing the operation policy . 3 LEVERAGING HUMAN KNOWLEDGE TO BETTER ACCOMPLISH TASKS . We introduce an assistant into the operation environment , who can provide information about the environment ’ s states . We assume the agent possesses a pre-learned operation policy π̂ . This policy serves as the common ground between the agent and the assistant , which is a prerequisite for communication between them to occur . For example , this policy represents a set of basic tasks that agent has mastered and the assistant can ask the agent to perform . In general , the more knowledge encoded in this policy , the more effectively the agent can communicate with and leverage help from the assistant . Our goal is to learn an interaction policy ψθ ( parametrized by θ ) that controls how the agent communicates with the assistant to gather additional information . The operation policy π̂ will be invoked by the interaction policy if the latter decides that the agent does not need new information and wants to take an operating action . The assistant aids the agent by giving new ( current or goal ) state descriptions , connecting the agent to situations on which it can make better decisions . Consider an object-finding navigation problem , where a robot has been trained to reliably navigate to the kitchen from the living room of a house . Suppose the robot is then asked to “ find a mug ” , an object that it has never heard of . The assistant can help the robot accomplish this task by giving a more informative goal description “ find a mug in the kitchen ” , relating the current task to the kitchen-finding task that the robot has been familiar with . The robot may also have problems with localization : it knows how to get the kitchen from the living room but it may not realize that it is currently the living room . In this case , giving a currentstate description that specifies this information provides the robot with a useful hint on what actions to take next . Our framework allows the assistant to convey any form of information that the agent can incorporate into its input . As discussed in §2 , the notion of “ state description ” in our framework is general , capturing various types of information , including but not limited to visual perception and verbal description . Communication between the agent and the assistant can be flexibly enriched by designing the agent ’ s operation policy to be able to consume the forms of information of interest ( e.g. , a policy that takes natural language as input ) . Communication with the Assistant . The assistant is present all the time and knows the agent ’ s current state st and the goal state gt . It is specified by two functions : a description function ρA : S ×D → ∆ ( D ) and a subgoal function ωA : S ×S → ∆ ( S ) . ρA ( d′ | s , d ) specifies the probability of giving d′ as the new description of state s given a current description d. ωA ( g′ | s , g ) indicates the probability of proposing g′ as a subgoal given a current state s and a goal state g. At time step t , the assistant accepts three types of request from the agent : ( a ) CUR : requests a new description of st and receives dst+1 ∼ ρA ( · | st , dst ) ; ( b ) GOAL : requests a new description of gt and receives d g t+1 ∼ ρA ( · | gt , d g t ) ; ( c ) SUB : requests a description of a subgoal gt+1 and receives d g t+1 ∼ ρA ( · | gt+1 , ∅ ) where gt+1 ∼ ωA ( · | st , gt ) and ∅ is an empty description . Interaction Policy . The action space of the interaction policy ψθ consists of five actions : { CUR , GOAL , SUB , DO , DONE } . The first three actions correspond to making the three types of request that the assistants accepts . The remaining two actions are used to traverse in the operation environment : ( d ) DO : executes the action adot , arg maxa∈A π̂ ( a | bst , d g t ) . The agent transitions to a new operation state st+1 ∼ T ( st , adot ) ; ( e ) DONE : determines that the current goal gt has been reached.2 If gt is a main goal ( gt = g1 ) , the task episode ends . If gt is a subgoal ( gt 6= g1 ) , the agent may choose a new goal to follow . Our problem formulation leaves it open on what goal should be selected next . By selecting among these actions , the interaction policy essentially decides when to ask the assistant for additional information , and what types of information to ask for . Our formulation does not specify the input space of the interaction policy , as this space depends on how the agent implements its goal memory ( i.e . how it stores and retrieves the subgoals ) . In the next section , we introduce an instantiation where the agent uses a stack data structure to manage ( sub ) goals .
This paper formulates a hierarchical RL agent that learns to request information from human assistant, when task-critical information is missing. The assistant is assumed to be omniscent, present at all times, know the agent’s current state, know the agents goal state, and be able to accurately provide the requested information. On each step the agent has 5 types of actions: it can either issue one of the three information queries (request current state description, goal state description, subgoal description), or execute the highest value action according to its beliefs, or terminate execution. Such a framework can be applicable to situations where an RL agent is trained on a certain task, but deployed on a similar task with some information missing (for example, a missing object annotation). The framework is demonstrated on simulated human-assisted object finding task. The paper shows that an agent equipped with a human assistant achieves an improved rate of successfully completing the task, compared to an unassisted agent.
SP:b945fbdb2f2b8e1045366cbe89d4ac95c690c120
Illiterate DALL$\cdot$E Learns to Compose
1 INTRODUCTION . Unsupervised learning of compositional representation is a core ability of human intelligence ( Yuille & Kersten , 2006 ; Frankland & Greene , 2020 ) . Observing a visual scene , we perceive it not simply as a monolithic entity but as a geometric composition of key components such as objects , borders , and space ( Kulkarni et al. , 2015 ; Yuille & Kersten , 2006 ; Epstein et al. , 2017 ; Behrens et al. , 2018 ) . Furthermore , this understanding of the structure of the scene composition enables the ability for zero-shot imagination , i.e. , composing a novel , counterfactual , or systematically manipulated scenes that are significantly different from the training distribution . As such , realizing this ability has been considered a core challenge in building a human-like AI system ( Lake et al. , 2017 ) . DALL·E ( Ramesh et al. , 2021 ) has recently shown an impressive ability to systematically generalize for zero-shot image generation . Trained with a dataset of text-image pairs , it can generate plausible images even from an unfamiliar text prompt such as “ avocado chair ” or “ lettuce hedgehog ” , a form of systematic generalization ( Lake & Baroni , 2018 ; Bahdanau et al. , 2018 ) in the text-to-image domain . However , from the perspective of compositionality , this success is somewhat expected because the text prompt already brings the composable structure . That is , the text is already discretized into a sequence of concept modules , i.e. , words , which are composable , reusable , and encapsulated . DALL·E then learns to produce an image with global consistency by smoothly stitching over the discrete concepts via an Image GPT ( Chen et al. , 2020 ) decoder . Building from the success of DALL·E , an important question is if we can achieve such systematic generalization for zero-shot image generation only from images without text . This would require realizing an ability lacking in DALL·E : extracting a set of composable representations from an image to play a similar role as that of word tokens . The most relevant direction towards this is object-centric representation learning ( Greff et al. , 2019 ; Locatello et al. , 2020 ; Lin et al. , 2020b ; Greff et al. , 2020b ) . While these can obtain a set of slots from an input image and reconstruct the same image from the slots , we argue that its systematic generalization ability to handle arbitrary reconfiguration of slots is significantly limited due to the way it decodes the slots . In this paper , we propose a model that can achieve composition-based systematic generalization for image generation like DALL·E but by learning compositional representations from images instead of providing a text prompt . We call this model , Illiterate-DALL·E . To do this , we first introduce the slot-decoding dilemma and the pixel independence problem observed in the pixel-mixture decoder of traditional object-centric representation models . Then , we hypothesize that achieving compositional systematic generalization in image generation requires not only compositional slots but also a powerful expressive decoder that can model complex interactions among the slots and other pixels . To this end , we propose the slot-to-sequence ( Slot2Seq ) decoder , which is an Image GPT decoder that takes the extracted slots as input instead of text . In experiments , we show that this simple architecture achieves the desired properties . The main contribution of the paper is to show for the first time that the compositional systematic generalization , shown in DALL·E , can be achieved without text . We also show that making a powerful and expressive decoder work with slot representations is crucial in achieving this . In this regard , we introduce a new architecture , Illiterate-DALL·E , and a new slot decoding framework , Slot2Seq . The paper also introduces a new dataset , CLEVR-Mirror , and other tasks useful to evaluate the systematic generalization ability in image generation . Lastly , the experiment results strongly support the benefits of our model , and suggest that future object-centric models may benefit from building on the advantages of the proposed framework alongside the pixel-mixture decoder . 2 PRELIMINARIES . 2.1 OBJECT-CENTRIC REPRESENTATION LEARNING WITH PIXEL-MIXTURE DECODER . A common framework for learning object-centric representations is via a form of auto-encoders ( Locatello et al. , 2020 ; Burgess et al. , 2019 ; Lin et al. , 2020b ) . An encoder takes an input image to return a set of object representation vectors or slot vectors { s1 , . . . , sN } = fφ ( x ) . A decoder then reconstructs the image by composing the decoded result of each slot x̂ = gθ ( s1 : N ) . To encourage the emergence of object concepts in the slots , the decoder usually uses an architecture implementing an inductive bias about the scene composition such as the pixel-mixture decoders . Pixel-mixture decoders are the most common approach to construct an image from slots . This method assumes that the final image is constructed by the pixel-wise weighted mean of the slot images . Specifically , each slot n generates its own slot image µn and its corresponding alpha-mask πn . Then , the slot images are weighted-summed with the alpha-mask weights as follows : x̂i = N∑ n=1 πn , i · µn , i where µn = gRGBθ ( sn ) and πn = exp gmaskθ ( sn ) ∑N m=1 exp g mask θ ( sm ) , where i ∈ [ 1 , HW ] is the pixel index with H and W the image height and width , respectively . 2.2 LIMITATIONS OF PIXEL-MIXTURE DECODERS . The pixel-mixture decoder has two main limitations . The first is what we term as the slot-decoding dilemma . As there is no explicit incentive for the encoder to make a slot focus on the pixel area corresponding to an object , it is usually required to employ a weak decoder for gRGBθ such as the Spatial Broadcast Network ( Watters et al. , 2019 ) to make object concepts emerge in the slots . By limiting the capacity of the slot-decoder , it prevents a slot from modeling multiple objects or the entire image and instead incentivizes the slot to focus on a local area that shows a statistical regularity such as an object of a simple color . However , this comes with a side effect : the weak decoder can make the generated image blur the details . When we use a more expressive decoder such as a CNN to capture such details , the object disentanglement tends to fail with encoder producing slots that capture the whole image , hence a dilemma ( See Appendix D.1 ) . The second problem is the pixel independence . In pixel-mixture decoders , each slot ’ s contribution to a generated pixel , i.e. , πn , i and µn , i , is independent of the other slots and pixels . This may not be an issue if the aim of the slots is only to reconstruct the input image . However , it becomes an issue when we consider that an important desired property for object representations is to use them as concept modules i.e. , to be able to reuse them in an arbitrary configuration in the same way as word embeddings can be reused to compose an arbitrary sentence . The lack of flexibility of the decoder due to the pixel independence , however , prevents the slots from having such reconfigurability . For example , when decoding an arbitrary set of slots , the rendered image would look like a mere superposition of individual object patches without global semantic consistency , producing a Frankenstein-like image as the examples in Section 5 shall show . In contrast , this zero-shot global semantic consistency for concept reconfiguration is achieved in DALL·E by using the Image GPT decoder . 2.3 IMAGE GPT AND DALL·E . Image GPT ( Chen et al. , 2020a ) is an autoregressive generative model for images implemented using Transformer ( Vaswani et al. , 2017 ; Brown et al. , 2020 ) . For computational efficiency , Image GPT first down-scales the image of size H×W by a factor of K using a VQ-VAE encoder ( van den Oord et al. , 2017 ) . This turns an image x into a sequence of discrete image tokens { zi } where i indexes the tokens in a raster-scan order from 1 to HW/K2 . The transformer is then trained to model an auto-regressive distribution over this token sequence by maximizing the log-likelihood∑ i log pθ ( zi|z < i ) . During generation , the transformer samples the image tokens sequentially conditioning on the previously generated tokens , i.e. , ẑi ∼ pθ ( ẑi|ẑ < i ) where ẑi is the image token generated for the position i in the sequence . Lastly , a VQ-VAE decoder takes all the generated tokens and produces the final image x̂ . Crucially , due to the autoregressive generation of zi , unlike the pixel-mixture decoder , the generated pixels are not independent . The autoregressive generation powered by the direct memory access of the transformer makes Image GPT one of the most powerful decoder models in image generation and completion tasks . However , Image GPT does not provide a way to learn high-level semantic representations such as object-centric representations that can provide a way to semantically control image generation . DALL·E ( Ramesh et al. , 2021 ) shows that the image generation of Image GPT can be controlled by conditioning on a text prompt . In particular , it shows the impressive ability of zero-shot generation with global semantic consistency for rather an arbitrary reconfiguration of the words in the text prompt . DALL·E can be seen as a conditional Image GPT model , ẑi ∼ pθ ( ẑi|ẑ < i , c1 : N ) , where c1 : N are the text prompt tokens . The key limitation from the perspective of this work is that it requires supervision in terms of text-image pairs . This means that it does not need to learn the compositional structure by itself since the discrete concepts are inherently provided by the prompt text even though it learns the word embeddings provided the structure . Therefore , it is important to investigate if we can make a text-free DALL·E by learning to infer such compositional structure and representation only from images . 3 ILLITERATE DALL·E WITH SLOT-TO-SEQUENCE DECODER . In this section , we propose a method that can provide global semantic consistency in the zeroshot image generation setting without text by learning object slots from images . To do this , we shall lift the use of inductive biases in the slot decoder about object composition by making use of a transformer ( Vaswani et al. , 2017 ) as our image decoder while replacing the text prompt with a concept library constructed from image slots . Our central hypothesis is that a powerful autoregressive decoder such as Transformer after training with a sufficiently diverse set of raw images should learn the rules of composition without domain specifications . Obtaining Image Tokens using DVAE . To make the training of transformer computationally feasible for high-resolution images , we first downscale the input image x of size H ×W by a factor of K using Discrete VAE ( Im et al. , 2017 ) . To do this , we split the image into K ×K-sized patches resulting in T patches where T = HW/K2 . We provide each patch xi as input to an encoder network fφ to return log probabilities ( denoted as oi ) for a categorical distribution with V classes . With these log probabilities , we use a relaxed categorical distribution ( Jang et al. , 2016 ) with a temperature τ to sample a relaxed one-hot vector zsofti . We then decode these soft vectors to obtain patch reconstructions . This process is summarized as follows : oi = fφ ( xi ) =⇒ zsofti ∼ RelaxedCategorical ( oi ; τ ) =⇒ x̃i = gθ ( zsofti ) . By minimizing an MSE reconstruction objective for the image patches i.e . LDVAE = ∑T i=1 ( x̃i − xi ) 2 , we train the DVAE encoder fφ ( · ) and the decoder gθ ( · ) networks . Inferring Object Slots . To infer the object slots from a given image x , we first use the DVAE encoder as described above to obtain a discrete token zi for each patch i . Next , we map each token zi to an embedding by using a learned dictionary . To incorporate the position information into these patch embeddings , we sum them with learned positional embeddings . This results in an embedding ui which now has both the content and the position information for the patch . These embeddings u1 : T are then given as input to a Slot-Attention encoder ( Locatello et al. , 2020 ) with N slots . oi = fφ ( xi ) =⇒ zi ∼ Categorical ( oi ) =⇒ ui = Dictionaryφ ( zi ) + pφ , i =⇒ s1 : N , A1 : N = SlotAttentionφ ( u1 : T ) . This results in N object slots s1 : N and N attention maps A1 : N from the last refinement iteration of the Slot-Attention encoder . Reconstruction using Transformer . To reconstruct the input image , we decode the slots s1 : N and first reconstruct the DVAE tokens ẑ1 : T using a Transformer . We then use the DVAE decoder gθ to decode the DVAE tokens and reconstruct the image patches x̂i and therefore the image x̂ . ôi = Transformerθ ( û < i ; s1 : N ) =⇒ ẑi = arg max v∈ [ 1 , V ] ôi , v =⇒ x̂i = gθ ( ẑi ) . where ûi = Dictionaryφ ( ẑi ) + pφ , i and ôi , v is the log probability of token v among the V classes of the categorical distribution represented by ôi . To train the transformer , the slot attention encoder and the embeddings , we minimize the cross-entropy of predicting each token zi conditioned on the preceding tokens z < i and the slots s1 : N . Let the predicted log-probabilities for the token at position i be ōi = Transformerθ ( u < i ; s1 : N ) . Then the cross-entropy training objective can be written as LST = ∑T i=1 CrossEntropy ( zi , ōi ) . Learning Objective and Training . The complete training objective is given by L = LST + LDVAE and all modules of our model are trained jointly . We apply a decay on the DVAE temperature τ from 1.0 to 0.1 at the start of the training . We also apply a learning rate warm-up for the parameters of Slot-Attention and Transformer at the start of the training as we found that this led to stable training . Multi-headed Slot Attention . For representing images , we found that slots of standard Slot Attention encoder ( Locatello et al. , 2020 ) can suffer in expressiveness when representing objects with complex shapes and textures . This is because the slots collect information from the input cells via dot-product attention in which the attended input values are pooled using a simple weighted sum . As such , this pooling method can be too weak for representing complex objects . To address this , we propose an extension of Slot Attention called Multi-headed Slot Attention in which each slot attends to the input cells via multiple heads . Thus each slot can attend to different parts of the same object . When the slot state is computed , the attended values of different heads are concatenated which allows these partial object features to interact more flexibly and produce a significantly better object representation . Full details of the implementation and an ablation experiment to show the benefits of multiple heads are provided in Appendix A.3 .
This paper proposes a method (Slot2Seq) to adapt the recent DALL-E (text-to-image) model to perform image-to-image composition. The aim is to simultaneously learn latent concepts from base images that can then apply to the generation process (as opposed to input text, which contains somewhat discretized "concepts" already). Experiments with 4 datasets (including a mirrored version of CLEVR) demonstrate that the Slot2Seq approach is effective for novel image generation from slots, reconstruction, and out-of-distribution generation.
SP:3cc6d4424ac05dd22c6f57619dce52271eba5697
Illiterate DALL$\cdot$E Learns to Compose
1 INTRODUCTION . Unsupervised learning of compositional representation is a core ability of human intelligence ( Yuille & Kersten , 2006 ; Frankland & Greene , 2020 ) . Observing a visual scene , we perceive it not simply as a monolithic entity but as a geometric composition of key components such as objects , borders , and space ( Kulkarni et al. , 2015 ; Yuille & Kersten , 2006 ; Epstein et al. , 2017 ; Behrens et al. , 2018 ) . Furthermore , this understanding of the structure of the scene composition enables the ability for zero-shot imagination , i.e. , composing a novel , counterfactual , or systematically manipulated scenes that are significantly different from the training distribution . As such , realizing this ability has been considered a core challenge in building a human-like AI system ( Lake et al. , 2017 ) . DALL·E ( Ramesh et al. , 2021 ) has recently shown an impressive ability to systematically generalize for zero-shot image generation . Trained with a dataset of text-image pairs , it can generate plausible images even from an unfamiliar text prompt such as “ avocado chair ” or “ lettuce hedgehog ” , a form of systematic generalization ( Lake & Baroni , 2018 ; Bahdanau et al. , 2018 ) in the text-to-image domain . However , from the perspective of compositionality , this success is somewhat expected because the text prompt already brings the composable structure . That is , the text is already discretized into a sequence of concept modules , i.e. , words , which are composable , reusable , and encapsulated . DALL·E then learns to produce an image with global consistency by smoothly stitching over the discrete concepts via an Image GPT ( Chen et al. , 2020 ) decoder . Building from the success of DALL·E , an important question is if we can achieve such systematic generalization for zero-shot image generation only from images without text . This would require realizing an ability lacking in DALL·E : extracting a set of composable representations from an image to play a similar role as that of word tokens . The most relevant direction towards this is object-centric representation learning ( Greff et al. , 2019 ; Locatello et al. , 2020 ; Lin et al. , 2020b ; Greff et al. , 2020b ) . While these can obtain a set of slots from an input image and reconstruct the same image from the slots , we argue that its systematic generalization ability to handle arbitrary reconfiguration of slots is significantly limited due to the way it decodes the slots . In this paper , we propose a model that can achieve composition-based systematic generalization for image generation like DALL·E but by learning compositional representations from images instead of providing a text prompt . We call this model , Illiterate-DALL·E . To do this , we first introduce the slot-decoding dilemma and the pixel independence problem observed in the pixel-mixture decoder of traditional object-centric representation models . Then , we hypothesize that achieving compositional systematic generalization in image generation requires not only compositional slots but also a powerful expressive decoder that can model complex interactions among the slots and other pixels . To this end , we propose the slot-to-sequence ( Slot2Seq ) decoder , which is an Image GPT decoder that takes the extracted slots as input instead of text . In experiments , we show that this simple architecture achieves the desired properties . The main contribution of the paper is to show for the first time that the compositional systematic generalization , shown in DALL·E , can be achieved without text . We also show that making a powerful and expressive decoder work with slot representations is crucial in achieving this . In this regard , we introduce a new architecture , Illiterate-DALL·E , and a new slot decoding framework , Slot2Seq . The paper also introduces a new dataset , CLEVR-Mirror , and other tasks useful to evaluate the systematic generalization ability in image generation . Lastly , the experiment results strongly support the benefits of our model , and suggest that future object-centric models may benefit from building on the advantages of the proposed framework alongside the pixel-mixture decoder . 2 PRELIMINARIES . 2.1 OBJECT-CENTRIC REPRESENTATION LEARNING WITH PIXEL-MIXTURE DECODER . A common framework for learning object-centric representations is via a form of auto-encoders ( Locatello et al. , 2020 ; Burgess et al. , 2019 ; Lin et al. , 2020b ) . An encoder takes an input image to return a set of object representation vectors or slot vectors { s1 , . . . , sN } = fφ ( x ) . A decoder then reconstructs the image by composing the decoded result of each slot x̂ = gθ ( s1 : N ) . To encourage the emergence of object concepts in the slots , the decoder usually uses an architecture implementing an inductive bias about the scene composition such as the pixel-mixture decoders . Pixel-mixture decoders are the most common approach to construct an image from slots . This method assumes that the final image is constructed by the pixel-wise weighted mean of the slot images . Specifically , each slot n generates its own slot image µn and its corresponding alpha-mask πn . Then , the slot images are weighted-summed with the alpha-mask weights as follows : x̂i = N∑ n=1 πn , i · µn , i where µn = gRGBθ ( sn ) and πn = exp gmaskθ ( sn ) ∑N m=1 exp g mask θ ( sm ) , where i ∈ [ 1 , HW ] is the pixel index with H and W the image height and width , respectively . 2.2 LIMITATIONS OF PIXEL-MIXTURE DECODERS . The pixel-mixture decoder has two main limitations . The first is what we term as the slot-decoding dilemma . As there is no explicit incentive for the encoder to make a slot focus on the pixel area corresponding to an object , it is usually required to employ a weak decoder for gRGBθ such as the Spatial Broadcast Network ( Watters et al. , 2019 ) to make object concepts emerge in the slots . By limiting the capacity of the slot-decoder , it prevents a slot from modeling multiple objects or the entire image and instead incentivizes the slot to focus on a local area that shows a statistical regularity such as an object of a simple color . However , this comes with a side effect : the weak decoder can make the generated image blur the details . When we use a more expressive decoder such as a CNN to capture such details , the object disentanglement tends to fail with encoder producing slots that capture the whole image , hence a dilemma ( See Appendix D.1 ) . The second problem is the pixel independence . In pixel-mixture decoders , each slot ’ s contribution to a generated pixel , i.e. , πn , i and µn , i , is independent of the other slots and pixels . This may not be an issue if the aim of the slots is only to reconstruct the input image . However , it becomes an issue when we consider that an important desired property for object representations is to use them as concept modules i.e. , to be able to reuse them in an arbitrary configuration in the same way as word embeddings can be reused to compose an arbitrary sentence . The lack of flexibility of the decoder due to the pixel independence , however , prevents the slots from having such reconfigurability . For example , when decoding an arbitrary set of slots , the rendered image would look like a mere superposition of individual object patches without global semantic consistency , producing a Frankenstein-like image as the examples in Section 5 shall show . In contrast , this zero-shot global semantic consistency for concept reconfiguration is achieved in DALL·E by using the Image GPT decoder . 2.3 IMAGE GPT AND DALL·E . Image GPT ( Chen et al. , 2020a ) is an autoregressive generative model for images implemented using Transformer ( Vaswani et al. , 2017 ; Brown et al. , 2020 ) . For computational efficiency , Image GPT first down-scales the image of size H×W by a factor of K using a VQ-VAE encoder ( van den Oord et al. , 2017 ) . This turns an image x into a sequence of discrete image tokens { zi } where i indexes the tokens in a raster-scan order from 1 to HW/K2 . The transformer is then trained to model an auto-regressive distribution over this token sequence by maximizing the log-likelihood∑ i log pθ ( zi|z < i ) . During generation , the transformer samples the image tokens sequentially conditioning on the previously generated tokens , i.e. , ẑi ∼ pθ ( ẑi|ẑ < i ) where ẑi is the image token generated for the position i in the sequence . Lastly , a VQ-VAE decoder takes all the generated tokens and produces the final image x̂ . Crucially , due to the autoregressive generation of zi , unlike the pixel-mixture decoder , the generated pixels are not independent . The autoregressive generation powered by the direct memory access of the transformer makes Image GPT one of the most powerful decoder models in image generation and completion tasks . However , Image GPT does not provide a way to learn high-level semantic representations such as object-centric representations that can provide a way to semantically control image generation . DALL·E ( Ramesh et al. , 2021 ) shows that the image generation of Image GPT can be controlled by conditioning on a text prompt . In particular , it shows the impressive ability of zero-shot generation with global semantic consistency for rather an arbitrary reconfiguration of the words in the text prompt . DALL·E can be seen as a conditional Image GPT model , ẑi ∼ pθ ( ẑi|ẑ < i , c1 : N ) , where c1 : N are the text prompt tokens . The key limitation from the perspective of this work is that it requires supervision in terms of text-image pairs . This means that it does not need to learn the compositional structure by itself since the discrete concepts are inherently provided by the prompt text even though it learns the word embeddings provided the structure . Therefore , it is important to investigate if we can make a text-free DALL·E by learning to infer such compositional structure and representation only from images . 3 ILLITERATE DALL·E WITH SLOT-TO-SEQUENCE DECODER . In this section , we propose a method that can provide global semantic consistency in the zeroshot image generation setting without text by learning object slots from images . To do this , we shall lift the use of inductive biases in the slot decoder about object composition by making use of a transformer ( Vaswani et al. , 2017 ) as our image decoder while replacing the text prompt with a concept library constructed from image slots . Our central hypothesis is that a powerful autoregressive decoder such as Transformer after training with a sufficiently diverse set of raw images should learn the rules of composition without domain specifications . Obtaining Image Tokens using DVAE . To make the training of transformer computationally feasible for high-resolution images , we first downscale the input image x of size H ×W by a factor of K using Discrete VAE ( Im et al. , 2017 ) . To do this , we split the image into K ×K-sized patches resulting in T patches where T = HW/K2 . We provide each patch xi as input to an encoder network fφ to return log probabilities ( denoted as oi ) for a categorical distribution with V classes . With these log probabilities , we use a relaxed categorical distribution ( Jang et al. , 2016 ) with a temperature τ to sample a relaxed one-hot vector zsofti . We then decode these soft vectors to obtain patch reconstructions . This process is summarized as follows : oi = fφ ( xi ) =⇒ zsofti ∼ RelaxedCategorical ( oi ; τ ) =⇒ x̃i = gθ ( zsofti ) . By minimizing an MSE reconstruction objective for the image patches i.e . LDVAE = ∑T i=1 ( x̃i − xi ) 2 , we train the DVAE encoder fφ ( · ) and the decoder gθ ( · ) networks . Inferring Object Slots . To infer the object slots from a given image x , we first use the DVAE encoder as described above to obtain a discrete token zi for each patch i . Next , we map each token zi to an embedding by using a learned dictionary . To incorporate the position information into these patch embeddings , we sum them with learned positional embeddings . This results in an embedding ui which now has both the content and the position information for the patch . These embeddings u1 : T are then given as input to a Slot-Attention encoder ( Locatello et al. , 2020 ) with N slots . oi = fφ ( xi ) =⇒ zi ∼ Categorical ( oi ) =⇒ ui = Dictionaryφ ( zi ) + pφ , i =⇒ s1 : N , A1 : N = SlotAttentionφ ( u1 : T ) . This results in N object slots s1 : N and N attention maps A1 : N from the last refinement iteration of the Slot-Attention encoder . Reconstruction using Transformer . To reconstruct the input image , we decode the slots s1 : N and first reconstruct the DVAE tokens ẑ1 : T using a Transformer . We then use the DVAE decoder gθ to decode the DVAE tokens and reconstruct the image patches x̂i and therefore the image x̂ . ôi = Transformerθ ( û < i ; s1 : N ) =⇒ ẑi = arg max v∈ [ 1 , V ] ôi , v =⇒ x̂i = gθ ( ẑi ) . where ûi = Dictionaryφ ( ẑi ) + pφ , i and ôi , v is the log probability of token v among the V classes of the categorical distribution represented by ôi . To train the transformer , the slot attention encoder and the embeddings , we minimize the cross-entropy of predicting each token zi conditioned on the preceding tokens z < i and the slots s1 : N . Let the predicted log-probabilities for the token at position i be ōi = Transformerθ ( u < i ; s1 : N ) . Then the cross-entropy training objective can be written as LST = ∑T i=1 CrossEntropy ( zi , ōi ) . Learning Objective and Training . The complete training objective is given by L = LST + LDVAE and all modules of our model are trained jointly . We apply a decay on the DVAE temperature τ from 1.0 to 0.1 at the start of the training . We also apply a learning rate warm-up for the parameters of Slot-Attention and Transformer at the start of the training as we found that this led to stable training . Multi-headed Slot Attention . For representing images , we found that slots of standard Slot Attention encoder ( Locatello et al. , 2020 ) can suffer in expressiveness when representing objects with complex shapes and textures . This is because the slots collect information from the input cells via dot-product attention in which the attended input values are pooled using a simple weighted sum . As such , this pooling method can be too weak for representing complex objects . To address this , we propose an extension of Slot Attention called Multi-headed Slot Attention in which each slot attends to the input cells via multiple heads . Thus each slot can attend to different parts of the same object . When the slot state is computed , the attended values of different heads are concatenated which allows these partial object features to interact more flexibly and produce a significantly better object representation . Full details of the implementation and an ablation experiment to show the benefits of multiple heads are provided in Appendix A.3 .
This paper introduces Illiterate DALL·E, a zero-shot image generation model inspired by slot attention and DALLE without text. The main idea is to leverage object-centric representations into image generation. The method demonstrates the zero-shot generation of novel images without text and better quality in generation than the models based on mixture decoders.
SP:3cc6d4424ac05dd22c6f57619dce52271eba5697
Illiterate DALL$\cdot$E Learns to Compose
1 INTRODUCTION . Unsupervised learning of compositional representation is a core ability of human intelligence ( Yuille & Kersten , 2006 ; Frankland & Greene , 2020 ) . Observing a visual scene , we perceive it not simply as a monolithic entity but as a geometric composition of key components such as objects , borders , and space ( Kulkarni et al. , 2015 ; Yuille & Kersten , 2006 ; Epstein et al. , 2017 ; Behrens et al. , 2018 ) . Furthermore , this understanding of the structure of the scene composition enables the ability for zero-shot imagination , i.e. , composing a novel , counterfactual , or systematically manipulated scenes that are significantly different from the training distribution . As such , realizing this ability has been considered a core challenge in building a human-like AI system ( Lake et al. , 2017 ) . DALL·E ( Ramesh et al. , 2021 ) has recently shown an impressive ability to systematically generalize for zero-shot image generation . Trained with a dataset of text-image pairs , it can generate plausible images even from an unfamiliar text prompt such as “ avocado chair ” or “ lettuce hedgehog ” , a form of systematic generalization ( Lake & Baroni , 2018 ; Bahdanau et al. , 2018 ) in the text-to-image domain . However , from the perspective of compositionality , this success is somewhat expected because the text prompt already brings the composable structure . That is , the text is already discretized into a sequence of concept modules , i.e. , words , which are composable , reusable , and encapsulated . DALL·E then learns to produce an image with global consistency by smoothly stitching over the discrete concepts via an Image GPT ( Chen et al. , 2020 ) decoder . Building from the success of DALL·E , an important question is if we can achieve such systematic generalization for zero-shot image generation only from images without text . This would require realizing an ability lacking in DALL·E : extracting a set of composable representations from an image to play a similar role as that of word tokens . The most relevant direction towards this is object-centric representation learning ( Greff et al. , 2019 ; Locatello et al. , 2020 ; Lin et al. , 2020b ; Greff et al. , 2020b ) . While these can obtain a set of slots from an input image and reconstruct the same image from the slots , we argue that its systematic generalization ability to handle arbitrary reconfiguration of slots is significantly limited due to the way it decodes the slots . In this paper , we propose a model that can achieve composition-based systematic generalization for image generation like DALL·E but by learning compositional representations from images instead of providing a text prompt . We call this model , Illiterate-DALL·E . To do this , we first introduce the slot-decoding dilemma and the pixel independence problem observed in the pixel-mixture decoder of traditional object-centric representation models . Then , we hypothesize that achieving compositional systematic generalization in image generation requires not only compositional slots but also a powerful expressive decoder that can model complex interactions among the slots and other pixels . To this end , we propose the slot-to-sequence ( Slot2Seq ) decoder , which is an Image GPT decoder that takes the extracted slots as input instead of text . In experiments , we show that this simple architecture achieves the desired properties . The main contribution of the paper is to show for the first time that the compositional systematic generalization , shown in DALL·E , can be achieved without text . We also show that making a powerful and expressive decoder work with slot representations is crucial in achieving this . In this regard , we introduce a new architecture , Illiterate-DALL·E , and a new slot decoding framework , Slot2Seq . The paper also introduces a new dataset , CLEVR-Mirror , and other tasks useful to evaluate the systematic generalization ability in image generation . Lastly , the experiment results strongly support the benefits of our model , and suggest that future object-centric models may benefit from building on the advantages of the proposed framework alongside the pixel-mixture decoder . 2 PRELIMINARIES . 2.1 OBJECT-CENTRIC REPRESENTATION LEARNING WITH PIXEL-MIXTURE DECODER . A common framework for learning object-centric representations is via a form of auto-encoders ( Locatello et al. , 2020 ; Burgess et al. , 2019 ; Lin et al. , 2020b ) . An encoder takes an input image to return a set of object representation vectors or slot vectors { s1 , . . . , sN } = fφ ( x ) . A decoder then reconstructs the image by composing the decoded result of each slot x̂ = gθ ( s1 : N ) . To encourage the emergence of object concepts in the slots , the decoder usually uses an architecture implementing an inductive bias about the scene composition such as the pixel-mixture decoders . Pixel-mixture decoders are the most common approach to construct an image from slots . This method assumes that the final image is constructed by the pixel-wise weighted mean of the slot images . Specifically , each slot n generates its own slot image µn and its corresponding alpha-mask πn . Then , the slot images are weighted-summed with the alpha-mask weights as follows : x̂i = N∑ n=1 πn , i · µn , i where µn = gRGBθ ( sn ) and πn = exp gmaskθ ( sn ) ∑N m=1 exp g mask θ ( sm ) , where i ∈ [ 1 , HW ] is the pixel index with H and W the image height and width , respectively . 2.2 LIMITATIONS OF PIXEL-MIXTURE DECODERS . The pixel-mixture decoder has two main limitations . The first is what we term as the slot-decoding dilemma . As there is no explicit incentive for the encoder to make a slot focus on the pixel area corresponding to an object , it is usually required to employ a weak decoder for gRGBθ such as the Spatial Broadcast Network ( Watters et al. , 2019 ) to make object concepts emerge in the slots . By limiting the capacity of the slot-decoder , it prevents a slot from modeling multiple objects or the entire image and instead incentivizes the slot to focus on a local area that shows a statistical regularity such as an object of a simple color . However , this comes with a side effect : the weak decoder can make the generated image blur the details . When we use a more expressive decoder such as a CNN to capture such details , the object disentanglement tends to fail with encoder producing slots that capture the whole image , hence a dilemma ( See Appendix D.1 ) . The second problem is the pixel independence . In pixel-mixture decoders , each slot ’ s contribution to a generated pixel , i.e. , πn , i and µn , i , is independent of the other slots and pixels . This may not be an issue if the aim of the slots is only to reconstruct the input image . However , it becomes an issue when we consider that an important desired property for object representations is to use them as concept modules i.e. , to be able to reuse them in an arbitrary configuration in the same way as word embeddings can be reused to compose an arbitrary sentence . The lack of flexibility of the decoder due to the pixel independence , however , prevents the slots from having such reconfigurability . For example , when decoding an arbitrary set of slots , the rendered image would look like a mere superposition of individual object patches without global semantic consistency , producing a Frankenstein-like image as the examples in Section 5 shall show . In contrast , this zero-shot global semantic consistency for concept reconfiguration is achieved in DALL·E by using the Image GPT decoder . 2.3 IMAGE GPT AND DALL·E . Image GPT ( Chen et al. , 2020a ) is an autoregressive generative model for images implemented using Transformer ( Vaswani et al. , 2017 ; Brown et al. , 2020 ) . For computational efficiency , Image GPT first down-scales the image of size H×W by a factor of K using a VQ-VAE encoder ( van den Oord et al. , 2017 ) . This turns an image x into a sequence of discrete image tokens { zi } where i indexes the tokens in a raster-scan order from 1 to HW/K2 . The transformer is then trained to model an auto-regressive distribution over this token sequence by maximizing the log-likelihood∑ i log pθ ( zi|z < i ) . During generation , the transformer samples the image tokens sequentially conditioning on the previously generated tokens , i.e. , ẑi ∼ pθ ( ẑi|ẑ < i ) where ẑi is the image token generated for the position i in the sequence . Lastly , a VQ-VAE decoder takes all the generated tokens and produces the final image x̂ . Crucially , due to the autoregressive generation of zi , unlike the pixel-mixture decoder , the generated pixels are not independent . The autoregressive generation powered by the direct memory access of the transformer makes Image GPT one of the most powerful decoder models in image generation and completion tasks . However , Image GPT does not provide a way to learn high-level semantic representations such as object-centric representations that can provide a way to semantically control image generation . DALL·E ( Ramesh et al. , 2021 ) shows that the image generation of Image GPT can be controlled by conditioning on a text prompt . In particular , it shows the impressive ability of zero-shot generation with global semantic consistency for rather an arbitrary reconfiguration of the words in the text prompt . DALL·E can be seen as a conditional Image GPT model , ẑi ∼ pθ ( ẑi|ẑ < i , c1 : N ) , where c1 : N are the text prompt tokens . The key limitation from the perspective of this work is that it requires supervision in terms of text-image pairs . This means that it does not need to learn the compositional structure by itself since the discrete concepts are inherently provided by the prompt text even though it learns the word embeddings provided the structure . Therefore , it is important to investigate if we can make a text-free DALL·E by learning to infer such compositional structure and representation only from images . 3 ILLITERATE DALL·E WITH SLOT-TO-SEQUENCE DECODER . In this section , we propose a method that can provide global semantic consistency in the zeroshot image generation setting without text by learning object slots from images . To do this , we shall lift the use of inductive biases in the slot decoder about object composition by making use of a transformer ( Vaswani et al. , 2017 ) as our image decoder while replacing the text prompt with a concept library constructed from image slots . Our central hypothesis is that a powerful autoregressive decoder such as Transformer after training with a sufficiently diverse set of raw images should learn the rules of composition without domain specifications . Obtaining Image Tokens using DVAE . To make the training of transformer computationally feasible for high-resolution images , we first downscale the input image x of size H ×W by a factor of K using Discrete VAE ( Im et al. , 2017 ) . To do this , we split the image into K ×K-sized patches resulting in T patches where T = HW/K2 . We provide each patch xi as input to an encoder network fφ to return log probabilities ( denoted as oi ) for a categorical distribution with V classes . With these log probabilities , we use a relaxed categorical distribution ( Jang et al. , 2016 ) with a temperature τ to sample a relaxed one-hot vector zsofti . We then decode these soft vectors to obtain patch reconstructions . This process is summarized as follows : oi = fφ ( xi ) =⇒ zsofti ∼ RelaxedCategorical ( oi ; τ ) =⇒ x̃i = gθ ( zsofti ) . By minimizing an MSE reconstruction objective for the image patches i.e . LDVAE = ∑T i=1 ( x̃i − xi ) 2 , we train the DVAE encoder fφ ( · ) and the decoder gθ ( · ) networks . Inferring Object Slots . To infer the object slots from a given image x , we first use the DVAE encoder as described above to obtain a discrete token zi for each patch i . Next , we map each token zi to an embedding by using a learned dictionary . To incorporate the position information into these patch embeddings , we sum them with learned positional embeddings . This results in an embedding ui which now has both the content and the position information for the patch . These embeddings u1 : T are then given as input to a Slot-Attention encoder ( Locatello et al. , 2020 ) with N slots . oi = fφ ( xi ) =⇒ zi ∼ Categorical ( oi ) =⇒ ui = Dictionaryφ ( zi ) + pφ , i =⇒ s1 : N , A1 : N = SlotAttentionφ ( u1 : T ) . This results in N object slots s1 : N and N attention maps A1 : N from the last refinement iteration of the Slot-Attention encoder . Reconstruction using Transformer . To reconstruct the input image , we decode the slots s1 : N and first reconstruct the DVAE tokens ẑ1 : T using a Transformer . We then use the DVAE decoder gθ to decode the DVAE tokens and reconstruct the image patches x̂i and therefore the image x̂ . ôi = Transformerθ ( û < i ; s1 : N ) =⇒ ẑi = arg max v∈ [ 1 , V ] ôi , v =⇒ x̂i = gθ ( ẑi ) . where ûi = Dictionaryφ ( ẑi ) + pφ , i and ôi , v is the log probability of token v among the V classes of the categorical distribution represented by ôi . To train the transformer , the slot attention encoder and the embeddings , we minimize the cross-entropy of predicting each token zi conditioned on the preceding tokens z < i and the slots s1 : N . Let the predicted log-probabilities for the token at position i be ōi = Transformerθ ( u < i ; s1 : N ) . Then the cross-entropy training objective can be written as LST = ∑T i=1 CrossEntropy ( zi , ōi ) . Learning Objective and Training . The complete training objective is given by L = LST + LDVAE and all modules of our model are trained jointly . We apply a decay on the DVAE temperature τ from 1.0 to 0.1 at the start of the training . We also apply a learning rate warm-up for the parameters of Slot-Attention and Transformer at the start of the training as we found that this led to stable training . Multi-headed Slot Attention . For representing images , we found that slots of standard Slot Attention encoder ( Locatello et al. , 2020 ) can suffer in expressiveness when representing objects with complex shapes and textures . This is because the slots collect information from the input cells via dot-product attention in which the attended input values are pooled using a simple weighted sum . As such , this pooling method can be too weak for representing complex objects . To address this , we propose an extension of Slot Attention called Multi-headed Slot Attention in which each slot attends to the input cells via multiple heads . Thus each slot can attend to different parts of the same object . When the slot state is computed , the attended values of different heads are concatenated which allows these partial object features to interact more flexibly and produce a significantly better object representation . Full details of the implementation and an ablation experiment to show the benefits of multiple heads are provided in Appendix A.3 .
This paper proposes a model that uses visual prompts to generate images. Basically, visual prompts are interesting and inspiring. And compared with existing works, the proposed model shows better performance.
SP:3cc6d4424ac05dd22c6f57619dce52271eba5697
WaveCorr: Deep Reinforcement Learning with Permutation Invariant Policy Networks for Portfolio Management
1 INTRODUCTION . In recent years , there has been a growing interest in applying Deep Reinforcement Learning ( DRL ) to solve dynamic decision problems that are complex in nature . One representative class of problems is portfolio management , whose formulation typically requires a large amount of continuous state/action variables and a sophisticated form of risk function for capturing the intrinsic complexity of financial markets , trading environment , and investors ’ preferences . In this paper , we propose a new architecture of DRL for solving portfolio management problems that optimize a Sharpe ratio criteria . While there are several works in the literature that apply DRL for portfolio management problems such as Moody et al . ( 1998 ) ; He et al . ( 2016 ) ; Liang et al . ( 2018 ) among others , little has been done to investigate how to improve the design of a Neural Network ( NN ) in DRL so that it can capture more effectively the nature of dependency exhibited in financial data . In particular , it is known that extracting and exploiting cross-asset dependencies over time is crucial to the performance of portfolio management . The neural network architectures adopted in most existing works , such as Long-Short-Term-Memory ( LSTM ) or Convolutional Neutral Network ( CNN ) , however , only process input data on an asset-by-asset basis and thus lack a mechanism to capture cross-asset dependency information . The architecture presented in this paper , named as WaveCorr , offers a mechanism to extract the information of both time-series dependency and cross-asset dependency . It is built upon the WaveNet structure ( Oord et al. , 2016 ) , which uses dilated causal convolutions at its core , and a new design of correlation block that can process and extract cross-asset information . In particular , throughout our development , we identify and define a property that can be used to guide the design of a network architecture that takes multi-asset data as input . This property , referred to as asset permutation invariance , is motivated by the observation that the dependency across assets has a very different nature from the dependency across time . Namely , while the dependency across time is sensitive to the sequential relationship of data , the dependency across assets is not . To put it another way , given a multivariate time series data , the data would not be considered the same if the time indices are permuted , but the data should remain the same if the asset indices are permuted . While this property may appear more than reasonable , as discussed in section 3 , a naive extension of CNN that accounts for both time and asset dependencies can easily fail to satisfy this property . To the best of our knowledge , the only other works that have also considered extracting cross-asset dependency information in DRL for portfolio management are the recent works of Zhang et al . ( 2020 ) and Xu et al . ( 2020 ) . While Zhang et al. ’ s work is closer to ours in that it is also built upon the idea of adding a correlation layer to a CNN-like module , its overall architecture is different from ours and , most noticeably , their design does not follow the property of asset permutation invariance and thus its performance can vary significantly when the ordering of assets changes . As further shown in the numerical section , our architecture , which has a simpler yet permutation invariant structure , outperforms in many aspects Zhang et al. ’ s architecture . The work of Xu et al . ( 2020 ) takes a very different direction from ours , which follows a so-called attention mechanism and an encoder-decoder structure . A more detailed discussion is beyond the scope of this paper . Overall , the contribution of this paper is three fold . First , we introduce a new permutation invariance property for policy network architectures , referred to as asset permutation invariance in the case of a portfolio policy network , and derive general theory for verifying its applicability . Second , we design the first CNN based portfolio policy network , named WaveCorr , that accounts for asset dependencies in a way that preserves this type of invariance . This achievement relies on the design of an innovative permutation invariant correlation processing layer . Third , and most importantly , we present evidence that WaveCorr significantly outperforms state-of-the-art policy network architectures using data from both Canadian ( TSX ) and American ( S & P 500 ) stock markets . Specifically , our new architecture leads to an impressive 5 % -25 % absolute improvement in terms of average annual return , up to more than 200 % relative improvement in average Sharpe ratio , and reduces , during the period of 2019-2020 ( i.e . the Covid-19 pandemic ) , by 16 % the maximum daily portfolio loss compared to the best competing method . Using the same set of hyper-parameters , we also measured an improvement of up to a factor of 5 in the stability of performance under random choices of initial asset ordering and weights , and observe that WaveCorr consistently outperforms our benchmarks under a number of variations of the model : including the number of available assets , the size of transaction costs , etc . Overall , we interpret this empirical evidence as strong support regarding the potential impact of the WaveCorr architecture on automated portfolio management practices , and , more generally , regarding the claim that asset permutation invariance is an important NN property for this class of problems . The rest of the paper unfolds as follows . Section 2 presents the portfolio management problem and risk averse reinforcement learning formulation . Section 3 introduces the new property of “ asset permutation invariance ” for portfolio policy network and presents a new network architecture based on convolution networks that satisfies this property . Finally , Section 4 presents the findings from our numerical experiments . 2 PROBLEM STATEMENT . 2.1 PORTFOLIO MANAGEMENT PROBLEM . The portfolio management problem consists of optimizing the reallocation of wealth among many available financial assets including stocks , commodities , equities , currencies , etc . at discrete points in time . In this paper , we assume that there are m risky assets in the market , hence the portfolio is controlled based on a set of weights wt 2 W : = { w 2 Rm+ | Pm i=1 w i = 1 } , which describes the proportion of wealth invested in each asset . Portfolios are rebalanced at the beginning of each period t = 0 , 1 , ... , T 1 , which will incur proportional transaction costs for the investor , i.e . commission rates are of cs and cp , respectively . We follow Jiang et al . ( 2017 ) to model the evolution of the portfolio value and weights ( see Figure 1 ) . Specifically , during period t the portfolio value and weights start at pt 1 and wt 1 , and the changes in stock prices , captured by a random vector of asset returns ⇠t 2 Rm , affect the end of period portfolio value p0t : = pt 1⇠ > t wt 1 , and weight vector w0t : = ( pt 1/p0t ) ⇠t wt 1 , where is a term-wise product . The investor then decides on a new distribution of his wealth wt , which triggers the following transaction cost : cs mX i=1 ( p0tw 0i t ptw i t ) + + cp mX i=1 ( ptw i t p 0 tw 0i t ) + . Denoting the net effect of transaction costs on portfolio value with ⌫t : = pt/p0t , as reported in Li et al . ( 2018 ) one finds that ⌫t is the solution of the following equations : ⌫t = f ( ⌫t , w 0 t , wt ) : = 1 cs mX i=1 ( w0it ⌫tw i t ) + cp mX i=1 ( ⌫tw i t w 0i t ) + . This , in turn , allows us to express the portfolio ’ s log return during the t+ 1-th period as : ⇣t+1 : = ln ( p 0 t+1/p 0 t ) = ln ( ⌫tp 0 t+1/pt ) = ln ( ⌫t ( w 0 t , wt ) ) + ln ( ⇠ > t+1wt ) ( 1 ) where we make explicit the influence of w0t and wt on ⌫t . We note that in Jiang et al . ( 2017 ) , the authors suggest to approximate ⌫t using an iterative procedure . However , we actually show in Appendix A.1 that ⌫t can easily be identified with high precision using the bisection method . 2.2 RISK-AVERSE REINFORCEMENT LEARNING FORMULATION . In this section , we formulate the portfolio management problem as a Markov Decision Process ( MDP ) denoted by ( S , A , r , P ) . In this regard , the agent ( i.e . an investor ) interacts with a stochastic environment by taking an action at ⌘ wt 2 W after observing the state st 2 S composed of a window of historical market observations , which include the latest stock returns ⇠t , along with the final portfolio composition of the previous period w0t . This action results in the immediate stochastic reward that takes the shape of an approximation of the realized log return , i.e . rt ( st , at , st+1 ) : = ln ( f ( 1 , w0t , wt ) ) + ln ( ⇠ > t+1wt ) ⇡ ln ( ⌫ ( w 0 t , wt ) ) + ln ( ⇠ > t+1wt ) , for which a derivative is easily obtained . Finally , P captures the assumed Markovian transition dynamics of the stock market and its effect on portfolio weights : P ( st+1|s0 , a0 , s1 , a1 , ... , st , at ) = P ( st+1|st , at ) . Following the works of Moody et al . ( 1998 ) and Almahdi & Yang ( 2017 ) on risk averse DRL , our objective is to identify a deterministic trading policy µ✓ ( parameterized by ✓ ) that maximizes the expected value of the Sharpe ratio measured on T -periods log return trajectories generated by µ✓ . Namely : max ✓ JF ( µ✓ ) : = E s0⇠F st+1⇠P ( ·|st , µ✓ ( st ) ) [ SR ( r0 ( s0 , µ✓ ( s0 ) , s1 ) , ... , rT 1 ( sT 1 , µ✓ ( sT 1 ) , sT ) ) ] ( 2 ) where F is some fixed distribution and SR ( r0 : T 1 ) : = ( 1/T ) PT 1 t=0 rtq ( 1/ ( T 1 ) ) PT 1 t=0 ( rt ( 1/T ) PT 1 t=0 rt ) 2 . The choice of using the Sharpe ratio of log returns is motivated by modern portfolio theory ( see Markowitz ( 1952 ) ) , which advocates a balance between expected returns and exposure to risks , and where it plays the role of a canonical way of exercising this trade-off ( Sharpe , 1966 ) . While it is inapt of characterizing downside risk , it is still considered a “ gold standard of performance evaluation '' by the financial community ( Bailey & Lopez de Prado , 2012 ) . In Moody et al . ( 1998 ) , the trajectory-wise Sharpe ratio is used as an estimator of the instantaneous one in order to facilitate its use in RL . A side-benefit of this estimator is to offer some control on the variations in the evolution of the portfolio value which can be reassuring for the investor . In the context of our portfolio management problem , since st is composed of an exogeneous component sexot which includes ⇠t and an endogenous state w0t that becomes deterministic when at and sexot+1 are known , we have that : JF ( µ✓ ) : = E s0⇠F st+1⇠P ( ·|st , ( st ) ) ) [ SR ( r0 ( s̄ ✓ 0 , µ✓ ( s̄ ✓ 0 ) , s̄ ✓ 1 ) , . . . , rT 1 ( s̄ ✓ T 1 , µ✓ ( s̄ ✓ T 1 ) , s̄ ✓ T ) ) ] where ( st ) is an arbitrary policy , and where the effect of µ✓ on the trajectory can be calculated using s̄✓t : = ✓ sexot , ⇠t µ✓ ( s̄✓t 1 ) ⇠ > t µ✓ ( s̄ ✓ t 1 ) ◆ , for t 1 , while s̄✓0 : = s0 . Hence , r✓JF ( µ✓ ) : = E [ r✓SR ( r0 ( s̄✓0 , µ✓ ( s̄✓0 ) , s̄✓1 ) , . . . , rT 1 ( s̄✓T 1 , µ✓ ( s̄✓T 1 ) , s̄✓T ) ) ] , ( 3 ) where r✓SR can be obtained by backpropagation using the chain rule . This leads to the following stochastic gradient step : ✓k+1 = ✓k + ↵r✓SR ( r0 ( s̄ ✓ 0 , µ✓ ( s̄ ✓ 0 ) , s̄ ✓ 1 ) , . . . , rT 1 ( s̄ ✓ T 1 , µ✓ ( s̄ ✓ T 1 ) , s̄ ✓ T ) , with ↵ > 0 as the step size .
The paper presents a deep reinforcement learning model for portfolio optimization that harnesses both cross-asset dependencies as well as time dependencies. To achieve this goal, the paper presents a residue block that is consists of dilated convolution component for time dependency and Correlation component for cross-asset dependency. Experiments are carried out on three datasets using price data and compared to three existing methods to demonstrate the effectiveness of the proposed method.
SP:3376f575045d72a30357710e96c1d64bd855402c
WaveCorr: Deep Reinforcement Learning with Permutation Invariant Policy Networks for Portfolio Management
1 INTRODUCTION . In recent years , there has been a growing interest in applying Deep Reinforcement Learning ( DRL ) to solve dynamic decision problems that are complex in nature . One representative class of problems is portfolio management , whose formulation typically requires a large amount of continuous state/action variables and a sophisticated form of risk function for capturing the intrinsic complexity of financial markets , trading environment , and investors ’ preferences . In this paper , we propose a new architecture of DRL for solving portfolio management problems that optimize a Sharpe ratio criteria . While there are several works in the literature that apply DRL for portfolio management problems such as Moody et al . ( 1998 ) ; He et al . ( 2016 ) ; Liang et al . ( 2018 ) among others , little has been done to investigate how to improve the design of a Neural Network ( NN ) in DRL so that it can capture more effectively the nature of dependency exhibited in financial data . In particular , it is known that extracting and exploiting cross-asset dependencies over time is crucial to the performance of portfolio management . The neural network architectures adopted in most existing works , such as Long-Short-Term-Memory ( LSTM ) or Convolutional Neutral Network ( CNN ) , however , only process input data on an asset-by-asset basis and thus lack a mechanism to capture cross-asset dependency information . The architecture presented in this paper , named as WaveCorr , offers a mechanism to extract the information of both time-series dependency and cross-asset dependency . It is built upon the WaveNet structure ( Oord et al. , 2016 ) , which uses dilated causal convolutions at its core , and a new design of correlation block that can process and extract cross-asset information . In particular , throughout our development , we identify and define a property that can be used to guide the design of a network architecture that takes multi-asset data as input . This property , referred to as asset permutation invariance , is motivated by the observation that the dependency across assets has a very different nature from the dependency across time . Namely , while the dependency across time is sensitive to the sequential relationship of data , the dependency across assets is not . To put it another way , given a multivariate time series data , the data would not be considered the same if the time indices are permuted , but the data should remain the same if the asset indices are permuted . While this property may appear more than reasonable , as discussed in section 3 , a naive extension of CNN that accounts for both time and asset dependencies can easily fail to satisfy this property . To the best of our knowledge , the only other works that have also considered extracting cross-asset dependency information in DRL for portfolio management are the recent works of Zhang et al . ( 2020 ) and Xu et al . ( 2020 ) . While Zhang et al. ’ s work is closer to ours in that it is also built upon the idea of adding a correlation layer to a CNN-like module , its overall architecture is different from ours and , most noticeably , their design does not follow the property of asset permutation invariance and thus its performance can vary significantly when the ordering of assets changes . As further shown in the numerical section , our architecture , which has a simpler yet permutation invariant structure , outperforms in many aspects Zhang et al. ’ s architecture . The work of Xu et al . ( 2020 ) takes a very different direction from ours , which follows a so-called attention mechanism and an encoder-decoder structure . A more detailed discussion is beyond the scope of this paper . Overall , the contribution of this paper is three fold . First , we introduce a new permutation invariance property for policy network architectures , referred to as asset permutation invariance in the case of a portfolio policy network , and derive general theory for verifying its applicability . Second , we design the first CNN based portfolio policy network , named WaveCorr , that accounts for asset dependencies in a way that preserves this type of invariance . This achievement relies on the design of an innovative permutation invariant correlation processing layer . Third , and most importantly , we present evidence that WaveCorr significantly outperforms state-of-the-art policy network architectures using data from both Canadian ( TSX ) and American ( S & P 500 ) stock markets . Specifically , our new architecture leads to an impressive 5 % -25 % absolute improvement in terms of average annual return , up to more than 200 % relative improvement in average Sharpe ratio , and reduces , during the period of 2019-2020 ( i.e . the Covid-19 pandemic ) , by 16 % the maximum daily portfolio loss compared to the best competing method . Using the same set of hyper-parameters , we also measured an improvement of up to a factor of 5 in the stability of performance under random choices of initial asset ordering and weights , and observe that WaveCorr consistently outperforms our benchmarks under a number of variations of the model : including the number of available assets , the size of transaction costs , etc . Overall , we interpret this empirical evidence as strong support regarding the potential impact of the WaveCorr architecture on automated portfolio management practices , and , more generally , regarding the claim that asset permutation invariance is an important NN property for this class of problems . The rest of the paper unfolds as follows . Section 2 presents the portfolio management problem and risk averse reinforcement learning formulation . Section 3 introduces the new property of “ asset permutation invariance ” for portfolio policy network and presents a new network architecture based on convolution networks that satisfies this property . Finally , Section 4 presents the findings from our numerical experiments . 2 PROBLEM STATEMENT . 2.1 PORTFOLIO MANAGEMENT PROBLEM . The portfolio management problem consists of optimizing the reallocation of wealth among many available financial assets including stocks , commodities , equities , currencies , etc . at discrete points in time . In this paper , we assume that there are m risky assets in the market , hence the portfolio is controlled based on a set of weights wt 2 W : = { w 2 Rm+ | Pm i=1 w i = 1 } , which describes the proportion of wealth invested in each asset . Portfolios are rebalanced at the beginning of each period t = 0 , 1 , ... , T 1 , which will incur proportional transaction costs for the investor , i.e . commission rates are of cs and cp , respectively . We follow Jiang et al . ( 2017 ) to model the evolution of the portfolio value and weights ( see Figure 1 ) . Specifically , during period t the portfolio value and weights start at pt 1 and wt 1 , and the changes in stock prices , captured by a random vector of asset returns ⇠t 2 Rm , affect the end of period portfolio value p0t : = pt 1⇠ > t wt 1 , and weight vector w0t : = ( pt 1/p0t ) ⇠t wt 1 , where is a term-wise product . The investor then decides on a new distribution of his wealth wt , which triggers the following transaction cost : cs mX i=1 ( p0tw 0i t ptw i t ) + + cp mX i=1 ( ptw i t p 0 tw 0i t ) + . Denoting the net effect of transaction costs on portfolio value with ⌫t : = pt/p0t , as reported in Li et al . ( 2018 ) one finds that ⌫t is the solution of the following equations : ⌫t = f ( ⌫t , w 0 t , wt ) : = 1 cs mX i=1 ( w0it ⌫tw i t ) + cp mX i=1 ( ⌫tw i t w 0i t ) + . This , in turn , allows us to express the portfolio ’ s log return during the t+ 1-th period as : ⇣t+1 : = ln ( p 0 t+1/p 0 t ) = ln ( ⌫tp 0 t+1/pt ) = ln ( ⌫t ( w 0 t , wt ) ) + ln ( ⇠ > t+1wt ) ( 1 ) where we make explicit the influence of w0t and wt on ⌫t . We note that in Jiang et al . ( 2017 ) , the authors suggest to approximate ⌫t using an iterative procedure . However , we actually show in Appendix A.1 that ⌫t can easily be identified with high precision using the bisection method . 2.2 RISK-AVERSE REINFORCEMENT LEARNING FORMULATION . In this section , we formulate the portfolio management problem as a Markov Decision Process ( MDP ) denoted by ( S , A , r , P ) . In this regard , the agent ( i.e . an investor ) interacts with a stochastic environment by taking an action at ⌘ wt 2 W after observing the state st 2 S composed of a window of historical market observations , which include the latest stock returns ⇠t , along with the final portfolio composition of the previous period w0t . This action results in the immediate stochastic reward that takes the shape of an approximation of the realized log return , i.e . rt ( st , at , st+1 ) : = ln ( f ( 1 , w0t , wt ) ) + ln ( ⇠ > t+1wt ) ⇡ ln ( ⌫ ( w 0 t , wt ) ) + ln ( ⇠ > t+1wt ) , for which a derivative is easily obtained . Finally , P captures the assumed Markovian transition dynamics of the stock market and its effect on portfolio weights : P ( st+1|s0 , a0 , s1 , a1 , ... , st , at ) = P ( st+1|st , at ) . Following the works of Moody et al . ( 1998 ) and Almahdi & Yang ( 2017 ) on risk averse DRL , our objective is to identify a deterministic trading policy µ✓ ( parameterized by ✓ ) that maximizes the expected value of the Sharpe ratio measured on T -periods log return trajectories generated by µ✓ . Namely : max ✓ JF ( µ✓ ) : = E s0⇠F st+1⇠P ( ·|st , µ✓ ( st ) ) [ SR ( r0 ( s0 , µ✓ ( s0 ) , s1 ) , ... , rT 1 ( sT 1 , µ✓ ( sT 1 ) , sT ) ) ] ( 2 ) where F is some fixed distribution and SR ( r0 : T 1 ) : = ( 1/T ) PT 1 t=0 rtq ( 1/ ( T 1 ) ) PT 1 t=0 ( rt ( 1/T ) PT 1 t=0 rt ) 2 . The choice of using the Sharpe ratio of log returns is motivated by modern portfolio theory ( see Markowitz ( 1952 ) ) , which advocates a balance between expected returns and exposure to risks , and where it plays the role of a canonical way of exercising this trade-off ( Sharpe , 1966 ) . While it is inapt of characterizing downside risk , it is still considered a “ gold standard of performance evaluation '' by the financial community ( Bailey & Lopez de Prado , 2012 ) . In Moody et al . ( 1998 ) , the trajectory-wise Sharpe ratio is used as an estimator of the instantaneous one in order to facilitate its use in RL . A side-benefit of this estimator is to offer some control on the variations in the evolution of the portfolio value which can be reassuring for the investor . In the context of our portfolio management problem , since st is composed of an exogeneous component sexot which includes ⇠t and an endogenous state w0t that becomes deterministic when at and sexot+1 are known , we have that : JF ( µ✓ ) : = E s0⇠F st+1⇠P ( ·|st , ( st ) ) ) [ SR ( r0 ( s̄ ✓ 0 , µ✓ ( s̄ ✓ 0 ) , s̄ ✓ 1 ) , . . . , rT 1 ( s̄ ✓ T 1 , µ✓ ( s̄ ✓ T 1 ) , s̄ ✓ T ) ) ] where ( st ) is an arbitrary policy , and where the effect of µ✓ on the trajectory can be calculated using s̄✓t : = ✓ sexot , ⇠t µ✓ ( s̄✓t 1 ) ⇠ > t µ✓ ( s̄ ✓ t 1 ) ◆ , for t 1 , while s̄✓0 : = s0 . Hence , r✓JF ( µ✓ ) : = E [ r✓SR ( r0 ( s̄✓0 , µ✓ ( s̄✓0 ) , s̄✓1 ) , . . . , rT 1 ( s̄✓T 1 , µ✓ ( s̄✓T 1 ) , s̄✓T ) ) ] , ( 3 ) where r✓SR can be obtained by backpropagation using the chain rule . This leads to the following stochastic gradient step : ✓k+1 = ✓k + ↵r✓SR ( r0 ( s̄ ✓ 0 , µ✓ ( s̄ ✓ 0 ) , s̄ ✓ 1 ) , . . . , rT 1 ( s̄ ✓ T 1 , µ✓ ( s̄ ✓ T 1 ) , s̄ ✓ T ) , with ↵ > 0 as the step size .
This paper applies deep reinforcement learning to address the problem of portfolio management where decisions need to be made over time and many factors such as market conditions need to be considered. This paper proposed a portfolio policy network that has the permutation invariance (equivariance) property when treating multiple assets’ information. The proposed approach is evaluated on three sets of data from the Canadian and US stock markets. The results show that the proposed approach outperformed baselines in terms of different metrics such as annual return and Sharpe ratio.
SP:3376f575045d72a30357710e96c1d64bd855402c
WaveCorr: Deep Reinforcement Learning with Permutation Invariant Policy Networks for Portfolio Management
1 INTRODUCTION . In recent years , there has been a growing interest in applying Deep Reinforcement Learning ( DRL ) to solve dynamic decision problems that are complex in nature . One representative class of problems is portfolio management , whose formulation typically requires a large amount of continuous state/action variables and a sophisticated form of risk function for capturing the intrinsic complexity of financial markets , trading environment , and investors ’ preferences . In this paper , we propose a new architecture of DRL for solving portfolio management problems that optimize a Sharpe ratio criteria . While there are several works in the literature that apply DRL for portfolio management problems such as Moody et al . ( 1998 ) ; He et al . ( 2016 ) ; Liang et al . ( 2018 ) among others , little has been done to investigate how to improve the design of a Neural Network ( NN ) in DRL so that it can capture more effectively the nature of dependency exhibited in financial data . In particular , it is known that extracting and exploiting cross-asset dependencies over time is crucial to the performance of portfolio management . The neural network architectures adopted in most existing works , such as Long-Short-Term-Memory ( LSTM ) or Convolutional Neutral Network ( CNN ) , however , only process input data on an asset-by-asset basis and thus lack a mechanism to capture cross-asset dependency information . The architecture presented in this paper , named as WaveCorr , offers a mechanism to extract the information of both time-series dependency and cross-asset dependency . It is built upon the WaveNet structure ( Oord et al. , 2016 ) , which uses dilated causal convolutions at its core , and a new design of correlation block that can process and extract cross-asset information . In particular , throughout our development , we identify and define a property that can be used to guide the design of a network architecture that takes multi-asset data as input . This property , referred to as asset permutation invariance , is motivated by the observation that the dependency across assets has a very different nature from the dependency across time . Namely , while the dependency across time is sensitive to the sequential relationship of data , the dependency across assets is not . To put it another way , given a multivariate time series data , the data would not be considered the same if the time indices are permuted , but the data should remain the same if the asset indices are permuted . While this property may appear more than reasonable , as discussed in section 3 , a naive extension of CNN that accounts for both time and asset dependencies can easily fail to satisfy this property . To the best of our knowledge , the only other works that have also considered extracting cross-asset dependency information in DRL for portfolio management are the recent works of Zhang et al . ( 2020 ) and Xu et al . ( 2020 ) . While Zhang et al. ’ s work is closer to ours in that it is also built upon the idea of adding a correlation layer to a CNN-like module , its overall architecture is different from ours and , most noticeably , their design does not follow the property of asset permutation invariance and thus its performance can vary significantly when the ordering of assets changes . As further shown in the numerical section , our architecture , which has a simpler yet permutation invariant structure , outperforms in many aspects Zhang et al. ’ s architecture . The work of Xu et al . ( 2020 ) takes a very different direction from ours , which follows a so-called attention mechanism and an encoder-decoder structure . A more detailed discussion is beyond the scope of this paper . Overall , the contribution of this paper is three fold . First , we introduce a new permutation invariance property for policy network architectures , referred to as asset permutation invariance in the case of a portfolio policy network , and derive general theory for verifying its applicability . Second , we design the first CNN based portfolio policy network , named WaveCorr , that accounts for asset dependencies in a way that preserves this type of invariance . This achievement relies on the design of an innovative permutation invariant correlation processing layer . Third , and most importantly , we present evidence that WaveCorr significantly outperforms state-of-the-art policy network architectures using data from both Canadian ( TSX ) and American ( S & P 500 ) stock markets . Specifically , our new architecture leads to an impressive 5 % -25 % absolute improvement in terms of average annual return , up to more than 200 % relative improvement in average Sharpe ratio , and reduces , during the period of 2019-2020 ( i.e . the Covid-19 pandemic ) , by 16 % the maximum daily portfolio loss compared to the best competing method . Using the same set of hyper-parameters , we also measured an improvement of up to a factor of 5 in the stability of performance under random choices of initial asset ordering and weights , and observe that WaveCorr consistently outperforms our benchmarks under a number of variations of the model : including the number of available assets , the size of transaction costs , etc . Overall , we interpret this empirical evidence as strong support regarding the potential impact of the WaveCorr architecture on automated portfolio management practices , and , more generally , regarding the claim that asset permutation invariance is an important NN property for this class of problems . The rest of the paper unfolds as follows . Section 2 presents the portfolio management problem and risk averse reinforcement learning formulation . Section 3 introduces the new property of “ asset permutation invariance ” for portfolio policy network and presents a new network architecture based on convolution networks that satisfies this property . Finally , Section 4 presents the findings from our numerical experiments . 2 PROBLEM STATEMENT . 2.1 PORTFOLIO MANAGEMENT PROBLEM . The portfolio management problem consists of optimizing the reallocation of wealth among many available financial assets including stocks , commodities , equities , currencies , etc . at discrete points in time . In this paper , we assume that there are m risky assets in the market , hence the portfolio is controlled based on a set of weights wt 2 W : = { w 2 Rm+ | Pm i=1 w i = 1 } , which describes the proportion of wealth invested in each asset . Portfolios are rebalanced at the beginning of each period t = 0 , 1 , ... , T 1 , which will incur proportional transaction costs for the investor , i.e . commission rates are of cs and cp , respectively . We follow Jiang et al . ( 2017 ) to model the evolution of the portfolio value and weights ( see Figure 1 ) . Specifically , during period t the portfolio value and weights start at pt 1 and wt 1 , and the changes in stock prices , captured by a random vector of asset returns ⇠t 2 Rm , affect the end of period portfolio value p0t : = pt 1⇠ > t wt 1 , and weight vector w0t : = ( pt 1/p0t ) ⇠t wt 1 , where is a term-wise product . The investor then decides on a new distribution of his wealth wt , which triggers the following transaction cost : cs mX i=1 ( p0tw 0i t ptw i t ) + + cp mX i=1 ( ptw i t p 0 tw 0i t ) + . Denoting the net effect of transaction costs on portfolio value with ⌫t : = pt/p0t , as reported in Li et al . ( 2018 ) one finds that ⌫t is the solution of the following equations : ⌫t = f ( ⌫t , w 0 t , wt ) : = 1 cs mX i=1 ( w0it ⌫tw i t ) + cp mX i=1 ( ⌫tw i t w 0i t ) + . This , in turn , allows us to express the portfolio ’ s log return during the t+ 1-th period as : ⇣t+1 : = ln ( p 0 t+1/p 0 t ) = ln ( ⌫tp 0 t+1/pt ) = ln ( ⌫t ( w 0 t , wt ) ) + ln ( ⇠ > t+1wt ) ( 1 ) where we make explicit the influence of w0t and wt on ⌫t . We note that in Jiang et al . ( 2017 ) , the authors suggest to approximate ⌫t using an iterative procedure . However , we actually show in Appendix A.1 that ⌫t can easily be identified with high precision using the bisection method . 2.2 RISK-AVERSE REINFORCEMENT LEARNING FORMULATION . In this section , we formulate the portfolio management problem as a Markov Decision Process ( MDP ) denoted by ( S , A , r , P ) . In this regard , the agent ( i.e . an investor ) interacts with a stochastic environment by taking an action at ⌘ wt 2 W after observing the state st 2 S composed of a window of historical market observations , which include the latest stock returns ⇠t , along with the final portfolio composition of the previous period w0t . This action results in the immediate stochastic reward that takes the shape of an approximation of the realized log return , i.e . rt ( st , at , st+1 ) : = ln ( f ( 1 , w0t , wt ) ) + ln ( ⇠ > t+1wt ) ⇡ ln ( ⌫ ( w 0 t , wt ) ) + ln ( ⇠ > t+1wt ) , for which a derivative is easily obtained . Finally , P captures the assumed Markovian transition dynamics of the stock market and its effect on portfolio weights : P ( st+1|s0 , a0 , s1 , a1 , ... , st , at ) = P ( st+1|st , at ) . Following the works of Moody et al . ( 1998 ) and Almahdi & Yang ( 2017 ) on risk averse DRL , our objective is to identify a deterministic trading policy µ✓ ( parameterized by ✓ ) that maximizes the expected value of the Sharpe ratio measured on T -periods log return trajectories generated by µ✓ . Namely : max ✓ JF ( µ✓ ) : = E s0⇠F st+1⇠P ( ·|st , µ✓ ( st ) ) [ SR ( r0 ( s0 , µ✓ ( s0 ) , s1 ) , ... , rT 1 ( sT 1 , µ✓ ( sT 1 ) , sT ) ) ] ( 2 ) where F is some fixed distribution and SR ( r0 : T 1 ) : = ( 1/T ) PT 1 t=0 rtq ( 1/ ( T 1 ) ) PT 1 t=0 ( rt ( 1/T ) PT 1 t=0 rt ) 2 . The choice of using the Sharpe ratio of log returns is motivated by modern portfolio theory ( see Markowitz ( 1952 ) ) , which advocates a balance between expected returns and exposure to risks , and where it plays the role of a canonical way of exercising this trade-off ( Sharpe , 1966 ) . While it is inapt of characterizing downside risk , it is still considered a “ gold standard of performance evaluation '' by the financial community ( Bailey & Lopez de Prado , 2012 ) . In Moody et al . ( 1998 ) , the trajectory-wise Sharpe ratio is used as an estimator of the instantaneous one in order to facilitate its use in RL . A side-benefit of this estimator is to offer some control on the variations in the evolution of the portfolio value which can be reassuring for the investor . In the context of our portfolio management problem , since st is composed of an exogeneous component sexot which includes ⇠t and an endogenous state w0t that becomes deterministic when at and sexot+1 are known , we have that : JF ( µ✓ ) : = E s0⇠F st+1⇠P ( ·|st , ( st ) ) ) [ SR ( r0 ( s̄ ✓ 0 , µ✓ ( s̄ ✓ 0 ) , s̄ ✓ 1 ) , . . . , rT 1 ( s̄ ✓ T 1 , µ✓ ( s̄ ✓ T 1 ) , s̄ ✓ T ) ) ] where ( st ) is an arbitrary policy , and where the effect of µ✓ on the trajectory can be calculated using s̄✓t : = ✓ sexot , ⇠t µ✓ ( s̄✓t 1 ) ⇠ > t µ✓ ( s̄ ✓ t 1 ) ◆ , for t 1 , while s̄✓0 : = s0 . Hence , r✓JF ( µ✓ ) : = E [ r✓SR ( r0 ( s̄✓0 , µ✓ ( s̄✓0 ) , s̄✓1 ) , . . . , rT 1 ( s̄✓T 1 , µ✓ ( s̄✓T 1 ) , s̄✓T ) ) ] , ( 3 ) where r✓SR can be obtained by backpropagation using the chain rule . This leads to the following stochastic gradient step : ✓k+1 = ✓k + ↵r✓SR ( r0 ( s̄ ✓ 0 , µ✓ ( s̄ ✓ 0 ) , s̄ ✓ 1 ) , . . . , rT 1 ( s̄ ✓ T 1 , µ✓ ( s̄ ✓ T 1 ) , s̄ ✓ T ) , with ↵ > 0 as the step size .
The paper develops the first CNN based portfolio optimization network named **WaveCorr**, which is capable of capturing both temporal and cross-sectional correlation structure for the training data. The paper proposes a new type of the permutation invariant (PI) principle for a class of functions (e.g., neural network blocks), and it demonstrates that \texttt{WaveCorr} structure satisfies the PI principle. By conducting numerical studies using data from both Canadian (TSX) and American (S\&P 500) stock markets, the paper testifies the superior performance of **WaveCorr** in terms of Sharpe ratio and stability, compared with several benchmark models.
SP:3376f575045d72a30357710e96c1d64bd855402c