paper_name
stringlengths
11
170
text
stringlengths
8.07k
307k
summary
stringlengths
152
6.16k
paper_id
stringlengths
43
43
Demystifying How Self-Supervised Features Improve Training from Noisy Labels
1 INTRODUCTION . Deep Neural Networks ( DNNs ) have achieved remarkable performance in many areas including speech recognition ( Graves et al. , 2013 ) , computer vision ( Krizhevsky et al. , 2012 ; Lotter et al. , 2016 ) , natural language processing ( Zhang & LeCun , 2015 ) etc . The high-achieving performance often builds on the availability of quality-annotated datasets . In real world scenario , data annotation inevitably brings in label noise which degrades the performance of the network , primarily due to DNNs ’ capability in “ memorizing ” noisy labels ( Zhang et al. , 2016 ) . In the past few years , a number of methods have been proposed to tackle the problem of learning with label noise including robust loss design ( Ghosh et al. , 2017 ; Zhang & Sabuncu , 2018 ; Liu & Guo , 2020 ) , sample selection ( Han et al. , 2018 ; Yu et al. , 2019 ; Cheng et al. , 2021 ) and noise transition matrix estimation ( Patrini et al. , 2017 ; Zhu et al. , 2021b ) . Among all these methods , arguably the most efficient treatment is to adopt robust losses , since sample selection and noise transition matrix estimation always involve training multiple networks or need multi-stage training . Nonetheless , though the designed losses are theoretically proven robust , they often suffer from significant performance drop when noise rate is high ( Wang et al. , 2019 ; Ma et al. , 2020 ; Cheng et al. , 2021 ; Zhu et al. , 2021a ) , hinting that the ability of converging to the optimal classifier is also important . Very recent works ( Zheltonozhskii et al. , 2021 ; Nodet et al. , 2021 ; Ghosh & Lan , 2021 ; Yao et al. , 2021 ; Tan et al. , 2021 ) started applying self-supervised learning to solving the problem of learning from noisy labels . The experiments show that methods built on the self-supervised features can achieve exceptional performance even when the noise rate is high and largely outperform previously reported SOTA approaches . Despite the empirical observations , the reasons why self-supervised features lead to significant performance improvement are not well understood . In this paper , we provide theoretical insights to understand how self-supervised features improve classification with label noise and perform extensive experiments to support our theory . Our analysis provides a new understanding on learning with noisy labels from the perspective of self-supervised learning . We summarize our main contributions below : • We theoretically and experimentally show that by using self-supervised features to fine-tune the network on noisy datasets , Cross Entropy itself is robust to label noise ( Theorem 1–2 ) . The theory also answers the question of whether or not to fix the encoder when performing fine-tuning . • We theoretically and experimentally show that by using self-supervised features , a regularizer commonly used in knowledge distillation ( Hinton et al. , 2015 ) ( where the dataset does not contain label noise ) can greatly alleviate over-fitting problem of DNN on noisy datasets ( Theorem 3–4 ) . 1.1 RELATED WORKS . Learning with Noisy Labels : Due to the over-fitting problem of DNN , many works design robust loss to improve the robustness of neural networks . ( Ghosh et al. , 2017 ) proves MAE is inherently robust to label noise . However , MAE has a severe under-fitting problem . ( Zhang & Sabuncu , 2018 ) propose a loss which can combine both the advantage of MAE and CE , exhibiting good performance on noisy datasets . ( Liu & Guo , 2020 ) introduces peer loss , which is proven statistically robust to label noise without knowing noise rate . The extension of peer loss also shows good performance on instance-dependent label noise ( Cheng et al. , 2021 ; Zhu et al. , 2021a ) . Another efficient approach to combat label noise is by sample selection ( Jiang et al. , 2018 ; Han et al. , 2018 ; Yu et al. , 2019 ; Northcutt et al. , 2021 ; Yao et al. , 2020 ; Wei et al. , 2020 ; Zhang et al. , 2020 ) . These methods regard “ small loss ” examples as clean ones and always involve training multiple networks to select clean samples . Semi-supervised learning is also popular and effective on learning with noisy labels in recent years . Some works ( Li et al. , 2020 ; Nguyen et al. , 2020 ) first perform clustering on the sample loss and divide the samples into clean ones and noisy ones . Then drop the labels of the ” noisy samples ” and perform semi-supervised learning on all the samples . Self-Supervised Learning : The goal of self-supervised learning ( SSL ) is to learn good presentation without using the information of the labels . Generally , the methods of SSL can be divided into two categories : designing pretext tasks or designing loss functions . The designed tasks or losses do not involve any labels . Some popular tasks include patch orderings ( Doersch et al. , 2015 ; Noroozi & Favaro , 2016 ) , tracking ( Wang & Gupta , 2015 ) or clustering features ( Caron et al. , 2018 ; 2019 ) . However , the SSL performance of pretext tasks is limited . Recent SOTA methods for SSL is by designing contrastive loss functions . The representative works include Moco ( He et al. , 2020 ) and SimCLR ( Chen et al. , 2020 ) which train neural networks based on InfoNCE loss ( Oord et al. , 2018 ) . In our paper , we also adopt InfoNCE for performing self-supervised training to get SSL pre-trained features . The first part of our paper relates to the works that apply SSL features to perform finetuning on noisy dataset ( Nodet et al. , 2021 ; Ghosh & Lan , 2021 ) and our goal is to build theoretical understanding on this aspect . Knowledge Distillation : The second part of our paper is very related to the research field of knowledge distillation ( KD ) . The original idea of KD can be traced back to model compression ( Buciluǎ et al. , 2006 ) , where authors demonstrate the knowledge acquired by a large ensemble of models can be transferred to a single small model . ( Hinton et al. , 2015 ) generalize this idea to neural networks and show a small , shallow network can be improved through a teacher-student framework . Due to its great applicability , KD has gained more and more attention in recent years and numerous methods have been proposed to perform efficient distillation ( Mirzadeh et al. , 2020 ; Zhang et al. , 2018 ; 2019 ) . However , the dataset used in KD is assumed to be clean . Thus it is hard to connect KD with learning with noisy labels . In this paper , we theoretically and experimentally show that a regularizer generally used in KD ( Park et al. , 2019 ) can alleviate the over-fitting problem on noisy data by using SSL features which offers a new alternative for dealing with label noise . 2 PRELIMINARY . We introduce preliminaries and notations including definitions and problem formulation . Problem Formulation : Consider a classification problem on a set of N training examples denoted by D : = { ( xn , yn ) } n∈ [ N ] , where [ N ] : = { 1 , 2 , · · · , N } is the set of example indices . Examples ( xn , yn ) are drawn according to random variables ( X , Y ) from a joint distribution D. The classification task aims to identify a classifier C that maps X to Y accurately . Our theoretical analyses focus on binary classifications thus Y ∈ { 0 , 1 } . In real-world applications , the learner can only observe noisy labels . For instance , human annotators may wrongly label some images containing cats as ones that contain dogs accidentally or irresponsibly . The label noise of each instance is assumed to be class-dependent ( Liu & Tao , 2015 ) , i.e. , P ( Ỹ |Y ) = P ( Ỹ |X , Y ) . Thus the error rates are defined as e+ = P ( Ỹ = 0|Y = 1 ) , e− = P ( Ỹ = 1|Y = 0 ) . The corresponding noisy dataset and distribution are denoted by D̃ : = { ( xn , ỹn ) } n∈ [ N ] and D̃ . Define the expected risk of a classifier C as R ( C ) = ED [ 1 ( C ( X ) 6= Y ) ] . The goal is to learn a classifier C from the noisy distribution D̃ which also minimizes R ( C ) , i.e. , learn the Bayes optimal classifier such that CBayes ( x ) = arg maxi∈ { 0,1 } P ( Y = i|X = x ) . For better presentation , we define the following notations : X+ = X|Y = 1 , X− = X|Y = 0 , and Xclean = X|Y = Ỹ , Xnoisy = X|Y 6= Ỹ . Evaluation of SSL ( Self-Supervised Learning ) : SSL is usually evaluated by two steps : First , use SSL to train an encoder f with only unlabeled data X , then add a linear classifier g following the pre-trained encoder f and only fine-tune g on ( X , Y ) with a fixed f . The high-level intuition is that , if the encoder f is well learned by SSL , only fine-tuning linear classifier g is often sufficient to achieve good performance on test data . If the test performance is comparable to SL ( Supervised Learning ) , we call the gap between SSL and SL is small ( Chen et al. , 2020 ) . Denote by G the space of linear classifier g. Fine-tuning linear layer g on ( X , Y ) ∼ D can be represented as : min g∈G ED [ CE ( g ( f ( X ) ) , Y ) ] , where CE denotes the Cross-Entropy loss . Note the dimension of f ( X ) is determined by the network structure , e.g. , 512 for ResNet34 . In binary classifications , g ( f ( X ) ) ∈ [ 0 , 1 ] where g ( f ( X ) ) < 0.5 indicates predicting class-0 and g ( f ( X ) ) > 0.5 corresponds to class-1 . g ( f ( X ) ) is supposed to predict the same label as CBayes ( x ) . 3 ROBUSTNESS OF CROSS-ENTROPY WITH SSL FEATURES . We will analyze the robustness of Cross-Entropy with SSL features by comparing three different learning paths as illustrated in Figure 1 . Path-1 is the traditional learning path that learns both encoder f and linear classifier g at the same time . Path-2 is the strategy applied in ( Ghosh & Lan , 2021 ) that firstly pre-trains encoder f with SSL , then treats the pre-trained model as a network initialization and jointly fine-tunes f and g. Path-3 is an alternate SSL-based path that first learns the encoder f then only fine-tunes the linear classifier g with fixed f . 3.1 THEORETICAL TOOLS . We prepare some theoretical tools for our analyses . Our first theorem focuses on demonstrating the effectiveness of only fine-tuning linear classifier g as in Path-3 . We present Theorem 1 below . Theorem 1 Let g1 = arg ming∈G ED [ CE ( g ( f ( X ) ) , Y ) ] , g2 = arg ming∈G ED̃ [ CE ( g ( f ( X ) ) , Ỹ ) ] . Then if e+ = e− < 0.5 , we have : Round ( g1 ( f ( X ) ) ) = Round ( g2 ( f ( X ) ) ) ( 1 ) where f is fixed encoder and g is the linear classifier , g ( f ( · ) ) denotes the output whose value ranges from 0 to 1 . Round ( p ) is a predictor function that outputs 1 if p > 0.5 and outputs 0 otherwise . Theorem 1 shows with balanced error rates , simply fine-tuning a linear classifier g on the noisy data distribution D̃ can achieve the same decision boundary as the optimal linear classifier obtained from the corresponding clean distribution D . i.e. , g1 ( f ) and g2 ( f ) have the same predictions for all the samples . Theorem 1 can be generalized to the case with an arbitrary classifier beyond linear . However , admittedly with limited data , training complicated classifiers is hard to converge to the optimal decision boundary . We defer more details to the next subsection . We then evaluate the former part of Path-3 , i.e. , the performance of SSL . Recall in Section 2 , SSL is usually evaluated by performance gap between f ◦ gBayes and CBayes , where gBayes is the optimal linear classifier trained on D , f ◦ gBayes denotes the joint model given by gBayes ( f ( X ) ) . We consider a tractable case in Assumption 1 . Assumption 1 The encoder outputs f ( X+ ) and f ( X− ) follow Gaussian distribution with parameters ( µ1 , Σ ) and ( µ2 , Σ ) , where Σ = σ2 · I , I is the identity matrix . Assumption 1 states that the self-supervised features for each class follow simple Gaussian distributions . We check the effectiveness of this assumption by Figure 2 . It can be observed that the features of each class may have overlaps , but a good SSL method is supposed to return features with good separations ( small overlaps ) . In Assumption 1 , we use ||µ1 − µ2|| and σ to capture the overlapping area of two classes . If ||µ1 − µ2|| is large and σ is small , then there exists small overlapping . Based on this assumption , we show the performance of SSL in Theorem 2 . Theorem 2 If P ( Y = 1 ) = P ( Y = 0 ) , the risk ( error rate ) of Bayes optimal classifier f ◦ gBayes follows as : R ( f ◦ gBayes ) = 1− Φ ( ||µ1 − µ2|| 2 · σ ) ( 2 ) where Φ is the cumulative distribution function ( CDF ) of the standard Gaussian distribution . Wrap-up With Theorem 1 , we know CE is robust , the performance of which is subject to f . Theorem 2 implies that if SSL features learned by f exhibit good property , i.e. , when ||µ1 − µ2|| is large and σ is small , only fine-tuning g can approach the Bayes optimal classifier CBayes . Therefore , good SSL features induce high performance . In summary , Theorem 1 and Theorem 2 connect SSL features with robustness and generalization ability of CE loss , providing an insight on why SSL features improve classification with label noise .
This paper studies how self-supervised pre-training impacts the resistance of the neural network to noisy labels. The paper provides both theoretical analyses and numerical experiments of their study. The main contribution of the provided study is (i) given a quality encoder pre-trained from SSL, a simple linear layer trained by the cross-entropy loss is theoretically robust to symmetric label noise (ii) providing insights for how knowledge distilled from SSL features can alleviate the over-fitting problem.
SP:1a4a9d9e7677e56afd88997ab0da2d64303b499c
Demystifying How Self-Supervised Features Improve Training from Noisy Labels
1 INTRODUCTION . Deep Neural Networks ( DNNs ) have achieved remarkable performance in many areas including speech recognition ( Graves et al. , 2013 ) , computer vision ( Krizhevsky et al. , 2012 ; Lotter et al. , 2016 ) , natural language processing ( Zhang & LeCun , 2015 ) etc . The high-achieving performance often builds on the availability of quality-annotated datasets . In real world scenario , data annotation inevitably brings in label noise which degrades the performance of the network , primarily due to DNNs ’ capability in “ memorizing ” noisy labels ( Zhang et al. , 2016 ) . In the past few years , a number of methods have been proposed to tackle the problem of learning with label noise including robust loss design ( Ghosh et al. , 2017 ; Zhang & Sabuncu , 2018 ; Liu & Guo , 2020 ) , sample selection ( Han et al. , 2018 ; Yu et al. , 2019 ; Cheng et al. , 2021 ) and noise transition matrix estimation ( Patrini et al. , 2017 ; Zhu et al. , 2021b ) . Among all these methods , arguably the most efficient treatment is to adopt robust losses , since sample selection and noise transition matrix estimation always involve training multiple networks or need multi-stage training . Nonetheless , though the designed losses are theoretically proven robust , they often suffer from significant performance drop when noise rate is high ( Wang et al. , 2019 ; Ma et al. , 2020 ; Cheng et al. , 2021 ; Zhu et al. , 2021a ) , hinting that the ability of converging to the optimal classifier is also important . Very recent works ( Zheltonozhskii et al. , 2021 ; Nodet et al. , 2021 ; Ghosh & Lan , 2021 ; Yao et al. , 2021 ; Tan et al. , 2021 ) started applying self-supervised learning to solving the problem of learning from noisy labels . The experiments show that methods built on the self-supervised features can achieve exceptional performance even when the noise rate is high and largely outperform previously reported SOTA approaches . Despite the empirical observations , the reasons why self-supervised features lead to significant performance improvement are not well understood . In this paper , we provide theoretical insights to understand how self-supervised features improve classification with label noise and perform extensive experiments to support our theory . Our analysis provides a new understanding on learning with noisy labels from the perspective of self-supervised learning . We summarize our main contributions below : • We theoretically and experimentally show that by using self-supervised features to fine-tune the network on noisy datasets , Cross Entropy itself is robust to label noise ( Theorem 1–2 ) . The theory also answers the question of whether or not to fix the encoder when performing fine-tuning . • We theoretically and experimentally show that by using self-supervised features , a regularizer commonly used in knowledge distillation ( Hinton et al. , 2015 ) ( where the dataset does not contain label noise ) can greatly alleviate over-fitting problem of DNN on noisy datasets ( Theorem 3–4 ) . 1.1 RELATED WORKS . Learning with Noisy Labels : Due to the over-fitting problem of DNN , many works design robust loss to improve the robustness of neural networks . ( Ghosh et al. , 2017 ) proves MAE is inherently robust to label noise . However , MAE has a severe under-fitting problem . ( Zhang & Sabuncu , 2018 ) propose a loss which can combine both the advantage of MAE and CE , exhibiting good performance on noisy datasets . ( Liu & Guo , 2020 ) introduces peer loss , which is proven statistically robust to label noise without knowing noise rate . The extension of peer loss also shows good performance on instance-dependent label noise ( Cheng et al. , 2021 ; Zhu et al. , 2021a ) . Another efficient approach to combat label noise is by sample selection ( Jiang et al. , 2018 ; Han et al. , 2018 ; Yu et al. , 2019 ; Northcutt et al. , 2021 ; Yao et al. , 2020 ; Wei et al. , 2020 ; Zhang et al. , 2020 ) . These methods regard “ small loss ” examples as clean ones and always involve training multiple networks to select clean samples . Semi-supervised learning is also popular and effective on learning with noisy labels in recent years . Some works ( Li et al. , 2020 ; Nguyen et al. , 2020 ) first perform clustering on the sample loss and divide the samples into clean ones and noisy ones . Then drop the labels of the ” noisy samples ” and perform semi-supervised learning on all the samples . Self-Supervised Learning : The goal of self-supervised learning ( SSL ) is to learn good presentation without using the information of the labels . Generally , the methods of SSL can be divided into two categories : designing pretext tasks or designing loss functions . The designed tasks or losses do not involve any labels . Some popular tasks include patch orderings ( Doersch et al. , 2015 ; Noroozi & Favaro , 2016 ) , tracking ( Wang & Gupta , 2015 ) or clustering features ( Caron et al. , 2018 ; 2019 ) . However , the SSL performance of pretext tasks is limited . Recent SOTA methods for SSL is by designing contrastive loss functions . The representative works include Moco ( He et al. , 2020 ) and SimCLR ( Chen et al. , 2020 ) which train neural networks based on InfoNCE loss ( Oord et al. , 2018 ) . In our paper , we also adopt InfoNCE for performing self-supervised training to get SSL pre-trained features . The first part of our paper relates to the works that apply SSL features to perform finetuning on noisy dataset ( Nodet et al. , 2021 ; Ghosh & Lan , 2021 ) and our goal is to build theoretical understanding on this aspect . Knowledge Distillation : The second part of our paper is very related to the research field of knowledge distillation ( KD ) . The original idea of KD can be traced back to model compression ( Buciluǎ et al. , 2006 ) , where authors demonstrate the knowledge acquired by a large ensemble of models can be transferred to a single small model . ( Hinton et al. , 2015 ) generalize this idea to neural networks and show a small , shallow network can be improved through a teacher-student framework . Due to its great applicability , KD has gained more and more attention in recent years and numerous methods have been proposed to perform efficient distillation ( Mirzadeh et al. , 2020 ; Zhang et al. , 2018 ; 2019 ) . However , the dataset used in KD is assumed to be clean . Thus it is hard to connect KD with learning with noisy labels . In this paper , we theoretically and experimentally show that a regularizer generally used in KD ( Park et al. , 2019 ) can alleviate the over-fitting problem on noisy data by using SSL features which offers a new alternative for dealing with label noise . 2 PRELIMINARY . We introduce preliminaries and notations including definitions and problem formulation . Problem Formulation : Consider a classification problem on a set of N training examples denoted by D : = { ( xn , yn ) } n∈ [ N ] , where [ N ] : = { 1 , 2 , · · · , N } is the set of example indices . Examples ( xn , yn ) are drawn according to random variables ( X , Y ) from a joint distribution D. The classification task aims to identify a classifier C that maps X to Y accurately . Our theoretical analyses focus on binary classifications thus Y ∈ { 0 , 1 } . In real-world applications , the learner can only observe noisy labels . For instance , human annotators may wrongly label some images containing cats as ones that contain dogs accidentally or irresponsibly . The label noise of each instance is assumed to be class-dependent ( Liu & Tao , 2015 ) , i.e. , P ( Ỹ |Y ) = P ( Ỹ |X , Y ) . Thus the error rates are defined as e+ = P ( Ỹ = 0|Y = 1 ) , e− = P ( Ỹ = 1|Y = 0 ) . The corresponding noisy dataset and distribution are denoted by D̃ : = { ( xn , ỹn ) } n∈ [ N ] and D̃ . Define the expected risk of a classifier C as R ( C ) = ED [ 1 ( C ( X ) 6= Y ) ] . The goal is to learn a classifier C from the noisy distribution D̃ which also minimizes R ( C ) , i.e. , learn the Bayes optimal classifier such that CBayes ( x ) = arg maxi∈ { 0,1 } P ( Y = i|X = x ) . For better presentation , we define the following notations : X+ = X|Y = 1 , X− = X|Y = 0 , and Xclean = X|Y = Ỹ , Xnoisy = X|Y 6= Ỹ . Evaluation of SSL ( Self-Supervised Learning ) : SSL is usually evaluated by two steps : First , use SSL to train an encoder f with only unlabeled data X , then add a linear classifier g following the pre-trained encoder f and only fine-tune g on ( X , Y ) with a fixed f . The high-level intuition is that , if the encoder f is well learned by SSL , only fine-tuning linear classifier g is often sufficient to achieve good performance on test data . If the test performance is comparable to SL ( Supervised Learning ) , we call the gap between SSL and SL is small ( Chen et al. , 2020 ) . Denote by G the space of linear classifier g. Fine-tuning linear layer g on ( X , Y ) ∼ D can be represented as : min g∈G ED [ CE ( g ( f ( X ) ) , Y ) ] , where CE denotes the Cross-Entropy loss . Note the dimension of f ( X ) is determined by the network structure , e.g. , 512 for ResNet34 . In binary classifications , g ( f ( X ) ) ∈ [ 0 , 1 ] where g ( f ( X ) ) < 0.5 indicates predicting class-0 and g ( f ( X ) ) > 0.5 corresponds to class-1 . g ( f ( X ) ) is supposed to predict the same label as CBayes ( x ) . 3 ROBUSTNESS OF CROSS-ENTROPY WITH SSL FEATURES . We will analyze the robustness of Cross-Entropy with SSL features by comparing three different learning paths as illustrated in Figure 1 . Path-1 is the traditional learning path that learns both encoder f and linear classifier g at the same time . Path-2 is the strategy applied in ( Ghosh & Lan , 2021 ) that firstly pre-trains encoder f with SSL , then treats the pre-trained model as a network initialization and jointly fine-tunes f and g. Path-3 is an alternate SSL-based path that first learns the encoder f then only fine-tunes the linear classifier g with fixed f . 3.1 THEORETICAL TOOLS . We prepare some theoretical tools for our analyses . Our first theorem focuses on demonstrating the effectiveness of only fine-tuning linear classifier g as in Path-3 . We present Theorem 1 below . Theorem 1 Let g1 = arg ming∈G ED [ CE ( g ( f ( X ) ) , Y ) ] , g2 = arg ming∈G ED̃ [ CE ( g ( f ( X ) ) , Ỹ ) ] . Then if e+ = e− < 0.5 , we have : Round ( g1 ( f ( X ) ) ) = Round ( g2 ( f ( X ) ) ) ( 1 ) where f is fixed encoder and g is the linear classifier , g ( f ( · ) ) denotes the output whose value ranges from 0 to 1 . Round ( p ) is a predictor function that outputs 1 if p > 0.5 and outputs 0 otherwise . Theorem 1 shows with balanced error rates , simply fine-tuning a linear classifier g on the noisy data distribution D̃ can achieve the same decision boundary as the optimal linear classifier obtained from the corresponding clean distribution D . i.e. , g1 ( f ) and g2 ( f ) have the same predictions for all the samples . Theorem 1 can be generalized to the case with an arbitrary classifier beyond linear . However , admittedly with limited data , training complicated classifiers is hard to converge to the optimal decision boundary . We defer more details to the next subsection . We then evaluate the former part of Path-3 , i.e. , the performance of SSL . Recall in Section 2 , SSL is usually evaluated by performance gap between f ◦ gBayes and CBayes , where gBayes is the optimal linear classifier trained on D , f ◦ gBayes denotes the joint model given by gBayes ( f ( X ) ) . We consider a tractable case in Assumption 1 . Assumption 1 The encoder outputs f ( X+ ) and f ( X− ) follow Gaussian distribution with parameters ( µ1 , Σ ) and ( µ2 , Σ ) , where Σ = σ2 · I , I is the identity matrix . Assumption 1 states that the self-supervised features for each class follow simple Gaussian distributions . We check the effectiveness of this assumption by Figure 2 . It can be observed that the features of each class may have overlaps , but a good SSL method is supposed to return features with good separations ( small overlaps ) . In Assumption 1 , we use ||µ1 − µ2|| and σ to capture the overlapping area of two classes . If ||µ1 − µ2|| is large and σ is small , then there exists small overlapping . Based on this assumption , we show the performance of SSL in Theorem 2 . Theorem 2 If P ( Y = 1 ) = P ( Y = 0 ) , the risk ( error rate ) of Bayes optimal classifier f ◦ gBayes follows as : R ( f ◦ gBayes ) = 1− Φ ( ||µ1 − µ2|| 2 · σ ) ( 2 ) where Φ is the cumulative distribution function ( CDF ) of the standard Gaussian distribution . Wrap-up With Theorem 1 , we know CE is robust , the performance of which is subject to f . Theorem 2 implies that if SSL features learned by f exhibit good property , i.e. , when ||µ1 − µ2|| is large and σ is small , only fine-tuning g can approach the Bayes optimal classifier CBayes . Therefore , good SSL features induce high performance . In summary , Theorem 1 and Theorem 2 connect SSL features with robustness and generalization ability of CE loss , providing an insight on why SSL features improve classification with label noise .
The authors illustrate why self-supervised learning can help learning in training with noisy labels. The main contributions are: 1. The authors illustrate theoretically why learning good representation can help learning with noisy labels 2. The authors describe why fixed encoders are important. 3. The authors motivate a regularizer between the SL and SSL.
SP:1a4a9d9e7677e56afd88997ab0da2d64303b499c
Demystifying How Self-Supervised Features Improve Training from Noisy Labels
1 INTRODUCTION . Deep Neural Networks ( DNNs ) have achieved remarkable performance in many areas including speech recognition ( Graves et al. , 2013 ) , computer vision ( Krizhevsky et al. , 2012 ; Lotter et al. , 2016 ) , natural language processing ( Zhang & LeCun , 2015 ) etc . The high-achieving performance often builds on the availability of quality-annotated datasets . In real world scenario , data annotation inevitably brings in label noise which degrades the performance of the network , primarily due to DNNs ’ capability in “ memorizing ” noisy labels ( Zhang et al. , 2016 ) . In the past few years , a number of methods have been proposed to tackle the problem of learning with label noise including robust loss design ( Ghosh et al. , 2017 ; Zhang & Sabuncu , 2018 ; Liu & Guo , 2020 ) , sample selection ( Han et al. , 2018 ; Yu et al. , 2019 ; Cheng et al. , 2021 ) and noise transition matrix estimation ( Patrini et al. , 2017 ; Zhu et al. , 2021b ) . Among all these methods , arguably the most efficient treatment is to adopt robust losses , since sample selection and noise transition matrix estimation always involve training multiple networks or need multi-stage training . Nonetheless , though the designed losses are theoretically proven robust , they often suffer from significant performance drop when noise rate is high ( Wang et al. , 2019 ; Ma et al. , 2020 ; Cheng et al. , 2021 ; Zhu et al. , 2021a ) , hinting that the ability of converging to the optimal classifier is also important . Very recent works ( Zheltonozhskii et al. , 2021 ; Nodet et al. , 2021 ; Ghosh & Lan , 2021 ; Yao et al. , 2021 ; Tan et al. , 2021 ) started applying self-supervised learning to solving the problem of learning from noisy labels . The experiments show that methods built on the self-supervised features can achieve exceptional performance even when the noise rate is high and largely outperform previously reported SOTA approaches . Despite the empirical observations , the reasons why self-supervised features lead to significant performance improvement are not well understood . In this paper , we provide theoretical insights to understand how self-supervised features improve classification with label noise and perform extensive experiments to support our theory . Our analysis provides a new understanding on learning with noisy labels from the perspective of self-supervised learning . We summarize our main contributions below : • We theoretically and experimentally show that by using self-supervised features to fine-tune the network on noisy datasets , Cross Entropy itself is robust to label noise ( Theorem 1–2 ) . The theory also answers the question of whether or not to fix the encoder when performing fine-tuning . • We theoretically and experimentally show that by using self-supervised features , a regularizer commonly used in knowledge distillation ( Hinton et al. , 2015 ) ( where the dataset does not contain label noise ) can greatly alleviate over-fitting problem of DNN on noisy datasets ( Theorem 3–4 ) . 1.1 RELATED WORKS . Learning with Noisy Labels : Due to the over-fitting problem of DNN , many works design robust loss to improve the robustness of neural networks . ( Ghosh et al. , 2017 ) proves MAE is inherently robust to label noise . However , MAE has a severe under-fitting problem . ( Zhang & Sabuncu , 2018 ) propose a loss which can combine both the advantage of MAE and CE , exhibiting good performance on noisy datasets . ( Liu & Guo , 2020 ) introduces peer loss , which is proven statistically robust to label noise without knowing noise rate . The extension of peer loss also shows good performance on instance-dependent label noise ( Cheng et al. , 2021 ; Zhu et al. , 2021a ) . Another efficient approach to combat label noise is by sample selection ( Jiang et al. , 2018 ; Han et al. , 2018 ; Yu et al. , 2019 ; Northcutt et al. , 2021 ; Yao et al. , 2020 ; Wei et al. , 2020 ; Zhang et al. , 2020 ) . These methods regard “ small loss ” examples as clean ones and always involve training multiple networks to select clean samples . Semi-supervised learning is also popular and effective on learning with noisy labels in recent years . Some works ( Li et al. , 2020 ; Nguyen et al. , 2020 ) first perform clustering on the sample loss and divide the samples into clean ones and noisy ones . Then drop the labels of the ” noisy samples ” and perform semi-supervised learning on all the samples . Self-Supervised Learning : The goal of self-supervised learning ( SSL ) is to learn good presentation without using the information of the labels . Generally , the methods of SSL can be divided into two categories : designing pretext tasks or designing loss functions . The designed tasks or losses do not involve any labels . Some popular tasks include patch orderings ( Doersch et al. , 2015 ; Noroozi & Favaro , 2016 ) , tracking ( Wang & Gupta , 2015 ) or clustering features ( Caron et al. , 2018 ; 2019 ) . However , the SSL performance of pretext tasks is limited . Recent SOTA methods for SSL is by designing contrastive loss functions . The representative works include Moco ( He et al. , 2020 ) and SimCLR ( Chen et al. , 2020 ) which train neural networks based on InfoNCE loss ( Oord et al. , 2018 ) . In our paper , we also adopt InfoNCE for performing self-supervised training to get SSL pre-trained features . The first part of our paper relates to the works that apply SSL features to perform finetuning on noisy dataset ( Nodet et al. , 2021 ; Ghosh & Lan , 2021 ) and our goal is to build theoretical understanding on this aspect . Knowledge Distillation : The second part of our paper is very related to the research field of knowledge distillation ( KD ) . The original idea of KD can be traced back to model compression ( Buciluǎ et al. , 2006 ) , where authors demonstrate the knowledge acquired by a large ensemble of models can be transferred to a single small model . ( Hinton et al. , 2015 ) generalize this idea to neural networks and show a small , shallow network can be improved through a teacher-student framework . Due to its great applicability , KD has gained more and more attention in recent years and numerous methods have been proposed to perform efficient distillation ( Mirzadeh et al. , 2020 ; Zhang et al. , 2018 ; 2019 ) . However , the dataset used in KD is assumed to be clean . Thus it is hard to connect KD with learning with noisy labels . In this paper , we theoretically and experimentally show that a regularizer generally used in KD ( Park et al. , 2019 ) can alleviate the over-fitting problem on noisy data by using SSL features which offers a new alternative for dealing with label noise . 2 PRELIMINARY . We introduce preliminaries and notations including definitions and problem formulation . Problem Formulation : Consider a classification problem on a set of N training examples denoted by D : = { ( xn , yn ) } n∈ [ N ] , where [ N ] : = { 1 , 2 , · · · , N } is the set of example indices . Examples ( xn , yn ) are drawn according to random variables ( X , Y ) from a joint distribution D. The classification task aims to identify a classifier C that maps X to Y accurately . Our theoretical analyses focus on binary classifications thus Y ∈ { 0 , 1 } . In real-world applications , the learner can only observe noisy labels . For instance , human annotators may wrongly label some images containing cats as ones that contain dogs accidentally or irresponsibly . The label noise of each instance is assumed to be class-dependent ( Liu & Tao , 2015 ) , i.e. , P ( Ỹ |Y ) = P ( Ỹ |X , Y ) . Thus the error rates are defined as e+ = P ( Ỹ = 0|Y = 1 ) , e− = P ( Ỹ = 1|Y = 0 ) . The corresponding noisy dataset and distribution are denoted by D̃ : = { ( xn , ỹn ) } n∈ [ N ] and D̃ . Define the expected risk of a classifier C as R ( C ) = ED [ 1 ( C ( X ) 6= Y ) ] . The goal is to learn a classifier C from the noisy distribution D̃ which also minimizes R ( C ) , i.e. , learn the Bayes optimal classifier such that CBayes ( x ) = arg maxi∈ { 0,1 } P ( Y = i|X = x ) . For better presentation , we define the following notations : X+ = X|Y = 1 , X− = X|Y = 0 , and Xclean = X|Y = Ỹ , Xnoisy = X|Y 6= Ỹ . Evaluation of SSL ( Self-Supervised Learning ) : SSL is usually evaluated by two steps : First , use SSL to train an encoder f with only unlabeled data X , then add a linear classifier g following the pre-trained encoder f and only fine-tune g on ( X , Y ) with a fixed f . The high-level intuition is that , if the encoder f is well learned by SSL , only fine-tuning linear classifier g is often sufficient to achieve good performance on test data . If the test performance is comparable to SL ( Supervised Learning ) , we call the gap between SSL and SL is small ( Chen et al. , 2020 ) . Denote by G the space of linear classifier g. Fine-tuning linear layer g on ( X , Y ) ∼ D can be represented as : min g∈G ED [ CE ( g ( f ( X ) ) , Y ) ] , where CE denotes the Cross-Entropy loss . Note the dimension of f ( X ) is determined by the network structure , e.g. , 512 for ResNet34 . In binary classifications , g ( f ( X ) ) ∈ [ 0 , 1 ] where g ( f ( X ) ) < 0.5 indicates predicting class-0 and g ( f ( X ) ) > 0.5 corresponds to class-1 . g ( f ( X ) ) is supposed to predict the same label as CBayes ( x ) . 3 ROBUSTNESS OF CROSS-ENTROPY WITH SSL FEATURES . We will analyze the robustness of Cross-Entropy with SSL features by comparing three different learning paths as illustrated in Figure 1 . Path-1 is the traditional learning path that learns both encoder f and linear classifier g at the same time . Path-2 is the strategy applied in ( Ghosh & Lan , 2021 ) that firstly pre-trains encoder f with SSL , then treats the pre-trained model as a network initialization and jointly fine-tunes f and g. Path-3 is an alternate SSL-based path that first learns the encoder f then only fine-tunes the linear classifier g with fixed f . 3.1 THEORETICAL TOOLS . We prepare some theoretical tools for our analyses . Our first theorem focuses on demonstrating the effectiveness of only fine-tuning linear classifier g as in Path-3 . We present Theorem 1 below . Theorem 1 Let g1 = arg ming∈G ED [ CE ( g ( f ( X ) ) , Y ) ] , g2 = arg ming∈G ED̃ [ CE ( g ( f ( X ) ) , Ỹ ) ] . Then if e+ = e− < 0.5 , we have : Round ( g1 ( f ( X ) ) ) = Round ( g2 ( f ( X ) ) ) ( 1 ) where f is fixed encoder and g is the linear classifier , g ( f ( · ) ) denotes the output whose value ranges from 0 to 1 . Round ( p ) is a predictor function that outputs 1 if p > 0.5 and outputs 0 otherwise . Theorem 1 shows with balanced error rates , simply fine-tuning a linear classifier g on the noisy data distribution D̃ can achieve the same decision boundary as the optimal linear classifier obtained from the corresponding clean distribution D . i.e. , g1 ( f ) and g2 ( f ) have the same predictions for all the samples . Theorem 1 can be generalized to the case with an arbitrary classifier beyond linear . However , admittedly with limited data , training complicated classifiers is hard to converge to the optimal decision boundary . We defer more details to the next subsection . We then evaluate the former part of Path-3 , i.e. , the performance of SSL . Recall in Section 2 , SSL is usually evaluated by performance gap between f ◦ gBayes and CBayes , where gBayes is the optimal linear classifier trained on D , f ◦ gBayes denotes the joint model given by gBayes ( f ( X ) ) . We consider a tractable case in Assumption 1 . Assumption 1 The encoder outputs f ( X+ ) and f ( X− ) follow Gaussian distribution with parameters ( µ1 , Σ ) and ( µ2 , Σ ) , where Σ = σ2 · I , I is the identity matrix . Assumption 1 states that the self-supervised features for each class follow simple Gaussian distributions . We check the effectiveness of this assumption by Figure 2 . It can be observed that the features of each class may have overlaps , but a good SSL method is supposed to return features with good separations ( small overlaps ) . In Assumption 1 , we use ||µ1 − µ2|| and σ to capture the overlapping area of two classes . If ||µ1 − µ2|| is large and σ is small , then there exists small overlapping . Based on this assumption , we show the performance of SSL in Theorem 2 . Theorem 2 If P ( Y = 1 ) = P ( Y = 0 ) , the risk ( error rate ) of Bayes optimal classifier f ◦ gBayes follows as : R ( f ◦ gBayes ) = 1− Φ ( ||µ1 − µ2|| 2 · σ ) ( 2 ) where Φ is the cumulative distribution function ( CDF ) of the standard Gaussian distribution . Wrap-up With Theorem 1 , we know CE is robust , the performance of which is subject to f . Theorem 2 implies that if SSL features learned by f exhibit good property , i.e. , when ||µ1 − µ2|| is large and σ is small , only fine-tuning g can approach the Bayes optimal classifier CBayes . Therefore , good SSL features induce high performance . In summary , Theorem 1 and Theorem 2 connect SSL features with robustness and generalization ability of CE loss , providing an insight on why SSL features improve classification with label noise .
This paper studies the usefulness of self-supervised features when encountering data with noisy labels. It presents an array of ideas on this topic: including the question of fine-tuning pre-trained representations, using ideas from distillation as regularisation to improve generalisation. Some theoretical and empirical results are relating to the authors arguments.
SP:1a4a9d9e7677e56afd88997ab0da2d64303b499c
Spending Your Winning Lottery Better After Drawing It
Lottery Ticket Hypothesis ( LTH ) ( Frankle & Carbin , 2019 ) suggests that a dense neural network contains a sparse sub-network that can match the performance of the original dense network when trained in isolation from scratch . Most works retrain the sparse sub-network with the same training protocols as its dense network , such as initialization , architecture blocks , and training recipes . However , till now it is unclear that whether these training protocols are optimal for sparse networks . In this paper , we demonstrate that it is unnecessary for spare retraining to strictly inherit those properties from the dense network . Instead , by plugging in purposeful “ tweaks ” of the sparse subnetwork architecture or its training recipe , its retraining can be significantly improved than the default , especially at high sparsity levels . Combining all our proposed “ tweaks ” can yield the new stateof-the-art performance of LTH , and these modifications can be easily adapted to other sparse training algorithms in general . Specifically , we have achieved a significant and consistent performance gain of 1.05 % − 4.93 % for ResNet18 on CIFAR-100 over vanilla-LTH . Moreover , our methods are shown to generalize across datasets ( CIFAR-10 , CIFAR-100 , TinyImageNet ) and architectures ( Vgg16 , ResNet-18/ResNet-34 , MobileNet ) . All codes will be publicly available . 1 INTRODUCTION . Deep neural networks ( NN ) have achieved significant progress in many tasks such as classification , detection , and segmentation . However , most existing models are computationally extensive and overparameterized , thus it is difficult to deploy these models in real-world devices . To address this issue , many efforts have been devoted to compressing the heavy model into a lightweight counterpart . Among them , network pruning ( LeCun et al. , 1990 ; Han et al. , 2015a ; b ; Li et al. , 2016 ; Liu et al. , 2019 ) , which identifies sparse sub-networks from the dense networks by removing unnecessary weights , stands as one of the most effective methods . Previous methods ( Han et al. , 2015b ) usually prune the dense network after the standard training process to obtain the sparse sub-networks . The performance of the pruned network , however , decreases heavily as parts of the weights are removed , and retraining is thus required to recover the original performance ( Han et al. , 2015b ) . The recent Lottery Ticket Hypothesis ( LTH ) ( Frankle & Carbin , 2019 ) represents a major paradigm shift from conventional after-training pruning . LTH suggests that a dense NN contains sparse subnetworks , named “ winning tickets ” , which can match the performance of the original dense NN when trained in isolation from scratch . Such a winning ticket can be “ drawn ” by finding the sparse weight mask , from dense training accompanied with iterative magnitude pruning ( IMP ) . The found sparse mask is then applied to the original dense NN , and the masked sparse subnetwork is subsequently re-trained from scratch . Using a similar metaphor , We call the sparse re-training step as “ spending ” the lottery , after it is drawn . In most ( if not all ) LTH literature ( Frankle & Carbin , 2019 ; Frankle et al. , 2019 ; Renda et al. , 2020 ) , the re-training step takes care of the masked subnetwork , which is re-trained with the same initialization ( or rewinding ) and same training recipe as its dense network . In plain language , “ You spend the same lottery ticket in the same way you draw it ” . Recent evidence seems to support this convention by attributing LTH ’ s success in recovering the original pruned solution Evci et al . ( 2020a ) . However , till now it is still unclear that whether the architecture blocks , initialization 1 regimes , or training recipes are necessarily optimal for the sparse network . Our question of curiosity is hence : “ Can you spend the same lottery ticket in a different yet better way than how you draw it ” ? Contrary to the common beliefs , this paper demonstrates that it is unnecessary for sparse network retraining ( “ spending the lottery ” ) to stick to the protocol of dense network training or sparse mask finding ( “ drawing the lottery ” ) . Instead , having sparse re-training purposely misaligned in some way from dense training can make the found sparse subnetwork work even better . Specifically , we investigate two possible aspects of modified sparse re-training : • Architecture tweaking : after the sparse subnetwork is found , we modify the network architecture by : ( a ) injecting more residual skip-connections that are non-existent in dense networks ; and ( b ) changing the ReLU neurons into smoother activation functions such as Swish ( Ramachandran et al. , 2017 ) and Mish ( Misra , 2019 ) . • Training recipe tweaking : when training the ( found or modified ) sparse subnetwork architecture , we modify the training approach by : ( c ) changing the “ lottery ticket initialization ” by learned layer-wise scaling ; and ( d ) replacing the one-hot labels with either naive or knowledge-distilled soft labels . Each idea could be viewed as certain type of learned smoothening ( we will explain later ) , and is plug-and-play in the sparse re-training stage of any LTH algorithm . Those techniques can be applied either alone or altogether , and can significantly boost the sparse re-training performance in large models and at high sparsities . Note that all above “ tweaks ” only affect the sparse re-training stage ( we never alter the found sparse mask ) , but not the dense training/masking finding stage . In fact , our experiments will show that they boost sparse re-training much more than dense counterparts . Our contributions can be summarized as : • In contrast to the common wisdom that LTH sparse re-training needs to inherit ( masked ) network architecture , initialization , and training protocol from dense training , we for the first time demonstrate that purposely re-tweaking them will actually improve the sparse re-training step . That urges our rethinking of the LTH ’ s true value . • We investigate two groups of techniques to tweak the sparse subnetwork architecture and training recipe respectively . For the former , we inject new skip connections and replace new activation neurons . For the latter , we re-scale the initialization and soften the labels . Each of the techniques improves sparse re-training ( much more than they can help dense counterparts ) , and altogether they lead to further boosts . • Our extensive experimental results demonstrate that by plugging these techniques in LTH sparse retraining , we can significantly improve the performance of “ winning tickets ” at high sparsity levels and large models , setting the state-of-the-art performance bar of LTH . Furthermore , we show that they can benefit other sparse training algorithms in general , and provide visualizations to analyze their successes . 2 BACKGROUND WORK . 2.1 THE LOTTERY TICKET HYPOTHESIS . The LTH ( Frankle & Carbin , 2019 ) implies that initialization is the key for sparse network retraining . Beyond image classification ( Liu et al. , 2019 ; Savarese et al. , 2020 ; Wang et al. , 2020 ; You et al. , 2020 ; Ma et al. , 2021 ; Chen et al. , 2020a ) , LTH has also been widely explored in numerous contexts , such as natural language processing ( Gale et al. , 2019 ; Yu et al. , 2019 ; Prasanna et al. , 2020 ; Chen et al. , 2020b ; c ) , reinforcement learning ( Yu et al. , 2019 ) , self-supervised learning ( Chen et al. , 2020a ) , lifelong learning ( Chen et al. , 2021c ) , generative adversarial networks ( Chen et al. , 2021d ; Kalibhat et al. , 2020 ; Chen et al. , 2021a ) , and graph neural networks ( Chen et al. , 2021b ) . However , when retraining the sparse network , these works still strictly follow the same training recipe from dense networks . The most recent work ( Tessera et al. , 2021 ) reveals that focusing on initialization appears insufficient . Optimization strategies , regularization , and architecture choices also play significant roles in sparse network training . However , ( Tessera et al. , 2021 ) only compares sparse networks to their equivalent capacity dense networks , and most of their experiments are con- 2 ducted on multi-layer perceptron ( MLP ) . Thus , it is unclear whether their conclusion can generalize to the ticket finding from dense CNNs . 2.2 SMOOTHNESS . Introducing smoothness into NNs , including on the weights , logits , or training trajectory , is a common techniques to improve the generalization and optimization ( Jean & Wang , 1994 ) . For labels , smoothness is usually introduced by replacing the hard target with soft labels ( Szegedy et al. , 2016 ) or soft logits ( Hinton et al. , 2015a ) . This uncertainty of labels helps to alleviate the overconfidence ( Hein et al. , 2019 ) and improves the generalization . Smoothness can also implemented by replacing the activation functions ( Misra , 2019 ; Ramachandran et al. , 2017 ) , adding skip-connections in NNs ( He et al. , 2016 ) , or averaging along the trajectory of gradient descent ( Izmailov et al. , 2018 ) . These methods contribute to more stable gradient flows ( Tessera et al. , 2021 ) and smoother loss landscapes , but most of them have not been considered nor validated on sparse NNs . 3 METHODOLOGY The LTH ( Frankle & Carbin , 2019 ) suggests that the “ winning tickets ” can be found via the following three steps : ( 1 ) training a dense network from scratch ; ( 2 ) pruning unnecessary weights to form the mask of a sparse sub-network ; and ( 3 ) re-training the subnetwork from the same initialization used in the dense model . For the third step , the retraining of sparse network usually inherits all properties , such as architecture blocks and training recipes , from dense networks . However , our experiments validate that those are not necessarily optimal for training sparse networks . To verify , we investigate two aspects of “ tweaks ” dedicated to the sparse re-training step : model architecture , and training recipe . 3.1 MODEL ARCHITECTURE TWEAKING . Replacing Smoother Activations Most deep NNs apply the Rectified Linear Units ( ReLU ) ( Nair & Hinton , 2010 ) as the activation function . However , the gradient of ReLU changes suddenly around zero , and this non-smooth nature of ReLU is an obstacle to sparse retraining because it leads to high activation sparsity into the subnetwork , likely blocking the gradient flow ( Appendix A1.1 ) . To mitigate this issue and encourage healthier gradient flow , we replace the ReLU to Swish ( Ramachandran et al. , 2017 ) and Mish ( Misra , 2019 ) . Different from ReLU , Swish and Mish are both smooth non-monotonic activation functions . The non-monotonic property allows for the gradient of small negative inputs , which leads to a more stable gradient flow ( Tessera et al. , 2021 ) . Meanwhile , the loss landscape of Swish and Mish are 3 proved to have smoother transition ( Misra , 2019 ) , which makes the loss function easier to optimize and hence makes the sparse network generalize better . Injecting New Skip Connections High sparsity networks easily suffer from the layer-collapse ( Tanaka et al. , 2020 ) , i.e. , the premature pruning of an entire layer . This could make the sparse network untrainable , as the gradient can not be backpropagated through that layer . The skip connection ( or named ” residual-addition ” ) ( He et al. , 2016 ) was initially proposed to avoid gradient vanishing problem , and enables the training of a very deep model . It is later proven that skip connections can smooth the loss surfaces ( Li et al. , 2017b ) . That naturally motivates us to consider using more skip connections on the sparse networks to smoothen the landscape and preserve gradients , besides its possible mitigation effect when encountering collapsed layers . Inspired by ( Ding et al. , 2021 ) , we propose to “ artificially ” add new skip-connections during our sparse re-training . Figure 3 illustrates this architectural modifications to the traditional Resnet-18 block . Similar to existing residual connection in traditional ResNet-18 block , our newly introduced skip-connections add input of each ( 3 × 3 ) convolution block , to their output before the activation . The original motivation behind residual connections comes from their ability to allow gradient information to flow to earlier layers of the NN , thereby reducing the vanishing gradient problem during training ( He et al. , 2016 ) . With high activation sparsity present in sparse subnetworks , additional skip-connections can facilitate healthy gradient flow and improve their trainability . Furthermore , ( Li et al. , 2017b ) observed that with an increase in depth of networks , neural loss landscape becomes highly chaotic and leads to drop in generalization and trainability . They further observed that skip connections promote flatness and prevent transition to chaotic behaviour . Inspired by them , we added skip-connections to stabilize the initial chaotic training regime of sparse NN at high sparsity level and manage to prevent the transition to a sub-optimal behaviour .
The authors propose several "tweaks" to sparse re-training of lottery tickets that have been identified by iterative magnitude pruning (IMP). These tweaks include 1) the replacement of ReLU activation functions by smooth activation functions, 2) the use of soft-labels instead of one-hot labels, 3) learned layer-wise rescaling of the initial parameters to enable effective gradient steps initially, 4) the injection of new skip connections to avoid layer collapse. The tweaks are compared and combined with weight rewinding. Experiments on CIFAR10, CIRAR100, any TinyImageNet suggest a superior performance of the tweaks over vanilla IMP.
SP:0f65fcb656c7ea471f50c8d3f6851f8c2c2f5ed9
Spending Your Winning Lottery Better After Drawing It
Lottery Ticket Hypothesis ( LTH ) ( Frankle & Carbin , 2019 ) suggests that a dense neural network contains a sparse sub-network that can match the performance of the original dense network when trained in isolation from scratch . Most works retrain the sparse sub-network with the same training protocols as its dense network , such as initialization , architecture blocks , and training recipes . However , till now it is unclear that whether these training protocols are optimal for sparse networks . In this paper , we demonstrate that it is unnecessary for spare retraining to strictly inherit those properties from the dense network . Instead , by plugging in purposeful “ tweaks ” of the sparse subnetwork architecture or its training recipe , its retraining can be significantly improved than the default , especially at high sparsity levels . Combining all our proposed “ tweaks ” can yield the new stateof-the-art performance of LTH , and these modifications can be easily adapted to other sparse training algorithms in general . Specifically , we have achieved a significant and consistent performance gain of 1.05 % − 4.93 % for ResNet18 on CIFAR-100 over vanilla-LTH . Moreover , our methods are shown to generalize across datasets ( CIFAR-10 , CIFAR-100 , TinyImageNet ) and architectures ( Vgg16 , ResNet-18/ResNet-34 , MobileNet ) . All codes will be publicly available . 1 INTRODUCTION . Deep neural networks ( NN ) have achieved significant progress in many tasks such as classification , detection , and segmentation . However , most existing models are computationally extensive and overparameterized , thus it is difficult to deploy these models in real-world devices . To address this issue , many efforts have been devoted to compressing the heavy model into a lightweight counterpart . Among them , network pruning ( LeCun et al. , 1990 ; Han et al. , 2015a ; b ; Li et al. , 2016 ; Liu et al. , 2019 ) , which identifies sparse sub-networks from the dense networks by removing unnecessary weights , stands as one of the most effective methods . Previous methods ( Han et al. , 2015b ) usually prune the dense network after the standard training process to obtain the sparse sub-networks . The performance of the pruned network , however , decreases heavily as parts of the weights are removed , and retraining is thus required to recover the original performance ( Han et al. , 2015b ) . The recent Lottery Ticket Hypothesis ( LTH ) ( Frankle & Carbin , 2019 ) represents a major paradigm shift from conventional after-training pruning . LTH suggests that a dense NN contains sparse subnetworks , named “ winning tickets ” , which can match the performance of the original dense NN when trained in isolation from scratch . Such a winning ticket can be “ drawn ” by finding the sparse weight mask , from dense training accompanied with iterative magnitude pruning ( IMP ) . The found sparse mask is then applied to the original dense NN , and the masked sparse subnetwork is subsequently re-trained from scratch . Using a similar metaphor , We call the sparse re-training step as “ spending ” the lottery , after it is drawn . In most ( if not all ) LTH literature ( Frankle & Carbin , 2019 ; Frankle et al. , 2019 ; Renda et al. , 2020 ) , the re-training step takes care of the masked subnetwork , which is re-trained with the same initialization ( or rewinding ) and same training recipe as its dense network . In plain language , “ You spend the same lottery ticket in the same way you draw it ” . Recent evidence seems to support this convention by attributing LTH ’ s success in recovering the original pruned solution Evci et al . ( 2020a ) . However , till now it is still unclear that whether the architecture blocks , initialization 1 regimes , or training recipes are necessarily optimal for the sparse network . Our question of curiosity is hence : “ Can you spend the same lottery ticket in a different yet better way than how you draw it ” ? Contrary to the common beliefs , this paper demonstrates that it is unnecessary for sparse network retraining ( “ spending the lottery ” ) to stick to the protocol of dense network training or sparse mask finding ( “ drawing the lottery ” ) . Instead , having sparse re-training purposely misaligned in some way from dense training can make the found sparse subnetwork work even better . Specifically , we investigate two possible aspects of modified sparse re-training : • Architecture tweaking : after the sparse subnetwork is found , we modify the network architecture by : ( a ) injecting more residual skip-connections that are non-existent in dense networks ; and ( b ) changing the ReLU neurons into smoother activation functions such as Swish ( Ramachandran et al. , 2017 ) and Mish ( Misra , 2019 ) . • Training recipe tweaking : when training the ( found or modified ) sparse subnetwork architecture , we modify the training approach by : ( c ) changing the “ lottery ticket initialization ” by learned layer-wise scaling ; and ( d ) replacing the one-hot labels with either naive or knowledge-distilled soft labels . Each idea could be viewed as certain type of learned smoothening ( we will explain later ) , and is plug-and-play in the sparse re-training stage of any LTH algorithm . Those techniques can be applied either alone or altogether , and can significantly boost the sparse re-training performance in large models and at high sparsities . Note that all above “ tweaks ” only affect the sparse re-training stage ( we never alter the found sparse mask ) , but not the dense training/masking finding stage . In fact , our experiments will show that they boost sparse re-training much more than dense counterparts . Our contributions can be summarized as : • In contrast to the common wisdom that LTH sparse re-training needs to inherit ( masked ) network architecture , initialization , and training protocol from dense training , we for the first time demonstrate that purposely re-tweaking them will actually improve the sparse re-training step . That urges our rethinking of the LTH ’ s true value . • We investigate two groups of techniques to tweak the sparse subnetwork architecture and training recipe respectively . For the former , we inject new skip connections and replace new activation neurons . For the latter , we re-scale the initialization and soften the labels . Each of the techniques improves sparse re-training ( much more than they can help dense counterparts ) , and altogether they lead to further boosts . • Our extensive experimental results demonstrate that by plugging these techniques in LTH sparse retraining , we can significantly improve the performance of “ winning tickets ” at high sparsity levels and large models , setting the state-of-the-art performance bar of LTH . Furthermore , we show that they can benefit other sparse training algorithms in general , and provide visualizations to analyze their successes . 2 BACKGROUND WORK . 2.1 THE LOTTERY TICKET HYPOTHESIS . The LTH ( Frankle & Carbin , 2019 ) implies that initialization is the key for sparse network retraining . Beyond image classification ( Liu et al. , 2019 ; Savarese et al. , 2020 ; Wang et al. , 2020 ; You et al. , 2020 ; Ma et al. , 2021 ; Chen et al. , 2020a ) , LTH has also been widely explored in numerous contexts , such as natural language processing ( Gale et al. , 2019 ; Yu et al. , 2019 ; Prasanna et al. , 2020 ; Chen et al. , 2020b ; c ) , reinforcement learning ( Yu et al. , 2019 ) , self-supervised learning ( Chen et al. , 2020a ) , lifelong learning ( Chen et al. , 2021c ) , generative adversarial networks ( Chen et al. , 2021d ; Kalibhat et al. , 2020 ; Chen et al. , 2021a ) , and graph neural networks ( Chen et al. , 2021b ) . However , when retraining the sparse network , these works still strictly follow the same training recipe from dense networks . The most recent work ( Tessera et al. , 2021 ) reveals that focusing on initialization appears insufficient . Optimization strategies , regularization , and architecture choices also play significant roles in sparse network training . However , ( Tessera et al. , 2021 ) only compares sparse networks to their equivalent capacity dense networks , and most of their experiments are con- 2 ducted on multi-layer perceptron ( MLP ) . Thus , it is unclear whether their conclusion can generalize to the ticket finding from dense CNNs . 2.2 SMOOTHNESS . Introducing smoothness into NNs , including on the weights , logits , or training trajectory , is a common techniques to improve the generalization and optimization ( Jean & Wang , 1994 ) . For labels , smoothness is usually introduced by replacing the hard target with soft labels ( Szegedy et al. , 2016 ) or soft logits ( Hinton et al. , 2015a ) . This uncertainty of labels helps to alleviate the overconfidence ( Hein et al. , 2019 ) and improves the generalization . Smoothness can also implemented by replacing the activation functions ( Misra , 2019 ; Ramachandran et al. , 2017 ) , adding skip-connections in NNs ( He et al. , 2016 ) , or averaging along the trajectory of gradient descent ( Izmailov et al. , 2018 ) . These methods contribute to more stable gradient flows ( Tessera et al. , 2021 ) and smoother loss landscapes , but most of them have not been considered nor validated on sparse NNs . 3 METHODOLOGY The LTH ( Frankle & Carbin , 2019 ) suggests that the “ winning tickets ” can be found via the following three steps : ( 1 ) training a dense network from scratch ; ( 2 ) pruning unnecessary weights to form the mask of a sparse sub-network ; and ( 3 ) re-training the subnetwork from the same initialization used in the dense model . For the third step , the retraining of sparse network usually inherits all properties , such as architecture blocks and training recipes , from dense networks . However , our experiments validate that those are not necessarily optimal for training sparse networks . To verify , we investigate two aspects of “ tweaks ” dedicated to the sparse re-training step : model architecture , and training recipe . 3.1 MODEL ARCHITECTURE TWEAKING . Replacing Smoother Activations Most deep NNs apply the Rectified Linear Units ( ReLU ) ( Nair & Hinton , 2010 ) as the activation function . However , the gradient of ReLU changes suddenly around zero , and this non-smooth nature of ReLU is an obstacle to sparse retraining because it leads to high activation sparsity into the subnetwork , likely blocking the gradient flow ( Appendix A1.1 ) . To mitigate this issue and encourage healthier gradient flow , we replace the ReLU to Swish ( Ramachandran et al. , 2017 ) and Mish ( Misra , 2019 ) . Different from ReLU , Swish and Mish are both smooth non-monotonic activation functions . The non-monotonic property allows for the gradient of small negative inputs , which leads to a more stable gradient flow ( Tessera et al. , 2021 ) . Meanwhile , the loss landscape of Swish and Mish are 3 proved to have smoother transition ( Misra , 2019 ) , which makes the loss function easier to optimize and hence makes the sparse network generalize better . Injecting New Skip Connections High sparsity networks easily suffer from the layer-collapse ( Tanaka et al. , 2020 ) , i.e. , the premature pruning of an entire layer . This could make the sparse network untrainable , as the gradient can not be backpropagated through that layer . The skip connection ( or named ” residual-addition ” ) ( He et al. , 2016 ) was initially proposed to avoid gradient vanishing problem , and enables the training of a very deep model . It is later proven that skip connections can smooth the loss surfaces ( Li et al. , 2017b ) . That naturally motivates us to consider using more skip connections on the sparse networks to smoothen the landscape and preserve gradients , besides its possible mitigation effect when encountering collapsed layers . Inspired by ( Ding et al. , 2021 ) , we propose to “ artificially ” add new skip-connections during our sparse re-training . Figure 3 illustrates this architectural modifications to the traditional Resnet-18 block . Similar to existing residual connection in traditional ResNet-18 block , our newly introduced skip-connections add input of each ( 3 × 3 ) convolution block , to their output before the activation . The original motivation behind residual connections comes from their ability to allow gradient information to flow to earlier layers of the NN , thereby reducing the vanishing gradient problem during training ( He et al. , 2016 ) . With high activation sparsity present in sparse subnetworks , additional skip-connections can facilitate healthy gradient flow and improve their trainability . Furthermore , ( Li et al. , 2017b ) observed that with an increase in depth of networks , neural loss landscape becomes highly chaotic and leads to drop in generalization and trainability . They further observed that skip connections promote flatness and prevent transition to chaotic behaviour . Inspired by them , we added skip-connections to stabilize the initial chaotic training regime of sparse NN at high sparsity level and manage to prevent the transition to a sub-optimal behaviour .
The authors propose that the training and structure of models found by lottery tickets rewinding (LTR)/lottery tickets (LT) should be modified from that of the dense model, unlike what was typically done in at least the original LT paper, and propose a set of training and architectural changes to improve retraining of these sparse models. The architectural changes consist of adding extra skip connections around each convolutional layer within the ResNet blocks, and changing the ReLU activation function to Swish/Mish. The training changes consist of scaling the LT initialization according to the sparsity of the layer and replacing the one-hot classification labels with naive or knowledge-distilled soft labels. The authors demonstrate improved generalization for the combination of all of these changes as compared to dense training and standard LTH retraining baselines with VGG16, ResNet-18/34 and MobileNet on CIFAR-10/CIFAR-100 and dense/standard LTH with (unclear what model) on Tiny-ImageNet. The authors claim significant generalization improvement for very sparse networks, e.g. +4.93% at 97% sparsity for ResNet-18/CIFAR-100.
SP:0f65fcb656c7ea471f50c8d3f6851f8c2c2f5ed9
Spending Your Winning Lottery Better After Drawing It
Lottery Ticket Hypothesis ( LTH ) ( Frankle & Carbin , 2019 ) suggests that a dense neural network contains a sparse sub-network that can match the performance of the original dense network when trained in isolation from scratch . Most works retrain the sparse sub-network with the same training protocols as its dense network , such as initialization , architecture blocks , and training recipes . However , till now it is unclear that whether these training protocols are optimal for sparse networks . In this paper , we demonstrate that it is unnecessary for spare retraining to strictly inherit those properties from the dense network . Instead , by plugging in purposeful “ tweaks ” of the sparse subnetwork architecture or its training recipe , its retraining can be significantly improved than the default , especially at high sparsity levels . Combining all our proposed “ tweaks ” can yield the new stateof-the-art performance of LTH , and these modifications can be easily adapted to other sparse training algorithms in general . Specifically , we have achieved a significant and consistent performance gain of 1.05 % − 4.93 % for ResNet18 on CIFAR-100 over vanilla-LTH . Moreover , our methods are shown to generalize across datasets ( CIFAR-10 , CIFAR-100 , TinyImageNet ) and architectures ( Vgg16 , ResNet-18/ResNet-34 , MobileNet ) . All codes will be publicly available . 1 INTRODUCTION . Deep neural networks ( NN ) have achieved significant progress in many tasks such as classification , detection , and segmentation . However , most existing models are computationally extensive and overparameterized , thus it is difficult to deploy these models in real-world devices . To address this issue , many efforts have been devoted to compressing the heavy model into a lightweight counterpart . Among them , network pruning ( LeCun et al. , 1990 ; Han et al. , 2015a ; b ; Li et al. , 2016 ; Liu et al. , 2019 ) , which identifies sparse sub-networks from the dense networks by removing unnecessary weights , stands as one of the most effective methods . Previous methods ( Han et al. , 2015b ) usually prune the dense network after the standard training process to obtain the sparse sub-networks . The performance of the pruned network , however , decreases heavily as parts of the weights are removed , and retraining is thus required to recover the original performance ( Han et al. , 2015b ) . The recent Lottery Ticket Hypothesis ( LTH ) ( Frankle & Carbin , 2019 ) represents a major paradigm shift from conventional after-training pruning . LTH suggests that a dense NN contains sparse subnetworks , named “ winning tickets ” , which can match the performance of the original dense NN when trained in isolation from scratch . Such a winning ticket can be “ drawn ” by finding the sparse weight mask , from dense training accompanied with iterative magnitude pruning ( IMP ) . The found sparse mask is then applied to the original dense NN , and the masked sparse subnetwork is subsequently re-trained from scratch . Using a similar metaphor , We call the sparse re-training step as “ spending ” the lottery , after it is drawn . In most ( if not all ) LTH literature ( Frankle & Carbin , 2019 ; Frankle et al. , 2019 ; Renda et al. , 2020 ) , the re-training step takes care of the masked subnetwork , which is re-trained with the same initialization ( or rewinding ) and same training recipe as its dense network . In plain language , “ You spend the same lottery ticket in the same way you draw it ” . Recent evidence seems to support this convention by attributing LTH ’ s success in recovering the original pruned solution Evci et al . ( 2020a ) . However , till now it is still unclear that whether the architecture blocks , initialization 1 regimes , or training recipes are necessarily optimal for the sparse network . Our question of curiosity is hence : “ Can you spend the same lottery ticket in a different yet better way than how you draw it ” ? Contrary to the common beliefs , this paper demonstrates that it is unnecessary for sparse network retraining ( “ spending the lottery ” ) to stick to the protocol of dense network training or sparse mask finding ( “ drawing the lottery ” ) . Instead , having sparse re-training purposely misaligned in some way from dense training can make the found sparse subnetwork work even better . Specifically , we investigate two possible aspects of modified sparse re-training : • Architecture tweaking : after the sparse subnetwork is found , we modify the network architecture by : ( a ) injecting more residual skip-connections that are non-existent in dense networks ; and ( b ) changing the ReLU neurons into smoother activation functions such as Swish ( Ramachandran et al. , 2017 ) and Mish ( Misra , 2019 ) . • Training recipe tweaking : when training the ( found or modified ) sparse subnetwork architecture , we modify the training approach by : ( c ) changing the “ lottery ticket initialization ” by learned layer-wise scaling ; and ( d ) replacing the one-hot labels with either naive or knowledge-distilled soft labels . Each idea could be viewed as certain type of learned smoothening ( we will explain later ) , and is plug-and-play in the sparse re-training stage of any LTH algorithm . Those techniques can be applied either alone or altogether , and can significantly boost the sparse re-training performance in large models and at high sparsities . Note that all above “ tweaks ” only affect the sparse re-training stage ( we never alter the found sparse mask ) , but not the dense training/masking finding stage . In fact , our experiments will show that they boost sparse re-training much more than dense counterparts . Our contributions can be summarized as : • In contrast to the common wisdom that LTH sparse re-training needs to inherit ( masked ) network architecture , initialization , and training protocol from dense training , we for the first time demonstrate that purposely re-tweaking them will actually improve the sparse re-training step . That urges our rethinking of the LTH ’ s true value . • We investigate two groups of techniques to tweak the sparse subnetwork architecture and training recipe respectively . For the former , we inject new skip connections and replace new activation neurons . For the latter , we re-scale the initialization and soften the labels . Each of the techniques improves sparse re-training ( much more than they can help dense counterparts ) , and altogether they lead to further boosts . • Our extensive experimental results demonstrate that by plugging these techniques in LTH sparse retraining , we can significantly improve the performance of “ winning tickets ” at high sparsity levels and large models , setting the state-of-the-art performance bar of LTH . Furthermore , we show that they can benefit other sparse training algorithms in general , and provide visualizations to analyze their successes . 2 BACKGROUND WORK . 2.1 THE LOTTERY TICKET HYPOTHESIS . The LTH ( Frankle & Carbin , 2019 ) implies that initialization is the key for sparse network retraining . Beyond image classification ( Liu et al. , 2019 ; Savarese et al. , 2020 ; Wang et al. , 2020 ; You et al. , 2020 ; Ma et al. , 2021 ; Chen et al. , 2020a ) , LTH has also been widely explored in numerous contexts , such as natural language processing ( Gale et al. , 2019 ; Yu et al. , 2019 ; Prasanna et al. , 2020 ; Chen et al. , 2020b ; c ) , reinforcement learning ( Yu et al. , 2019 ) , self-supervised learning ( Chen et al. , 2020a ) , lifelong learning ( Chen et al. , 2021c ) , generative adversarial networks ( Chen et al. , 2021d ; Kalibhat et al. , 2020 ; Chen et al. , 2021a ) , and graph neural networks ( Chen et al. , 2021b ) . However , when retraining the sparse network , these works still strictly follow the same training recipe from dense networks . The most recent work ( Tessera et al. , 2021 ) reveals that focusing on initialization appears insufficient . Optimization strategies , regularization , and architecture choices also play significant roles in sparse network training . However , ( Tessera et al. , 2021 ) only compares sparse networks to their equivalent capacity dense networks , and most of their experiments are con- 2 ducted on multi-layer perceptron ( MLP ) . Thus , it is unclear whether their conclusion can generalize to the ticket finding from dense CNNs . 2.2 SMOOTHNESS . Introducing smoothness into NNs , including on the weights , logits , or training trajectory , is a common techniques to improve the generalization and optimization ( Jean & Wang , 1994 ) . For labels , smoothness is usually introduced by replacing the hard target with soft labels ( Szegedy et al. , 2016 ) or soft logits ( Hinton et al. , 2015a ) . This uncertainty of labels helps to alleviate the overconfidence ( Hein et al. , 2019 ) and improves the generalization . Smoothness can also implemented by replacing the activation functions ( Misra , 2019 ; Ramachandran et al. , 2017 ) , adding skip-connections in NNs ( He et al. , 2016 ) , or averaging along the trajectory of gradient descent ( Izmailov et al. , 2018 ) . These methods contribute to more stable gradient flows ( Tessera et al. , 2021 ) and smoother loss landscapes , but most of them have not been considered nor validated on sparse NNs . 3 METHODOLOGY The LTH ( Frankle & Carbin , 2019 ) suggests that the “ winning tickets ” can be found via the following three steps : ( 1 ) training a dense network from scratch ; ( 2 ) pruning unnecessary weights to form the mask of a sparse sub-network ; and ( 3 ) re-training the subnetwork from the same initialization used in the dense model . For the third step , the retraining of sparse network usually inherits all properties , such as architecture blocks and training recipes , from dense networks . However , our experiments validate that those are not necessarily optimal for training sparse networks . To verify , we investigate two aspects of “ tweaks ” dedicated to the sparse re-training step : model architecture , and training recipe . 3.1 MODEL ARCHITECTURE TWEAKING . Replacing Smoother Activations Most deep NNs apply the Rectified Linear Units ( ReLU ) ( Nair & Hinton , 2010 ) as the activation function . However , the gradient of ReLU changes suddenly around zero , and this non-smooth nature of ReLU is an obstacle to sparse retraining because it leads to high activation sparsity into the subnetwork , likely blocking the gradient flow ( Appendix A1.1 ) . To mitigate this issue and encourage healthier gradient flow , we replace the ReLU to Swish ( Ramachandran et al. , 2017 ) and Mish ( Misra , 2019 ) . Different from ReLU , Swish and Mish are both smooth non-monotonic activation functions . The non-monotonic property allows for the gradient of small negative inputs , which leads to a more stable gradient flow ( Tessera et al. , 2021 ) . Meanwhile , the loss landscape of Swish and Mish are 3 proved to have smoother transition ( Misra , 2019 ) , which makes the loss function easier to optimize and hence makes the sparse network generalize better . Injecting New Skip Connections High sparsity networks easily suffer from the layer-collapse ( Tanaka et al. , 2020 ) , i.e. , the premature pruning of an entire layer . This could make the sparse network untrainable , as the gradient can not be backpropagated through that layer . The skip connection ( or named ” residual-addition ” ) ( He et al. , 2016 ) was initially proposed to avoid gradient vanishing problem , and enables the training of a very deep model . It is later proven that skip connections can smooth the loss surfaces ( Li et al. , 2017b ) . That naturally motivates us to consider using more skip connections on the sparse networks to smoothen the landscape and preserve gradients , besides its possible mitigation effect when encountering collapsed layers . Inspired by ( Ding et al. , 2021 ) , we propose to “ artificially ” add new skip-connections during our sparse re-training . Figure 3 illustrates this architectural modifications to the traditional Resnet-18 block . Similar to existing residual connection in traditional ResNet-18 block , our newly introduced skip-connections add input of each ( 3 × 3 ) convolution block , to their output before the activation . The original motivation behind residual connections comes from their ability to allow gradient information to flow to earlier layers of the NN , thereby reducing the vanishing gradient problem during training ( He et al. , 2016 ) . With high activation sparsity present in sparse subnetworks , additional skip-connections can facilitate healthy gradient flow and improve their trainability . Furthermore , ( Li et al. , 2017b ) observed that with an increase in depth of networks , neural loss landscape becomes highly chaotic and leads to drop in generalization and trainability . They further observed that skip connections promote flatness and prevent transition to chaotic behaviour . Inspired by them , we added skip-connections to stabilize the initial chaotic training regime of sparse NN at high sparsity level and manage to prevent the transition to a sub-optimal behaviour .
The paper aims to improve Lottery Ticket Hypothesis (LTH). The paper shows that the combination of several techniques, such as different activations, skip connection, and knowledge distillation, can improve the performance of the sparse sub-network obtained from dense networks. The paper validates the method on some networks such as ResNet and MobileNet. Most experiments shown in the paper are conducted on CIFAR10 and CIFAR100.
SP:0f65fcb656c7ea471f50c8d3f6851f8c2c2f5ed9
Non-Transferable Learning: A New Approach for Model Ownership Verification and Applicability Authorization
1 INTRODUCTION . Deep Learning ( DL ) is the backbone of Artificial Intelligence as a Service ( AIaaS ) ( Ribeiro et al. , 2015 ) , which is being provided in a wide range of applications including music composition ( Briot et al. , 2020 ) , autonomous driving ( Li et al. , 2021a ) , smart building ( Xu et al. , 2020a ) , etc . However , a good model can be expensive to obtain : it often requires dedicated architecture design ( He et al. , 2016 ) , a large amount of high-quality data ( Deng et al. , 2009 ) , lengthy training on professional devices ( Zoph & Le , 2016 ) , and expert tuning ( Zhang et al. , 2019 ) . Thus , well-trained DL models are valuable intellectual property ( IP ) to the model owners and need protection . Generally speaking , there are two aspects in protecting an IP in AIaaS , verifying who owns the model and authorizing how the model can be used . These two aspects led to the development of two types of protection techniques : ownership verification and usage authorization . For ownership verification , prior works proposed approaches such as embedding watermarks into network parameters ( Song et al. , 2017 ) , learning special behaviors for pre-defined triggers ( Fan et al. , 2019 ) , and extracting fingerprints from the model ( Le Merrer et al. , 2020 ) . However , they are vulnerable to state-of-art watermark removal approaches that are based on model fine-tuning or retraining ( Chen et al. , 2019 ) , watermark overwriting and model pruning ( Rouhani et al. , 2018 ) . For model usage authorization , most prior works were built on encrypting neural network parameters with a secret key ( Alam et al. , 2020 ; Chakraborty et al. , 2020 ) and ensuring that models can only be used by users with this key . However , authorized users may use the model on any data without restriction . We believe that for comprehensive IP protection , the goal of usage authorization is not only who is allowed to use the model , but also what data can the model be used on . We thus consider a new data-centric aspect of usage authorization in this work , i.e. , authorizing models to certain data for preventing their usage on unauthorized data . We call this applicability authorization . Note that applicability authorization goes far beyond IP protection . It can also be viewed as a way to “ control ” how machine learning models are used in general . One example would be a company Data space Reduced model generalization bound Source domain Source-Only NTL Source domain Outside of source domain . Data space Target Target-Specified NTL Source domain Generalization bound Data space Supervised Learning Figure 1 : A visualization of the generalization bound trained with different approaches . The left figure shows Supervised Learning in the source domain , which can derive a wide generalization area . When Target-Specified NTL is applied ( middle ) , the target domain is removed from the generalization area . As for Source-Only NTL ( right ) , the generalization area is significantly reduced . ( e.g. , Facebook ) trains a model from adult data and uses applicability authorization to prevent the model from being used for teenagers . Our Approach and Contribution . In this work , we propose Non-Transferable Learning ( NTL ) , a novel approach that can robustly verify the model ownership and authorize the model applicability on certain data . Intuitively , NTL goes against the current research trend of improving the generalization ability of models across various domains , e.g. , domain generalization and adaptation ( Li et al. , 2020 ; Zhou et al. , 2020 ) . Instead , NTL tries to make the generalization bound of DL models more explicit and narrower , by optimizing the model to learn domain-dependent features and thereby making the model exclusive to certain domains . More specifically , we consider two domains : the source domain where we want the models to perform well , and the auxiliary domain where we aim to degrade the model performance . And if the model trained with NTL is applied to a target domain similar to the auxiliary one , the performance should also be poor . As shown in Figure 1 , we have developed two types of NTL approaches : Target-Specified NTL and Source-Only NTL . • Target-Specified NTL assumes that the source and target domains are both known . We then treat the target domain as the auxiliary domain and enlarge the distance of representations between the source and auxiliary domains . Target-Specified NTL can be used to verify the model ownership by triggering misclassification . While previous model watermarks can often be easily removed because the model memorization of such watermarks encounters catastrophic forgetting ( Kemker et al. , 2018 ) during watermark removal , our NTL-based verification is resistant to state-of-art watermark removal approaches , because the misclassification behavior is dependent on the overall target-private features that have little correlation with the source-private features for the main task . • In Source-Only NTL , the target domain is unknown and thus our approach relies solely on the source domain , aiming to degrade the performance in all other domains . In this case , NTL generates the auxiliary domain from a novel generative adversarial augmentation framework and then increases the representation distance . Source-Only NTL can provide authorization to certain data rather than particular users or devices , by degrading the model performance on all other data domains other than the source domain . This provides data-centric applicability authorization , with which we can also prevent unauthorized model usage that are caused by the secret key leakage and can not be addressed by prior model authorization methods . In addition to proposing the novel concept of NTL and developing its two approaches , we are also able to experimentally validate their effectiveness . We conducte extensive experiments on 5 digit sets , CIFAR10 & STL10 and VisDA . For target-specified cases , we demonstrate how to apply NTL for model ownership verification . Our experiments show that the state-of-art model watermark removal methods are ineffective on NTL-based ownership verification . For source-only NTL , our experiments demonstrate its effectiveness in authorizing model applicability to certain data . 2 RELATED WORK . Domain Generalization & Adaptation ( DG & DA ) . DG aims to generalize learning models with available source domains to unseen target domains ( Blanchard et al. , 2011 ) . A number of methods have been proposed for domain discrepancy minimization ( Li et al. , 2020 ) , adversarial training ( Rahman et al. , 2020 ; Zhao et al. , 2020c ) , invariance representation learning ( Zhou et al. , 2020 ; Piratla et al. , 2020 ) , etc . Recently , there is significant interest on conducting DG with one source domain only , for which well-crafted data augmentation approaches ( Qiao et al. , 2020 ; Zhao et al. , 2020b ; Li et al. , 2021b ; Xu et al. , 2020b ) have been proposed to expand the input space . DA is also related to improving the generalization ability of models across domains ( Ahmed et al. , 2021 ) , and while DA can access the target data , DG has no access to any target sample ( Tzeng et al. , 2017 ; Kundu et al. , 2020 ) . Unlike DG or DA , in this work , we try to weaken the generalization ability of models by expanding the distance between representations of different domains . Our proposed method can work effectively for both the target-specified case and the source-only case with a novel adversarial augmentation framework . Intellectual Property ( IP ) Protection for Deep Learning ( DL ) . While DL has shown its unparalleled advantages in various applications , there are significant challenges in protecting DL models . For instance , Membership Inference Attack ( Shokri et al. , 2017 ) can steal information on whether a particular data sample has been learned by the target DL model . Model Inversion Attack ( He et al. , 2019 ; Salem et al. , 2020 ) is able to recover the input data via an analysis of the model prediction . These two types of attacks directly threaten the privacy of model users , while there are many active attacks ( Suciu et al. , 2018 ; Yao et al. , 2019 ) that lead DL models to produce abnormal behaviors . In addition , verifying model ownership and authorizing model usage have become important issues with the development of AIaaS . There have been a number of watermarking approaches addressing the verification of model ownership . For instance , Zhang et al . ( 2018 ) and Li et al . ( 2019 ) train a neural network on the original datasets and on the watermarked one assigned with a particular label , which makes the model behave abnormally when it encounters watermarked data . Song et al . ( 2017 ) and Uchida et al . ( 2017 ) inject watermark into the least significant bits of the model parameters and provide the corresponding decoding methods . Le Merrer et al . ( 2020 ) and Zhao et al . ( 2020a ) make use of adversarial examples to extract fingerprints from learned neural networks without accessing network weights . Compared to these approaches , our NTL can achieve model ownership verification by triggering universal misclassification . Moreover , with extensive experiments , we also demonstrate that state-of-art model watermark removal methods , e.g. , FTAL and RTAL ( Adi et al. , 2018 ) , EWC and AU ( Chen et al. , 2019 ) , watermark overwriting and model pruning ( Rouhani et al. , 2018 ) are not effective to NTL-based verification . Model usage authorization is another aspect in protecting model intellectual property . For instance , Alam et al . ( 2020 ) encrypt every network parameter with a secret key . Chakraborty et al . ( 2020 ) generate a secret key from hardware fingerprints of a particular device , and require that only users who possess this device can load and employ the model . Different from these methods , our NTL focuses on providing data-centric protection via applicability authorization , which retains good model performance on authorized data while degrading model performance for other data domains . To the best of our knowledge , this is the first work that prevents model usage on unauthorized data via model learning . 3 METHODOLOGY . In this section , we introduce our NTL approach . Section 3.1 presents the inspiration and the design of optimization objective of NTL , which is at the core for both target-specified and source-only cases . Section 3.2 presents the generative augmentation framework for source-only cases . Our method is based on the concept of generative adversarial networks ( GAN ) , however our goal is not to propose a new GAN but to design an effective augmentation method in the context of NTL . Section 3.3 introduces the application of NTL on ownership verification and applicability authorization . 3.1 NON-TRANSFERABLE LEARNING WITH DISTANCE EXPANSION OF REPRESENTATION . We consider a source domain with labeled samples S= { ( x , y ) ∥x∼PSX , y∼PSY } , where PX and PY are the input and label distributions , respectively . In this work , we use image classification as the learning task with K possible classes , in which case x and y are matrix-valued and scalar random variables , respectively . In addition , we consider an auxiliary domain A= { ( x , y ) ∥x∼PAX , y∼PAY } . The source domain S and the auxiliary domain A will be fed into a deep neural network , and without loss of generality , we split the neural network into two parts , one is a feature extractor Φ on the bottom , and the other is a classifier Ω on the top . Inspiration from Information Bottleneck . Our NTL , in particular the design of optimization objective , is inspired by the analysis of Information Bottleneck ( IB ) ( Tishby et al. , 2000 ) . Let us start by introducing Shannon Mutual Information ( SMI ) . In addition to random variables – input x and label y , we also regard representation z extracted by Φ as a random variable . The SMI between two random variables , e.g. , between z and x , is defined as I ( z ; x ) =Ex∼PX [ DKL ( P ( z|x ) ∥P ( z ) ) ] , where DKL ( · ) represents the Kullback-Leible ( KL ) divergence and P ( · ) is the distribution . In IB theory , considering the effectiveness , privacy and generalization , an optimal representation has three properties ( Achille & Soatto , 2018 ) : ( 1 ) Sufficiency : label y sufficiently differentiates representation z , i.e. , I ( z ; y ) = I ( x ; y ) ; ( 2 ) Minimality : z needs to represent as little information about input x as possible , i.e. , min I ( z ; x ) ; ( 3 ) Invariance : z is optimal , meaning that it does not overfit to spurious correlations between y and nuisance n embedded in x , i.e. , I ( z ; n ) =0 . IB theory assumes that nuisance n is a factor that affects input x , and it works with y together to determine what x looks like to some extent . For instance , in domain generalization , nuisance n can be regarded as a domain index that indicates which domain a certain sample comes from ( Du et al. , 2020 ) . In our problem , different from the objective of the IB theory , NTL enforces the models to extract nuisance-dependent representations , which is opposite to the property of invariance . In other words , we aim to increase I ( z ; n ) , and we have the following proposition for achieving this aim . Proposition 1 . Let n be a nuisance for input x . Let z be a representation of x , and the label is y . For the information flow in the representation learning , we have I ( z ; x ) − I ( z ; y|n ) ≥ I ( z ; n ) ( 1 ) The detailed proof for Proposition 1 is included in the Appendix . Optimization Objective Design . Proposition 1 provides guidance for maximizing I ( z ; n ) . First , unlike in the IB theory , we do not minimize I ( z ; x ) for the minimality property . In addition , we try to minimize I ( z ; y|n ) through the design of optimization objective that measures the error between the model prediction and the ground truth during the training of neural networks . Specifically , instead of using the typical CrossEntropy loss to measure the error , we apply KL divergence loss to direct the training , and we have the following theorem . Theorem 1 . Let ŷ be the predicted label outputted by a representation model when feeding with input x , and suppose that ŷ is a scalar random variable and x is balanced on the ground truth label y. Denote the one-hot forms of ŷ and y as ŷ and y , respectively . If the KL divergence loss DKL ( P ( ŷ ) ∥P ( y ) ) increases , the mutual information I ( z ; y ) will decrease . The detailed proof of Theorem 1 is provided in the Appendix . According to this theorem , I ( z ; y|n ) can be minimized by increasing the KL divergence loss of training data conditioned on different n. However , as stated in Section 1 , we aim to degrade the model performance in the auxiliary domain while still maintaining good model performance in the source domain . Thus , we only minimize I ( z ; y|n ) by increasing the KL divergence loss of the auxiliary domain data . In order to achieve this goal , we design a loss L∗ntl that shapes like a minus operation between KL divergence losses of the source and auxiliary domain ( LS , LA ) , i.e. , LS = Ex∼PSX [ DKL ( P ( Ω ( Φ ( x ) ) ) ∥P ( y ) ) ] and LA=Ex∼PAX [ DKL ( P ( Ω ( Φ ( x ) ) ) ∥P ( y ) ) ] . Specifically , this loss can be written as follows : L∗ntl = LS −max ( β , α · LA ) ( 2 ) Here , α is the scaling factor for LA ( α = 0.1 in our experiments ) , and β is an upper bound when LA gets too large and dominates the overall loss ( β=1.0 in experiments ; please see the Appendix for more details about α and β ) . Moreover , if we use n = 0 and n = 1 to denote the source and auxiliary domain respectively , the optimization of Eq . ( 2 ) can guarantee the sufficiency property for the source domain : I ( z ; y|n=0 ) =I ( x ; y|n=0 ) , and increasing LA decreases I ( z ; y|n=1 ) . According to Proposition 1 , we can move the upper bound of I ( z ; n ) to a higher baseline via optimizing Eq . ( 2 ) . However , such optimization might only make classifier Ω more sensitive to domain features and have little effect on feature extractor Φ . In this case , representations of different domains captured by Φ may still be similar , which conflicts with our intention to maximize I ( z ; n ) , and the performance of the target can be easily improved by fine-tuning or adapting Ω with a small number of labeled target samples . On the other hand , directly calculating I ( z ; n ) and taking it as part of the optimization objective are difficult , especially in the optimization of representation learning ( Torkkola , 2003 ) . Achille & Soatto ( 2018 ) apply binary classifier as the nuisance discriminator , and they can estimate I ( z ; n ) after the model training via this discriminator . Here , we find another way to increase I ( z ; n ) indirectly based on the following theorem . Theorem 2 . Let n be a nuisance that is regarded as a domain index . n=0 and n=1 denote that a certain input x comes from two different domains . Suppose that these two domains have the same number of samples d , and the samples of each domain are symmetrically distributed around the centroid . Let z be a representation of x , and it is drawn from distribution PZ . An estimator with the characteristic kernel from Reproducing Kernel Hilbert Spaces ( RKHSs ) – Gaussian Kernel estimator MMD ( P , Q ; exp ) is applied on finite samples from distributions PZ|0 and PZ|1 to approximate the Maximum Mean Discrepancy ( MMD ) between these two distributions . If MMD ( PZ|0 , PZ|1 ; exp ) increases to saturation , the mutual information between z and n will increase . MMD ( PZ|0 , PZ|1 ; exp ) =Ez , z′∼PZ|0 [ e −∥z−z′∥2 ] −2Ez∼PZ|0 , z′∼PZ|1 [ e −∥z−z′∥2 ] +Ez , z′∼PZ|1 [ e −∥z−z′∥2 ] ( 3 ) We also employ a nuisance discriminator to observe the change of I ( z ; n ) during training . The details of this discriminator design and the proof of Theorem 2 can be found in the Appendix . NTL Optimization Objective . Based on the above analysis , we design our NTL optimization objective to increase I ( z ; n ) and extract nuisance-dependent representations . Specifically , we compute the MMD ( P , Q ; exp ) between representations of the source and auxiliary domain data and maximize it . For stability concern , we also set an upper bound to the MMD ( P , Q ; exp ) . Then , the overall optimization objective of NTL with distance expansion of representation is shaped as follows : Lntl = LS−max ( β , α ·LA ·Ldis ) , whereLdis = max ( β′ , α′ ·MMD ( Px∼PS X ( Φ ( x ) ) , Px∼PA X ( Φ ( x ) ) ; exp ) ( 4 ) Here , α′ and β′ represent the scaling factor and upper bound of Ldis respectively ( α′ = 0.1 and β′=1.0 in our experiments ; please refer to the Appendix for more details about α′ and β′ ) . Φ ( · ) is the feature extractor that outputs the corresponding representations of given inputs . When the target domain is known and accessible , it will be regarded as the auxiliary domain , and the above NTL with distance expansion of representation can be conducted directly on the source and auxiliary domains . We call such cases Target-Specified NTL .
In the era of deep learning, pre-trained models have been regarded as intellectual properties of AI companies. Thus, protecting these models has been more and more important. To achieve this aim, this paper proposes a non-transferable learning (NTL) method to capture the exclusive data representation in the learned model and restrict the model generalization ability to certain domains. This approach provides effective solutions to both model verification and authorization. Specifically: 1) For ownership verification, watermarking techniques are commonly used but are often vulnerable to sophisticated watermark removal methods. By comparison, the NTL-based ownership verification provides robust resistance to state-of-the-art watermark removal methods, as shown in extensive experiments with 6 removal approaches over the digits, CIFAR10 & STL10, and VisDA datasets. 2) For usage authorization, prior solutions focus on authorizing specific users to access the model, but authorized users can still apply the model to any data without restriction. The NTL-based authorization approach instead provides a data-centric protection, which is called applicability authorization, by significantly degrading the performance of the model on unauthorized data. In general, this paper contributes a novel method to the field, and experiments verified the success of the proposed method.
SP:fc3be226cf3cdf2821f45e68c4a800d1337c7abc
Non-Transferable Learning: A New Approach for Model Ownership Verification and Applicability Authorization
1 INTRODUCTION . Deep Learning ( DL ) is the backbone of Artificial Intelligence as a Service ( AIaaS ) ( Ribeiro et al. , 2015 ) , which is being provided in a wide range of applications including music composition ( Briot et al. , 2020 ) , autonomous driving ( Li et al. , 2021a ) , smart building ( Xu et al. , 2020a ) , etc . However , a good model can be expensive to obtain : it often requires dedicated architecture design ( He et al. , 2016 ) , a large amount of high-quality data ( Deng et al. , 2009 ) , lengthy training on professional devices ( Zoph & Le , 2016 ) , and expert tuning ( Zhang et al. , 2019 ) . Thus , well-trained DL models are valuable intellectual property ( IP ) to the model owners and need protection . Generally speaking , there are two aspects in protecting an IP in AIaaS , verifying who owns the model and authorizing how the model can be used . These two aspects led to the development of two types of protection techniques : ownership verification and usage authorization . For ownership verification , prior works proposed approaches such as embedding watermarks into network parameters ( Song et al. , 2017 ) , learning special behaviors for pre-defined triggers ( Fan et al. , 2019 ) , and extracting fingerprints from the model ( Le Merrer et al. , 2020 ) . However , they are vulnerable to state-of-art watermark removal approaches that are based on model fine-tuning or retraining ( Chen et al. , 2019 ) , watermark overwriting and model pruning ( Rouhani et al. , 2018 ) . For model usage authorization , most prior works were built on encrypting neural network parameters with a secret key ( Alam et al. , 2020 ; Chakraborty et al. , 2020 ) and ensuring that models can only be used by users with this key . However , authorized users may use the model on any data without restriction . We believe that for comprehensive IP protection , the goal of usage authorization is not only who is allowed to use the model , but also what data can the model be used on . We thus consider a new data-centric aspect of usage authorization in this work , i.e. , authorizing models to certain data for preventing their usage on unauthorized data . We call this applicability authorization . Note that applicability authorization goes far beyond IP protection . It can also be viewed as a way to “ control ” how machine learning models are used in general . One example would be a company Data space Reduced model generalization bound Source domain Source-Only NTL Source domain Outside of source domain . Data space Target Target-Specified NTL Source domain Generalization bound Data space Supervised Learning Figure 1 : A visualization of the generalization bound trained with different approaches . The left figure shows Supervised Learning in the source domain , which can derive a wide generalization area . When Target-Specified NTL is applied ( middle ) , the target domain is removed from the generalization area . As for Source-Only NTL ( right ) , the generalization area is significantly reduced . ( e.g. , Facebook ) trains a model from adult data and uses applicability authorization to prevent the model from being used for teenagers . Our Approach and Contribution . In this work , we propose Non-Transferable Learning ( NTL ) , a novel approach that can robustly verify the model ownership and authorize the model applicability on certain data . Intuitively , NTL goes against the current research trend of improving the generalization ability of models across various domains , e.g. , domain generalization and adaptation ( Li et al. , 2020 ; Zhou et al. , 2020 ) . Instead , NTL tries to make the generalization bound of DL models more explicit and narrower , by optimizing the model to learn domain-dependent features and thereby making the model exclusive to certain domains . More specifically , we consider two domains : the source domain where we want the models to perform well , and the auxiliary domain where we aim to degrade the model performance . And if the model trained with NTL is applied to a target domain similar to the auxiliary one , the performance should also be poor . As shown in Figure 1 , we have developed two types of NTL approaches : Target-Specified NTL and Source-Only NTL . • Target-Specified NTL assumes that the source and target domains are both known . We then treat the target domain as the auxiliary domain and enlarge the distance of representations between the source and auxiliary domains . Target-Specified NTL can be used to verify the model ownership by triggering misclassification . While previous model watermarks can often be easily removed because the model memorization of such watermarks encounters catastrophic forgetting ( Kemker et al. , 2018 ) during watermark removal , our NTL-based verification is resistant to state-of-art watermark removal approaches , because the misclassification behavior is dependent on the overall target-private features that have little correlation with the source-private features for the main task . • In Source-Only NTL , the target domain is unknown and thus our approach relies solely on the source domain , aiming to degrade the performance in all other domains . In this case , NTL generates the auxiliary domain from a novel generative adversarial augmentation framework and then increases the representation distance . Source-Only NTL can provide authorization to certain data rather than particular users or devices , by degrading the model performance on all other data domains other than the source domain . This provides data-centric applicability authorization , with which we can also prevent unauthorized model usage that are caused by the secret key leakage and can not be addressed by prior model authorization methods . In addition to proposing the novel concept of NTL and developing its two approaches , we are also able to experimentally validate their effectiveness . We conducte extensive experiments on 5 digit sets , CIFAR10 & STL10 and VisDA . For target-specified cases , we demonstrate how to apply NTL for model ownership verification . Our experiments show that the state-of-art model watermark removal methods are ineffective on NTL-based ownership verification . For source-only NTL , our experiments demonstrate its effectiveness in authorizing model applicability to certain data . 2 RELATED WORK . Domain Generalization & Adaptation ( DG & DA ) . DG aims to generalize learning models with available source domains to unseen target domains ( Blanchard et al. , 2011 ) . A number of methods have been proposed for domain discrepancy minimization ( Li et al. , 2020 ) , adversarial training ( Rahman et al. , 2020 ; Zhao et al. , 2020c ) , invariance representation learning ( Zhou et al. , 2020 ; Piratla et al. , 2020 ) , etc . Recently , there is significant interest on conducting DG with one source domain only , for which well-crafted data augmentation approaches ( Qiao et al. , 2020 ; Zhao et al. , 2020b ; Li et al. , 2021b ; Xu et al. , 2020b ) have been proposed to expand the input space . DA is also related to improving the generalization ability of models across domains ( Ahmed et al. , 2021 ) , and while DA can access the target data , DG has no access to any target sample ( Tzeng et al. , 2017 ; Kundu et al. , 2020 ) . Unlike DG or DA , in this work , we try to weaken the generalization ability of models by expanding the distance between representations of different domains . Our proposed method can work effectively for both the target-specified case and the source-only case with a novel adversarial augmentation framework . Intellectual Property ( IP ) Protection for Deep Learning ( DL ) . While DL has shown its unparalleled advantages in various applications , there are significant challenges in protecting DL models . For instance , Membership Inference Attack ( Shokri et al. , 2017 ) can steal information on whether a particular data sample has been learned by the target DL model . Model Inversion Attack ( He et al. , 2019 ; Salem et al. , 2020 ) is able to recover the input data via an analysis of the model prediction . These two types of attacks directly threaten the privacy of model users , while there are many active attacks ( Suciu et al. , 2018 ; Yao et al. , 2019 ) that lead DL models to produce abnormal behaviors . In addition , verifying model ownership and authorizing model usage have become important issues with the development of AIaaS . There have been a number of watermarking approaches addressing the verification of model ownership . For instance , Zhang et al . ( 2018 ) and Li et al . ( 2019 ) train a neural network on the original datasets and on the watermarked one assigned with a particular label , which makes the model behave abnormally when it encounters watermarked data . Song et al . ( 2017 ) and Uchida et al . ( 2017 ) inject watermark into the least significant bits of the model parameters and provide the corresponding decoding methods . Le Merrer et al . ( 2020 ) and Zhao et al . ( 2020a ) make use of adversarial examples to extract fingerprints from learned neural networks without accessing network weights . Compared to these approaches , our NTL can achieve model ownership verification by triggering universal misclassification . Moreover , with extensive experiments , we also demonstrate that state-of-art model watermark removal methods , e.g. , FTAL and RTAL ( Adi et al. , 2018 ) , EWC and AU ( Chen et al. , 2019 ) , watermark overwriting and model pruning ( Rouhani et al. , 2018 ) are not effective to NTL-based verification . Model usage authorization is another aspect in protecting model intellectual property . For instance , Alam et al . ( 2020 ) encrypt every network parameter with a secret key . Chakraborty et al . ( 2020 ) generate a secret key from hardware fingerprints of a particular device , and require that only users who possess this device can load and employ the model . Different from these methods , our NTL focuses on providing data-centric protection via applicability authorization , which retains good model performance on authorized data while degrading model performance for other data domains . To the best of our knowledge , this is the first work that prevents model usage on unauthorized data via model learning . 3 METHODOLOGY . In this section , we introduce our NTL approach . Section 3.1 presents the inspiration and the design of optimization objective of NTL , which is at the core for both target-specified and source-only cases . Section 3.2 presents the generative augmentation framework for source-only cases . Our method is based on the concept of generative adversarial networks ( GAN ) , however our goal is not to propose a new GAN but to design an effective augmentation method in the context of NTL . Section 3.3 introduces the application of NTL on ownership verification and applicability authorization . 3.1 NON-TRANSFERABLE LEARNING WITH DISTANCE EXPANSION OF REPRESENTATION . We consider a source domain with labeled samples S= { ( x , y ) ∥x∼PSX , y∼PSY } , where PX and PY are the input and label distributions , respectively . In this work , we use image classification as the learning task with K possible classes , in which case x and y are matrix-valued and scalar random variables , respectively . In addition , we consider an auxiliary domain A= { ( x , y ) ∥x∼PAX , y∼PAY } . The source domain S and the auxiliary domain A will be fed into a deep neural network , and without loss of generality , we split the neural network into two parts , one is a feature extractor Φ on the bottom , and the other is a classifier Ω on the top . Inspiration from Information Bottleneck . Our NTL , in particular the design of optimization objective , is inspired by the analysis of Information Bottleneck ( IB ) ( Tishby et al. , 2000 ) . Let us start by introducing Shannon Mutual Information ( SMI ) . In addition to random variables – input x and label y , we also regard representation z extracted by Φ as a random variable . The SMI between two random variables , e.g. , between z and x , is defined as I ( z ; x ) =Ex∼PX [ DKL ( P ( z|x ) ∥P ( z ) ) ] , where DKL ( · ) represents the Kullback-Leible ( KL ) divergence and P ( · ) is the distribution . In IB theory , considering the effectiveness , privacy and generalization , an optimal representation has three properties ( Achille & Soatto , 2018 ) : ( 1 ) Sufficiency : label y sufficiently differentiates representation z , i.e. , I ( z ; y ) = I ( x ; y ) ; ( 2 ) Minimality : z needs to represent as little information about input x as possible , i.e. , min I ( z ; x ) ; ( 3 ) Invariance : z is optimal , meaning that it does not overfit to spurious correlations between y and nuisance n embedded in x , i.e. , I ( z ; n ) =0 . IB theory assumes that nuisance n is a factor that affects input x , and it works with y together to determine what x looks like to some extent . For instance , in domain generalization , nuisance n can be regarded as a domain index that indicates which domain a certain sample comes from ( Du et al. , 2020 ) . In our problem , different from the objective of the IB theory , NTL enforces the models to extract nuisance-dependent representations , which is opposite to the property of invariance . In other words , we aim to increase I ( z ; n ) , and we have the following proposition for achieving this aim . Proposition 1 . Let n be a nuisance for input x . Let z be a representation of x , and the label is y . For the information flow in the representation learning , we have I ( z ; x ) − I ( z ; y|n ) ≥ I ( z ; n ) ( 1 ) The detailed proof for Proposition 1 is included in the Appendix . Optimization Objective Design . Proposition 1 provides guidance for maximizing I ( z ; n ) . First , unlike in the IB theory , we do not minimize I ( z ; x ) for the minimality property . In addition , we try to minimize I ( z ; y|n ) through the design of optimization objective that measures the error between the model prediction and the ground truth during the training of neural networks . Specifically , instead of using the typical CrossEntropy loss to measure the error , we apply KL divergence loss to direct the training , and we have the following theorem . Theorem 1 . Let ŷ be the predicted label outputted by a representation model when feeding with input x , and suppose that ŷ is a scalar random variable and x is balanced on the ground truth label y. Denote the one-hot forms of ŷ and y as ŷ and y , respectively . If the KL divergence loss DKL ( P ( ŷ ) ∥P ( y ) ) increases , the mutual information I ( z ; y ) will decrease . The detailed proof of Theorem 1 is provided in the Appendix . According to this theorem , I ( z ; y|n ) can be minimized by increasing the KL divergence loss of training data conditioned on different n. However , as stated in Section 1 , we aim to degrade the model performance in the auxiliary domain while still maintaining good model performance in the source domain . Thus , we only minimize I ( z ; y|n ) by increasing the KL divergence loss of the auxiliary domain data . In order to achieve this goal , we design a loss L∗ntl that shapes like a minus operation between KL divergence losses of the source and auxiliary domain ( LS , LA ) , i.e. , LS = Ex∼PSX [ DKL ( P ( Ω ( Φ ( x ) ) ) ∥P ( y ) ) ] and LA=Ex∼PAX [ DKL ( P ( Ω ( Φ ( x ) ) ) ∥P ( y ) ) ] . Specifically , this loss can be written as follows : L∗ntl = LS −max ( β , α · LA ) ( 2 ) Here , α is the scaling factor for LA ( α = 0.1 in our experiments ) , and β is an upper bound when LA gets too large and dominates the overall loss ( β=1.0 in experiments ; please see the Appendix for more details about α and β ) . Moreover , if we use n = 0 and n = 1 to denote the source and auxiliary domain respectively , the optimization of Eq . ( 2 ) can guarantee the sufficiency property for the source domain : I ( z ; y|n=0 ) =I ( x ; y|n=0 ) , and increasing LA decreases I ( z ; y|n=1 ) . According to Proposition 1 , we can move the upper bound of I ( z ; n ) to a higher baseline via optimizing Eq . ( 2 ) . However , such optimization might only make classifier Ω more sensitive to domain features and have little effect on feature extractor Φ . In this case , representations of different domains captured by Φ may still be similar , which conflicts with our intention to maximize I ( z ; n ) , and the performance of the target can be easily improved by fine-tuning or adapting Ω with a small number of labeled target samples . On the other hand , directly calculating I ( z ; n ) and taking it as part of the optimization objective are difficult , especially in the optimization of representation learning ( Torkkola , 2003 ) . Achille & Soatto ( 2018 ) apply binary classifier as the nuisance discriminator , and they can estimate I ( z ; n ) after the model training via this discriminator . Here , we find another way to increase I ( z ; n ) indirectly based on the following theorem . Theorem 2 . Let n be a nuisance that is regarded as a domain index . n=0 and n=1 denote that a certain input x comes from two different domains . Suppose that these two domains have the same number of samples d , and the samples of each domain are symmetrically distributed around the centroid . Let z be a representation of x , and it is drawn from distribution PZ . An estimator with the characteristic kernel from Reproducing Kernel Hilbert Spaces ( RKHSs ) – Gaussian Kernel estimator MMD ( P , Q ; exp ) is applied on finite samples from distributions PZ|0 and PZ|1 to approximate the Maximum Mean Discrepancy ( MMD ) between these two distributions . If MMD ( PZ|0 , PZ|1 ; exp ) increases to saturation , the mutual information between z and n will increase . MMD ( PZ|0 , PZ|1 ; exp ) =Ez , z′∼PZ|0 [ e −∥z−z′∥2 ] −2Ez∼PZ|0 , z′∼PZ|1 [ e −∥z−z′∥2 ] +Ez , z′∼PZ|1 [ e −∥z−z′∥2 ] ( 3 ) We also employ a nuisance discriminator to observe the change of I ( z ; n ) during training . The details of this discriminator design and the proof of Theorem 2 can be found in the Appendix . NTL Optimization Objective . Based on the above analysis , we design our NTL optimization objective to increase I ( z ; n ) and extract nuisance-dependent representations . Specifically , we compute the MMD ( P , Q ; exp ) between representations of the source and auxiliary domain data and maximize it . For stability concern , we also set an upper bound to the MMD ( P , Q ; exp ) . Then , the overall optimization objective of NTL with distance expansion of representation is shaped as follows : Lntl = LS−max ( β , α ·LA ·Ldis ) , whereLdis = max ( β′ , α′ ·MMD ( Px∼PS X ( Φ ( x ) ) , Px∼PA X ( Φ ( x ) ) ; exp ) ( 4 ) Here , α′ and β′ represent the scaling factor and upper bound of Ldis respectively ( α′ = 0.1 and β′=1.0 in our experiments ; please refer to the Appendix for more details about α′ and β′ ) . Φ ( · ) is the feature extractor that outputs the corresponding representations of given inputs . When the target domain is known and accessible , it will be regarded as the auxiliary domain , and the above NTL with distance expansion of representation can be conducted directly on the source and auxiliary domains . We call such cases Target-Specified NTL .
This paper introduces the idea of "non-transferable learning", which is roughly what the name indicates. The authors explain the value of this as a security/IP protection tool to protect the model from being used on unauthorized data. In addition, this presents a kind of attack against domain adaption works that try to improve generalization bounds without access to source data.
SP:fc3be226cf3cdf2821f45e68c4a800d1337c7abc
Non-Transferable Learning: A New Approach for Model Ownership Verification and Applicability Authorization
1 INTRODUCTION . Deep Learning ( DL ) is the backbone of Artificial Intelligence as a Service ( AIaaS ) ( Ribeiro et al. , 2015 ) , which is being provided in a wide range of applications including music composition ( Briot et al. , 2020 ) , autonomous driving ( Li et al. , 2021a ) , smart building ( Xu et al. , 2020a ) , etc . However , a good model can be expensive to obtain : it often requires dedicated architecture design ( He et al. , 2016 ) , a large amount of high-quality data ( Deng et al. , 2009 ) , lengthy training on professional devices ( Zoph & Le , 2016 ) , and expert tuning ( Zhang et al. , 2019 ) . Thus , well-trained DL models are valuable intellectual property ( IP ) to the model owners and need protection . Generally speaking , there are two aspects in protecting an IP in AIaaS , verifying who owns the model and authorizing how the model can be used . These two aspects led to the development of two types of protection techniques : ownership verification and usage authorization . For ownership verification , prior works proposed approaches such as embedding watermarks into network parameters ( Song et al. , 2017 ) , learning special behaviors for pre-defined triggers ( Fan et al. , 2019 ) , and extracting fingerprints from the model ( Le Merrer et al. , 2020 ) . However , they are vulnerable to state-of-art watermark removal approaches that are based on model fine-tuning or retraining ( Chen et al. , 2019 ) , watermark overwriting and model pruning ( Rouhani et al. , 2018 ) . For model usage authorization , most prior works were built on encrypting neural network parameters with a secret key ( Alam et al. , 2020 ; Chakraborty et al. , 2020 ) and ensuring that models can only be used by users with this key . However , authorized users may use the model on any data without restriction . We believe that for comprehensive IP protection , the goal of usage authorization is not only who is allowed to use the model , but also what data can the model be used on . We thus consider a new data-centric aspect of usage authorization in this work , i.e. , authorizing models to certain data for preventing their usage on unauthorized data . We call this applicability authorization . Note that applicability authorization goes far beyond IP protection . It can also be viewed as a way to “ control ” how machine learning models are used in general . One example would be a company Data space Reduced model generalization bound Source domain Source-Only NTL Source domain Outside of source domain . Data space Target Target-Specified NTL Source domain Generalization bound Data space Supervised Learning Figure 1 : A visualization of the generalization bound trained with different approaches . The left figure shows Supervised Learning in the source domain , which can derive a wide generalization area . When Target-Specified NTL is applied ( middle ) , the target domain is removed from the generalization area . As for Source-Only NTL ( right ) , the generalization area is significantly reduced . ( e.g. , Facebook ) trains a model from adult data and uses applicability authorization to prevent the model from being used for teenagers . Our Approach and Contribution . In this work , we propose Non-Transferable Learning ( NTL ) , a novel approach that can robustly verify the model ownership and authorize the model applicability on certain data . Intuitively , NTL goes against the current research trend of improving the generalization ability of models across various domains , e.g. , domain generalization and adaptation ( Li et al. , 2020 ; Zhou et al. , 2020 ) . Instead , NTL tries to make the generalization bound of DL models more explicit and narrower , by optimizing the model to learn domain-dependent features and thereby making the model exclusive to certain domains . More specifically , we consider two domains : the source domain where we want the models to perform well , and the auxiliary domain where we aim to degrade the model performance . And if the model trained with NTL is applied to a target domain similar to the auxiliary one , the performance should also be poor . As shown in Figure 1 , we have developed two types of NTL approaches : Target-Specified NTL and Source-Only NTL . • Target-Specified NTL assumes that the source and target domains are both known . We then treat the target domain as the auxiliary domain and enlarge the distance of representations between the source and auxiliary domains . Target-Specified NTL can be used to verify the model ownership by triggering misclassification . While previous model watermarks can often be easily removed because the model memorization of such watermarks encounters catastrophic forgetting ( Kemker et al. , 2018 ) during watermark removal , our NTL-based verification is resistant to state-of-art watermark removal approaches , because the misclassification behavior is dependent on the overall target-private features that have little correlation with the source-private features for the main task . • In Source-Only NTL , the target domain is unknown and thus our approach relies solely on the source domain , aiming to degrade the performance in all other domains . In this case , NTL generates the auxiliary domain from a novel generative adversarial augmentation framework and then increases the representation distance . Source-Only NTL can provide authorization to certain data rather than particular users or devices , by degrading the model performance on all other data domains other than the source domain . This provides data-centric applicability authorization , with which we can also prevent unauthorized model usage that are caused by the secret key leakage and can not be addressed by prior model authorization methods . In addition to proposing the novel concept of NTL and developing its two approaches , we are also able to experimentally validate their effectiveness . We conducte extensive experiments on 5 digit sets , CIFAR10 & STL10 and VisDA . For target-specified cases , we demonstrate how to apply NTL for model ownership verification . Our experiments show that the state-of-art model watermark removal methods are ineffective on NTL-based ownership verification . For source-only NTL , our experiments demonstrate its effectiveness in authorizing model applicability to certain data . 2 RELATED WORK . Domain Generalization & Adaptation ( DG & DA ) . DG aims to generalize learning models with available source domains to unseen target domains ( Blanchard et al. , 2011 ) . A number of methods have been proposed for domain discrepancy minimization ( Li et al. , 2020 ) , adversarial training ( Rahman et al. , 2020 ; Zhao et al. , 2020c ) , invariance representation learning ( Zhou et al. , 2020 ; Piratla et al. , 2020 ) , etc . Recently , there is significant interest on conducting DG with one source domain only , for which well-crafted data augmentation approaches ( Qiao et al. , 2020 ; Zhao et al. , 2020b ; Li et al. , 2021b ; Xu et al. , 2020b ) have been proposed to expand the input space . DA is also related to improving the generalization ability of models across domains ( Ahmed et al. , 2021 ) , and while DA can access the target data , DG has no access to any target sample ( Tzeng et al. , 2017 ; Kundu et al. , 2020 ) . Unlike DG or DA , in this work , we try to weaken the generalization ability of models by expanding the distance between representations of different domains . Our proposed method can work effectively for both the target-specified case and the source-only case with a novel adversarial augmentation framework . Intellectual Property ( IP ) Protection for Deep Learning ( DL ) . While DL has shown its unparalleled advantages in various applications , there are significant challenges in protecting DL models . For instance , Membership Inference Attack ( Shokri et al. , 2017 ) can steal information on whether a particular data sample has been learned by the target DL model . Model Inversion Attack ( He et al. , 2019 ; Salem et al. , 2020 ) is able to recover the input data via an analysis of the model prediction . These two types of attacks directly threaten the privacy of model users , while there are many active attacks ( Suciu et al. , 2018 ; Yao et al. , 2019 ) that lead DL models to produce abnormal behaviors . In addition , verifying model ownership and authorizing model usage have become important issues with the development of AIaaS . There have been a number of watermarking approaches addressing the verification of model ownership . For instance , Zhang et al . ( 2018 ) and Li et al . ( 2019 ) train a neural network on the original datasets and on the watermarked one assigned with a particular label , which makes the model behave abnormally when it encounters watermarked data . Song et al . ( 2017 ) and Uchida et al . ( 2017 ) inject watermark into the least significant bits of the model parameters and provide the corresponding decoding methods . Le Merrer et al . ( 2020 ) and Zhao et al . ( 2020a ) make use of adversarial examples to extract fingerprints from learned neural networks without accessing network weights . Compared to these approaches , our NTL can achieve model ownership verification by triggering universal misclassification . Moreover , with extensive experiments , we also demonstrate that state-of-art model watermark removal methods , e.g. , FTAL and RTAL ( Adi et al. , 2018 ) , EWC and AU ( Chen et al. , 2019 ) , watermark overwriting and model pruning ( Rouhani et al. , 2018 ) are not effective to NTL-based verification . Model usage authorization is another aspect in protecting model intellectual property . For instance , Alam et al . ( 2020 ) encrypt every network parameter with a secret key . Chakraborty et al . ( 2020 ) generate a secret key from hardware fingerprints of a particular device , and require that only users who possess this device can load and employ the model . Different from these methods , our NTL focuses on providing data-centric protection via applicability authorization , which retains good model performance on authorized data while degrading model performance for other data domains . To the best of our knowledge , this is the first work that prevents model usage on unauthorized data via model learning . 3 METHODOLOGY . In this section , we introduce our NTL approach . Section 3.1 presents the inspiration and the design of optimization objective of NTL , which is at the core for both target-specified and source-only cases . Section 3.2 presents the generative augmentation framework for source-only cases . Our method is based on the concept of generative adversarial networks ( GAN ) , however our goal is not to propose a new GAN but to design an effective augmentation method in the context of NTL . Section 3.3 introduces the application of NTL on ownership verification and applicability authorization . 3.1 NON-TRANSFERABLE LEARNING WITH DISTANCE EXPANSION OF REPRESENTATION . We consider a source domain with labeled samples S= { ( x , y ) ∥x∼PSX , y∼PSY } , where PX and PY are the input and label distributions , respectively . In this work , we use image classification as the learning task with K possible classes , in which case x and y are matrix-valued and scalar random variables , respectively . In addition , we consider an auxiliary domain A= { ( x , y ) ∥x∼PAX , y∼PAY } . The source domain S and the auxiliary domain A will be fed into a deep neural network , and without loss of generality , we split the neural network into two parts , one is a feature extractor Φ on the bottom , and the other is a classifier Ω on the top . Inspiration from Information Bottleneck . Our NTL , in particular the design of optimization objective , is inspired by the analysis of Information Bottleneck ( IB ) ( Tishby et al. , 2000 ) . Let us start by introducing Shannon Mutual Information ( SMI ) . In addition to random variables – input x and label y , we also regard representation z extracted by Φ as a random variable . The SMI between two random variables , e.g. , between z and x , is defined as I ( z ; x ) =Ex∼PX [ DKL ( P ( z|x ) ∥P ( z ) ) ] , where DKL ( · ) represents the Kullback-Leible ( KL ) divergence and P ( · ) is the distribution . In IB theory , considering the effectiveness , privacy and generalization , an optimal representation has three properties ( Achille & Soatto , 2018 ) : ( 1 ) Sufficiency : label y sufficiently differentiates representation z , i.e. , I ( z ; y ) = I ( x ; y ) ; ( 2 ) Minimality : z needs to represent as little information about input x as possible , i.e. , min I ( z ; x ) ; ( 3 ) Invariance : z is optimal , meaning that it does not overfit to spurious correlations between y and nuisance n embedded in x , i.e. , I ( z ; n ) =0 . IB theory assumes that nuisance n is a factor that affects input x , and it works with y together to determine what x looks like to some extent . For instance , in domain generalization , nuisance n can be regarded as a domain index that indicates which domain a certain sample comes from ( Du et al. , 2020 ) . In our problem , different from the objective of the IB theory , NTL enforces the models to extract nuisance-dependent representations , which is opposite to the property of invariance . In other words , we aim to increase I ( z ; n ) , and we have the following proposition for achieving this aim . Proposition 1 . Let n be a nuisance for input x . Let z be a representation of x , and the label is y . For the information flow in the representation learning , we have I ( z ; x ) − I ( z ; y|n ) ≥ I ( z ; n ) ( 1 ) The detailed proof for Proposition 1 is included in the Appendix . Optimization Objective Design . Proposition 1 provides guidance for maximizing I ( z ; n ) . First , unlike in the IB theory , we do not minimize I ( z ; x ) for the minimality property . In addition , we try to minimize I ( z ; y|n ) through the design of optimization objective that measures the error between the model prediction and the ground truth during the training of neural networks . Specifically , instead of using the typical CrossEntropy loss to measure the error , we apply KL divergence loss to direct the training , and we have the following theorem . Theorem 1 . Let ŷ be the predicted label outputted by a representation model when feeding with input x , and suppose that ŷ is a scalar random variable and x is balanced on the ground truth label y. Denote the one-hot forms of ŷ and y as ŷ and y , respectively . If the KL divergence loss DKL ( P ( ŷ ) ∥P ( y ) ) increases , the mutual information I ( z ; y ) will decrease . The detailed proof of Theorem 1 is provided in the Appendix . According to this theorem , I ( z ; y|n ) can be minimized by increasing the KL divergence loss of training data conditioned on different n. However , as stated in Section 1 , we aim to degrade the model performance in the auxiliary domain while still maintaining good model performance in the source domain . Thus , we only minimize I ( z ; y|n ) by increasing the KL divergence loss of the auxiliary domain data . In order to achieve this goal , we design a loss L∗ntl that shapes like a minus operation between KL divergence losses of the source and auxiliary domain ( LS , LA ) , i.e. , LS = Ex∼PSX [ DKL ( P ( Ω ( Φ ( x ) ) ) ∥P ( y ) ) ] and LA=Ex∼PAX [ DKL ( P ( Ω ( Φ ( x ) ) ) ∥P ( y ) ) ] . Specifically , this loss can be written as follows : L∗ntl = LS −max ( β , α · LA ) ( 2 ) Here , α is the scaling factor for LA ( α = 0.1 in our experiments ) , and β is an upper bound when LA gets too large and dominates the overall loss ( β=1.0 in experiments ; please see the Appendix for more details about α and β ) . Moreover , if we use n = 0 and n = 1 to denote the source and auxiliary domain respectively , the optimization of Eq . ( 2 ) can guarantee the sufficiency property for the source domain : I ( z ; y|n=0 ) =I ( x ; y|n=0 ) , and increasing LA decreases I ( z ; y|n=1 ) . According to Proposition 1 , we can move the upper bound of I ( z ; n ) to a higher baseline via optimizing Eq . ( 2 ) . However , such optimization might only make classifier Ω more sensitive to domain features and have little effect on feature extractor Φ . In this case , representations of different domains captured by Φ may still be similar , which conflicts with our intention to maximize I ( z ; n ) , and the performance of the target can be easily improved by fine-tuning or adapting Ω with a small number of labeled target samples . On the other hand , directly calculating I ( z ; n ) and taking it as part of the optimization objective are difficult , especially in the optimization of representation learning ( Torkkola , 2003 ) . Achille & Soatto ( 2018 ) apply binary classifier as the nuisance discriminator , and they can estimate I ( z ; n ) after the model training via this discriminator . Here , we find another way to increase I ( z ; n ) indirectly based on the following theorem . Theorem 2 . Let n be a nuisance that is regarded as a domain index . n=0 and n=1 denote that a certain input x comes from two different domains . Suppose that these two domains have the same number of samples d , and the samples of each domain are symmetrically distributed around the centroid . Let z be a representation of x , and it is drawn from distribution PZ . An estimator with the characteristic kernel from Reproducing Kernel Hilbert Spaces ( RKHSs ) – Gaussian Kernel estimator MMD ( P , Q ; exp ) is applied on finite samples from distributions PZ|0 and PZ|1 to approximate the Maximum Mean Discrepancy ( MMD ) between these two distributions . If MMD ( PZ|0 , PZ|1 ; exp ) increases to saturation , the mutual information between z and n will increase . MMD ( PZ|0 , PZ|1 ; exp ) =Ez , z′∼PZ|0 [ e −∥z−z′∥2 ] −2Ez∼PZ|0 , z′∼PZ|1 [ e −∥z−z′∥2 ] +Ez , z′∼PZ|1 [ e −∥z−z′∥2 ] ( 3 ) We also employ a nuisance discriminator to observe the change of I ( z ; n ) during training . The details of this discriminator design and the proof of Theorem 2 can be found in the Appendix . NTL Optimization Objective . Based on the above analysis , we design our NTL optimization objective to increase I ( z ; n ) and extract nuisance-dependent representations . Specifically , we compute the MMD ( P , Q ; exp ) between representations of the source and auxiliary domain data and maximize it . For stability concern , we also set an upper bound to the MMD ( P , Q ; exp ) . Then , the overall optimization objective of NTL with distance expansion of representation is shaped as follows : Lntl = LS−max ( β , α ·LA ·Ldis ) , whereLdis = max ( β′ , α′ ·MMD ( Px∼PS X ( Φ ( x ) ) , Px∼PA X ( Φ ( x ) ) ; exp ) ( 4 ) Here , α′ and β′ represent the scaling factor and upper bound of Ldis respectively ( α′ = 0.1 and β′=1.0 in our experiments ; please refer to the Appendix for more details about α′ and β′ ) . Φ ( · ) is the feature extractor that outputs the corresponding representations of given inputs . When the target domain is known and accessible , it will be regarded as the auxiliary domain , and the above NTL with distance expansion of representation can be conducted directly on the source and auxiliary domains . We call such cases Target-Specified NTL .
Protecting the intellectual property of the trained models has received appealing attentions. Existing researches to protect intellectual property fall into two major categories: ownership verification and usage authorization. To this end, the authors propose to utilize non-transferable learning to achieve both the goal of ownership verification and usage authorization. Extensive experiments on several representative datasets validate the effectiveness of the proposed method in terms of ownership verification. Generally, this paper proposes a novel idea to address a practical problem in real-world applications, which could inspire many readers to follow it and have an important influence on the community of computer vision. I support the acceptance of this paper for a better ICLR conference.
SP:fc3be226cf3cdf2821f45e68c4a800d1337c7abc
NASViT: Neural Architecture Search for Efficient Vision Transformers with Gradient Conflict aware Supernet Training
1 INTRODUCTION . Transformers have recently been applied to various vision tasks , including image classification ( Liu et al. , 2021 ; Dong et al. , 2021 ; Bao et al. , 2021 ) , object detection ( Carion et al. , 2020 ; Zhu et al. , 2020 ) , semantic segmentation ( Xie et al. , 2021 ; Cheng et al. , 2021 ) , video understanding ( Bertasius et al. , 2021 ; Fan et al. , 2021 ) , etc . Vision transformers ( ViTs ) benefit from high model capacity , large receptive field , and grouping effect , etc ( Dosovitskiy et al. , 2020 ) , and demonstrate superior performance compared to convolutional neural networks ( CNNs ) especially with the scaling of the model size and training data size . For example , CoAtNet ( Dai et al. , 2021 ) achieves 90.88 % top-1 accuracy on Imagenet by scaling the model to 2586G FLOPs and pre-training the model on JFT-3B dataset ( Sun et al. , 2017 ) . Though promising in the high computation budget regime , the performance of ViTs is still inferior to that of the CNN counterparts on small- or medium-sized architectures , especially compared to CNN architectures that are highly optimized by neural architecture search ( NAS ) , e.g. , AlphaNet ( Wang et al. , 2021a ) , FBNetV3 ( Dai et al. , 2020 ) , etc . For example , the initial DeiT-Tiny ( Touvron et al. , 2020 ) only achieves 72.2 % top-1 accuracy with 1.2G FLOPs . The recently proposed LeViT ( Graham et al. , 2021 ) makes significant progress to achieve 76.6 % top-1 accuracy with 305M FLOPs with convolution/transformer hybrid architectures and a 3x longer training schedule . In contrast , AlphaNet ( Wang et al. , 2021a ) achieves 77.8 % top-1 accuracy with only 203M FLOPs . The large accuracy gap illustrated above raises a natural question : are transformer blocks that build large and dynamic receptive fields beneficial for small models ? To answer the question above , in this work , we target at developing a family of efficient ViTs with FLOPs ranging from 200M to 800M . A natural approach is to leverage NAS , which has achieved state-of-the-art ( SOTA ) accuracy-efficiency trade-off for CNNs ( Wang et al. , 2021a ; Dai et al. , 2020 ; Cai et al. , 2019 ) . The recently proposed supernet-based NAS , e.g. , BigNAS ( Yu et al. , 2020a ) and AlphaNet ( Wang et al. , 2021a ) , builds a weight-sharing graph including all the sub-networks in the architecture search space . A sandwich sampling rule with inplace knowledge distillation ( KD ) ( Yu et al. , 2018 ) is leveraged to simultaneously optimize the supernet and sub-networks for each mini-batch , which stabilizes the training and improves the training convergence . To leverage the supernet-based NAS , we first modify the LeViT model to build the architecture search space for ViTs and then jointly optimize the model architectures and parameters following AlphaNet . However , we find that directly applying AlphaNet achieves poor performance on the ViT search space , even worse compared to training single ViTs . To understand the root cause of the poor performance , we examine the supernet training procedure and observe that the gradients of the supernet and the different sub-networks conflict with each other during the sandwich sampling , which makes the training loss saturates much more quickly for ViTs , thus leading to slow convergence . To alleviate the issue of conflicting gradients , we propose three different techniques to improve the supernet training . Firstly , instead of directly adding the gradients from different sub-networks together , we find it beneficial to prioritize the training of the sub-networks over the supernet , as our main purpose is to build efficient sub-networks . We achieve this with a projection gradient algorithm which removes the component of the supernet gradient that is conflict with the sub-network gradient . Secondly , to alleviate the gradient conflicts among different sub-networks , we propose to augment each transformer layer with switchable channel-wise scaling layers . The weights of different scaling layers are not shared among different transformer blocks to reduce gradient conflicts . Thirdly , we propose to use a weak data augmentation scheme and reduce the regularization in training to decrease the optimization difficulty and hence reduce gradient conflicts . Our proposed techniques significantly alleviate the gradient conflict issue and empirically improve the convergence of supernet training . Compared to the baseline supernet training algorithm in AlphaNet , we can improve the top-1 accuracy to 78.2 % for the small model with 205M FLOPs and achieve 81.8 % for the large model with 757M FLOPs . Meanwhile , the resulting model family , NASViT , outperforms all the SOTA CNN and ViT models across a wide range of computation constraints . NASViT also demonstrates good performance on downstream tasks . When transferring to semantic segmentation tasks , NASViT backbones outperform previous CNN and ViT backbones on both Cityscape and ADE20K datasets , achieving 73.2 % and 37.9 % mIoU with 5G FLOPs , respectively . Related Works Recently , researchers have used supernet-based NAS to optimize the architecture for transformers . For example , HAT ( Han et al. , 2021 ) uses supernet for hardware-aware transformer optimization . HAT mainly focuses on NLP tasks and features a design space with heterogeneous transformer layers . AutoFormer ( Chen et al. , 2021a ) and ViTAS ( Su et al. , 2021 ) leverages supernetbased NAS to optimize the ViT architecture . By searching the width , depth , K/Q/V dimension , MLP ratio , etc , better accuracy is achieved compared to the baseline DeiT models ( Chen et al. , 2021a ) . However , these works focus on large ViT models with more than 1G FLOPs and their accuracy is still inferior to the CNN backbones with similar compute , e.g. , EfficientNet ( Tan & Le , 2019 ) . We refer readers to appendix for more discussions about related works . 2 NAS FOR EFFICIENT TRANSFORMERS . Our goal is to design efficient small- and medium-sized ViTs in the FLOPs regime from 200M to 800M . We build our search space inspired by the recently proposed LeViT ( Graham et al. , 2021 ) . LeViT is a family of efficient models leveraging a hybrid architecture of convolutions and transformers . In LeViT , the convolutions are introduced to handle high resolution inputs thanks to their efficiency from local computation while the transformers are leveraged for lower resolution features to extract global information . We closely follow LeViT to build our baseline search space ; see Figure 1 for an overview . Search Space We summarize the detailed search dimensions of our search space in Table 1 . For each CNN block , we directly follow the design in AlphaNet ( Wang et al. , 2021a ; b ) and search for the optimal channel widths , block depths , expansion ratios and kernel sizes ; for each transformer block , we search for the best number of windows , hidden feature dimensions ( denoted as Width in Table 1 ) 1 , depths and MLP expansion ratios . Compared to CNN blocks , one special search dimension 1Hidden feature dimension equals the number of heads times the feature dimension of each head . In our search space , we fix the head dimension to be 8 , and only searching for the number of heads . for transformer blocks is the number of windows k. When the number of windows k is greater than 1 , we follow Swin transformer ( Liu et al. , 2021 ) and partition the input tokens into k groups . We then compute the self-attention weights for each group separately to reduce computational cost . Standard global self-attention is a special case of k = 1 . In this work , we only search the number of windows for the first transformer block , as the input resolutions to the other transformer blocks are already small after 4 times of down-sampling . Similar to the search range of AlphaNet , the smallest sub-network in our search space has 190M FLOPs and the largest sub-network has FLOPs of 1,881M . we refer the reader to Appendix B for more description of our search space . Naive supernet-based NAS fails to find accurate ViTs We first closely follow the previous best practices in AlphaNet ( Wang et al. , 2021a ) for the supernet training . We train the supernet for 360 epochs on ImageNet ( Deng et al. , 2009 ) . At each training step , we adopt the sandwich sampling rule ( Yu et al. , 2018 ) and sample four sub-networks : the smallest sub-network , the supernet ( a.k.a . the largest sub-network ) , and two random sub-networks . All small sub-networks are supervised by the supernet with α-divergence-based KD ; see Algorithm 1 in Appendix C.1 for an overview of the supernet training procedure . Additionally , as our candidate networks contain transformer blocks , we further incorporate the best training recipe from LeViT ( Graham et al. , 2021 ) by replacing the SGD optimizer with Adam ( Kingma & Ba , 2014 ) and leveraging an external pre-trained teacher model for the best accuracy . Specifically , we use the pre-trained teacher to supervise the supernet and still constrain all other small sub-networks to learn from the supernet . In this work , we always use an EfficientNet-B5 ( Tan & Le , 2019 ) with 83.3 % top-1 accuracy on ImageNet as the teacher to train our ViT supernet unless otherwise specified . We plot the training curves of the smallest sub-network and the largest sub-network in Figure 2 . We find both the smallest sub-network and the largest sub-network from our search space converge poorly compared to the CNN baseline . Specifically , the validation accuracy of both the smallest and the largest sub-network is saturated at around the 250-th epoch , and the final accuracy is much worse than the CNN baselines . To understand the inferior model performance , we investigate the potential issues of our ViT supernet training from the following three directions . Investigation 1 : Is our search space designed badly ? We seek to understand if the performance gap is caused by a bad search space design . To verify , we randomly pick four sub-networks from the search space with computation cost ranging from 190M to 591M FLOPs . Then , we train these networks from scratch with the same data augmentation and regularization . As we can see from Table 2 , the sub-networks trained from scratch outperform the sub-networks sampled from the supernet . Note that from previous works ( e.g . Yu et al. , 2020a ) , supernet often learns more accurate sub-networks compared to the training from scratch performance , by taking advantage of inplace knowledge KD and weight-sharing . Our observations in Table 2 indicate that the poor performance does not come from the search space but from the interference with the training of the supernet . Investigation 2 : Are the training settings suitable for ViTs ? Our default training settings from AlphaNet are originally optimized for CNNs only . Compared with AlphaNet , recent ViT methods , e.g. , DeiT and LeViT , suggest to use stronger data augmentation schemes ( e.g. , a combination of CutMix ( Yun et al. , 2019 ) , Mixup ( Zhang et al. , 2017 ) , randaugment ( Cubuk et al. , 2020 ) , random erasing ( Zhong et al. , 2020 ) , and repeated augmentation ) and stronger regularization ( e.g. , large weight decay , large drop path probability ) for training . We evaluate the effectiveness of these ViT specific training recipes and summarize our findings in Table 3 . As we can see from Table 3 , DeiT- or LeViT-based training recipe produces even worse accuracy compared to the results from AlphaNet-based training . Investigation 3 : Saturated supernet training due to gradient conflicts ? Compared to the standard single network training , a major difference of supernet training is that multiple networks are sampled and trained at each step . We hypothesize that the training loss from the supernet and that from the sub-networks may yield conflicting gradients due to the heterogeneous and complex structures of networks , and the conflict gradients may consequently lead to slow convergence and undesirable performance . To verify this hypothesis , we compute the cosine similarity between the gradients from the supernet and the averaged gradients from the sub-networks . A negative cosine similarity indicates the supernet and sub-networks produce conflict gradients and tend to update model parameters in opposite directions . To quantitatively examine the gradient conflict issue , we go through the entire ImageNet training set and calculate the percentage of negative cosine similarity between the gradients of supernet and sub-networks among all training images at a per layer granularity . The gradients are computed under the same data augmentation and regularization as the supernet training stage . For AlphaNet , we train the model using its official code 2 . As shown in Table 4 , our ViT supernet suffers from more severe gradient conflicts compared to the CNN baseline . According to existing works in multi-task learning , large gradient conflict ratios may result in significant accuracy drop even for binary classification problems ( see Figure 3 in Du et al . ( 2018 ) and Figure 4 ( b ) in Yu et al . ( 2020b ) ) . We hypothesize that the inferior performance of our ViT supernet is mainly caused by the large percentage of disagreements between the supernet gradients and the subnetworks gradients .
This work presents the gradient conflict issue in ViT training, i.e., the gradients of sub-networks conflict with that of the supernet, leads to inferior performance of ViT supernet training. The authors fix this issue by 1) a gradient project method to prioritize the sub-network update; 2) Use switchable layers to increase the model capacities of sub-networks; 3) Simplify the training recipe. The proposed NASViT shows the state-of-the-art top-1 accuracy v.s. FLOPs trade-offs on ImageNet.
SP:41877cb2a05a7fdb6123f904778317f105db911b
NASViT: Neural Architecture Search for Efficient Vision Transformers with Gradient Conflict aware Supernet Training
1 INTRODUCTION . Transformers have recently been applied to various vision tasks , including image classification ( Liu et al. , 2021 ; Dong et al. , 2021 ; Bao et al. , 2021 ) , object detection ( Carion et al. , 2020 ; Zhu et al. , 2020 ) , semantic segmentation ( Xie et al. , 2021 ; Cheng et al. , 2021 ) , video understanding ( Bertasius et al. , 2021 ; Fan et al. , 2021 ) , etc . Vision transformers ( ViTs ) benefit from high model capacity , large receptive field , and grouping effect , etc ( Dosovitskiy et al. , 2020 ) , and demonstrate superior performance compared to convolutional neural networks ( CNNs ) especially with the scaling of the model size and training data size . For example , CoAtNet ( Dai et al. , 2021 ) achieves 90.88 % top-1 accuracy on Imagenet by scaling the model to 2586G FLOPs and pre-training the model on JFT-3B dataset ( Sun et al. , 2017 ) . Though promising in the high computation budget regime , the performance of ViTs is still inferior to that of the CNN counterparts on small- or medium-sized architectures , especially compared to CNN architectures that are highly optimized by neural architecture search ( NAS ) , e.g. , AlphaNet ( Wang et al. , 2021a ) , FBNetV3 ( Dai et al. , 2020 ) , etc . For example , the initial DeiT-Tiny ( Touvron et al. , 2020 ) only achieves 72.2 % top-1 accuracy with 1.2G FLOPs . The recently proposed LeViT ( Graham et al. , 2021 ) makes significant progress to achieve 76.6 % top-1 accuracy with 305M FLOPs with convolution/transformer hybrid architectures and a 3x longer training schedule . In contrast , AlphaNet ( Wang et al. , 2021a ) achieves 77.8 % top-1 accuracy with only 203M FLOPs . The large accuracy gap illustrated above raises a natural question : are transformer blocks that build large and dynamic receptive fields beneficial for small models ? To answer the question above , in this work , we target at developing a family of efficient ViTs with FLOPs ranging from 200M to 800M . A natural approach is to leverage NAS , which has achieved state-of-the-art ( SOTA ) accuracy-efficiency trade-off for CNNs ( Wang et al. , 2021a ; Dai et al. , 2020 ; Cai et al. , 2019 ) . The recently proposed supernet-based NAS , e.g. , BigNAS ( Yu et al. , 2020a ) and AlphaNet ( Wang et al. , 2021a ) , builds a weight-sharing graph including all the sub-networks in the architecture search space . A sandwich sampling rule with inplace knowledge distillation ( KD ) ( Yu et al. , 2018 ) is leveraged to simultaneously optimize the supernet and sub-networks for each mini-batch , which stabilizes the training and improves the training convergence . To leverage the supernet-based NAS , we first modify the LeViT model to build the architecture search space for ViTs and then jointly optimize the model architectures and parameters following AlphaNet . However , we find that directly applying AlphaNet achieves poor performance on the ViT search space , even worse compared to training single ViTs . To understand the root cause of the poor performance , we examine the supernet training procedure and observe that the gradients of the supernet and the different sub-networks conflict with each other during the sandwich sampling , which makes the training loss saturates much more quickly for ViTs , thus leading to slow convergence . To alleviate the issue of conflicting gradients , we propose three different techniques to improve the supernet training . Firstly , instead of directly adding the gradients from different sub-networks together , we find it beneficial to prioritize the training of the sub-networks over the supernet , as our main purpose is to build efficient sub-networks . We achieve this with a projection gradient algorithm which removes the component of the supernet gradient that is conflict with the sub-network gradient . Secondly , to alleviate the gradient conflicts among different sub-networks , we propose to augment each transformer layer with switchable channel-wise scaling layers . The weights of different scaling layers are not shared among different transformer blocks to reduce gradient conflicts . Thirdly , we propose to use a weak data augmentation scheme and reduce the regularization in training to decrease the optimization difficulty and hence reduce gradient conflicts . Our proposed techniques significantly alleviate the gradient conflict issue and empirically improve the convergence of supernet training . Compared to the baseline supernet training algorithm in AlphaNet , we can improve the top-1 accuracy to 78.2 % for the small model with 205M FLOPs and achieve 81.8 % for the large model with 757M FLOPs . Meanwhile , the resulting model family , NASViT , outperforms all the SOTA CNN and ViT models across a wide range of computation constraints . NASViT also demonstrates good performance on downstream tasks . When transferring to semantic segmentation tasks , NASViT backbones outperform previous CNN and ViT backbones on both Cityscape and ADE20K datasets , achieving 73.2 % and 37.9 % mIoU with 5G FLOPs , respectively . Related Works Recently , researchers have used supernet-based NAS to optimize the architecture for transformers . For example , HAT ( Han et al. , 2021 ) uses supernet for hardware-aware transformer optimization . HAT mainly focuses on NLP tasks and features a design space with heterogeneous transformer layers . AutoFormer ( Chen et al. , 2021a ) and ViTAS ( Su et al. , 2021 ) leverages supernetbased NAS to optimize the ViT architecture . By searching the width , depth , K/Q/V dimension , MLP ratio , etc , better accuracy is achieved compared to the baseline DeiT models ( Chen et al. , 2021a ) . However , these works focus on large ViT models with more than 1G FLOPs and their accuracy is still inferior to the CNN backbones with similar compute , e.g. , EfficientNet ( Tan & Le , 2019 ) . We refer readers to appendix for more discussions about related works . 2 NAS FOR EFFICIENT TRANSFORMERS . Our goal is to design efficient small- and medium-sized ViTs in the FLOPs regime from 200M to 800M . We build our search space inspired by the recently proposed LeViT ( Graham et al. , 2021 ) . LeViT is a family of efficient models leveraging a hybrid architecture of convolutions and transformers . In LeViT , the convolutions are introduced to handle high resolution inputs thanks to their efficiency from local computation while the transformers are leveraged for lower resolution features to extract global information . We closely follow LeViT to build our baseline search space ; see Figure 1 for an overview . Search Space We summarize the detailed search dimensions of our search space in Table 1 . For each CNN block , we directly follow the design in AlphaNet ( Wang et al. , 2021a ; b ) and search for the optimal channel widths , block depths , expansion ratios and kernel sizes ; for each transformer block , we search for the best number of windows , hidden feature dimensions ( denoted as Width in Table 1 ) 1 , depths and MLP expansion ratios . Compared to CNN blocks , one special search dimension 1Hidden feature dimension equals the number of heads times the feature dimension of each head . In our search space , we fix the head dimension to be 8 , and only searching for the number of heads . for transformer blocks is the number of windows k. When the number of windows k is greater than 1 , we follow Swin transformer ( Liu et al. , 2021 ) and partition the input tokens into k groups . We then compute the self-attention weights for each group separately to reduce computational cost . Standard global self-attention is a special case of k = 1 . In this work , we only search the number of windows for the first transformer block , as the input resolutions to the other transformer blocks are already small after 4 times of down-sampling . Similar to the search range of AlphaNet , the smallest sub-network in our search space has 190M FLOPs and the largest sub-network has FLOPs of 1,881M . we refer the reader to Appendix B for more description of our search space . Naive supernet-based NAS fails to find accurate ViTs We first closely follow the previous best practices in AlphaNet ( Wang et al. , 2021a ) for the supernet training . We train the supernet for 360 epochs on ImageNet ( Deng et al. , 2009 ) . At each training step , we adopt the sandwich sampling rule ( Yu et al. , 2018 ) and sample four sub-networks : the smallest sub-network , the supernet ( a.k.a . the largest sub-network ) , and two random sub-networks . All small sub-networks are supervised by the supernet with α-divergence-based KD ; see Algorithm 1 in Appendix C.1 for an overview of the supernet training procedure . Additionally , as our candidate networks contain transformer blocks , we further incorporate the best training recipe from LeViT ( Graham et al. , 2021 ) by replacing the SGD optimizer with Adam ( Kingma & Ba , 2014 ) and leveraging an external pre-trained teacher model for the best accuracy . Specifically , we use the pre-trained teacher to supervise the supernet and still constrain all other small sub-networks to learn from the supernet . In this work , we always use an EfficientNet-B5 ( Tan & Le , 2019 ) with 83.3 % top-1 accuracy on ImageNet as the teacher to train our ViT supernet unless otherwise specified . We plot the training curves of the smallest sub-network and the largest sub-network in Figure 2 . We find both the smallest sub-network and the largest sub-network from our search space converge poorly compared to the CNN baseline . Specifically , the validation accuracy of both the smallest and the largest sub-network is saturated at around the 250-th epoch , and the final accuracy is much worse than the CNN baselines . To understand the inferior model performance , we investigate the potential issues of our ViT supernet training from the following three directions . Investigation 1 : Is our search space designed badly ? We seek to understand if the performance gap is caused by a bad search space design . To verify , we randomly pick four sub-networks from the search space with computation cost ranging from 190M to 591M FLOPs . Then , we train these networks from scratch with the same data augmentation and regularization . As we can see from Table 2 , the sub-networks trained from scratch outperform the sub-networks sampled from the supernet . Note that from previous works ( e.g . Yu et al. , 2020a ) , supernet often learns more accurate sub-networks compared to the training from scratch performance , by taking advantage of inplace knowledge KD and weight-sharing . Our observations in Table 2 indicate that the poor performance does not come from the search space but from the interference with the training of the supernet . Investigation 2 : Are the training settings suitable for ViTs ? Our default training settings from AlphaNet are originally optimized for CNNs only . Compared with AlphaNet , recent ViT methods , e.g. , DeiT and LeViT , suggest to use stronger data augmentation schemes ( e.g. , a combination of CutMix ( Yun et al. , 2019 ) , Mixup ( Zhang et al. , 2017 ) , randaugment ( Cubuk et al. , 2020 ) , random erasing ( Zhong et al. , 2020 ) , and repeated augmentation ) and stronger regularization ( e.g. , large weight decay , large drop path probability ) for training . We evaluate the effectiveness of these ViT specific training recipes and summarize our findings in Table 3 . As we can see from Table 3 , DeiT- or LeViT-based training recipe produces even worse accuracy compared to the results from AlphaNet-based training . Investigation 3 : Saturated supernet training due to gradient conflicts ? Compared to the standard single network training , a major difference of supernet training is that multiple networks are sampled and trained at each step . We hypothesize that the training loss from the supernet and that from the sub-networks may yield conflicting gradients due to the heterogeneous and complex structures of networks , and the conflict gradients may consequently lead to slow convergence and undesirable performance . To verify this hypothesis , we compute the cosine similarity between the gradients from the supernet and the averaged gradients from the sub-networks . A negative cosine similarity indicates the supernet and sub-networks produce conflict gradients and tend to update model parameters in opposite directions . To quantitatively examine the gradient conflict issue , we go through the entire ImageNet training set and calculate the percentage of negative cosine similarity between the gradients of supernet and sub-networks among all training images at a per layer granularity . The gradients are computed under the same data augmentation and regularization as the supernet training stage . For AlphaNet , we train the model using its official code 2 . As shown in Table 4 , our ViT supernet suffers from more severe gradient conflicts compared to the CNN baseline . According to existing works in multi-task learning , large gradient conflict ratios may result in significant accuracy drop even for binary classification problems ( see Figure 3 in Du et al . ( 2018 ) and Figure 4 ( b ) in Yu et al . ( 2020b ) ) . We hypothesize that the inferior performance of our ViT supernet is mainly caused by the large percentage of disagreements between the supernet gradients and the subnetworks gradients .
The paper proposes a NAS algorithm for vision transformers. The search space contains both CNN blocks and transformer blocks. The authors solve the gradient conflict dilemma in this process and find out a good architecture. Experiments on classification and segmentation show its effectiveness over other vison transformers like swin, cvt, etc.
SP:41877cb2a05a7fdb6123f904778317f105db911b
NASViT: Neural Architecture Search for Efficient Vision Transformers with Gradient Conflict aware Supernet Training
1 INTRODUCTION . Transformers have recently been applied to various vision tasks , including image classification ( Liu et al. , 2021 ; Dong et al. , 2021 ; Bao et al. , 2021 ) , object detection ( Carion et al. , 2020 ; Zhu et al. , 2020 ) , semantic segmentation ( Xie et al. , 2021 ; Cheng et al. , 2021 ) , video understanding ( Bertasius et al. , 2021 ; Fan et al. , 2021 ) , etc . Vision transformers ( ViTs ) benefit from high model capacity , large receptive field , and grouping effect , etc ( Dosovitskiy et al. , 2020 ) , and demonstrate superior performance compared to convolutional neural networks ( CNNs ) especially with the scaling of the model size and training data size . For example , CoAtNet ( Dai et al. , 2021 ) achieves 90.88 % top-1 accuracy on Imagenet by scaling the model to 2586G FLOPs and pre-training the model on JFT-3B dataset ( Sun et al. , 2017 ) . Though promising in the high computation budget regime , the performance of ViTs is still inferior to that of the CNN counterparts on small- or medium-sized architectures , especially compared to CNN architectures that are highly optimized by neural architecture search ( NAS ) , e.g. , AlphaNet ( Wang et al. , 2021a ) , FBNetV3 ( Dai et al. , 2020 ) , etc . For example , the initial DeiT-Tiny ( Touvron et al. , 2020 ) only achieves 72.2 % top-1 accuracy with 1.2G FLOPs . The recently proposed LeViT ( Graham et al. , 2021 ) makes significant progress to achieve 76.6 % top-1 accuracy with 305M FLOPs with convolution/transformer hybrid architectures and a 3x longer training schedule . In contrast , AlphaNet ( Wang et al. , 2021a ) achieves 77.8 % top-1 accuracy with only 203M FLOPs . The large accuracy gap illustrated above raises a natural question : are transformer blocks that build large and dynamic receptive fields beneficial for small models ? To answer the question above , in this work , we target at developing a family of efficient ViTs with FLOPs ranging from 200M to 800M . A natural approach is to leverage NAS , which has achieved state-of-the-art ( SOTA ) accuracy-efficiency trade-off for CNNs ( Wang et al. , 2021a ; Dai et al. , 2020 ; Cai et al. , 2019 ) . The recently proposed supernet-based NAS , e.g. , BigNAS ( Yu et al. , 2020a ) and AlphaNet ( Wang et al. , 2021a ) , builds a weight-sharing graph including all the sub-networks in the architecture search space . A sandwich sampling rule with inplace knowledge distillation ( KD ) ( Yu et al. , 2018 ) is leveraged to simultaneously optimize the supernet and sub-networks for each mini-batch , which stabilizes the training and improves the training convergence . To leverage the supernet-based NAS , we first modify the LeViT model to build the architecture search space for ViTs and then jointly optimize the model architectures and parameters following AlphaNet . However , we find that directly applying AlphaNet achieves poor performance on the ViT search space , even worse compared to training single ViTs . To understand the root cause of the poor performance , we examine the supernet training procedure and observe that the gradients of the supernet and the different sub-networks conflict with each other during the sandwich sampling , which makes the training loss saturates much more quickly for ViTs , thus leading to slow convergence . To alleviate the issue of conflicting gradients , we propose three different techniques to improve the supernet training . Firstly , instead of directly adding the gradients from different sub-networks together , we find it beneficial to prioritize the training of the sub-networks over the supernet , as our main purpose is to build efficient sub-networks . We achieve this with a projection gradient algorithm which removes the component of the supernet gradient that is conflict with the sub-network gradient . Secondly , to alleviate the gradient conflicts among different sub-networks , we propose to augment each transformer layer with switchable channel-wise scaling layers . The weights of different scaling layers are not shared among different transformer blocks to reduce gradient conflicts . Thirdly , we propose to use a weak data augmentation scheme and reduce the regularization in training to decrease the optimization difficulty and hence reduce gradient conflicts . Our proposed techniques significantly alleviate the gradient conflict issue and empirically improve the convergence of supernet training . Compared to the baseline supernet training algorithm in AlphaNet , we can improve the top-1 accuracy to 78.2 % for the small model with 205M FLOPs and achieve 81.8 % for the large model with 757M FLOPs . Meanwhile , the resulting model family , NASViT , outperforms all the SOTA CNN and ViT models across a wide range of computation constraints . NASViT also demonstrates good performance on downstream tasks . When transferring to semantic segmentation tasks , NASViT backbones outperform previous CNN and ViT backbones on both Cityscape and ADE20K datasets , achieving 73.2 % and 37.9 % mIoU with 5G FLOPs , respectively . Related Works Recently , researchers have used supernet-based NAS to optimize the architecture for transformers . For example , HAT ( Han et al. , 2021 ) uses supernet for hardware-aware transformer optimization . HAT mainly focuses on NLP tasks and features a design space with heterogeneous transformer layers . AutoFormer ( Chen et al. , 2021a ) and ViTAS ( Su et al. , 2021 ) leverages supernetbased NAS to optimize the ViT architecture . By searching the width , depth , K/Q/V dimension , MLP ratio , etc , better accuracy is achieved compared to the baseline DeiT models ( Chen et al. , 2021a ) . However , these works focus on large ViT models with more than 1G FLOPs and their accuracy is still inferior to the CNN backbones with similar compute , e.g. , EfficientNet ( Tan & Le , 2019 ) . We refer readers to appendix for more discussions about related works . 2 NAS FOR EFFICIENT TRANSFORMERS . Our goal is to design efficient small- and medium-sized ViTs in the FLOPs regime from 200M to 800M . We build our search space inspired by the recently proposed LeViT ( Graham et al. , 2021 ) . LeViT is a family of efficient models leveraging a hybrid architecture of convolutions and transformers . In LeViT , the convolutions are introduced to handle high resolution inputs thanks to their efficiency from local computation while the transformers are leveraged for lower resolution features to extract global information . We closely follow LeViT to build our baseline search space ; see Figure 1 for an overview . Search Space We summarize the detailed search dimensions of our search space in Table 1 . For each CNN block , we directly follow the design in AlphaNet ( Wang et al. , 2021a ; b ) and search for the optimal channel widths , block depths , expansion ratios and kernel sizes ; for each transformer block , we search for the best number of windows , hidden feature dimensions ( denoted as Width in Table 1 ) 1 , depths and MLP expansion ratios . Compared to CNN blocks , one special search dimension 1Hidden feature dimension equals the number of heads times the feature dimension of each head . In our search space , we fix the head dimension to be 8 , and only searching for the number of heads . for transformer blocks is the number of windows k. When the number of windows k is greater than 1 , we follow Swin transformer ( Liu et al. , 2021 ) and partition the input tokens into k groups . We then compute the self-attention weights for each group separately to reduce computational cost . Standard global self-attention is a special case of k = 1 . In this work , we only search the number of windows for the first transformer block , as the input resolutions to the other transformer blocks are already small after 4 times of down-sampling . Similar to the search range of AlphaNet , the smallest sub-network in our search space has 190M FLOPs and the largest sub-network has FLOPs of 1,881M . we refer the reader to Appendix B for more description of our search space . Naive supernet-based NAS fails to find accurate ViTs We first closely follow the previous best practices in AlphaNet ( Wang et al. , 2021a ) for the supernet training . We train the supernet for 360 epochs on ImageNet ( Deng et al. , 2009 ) . At each training step , we adopt the sandwich sampling rule ( Yu et al. , 2018 ) and sample four sub-networks : the smallest sub-network , the supernet ( a.k.a . the largest sub-network ) , and two random sub-networks . All small sub-networks are supervised by the supernet with α-divergence-based KD ; see Algorithm 1 in Appendix C.1 for an overview of the supernet training procedure . Additionally , as our candidate networks contain transformer blocks , we further incorporate the best training recipe from LeViT ( Graham et al. , 2021 ) by replacing the SGD optimizer with Adam ( Kingma & Ba , 2014 ) and leveraging an external pre-trained teacher model for the best accuracy . Specifically , we use the pre-trained teacher to supervise the supernet and still constrain all other small sub-networks to learn from the supernet . In this work , we always use an EfficientNet-B5 ( Tan & Le , 2019 ) with 83.3 % top-1 accuracy on ImageNet as the teacher to train our ViT supernet unless otherwise specified . We plot the training curves of the smallest sub-network and the largest sub-network in Figure 2 . We find both the smallest sub-network and the largest sub-network from our search space converge poorly compared to the CNN baseline . Specifically , the validation accuracy of both the smallest and the largest sub-network is saturated at around the 250-th epoch , and the final accuracy is much worse than the CNN baselines . To understand the inferior model performance , we investigate the potential issues of our ViT supernet training from the following three directions . Investigation 1 : Is our search space designed badly ? We seek to understand if the performance gap is caused by a bad search space design . To verify , we randomly pick four sub-networks from the search space with computation cost ranging from 190M to 591M FLOPs . Then , we train these networks from scratch with the same data augmentation and regularization . As we can see from Table 2 , the sub-networks trained from scratch outperform the sub-networks sampled from the supernet . Note that from previous works ( e.g . Yu et al. , 2020a ) , supernet often learns more accurate sub-networks compared to the training from scratch performance , by taking advantage of inplace knowledge KD and weight-sharing . Our observations in Table 2 indicate that the poor performance does not come from the search space but from the interference with the training of the supernet . Investigation 2 : Are the training settings suitable for ViTs ? Our default training settings from AlphaNet are originally optimized for CNNs only . Compared with AlphaNet , recent ViT methods , e.g. , DeiT and LeViT , suggest to use stronger data augmentation schemes ( e.g. , a combination of CutMix ( Yun et al. , 2019 ) , Mixup ( Zhang et al. , 2017 ) , randaugment ( Cubuk et al. , 2020 ) , random erasing ( Zhong et al. , 2020 ) , and repeated augmentation ) and stronger regularization ( e.g. , large weight decay , large drop path probability ) for training . We evaluate the effectiveness of these ViT specific training recipes and summarize our findings in Table 3 . As we can see from Table 3 , DeiT- or LeViT-based training recipe produces even worse accuracy compared to the results from AlphaNet-based training . Investigation 3 : Saturated supernet training due to gradient conflicts ? Compared to the standard single network training , a major difference of supernet training is that multiple networks are sampled and trained at each step . We hypothesize that the training loss from the supernet and that from the sub-networks may yield conflicting gradients due to the heterogeneous and complex structures of networks , and the conflict gradients may consequently lead to slow convergence and undesirable performance . To verify this hypothesis , we compute the cosine similarity between the gradients from the supernet and the averaged gradients from the sub-networks . A negative cosine similarity indicates the supernet and sub-networks produce conflict gradients and tend to update model parameters in opposite directions . To quantitatively examine the gradient conflict issue , we go through the entire ImageNet training set and calculate the percentage of negative cosine similarity between the gradients of supernet and sub-networks among all training images at a per layer granularity . The gradients are computed under the same data augmentation and regularization as the supernet training stage . For AlphaNet , we train the model using its official code 2 . As shown in Table 4 , our ViT supernet suffers from more severe gradient conflicts compared to the CNN baseline . According to existing works in multi-task learning , large gradient conflict ratios may result in significant accuracy drop even for binary classification problems ( see Figure 3 in Du et al . ( 2018 ) and Figure 4 ( b ) in Yu et al . ( 2020b ) ) . We hypothesize that the inferior performance of our ViT supernet is mainly caused by the large percentage of disagreements between the supernet gradients and the subnetworks gradients .
This paper aims at applying one-shot Neural Architecture Search (NAS) to Vision Transformers (ViTs). The authors claim that directly using existing CNN based NAS method to ViTs will lead to a gradient conflict issue. In order to tackle this issue, the authors propose three techniques, including a gradient projection, a switchable layer scaling, and a data augmentation. The experimental results demonstrate the effectiveness of the proposed method to some extent.
SP:41877cb2a05a7fdb6123f904778317f105db911b
Distilling GANs with Style-Mixed Triplets for X2I Translation with Limited Data
1 INTRODUCTION . Conditional image synthesis , also X2I translation , maps from an input domain ( e.g . text , audio , segmentation maps , etc . ) to the image domain . Benefiting from GANs ( Goodfellow et al. , 2014 ) and its follow-up improved versions ( Gulrajani et al. , 2017 ; Kang & Park , 2020 ; Salimans et al. , 2016 ) , they obtain remarkable performance on a wide variety of image synthesis tasks : image to image ( I2I ) ( Lee et al. , 2018 ; Zhu et al. , 2017 ) , audio to image ( Chen et al. , 2017 ; Wang et al. , 2020a ) , text to image ( Hu et al. , 2021 ; Li et al. , 2019 ; 2020 ; Radford et al. , 2021 ; Zhang et al. , 2017a ) and semantic segmentation map to image ( Isola et al. , 2017 ; Wang et al. , 2018 ) . Despite impressive leaps forward for a variety of image synthesis tasks , there are still important challenges . Specifically , to obtain good results , existing works rely on large labelled datasets . Labeling these datasets is both laborious and time-consuming , considerably reducing the practical impact of these methods . It is noteworthy to observe that many of these models ( Zhang et al. , 2017a ) apply transfer learning to the text and audio encoders ( e.g . using a pretrained LSTM ( Reed et al. , 2016 ) model for text and pretrained GRU ( Merkx et al. , 2019 ) model for audio ) , however they train the image synthesis decoder from scratch . This happens because there are no established methods to transfer pretrained GANs to conditional image decoders ; an omission which we aim to address in this paper . In this paper , we investigate knowledge transfer for a variety of conditional image synthesis tasks . Traditional knowledge transfer for conditional image synthesis is often not possible , because there might not be a pretrained network available for the desired translation task ( e.g . at the moment no high-quality pretrained network for segmentation map-to-image translation is available ) . It would therefore be preferable if the wide variety of high-quality GANs available for image generation could be exploited for X2I . Recent works ( Wang et al. , 2021 ; 2020b ) leveraged a pretrained GAN to initialize an I2I translation model , managing to transfer knowledge to different image synthesis tasks . These methods , however , suffer from three problems : ( I ) They can only be used for I2I translation and do not generalize to other conditional image synthesis tasks . ( II ) They are GAN architecture-specific approaches , requiring the GAN architecture within the X2I system to be exactly the same as that of the pretrained GAN . This limits transfer to current state-of-the-art X2I systems for which no similar GAN architecture exists ( like for example StarGANv2 ( Choi et al. , 2020 ) for I2I ) . ( III ) X2I systems are based on a conditional GAN , however existing methods for knowledge transfer for I2I do not initialize the conditional branch during the transfer , and therefore this has to be learned from scratch during the finetuning on the target dataset . Learning this on small target datasets can be problematic . To address the aforementioned problems , we propose several improvements for knowledge transfer to X2I systems : ( I ) we are the first to investigate knowledge transfer for X2I translation . Therefore , we propose a novel , unified transfer learning method , which can be used for varying kinds of conditional image synthesis tasks ( Figure 1 ) which is based on generated images and therefore does not require any real data . ( II ) The student generator does not need to have the same architecture as the pretrained GAN . Therefore , we can use well-devised specific image synthesis architectures ( e.g. , SPADE ( Park et al. , 2019 ) and StarGANv2 ( Choi et al. , 2020 ) ) by distilling knowledge from the pretrained teacher GAN ( e.g. , StyleGAN ) to the task-specific student GAN . ( III ) We use the style mixing characteristic of StyleGAN to create style-mixed triplet data , which are used to transfer the knowledge efficiently to both I2I and X2I translation models . Furthermore , we propose a semantic diversity loss based on the style-mixed triplet , which contributes to learn the semantic information of the output image . We perform experiments on a wide variety of image synthesis tasks , including text-to-image , audioto-image , segmentation map-to-image and I2I translations . We demonstrate the efficiency of the proposed knowledge distillation method , providing qualitative and quantitative results . We prove that the single pretrained GAN model can be universally used in varying specific task model . Additionally , leveraging the style mixing character of StyleGAN , further improves I2I translation performance . 2 RELATED WORK . GAN-based Conditional Image Synthesis . Benefiting from the advances in GANs and its variants in recent years , conditional image synthesis ( also called X2I translation ) research has developed rapidly . Two typical approaches have been investigated for GAN-based image synthesis , namely , unsupervised ( Kim et al. , 2017 ; Yi et al. , 2017 ) and supervised image generation ( Park et al. , 2019 ; Zhang et al. , 2017b ) . The latter inputs conditional information ( e.g . text , audio , image , segmentation map etc . ) to synthesize images which contain the corresponding semantic information ( i.e . the conditional information ) . Specifically , text-to-image translation ( Hu et al. , 2021 ; Li et al. , 2020 ; Zhang et al. , 2017a ) aims to synthesize high-realistic images which are semantically consistent with the text descriptions . Recent work ( Hu et al. , 2021 ) introduces semantic-spatial batch normalization to better exploit the text information . Similar to text-to-image translation , both audio-to-image translation ( Chen et al. , 2017 ; Wang et al. , 2020a ) and segmentation map-to-image translation ( Bau et al. , 2020 ; Park et al. , 2019 ) aim to learn a mapping from the audio/segmentation map to the output image . Different to the above image synthesis tasks , image-to-image translation ( Park et al. , 2020 ; Zhu et al. , 2017 ) performs projection from the source to the target image domain . In this paper , we explore transfer learning from GANs to a variation of conditional image synthesis tasks . Transfer learning . A considerable research effort has investigated transferring knowledge for both discriminative ( Donahue et al. , 2014 ; Hinton et al. , 2014 ) and generative tasks ( Noguchi & Harada , 2019 ; Zhao et al. , 2020 ) . There also exist several approaches ( Goetschalckx et al. , 2019 ; Jahanian et al. , 2020 ) which focus on the image manipulation based on the pretrained GAN . Given a target semantic attribute they aim to manipulate the output image of a pretrained GAN . However , these methods do not focus on transfer learning for target data . Some other methods ( Abdal et al. , 2019 ; Zhu et al. , 2020a ) reverse the given image into the input latent space of the pretrained GAN ( e.g. , StyleGAN ) , and manage to restructure the target image by optimization of the latent representation . Recent work ( Shocher et al. , 2020 ; Wang et al. , 2021 ; 2020b ) performed knowledge transfer from a pretrained classification model ( e.g. , VGG ( Simonyan & Zisserman , 2014 ) ) or the discriminator ( BigGAN ( Brock et al. , 2019 ) ) for I2I translation . However , both DeepI2I ( Wang et al. , 2020b ) and TransferI2I ( Wang et al. , 2021 ) require that the GAN architecture is identical with the generator used in the I2I architecture . As a consequence , these methods can not be applied to well-designed I2I translation architectures ( like starGANv2 ( Choi et al. , 2020 ) ) since they do not use a standard GAN architecture . The proposed method could address these problems . 3 KNOWLEDGE TRANSFER FOR X2I . Problem setting . Our goal is to transfer knowledge from a pretrained high-quality unconditional GAN to an X2I translation system for the case when training data is limited . The proposed method consist of two stages . In the first stage we perform the data-free knowledge transfer method explained in Sec . 3.2 and 3.3 . This stage does not require any target data . In the second stage , we apply a standard finetuning of this distilled model on the target dataset . Distillation can be used to perform knowledge transfer to other architectures , however , there is little target data available . Fortunately , the pretrained GAN can generate infinite data for data distillation , meaning that we do not require access to any real data ( i.e. , data-free ) . Also , we transfer knowledge from an unconditional GAN ( e.g. , StyleGAN ) to a conditional GAN ( e.g. , I2I translation ) ; requiring us to propose techniques to initialize the conditional branch . Exploiting the style-mixed characteristic ( Sec . 3.1 ) of StyleGAN we propose two solutions : one for I2I ( Sec . 3.2 ) and another one for X2I ( Sec . 3.3 ) . Our method consists of two stages : ( 1 ) transfer leaning without any real data ( i.e. , style-mixed triplets in Sec . 3.1 , I2I translation in Sec . 3.2 and X2I translation in Sec . 3.3 ) and ( 2 ) finetunning with the real target data . 3.1 STYLE-MIXED TRIPLETS Benefiting from the style mixing ( ( Figure 2 ( a ) ) ) characteristic of StyleGAN , we are able to create an infinite amount of triplet images from any of the two domains . Let zt ∈ RZ indicates the input noise of the pretrained generator GT ( teacher ) . given the input noises z1t and z 2 t , the mapping network MT of the StyleGAN generator encodes them to a style vector s1t = MT ( z 1 t ) and s 2 t = MT ( z 2 t ) . We define GT ( z ) = G′T ( MT ( z ) ) where G ′ T takes styles vectors as an input to each of its layers . We further feed these style vectors to the teacher generator G′T to output x 1 t = G ′ T ( s 1 t ) and x 2 t = G′T ( s 2 t ) ( where x 1 t , x 2 t ∈ X and image domain X = RH×W×3 ) respectively . Here the function Φ ( s1t , s 2 t ) selects to forward s 1 t to the layers of G ′ T important for the content of the generated image ( the bottom layers ) , and s2t to those important for the style ( the top layers ) 1 . Interestingly , a new image yt = G′T ( Φ ( s 1 t , s 2 t ) ) ( where yt ∈ Y and image domain Y = RH×W×3 ) contains mixed information with respect to content and style of both inputs x1t and x 2 t . Based on this observation above , we propose to leverage these style-mixed triplets ( x1t , x 2 t , yt ) to perform distillation for the I2I and X2I translation models without the need of any real triplet training data . 2
The work introduces a flexible method to distill the knowledge of unconditional GANs of images to various image translation tasks, including image-to-image, text-to-image, and audio-to-image translation. While prior work requires using the same architecture of the pre-trained GANs to train the downstream im2im tasks, the proposed method supports distillation on a wide range of X-to-image translation architectures (e.g. starGANv2). The authors have compared their methods with prior work and showed that the proposed method obtained better FIDs.
SP:d59e17faaba144ea4e55c1d77849bc21c19eeff7
Distilling GANs with Style-Mixed Triplets for X2I Translation with Limited Data
1 INTRODUCTION . Conditional image synthesis , also X2I translation , maps from an input domain ( e.g . text , audio , segmentation maps , etc . ) to the image domain . Benefiting from GANs ( Goodfellow et al. , 2014 ) and its follow-up improved versions ( Gulrajani et al. , 2017 ; Kang & Park , 2020 ; Salimans et al. , 2016 ) , they obtain remarkable performance on a wide variety of image synthesis tasks : image to image ( I2I ) ( Lee et al. , 2018 ; Zhu et al. , 2017 ) , audio to image ( Chen et al. , 2017 ; Wang et al. , 2020a ) , text to image ( Hu et al. , 2021 ; Li et al. , 2019 ; 2020 ; Radford et al. , 2021 ; Zhang et al. , 2017a ) and semantic segmentation map to image ( Isola et al. , 2017 ; Wang et al. , 2018 ) . Despite impressive leaps forward for a variety of image synthesis tasks , there are still important challenges . Specifically , to obtain good results , existing works rely on large labelled datasets . Labeling these datasets is both laborious and time-consuming , considerably reducing the practical impact of these methods . It is noteworthy to observe that many of these models ( Zhang et al. , 2017a ) apply transfer learning to the text and audio encoders ( e.g . using a pretrained LSTM ( Reed et al. , 2016 ) model for text and pretrained GRU ( Merkx et al. , 2019 ) model for audio ) , however they train the image synthesis decoder from scratch . This happens because there are no established methods to transfer pretrained GANs to conditional image decoders ; an omission which we aim to address in this paper . In this paper , we investigate knowledge transfer for a variety of conditional image synthesis tasks . Traditional knowledge transfer for conditional image synthesis is often not possible , because there might not be a pretrained network available for the desired translation task ( e.g . at the moment no high-quality pretrained network for segmentation map-to-image translation is available ) . It would therefore be preferable if the wide variety of high-quality GANs available for image generation could be exploited for X2I . Recent works ( Wang et al. , 2021 ; 2020b ) leveraged a pretrained GAN to initialize an I2I translation model , managing to transfer knowledge to different image synthesis tasks . These methods , however , suffer from three problems : ( I ) They can only be used for I2I translation and do not generalize to other conditional image synthesis tasks . ( II ) They are GAN architecture-specific approaches , requiring the GAN architecture within the X2I system to be exactly the same as that of the pretrained GAN . This limits transfer to current state-of-the-art X2I systems for which no similar GAN architecture exists ( like for example StarGANv2 ( Choi et al. , 2020 ) for I2I ) . ( III ) X2I systems are based on a conditional GAN , however existing methods for knowledge transfer for I2I do not initialize the conditional branch during the transfer , and therefore this has to be learned from scratch during the finetuning on the target dataset . Learning this on small target datasets can be problematic . To address the aforementioned problems , we propose several improvements for knowledge transfer to X2I systems : ( I ) we are the first to investigate knowledge transfer for X2I translation . Therefore , we propose a novel , unified transfer learning method , which can be used for varying kinds of conditional image synthesis tasks ( Figure 1 ) which is based on generated images and therefore does not require any real data . ( II ) The student generator does not need to have the same architecture as the pretrained GAN . Therefore , we can use well-devised specific image synthesis architectures ( e.g. , SPADE ( Park et al. , 2019 ) and StarGANv2 ( Choi et al. , 2020 ) ) by distilling knowledge from the pretrained teacher GAN ( e.g. , StyleGAN ) to the task-specific student GAN . ( III ) We use the style mixing characteristic of StyleGAN to create style-mixed triplet data , which are used to transfer the knowledge efficiently to both I2I and X2I translation models . Furthermore , we propose a semantic diversity loss based on the style-mixed triplet , which contributes to learn the semantic information of the output image . We perform experiments on a wide variety of image synthesis tasks , including text-to-image , audioto-image , segmentation map-to-image and I2I translations . We demonstrate the efficiency of the proposed knowledge distillation method , providing qualitative and quantitative results . We prove that the single pretrained GAN model can be universally used in varying specific task model . Additionally , leveraging the style mixing character of StyleGAN , further improves I2I translation performance . 2 RELATED WORK . GAN-based Conditional Image Synthesis . Benefiting from the advances in GANs and its variants in recent years , conditional image synthesis ( also called X2I translation ) research has developed rapidly . Two typical approaches have been investigated for GAN-based image synthesis , namely , unsupervised ( Kim et al. , 2017 ; Yi et al. , 2017 ) and supervised image generation ( Park et al. , 2019 ; Zhang et al. , 2017b ) . The latter inputs conditional information ( e.g . text , audio , image , segmentation map etc . ) to synthesize images which contain the corresponding semantic information ( i.e . the conditional information ) . Specifically , text-to-image translation ( Hu et al. , 2021 ; Li et al. , 2020 ; Zhang et al. , 2017a ) aims to synthesize high-realistic images which are semantically consistent with the text descriptions . Recent work ( Hu et al. , 2021 ) introduces semantic-spatial batch normalization to better exploit the text information . Similar to text-to-image translation , both audio-to-image translation ( Chen et al. , 2017 ; Wang et al. , 2020a ) and segmentation map-to-image translation ( Bau et al. , 2020 ; Park et al. , 2019 ) aim to learn a mapping from the audio/segmentation map to the output image . Different to the above image synthesis tasks , image-to-image translation ( Park et al. , 2020 ; Zhu et al. , 2017 ) performs projection from the source to the target image domain . In this paper , we explore transfer learning from GANs to a variation of conditional image synthesis tasks . Transfer learning . A considerable research effort has investigated transferring knowledge for both discriminative ( Donahue et al. , 2014 ; Hinton et al. , 2014 ) and generative tasks ( Noguchi & Harada , 2019 ; Zhao et al. , 2020 ) . There also exist several approaches ( Goetschalckx et al. , 2019 ; Jahanian et al. , 2020 ) which focus on the image manipulation based on the pretrained GAN . Given a target semantic attribute they aim to manipulate the output image of a pretrained GAN . However , these methods do not focus on transfer learning for target data . Some other methods ( Abdal et al. , 2019 ; Zhu et al. , 2020a ) reverse the given image into the input latent space of the pretrained GAN ( e.g. , StyleGAN ) , and manage to restructure the target image by optimization of the latent representation . Recent work ( Shocher et al. , 2020 ; Wang et al. , 2021 ; 2020b ) performed knowledge transfer from a pretrained classification model ( e.g. , VGG ( Simonyan & Zisserman , 2014 ) ) or the discriminator ( BigGAN ( Brock et al. , 2019 ) ) for I2I translation . However , both DeepI2I ( Wang et al. , 2020b ) and TransferI2I ( Wang et al. , 2021 ) require that the GAN architecture is identical with the generator used in the I2I architecture . As a consequence , these methods can not be applied to well-designed I2I translation architectures ( like starGANv2 ( Choi et al. , 2020 ) ) since they do not use a standard GAN architecture . The proposed method could address these problems . 3 KNOWLEDGE TRANSFER FOR X2I . Problem setting . Our goal is to transfer knowledge from a pretrained high-quality unconditional GAN to an X2I translation system for the case when training data is limited . The proposed method consist of two stages . In the first stage we perform the data-free knowledge transfer method explained in Sec . 3.2 and 3.3 . This stage does not require any target data . In the second stage , we apply a standard finetuning of this distilled model on the target dataset . Distillation can be used to perform knowledge transfer to other architectures , however , there is little target data available . Fortunately , the pretrained GAN can generate infinite data for data distillation , meaning that we do not require access to any real data ( i.e. , data-free ) . Also , we transfer knowledge from an unconditional GAN ( e.g. , StyleGAN ) to a conditional GAN ( e.g. , I2I translation ) ; requiring us to propose techniques to initialize the conditional branch . Exploiting the style-mixed characteristic ( Sec . 3.1 ) of StyleGAN we propose two solutions : one for I2I ( Sec . 3.2 ) and another one for X2I ( Sec . 3.3 ) . Our method consists of two stages : ( 1 ) transfer leaning without any real data ( i.e. , style-mixed triplets in Sec . 3.1 , I2I translation in Sec . 3.2 and X2I translation in Sec . 3.3 ) and ( 2 ) finetunning with the real target data . 3.1 STYLE-MIXED TRIPLETS Benefiting from the style mixing ( ( Figure 2 ( a ) ) ) characteristic of StyleGAN , we are able to create an infinite amount of triplet images from any of the two domains . Let zt ∈ RZ indicates the input noise of the pretrained generator GT ( teacher ) . given the input noises z1t and z 2 t , the mapping network MT of the StyleGAN generator encodes them to a style vector s1t = MT ( z 1 t ) and s 2 t = MT ( z 2 t ) . We define GT ( z ) = G′T ( MT ( z ) ) where G ′ T takes styles vectors as an input to each of its layers . We further feed these style vectors to the teacher generator G′T to output x 1 t = G ′ T ( s 1 t ) and x 2 t = G′T ( s 2 t ) ( where x 1 t , x 2 t ∈ X and image domain X = RH×W×3 ) respectively . Here the function Φ ( s1t , s 2 t ) selects to forward s 1 t to the layers of G ′ T important for the content of the generated image ( the bottom layers ) , and s2t to those important for the style ( the top layers ) 1 . Interestingly , a new image yt = G′T ( Φ ( s 1 t , s 2 t ) ) ( where yt ∈ Y and image domain Y = RH×W×3 ) contains mixed information with respect to content and style of both inputs x1t and x 2 t . Based on this observation above , we propose to leverage these style-mixed triplets ( x1t , x 2 t , yt ) to perform distillation for the I2I and X2I translation models without the need of any real triplet training data . 2
In this paper, the authors present a unifield learning method to investigate the knowledge transfer for X2I translation. Compared to existing methods, there are two advantages here: (1) this framework can be used for varying kinds of conditional image synthesis tasks; (2) it relieves the limitation for student generator to be the same as the pre-trained GAN. Specifically, the authors leverage the style mixing characteristics of high-quality GANs and introduce the semantic diversity loss to achieve it. Many experiments are conducted with good qualitative and quantitative results.
SP:d59e17faaba144ea4e55c1d77849bc21c19eeff7
Distilling GANs with Style-Mixed Triplets for X2I Translation with Limited Data
1 INTRODUCTION . Conditional image synthesis , also X2I translation , maps from an input domain ( e.g . text , audio , segmentation maps , etc . ) to the image domain . Benefiting from GANs ( Goodfellow et al. , 2014 ) and its follow-up improved versions ( Gulrajani et al. , 2017 ; Kang & Park , 2020 ; Salimans et al. , 2016 ) , they obtain remarkable performance on a wide variety of image synthesis tasks : image to image ( I2I ) ( Lee et al. , 2018 ; Zhu et al. , 2017 ) , audio to image ( Chen et al. , 2017 ; Wang et al. , 2020a ) , text to image ( Hu et al. , 2021 ; Li et al. , 2019 ; 2020 ; Radford et al. , 2021 ; Zhang et al. , 2017a ) and semantic segmentation map to image ( Isola et al. , 2017 ; Wang et al. , 2018 ) . Despite impressive leaps forward for a variety of image synthesis tasks , there are still important challenges . Specifically , to obtain good results , existing works rely on large labelled datasets . Labeling these datasets is both laborious and time-consuming , considerably reducing the practical impact of these methods . It is noteworthy to observe that many of these models ( Zhang et al. , 2017a ) apply transfer learning to the text and audio encoders ( e.g . using a pretrained LSTM ( Reed et al. , 2016 ) model for text and pretrained GRU ( Merkx et al. , 2019 ) model for audio ) , however they train the image synthesis decoder from scratch . This happens because there are no established methods to transfer pretrained GANs to conditional image decoders ; an omission which we aim to address in this paper . In this paper , we investigate knowledge transfer for a variety of conditional image synthesis tasks . Traditional knowledge transfer for conditional image synthesis is often not possible , because there might not be a pretrained network available for the desired translation task ( e.g . at the moment no high-quality pretrained network for segmentation map-to-image translation is available ) . It would therefore be preferable if the wide variety of high-quality GANs available for image generation could be exploited for X2I . Recent works ( Wang et al. , 2021 ; 2020b ) leveraged a pretrained GAN to initialize an I2I translation model , managing to transfer knowledge to different image synthesis tasks . These methods , however , suffer from three problems : ( I ) They can only be used for I2I translation and do not generalize to other conditional image synthesis tasks . ( II ) They are GAN architecture-specific approaches , requiring the GAN architecture within the X2I system to be exactly the same as that of the pretrained GAN . This limits transfer to current state-of-the-art X2I systems for which no similar GAN architecture exists ( like for example StarGANv2 ( Choi et al. , 2020 ) for I2I ) . ( III ) X2I systems are based on a conditional GAN , however existing methods for knowledge transfer for I2I do not initialize the conditional branch during the transfer , and therefore this has to be learned from scratch during the finetuning on the target dataset . Learning this on small target datasets can be problematic . To address the aforementioned problems , we propose several improvements for knowledge transfer to X2I systems : ( I ) we are the first to investigate knowledge transfer for X2I translation . Therefore , we propose a novel , unified transfer learning method , which can be used for varying kinds of conditional image synthesis tasks ( Figure 1 ) which is based on generated images and therefore does not require any real data . ( II ) The student generator does not need to have the same architecture as the pretrained GAN . Therefore , we can use well-devised specific image synthesis architectures ( e.g. , SPADE ( Park et al. , 2019 ) and StarGANv2 ( Choi et al. , 2020 ) ) by distilling knowledge from the pretrained teacher GAN ( e.g. , StyleGAN ) to the task-specific student GAN . ( III ) We use the style mixing characteristic of StyleGAN to create style-mixed triplet data , which are used to transfer the knowledge efficiently to both I2I and X2I translation models . Furthermore , we propose a semantic diversity loss based on the style-mixed triplet , which contributes to learn the semantic information of the output image . We perform experiments on a wide variety of image synthesis tasks , including text-to-image , audioto-image , segmentation map-to-image and I2I translations . We demonstrate the efficiency of the proposed knowledge distillation method , providing qualitative and quantitative results . We prove that the single pretrained GAN model can be universally used in varying specific task model . Additionally , leveraging the style mixing character of StyleGAN , further improves I2I translation performance . 2 RELATED WORK . GAN-based Conditional Image Synthesis . Benefiting from the advances in GANs and its variants in recent years , conditional image synthesis ( also called X2I translation ) research has developed rapidly . Two typical approaches have been investigated for GAN-based image synthesis , namely , unsupervised ( Kim et al. , 2017 ; Yi et al. , 2017 ) and supervised image generation ( Park et al. , 2019 ; Zhang et al. , 2017b ) . The latter inputs conditional information ( e.g . text , audio , image , segmentation map etc . ) to synthesize images which contain the corresponding semantic information ( i.e . the conditional information ) . Specifically , text-to-image translation ( Hu et al. , 2021 ; Li et al. , 2020 ; Zhang et al. , 2017a ) aims to synthesize high-realistic images which are semantically consistent with the text descriptions . Recent work ( Hu et al. , 2021 ) introduces semantic-spatial batch normalization to better exploit the text information . Similar to text-to-image translation , both audio-to-image translation ( Chen et al. , 2017 ; Wang et al. , 2020a ) and segmentation map-to-image translation ( Bau et al. , 2020 ; Park et al. , 2019 ) aim to learn a mapping from the audio/segmentation map to the output image . Different to the above image synthesis tasks , image-to-image translation ( Park et al. , 2020 ; Zhu et al. , 2017 ) performs projection from the source to the target image domain . In this paper , we explore transfer learning from GANs to a variation of conditional image synthesis tasks . Transfer learning . A considerable research effort has investigated transferring knowledge for both discriminative ( Donahue et al. , 2014 ; Hinton et al. , 2014 ) and generative tasks ( Noguchi & Harada , 2019 ; Zhao et al. , 2020 ) . There also exist several approaches ( Goetschalckx et al. , 2019 ; Jahanian et al. , 2020 ) which focus on the image manipulation based on the pretrained GAN . Given a target semantic attribute they aim to manipulate the output image of a pretrained GAN . However , these methods do not focus on transfer learning for target data . Some other methods ( Abdal et al. , 2019 ; Zhu et al. , 2020a ) reverse the given image into the input latent space of the pretrained GAN ( e.g. , StyleGAN ) , and manage to restructure the target image by optimization of the latent representation . Recent work ( Shocher et al. , 2020 ; Wang et al. , 2021 ; 2020b ) performed knowledge transfer from a pretrained classification model ( e.g. , VGG ( Simonyan & Zisserman , 2014 ) ) or the discriminator ( BigGAN ( Brock et al. , 2019 ) ) for I2I translation . However , both DeepI2I ( Wang et al. , 2020b ) and TransferI2I ( Wang et al. , 2021 ) require that the GAN architecture is identical with the generator used in the I2I architecture . As a consequence , these methods can not be applied to well-designed I2I translation architectures ( like starGANv2 ( Choi et al. , 2020 ) ) since they do not use a standard GAN architecture . The proposed method could address these problems . 3 KNOWLEDGE TRANSFER FOR X2I . Problem setting . Our goal is to transfer knowledge from a pretrained high-quality unconditional GAN to an X2I translation system for the case when training data is limited . The proposed method consist of two stages . In the first stage we perform the data-free knowledge transfer method explained in Sec . 3.2 and 3.3 . This stage does not require any target data . In the second stage , we apply a standard finetuning of this distilled model on the target dataset . Distillation can be used to perform knowledge transfer to other architectures , however , there is little target data available . Fortunately , the pretrained GAN can generate infinite data for data distillation , meaning that we do not require access to any real data ( i.e. , data-free ) . Also , we transfer knowledge from an unconditional GAN ( e.g. , StyleGAN ) to a conditional GAN ( e.g. , I2I translation ) ; requiring us to propose techniques to initialize the conditional branch . Exploiting the style-mixed characteristic ( Sec . 3.1 ) of StyleGAN we propose two solutions : one for I2I ( Sec . 3.2 ) and another one for X2I ( Sec . 3.3 ) . Our method consists of two stages : ( 1 ) transfer leaning without any real data ( i.e. , style-mixed triplets in Sec . 3.1 , I2I translation in Sec . 3.2 and X2I translation in Sec . 3.3 ) and ( 2 ) finetunning with the real target data . 3.1 STYLE-MIXED TRIPLETS Benefiting from the style mixing ( ( Figure 2 ( a ) ) ) characteristic of StyleGAN , we are able to create an infinite amount of triplet images from any of the two domains . Let zt ∈ RZ indicates the input noise of the pretrained generator GT ( teacher ) . given the input noises z1t and z 2 t , the mapping network MT of the StyleGAN generator encodes them to a style vector s1t = MT ( z 1 t ) and s 2 t = MT ( z 2 t ) . We define GT ( z ) = G′T ( MT ( z ) ) where G ′ T takes styles vectors as an input to each of its layers . We further feed these style vectors to the teacher generator G′T to output x 1 t = G ′ T ( s 1 t ) and x 2 t = G′T ( s 2 t ) ( where x 1 t , x 2 t ∈ X and image domain X = RH×W×3 ) respectively . Here the function Φ ( s1t , s 2 t ) selects to forward s 1 t to the layers of G ′ T important for the content of the generated image ( the bottom layers ) , and s2t to those important for the style ( the top layers ) 1 . Interestingly , a new image yt = G′T ( Φ ( s 1 t , s 2 t ) ) ( where yt ∈ Y and image domain Y = RH×W×3 ) contains mixed information with respect to content and style of both inputs x1t and x 2 t . Based on this observation above , we propose to leverage these style-mixed triplets ( x1t , x 2 t , yt ) to perform distillation for the I2I and X2I translation models without the need of any real triplet training data . 2
The paper presents a framework for knowledge distillation in image-to-image translation and arbitrary domain-to-image (e.g., text-to-image) translation. Authors claim following contributions: (1) a unified transfer learning method that leverages only synthetic images, (2) a semantic diversity loss, (3) a style-mixing triplets representing a tuple that includes an input image, a reference image, and a target image. Authors provide results for image-to-image translation tasks and for text-to-image translation tasks. A limited comparison with several modern models is presented. Authors claim that the proposed transfer learning method outperforms modern state-of-the-art.
SP:d59e17faaba144ea4e55c1d77849bc21c19eeff7
Sample-efficient actor-critic algorithms with an etiquette for zero-sum Markov games
We introduce algorithms based on natural actor-critic and analyze their sample complexity for solving two player zero-sum Markov games in the tabular case . Our results improve the best-known sample complexities of policy gradient/actorcritic methods for convergence to Nash equilibrium in the multi-agent setting . We use the error propagation scheme in approximate dynamic programming , recent advances for global convergence of policy gradient methods , temporal difference learning , and techniques from stochastic primal-dual optimization . Our algorithms feature two stages , requiring agents to agree on an etiquette before starting their interactions , which is feasible for instance in self-play . However , the agents only access to joint reward and joint next state and not to each other ’ s actions or policies . Our complexity results match the best-known results for global convergence of policy gradient algorithms for single agent RL . We provide numerical verification of our methods for a two player bandit environment and a two player game , Alesia . We observe improved empirical performance as compared to the recently proposed optimistic gradient descent-ascent variant for Markov games . 1 INTRODUCTION . We study two-player zero-sum Markov game framework which is a key model with broad applications in competitive reinforcement learning ( RL ) , robust RL , and many others Zhang et al . ( 2019a ; 2021 ) . This framework is introduced by Shapley ( 1953 ) as stochastic games and popularized in RL with Littman ( 1994 ) . In its basic form , two agents with competing interests interact in an environment where the reward and the state transition depend on the actions of both players . Even with this simplicity , such systems achieved impressive success in game-playing and robotics ( Kober et al. , 2013 ; Silver et al. , 2017 ; Mnih et al. , 2015 ; Vinyals et al. , 2019 ; Brown & Sandholm , 2019 ) . While value-based methods offer near-optimal guarantees ( Sidford et al. , 2020 ; Bai et al. , 2020 ; Bai & Jin , 2020 ; Xie et al. , 2020 ; Tian et al. , 2020 ) , policy gradient ( PG ) methods , including actor-critic ( AC ) and their natural counterparts natural PG ( NPG ) ( Kakade , 2001 ) and natural AC ( NAC ) ( Peters & Schaal , 2008 ) , only have limited guarantees , despite their model-free and easy-to-implement structure , flexibility and generality ( Schulman et al. , 2015 ; 2017 ; Wang et al. , 2016 ) . The PG methods ( Kakade , 2001 ; Sutton et al. , 2000 ) directly optimize the value function in the policy space— a non-convex optimization problem even in the basic single agent , tabular setting . Intriguingly , recent results demonstrate globally optimal convergence of PG methods by identifying a hidden convexity structure for single agent RL ( Agarwal et al. , 2020 ; Cen et al. , 2020 ; Mei et al. , 2020 ; Bhandari & Russo , 2019 ; 2021 ; Xu et al. , 2020b ; Lan , 2021 ; Khodadadian et al. , 2021b ; Hong et al. , 2020 ; Xu et al. , 2020a ; Khodadadian et al. , 2021b ) , and multi-agent RL ( MARL ) ( Daskalakis et al. , 2020 ; Wei et al. , 2021 ; Zhao et al. , 2021 ) . The existing results on PG methods for tabular two-player zero-sum Markov games mostly focus on decentralized algorithms with sample complexities Õ ( ϵ−12.5 ) ( Daskalakis et al. , 2020 ) , Õ ( ϵ−8 ) , and even Õ ( ϵ−4 ) , yet with some limitations ( Wei et al. , 2021 ) ; see Section 1.1 for the details . With function approximation , Zhao et al . ( 2021 ) obtains Õ ( ϵ−6 ) sample complexity when given access to unbiased sampling oracles of the value functions . On the other hand , the best-known sample complexity for global optimality for single agent problem is Õ ( ϵ−2 ) in the tabular case ( Lan , 2021 ) . As this complexity is achieved by value-based/modelbased methods in the multi-agent setting ( Sidford et al. , 2020 ; Zhang et al. , 2020 ) , one expects a similar complexity for policy-based methods . Our work precisely bridges this gap and develops policy gradient methods whose performance for MARL is closer to their single agent counterparts . Contributions . We propose algorithms based on natural actor-critic ( NAC ) framework for solving two-player zero-sum Markov games in the tabular case . Our sample complexity results match the best-known ones for global optimality in the single agent setting ( Lan , 2021 ; Khodadadian et al. , 2021b ; Hong et al. , 2020 ; Xu et al. , 2020b ) . In particular , we show that by using inner loops for policy evaluation and a carefully designed algorithm , the sample complexity to get an ϵ-approximate Nash equilibrium , is Õ ( ϵ−2 ) , by assuming a uniform lower bound on the policies . Without this assumption , we show Õ ( ϵ−4 ) complexity.1 Surprisingly , we achieve these results—to our knowledge , for the first time with policy gradient methods—mostly by a careful adaptation of the recent results for policy gradient methods in single agent setting , temporal difference learning , two-stage error propagation framework of policy iteration ( Perolat et al. , 2015 ) , and by employing techniques from stochastic primal-dual optimization . These developments require a careful algorithm design and analysis . In particular , two-stage nature of the algorithm incurs biases between the stages that we have to control carefully . Obtaining Õ ( ϵ−2 ) complexity requires a tighter analysis for both stages of the algorithm , with strict control on the aforementioned bias . Therefore , it requires more advanced techniques and algorithms , inspired from the stochastic primal-dual optimization literature . We explicitly highlight our important new techniques as insights in the sequel . The full proofs are included in the appendices . 1.1 RELATED WORKS . Policy gradient methods . There is growing interest in global convergence of PG methods in the single agent setting . Several works showed convergence rates of natural policy gradient ( NPG ) in the tabular setting by assuming access to exact value function oracle ( Agarwal et al. , 2020 ; Cen et al. , 2020 ; Mei et al. , 2020 ; Bhandari & Russo , 2019 ; 2021 ) or when value functions are estimated from the data ( Shani et al. , 2020 ; Xu et al. , 2020b ; Lan , 2021 ; Khodadadian et al. , 2021b ; Hong et al. , 2020 ; Xu et al. , 2020a ; Khodadadian et al. , 2021b ) . To our knowledge , the best sample complexity for NPG methods with inner loop for policy evaluation ( which we refer to as NAC ) is Õ ( ϵ−2 ) and is due to ( Lan , 2021 ) . For single loop NAC with online policy evaluation , the best sample complexity is Õ ( ϵ−4 ) as obtained in ( Khodadadian et al. , 2021b ; Hong et al. , 2020 ; Xu et al. , 2020b ) ( see ( Khodadadian et al. , 2021a , Table 1 ) ) . For a general overview of results in MARL we refer to Zhang et al . ( 2019a ) . Policy gradient methods for two-player zero-sum Markov games . With the positive results on global convergence of PG methods , translating these results to the competitive MARL has been the goal of many recent works . In particular , independent policy gradient methods with the agents interacting symmetrically has been considered in Daskalakis et al . ( 2020 ) ; Wei et al . ( 2021 ) . The work of Daskalakis et al . ( 2020 ) built on Agarwal et al . ( 2020 ) by using REINFORCE estimator ( Williams , 1992 ) and obtained sample complexity of Õ ( ϵ−12.5 ) for reaching to one-sided Nash equilibrium . The algorithm of Wei et al . ( 2021 ) built on optimistic gradient descent-ascent ( OGDA ) method combined with a running estimate of the value function , obtaining Õ ( ϵ−8 ) sample complexity for finding a policy pair with small duality gap . In addition , Wei et al . ( 2021 ) showed improved complexity Õ ( ϵ−4 ) when restricted to Euclidean projections onto the simplex with metric subregularity assumption . There are two subtleties about this result : First , as pointed out in Daskalakis et al . ( 2020 ) , metric subregularity constant can be arbitrarily small , resulting in degradation of the rate . Second , as also pointed out by Wei et al . ( 2021 ) , this result is limited to Euclidean setting and can not be extended to the NPG with softmax policy update , which requires projection with KL divergence . The algorithm can be seen similar to the gradient ascent algorithm in Agarwal et al . ( 2020 ) . As 1In Appendix E , we design an algorithm based on single loop NAC with the complexity of Õ ( ϵ−4 ) ( and O ( ϵ−7 ) without assuming lower bounded policies ) . Our results on this algorithm is , to our knowledge , the first finite-sample analysis of single loop NAC-based methods for two-player zero-sum Markov games . x , y is the time that it takes to go from state s to state s′ by using policy pair x , y ( Wei et al. , 2021 , Assumption 1 ) . ‡This Õ ( ϵ−4 ) complexity by Wei et al . ( 2021 ) requires using Euclidean projections onto the simplex instead of softmax updates and depends on the metric subregularity constant . Hence it is not applicable to NPG . shown in Agarwal et al . ( 2020 ) for single agent problems , NPG methods have much better convergence properties than Euclidean projected gradient ascent methods . For comparison with the works in Daskalakis et al . ( 2020 ) ; Wei et al . ( 2021 ) , we also refer to Remark 2.1 and Table 1 . Another very related work to ours is by Zhao et al . ( 2021 ) which considered ( i ) tabular setting with exact value functions and ( ii ) online setting with function approximation , also using the error propagation scheme of Perolat et al . ( 2015 ) . Building on Agarwal et al . ( 2020 ) , this work showed Õ ( ϵ−6 ) sample complexity with function approximation , with access to unbiased samples of the value functions . In contrast , we focus on the tabular setting and we do not assume access to unbiased value function oracles . Indeed , lack of unbiased samples for value functions required us to use new insights described in the sequel , to derive the tighter complexities Õ ( ϵ−2 ) and Õ ( ϵ−4 ) . Policy gradient methods for linear quadratic regulator ( LQR ) . For zero-sum LQR , Zhang et al . ( 2019b ) ; Bu et al . ( 2019 ) showed global convergence of PG with exact value function oracles . These methods have a nested structure where one player computes best-response and the other does policy gradient updates . Recently , Zhang et al . ( 2021 ) built on Zhang et al . ( 2019b ) to derive sample complexities when value functions are estimated from data . 2 PRELIMINARIES . Notation . We consider the tabular setting with finite state and action spaces denoted by S , A , B and the discount factor γ < 1 . The policy of the min agent is x and the max agent is y , with action sets A , B , respectively . At state s , both agents take actions independent of each other : a ∼ x ( ·|s ) and b ∼ y ( ·|s ) . Based on the actions , the environment transitions to the next state s′ ∼ P ( ·|s , a , b ) and the agents receive reward |r ( s , a , b ) | ≤ 1 . Given a policy pair x , y , we denote the induced steadystate distribution as ρx , y . Let U denote the uniform distribution for states that we also take as the initial state distribution for simplicity . We denote the probability simplex as ∆ . Given a policy x , we sometimes use the notation xs for x ( ·|s ) in the proofs . We use e ( st ) ∈ R|S| to denote the vector such that e ( s ) = 1 if s = st and e ( s ) = 0 , if s ̸= st. We use the same notation for e ( st , at ) . The value function for state s is defined as V x , y ( s ) = Ex , y [ ∞∑ t=0 γtr ( st , at , bt ) |s0 = s ] , where Ex , y is over random variables st , at , bt for all t ≥ 0 as at ∼ x ( ·|st ) , bt ∼ y ( ·|st ) and st+1 ∼ P ( ·|st , at , bt ) . Similarly , the action value function is defined as Qx , y ( s , a , b ) = Ex , y [ ∑∞ t=0 γ tr ( st , at , bt ) |s0 = s , a0 = a , b0 = b ] . With these definitions , we can state the formal problem . For all s ∈ S , we aim to solve min x ( ·|s ) ∈∆ max y ( ·|s ) ∈∆ V x , y ( s ) . We denote the information needed in algorithms as oracles . We provide the background on NPG , NAC , TD ( 0 ) in Appendix A. Nash equilibrium . We assume the existence of a pair of policies x⋆ , y⋆ that are Nash equilibrium , namely , for all s , V x ⋆ , y ( s ) ≤ V ⋆ ( s ) : = V x⋆ , y⋆ ( s ) ≤ V x , y⋆ ( s ) . We are interested in finding a onesided Nash equilibrium , similar to Daskalakis et al . ( 2020 ) ; Zhao et al . ( 2021 ) ; Zhang et al . ( 2019b ) ; Bu et al . ( 2019 ) . As mentioned in Daskalakis et al . ( 2020 ) , for the other player , one can re-run the algorithm by switching roles to have the guarantee for both players . In particular , for the initial state distribution U , we seek for xout such that Es0∼U [ max y V xout , y ( s0 ) − V ⋆ ( s0 ) ] ≤ ϵ . It is easy to prove that this quantity on the LHS is 0 if and only if xout is a Nash equilibrium . Interaction procedure . We use the interactions of the agents with the environment to estimate the value functions and related oracles for the running of the algorithm . At each interaction , agents have access to ( si , ai , r ( si , ai , bi ) , si+1 ) and ( si , bi , r ( si , ai , bi ) , si+1 ) , respectively . In terms of access of agents , our oracle model is similar to Daskalakis et al . ( 2020 ) ; Wei et al . ( 2021 ) . However , one difference is that we require a game etiquette : Our algorithms have two stages where the agents have to behave differently . As long as this etiquette is respected by the agents ( for example embedded to players in the beginning of the game ) , they do not need further communication . Softmax update rule/NAC . Given Kullback-Leibler divergence KL and action-value function Qxt , xt+1 ( ·|s ) = PKL ( xt ( ·|s ) , Qxt ( s , · ) ) : = arg min x ( ·|s ) ∈∆ ⟨Qxt ( s , · ) , x ( ·|s ) ⟩+KL ( x ( ·|s ) , xt ( ·|s ) ) , ( 1 ) is known as NPG with softmax parameterization ( Agarwal et al. , 2020 , Lemma 5.1 ) . When there is a critic estimating Qxt , along with actor updating xt with NPG , this algorithmic framework is called natural actor-critic , in short , NAC . We focus on KL divergence for simplicity and its wide use . Our developments also hold for more general Bregman divergences as Zhan et al . ( 2021 ) . Assumption 1 . There exists ρ such that , for any policy iterate pair xt , yt , for any state s , it holds that ρxt , yt ( s ) ≥ ρ > 0 , where ρxt , yt is the stationary state distribution induced by the policy pair . Assumption2 . There exist x , y such that , for any policy iterate pair xt , yt , for any state action tuple s , a , b , it holds that xt ( a|s ) ≥ x > 0 , yt ( b|s ) ≥ y > 0 . Our rationale on the assumptions . Assumption 1 and 2 essentially mean positive definiteness of the sampling matrices in policy evaluation ( see eqs . ( 30 ) , ( 34 ) and ( 42 ) ) . To our knowledge , some form of this assumption is required in most of the existing work on temporal difference ( TD ) ( including TD ( 0 ) ) methods for policy evaluation ( Bhandari et al. , 2018 ; Xu et al. , 2020b ; Khodadadian et al. , 2021a ; Lan , 2021 ; Hong et al. , 2020 ; Xu et al. , 2020a ; Wu et al. , 2020 ; Zou et al. , 2019 ) ( see App . A ) . The complexity Õ ( ϵ−2 ) requires Assumption 2 even for single agent problems ( see ( Lan , 2021 , Rem . 1 , Sec . 5.2 ) ) . Remark 2.1 . As summarized in Table 1 , similar assumptions to Assumption1 are used in Daskalakis et al . ( 2020 ) ; Wei et al . ( 2021 ) . In particular , each of these assumptions ensure that all action-state pairs are observed with nonzero probability throughout the game . Moreover , by additionally requiring Assumption 2 , we can obtain the complexity Õ ( ϵ−2 ) , matching the single-agent counterpart . Markovian bias . For simplicity , we assume that we sample from the steady state distribution of a given policy pair . During normal interaction with the environment , this is not the case and we obtain a single stream of data . Hence , TD ( 0 ) update is biased—commonly referred to as the Markovian bias . A large body of literature in the single agent literature showed that the effect of this bias in TD ( 0 ) update is essentially additive and can be handled by assuming uniform mixing of the induced Markov chain ( Wu et al. , 2020 ; Bhandari et al. , 2018 ; Zou et al. , 2019 ; Khodadadian et al. , 2021b ; Xu et al. , 2020b ; a ) . These analyses apply to our policy evaluation routines , extending them to the Markovian setting . For simplicity , we show our techniques with i.i.d . assumption and then illustrate how the extension with Markovian data follows with the uniform mixing assumption in Appendix D. Error propagation for approximate dynamic programming . Perolat et al . ( 2015 ) proposed error propagation analysis for approximate version of generalized policy iteration for zero-sum Markov games ( see Appendix C ) . The authors showed that the following two-stage algorithm converges : • Stage 1 : Given a fixed value function Vk−1 , find the policy pair which is an ϵ-equilibrium . min xs∈∆ max ys∈∆ ∑ a , b x ( a|s ) y ( a|s ) Qk−1 ( s , a , b ) = : xsQsk−1ys , ( 2 ) Algorithm 1 Reflected NAC with a game etiquette and ζ-greedy exploration Require : PKL defined in ( 1 ) in Sec . 2 . Exploration parameter ζ ≥ 0 ( with equality if Assumption 2 holds ) . Subroutines Policy-Eval-V , Policy-Eval-θ , Policy-Eval-ν ( see Alg . 2 , 3 , 4 and note βνn , β θ n , β ω n are potential step sizes for this routine ) . Initial policies x0 , y0 , ȳ0 . xk , yk denote outer , xt , yt denote inner loop ’ s iterate . 1 : for k = 0 , 1 , . . . do 2 : Stage 1 // Approximately solve a matrix game 3 : for t = 0 , 1 , . . . , T − 1 do 4 : [ V̂ xk−1 , V̂ y k−1 ] = [ Policy-Eval-V ( x k−1 , yk−1 , N , βωn ) , Policy-Eval-V ( x k−1 , yk−1 , N , βωn ) ] // Both players compute their own estimations of Vk−1 , denoted as V̂ x and V̂ y 5 : [ θ̂xt+1 , θ̂ y t+1 ] = [ Policy-Eval-θ ( xt , yt , N , V̂ x k−1 , β θ n ) , Policy-Eval-θ ( xt , yt , N , V̂ y k−1 , β θ n ) ] 6 : xt+1 ( ·|s ) = PKL ( xt ( ·|s ) , η ( 2θ̂xt+1 ( s , · ) − θ̂xt ( s , · ) ) ) 7 : yt+1 ( ·|s ) = PKL ( yt ( ·|s ) , −η ( 2θ̂yt+1 ( s , · ) − θ̂ y t ( s , · ) ) ) 8 : Output xk = 1T ∑T t=1 xt . 9 : Stage 2 // Approximately find best response 10 : for t = 0 , 1 , . . . , T − 1 do 11 : ν̂t+1 = Policy-Eval-ν ( xk , ȳt , N , β = βνn ) 12 : ȳt+1 ( ·|s ) = PKL ( ȳt ( ·|s ) , −ην̂t+1 ( s , · ) ) 13 : Output yk = ȳt̂ , where t̂ ∈ [ T ] is selected uniformly at random . Algorithm 2 VN = Policy-Eval-V ( x , y , N , β ) Require : Policy pair x , y , iteration counter N , step size β , initial value function estimate V0 . x̂ ( ·|s ) = ( 1− ζ ) x ( ·|s ) + ζ|A| , ŷ ( ·|s ) = ( 1− ζ ) y ( ·|s ) + ζ |B| . 1 : for n = 0 , 1 , . . . , N − 1 do 2 : Sample sn ∼ ρx̂ , ŷ ( · ) , an ∼ x̂ ( ·|sn ) , bn ∼ ŷ ( ·|sn ) , sn+1 ∼ P ( ·|sn , an , bn ) . 3 : Vn+1 = Vn − βne ( sn ) ( Vn ( sn ) − r ( sn , an , bn ) − γVn ( sn+1 ) ) where Qk−1 ( s , a , b ) = r ( s , a , b ) + γ ∑ s′ P ( s ′|s , a , b ) Vk−1 ( s′ ) . When it is clear from the context , we drop the subscript of Qk−1 . This is a matrix game and is the sample-complexity bottleneck ( Perolat et al. , 2015 ) . Let ϵg denote the accuracy and xk the output of this stage at iteration k : E [ Es∼U [ max ys∈∆ ( xk ) sQsk−1y s − min xs∈∆ max ys∈∆ xsQsk−1y s ] ] = ϵk1 , ( 3 ) where the outer expectation is over the randomness of the algorithm used to generate xk . • Stage 2 : This step finds an approximate best response . The fixed policy ( xk ) , can be viewed as a part of the environment . Denote yk as the approximate best-response computed in this stage , at iteration k. The resulting value function Vk = V x k , yk is fed to stage 1 in the next iteration . Let ϵe be the accuracy for this stage , yk the output of this stage : E [ Es∼U [ max y V x k , y ( s ) − V x k , yk ( s ) ] ] = ϵk2 , ( 4 ) where the outer expectation is over the randomness of the algorithm used to generate yk . Then , Perolat et al . ( 2015 , Theorem 1 ) , Zhao et al . ( 2021 ) show that the following holds ( see also Appendix C ) . E [ Es∼U [ max y∈∆ V x K , y ( s ) − V ⋆ ( s ) ] ] ≤ |S|K 1− γ Õ ( sup k≤K ϵk1 + sup k≤K ϵk2 ) +O ( |S|γK 1− γ ) . ( 5 )
This paper considers algorithms based on natural actor-critic for solving two player zero-sum Markov games in the tabular case. In particular, the authors focus on the analysis of the sample complexity for a two-stage algorithm that solves a matrix game and a single agent problem, alternatively and iteratively. By combining and refining recent results for policy gradient methods, this paper manages to match the best-known results for global convergence of policy gradient algorithms for single agent RL.
SP:f460a21378458bd0576233891e977f66c010ae62
Sample-efficient actor-critic algorithms with an etiquette for zero-sum Markov games
We introduce algorithms based on natural actor-critic and analyze their sample complexity for solving two player zero-sum Markov games in the tabular case . Our results improve the best-known sample complexities of policy gradient/actorcritic methods for convergence to Nash equilibrium in the multi-agent setting . We use the error propagation scheme in approximate dynamic programming , recent advances for global convergence of policy gradient methods , temporal difference learning , and techniques from stochastic primal-dual optimization . Our algorithms feature two stages , requiring agents to agree on an etiquette before starting their interactions , which is feasible for instance in self-play . However , the agents only access to joint reward and joint next state and not to each other ’ s actions or policies . Our complexity results match the best-known results for global convergence of policy gradient algorithms for single agent RL . We provide numerical verification of our methods for a two player bandit environment and a two player game , Alesia . We observe improved empirical performance as compared to the recently proposed optimistic gradient descent-ascent variant for Markov games . 1 INTRODUCTION . We study two-player zero-sum Markov game framework which is a key model with broad applications in competitive reinforcement learning ( RL ) , robust RL , and many others Zhang et al . ( 2019a ; 2021 ) . This framework is introduced by Shapley ( 1953 ) as stochastic games and popularized in RL with Littman ( 1994 ) . In its basic form , two agents with competing interests interact in an environment where the reward and the state transition depend on the actions of both players . Even with this simplicity , such systems achieved impressive success in game-playing and robotics ( Kober et al. , 2013 ; Silver et al. , 2017 ; Mnih et al. , 2015 ; Vinyals et al. , 2019 ; Brown & Sandholm , 2019 ) . While value-based methods offer near-optimal guarantees ( Sidford et al. , 2020 ; Bai et al. , 2020 ; Bai & Jin , 2020 ; Xie et al. , 2020 ; Tian et al. , 2020 ) , policy gradient ( PG ) methods , including actor-critic ( AC ) and their natural counterparts natural PG ( NPG ) ( Kakade , 2001 ) and natural AC ( NAC ) ( Peters & Schaal , 2008 ) , only have limited guarantees , despite their model-free and easy-to-implement structure , flexibility and generality ( Schulman et al. , 2015 ; 2017 ; Wang et al. , 2016 ) . The PG methods ( Kakade , 2001 ; Sutton et al. , 2000 ) directly optimize the value function in the policy space— a non-convex optimization problem even in the basic single agent , tabular setting . Intriguingly , recent results demonstrate globally optimal convergence of PG methods by identifying a hidden convexity structure for single agent RL ( Agarwal et al. , 2020 ; Cen et al. , 2020 ; Mei et al. , 2020 ; Bhandari & Russo , 2019 ; 2021 ; Xu et al. , 2020b ; Lan , 2021 ; Khodadadian et al. , 2021b ; Hong et al. , 2020 ; Xu et al. , 2020a ; Khodadadian et al. , 2021b ) , and multi-agent RL ( MARL ) ( Daskalakis et al. , 2020 ; Wei et al. , 2021 ; Zhao et al. , 2021 ) . The existing results on PG methods for tabular two-player zero-sum Markov games mostly focus on decentralized algorithms with sample complexities Õ ( ϵ−12.5 ) ( Daskalakis et al. , 2020 ) , Õ ( ϵ−8 ) , and even Õ ( ϵ−4 ) , yet with some limitations ( Wei et al. , 2021 ) ; see Section 1.1 for the details . With function approximation , Zhao et al . ( 2021 ) obtains Õ ( ϵ−6 ) sample complexity when given access to unbiased sampling oracles of the value functions . On the other hand , the best-known sample complexity for global optimality for single agent problem is Õ ( ϵ−2 ) in the tabular case ( Lan , 2021 ) . As this complexity is achieved by value-based/modelbased methods in the multi-agent setting ( Sidford et al. , 2020 ; Zhang et al. , 2020 ) , one expects a similar complexity for policy-based methods . Our work precisely bridges this gap and develops policy gradient methods whose performance for MARL is closer to their single agent counterparts . Contributions . We propose algorithms based on natural actor-critic ( NAC ) framework for solving two-player zero-sum Markov games in the tabular case . Our sample complexity results match the best-known ones for global optimality in the single agent setting ( Lan , 2021 ; Khodadadian et al. , 2021b ; Hong et al. , 2020 ; Xu et al. , 2020b ) . In particular , we show that by using inner loops for policy evaluation and a carefully designed algorithm , the sample complexity to get an ϵ-approximate Nash equilibrium , is Õ ( ϵ−2 ) , by assuming a uniform lower bound on the policies . Without this assumption , we show Õ ( ϵ−4 ) complexity.1 Surprisingly , we achieve these results—to our knowledge , for the first time with policy gradient methods—mostly by a careful adaptation of the recent results for policy gradient methods in single agent setting , temporal difference learning , two-stage error propagation framework of policy iteration ( Perolat et al. , 2015 ) , and by employing techniques from stochastic primal-dual optimization . These developments require a careful algorithm design and analysis . In particular , two-stage nature of the algorithm incurs biases between the stages that we have to control carefully . Obtaining Õ ( ϵ−2 ) complexity requires a tighter analysis for both stages of the algorithm , with strict control on the aforementioned bias . Therefore , it requires more advanced techniques and algorithms , inspired from the stochastic primal-dual optimization literature . We explicitly highlight our important new techniques as insights in the sequel . The full proofs are included in the appendices . 1.1 RELATED WORKS . Policy gradient methods . There is growing interest in global convergence of PG methods in the single agent setting . Several works showed convergence rates of natural policy gradient ( NPG ) in the tabular setting by assuming access to exact value function oracle ( Agarwal et al. , 2020 ; Cen et al. , 2020 ; Mei et al. , 2020 ; Bhandari & Russo , 2019 ; 2021 ) or when value functions are estimated from the data ( Shani et al. , 2020 ; Xu et al. , 2020b ; Lan , 2021 ; Khodadadian et al. , 2021b ; Hong et al. , 2020 ; Xu et al. , 2020a ; Khodadadian et al. , 2021b ) . To our knowledge , the best sample complexity for NPG methods with inner loop for policy evaluation ( which we refer to as NAC ) is Õ ( ϵ−2 ) and is due to ( Lan , 2021 ) . For single loop NAC with online policy evaluation , the best sample complexity is Õ ( ϵ−4 ) as obtained in ( Khodadadian et al. , 2021b ; Hong et al. , 2020 ; Xu et al. , 2020b ) ( see ( Khodadadian et al. , 2021a , Table 1 ) ) . For a general overview of results in MARL we refer to Zhang et al . ( 2019a ) . Policy gradient methods for two-player zero-sum Markov games . With the positive results on global convergence of PG methods , translating these results to the competitive MARL has been the goal of many recent works . In particular , independent policy gradient methods with the agents interacting symmetrically has been considered in Daskalakis et al . ( 2020 ) ; Wei et al . ( 2021 ) . The work of Daskalakis et al . ( 2020 ) built on Agarwal et al . ( 2020 ) by using REINFORCE estimator ( Williams , 1992 ) and obtained sample complexity of Õ ( ϵ−12.5 ) for reaching to one-sided Nash equilibrium . The algorithm of Wei et al . ( 2021 ) built on optimistic gradient descent-ascent ( OGDA ) method combined with a running estimate of the value function , obtaining Õ ( ϵ−8 ) sample complexity for finding a policy pair with small duality gap . In addition , Wei et al . ( 2021 ) showed improved complexity Õ ( ϵ−4 ) when restricted to Euclidean projections onto the simplex with metric subregularity assumption . There are two subtleties about this result : First , as pointed out in Daskalakis et al . ( 2020 ) , metric subregularity constant can be arbitrarily small , resulting in degradation of the rate . Second , as also pointed out by Wei et al . ( 2021 ) , this result is limited to Euclidean setting and can not be extended to the NPG with softmax policy update , which requires projection with KL divergence . The algorithm can be seen similar to the gradient ascent algorithm in Agarwal et al . ( 2020 ) . As 1In Appendix E , we design an algorithm based on single loop NAC with the complexity of Õ ( ϵ−4 ) ( and O ( ϵ−7 ) without assuming lower bounded policies ) . Our results on this algorithm is , to our knowledge , the first finite-sample analysis of single loop NAC-based methods for two-player zero-sum Markov games . x , y is the time that it takes to go from state s to state s′ by using policy pair x , y ( Wei et al. , 2021 , Assumption 1 ) . ‡This Õ ( ϵ−4 ) complexity by Wei et al . ( 2021 ) requires using Euclidean projections onto the simplex instead of softmax updates and depends on the metric subregularity constant . Hence it is not applicable to NPG . shown in Agarwal et al . ( 2020 ) for single agent problems , NPG methods have much better convergence properties than Euclidean projected gradient ascent methods . For comparison with the works in Daskalakis et al . ( 2020 ) ; Wei et al . ( 2021 ) , we also refer to Remark 2.1 and Table 1 . Another very related work to ours is by Zhao et al . ( 2021 ) which considered ( i ) tabular setting with exact value functions and ( ii ) online setting with function approximation , also using the error propagation scheme of Perolat et al . ( 2015 ) . Building on Agarwal et al . ( 2020 ) , this work showed Õ ( ϵ−6 ) sample complexity with function approximation , with access to unbiased samples of the value functions . In contrast , we focus on the tabular setting and we do not assume access to unbiased value function oracles . Indeed , lack of unbiased samples for value functions required us to use new insights described in the sequel , to derive the tighter complexities Õ ( ϵ−2 ) and Õ ( ϵ−4 ) . Policy gradient methods for linear quadratic regulator ( LQR ) . For zero-sum LQR , Zhang et al . ( 2019b ) ; Bu et al . ( 2019 ) showed global convergence of PG with exact value function oracles . These methods have a nested structure where one player computes best-response and the other does policy gradient updates . Recently , Zhang et al . ( 2021 ) built on Zhang et al . ( 2019b ) to derive sample complexities when value functions are estimated from data . 2 PRELIMINARIES . Notation . We consider the tabular setting with finite state and action spaces denoted by S , A , B and the discount factor γ < 1 . The policy of the min agent is x and the max agent is y , with action sets A , B , respectively . At state s , both agents take actions independent of each other : a ∼ x ( ·|s ) and b ∼ y ( ·|s ) . Based on the actions , the environment transitions to the next state s′ ∼ P ( ·|s , a , b ) and the agents receive reward |r ( s , a , b ) | ≤ 1 . Given a policy pair x , y , we denote the induced steadystate distribution as ρx , y . Let U denote the uniform distribution for states that we also take as the initial state distribution for simplicity . We denote the probability simplex as ∆ . Given a policy x , we sometimes use the notation xs for x ( ·|s ) in the proofs . We use e ( st ) ∈ R|S| to denote the vector such that e ( s ) = 1 if s = st and e ( s ) = 0 , if s ̸= st. We use the same notation for e ( st , at ) . The value function for state s is defined as V x , y ( s ) = Ex , y [ ∞∑ t=0 γtr ( st , at , bt ) |s0 = s ] , where Ex , y is over random variables st , at , bt for all t ≥ 0 as at ∼ x ( ·|st ) , bt ∼ y ( ·|st ) and st+1 ∼ P ( ·|st , at , bt ) . Similarly , the action value function is defined as Qx , y ( s , a , b ) = Ex , y [ ∑∞ t=0 γ tr ( st , at , bt ) |s0 = s , a0 = a , b0 = b ] . With these definitions , we can state the formal problem . For all s ∈ S , we aim to solve min x ( ·|s ) ∈∆ max y ( ·|s ) ∈∆ V x , y ( s ) . We denote the information needed in algorithms as oracles . We provide the background on NPG , NAC , TD ( 0 ) in Appendix A. Nash equilibrium . We assume the existence of a pair of policies x⋆ , y⋆ that are Nash equilibrium , namely , for all s , V x ⋆ , y ( s ) ≤ V ⋆ ( s ) : = V x⋆ , y⋆ ( s ) ≤ V x , y⋆ ( s ) . We are interested in finding a onesided Nash equilibrium , similar to Daskalakis et al . ( 2020 ) ; Zhao et al . ( 2021 ) ; Zhang et al . ( 2019b ) ; Bu et al . ( 2019 ) . As mentioned in Daskalakis et al . ( 2020 ) , for the other player , one can re-run the algorithm by switching roles to have the guarantee for both players . In particular , for the initial state distribution U , we seek for xout such that Es0∼U [ max y V xout , y ( s0 ) − V ⋆ ( s0 ) ] ≤ ϵ . It is easy to prove that this quantity on the LHS is 0 if and only if xout is a Nash equilibrium . Interaction procedure . We use the interactions of the agents with the environment to estimate the value functions and related oracles for the running of the algorithm . At each interaction , agents have access to ( si , ai , r ( si , ai , bi ) , si+1 ) and ( si , bi , r ( si , ai , bi ) , si+1 ) , respectively . In terms of access of agents , our oracle model is similar to Daskalakis et al . ( 2020 ) ; Wei et al . ( 2021 ) . However , one difference is that we require a game etiquette : Our algorithms have two stages where the agents have to behave differently . As long as this etiquette is respected by the agents ( for example embedded to players in the beginning of the game ) , they do not need further communication . Softmax update rule/NAC . Given Kullback-Leibler divergence KL and action-value function Qxt , xt+1 ( ·|s ) = PKL ( xt ( ·|s ) , Qxt ( s , · ) ) : = arg min x ( ·|s ) ∈∆ ⟨Qxt ( s , · ) , x ( ·|s ) ⟩+KL ( x ( ·|s ) , xt ( ·|s ) ) , ( 1 ) is known as NPG with softmax parameterization ( Agarwal et al. , 2020 , Lemma 5.1 ) . When there is a critic estimating Qxt , along with actor updating xt with NPG , this algorithmic framework is called natural actor-critic , in short , NAC . We focus on KL divergence for simplicity and its wide use . Our developments also hold for more general Bregman divergences as Zhan et al . ( 2021 ) . Assumption 1 . There exists ρ such that , for any policy iterate pair xt , yt , for any state s , it holds that ρxt , yt ( s ) ≥ ρ > 0 , where ρxt , yt is the stationary state distribution induced by the policy pair . Assumption2 . There exist x , y such that , for any policy iterate pair xt , yt , for any state action tuple s , a , b , it holds that xt ( a|s ) ≥ x > 0 , yt ( b|s ) ≥ y > 0 . Our rationale on the assumptions . Assumption 1 and 2 essentially mean positive definiteness of the sampling matrices in policy evaluation ( see eqs . ( 30 ) , ( 34 ) and ( 42 ) ) . To our knowledge , some form of this assumption is required in most of the existing work on temporal difference ( TD ) ( including TD ( 0 ) ) methods for policy evaluation ( Bhandari et al. , 2018 ; Xu et al. , 2020b ; Khodadadian et al. , 2021a ; Lan , 2021 ; Hong et al. , 2020 ; Xu et al. , 2020a ; Wu et al. , 2020 ; Zou et al. , 2019 ) ( see App . A ) . The complexity Õ ( ϵ−2 ) requires Assumption 2 even for single agent problems ( see ( Lan , 2021 , Rem . 1 , Sec . 5.2 ) ) . Remark 2.1 . As summarized in Table 1 , similar assumptions to Assumption1 are used in Daskalakis et al . ( 2020 ) ; Wei et al . ( 2021 ) . In particular , each of these assumptions ensure that all action-state pairs are observed with nonzero probability throughout the game . Moreover , by additionally requiring Assumption 2 , we can obtain the complexity Õ ( ϵ−2 ) , matching the single-agent counterpart . Markovian bias . For simplicity , we assume that we sample from the steady state distribution of a given policy pair . During normal interaction with the environment , this is not the case and we obtain a single stream of data . Hence , TD ( 0 ) update is biased—commonly referred to as the Markovian bias . A large body of literature in the single agent literature showed that the effect of this bias in TD ( 0 ) update is essentially additive and can be handled by assuming uniform mixing of the induced Markov chain ( Wu et al. , 2020 ; Bhandari et al. , 2018 ; Zou et al. , 2019 ; Khodadadian et al. , 2021b ; Xu et al. , 2020b ; a ) . These analyses apply to our policy evaluation routines , extending them to the Markovian setting . For simplicity , we show our techniques with i.i.d . assumption and then illustrate how the extension with Markovian data follows with the uniform mixing assumption in Appendix D. Error propagation for approximate dynamic programming . Perolat et al . ( 2015 ) proposed error propagation analysis for approximate version of generalized policy iteration for zero-sum Markov games ( see Appendix C ) . The authors showed that the following two-stage algorithm converges : • Stage 1 : Given a fixed value function Vk−1 , find the policy pair which is an ϵ-equilibrium . min xs∈∆ max ys∈∆ ∑ a , b x ( a|s ) y ( a|s ) Qk−1 ( s , a , b ) = : xsQsk−1ys , ( 2 ) Algorithm 1 Reflected NAC with a game etiquette and ζ-greedy exploration Require : PKL defined in ( 1 ) in Sec . 2 . Exploration parameter ζ ≥ 0 ( with equality if Assumption 2 holds ) . Subroutines Policy-Eval-V , Policy-Eval-θ , Policy-Eval-ν ( see Alg . 2 , 3 , 4 and note βνn , β θ n , β ω n are potential step sizes for this routine ) . Initial policies x0 , y0 , ȳ0 . xk , yk denote outer , xt , yt denote inner loop ’ s iterate . 1 : for k = 0 , 1 , . . . do 2 : Stage 1 // Approximately solve a matrix game 3 : for t = 0 , 1 , . . . , T − 1 do 4 : [ V̂ xk−1 , V̂ y k−1 ] = [ Policy-Eval-V ( x k−1 , yk−1 , N , βωn ) , Policy-Eval-V ( x k−1 , yk−1 , N , βωn ) ] // Both players compute their own estimations of Vk−1 , denoted as V̂ x and V̂ y 5 : [ θ̂xt+1 , θ̂ y t+1 ] = [ Policy-Eval-θ ( xt , yt , N , V̂ x k−1 , β θ n ) , Policy-Eval-θ ( xt , yt , N , V̂ y k−1 , β θ n ) ] 6 : xt+1 ( ·|s ) = PKL ( xt ( ·|s ) , η ( 2θ̂xt+1 ( s , · ) − θ̂xt ( s , · ) ) ) 7 : yt+1 ( ·|s ) = PKL ( yt ( ·|s ) , −η ( 2θ̂yt+1 ( s , · ) − θ̂ y t ( s , · ) ) ) 8 : Output xk = 1T ∑T t=1 xt . 9 : Stage 2 // Approximately find best response 10 : for t = 0 , 1 , . . . , T − 1 do 11 : ν̂t+1 = Policy-Eval-ν ( xk , ȳt , N , β = βνn ) 12 : ȳt+1 ( ·|s ) = PKL ( ȳt ( ·|s ) , −ην̂t+1 ( s , · ) ) 13 : Output yk = ȳt̂ , where t̂ ∈ [ T ] is selected uniformly at random . Algorithm 2 VN = Policy-Eval-V ( x , y , N , β ) Require : Policy pair x , y , iteration counter N , step size β , initial value function estimate V0 . x̂ ( ·|s ) = ( 1− ζ ) x ( ·|s ) + ζ|A| , ŷ ( ·|s ) = ( 1− ζ ) y ( ·|s ) + ζ |B| . 1 : for n = 0 , 1 , . . . , N − 1 do 2 : Sample sn ∼ ρx̂ , ŷ ( · ) , an ∼ x̂ ( ·|sn ) , bn ∼ ŷ ( ·|sn ) , sn+1 ∼ P ( ·|sn , an , bn ) . 3 : Vn+1 = Vn − βne ( sn ) ( Vn ( sn ) − r ( sn , an , bn ) − γVn ( sn+1 ) ) where Qk−1 ( s , a , b ) = r ( s , a , b ) + γ ∑ s′ P ( s ′|s , a , b ) Vk−1 ( s′ ) . When it is clear from the context , we drop the subscript of Qk−1 . This is a matrix game and is the sample-complexity bottleneck ( Perolat et al. , 2015 ) . Let ϵg denote the accuracy and xk the output of this stage at iteration k : E [ Es∼U [ max ys∈∆ ( xk ) sQsk−1y s − min xs∈∆ max ys∈∆ xsQsk−1y s ] ] = ϵk1 , ( 3 ) where the outer expectation is over the randomness of the algorithm used to generate xk . • Stage 2 : This step finds an approximate best response . The fixed policy ( xk ) , can be viewed as a part of the environment . Denote yk as the approximate best-response computed in this stage , at iteration k. The resulting value function Vk = V x k , yk is fed to stage 1 in the next iteration . Let ϵe be the accuracy for this stage , yk the output of this stage : E [ Es∼U [ max y V x k , y ( s ) − V x k , yk ( s ) ] ] = ϵk2 , ( 4 ) where the outer expectation is over the randomness of the algorithm used to generate yk . Then , Perolat et al . ( 2015 , Theorem 1 ) , Zhao et al . ( 2021 ) show that the following holds ( see also Appendix C ) . E [ Es∼U [ max y∈∆ V x K , y ( s ) − V ⋆ ( s ) ] ] ≤ |S|K 1− γ Õ ( sup k≤K ϵk1 + sup k≤K ϵk2 ) +O ( |S|γK 1− γ ) . ( 5 )
This paper studies the sample complexity of learning algorithms in two-player zero-sum tabular Markov games. The authors propose a two-stage algorithm that requires agents to agree on an etiquette, which means the agents have behave differently in two stages. Based on two assumptions on stationary state distribution and action exploration that are different from previous works, the authors show two finite-time convergence bounds, which improve much compared with existing results. The most challenging part of their proof is in bounding the approximation error in the first stage, which approximates the equilibrium of a matrix game. The authors also present some numerical results that can verify the performance of the proposed algorithm.
SP:f460a21378458bd0576233891e977f66c010ae62
Sample-efficient actor-critic algorithms with an etiquette for zero-sum Markov games
We introduce algorithms based on natural actor-critic and analyze their sample complexity for solving two player zero-sum Markov games in the tabular case . Our results improve the best-known sample complexities of policy gradient/actorcritic methods for convergence to Nash equilibrium in the multi-agent setting . We use the error propagation scheme in approximate dynamic programming , recent advances for global convergence of policy gradient methods , temporal difference learning , and techniques from stochastic primal-dual optimization . Our algorithms feature two stages , requiring agents to agree on an etiquette before starting their interactions , which is feasible for instance in self-play . However , the agents only access to joint reward and joint next state and not to each other ’ s actions or policies . Our complexity results match the best-known results for global convergence of policy gradient algorithms for single agent RL . We provide numerical verification of our methods for a two player bandit environment and a two player game , Alesia . We observe improved empirical performance as compared to the recently proposed optimistic gradient descent-ascent variant for Markov games . 1 INTRODUCTION . We study two-player zero-sum Markov game framework which is a key model with broad applications in competitive reinforcement learning ( RL ) , robust RL , and many others Zhang et al . ( 2019a ; 2021 ) . This framework is introduced by Shapley ( 1953 ) as stochastic games and popularized in RL with Littman ( 1994 ) . In its basic form , two agents with competing interests interact in an environment where the reward and the state transition depend on the actions of both players . Even with this simplicity , such systems achieved impressive success in game-playing and robotics ( Kober et al. , 2013 ; Silver et al. , 2017 ; Mnih et al. , 2015 ; Vinyals et al. , 2019 ; Brown & Sandholm , 2019 ) . While value-based methods offer near-optimal guarantees ( Sidford et al. , 2020 ; Bai et al. , 2020 ; Bai & Jin , 2020 ; Xie et al. , 2020 ; Tian et al. , 2020 ) , policy gradient ( PG ) methods , including actor-critic ( AC ) and their natural counterparts natural PG ( NPG ) ( Kakade , 2001 ) and natural AC ( NAC ) ( Peters & Schaal , 2008 ) , only have limited guarantees , despite their model-free and easy-to-implement structure , flexibility and generality ( Schulman et al. , 2015 ; 2017 ; Wang et al. , 2016 ) . The PG methods ( Kakade , 2001 ; Sutton et al. , 2000 ) directly optimize the value function in the policy space— a non-convex optimization problem even in the basic single agent , tabular setting . Intriguingly , recent results demonstrate globally optimal convergence of PG methods by identifying a hidden convexity structure for single agent RL ( Agarwal et al. , 2020 ; Cen et al. , 2020 ; Mei et al. , 2020 ; Bhandari & Russo , 2019 ; 2021 ; Xu et al. , 2020b ; Lan , 2021 ; Khodadadian et al. , 2021b ; Hong et al. , 2020 ; Xu et al. , 2020a ; Khodadadian et al. , 2021b ) , and multi-agent RL ( MARL ) ( Daskalakis et al. , 2020 ; Wei et al. , 2021 ; Zhao et al. , 2021 ) . The existing results on PG methods for tabular two-player zero-sum Markov games mostly focus on decentralized algorithms with sample complexities Õ ( ϵ−12.5 ) ( Daskalakis et al. , 2020 ) , Õ ( ϵ−8 ) , and even Õ ( ϵ−4 ) , yet with some limitations ( Wei et al. , 2021 ) ; see Section 1.1 for the details . With function approximation , Zhao et al . ( 2021 ) obtains Õ ( ϵ−6 ) sample complexity when given access to unbiased sampling oracles of the value functions . On the other hand , the best-known sample complexity for global optimality for single agent problem is Õ ( ϵ−2 ) in the tabular case ( Lan , 2021 ) . As this complexity is achieved by value-based/modelbased methods in the multi-agent setting ( Sidford et al. , 2020 ; Zhang et al. , 2020 ) , one expects a similar complexity for policy-based methods . Our work precisely bridges this gap and develops policy gradient methods whose performance for MARL is closer to their single agent counterparts . Contributions . We propose algorithms based on natural actor-critic ( NAC ) framework for solving two-player zero-sum Markov games in the tabular case . Our sample complexity results match the best-known ones for global optimality in the single agent setting ( Lan , 2021 ; Khodadadian et al. , 2021b ; Hong et al. , 2020 ; Xu et al. , 2020b ) . In particular , we show that by using inner loops for policy evaluation and a carefully designed algorithm , the sample complexity to get an ϵ-approximate Nash equilibrium , is Õ ( ϵ−2 ) , by assuming a uniform lower bound on the policies . Without this assumption , we show Õ ( ϵ−4 ) complexity.1 Surprisingly , we achieve these results—to our knowledge , for the first time with policy gradient methods—mostly by a careful adaptation of the recent results for policy gradient methods in single agent setting , temporal difference learning , two-stage error propagation framework of policy iteration ( Perolat et al. , 2015 ) , and by employing techniques from stochastic primal-dual optimization . These developments require a careful algorithm design and analysis . In particular , two-stage nature of the algorithm incurs biases between the stages that we have to control carefully . Obtaining Õ ( ϵ−2 ) complexity requires a tighter analysis for both stages of the algorithm , with strict control on the aforementioned bias . Therefore , it requires more advanced techniques and algorithms , inspired from the stochastic primal-dual optimization literature . We explicitly highlight our important new techniques as insights in the sequel . The full proofs are included in the appendices . 1.1 RELATED WORKS . Policy gradient methods . There is growing interest in global convergence of PG methods in the single agent setting . Several works showed convergence rates of natural policy gradient ( NPG ) in the tabular setting by assuming access to exact value function oracle ( Agarwal et al. , 2020 ; Cen et al. , 2020 ; Mei et al. , 2020 ; Bhandari & Russo , 2019 ; 2021 ) or when value functions are estimated from the data ( Shani et al. , 2020 ; Xu et al. , 2020b ; Lan , 2021 ; Khodadadian et al. , 2021b ; Hong et al. , 2020 ; Xu et al. , 2020a ; Khodadadian et al. , 2021b ) . To our knowledge , the best sample complexity for NPG methods with inner loop for policy evaluation ( which we refer to as NAC ) is Õ ( ϵ−2 ) and is due to ( Lan , 2021 ) . For single loop NAC with online policy evaluation , the best sample complexity is Õ ( ϵ−4 ) as obtained in ( Khodadadian et al. , 2021b ; Hong et al. , 2020 ; Xu et al. , 2020b ) ( see ( Khodadadian et al. , 2021a , Table 1 ) ) . For a general overview of results in MARL we refer to Zhang et al . ( 2019a ) . Policy gradient methods for two-player zero-sum Markov games . With the positive results on global convergence of PG methods , translating these results to the competitive MARL has been the goal of many recent works . In particular , independent policy gradient methods with the agents interacting symmetrically has been considered in Daskalakis et al . ( 2020 ) ; Wei et al . ( 2021 ) . The work of Daskalakis et al . ( 2020 ) built on Agarwal et al . ( 2020 ) by using REINFORCE estimator ( Williams , 1992 ) and obtained sample complexity of Õ ( ϵ−12.5 ) for reaching to one-sided Nash equilibrium . The algorithm of Wei et al . ( 2021 ) built on optimistic gradient descent-ascent ( OGDA ) method combined with a running estimate of the value function , obtaining Õ ( ϵ−8 ) sample complexity for finding a policy pair with small duality gap . In addition , Wei et al . ( 2021 ) showed improved complexity Õ ( ϵ−4 ) when restricted to Euclidean projections onto the simplex with metric subregularity assumption . There are two subtleties about this result : First , as pointed out in Daskalakis et al . ( 2020 ) , metric subregularity constant can be arbitrarily small , resulting in degradation of the rate . Second , as also pointed out by Wei et al . ( 2021 ) , this result is limited to Euclidean setting and can not be extended to the NPG with softmax policy update , which requires projection with KL divergence . The algorithm can be seen similar to the gradient ascent algorithm in Agarwal et al . ( 2020 ) . As 1In Appendix E , we design an algorithm based on single loop NAC with the complexity of Õ ( ϵ−4 ) ( and O ( ϵ−7 ) without assuming lower bounded policies ) . Our results on this algorithm is , to our knowledge , the first finite-sample analysis of single loop NAC-based methods for two-player zero-sum Markov games . x , y is the time that it takes to go from state s to state s′ by using policy pair x , y ( Wei et al. , 2021 , Assumption 1 ) . ‡This Õ ( ϵ−4 ) complexity by Wei et al . ( 2021 ) requires using Euclidean projections onto the simplex instead of softmax updates and depends on the metric subregularity constant . Hence it is not applicable to NPG . shown in Agarwal et al . ( 2020 ) for single agent problems , NPG methods have much better convergence properties than Euclidean projected gradient ascent methods . For comparison with the works in Daskalakis et al . ( 2020 ) ; Wei et al . ( 2021 ) , we also refer to Remark 2.1 and Table 1 . Another very related work to ours is by Zhao et al . ( 2021 ) which considered ( i ) tabular setting with exact value functions and ( ii ) online setting with function approximation , also using the error propagation scheme of Perolat et al . ( 2015 ) . Building on Agarwal et al . ( 2020 ) , this work showed Õ ( ϵ−6 ) sample complexity with function approximation , with access to unbiased samples of the value functions . In contrast , we focus on the tabular setting and we do not assume access to unbiased value function oracles . Indeed , lack of unbiased samples for value functions required us to use new insights described in the sequel , to derive the tighter complexities Õ ( ϵ−2 ) and Õ ( ϵ−4 ) . Policy gradient methods for linear quadratic regulator ( LQR ) . For zero-sum LQR , Zhang et al . ( 2019b ) ; Bu et al . ( 2019 ) showed global convergence of PG with exact value function oracles . These methods have a nested structure where one player computes best-response and the other does policy gradient updates . Recently , Zhang et al . ( 2021 ) built on Zhang et al . ( 2019b ) to derive sample complexities when value functions are estimated from data . 2 PRELIMINARIES . Notation . We consider the tabular setting with finite state and action spaces denoted by S , A , B and the discount factor γ < 1 . The policy of the min agent is x and the max agent is y , with action sets A , B , respectively . At state s , both agents take actions independent of each other : a ∼ x ( ·|s ) and b ∼ y ( ·|s ) . Based on the actions , the environment transitions to the next state s′ ∼ P ( ·|s , a , b ) and the agents receive reward |r ( s , a , b ) | ≤ 1 . Given a policy pair x , y , we denote the induced steadystate distribution as ρx , y . Let U denote the uniform distribution for states that we also take as the initial state distribution for simplicity . We denote the probability simplex as ∆ . Given a policy x , we sometimes use the notation xs for x ( ·|s ) in the proofs . We use e ( st ) ∈ R|S| to denote the vector such that e ( s ) = 1 if s = st and e ( s ) = 0 , if s ̸= st. We use the same notation for e ( st , at ) . The value function for state s is defined as V x , y ( s ) = Ex , y [ ∞∑ t=0 γtr ( st , at , bt ) |s0 = s ] , where Ex , y is over random variables st , at , bt for all t ≥ 0 as at ∼ x ( ·|st ) , bt ∼ y ( ·|st ) and st+1 ∼ P ( ·|st , at , bt ) . Similarly , the action value function is defined as Qx , y ( s , a , b ) = Ex , y [ ∑∞ t=0 γ tr ( st , at , bt ) |s0 = s , a0 = a , b0 = b ] . With these definitions , we can state the formal problem . For all s ∈ S , we aim to solve min x ( ·|s ) ∈∆ max y ( ·|s ) ∈∆ V x , y ( s ) . We denote the information needed in algorithms as oracles . We provide the background on NPG , NAC , TD ( 0 ) in Appendix A. Nash equilibrium . We assume the existence of a pair of policies x⋆ , y⋆ that are Nash equilibrium , namely , for all s , V x ⋆ , y ( s ) ≤ V ⋆ ( s ) : = V x⋆ , y⋆ ( s ) ≤ V x , y⋆ ( s ) . We are interested in finding a onesided Nash equilibrium , similar to Daskalakis et al . ( 2020 ) ; Zhao et al . ( 2021 ) ; Zhang et al . ( 2019b ) ; Bu et al . ( 2019 ) . As mentioned in Daskalakis et al . ( 2020 ) , for the other player , one can re-run the algorithm by switching roles to have the guarantee for both players . In particular , for the initial state distribution U , we seek for xout such that Es0∼U [ max y V xout , y ( s0 ) − V ⋆ ( s0 ) ] ≤ ϵ . It is easy to prove that this quantity on the LHS is 0 if and only if xout is a Nash equilibrium . Interaction procedure . We use the interactions of the agents with the environment to estimate the value functions and related oracles for the running of the algorithm . At each interaction , agents have access to ( si , ai , r ( si , ai , bi ) , si+1 ) and ( si , bi , r ( si , ai , bi ) , si+1 ) , respectively . In terms of access of agents , our oracle model is similar to Daskalakis et al . ( 2020 ) ; Wei et al . ( 2021 ) . However , one difference is that we require a game etiquette : Our algorithms have two stages where the agents have to behave differently . As long as this etiquette is respected by the agents ( for example embedded to players in the beginning of the game ) , they do not need further communication . Softmax update rule/NAC . Given Kullback-Leibler divergence KL and action-value function Qxt , xt+1 ( ·|s ) = PKL ( xt ( ·|s ) , Qxt ( s , · ) ) : = arg min x ( ·|s ) ∈∆ ⟨Qxt ( s , · ) , x ( ·|s ) ⟩+KL ( x ( ·|s ) , xt ( ·|s ) ) , ( 1 ) is known as NPG with softmax parameterization ( Agarwal et al. , 2020 , Lemma 5.1 ) . When there is a critic estimating Qxt , along with actor updating xt with NPG , this algorithmic framework is called natural actor-critic , in short , NAC . We focus on KL divergence for simplicity and its wide use . Our developments also hold for more general Bregman divergences as Zhan et al . ( 2021 ) . Assumption 1 . There exists ρ such that , for any policy iterate pair xt , yt , for any state s , it holds that ρxt , yt ( s ) ≥ ρ > 0 , where ρxt , yt is the stationary state distribution induced by the policy pair . Assumption2 . There exist x , y such that , for any policy iterate pair xt , yt , for any state action tuple s , a , b , it holds that xt ( a|s ) ≥ x > 0 , yt ( b|s ) ≥ y > 0 . Our rationale on the assumptions . Assumption 1 and 2 essentially mean positive definiteness of the sampling matrices in policy evaluation ( see eqs . ( 30 ) , ( 34 ) and ( 42 ) ) . To our knowledge , some form of this assumption is required in most of the existing work on temporal difference ( TD ) ( including TD ( 0 ) ) methods for policy evaluation ( Bhandari et al. , 2018 ; Xu et al. , 2020b ; Khodadadian et al. , 2021a ; Lan , 2021 ; Hong et al. , 2020 ; Xu et al. , 2020a ; Wu et al. , 2020 ; Zou et al. , 2019 ) ( see App . A ) . The complexity Õ ( ϵ−2 ) requires Assumption 2 even for single agent problems ( see ( Lan , 2021 , Rem . 1 , Sec . 5.2 ) ) . Remark 2.1 . As summarized in Table 1 , similar assumptions to Assumption1 are used in Daskalakis et al . ( 2020 ) ; Wei et al . ( 2021 ) . In particular , each of these assumptions ensure that all action-state pairs are observed with nonzero probability throughout the game . Moreover , by additionally requiring Assumption 2 , we can obtain the complexity Õ ( ϵ−2 ) , matching the single-agent counterpart . Markovian bias . For simplicity , we assume that we sample from the steady state distribution of a given policy pair . During normal interaction with the environment , this is not the case and we obtain a single stream of data . Hence , TD ( 0 ) update is biased—commonly referred to as the Markovian bias . A large body of literature in the single agent literature showed that the effect of this bias in TD ( 0 ) update is essentially additive and can be handled by assuming uniform mixing of the induced Markov chain ( Wu et al. , 2020 ; Bhandari et al. , 2018 ; Zou et al. , 2019 ; Khodadadian et al. , 2021b ; Xu et al. , 2020b ; a ) . These analyses apply to our policy evaluation routines , extending them to the Markovian setting . For simplicity , we show our techniques with i.i.d . assumption and then illustrate how the extension with Markovian data follows with the uniform mixing assumption in Appendix D. Error propagation for approximate dynamic programming . Perolat et al . ( 2015 ) proposed error propagation analysis for approximate version of generalized policy iteration for zero-sum Markov games ( see Appendix C ) . The authors showed that the following two-stage algorithm converges : • Stage 1 : Given a fixed value function Vk−1 , find the policy pair which is an ϵ-equilibrium . min xs∈∆ max ys∈∆ ∑ a , b x ( a|s ) y ( a|s ) Qk−1 ( s , a , b ) = : xsQsk−1ys , ( 2 ) Algorithm 1 Reflected NAC with a game etiquette and ζ-greedy exploration Require : PKL defined in ( 1 ) in Sec . 2 . Exploration parameter ζ ≥ 0 ( with equality if Assumption 2 holds ) . Subroutines Policy-Eval-V , Policy-Eval-θ , Policy-Eval-ν ( see Alg . 2 , 3 , 4 and note βνn , β θ n , β ω n are potential step sizes for this routine ) . Initial policies x0 , y0 , ȳ0 . xk , yk denote outer , xt , yt denote inner loop ’ s iterate . 1 : for k = 0 , 1 , . . . do 2 : Stage 1 // Approximately solve a matrix game 3 : for t = 0 , 1 , . . . , T − 1 do 4 : [ V̂ xk−1 , V̂ y k−1 ] = [ Policy-Eval-V ( x k−1 , yk−1 , N , βωn ) , Policy-Eval-V ( x k−1 , yk−1 , N , βωn ) ] // Both players compute their own estimations of Vk−1 , denoted as V̂ x and V̂ y 5 : [ θ̂xt+1 , θ̂ y t+1 ] = [ Policy-Eval-θ ( xt , yt , N , V̂ x k−1 , β θ n ) , Policy-Eval-θ ( xt , yt , N , V̂ y k−1 , β θ n ) ] 6 : xt+1 ( ·|s ) = PKL ( xt ( ·|s ) , η ( 2θ̂xt+1 ( s , · ) − θ̂xt ( s , · ) ) ) 7 : yt+1 ( ·|s ) = PKL ( yt ( ·|s ) , −η ( 2θ̂yt+1 ( s , · ) − θ̂ y t ( s , · ) ) ) 8 : Output xk = 1T ∑T t=1 xt . 9 : Stage 2 // Approximately find best response 10 : for t = 0 , 1 , . . . , T − 1 do 11 : ν̂t+1 = Policy-Eval-ν ( xk , ȳt , N , β = βνn ) 12 : ȳt+1 ( ·|s ) = PKL ( ȳt ( ·|s ) , −ην̂t+1 ( s , · ) ) 13 : Output yk = ȳt̂ , where t̂ ∈ [ T ] is selected uniformly at random . Algorithm 2 VN = Policy-Eval-V ( x , y , N , β ) Require : Policy pair x , y , iteration counter N , step size β , initial value function estimate V0 . x̂ ( ·|s ) = ( 1− ζ ) x ( ·|s ) + ζ|A| , ŷ ( ·|s ) = ( 1− ζ ) y ( ·|s ) + ζ |B| . 1 : for n = 0 , 1 , . . . , N − 1 do 2 : Sample sn ∼ ρx̂ , ŷ ( · ) , an ∼ x̂ ( ·|sn ) , bn ∼ ŷ ( ·|sn ) , sn+1 ∼ P ( ·|sn , an , bn ) . 3 : Vn+1 = Vn − βne ( sn ) ( Vn ( sn ) − r ( sn , an , bn ) − γVn ( sn+1 ) ) where Qk−1 ( s , a , b ) = r ( s , a , b ) + γ ∑ s′ P ( s ′|s , a , b ) Vk−1 ( s′ ) . When it is clear from the context , we drop the subscript of Qk−1 . This is a matrix game and is the sample-complexity bottleneck ( Perolat et al. , 2015 ) . Let ϵg denote the accuracy and xk the output of this stage at iteration k : E [ Es∼U [ max ys∈∆ ( xk ) sQsk−1y s − min xs∈∆ max ys∈∆ xsQsk−1y s ] ] = ϵk1 , ( 3 ) where the outer expectation is over the randomness of the algorithm used to generate xk . • Stage 2 : This step finds an approximate best response . The fixed policy ( xk ) , can be viewed as a part of the environment . Denote yk as the approximate best-response computed in this stage , at iteration k. The resulting value function Vk = V x k , yk is fed to stage 1 in the next iteration . Let ϵe be the accuracy for this stage , yk the output of this stage : E [ Es∼U [ max y V x k , y ( s ) − V x k , yk ( s ) ] ] = ϵk2 , ( 4 ) where the outer expectation is over the randomness of the algorithm used to generate yk . Then , Perolat et al . ( 2015 , Theorem 1 ) , Zhao et al . ( 2021 ) show that the following holds ( see also Appendix C ) . E [ Es∼U [ max y∈∆ V x K , y ( s ) − V ⋆ ( s ) ] ] ≤ |S|K 1− γ Õ ( sup k≤K ϵk1 + sup k≤K ϵk2 ) +O ( |S|γK 1− γ ) . ( 5 )
This work proposes a natural actor-critic (NAC) algorithm for two-player zero-sum Markov game in the tabular case. The algorithm is model-free, private, but asymmetric, and the convergence guarantee is established in terms of the expected one-sided Nash-equilibrium duality gap. Among the existing policy-based algorithms for the two-player zero-sum Markov game, this is the first work that claims to achieve the best-known sample complexities of policy gradient algorithms for single-agent RL.
SP:f460a21378458bd0576233891e977f66c010ae62
PER-ETD: A Polynomially Efficient Emphatic Temporal Difference Learning Method
1 INTRODUCTION . As a major value function evaluation method , temporal difference ( TD ) learning ( Sutton , 1988 ; Dayan , 1992 ) has been widely used in various planning problems in reinforcement learning . Although TD learning performs successfully in the on-policy settings , where an agent can interact with environments under the target policy , it can perform poorly or even diverge under the off-policy settings when the agent only has access to data sampled by a behavior policy ( Baird , 1995 ; Tsitsiklis & Van Roy , 1997 ; Mahmood et al. , 2015 ) . To address such an issue , the gradient temporal-difference ( GTD ) ( Sutton et al. , 2008 ) and least-squares temporal difference ( LSTD ) ( Yu , 2010 ) algorithms have been proposed , which have been shown to converge in the off-policy settings . However , since GTD and LSTD consider an objective function based on the behavior policy , which adjusts only the distribution mismatch of the action and does not adjust the distribution mismatch of the state , their converging points can be largely biased from the true value function due to the distribution mismatch between the target and behavior policies , even when the express power of the function approximation class is arbitrarily large ( Kolter , 2011 ) . In order to provide a more accurate evaluation , Sutton et al . ( 2016 ) proposed the emphatic temporal difference ( ETD ) algorithm , which introduces the follow-on trace to address the distribution mismatch issue and thus adjusts both state and action distribution mismatch . The stability of ETD was then shown in Sutton et al . ( 2016 ) ; Mahmood et al . ( 2015 ) , and the asymptotic convergence guarantee for ETD was established in Yu ( 2015 ) , it has also achieved great success in many tasks ( Ghiassian et al. , 2016 ; Ni , 2021 ) . However , although ETD can address the distribution mismatch issue to yield a more accurate evaluation , it often suffers from very large variance error due to the follow-on trace estimation over a long or infinite time horizon ( Hallak et al. , 2016 ) . Consequently , the convergence of ETD can be unstable . It can be shown that the variance of ETD can grow exponentially fast as the number of iterations grow so that ETD requires exponentially large number of samples to converge . Hallak et al . ( 2016 ) proposed an ETD method to keep the follow-on trace bounded but at the cost of a possibly large bias error . This thus poses the following intriguing question : Can we design a new ETD method , which overcomes its large variance without introducing a large bias error , and improves its exponential sample complexity to be polynomial at the same time ? In this work , we provide an affirmative answer . 1.1 MAIN CONTRIBUTIONS . We propose a novel ETD approach , called PER-ETD ( i.e. , PEriodically Restarted-ETD ) , in which for each update of the value function parameter we restart the follow-on trace iteration and update it only for b times ( where we call b as the period length ) . Such a periodic restart effectively reduces the variance of the follow-on trace . More importantly , with the design of the period length b to increase logarithmically with the number of iterations , PER-ETD attains the polynomial rather than exponential sample complexity required by ETD . We provide the theoretical guarantee of the sample efficiency of PER-ETD via the finite-time analysis . We show that PER-ETD ( both PER-ETD ( 0 ) and PER-ETD ( λ ) ) converges to the same fixed points of ETD ( 0 ) and ETD ( λ ) , respectively , but with only polynomial sample complexity ( whereas ETD takes exponential sample complexity ) . Our analysis features the following key insights . ( a ) The period length b plays the role of trading off between the variance ( of the follow-on trace ) and bias error ( with respect to the fixed point of ETD ) , and its optimal choice of logarithmical increase with the number of iterations achieves the best tradeoff and keeps both errors vanishing sublinearly . ( b ) Our analysis captures how the mismatch between the behavior and target policies affects the convergence rate of PER-ETD . Interestingly , the mismatch level determines a phase-transition phenomenon of PER-ETD : as long as the mismatch is below a certain threshold , then PER-ETD achieves the same convergence rate as the on-policy TD algorithm ; and if the mismatch is above the threshold , the converge rate of PER-ETD gradually decays as the level of mismatch increases . Experimentally , we demonstrate that PER-ETD converges in the case that neither TD nor ETD converges . Further , our experiments provide the following two interesting observations . ( a ) There does exist a choice of the period length for PER-ETD , which attains the best tradeoff between the variance and bias errors . Below such a choice , the bias error is large so that evaluation is not accurate , and above it the variance error is large so that the convergence is unstable . ( b ) Under a small period length b , it is not always the case that PER-ETD ( λ ) with λ = 1 attains the smallest error with respect to the ground truth value function . The best λ depends on the geometry of the locations of fixed points of PER-ETD ( λ ) for 0 ≤ λ ≤ 1 , which is determined by chosen features . 1.2 RELATED WORKS . TD learning and GTD : The asymptotic convergence of TD learning was established by Sutton ( 1988 ) ; Jaakkola et al . ( 1994 ) ; Dayan & Sejnowski ( 1994 ) ; Tsitsiklis & Van Roy ( 1997 ) , and its nonasymptotic convergence rate was further characterized recently in Dalal et al . ( 2018a ) ; Bhandari et al . ( 2018 ) ; Kotsalis et al . ( 2020 ) ; Chen et al . ( 2019 ) ; Kaledin et al . ( 2020 ) ; Hu & Syed ( 2019 ) ; Srikant & Ying ( 2019 ) . The gradient temporal-difference ( GTD ) was proposed in Sutton et al . ( 2008 ) for off-policy evaluation and was shown to converge asymptotically . Then , Dalal et al . ( 2018b ) ; Gupta et al . ( 2019 ) ; Wang et al . ( 2018 ) ; Xu et al . ( 2019 ) ; Xu & Liang ( 2021 ) provided the finite-time analysis of GTD and its variants . Emphatic Temporal Difference ( ETD ) Learning : The ETD approach was originally proposed in the seminal work Sutton et al . ( 2016 ) , which introduced the follow-on trace to overcome the distribution mismatch between the behavior and target policies . Yu ( 2015 ) provided the asymptotic convergence guarantee for ETD . Hallak et al . ( 2016 ) showed that the variance of the follow-on trace may be unbounded . They further proposed an ETD method with a variable decay rate to keep the follow-on trace bounded but at the cost of a possibly large bias error . Our approach is different and keeps both the variance and bias vanishing sublinearly with the number of iterations . Imani et al . ( 2018 ) developed a new policy gradient theorem , where the emphatic weight is used to correct the distribution shift . Zhang et al . ( 2020b ) provided a new variant of ETD , where the emphatic weights are estimated through function approximation . Van Hasselt et al . ( 2018 ) ; Jiang et al . ( 2021 ) studied ETD with deep neural function class . Comparison to concurrent work : During our preparation of this paper , a concurrent work ( Zhang & Whiteson , 2021 ) was posted on arXiv , and proposed a truncated ETD ( which we refer to as T-ETD for short here ) , which truncates the update of the follow-on trace to reduce the variance of ETD . While T-ETD and our PER-ETD share a similar design idea , there are several critical differences between our work from Zhang & Whiteson ( 2021 ) . ( a ) Our PER-ETD features a design of the logarithmical increase of the restart period with the number of iterations , which guarantees the convergence to the original fixed point of ETD , with both the variance and bias errors vanishing sublinearly . However , T-ETD is guaranteed to converge only to a truncation-length-dependent fixed point , where the convergence is obtained by treating the truncation length as a constant . A careful review of the convergence proof indicates that the variance term scales exponentially fast with the truncation length , and hence the polynomial efficiency is not guaranteed as the truncation length becomes large . ( b ) Our convergence rate for PER-ETD does not depend on the cardinality of the state space and has only polynomial dependence on the mismatch parameter of the behavior and target policies . However , the convergence rate in Zhang & Whiteson ( 2021 ) scales with the cardinality of the state space , and increases exponentially fast with the mismatch parameter of behavior and target policies . ( c ) This paper further studies PER-ETD ( λ ) and the impact of λ on the converge rate and variance and bias errors , whereas Zhang & Whiteson ( 2021 ) considers further the application of T-ETD to the control problem . 2 BACKGROUND AND PRELIMINARIES . 2.1 MARKOV DECISION PROCESS . We consider the infinite-horizon Markov decision process ( MDP ) defined by the five tuple ( S , A , r , P , γ ) . Here , S and A denote the state and action spaces respectively , which are both assumed to be finite sets , r : S ×A → R denotes the reward function , P : S ×A → ∆ ( S ) denotes the transition kernel , where ∆ ( S ) denotes the probability simplex over the state space S , and γ ∈ ( 0 , 1 ) is the discount factor . A policy π : S → ∆ ( A ) of an agent maps from the state space to the probability simplex over the action space A , i.e. , π ( a|s ) represents the probability of taking the action a under the state s. At any time t , given that the system is at the state st , the agent takes an action at with the probability π ( at|st ) , and receives a reward r ( st , at ) . The system then takes a transition to the next state st+1 at time t+ 1 with the probability P ( st+1|st , at ) . For a given policy π , we define the value function corresponding to an initial state s0 = s ∈ S as Vπ ( s ) = E [ ∑∞ t=0 γ tr ( st , at ) |s0 = s , π ] . Then the value function over the state space can be expressed as a vector Vπ = ( Vπ ( 1 ) , Vπ ( 2 ) , . . . , Vπ ( |S| ) ) > ∈ R|S| . Here , Vπ is a deterministic function of the policy π . We use capitalized characters to be consistent with the literature . When the state space is large , we approximate the value function Vπ via a linear function class as Vθ ( s ) = φ > ( s ) θ , where φ ( s ) ∈ Rd denotes the feature vector , and θ ∈ Rd denotes the parameter vector to be learned . We further let Φ = [ φ ( 1 ) , φ ( 2 ) , . . . , φ ( |S| ) ] > denote the feature matrix , and then Vθ = Φθ . We assume that the feature matrix Φ has linearly independent columns and each feature vector has bounded ` 2-norm , i.e. , ‖φ ( s ) ‖2 ≤ Bφ for all s ∈ S .
This paper proposed a new off-policy evaluation successor method of ETD. The method has reduced variance by leveraging a simple and effective way that restarting follow-on trace iteration every couple of updates. The authors also provide theoretical analysis that shows that the proposed method improves the converge rate from an exponential one to a polynomial one with the guarantee of the same fixed converging points. The empirical results show that the proposed method could converge in the case that neither TD nor ETD does.
SP:8b914a5ce2dae75515370f788c99b04039218fd4
PER-ETD: A Polynomially Efficient Emphatic Temporal Difference Learning Method
1 INTRODUCTION . As a major value function evaluation method , temporal difference ( TD ) learning ( Sutton , 1988 ; Dayan , 1992 ) has been widely used in various planning problems in reinforcement learning . Although TD learning performs successfully in the on-policy settings , where an agent can interact with environments under the target policy , it can perform poorly or even diverge under the off-policy settings when the agent only has access to data sampled by a behavior policy ( Baird , 1995 ; Tsitsiklis & Van Roy , 1997 ; Mahmood et al. , 2015 ) . To address such an issue , the gradient temporal-difference ( GTD ) ( Sutton et al. , 2008 ) and least-squares temporal difference ( LSTD ) ( Yu , 2010 ) algorithms have been proposed , which have been shown to converge in the off-policy settings . However , since GTD and LSTD consider an objective function based on the behavior policy , which adjusts only the distribution mismatch of the action and does not adjust the distribution mismatch of the state , their converging points can be largely biased from the true value function due to the distribution mismatch between the target and behavior policies , even when the express power of the function approximation class is arbitrarily large ( Kolter , 2011 ) . In order to provide a more accurate evaluation , Sutton et al . ( 2016 ) proposed the emphatic temporal difference ( ETD ) algorithm , which introduces the follow-on trace to address the distribution mismatch issue and thus adjusts both state and action distribution mismatch . The stability of ETD was then shown in Sutton et al . ( 2016 ) ; Mahmood et al . ( 2015 ) , and the asymptotic convergence guarantee for ETD was established in Yu ( 2015 ) , it has also achieved great success in many tasks ( Ghiassian et al. , 2016 ; Ni , 2021 ) . However , although ETD can address the distribution mismatch issue to yield a more accurate evaluation , it often suffers from very large variance error due to the follow-on trace estimation over a long or infinite time horizon ( Hallak et al. , 2016 ) . Consequently , the convergence of ETD can be unstable . It can be shown that the variance of ETD can grow exponentially fast as the number of iterations grow so that ETD requires exponentially large number of samples to converge . Hallak et al . ( 2016 ) proposed an ETD method to keep the follow-on trace bounded but at the cost of a possibly large bias error . This thus poses the following intriguing question : Can we design a new ETD method , which overcomes its large variance without introducing a large bias error , and improves its exponential sample complexity to be polynomial at the same time ? In this work , we provide an affirmative answer . 1.1 MAIN CONTRIBUTIONS . We propose a novel ETD approach , called PER-ETD ( i.e. , PEriodically Restarted-ETD ) , in which for each update of the value function parameter we restart the follow-on trace iteration and update it only for b times ( where we call b as the period length ) . Such a periodic restart effectively reduces the variance of the follow-on trace . More importantly , with the design of the period length b to increase logarithmically with the number of iterations , PER-ETD attains the polynomial rather than exponential sample complexity required by ETD . We provide the theoretical guarantee of the sample efficiency of PER-ETD via the finite-time analysis . We show that PER-ETD ( both PER-ETD ( 0 ) and PER-ETD ( λ ) ) converges to the same fixed points of ETD ( 0 ) and ETD ( λ ) , respectively , but with only polynomial sample complexity ( whereas ETD takes exponential sample complexity ) . Our analysis features the following key insights . ( a ) The period length b plays the role of trading off between the variance ( of the follow-on trace ) and bias error ( with respect to the fixed point of ETD ) , and its optimal choice of logarithmical increase with the number of iterations achieves the best tradeoff and keeps both errors vanishing sublinearly . ( b ) Our analysis captures how the mismatch between the behavior and target policies affects the convergence rate of PER-ETD . Interestingly , the mismatch level determines a phase-transition phenomenon of PER-ETD : as long as the mismatch is below a certain threshold , then PER-ETD achieves the same convergence rate as the on-policy TD algorithm ; and if the mismatch is above the threshold , the converge rate of PER-ETD gradually decays as the level of mismatch increases . Experimentally , we demonstrate that PER-ETD converges in the case that neither TD nor ETD converges . Further , our experiments provide the following two interesting observations . ( a ) There does exist a choice of the period length for PER-ETD , which attains the best tradeoff between the variance and bias errors . Below such a choice , the bias error is large so that evaluation is not accurate , and above it the variance error is large so that the convergence is unstable . ( b ) Under a small period length b , it is not always the case that PER-ETD ( λ ) with λ = 1 attains the smallest error with respect to the ground truth value function . The best λ depends on the geometry of the locations of fixed points of PER-ETD ( λ ) for 0 ≤ λ ≤ 1 , which is determined by chosen features . 1.2 RELATED WORKS . TD learning and GTD : The asymptotic convergence of TD learning was established by Sutton ( 1988 ) ; Jaakkola et al . ( 1994 ) ; Dayan & Sejnowski ( 1994 ) ; Tsitsiklis & Van Roy ( 1997 ) , and its nonasymptotic convergence rate was further characterized recently in Dalal et al . ( 2018a ) ; Bhandari et al . ( 2018 ) ; Kotsalis et al . ( 2020 ) ; Chen et al . ( 2019 ) ; Kaledin et al . ( 2020 ) ; Hu & Syed ( 2019 ) ; Srikant & Ying ( 2019 ) . The gradient temporal-difference ( GTD ) was proposed in Sutton et al . ( 2008 ) for off-policy evaluation and was shown to converge asymptotically . Then , Dalal et al . ( 2018b ) ; Gupta et al . ( 2019 ) ; Wang et al . ( 2018 ) ; Xu et al . ( 2019 ) ; Xu & Liang ( 2021 ) provided the finite-time analysis of GTD and its variants . Emphatic Temporal Difference ( ETD ) Learning : The ETD approach was originally proposed in the seminal work Sutton et al . ( 2016 ) , which introduced the follow-on trace to overcome the distribution mismatch between the behavior and target policies . Yu ( 2015 ) provided the asymptotic convergence guarantee for ETD . Hallak et al . ( 2016 ) showed that the variance of the follow-on trace may be unbounded . They further proposed an ETD method with a variable decay rate to keep the follow-on trace bounded but at the cost of a possibly large bias error . Our approach is different and keeps both the variance and bias vanishing sublinearly with the number of iterations . Imani et al . ( 2018 ) developed a new policy gradient theorem , where the emphatic weight is used to correct the distribution shift . Zhang et al . ( 2020b ) provided a new variant of ETD , where the emphatic weights are estimated through function approximation . Van Hasselt et al . ( 2018 ) ; Jiang et al . ( 2021 ) studied ETD with deep neural function class . Comparison to concurrent work : During our preparation of this paper , a concurrent work ( Zhang & Whiteson , 2021 ) was posted on arXiv , and proposed a truncated ETD ( which we refer to as T-ETD for short here ) , which truncates the update of the follow-on trace to reduce the variance of ETD . While T-ETD and our PER-ETD share a similar design idea , there are several critical differences between our work from Zhang & Whiteson ( 2021 ) . ( a ) Our PER-ETD features a design of the logarithmical increase of the restart period with the number of iterations , which guarantees the convergence to the original fixed point of ETD , with both the variance and bias errors vanishing sublinearly . However , T-ETD is guaranteed to converge only to a truncation-length-dependent fixed point , where the convergence is obtained by treating the truncation length as a constant . A careful review of the convergence proof indicates that the variance term scales exponentially fast with the truncation length , and hence the polynomial efficiency is not guaranteed as the truncation length becomes large . ( b ) Our convergence rate for PER-ETD does not depend on the cardinality of the state space and has only polynomial dependence on the mismatch parameter of the behavior and target policies . However , the convergence rate in Zhang & Whiteson ( 2021 ) scales with the cardinality of the state space , and increases exponentially fast with the mismatch parameter of behavior and target policies . ( c ) This paper further studies PER-ETD ( λ ) and the impact of λ on the converge rate and variance and bias errors , whereas Zhang & Whiteson ( 2021 ) considers further the application of T-ETD to the control problem . 2 BACKGROUND AND PRELIMINARIES . 2.1 MARKOV DECISION PROCESS . We consider the infinite-horizon Markov decision process ( MDP ) defined by the five tuple ( S , A , r , P , γ ) . Here , S and A denote the state and action spaces respectively , which are both assumed to be finite sets , r : S ×A → R denotes the reward function , P : S ×A → ∆ ( S ) denotes the transition kernel , where ∆ ( S ) denotes the probability simplex over the state space S , and γ ∈ ( 0 , 1 ) is the discount factor . A policy π : S → ∆ ( A ) of an agent maps from the state space to the probability simplex over the action space A , i.e. , π ( a|s ) represents the probability of taking the action a under the state s. At any time t , given that the system is at the state st , the agent takes an action at with the probability π ( at|st ) , and receives a reward r ( st , at ) . The system then takes a transition to the next state st+1 at time t+ 1 with the probability P ( st+1|st , at ) . For a given policy π , we define the value function corresponding to an initial state s0 = s ∈ S as Vπ ( s ) = E [ ∑∞ t=0 γ tr ( st , at ) |s0 = s , π ] . Then the value function over the state space can be expressed as a vector Vπ = ( Vπ ( 1 ) , Vπ ( 2 ) , . . . , Vπ ( |S| ) ) > ∈ R|S| . Here , Vπ is a deterministic function of the policy π . We use capitalized characters to be consistent with the literature . When the state space is large , we approximate the value function Vπ via a linear function class as Vθ ( s ) = φ > ( s ) θ , where φ ( s ) ∈ Rd denotes the feature vector , and θ ∈ Rd denotes the parameter vector to be learned . We further let Φ = [ φ ( 1 ) , φ ( 2 ) , . . . , φ ( |S| ) ] > denote the feature matrix , and then Vθ = Φθ . We assume that the feature matrix Φ has linearly independent columns and each feature vector has bounded ` 2-norm , i.e. , ‖φ ( s ) ‖2 ≤ Bφ for all s ∈ S .
The authors propose an improved variant of emphatic temporal difference (ETD) aimed at addressing issues of high variance when faced with a large mismatch between behavior and target policies. The main improvement of PER-ETD, the proposed algorithm, comes from periodically clearing the follow-on trace at logarthmically increasing periods. The authors present a finite-time analysis for both the PER-ETD(0) and PER-ETD($\lambda$) case showing how bias and variance depends on the time between clearing the trace. This is used to derive a schedule that effectively minimizes the variance and bias to achieve polynomial sample complexity. The authors conclude by illustrating these improved properties in Baird's counter-example MDP. The results confirm the effect on bias and variance of the period parameter and highlight's that $\lambda=1$ no longer results in the closest fixed-point to the optimal solution.
SP:8b914a5ce2dae75515370f788c99b04039218fd4
PER-ETD: A Polynomially Efficient Emphatic Temporal Difference Learning Method
1 INTRODUCTION . As a major value function evaluation method , temporal difference ( TD ) learning ( Sutton , 1988 ; Dayan , 1992 ) has been widely used in various planning problems in reinforcement learning . Although TD learning performs successfully in the on-policy settings , where an agent can interact with environments under the target policy , it can perform poorly or even diverge under the off-policy settings when the agent only has access to data sampled by a behavior policy ( Baird , 1995 ; Tsitsiklis & Van Roy , 1997 ; Mahmood et al. , 2015 ) . To address such an issue , the gradient temporal-difference ( GTD ) ( Sutton et al. , 2008 ) and least-squares temporal difference ( LSTD ) ( Yu , 2010 ) algorithms have been proposed , which have been shown to converge in the off-policy settings . However , since GTD and LSTD consider an objective function based on the behavior policy , which adjusts only the distribution mismatch of the action and does not adjust the distribution mismatch of the state , their converging points can be largely biased from the true value function due to the distribution mismatch between the target and behavior policies , even when the express power of the function approximation class is arbitrarily large ( Kolter , 2011 ) . In order to provide a more accurate evaluation , Sutton et al . ( 2016 ) proposed the emphatic temporal difference ( ETD ) algorithm , which introduces the follow-on trace to address the distribution mismatch issue and thus adjusts both state and action distribution mismatch . The stability of ETD was then shown in Sutton et al . ( 2016 ) ; Mahmood et al . ( 2015 ) , and the asymptotic convergence guarantee for ETD was established in Yu ( 2015 ) , it has also achieved great success in many tasks ( Ghiassian et al. , 2016 ; Ni , 2021 ) . However , although ETD can address the distribution mismatch issue to yield a more accurate evaluation , it often suffers from very large variance error due to the follow-on trace estimation over a long or infinite time horizon ( Hallak et al. , 2016 ) . Consequently , the convergence of ETD can be unstable . It can be shown that the variance of ETD can grow exponentially fast as the number of iterations grow so that ETD requires exponentially large number of samples to converge . Hallak et al . ( 2016 ) proposed an ETD method to keep the follow-on trace bounded but at the cost of a possibly large bias error . This thus poses the following intriguing question : Can we design a new ETD method , which overcomes its large variance without introducing a large bias error , and improves its exponential sample complexity to be polynomial at the same time ? In this work , we provide an affirmative answer . 1.1 MAIN CONTRIBUTIONS . We propose a novel ETD approach , called PER-ETD ( i.e. , PEriodically Restarted-ETD ) , in which for each update of the value function parameter we restart the follow-on trace iteration and update it only for b times ( where we call b as the period length ) . Such a periodic restart effectively reduces the variance of the follow-on trace . More importantly , with the design of the period length b to increase logarithmically with the number of iterations , PER-ETD attains the polynomial rather than exponential sample complexity required by ETD . We provide the theoretical guarantee of the sample efficiency of PER-ETD via the finite-time analysis . We show that PER-ETD ( both PER-ETD ( 0 ) and PER-ETD ( λ ) ) converges to the same fixed points of ETD ( 0 ) and ETD ( λ ) , respectively , but with only polynomial sample complexity ( whereas ETD takes exponential sample complexity ) . Our analysis features the following key insights . ( a ) The period length b plays the role of trading off between the variance ( of the follow-on trace ) and bias error ( with respect to the fixed point of ETD ) , and its optimal choice of logarithmical increase with the number of iterations achieves the best tradeoff and keeps both errors vanishing sublinearly . ( b ) Our analysis captures how the mismatch between the behavior and target policies affects the convergence rate of PER-ETD . Interestingly , the mismatch level determines a phase-transition phenomenon of PER-ETD : as long as the mismatch is below a certain threshold , then PER-ETD achieves the same convergence rate as the on-policy TD algorithm ; and if the mismatch is above the threshold , the converge rate of PER-ETD gradually decays as the level of mismatch increases . Experimentally , we demonstrate that PER-ETD converges in the case that neither TD nor ETD converges . Further , our experiments provide the following two interesting observations . ( a ) There does exist a choice of the period length for PER-ETD , which attains the best tradeoff between the variance and bias errors . Below such a choice , the bias error is large so that evaluation is not accurate , and above it the variance error is large so that the convergence is unstable . ( b ) Under a small period length b , it is not always the case that PER-ETD ( λ ) with λ = 1 attains the smallest error with respect to the ground truth value function . The best λ depends on the geometry of the locations of fixed points of PER-ETD ( λ ) for 0 ≤ λ ≤ 1 , which is determined by chosen features . 1.2 RELATED WORKS . TD learning and GTD : The asymptotic convergence of TD learning was established by Sutton ( 1988 ) ; Jaakkola et al . ( 1994 ) ; Dayan & Sejnowski ( 1994 ) ; Tsitsiklis & Van Roy ( 1997 ) , and its nonasymptotic convergence rate was further characterized recently in Dalal et al . ( 2018a ) ; Bhandari et al . ( 2018 ) ; Kotsalis et al . ( 2020 ) ; Chen et al . ( 2019 ) ; Kaledin et al . ( 2020 ) ; Hu & Syed ( 2019 ) ; Srikant & Ying ( 2019 ) . The gradient temporal-difference ( GTD ) was proposed in Sutton et al . ( 2008 ) for off-policy evaluation and was shown to converge asymptotically . Then , Dalal et al . ( 2018b ) ; Gupta et al . ( 2019 ) ; Wang et al . ( 2018 ) ; Xu et al . ( 2019 ) ; Xu & Liang ( 2021 ) provided the finite-time analysis of GTD and its variants . Emphatic Temporal Difference ( ETD ) Learning : The ETD approach was originally proposed in the seminal work Sutton et al . ( 2016 ) , which introduced the follow-on trace to overcome the distribution mismatch between the behavior and target policies . Yu ( 2015 ) provided the asymptotic convergence guarantee for ETD . Hallak et al . ( 2016 ) showed that the variance of the follow-on trace may be unbounded . They further proposed an ETD method with a variable decay rate to keep the follow-on trace bounded but at the cost of a possibly large bias error . Our approach is different and keeps both the variance and bias vanishing sublinearly with the number of iterations . Imani et al . ( 2018 ) developed a new policy gradient theorem , where the emphatic weight is used to correct the distribution shift . Zhang et al . ( 2020b ) provided a new variant of ETD , where the emphatic weights are estimated through function approximation . Van Hasselt et al . ( 2018 ) ; Jiang et al . ( 2021 ) studied ETD with deep neural function class . Comparison to concurrent work : During our preparation of this paper , a concurrent work ( Zhang & Whiteson , 2021 ) was posted on arXiv , and proposed a truncated ETD ( which we refer to as T-ETD for short here ) , which truncates the update of the follow-on trace to reduce the variance of ETD . While T-ETD and our PER-ETD share a similar design idea , there are several critical differences between our work from Zhang & Whiteson ( 2021 ) . ( a ) Our PER-ETD features a design of the logarithmical increase of the restart period with the number of iterations , which guarantees the convergence to the original fixed point of ETD , with both the variance and bias errors vanishing sublinearly . However , T-ETD is guaranteed to converge only to a truncation-length-dependent fixed point , where the convergence is obtained by treating the truncation length as a constant . A careful review of the convergence proof indicates that the variance term scales exponentially fast with the truncation length , and hence the polynomial efficiency is not guaranteed as the truncation length becomes large . ( b ) Our convergence rate for PER-ETD does not depend on the cardinality of the state space and has only polynomial dependence on the mismatch parameter of the behavior and target policies . However , the convergence rate in Zhang & Whiteson ( 2021 ) scales with the cardinality of the state space , and increases exponentially fast with the mismatch parameter of behavior and target policies . ( c ) This paper further studies PER-ETD ( λ ) and the impact of λ on the converge rate and variance and bias errors , whereas Zhang & Whiteson ( 2021 ) considers further the application of T-ETD to the control problem . 2 BACKGROUND AND PRELIMINARIES . 2.1 MARKOV DECISION PROCESS . We consider the infinite-horizon Markov decision process ( MDP ) defined by the five tuple ( S , A , r , P , γ ) . Here , S and A denote the state and action spaces respectively , which are both assumed to be finite sets , r : S ×A → R denotes the reward function , P : S ×A → ∆ ( S ) denotes the transition kernel , where ∆ ( S ) denotes the probability simplex over the state space S , and γ ∈ ( 0 , 1 ) is the discount factor . A policy π : S → ∆ ( A ) of an agent maps from the state space to the probability simplex over the action space A , i.e. , π ( a|s ) represents the probability of taking the action a under the state s. At any time t , given that the system is at the state st , the agent takes an action at with the probability π ( at|st ) , and receives a reward r ( st , at ) . The system then takes a transition to the next state st+1 at time t+ 1 with the probability P ( st+1|st , at ) . For a given policy π , we define the value function corresponding to an initial state s0 = s ∈ S as Vπ ( s ) = E [ ∑∞ t=0 γ tr ( st , at ) |s0 = s , π ] . Then the value function over the state space can be expressed as a vector Vπ = ( Vπ ( 1 ) , Vπ ( 2 ) , . . . , Vπ ( |S| ) ) > ∈ R|S| . Here , Vπ is a deterministic function of the policy π . We use capitalized characters to be consistent with the literature . When the state space is large , we approximate the value function Vπ via a linear function class as Vθ ( s ) = φ > ( s ) θ , where φ ( s ) ∈ Rd denotes the feature vector , and θ ∈ Rd denotes the parameter vector to be learned . We further let Φ = [ φ ( 1 ) , φ ( 2 ) , . . . , φ ( |S| ) ] > denote the feature matrix , and then Vθ = Φθ . We assume that the feature matrix Φ has linearly independent columns and each feature vector has bounded ` 2-norm , i.e. , ‖φ ( s ) ‖2 ≤ Bφ for all s ∈ S .
This paper presents a technique of reducing the variance of emphatic algorithms by resetting the trace periodically, and that increasing the period logarithmicaly can result in an optimal way of trading off bias and variance of the resulting learned value function. The authors prove such a method obtains the optimal tradeoff and results in convergence in settings where predecessor variants fails (TD and ETD). The paper proves these claims theoretically, and show an illustration on the Baird domain for empirical support.
SP:8b914a5ce2dae75515370f788c99b04039218fd4
Evaluating generative networks using Gaussian mixtures of image features
1 INTRODUCTION . Generative networks , such as generative adversarial networks ( GANs ) ( Goodfellow et al. , 2014a ) and variational autoencoders ( Kingma & Welling , 2013 ) , model distributions implicitly by trying to learn a map from a simple distribution , such as a Gaussian , to the desired target distribution . Using generative networks , one can generate new images ( Brock et al. , 2018 ; Karras et al. , 2019a ; b ; 2017 ; Kingma & Welling , 2013 ) , superresolve images ( Ledig et al. , 2017 ; Wang et al. , 2018 ) , solve inverse problems ( Bora et al. , 2017 ) , and perform a host of image-to-image translation tasks ( Isola et al. , 2017 ; Zhu et al. , 2017 ; 2016 ) . However , the high dimensionality of an image distribution makes it difficult to model explicitly , that is , to estimate the moments of the distribution via some parameterization . Just estimating the covariance of a distribution requires p ( p+1 ) 2 parameters , where p is the feature dimension . For this reason , modelling distributions implicitly , using transformations of simple distributions , can be useful for high dimensional data . Since the generator network is typically nonlinear , the explicit form of the generated distribution is not known . Nonetheless , these generative models allow one to sample from the learned distribution . Because we only have access to samples from these generative networks , instead of explicit probability density functions , evaluating their performance can be difficult . As such , several ways of evaluating the quality of the samples drawn from generative networks ( Borji , 2019 ) have been proposed , the most popular of which is the Fréchet Inception distance ( FID ) ( Heusel et al. , 2017 ) . FID fits Gaussian distributions to features extracted from a set of a real images and a set of GANgenerated images . The features are typically extracted using the Inception-v3 classifier ( Szegedy et al. , 2016a ) . These two distributions are then compared using the 2-Wasserstein ( Villani , 2009 ; 2003 ) metric . While FID has demonstrated its utility in providing a computationally efficient metric for assessing the quality of GAN-generated images , closer examination reveals that the fundamental assumption of the FID method—namely , that the underlying feature distributions are Gaussian—is invalid . A more accurate model of the underlying features will capture a more comprehensive and informative assessment of GAN quality . In this paper , we first show that the features used to calculate FID are not Gaussian , violating the main assumption in FID ( Section 3 ) . The 2-Wasserstein metric , which FID uses , can not be extended past Gaussians easily because it is typically computationally intractable and does not have closed formed solutions for many families of distributions . Moreover , FID is only capturing the first two moments of the feature distribution and completely ignores all information present in the higher order moments . Missing this information biases FID toward artificially low values , an undesirable property for a performance metric . Thus , we propose using a Gaussian mixture model ( GMM ) ( McLachlan & Peel , 2000 ) for the features instead , because GMMs can model more complex distributions and capture higher order moments . GMMs are estimated efficiently and there exists a Wasserstein-type metric for GMMs ( Delon & Desolneux , 2020 ) ( Section 4 ) which allows us to generalize FID . We use this to develop our generative model evaluation metric , WaM . We provide code for the community to use WaM at ( link will be added after acceptance ) . Finally , we show that WaM is not as sensitive to visually imperceptible noise as FID ( Section 5 ) . Since GMMs can capture more information than Gaussians , WaM more accurately identifies differences between sets of images and avoids the low score bias of FID . We therefore reduce the issue of FID being overly sensitive to various noise perturbations ( Borji , 2019 ) by modelling more information in the feature distributions . We test perturbation sensitivity using additive isotropic Gaussian noise and perturbed images which specifically attempt to increase FID using backpropagation ( Mathiasen & Hvilshøj , 2020b ) . The ability of WaM to model more information in the feature distribution makes it a better evaluation metric for generative networks . 2 RELATED WORK . 2.1 WASSERSTEIN DISTANCE . There are several ways to define a distance metric between probability distributions . A popular metric from optimal transport ( Villani , 2003 ; 2009 ) is the p-Wasserstein metric . We first are given a Polish metric space X with a metric d. Given p ∈ ( 0 , ∞ ) and two distributions P and Q on X with finite moments of order p , the p-Wasserstein metric is given by Wp ( P , Q ) = ( inf γ ∫ X×X d ( x , y ) pdγ ( x , y ) ) 1 p where the infimum is taken over all joint distributions γ of P and Q . Different values of p yield different metric properties ; in image processing , the 1-Wasserstein distance on discrete spaces is used and called the earth mover distance ( Rubner et al. , 2000 ) . The 2-Wasserstein metric ( Dowson & Landau , 1982 ; Olkin & Pukelsheim , 1982 ) is often used when comparing Gaussians since there exists a closed form solution for W2 ( N ( µ1 , Σ1 ) , N ( µ2 , Σ2 ) ) = ∥µ1 − µ2∥22 + Tr ( Σ1 +Σ2 − 2 ( Σ 1 2 1 Σ2Σ 1 2 1 ) 1 2 ) , ( 1 ) as is used to calculate the Fréchet Inception distance . 2.2 FID AND VARIANTS . The Fréchet Inception distance ( FID ) ( Heusel et al. , 2017 ) is a performance measure typically used to evaluate generative networks . In order to compare two sets of images , X1 and X2 , they are featurized using the penultimate layer of the Inception-v3 network to get sets of features F1 and F2 . For ImageNet data , this reduces the dimension of the data from 3× 224× 224 = 150,528 to 2048 . At this point , Heusel et al . assume that these features are Gaussian and use Equation ( 1 ) to obtain a distance between them . There are several ways that FID has been improved . One work has shown that FID is biased ( Chong & Forsyth , 2020 ) , especially when it is computed using a small number of samples . They show that FID is unbiased asymptotically and show how to estimate the asymptotic value of FID to obtain an unbiased estimate . Others have used a network different from Inception-v3 to evaluate data that is not from ImageNet ; for example , a LeNet-like ( LeCun et al. , 1989 ) feature extractor can be used for MNIST . In this work we focus on several different ImageNet feature extractors because of their widespread use . Modelling ImageNet features has been improved due to a conditional version of FID ( Soloveitchik et al. , 2021 ) which extends FID to conditional distributions , and a class-aware Fréchet distance ( Liu et al. , 2018 ) which models the classes with GMMs . In this work , we do not consider conditional versions of FID , but our work can be extended to fit such a formulation in a straightforward manner . Moreover , we use GMMs over the feature space rather than one component per class as is done in the class-aware Fréchet distance . Another metric related to our proposed metric is called WInD ( Dimitrakopoulos et al. , 2020 ) . WInD uses a combination of the 1-Wasserstein metric on discrete spaces with the 2-Wasserstein metric on Rp . For this reason , it is not a p-Wasserstein metric in Rp or between GMMs . For example , if P and Q are a mixture of Dirac delta functions then the WInD distance between them becomes the 1-Wasserstein distance . However , if P and Q are Gaussians , then the WInD distance between them becomes the 2-Wasserstein distance . Moreover , if P and Q are arbitrary GMMs , the relationship between WInD and the p-Wasserstein metrics is not clear . This means that WInD can alternate between the 1-Wasserstein and 2-Wasserstein distance depending on the input distributions . In this paper , we focus on using a metric which closely follows the 2-Wasserstein distance as is currently done with FID . 2.3 MW2 A closed form solution for the 2-Wasserstein distance between GMMs is not known . This is because the joint distribution between two GMMs is not necessarily a GMM . However , if we restrict ourselves to the relaxed problem of only considering joint distributions over GMMs , then the resulting 2-Wasserstein distance of this new space is known . The restricted space of GMMs is quite large since GMMs can approximate any distribution to arbitrary precision , given enough mixture components . So given two GMMs , P and Q , we can calculate MW22 ( P , Q ) = inf γ ∫ X×X d ( x , y ) 2dγ ( x , y ) where the infimum is over all joint distributions γ which are also GMMs . Constraining the class of joint distributions is a relaxation that has been done before ( Bion-Nadal et al. , 2019 ) due to the difficulty of considering arbitrary joint distributions . This metric , MW2 , appears in a few different sources in the literature ( Chen et al. , 2016 ; 2018 ; 2019 ) and has been studied theoretically ( Delon & Desolneux , 2020 ) ; recently , implementations of this quantity have emerged.1 The practical formulation of this problem is done as follows . Let P = ∑K0 i=1 πiνi and Q =∑K1 j=1 αjµj be two GMMs with Gaussians νi , µj for i ∈ { 1 , . . . , K0 } , j ∈ { 1 , . . . , K1 } . Then , we have that MW22 ( P , Q ) = min γ ∑ ij γijW22 ( νi , µj ) ( 2 ) where γ is taken to be the joint distribution over the two categorical distributions [ π1 . . . πK0 ] and [ α1 . . . αK1 ] ; hence , γ in this case is actually a matrix . Thus , MW2 can be implemented as a discrete optimal transport plan and efficient software exists to compute this ( Flamary et al. , 2021 ) . MW2 is a great candidate for modelling the distance between GMMs for several reasons ; most importantly , it is an actual distance metric . Since we are restricting the joint distribution to be a GMM , we see that MW2 must be greater than or equal to the 2-Wasserstein distance between two GMMs . Moreover , MW2 clearly approximates the 2-Wasserstein metric ; Delon & Desolneux derive bounds showing how close MW2 is to W2 . It is also computationally efficient to compute because it can be formulated as a discrete optimal transport problem , making it practical . The strong theoretical properties and computational efficiency of MW2 make it a prime candidate to calculate the distance between GMMs . 1https : //github.com/judelo/gmmot ResNet-18 feature # 172 ResNet-50 feature # 559 ResNeXt-101 ( 32×8d ) feature # 1653 Inception-v3 feature # 1216 3 INCEPTION-V3 HAS NON-GAUSSIAN FEATURES ON IMAGENET .
This paper generalizes the widely-used FID metric for image generation evaluation by fitting a mixture of Gaussians instead of a single Gaussian on the extracted features. The advantage of the proposed approach is it removes the unrealistic assumption of FID that the extracted features from some encoder networks (such as Inception-v3) are approximately Gaussian. The consequence of changing to GMM is that calculating the 2-wasserstein distance now requires a relaxation/approximation, which may result in approximation error and more computation. Empirically, the paper demonstrate that the proposed metric WaM may be less sensitive to noise perturbations.
SP:397daca667c4f4f2413dd716989d9c5cb4df90a8
Evaluating generative networks using Gaussian mixtures of image features
1 INTRODUCTION . Generative networks , such as generative adversarial networks ( GANs ) ( Goodfellow et al. , 2014a ) and variational autoencoders ( Kingma & Welling , 2013 ) , model distributions implicitly by trying to learn a map from a simple distribution , such as a Gaussian , to the desired target distribution . Using generative networks , one can generate new images ( Brock et al. , 2018 ; Karras et al. , 2019a ; b ; 2017 ; Kingma & Welling , 2013 ) , superresolve images ( Ledig et al. , 2017 ; Wang et al. , 2018 ) , solve inverse problems ( Bora et al. , 2017 ) , and perform a host of image-to-image translation tasks ( Isola et al. , 2017 ; Zhu et al. , 2017 ; 2016 ) . However , the high dimensionality of an image distribution makes it difficult to model explicitly , that is , to estimate the moments of the distribution via some parameterization . Just estimating the covariance of a distribution requires p ( p+1 ) 2 parameters , where p is the feature dimension . For this reason , modelling distributions implicitly , using transformations of simple distributions , can be useful for high dimensional data . Since the generator network is typically nonlinear , the explicit form of the generated distribution is not known . Nonetheless , these generative models allow one to sample from the learned distribution . Because we only have access to samples from these generative networks , instead of explicit probability density functions , evaluating their performance can be difficult . As such , several ways of evaluating the quality of the samples drawn from generative networks ( Borji , 2019 ) have been proposed , the most popular of which is the Fréchet Inception distance ( FID ) ( Heusel et al. , 2017 ) . FID fits Gaussian distributions to features extracted from a set of a real images and a set of GANgenerated images . The features are typically extracted using the Inception-v3 classifier ( Szegedy et al. , 2016a ) . These two distributions are then compared using the 2-Wasserstein ( Villani , 2009 ; 2003 ) metric . While FID has demonstrated its utility in providing a computationally efficient metric for assessing the quality of GAN-generated images , closer examination reveals that the fundamental assumption of the FID method—namely , that the underlying feature distributions are Gaussian—is invalid . A more accurate model of the underlying features will capture a more comprehensive and informative assessment of GAN quality . In this paper , we first show that the features used to calculate FID are not Gaussian , violating the main assumption in FID ( Section 3 ) . The 2-Wasserstein metric , which FID uses , can not be extended past Gaussians easily because it is typically computationally intractable and does not have closed formed solutions for many families of distributions . Moreover , FID is only capturing the first two moments of the feature distribution and completely ignores all information present in the higher order moments . Missing this information biases FID toward artificially low values , an undesirable property for a performance metric . Thus , we propose using a Gaussian mixture model ( GMM ) ( McLachlan & Peel , 2000 ) for the features instead , because GMMs can model more complex distributions and capture higher order moments . GMMs are estimated efficiently and there exists a Wasserstein-type metric for GMMs ( Delon & Desolneux , 2020 ) ( Section 4 ) which allows us to generalize FID . We use this to develop our generative model evaluation metric , WaM . We provide code for the community to use WaM at ( link will be added after acceptance ) . Finally , we show that WaM is not as sensitive to visually imperceptible noise as FID ( Section 5 ) . Since GMMs can capture more information than Gaussians , WaM more accurately identifies differences between sets of images and avoids the low score bias of FID . We therefore reduce the issue of FID being overly sensitive to various noise perturbations ( Borji , 2019 ) by modelling more information in the feature distributions . We test perturbation sensitivity using additive isotropic Gaussian noise and perturbed images which specifically attempt to increase FID using backpropagation ( Mathiasen & Hvilshøj , 2020b ) . The ability of WaM to model more information in the feature distribution makes it a better evaluation metric for generative networks . 2 RELATED WORK . 2.1 WASSERSTEIN DISTANCE . There are several ways to define a distance metric between probability distributions . A popular metric from optimal transport ( Villani , 2003 ; 2009 ) is the p-Wasserstein metric . We first are given a Polish metric space X with a metric d. Given p ∈ ( 0 , ∞ ) and two distributions P and Q on X with finite moments of order p , the p-Wasserstein metric is given by Wp ( P , Q ) = ( inf γ ∫ X×X d ( x , y ) pdγ ( x , y ) ) 1 p where the infimum is taken over all joint distributions γ of P and Q . Different values of p yield different metric properties ; in image processing , the 1-Wasserstein distance on discrete spaces is used and called the earth mover distance ( Rubner et al. , 2000 ) . The 2-Wasserstein metric ( Dowson & Landau , 1982 ; Olkin & Pukelsheim , 1982 ) is often used when comparing Gaussians since there exists a closed form solution for W2 ( N ( µ1 , Σ1 ) , N ( µ2 , Σ2 ) ) = ∥µ1 − µ2∥22 + Tr ( Σ1 +Σ2 − 2 ( Σ 1 2 1 Σ2Σ 1 2 1 ) 1 2 ) , ( 1 ) as is used to calculate the Fréchet Inception distance . 2.2 FID AND VARIANTS . The Fréchet Inception distance ( FID ) ( Heusel et al. , 2017 ) is a performance measure typically used to evaluate generative networks . In order to compare two sets of images , X1 and X2 , they are featurized using the penultimate layer of the Inception-v3 network to get sets of features F1 and F2 . For ImageNet data , this reduces the dimension of the data from 3× 224× 224 = 150,528 to 2048 . At this point , Heusel et al . assume that these features are Gaussian and use Equation ( 1 ) to obtain a distance between them . There are several ways that FID has been improved . One work has shown that FID is biased ( Chong & Forsyth , 2020 ) , especially when it is computed using a small number of samples . They show that FID is unbiased asymptotically and show how to estimate the asymptotic value of FID to obtain an unbiased estimate . Others have used a network different from Inception-v3 to evaluate data that is not from ImageNet ; for example , a LeNet-like ( LeCun et al. , 1989 ) feature extractor can be used for MNIST . In this work we focus on several different ImageNet feature extractors because of their widespread use . Modelling ImageNet features has been improved due to a conditional version of FID ( Soloveitchik et al. , 2021 ) which extends FID to conditional distributions , and a class-aware Fréchet distance ( Liu et al. , 2018 ) which models the classes with GMMs . In this work , we do not consider conditional versions of FID , but our work can be extended to fit such a formulation in a straightforward manner . Moreover , we use GMMs over the feature space rather than one component per class as is done in the class-aware Fréchet distance . Another metric related to our proposed metric is called WInD ( Dimitrakopoulos et al. , 2020 ) . WInD uses a combination of the 1-Wasserstein metric on discrete spaces with the 2-Wasserstein metric on Rp . For this reason , it is not a p-Wasserstein metric in Rp or between GMMs . For example , if P and Q are a mixture of Dirac delta functions then the WInD distance between them becomes the 1-Wasserstein distance . However , if P and Q are Gaussians , then the WInD distance between them becomes the 2-Wasserstein distance . Moreover , if P and Q are arbitrary GMMs , the relationship between WInD and the p-Wasserstein metrics is not clear . This means that WInD can alternate between the 1-Wasserstein and 2-Wasserstein distance depending on the input distributions . In this paper , we focus on using a metric which closely follows the 2-Wasserstein distance as is currently done with FID . 2.3 MW2 A closed form solution for the 2-Wasserstein distance between GMMs is not known . This is because the joint distribution between two GMMs is not necessarily a GMM . However , if we restrict ourselves to the relaxed problem of only considering joint distributions over GMMs , then the resulting 2-Wasserstein distance of this new space is known . The restricted space of GMMs is quite large since GMMs can approximate any distribution to arbitrary precision , given enough mixture components . So given two GMMs , P and Q , we can calculate MW22 ( P , Q ) = inf γ ∫ X×X d ( x , y ) 2dγ ( x , y ) where the infimum is over all joint distributions γ which are also GMMs . Constraining the class of joint distributions is a relaxation that has been done before ( Bion-Nadal et al. , 2019 ) due to the difficulty of considering arbitrary joint distributions . This metric , MW2 , appears in a few different sources in the literature ( Chen et al. , 2016 ; 2018 ; 2019 ) and has been studied theoretically ( Delon & Desolneux , 2020 ) ; recently , implementations of this quantity have emerged.1 The practical formulation of this problem is done as follows . Let P = ∑K0 i=1 πiνi and Q =∑K1 j=1 αjµj be two GMMs with Gaussians νi , µj for i ∈ { 1 , . . . , K0 } , j ∈ { 1 , . . . , K1 } . Then , we have that MW22 ( P , Q ) = min γ ∑ ij γijW22 ( νi , µj ) ( 2 ) where γ is taken to be the joint distribution over the two categorical distributions [ π1 . . . πK0 ] and [ α1 . . . αK1 ] ; hence , γ in this case is actually a matrix . Thus , MW2 can be implemented as a discrete optimal transport plan and efficient software exists to compute this ( Flamary et al. , 2021 ) . MW2 is a great candidate for modelling the distance between GMMs for several reasons ; most importantly , it is an actual distance metric . Since we are restricting the joint distribution to be a GMM , we see that MW2 must be greater than or equal to the 2-Wasserstein distance between two GMMs . Moreover , MW2 clearly approximates the 2-Wasserstein metric ; Delon & Desolneux derive bounds showing how close MW2 is to W2 . It is also computationally efficient to compute because it can be formulated as a discrete optimal transport problem , making it practical . The strong theoretical properties and computational efficiency of MW2 make it a prime candidate to calculate the distance between GMMs . 1https : //github.com/judelo/gmmot ResNet-18 feature # 172 ResNet-50 feature # 559 ResNeXt-101 ( 32×8d ) feature # 1653 Inception-v3 feature # 1216 3 INCEPTION-V3 HAS NON-GAUSSIAN FEATURES ON IMAGENET .
This paper propose a new method to evaluate GANs. Current prevailing evaluation of GANs is FID, which has one assumption that the evaluated data (or feature) has Gaussian distribution. However, this assumption is false when practically applying it. Inspired by recent work MW$_2$, authors propose GMMs to evaluate two sets of distribution.
SP:397daca667c4f4f2413dd716989d9c5cb4df90a8
Evaluating generative networks using Gaussian mixtures of image features
1 INTRODUCTION . Generative networks , such as generative adversarial networks ( GANs ) ( Goodfellow et al. , 2014a ) and variational autoencoders ( Kingma & Welling , 2013 ) , model distributions implicitly by trying to learn a map from a simple distribution , such as a Gaussian , to the desired target distribution . Using generative networks , one can generate new images ( Brock et al. , 2018 ; Karras et al. , 2019a ; b ; 2017 ; Kingma & Welling , 2013 ) , superresolve images ( Ledig et al. , 2017 ; Wang et al. , 2018 ) , solve inverse problems ( Bora et al. , 2017 ) , and perform a host of image-to-image translation tasks ( Isola et al. , 2017 ; Zhu et al. , 2017 ; 2016 ) . However , the high dimensionality of an image distribution makes it difficult to model explicitly , that is , to estimate the moments of the distribution via some parameterization . Just estimating the covariance of a distribution requires p ( p+1 ) 2 parameters , where p is the feature dimension . For this reason , modelling distributions implicitly , using transformations of simple distributions , can be useful for high dimensional data . Since the generator network is typically nonlinear , the explicit form of the generated distribution is not known . Nonetheless , these generative models allow one to sample from the learned distribution . Because we only have access to samples from these generative networks , instead of explicit probability density functions , evaluating their performance can be difficult . As such , several ways of evaluating the quality of the samples drawn from generative networks ( Borji , 2019 ) have been proposed , the most popular of which is the Fréchet Inception distance ( FID ) ( Heusel et al. , 2017 ) . FID fits Gaussian distributions to features extracted from a set of a real images and a set of GANgenerated images . The features are typically extracted using the Inception-v3 classifier ( Szegedy et al. , 2016a ) . These two distributions are then compared using the 2-Wasserstein ( Villani , 2009 ; 2003 ) metric . While FID has demonstrated its utility in providing a computationally efficient metric for assessing the quality of GAN-generated images , closer examination reveals that the fundamental assumption of the FID method—namely , that the underlying feature distributions are Gaussian—is invalid . A more accurate model of the underlying features will capture a more comprehensive and informative assessment of GAN quality . In this paper , we first show that the features used to calculate FID are not Gaussian , violating the main assumption in FID ( Section 3 ) . The 2-Wasserstein metric , which FID uses , can not be extended past Gaussians easily because it is typically computationally intractable and does not have closed formed solutions for many families of distributions . Moreover , FID is only capturing the first two moments of the feature distribution and completely ignores all information present in the higher order moments . Missing this information biases FID toward artificially low values , an undesirable property for a performance metric . Thus , we propose using a Gaussian mixture model ( GMM ) ( McLachlan & Peel , 2000 ) for the features instead , because GMMs can model more complex distributions and capture higher order moments . GMMs are estimated efficiently and there exists a Wasserstein-type metric for GMMs ( Delon & Desolneux , 2020 ) ( Section 4 ) which allows us to generalize FID . We use this to develop our generative model evaluation metric , WaM . We provide code for the community to use WaM at ( link will be added after acceptance ) . Finally , we show that WaM is not as sensitive to visually imperceptible noise as FID ( Section 5 ) . Since GMMs can capture more information than Gaussians , WaM more accurately identifies differences between sets of images and avoids the low score bias of FID . We therefore reduce the issue of FID being overly sensitive to various noise perturbations ( Borji , 2019 ) by modelling more information in the feature distributions . We test perturbation sensitivity using additive isotropic Gaussian noise and perturbed images which specifically attempt to increase FID using backpropagation ( Mathiasen & Hvilshøj , 2020b ) . The ability of WaM to model more information in the feature distribution makes it a better evaluation metric for generative networks . 2 RELATED WORK . 2.1 WASSERSTEIN DISTANCE . There are several ways to define a distance metric between probability distributions . A popular metric from optimal transport ( Villani , 2003 ; 2009 ) is the p-Wasserstein metric . We first are given a Polish metric space X with a metric d. Given p ∈ ( 0 , ∞ ) and two distributions P and Q on X with finite moments of order p , the p-Wasserstein metric is given by Wp ( P , Q ) = ( inf γ ∫ X×X d ( x , y ) pdγ ( x , y ) ) 1 p where the infimum is taken over all joint distributions γ of P and Q . Different values of p yield different metric properties ; in image processing , the 1-Wasserstein distance on discrete spaces is used and called the earth mover distance ( Rubner et al. , 2000 ) . The 2-Wasserstein metric ( Dowson & Landau , 1982 ; Olkin & Pukelsheim , 1982 ) is often used when comparing Gaussians since there exists a closed form solution for W2 ( N ( µ1 , Σ1 ) , N ( µ2 , Σ2 ) ) = ∥µ1 − µ2∥22 + Tr ( Σ1 +Σ2 − 2 ( Σ 1 2 1 Σ2Σ 1 2 1 ) 1 2 ) , ( 1 ) as is used to calculate the Fréchet Inception distance . 2.2 FID AND VARIANTS . The Fréchet Inception distance ( FID ) ( Heusel et al. , 2017 ) is a performance measure typically used to evaluate generative networks . In order to compare two sets of images , X1 and X2 , they are featurized using the penultimate layer of the Inception-v3 network to get sets of features F1 and F2 . For ImageNet data , this reduces the dimension of the data from 3× 224× 224 = 150,528 to 2048 . At this point , Heusel et al . assume that these features are Gaussian and use Equation ( 1 ) to obtain a distance between them . There are several ways that FID has been improved . One work has shown that FID is biased ( Chong & Forsyth , 2020 ) , especially when it is computed using a small number of samples . They show that FID is unbiased asymptotically and show how to estimate the asymptotic value of FID to obtain an unbiased estimate . Others have used a network different from Inception-v3 to evaluate data that is not from ImageNet ; for example , a LeNet-like ( LeCun et al. , 1989 ) feature extractor can be used for MNIST . In this work we focus on several different ImageNet feature extractors because of their widespread use . Modelling ImageNet features has been improved due to a conditional version of FID ( Soloveitchik et al. , 2021 ) which extends FID to conditional distributions , and a class-aware Fréchet distance ( Liu et al. , 2018 ) which models the classes with GMMs . In this work , we do not consider conditional versions of FID , but our work can be extended to fit such a formulation in a straightforward manner . Moreover , we use GMMs over the feature space rather than one component per class as is done in the class-aware Fréchet distance . Another metric related to our proposed metric is called WInD ( Dimitrakopoulos et al. , 2020 ) . WInD uses a combination of the 1-Wasserstein metric on discrete spaces with the 2-Wasserstein metric on Rp . For this reason , it is not a p-Wasserstein metric in Rp or between GMMs . For example , if P and Q are a mixture of Dirac delta functions then the WInD distance between them becomes the 1-Wasserstein distance . However , if P and Q are Gaussians , then the WInD distance between them becomes the 2-Wasserstein distance . Moreover , if P and Q are arbitrary GMMs , the relationship between WInD and the p-Wasserstein metrics is not clear . This means that WInD can alternate between the 1-Wasserstein and 2-Wasserstein distance depending on the input distributions . In this paper , we focus on using a metric which closely follows the 2-Wasserstein distance as is currently done with FID . 2.3 MW2 A closed form solution for the 2-Wasserstein distance between GMMs is not known . This is because the joint distribution between two GMMs is not necessarily a GMM . However , if we restrict ourselves to the relaxed problem of only considering joint distributions over GMMs , then the resulting 2-Wasserstein distance of this new space is known . The restricted space of GMMs is quite large since GMMs can approximate any distribution to arbitrary precision , given enough mixture components . So given two GMMs , P and Q , we can calculate MW22 ( P , Q ) = inf γ ∫ X×X d ( x , y ) 2dγ ( x , y ) where the infimum is over all joint distributions γ which are also GMMs . Constraining the class of joint distributions is a relaxation that has been done before ( Bion-Nadal et al. , 2019 ) due to the difficulty of considering arbitrary joint distributions . This metric , MW2 , appears in a few different sources in the literature ( Chen et al. , 2016 ; 2018 ; 2019 ) and has been studied theoretically ( Delon & Desolneux , 2020 ) ; recently , implementations of this quantity have emerged.1 The practical formulation of this problem is done as follows . Let P = ∑K0 i=1 πiνi and Q =∑K1 j=1 αjµj be two GMMs with Gaussians νi , µj for i ∈ { 1 , . . . , K0 } , j ∈ { 1 , . . . , K1 } . Then , we have that MW22 ( P , Q ) = min γ ∑ ij γijW22 ( νi , µj ) ( 2 ) where γ is taken to be the joint distribution over the two categorical distributions [ π1 . . . πK0 ] and [ α1 . . . αK1 ] ; hence , γ in this case is actually a matrix . Thus , MW2 can be implemented as a discrete optimal transport plan and efficient software exists to compute this ( Flamary et al. , 2021 ) . MW2 is a great candidate for modelling the distance between GMMs for several reasons ; most importantly , it is an actual distance metric . Since we are restricting the joint distribution to be a GMM , we see that MW2 must be greater than or equal to the 2-Wasserstein distance between two GMMs . Moreover , MW2 clearly approximates the 2-Wasserstein metric ; Delon & Desolneux derive bounds showing how close MW2 is to W2 . It is also computationally efficient to compute because it can be formulated as a discrete optimal transport problem , making it practical . The strong theoretical properties and computational efficiency of MW2 make it a prime candidate to calculate the distance between GMMs . 1https : //github.com/judelo/gmmot ResNet-18 feature # 172 ResNet-50 feature # 559 ResNeXt-101 ( 32×8d ) feature # 1653 Inception-v3 feature # 1216 3 INCEPTION-V3 HAS NON-GAUSSIAN FEATURES ON IMAGENET .
This paper targets to a new evaluation metric for the performance of generative models given a set of real images and a set of fake images. The authors show that Inception-v3 features of the imageNet dataset are not Gaussian and remedy this issue by modeling image features using Gaussian mixture models (GMMs) and formulating the distribution distance between two GMMs by MW2. They demonstrate their metric is less sensitive than FID against image perturbations.
SP:397daca667c4f4f2413dd716989d9c5cb4df90a8
On the Latent Holes 🧀 of VAEs for Text Generation
1 INTRODUCTION . Variational Auto-Encoders ( VAEs ) are powerful unsupervised models for learning low-dimensional manifolds ( aka . a latent space ) from non-trivial high-dimensional data ( Kingma & Welling , 2014 ; Rezende et al. , 2014 ) . They have found successes in a number of downstream tasks across different application domains such as text classification ( Xu et al. , 2017 ) , transfer learning ( Higgins et al. , 2017b ) , image synthesis ( Huang et al. , 2018 ; Razavi et al. , 2019 ) , language generation ( Bowman et al. , 2016 ; He et al. , 2019 ) , and music composition ( Roberts et al. , 2018 ) . Various effort has been made to improve the capacity of VAEs , where the majority of the extensions are focused on increasing the flexibility of the prior and approximating posterior . For instance , Davidson et al . ( 2018 ) introduced the von Mises-Fisher ( vMF ) distribution to replace the standard Gaussian distribution ; Kalatzis et al . ( 2020 ) assumed a Riemannian structure over the latent space by adopting the Riemannian Brownian motion prior . A few recent studies attempted to investigate the problem more fundamentally , and revealed that there exist discontinuous regions ( we refer to them as “ latent holes ” following past literature ) in the latent space , which have a detrimental effect on model capacity . Falorsi et al . ( 2018 ) approached the problem from a theoretical perspective of manifold mismatch and showed that this undesirable phenomenon is due to the latent space ’ s topological incapability of accurately capturing the properties of a dataset . Xu et al . ( 2020 ) examined the obstacles that prevent sequential VAEs from performing well in unsupervised controllable text generation , and empirically discovered that manipulating the latent variables for semantic variations in text often leads to latent variables to reside in some latent holes . As a result , the decoding network fails to properly decode or generalise when the sampled latent variables land in those areas . Although the works on investigating latent holes are still relatively sparse , they have opened up new opportunities for improving VAE models , where one can design mechanisms directly engineered for mitigating the hole issue . However , it should be noted that existing works ( Falorsi et al. , 2018 ; Xu et al. , 2020 ) exclusively target at the encoder network when investigating holes in the latent space , and they merely explored its existence without providing further in-depth analysis of the phenomenon . It has also been revealed that the hole issue is more severe on text compared to the image domain , due to the discreteness of text data ( Xu et al. , 2020 ) . In this paper , we tackle the aforementioned issues by proposing a novel tree-based decoder-centric ( TDC ) algorithm for latent hole identification , with a focus on the text domain . In contrast to existing works which are encoder-centric , our approach is centric to the decoder network , as a decoder has a direct impact on the model ’ s performance , e.g. , for text generation . Our TDC algorithm is also highly efficient for latent hole searching when compared to existing approaches , owing to the dimension reduction and Breadth-First Search strategies . Another important technical contribution is that we theoretically unify the two prior indicators for latent hole identification , and evidence that the one of Falorsi et al . ( 2018 ) is more accurate , which forms the basis of our algorithm detailed in § 3 . In terms of analysing the latent hole phenomenon , we provide , for the first time , an in-depth empirical analysis that examines three important aspects : ( i ) how the holes impact VAE models ’ performance on text generation ; ( ii ) whether the holes are really vacant , i.e. , useful information is not captured by the holes at all ; and ( iii ) how the holes are distributed in the latent space . To validate our theory and to demonstrate the generalisability of our proposed TDC algorithm , we pre-train five strong and representative VAE models for producing sentences , including the state-of-the-art model . Comprehensive experiments on the text task involving four large-scale public datasets show that the output quality is strongly correlated with the density of latent holes ; that from the perspective of the decoder , the Latent Vacancy Hypothesis proposed by Xu et al . ( 2020 ) does not hold empirically ; and that holes are ubiquitous and densely distributed in the latent space . Our code will be made publicly available upon the acceptance of this paper . 2 PRELIMINARIES . 2.1 VARIATIONAL AUTOENCODER . A VAE is a generative model which defines a joint distribution over the observations x and the latent variable z̃ , i.e. , p ( x , z̃ ) = p ( x|z̃ ) p ( z̃ ) . Given a dataset X = { xi } Ni=1 with N i.i.d . datapoints , we need to optimise the marginal likelihood p ( X ) = 1N ∑N i ∫ p ( xi|z̃ ) p ( z̃ ) dz̃ over the entire training set . However , this marginal likelihood is intractable . A common solution is to maximise the Evidence Lower BOund ( ELBO ) via variational inference for every observation x : L ( θ , φ ; x ) = Eqφ ( z̃|x ) ( log pθ ( x|z̃ ) ) −DKL ( qφ ( z̃|x ) ‖p ( z̃ ) ) , ( 1 ) where qφ ( z̃|x ) is a variational posterior to approximate the true posterior p ( z̃|x ) . The variational posterior qφ ( z̃|x ) ( aka . encoder ) and the conditional distribution pθ ( x|z̃ ) ( aka . decoder ) are set up using two neural networks parameterised by φ and θ , respectively . Normally , the first term in Eq . ( 1 ) is the expected data reconstruction loss showing how well the model can reconstruct data given a latent variable . The second term is the KL-divergence of the approximate variational posterior from the prior , i.e. , a regularisation forcing the learned posterior to be as close to the prior as possible . 2.2 EXISTING LATENT HOLE INDICATORS . To our knowledge , there are only two prior works which directly determine whether a latent region is continuous or not . One work formalises latent holes based on the relative distance of pairwise points taken from the latent space and the sample space ( Falorsi et al. , 2018 ) . Concretely speaking , given a pair of vectors z̃i and z̃i+1 which are closely located on a latent path , and their corresponding samples x′i and x′i+1 in the sample space , a latent hole indicator is computed as ILIP ( i ) : = Dsample ( x ′ i , x ′ i+1 ) /Dlatent ( z̃i , z̃i+1 ) , ( 2 ) where Dsample and Dlatent respectively denote the metrics measuring the sample and latent spaces ( NB : Dlatent is an arbitrary metric , e.g. , the Euclidean distance and Riemannian distance ) . Falorsi et al . ( 2018 ) focused on the image domain and utilised Euclidean distance for both spaces . Based on the concept of Lipschitz continuity , Falorsi et al . ( 2018 ) then proposed to measure the continuity of a latent region as follows : under the premise that z̃i+1 does not land on a hole , z̃i is recognised as belonging to a hole if the corresponding ILIP ( i ) is a large outlier1 . Another line of work ( Xu et al. , 2020 ) signals latent holes based on the so-called aggregated posterior , with a focus on sequential VAEs for language modelling . This approach interpolates a series of vectors on a latent path at a small interval , and then scores the i-th latent vector z̃i as IAGG ( i ) : = ∑M t=1NLL ( z̃i , Z ( t ) ) /M , ( 3 ) 1Unless otherwise stated , outliers are detected by comparing the subject data point with a fixed bound , which is pre-determined based on a percentile of all data points . where Z ( t ) is the sample of the posterior distribution of the t-th out of the total M training samples , e.g. , when studying holes on the encoder side , this distribution can be computed using qφ ( z̃|x ) in Eq . ( 1 ) ( Xu et al. , 2020 ) . Z ( t ) serves as the reference when calculating the Negative Log-Likelihood ( NLL ) . After all the interpolated vectors on the latent path are traversed , similar to the first method , vectors with large outlier indicators ( IAGG ) are identified as in latent holes . We note that these two indicators actually stem from different intuitions . For ILIP , there is an underlying assumption that a mapping between the sample and latent spaces should have good stability in terms of relative distance change in order to guarantee good continuity in the latent space . In contrast , IAGG is based on the belief that small perturbations on the non-hole regions should not lead to large offsets on the absolute dissimilarity between posterior samples Z ( · ) and the sample z̃i , and hence the calculation is performed only in the latent space and only around one single latent position . While seemly distinct , we show that ( in § 3.2 ) both indicators actually have tight underlying connections and can be unified in a shared mathematical framework . Moreover , the first indicator ( ILIP ) is proofed to be more comprehensive than the second ( IAGG ) and thus can reduce false negatives when identifying holes in the latent space . This forms the basis of our algorithm in § 3 , which is the first attempt to identify a VAE decoder ’ s latent holes for language generation . 3 METHODOLOGY . In this section , we describe our tree-based decoder-centric ( TDC ) algorithm for latent hole identification , which consists of three main components . We first introduce our heuristic-based Breadth-First Search ( BFS ) algorithm for highly efficient latent space searching ( § 3.1 ) . We then theoretically proof , for the first time , that two existing holes indicators can be unified under the same framework and that ILIP is a more suitable choice for identifying latent holes ( § 3.2 ) . Finally , we extend ILIP to the text domain by incorporating the Wasserstein distance for the sample space ( § 3.3 ) . 3.1 TREE-BASED DECODER-CENTRIC LATENT HOLE IDENTIFICATION . As discussed earlier , existing works for investigating latent holes of VAEs all exclusively focus on the encoder network ( e.g. , Falorsi et al . ( 2018 ) ; Xu et al . ( 2020 ) ) , and they can not be trivially applied to the decoders ( which play ultimately important roles on generation tasks ) due to metric incompatibility , especially for VAEs in the text domain ( see detailed discussion in § 3.3 ) . Another drawback of existing indicators is that they have very limited efficiency . Theoretically , their time complexity for traversing a d-dimensional latent space with I interpolations per path is O ( Id ) at the optimal efficiency , which is computationally prohibitive as typically d and I are larger than 30 and 50 for VAEs in practice . Each path is parallel to one axis of the traversed latent space2 . Empirically , we observe that even finding a handful of latent holes has been shown to be difficult for existing methods ( Falorsi et al. , 2018 ; Xu et al. , 2020 ) . Therefore , we tackle both challenges by proposing a highly efficient algorithm for decoder-centric latent hole identification . The pipeline of our TDC algorithm is described in Algorithm 1 and we give a detailed discussion as follows . For the visualisation of TDC ’ s working process in practice , please see Fig . 1 . 2For example , in a 3-dimensional latent space with 4 interpolations per path , as each point is the intersection of 3 paths , 43 = 64 points in total are determined . The space is then equally divided into 64 cubes . Algorithm 1 TDC for latent hole identification Input : Trained VAE model w/ a d-dimensional latent space ; original training set X ; reduced dimension dr ; the desired number of detected vectors in latent holes Nhole Output : Zhole 1 : Z← ∅ ; Vtrain ← ∅ ; Dtrain ← ∅ 2 : ∀x ∈ X , Z← Z ∪ { z̃ } // z̃ is the encoded x 3 : ∀x ∈ X , Vtrain ← Vtrain ∪ { E ( x ) } // E ( · ) is the expectation 4 : ∀x ∈ X , Dtrain ← Dtrain ∪ { σ ( x ) } // σ ( · ) is the standard deviation 5 : Z′ ← PCA ( Z ) // Dimension reduced from d to dr 6 : C ← a randomly-picked closed cube which contains dr vectors of Z′ , w/ edges parallel to dr dimensional axes 7 : Zhole ← ∅ ; Z′hub ← ∅ ; Π← ∅ 8 : while |Zhole| ≤ Nhole do 9 : if Z′hub == ∅ then 10 : Z′hub ← { a random point in C } // Restart BFS 11 : end if 12 : Π← unvisited line segments : passing through vectors in Z′hub ∧ parallel to one of the dr dimensions ∧ w/ endpoints on C // Depth increases by one 13 : Z′hub ← ∅ 14 : for each path ( cf . § 2.2 ) in Π do 15 : Sample z̃′i on path at an interval of 0.01 ∗min ( Dtrain ) 16 : ∀i , z̃i ← INVERSE PCA ( z̃′i ) 17 : ∀i , decode z̃i to compute I ( i ) w/ Vtrain and Dtrain // Cf . Eq . ( 2 ) in § 2.2 18 : if I ( i ) is an outlier then 19 : Zhole ← Zhole ∪ { z̃i } ; Z′hub ← Z′hub ∪ { z̃′i } 20 : end if 21 : end for 22 : end while Dimensionality Reduction . One problem for the current indicators is their limited searching capacity ( as evidenced by their time complexity O ( Id ) ) over the target space . Concretely speaking , both indicators rely on signalling latent holes through 1-dimensional traversal , but a latent space normally has dozens of dimensions to guarantee modelling capacity . To alleviate this issue , after feeding all training samples in X to the forward pass of a trained VAE and storing the encoded latent variables in Z ( Step 2 ) , we perform dimension reduction using Principal Component Analysis ( PCA ) ( Jolliffe , 1987 ) and conduct a search in the resulting dr-dimensional space instead of the original d-dimensional space ( Step 5 ) . We further save the mathematical expectation and standard deviation of each training sample in Vtrain ( Step 3 ) and Dtrain ( Step 4 ) , respectively . In addition , instead of traversing unconstrained paths like past studies , we only visit latent vectors through paths parallel to the dr dimensions ( see Step 12 and the next paragraph ) . Such a setup is based on the intuition that these top principal components contain more information about the latent space , and thus they are more likely to be useful when capturing latent holes . Initialising Infrastructures for Search . To further boost efficiency , we propose to conduct a search on a tree-based structure within a pre-established cubic fence . To be more concrete , at Step 6 we first locate a cube C which surrounds dr encoded training samples from Z′ ( i.e. , Z after dimension reduction ) . These dr posterior vectors serve as references when analysing the distribution of latent holes3 ( cf . § 4.2 ) . We restrict the edges of the dr-dimensional C to be parallel to the dr latent dimensional axes and treat C as the range of our search . Next , we regard each sampled latent vector after dimension reduction z̃′i as a node , and in order to expand the search regions rapidly , we need to visit these nodes following a BFS-based procedure ( Skiena , 2008 ) . Therefore , our algorithm maintains a set Z′hub to keep track of all untraversed hub nodes , where the root ( aka . the first hub node ) is randomly initialised in C ( Step 10 ) . For each hub node , we define dr orthogonal paths , each of which is a line segment that passes through the hub node and is parallel to one dimension . At Step 12 , we log paths having not been previously processed in a set Π. Identifying Latent Holes . Following the principle of BFS , the TDC algorithm processes all nodes at the same depth ( i.e. , all nodes on the paths in Π ) before moving to the next depth . On each path , following Falorsi et al . ( 2018 ) and Xu et al . ( 2020 ) , at Step 15 we sequentially sample a series 3To avoid cherry-picking and parameter deredundancy , we select dr as the number of contained z̃′ ∈ Z′ . of z̃′i . To ensure the sampling is fine-grained , we set the interpolation interval at the 0.01 times minimum standard deviation of all elements in Dtrain ( see Step 4 ) . After that , we utilise the inverse transformation of PCA ( Developers , 2011 ) to reconstruct z̃′i to the original d-dimensional latent space at Step 16 and generate output samples through the decoder at Step 17 . One core question raised is how to choose the indicator I between the two existing ones which seem quite distinct ( cf . § 2.2 ) . We eventually select the scheme of Falorsi et al . ( 2018 ) ( i.e. , ILIP in Eq . ( 2 ) ) and further adopt the Wassertein distance as the metric for the sample space . Detailed justifications are provided in § 3.2 and § 3.3 , respectively . After all paths in Π are investigated , our algorithm pushes the tree search to its next depth by reloading the emptied Z′hub with newly identified latent variables in the holes ( Step 19 ) . The motivation for treating them as new hub nodes comes from our observation that holes tend to gather as clusters . In case that no hub node is added , which suggests the end of current BFS , TDC will bootstrap another tree by randomly picking a new root . The algorithm halts when more than Nhole holes are identified . In practice , we find that our tree-search strategy with dimension reduction not only boosts the efficiency from an algorithmic perspective , but is also highly parallelisable by nature4 and thus can reduce computational time . In theory , the time complexity of TDC can be reduced toO ( Irdr ) , where dr can be as small as 3 ( cf . § 4 ) and Ir is typically less than 2 , thanks to the parallelism of our algorithm . In experiments , when the device is equipped with a Nvidia GTX Titan-X GPU and a Intel i9-9900K CPU , in most cases TDC ( with dr at 8 ) can return more than 200 holes in less than 5 minutes , whereas the methods of Falorsi et al . ( 2018 ) and Xu et al . ( 2020 ) often need at least 30 minutes to find a hole in the same setup as our TDC . 3.2 PICKING INDICATOR FOR TDC Obviously , the indicator used by TDC ( Step 17 in Algorithm 1 ) plays a crucial role as it directly affects the effectiveness of identifying latent holes . By analysing the two existing indicators in § 2.2 , we demonstrate that ( 1 ) although developed under different intuitions , they can actually be unified within a common framework ; ( 2 ) although both indicators have been tested successfully in validating the presence of latent holes , the indicator of Falorsi et al . ( 2018 ) ( ILIP ) is more accurate as it has better completeness and is thus more suitable to our algorithm . To begin with , we prove the following lemma : Lemma 1 NLL ( x , P ) , the NLL of a data point x under a multivariate normal distribution with independent dimensions P can be numerically linked with DG , the so-called Generalized Squared Interpoint Distance ( Gnanadesikan & Kettenring , 1972 ) , as NLL ( x , P ) ≡ 1 2 DG ( x , µ ) + δ ( KP ) s.t . P = N ( µ , KP ) , ( 4 ) where µ denotes the mean , KP denotes the covariance matrix , DG is the so-called Generalized Squared Interpoint Distance ( Gnanadesikan & Kettenring , 1972 ) , and δ ( · ) is a single value function . Proof . See Appendix A . Based on this lemma , we find that the right hand of Eq . ( 3 ) is numerically equivalent to directly calculating NLL ( z̃i , Z ( t ) ) for posterior Z ( t ) , yielding IAGG ( i ) ≡ M∑ t=1 [ 1 2 DG ( z̃i , µ ( t ) ) + δ ( KZ ( t ) ) ] /M s.t . Z ( t ) = N ( µ ( t ) , KZ ( t ) ) . ( 5 ) Note that as Z ( t ) is deterministic , δ ( KZ ( t ) ) settles as a constant term . By integrating Eq . ( 2 ) , w.l.o.g. , we can theoretically prove that if a latent position is signalled to be discontinuous by the indicator of Xu et al . ( 2020 ) , it will be identified using that of Falorsi et al . ( 2018 ) . Proof . See Appendix B . Apart from theoretical proof , empirically we also observe cases showing ILIP has better completeness than IAGG . We present one toy example in Appendix C. To conclude , ILIP should be adopted to reduce the false-negative rate of TDC . 4Our implementation parallelises the computation process at two hierarchies : different paths at the same BFS depth and different z̃′ on the same path .
This paper focuses on the discontinuities (aka. holes) in the latent space of VAE. Unlike previous work which concentrates on the encoder side, this paper pays attention to the decoder network who plays an important role in generation tasks. This paper analyzes two existing latent hole indicators and proves that they can actually be unified within a common framework by detailed theoretical proof. The author proposes a heuristic-based BFS algorithm for highly efficient latent space searching. And comprehensive experiments on the language generation task show how the latent holes harm the performance of VAEs and how the holes are distributed. Experiments also show that the latent vacancy hypothesis proposed by previous work does not hold empirically.
SP:4c020f0efc7031e0850de38213a56b52ca7f6343
On the Latent Holes 🧀 of VAEs for Text Generation
1 INTRODUCTION . Variational Auto-Encoders ( VAEs ) are powerful unsupervised models for learning low-dimensional manifolds ( aka . a latent space ) from non-trivial high-dimensional data ( Kingma & Welling , 2014 ; Rezende et al. , 2014 ) . They have found successes in a number of downstream tasks across different application domains such as text classification ( Xu et al. , 2017 ) , transfer learning ( Higgins et al. , 2017b ) , image synthesis ( Huang et al. , 2018 ; Razavi et al. , 2019 ) , language generation ( Bowman et al. , 2016 ; He et al. , 2019 ) , and music composition ( Roberts et al. , 2018 ) . Various effort has been made to improve the capacity of VAEs , where the majority of the extensions are focused on increasing the flexibility of the prior and approximating posterior . For instance , Davidson et al . ( 2018 ) introduced the von Mises-Fisher ( vMF ) distribution to replace the standard Gaussian distribution ; Kalatzis et al . ( 2020 ) assumed a Riemannian structure over the latent space by adopting the Riemannian Brownian motion prior . A few recent studies attempted to investigate the problem more fundamentally , and revealed that there exist discontinuous regions ( we refer to them as “ latent holes ” following past literature ) in the latent space , which have a detrimental effect on model capacity . Falorsi et al . ( 2018 ) approached the problem from a theoretical perspective of manifold mismatch and showed that this undesirable phenomenon is due to the latent space ’ s topological incapability of accurately capturing the properties of a dataset . Xu et al . ( 2020 ) examined the obstacles that prevent sequential VAEs from performing well in unsupervised controllable text generation , and empirically discovered that manipulating the latent variables for semantic variations in text often leads to latent variables to reside in some latent holes . As a result , the decoding network fails to properly decode or generalise when the sampled latent variables land in those areas . Although the works on investigating latent holes are still relatively sparse , they have opened up new opportunities for improving VAE models , where one can design mechanisms directly engineered for mitigating the hole issue . However , it should be noted that existing works ( Falorsi et al. , 2018 ; Xu et al. , 2020 ) exclusively target at the encoder network when investigating holes in the latent space , and they merely explored its existence without providing further in-depth analysis of the phenomenon . It has also been revealed that the hole issue is more severe on text compared to the image domain , due to the discreteness of text data ( Xu et al. , 2020 ) . In this paper , we tackle the aforementioned issues by proposing a novel tree-based decoder-centric ( TDC ) algorithm for latent hole identification , with a focus on the text domain . In contrast to existing works which are encoder-centric , our approach is centric to the decoder network , as a decoder has a direct impact on the model ’ s performance , e.g. , for text generation . Our TDC algorithm is also highly efficient for latent hole searching when compared to existing approaches , owing to the dimension reduction and Breadth-First Search strategies . Another important technical contribution is that we theoretically unify the two prior indicators for latent hole identification , and evidence that the one of Falorsi et al . ( 2018 ) is more accurate , which forms the basis of our algorithm detailed in § 3 . In terms of analysing the latent hole phenomenon , we provide , for the first time , an in-depth empirical analysis that examines three important aspects : ( i ) how the holes impact VAE models ’ performance on text generation ; ( ii ) whether the holes are really vacant , i.e. , useful information is not captured by the holes at all ; and ( iii ) how the holes are distributed in the latent space . To validate our theory and to demonstrate the generalisability of our proposed TDC algorithm , we pre-train five strong and representative VAE models for producing sentences , including the state-of-the-art model . Comprehensive experiments on the text task involving four large-scale public datasets show that the output quality is strongly correlated with the density of latent holes ; that from the perspective of the decoder , the Latent Vacancy Hypothesis proposed by Xu et al . ( 2020 ) does not hold empirically ; and that holes are ubiquitous and densely distributed in the latent space . Our code will be made publicly available upon the acceptance of this paper . 2 PRELIMINARIES . 2.1 VARIATIONAL AUTOENCODER . A VAE is a generative model which defines a joint distribution over the observations x and the latent variable z̃ , i.e. , p ( x , z̃ ) = p ( x|z̃ ) p ( z̃ ) . Given a dataset X = { xi } Ni=1 with N i.i.d . datapoints , we need to optimise the marginal likelihood p ( X ) = 1N ∑N i ∫ p ( xi|z̃ ) p ( z̃ ) dz̃ over the entire training set . However , this marginal likelihood is intractable . A common solution is to maximise the Evidence Lower BOund ( ELBO ) via variational inference for every observation x : L ( θ , φ ; x ) = Eqφ ( z̃|x ) ( log pθ ( x|z̃ ) ) −DKL ( qφ ( z̃|x ) ‖p ( z̃ ) ) , ( 1 ) where qφ ( z̃|x ) is a variational posterior to approximate the true posterior p ( z̃|x ) . The variational posterior qφ ( z̃|x ) ( aka . encoder ) and the conditional distribution pθ ( x|z̃ ) ( aka . decoder ) are set up using two neural networks parameterised by φ and θ , respectively . Normally , the first term in Eq . ( 1 ) is the expected data reconstruction loss showing how well the model can reconstruct data given a latent variable . The second term is the KL-divergence of the approximate variational posterior from the prior , i.e. , a regularisation forcing the learned posterior to be as close to the prior as possible . 2.2 EXISTING LATENT HOLE INDICATORS . To our knowledge , there are only two prior works which directly determine whether a latent region is continuous or not . One work formalises latent holes based on the relative distance of pairwise points taken from the latent space and the sample space ( Falorsi et al. , 2018 ) . Concretely speaking , given a pair of vectors z̃i and z̃i+1 which are closely located on a latent path , and their corresponding samples x′i and x′i+1 in the sample space , a latent hole indicator is computed as ILIP ( i ) : = Dsample ( x ′ i , x ′ i+1 ) /Dlatent ( z̃i , z̃i+1 ) , ( 2 ) where Dsample and Dlatent respectively denote the metrics measuring the sample and latent spaces ( NB : Dlatent is an arbitrary metric , e.g. , the Euclidean distance and Riemannian distance ) . Falorsi et al . ( 2018 ) focused on the image domain and utilised Euclidean distance for both spaces . Based on the concept of Lipschitz continuity , Falorsi et al . ( 2018 ) then proposed to measure the continuity of a latent region as follows : under the premise that z̃i+1 does not land on a hole , z̃i is recognised as belonging to a hole if the corresponding ILIP ( i ) is a large outlier1 . Another line of work ( Xu et al. , 2020 ) signals latent holes based on the so-called aggregated posterior , with a focus on sequential VAEs for language modelling . This approach interpolates a series of vectors on a latent path at a small interval , and then scores the i-th latent vector z̃i as IAGG ( i ) : = ∑M t=1NLL ( z̃i , Z ( t ) ) /M , ( 3 ) 1Unless otherwise stated , outliers are detected by comparing the subject data point with a fixed bound , which is pre-determined based on a percentile of all data points . where Z ( t ) is the sample of the posterior distribution of the t-th out of the total M training samples , e.g. , when studying holes on the encoder side , this distribution can be computed using qφ ( z̃|x ) in Eq . ( 1 ) ( Xu et al. , 2020 ) . Z ( t ) serves as the reference when calculating the Negative Log-Likelihood ( NLL ) . After all the interpolated vectors on the latent path are traversed , similar to the first method , vectors with large outlier indicators ( IAGG ) are identified as in latent holes . We note that these two indicators actually stem from different intuitions . For ILIP , there is an underlying assumption that a mapping between the sample and latent spaces should have good stability in terms of relative distance change in order to guarantee good continuity in the latent space . In contrast , IAGG is based on the belief that small perturbations on the non-hole regions should not lead to large offsets on the absolute dissimilarity between posterior samples Z ( · ) and the sample z̃i , and hence the calculation is performed only in the latent space and only around one single latent position . While seemly distinct , we show that ( in § 3.2 ) both indicators actually have tight underlying connections and can be unified in a shared mathematical framework . Moreover , the first indicator ( ILIP ) is proofed to be more comprehensive than the second ( IAGG ) and thus can reduce false negatives when identifying holes in the latent space . This forms the basis of our algorithm in § 3 , which is the first attempt to identify a VAE decoder ’ s latent holes for language generation . 3 METHODOLOGY . In this section , we describe our tree-based decoder-centric ( TDC ) algorithm for latent hole identification , which consists of three main components . We first introduce our heuristic-based Breadth-First Search ( BFS ) algorithm for highly efficient latent space searching ( § 3.1 ) . We then theoretically proof , for the first time , that two existing holes indicators can be unified under the same framework and that ILIP is a more suitable choice for identifying latent holes ( § 3.2 ) . Finally , we extend ILIP to the text domain by incorporating the Wasserstein distance for the sample space ( § 3.3 ) . 3.1 TREE-BASED DECODER-CENTRIC LATENT HOLE IDENTIFICATION . As discussed earlier , existing works for investigating latent holes of VAEs all exclusively focus on the encoder network ( e.g. , Falorsi et al . ( 2018 ) ; Xu et al . ( 2020 ) ) , and they can not be trivially applied to the decoders ( which play ultimately important roles on generation tasks ) due to metric incompatibility , especially for VAEs in the text domain ( see detailed discussion in § 3.3 ) . Another drawback of existing indicators is that they have very limited efficiency . Theoretically , their time complexity for traversing a d-dimensional latent space with I interpolations per path is O ( Id ) at the optimal efficiency , which is computationally prohibitive as typically d and I are larger than 30 and 50 for VAEs in practice . Each path is parallel to one axis of the traversed latent space2 . Empirically , we observe that even finding a handful of latent holes has been shown to be difficult for existing methods ( Falorsi et al. , 2018 ; Xu et al. , 2020 ) . Therefore , we tackle both challenges by proposing a highly efficient algorithm for decoder-centric latent hole identification . The pipeline of our TDC algorithm is described in Algorithm 1 and we give a detailed discussion as follows . For the visualisation of TDC ’ s working process in practice , please see Fig . 1 . 2For example , in a 3-dimensional latent space with 4 interpolations per path , as each point is the intersection of 3 paths , 43 = 64 points in total are determined . The space is then equally divided into 64 cubes . Algorithm 1 TDC for latent hole identification Input : Trained VAE model w/ a d-dimensional latent space ; original training set X ; reduced dimension dr ; the desired number of detected vectors in latent holes Nhole Output : Zhole 1 : Z← ∅ ; Vtrain ← ∅ ; Dtrain ← ∅ 2 : ∀x ∈ X , Z← Z ∪ { z̃ } // z̃ is the encoded x 3 : ∀x ∈ X , Vtrain ← Vtrain ∪ { E ( x ) } // E ( · ) is the expectation 4 : ∀x ∈ X , Dtrain ← Dtrain ∪ { σ ( x ) } // σ ( · ) is the standard deviation 5 : Z′ ← PCA ( Z ) // Dimension reduced from d to dr 6 : C ← a randomly-picked closed cube which contains dr vectors of Z′ , w/ edges parallel to dr dimensional axes 7 : Zhole ← ∅ ; Z′hub ← ∅ ; Π← ∅ 8 : while |Zhole| ≤ Nhole do 9 : if Z′hub == ∅ then 10 : Z′hub ← { a random point in C } // Restart BFS 11 : end if 12 : Π← unvisited line segments : passing through vectors in Z′hub ∧ parallel to one of the dr dimensions ∧ w/ endpoints on C // Depth increases by one 13 : Z′hub ← ∅ 14 : for each path ( cf . § 2.2 ) in Π do 15 : Sample z̃′i on path at an interval of 0.01 ∗min ( Dtrain ) 16 : ∀i , z̃i ← INVERSE PCA ( z̃′i ) 17 : ∀i , decode z̃i to compute I ( i ) w/ Vtrain and Dtrain // Cf . Eq . ( 2 ) in § 2.2 18 : if I ( i ) is an outlier then 19 : Zhole ← Zhole ∪ { z̃i } ; Z′hub ← Z′hub ∪ { z̃′i } 20 : end if 21 : end for 22 : end while Dimensionality Reduction . One problem for the current indicators is their limited searching capacity ( as evidenced by their time complexity O ( Id ) ) over the target space . Concretely speaking , both indicators rely on signalling latent holes through 1-dimensional traversal , but a latent space normally has dozens of dimensions to guarantee modelling capacity . To alleviate this issue , after feeding all training samples in X to the forward pass of a trained VAE and storing the encoded latent variables in Z ( Step 2 ) , we perform dimension reduction using Principal Component Analysis ( PCA ) ( Jolliffe , 1987 ) and conduct a search in the resulting dr-dimensional space instead of the original d-dimensional space ( Step 5 ) . We further save the mathematical expectation and standard deviation of each training sample in Vtrain ( Step 3 ) and Dtrain ( Step 4 ) , respectively . In addition , instead of traversing unconstrained paths like past studies , we only visit latent vectors through paths parallel to the dr dimensions ( see Step 12 and the next paragraph ) . Such a setup is based on the intuition that these top principal components contain more information about the latent space , and thus they are more likely to be useful when capturing latent holes . Initialising Infrastructures for Search . To further boost efficiency , we propose to conduct a search on a tree-based structure within a pre-established cubic fence . To be more concrete , at Step 6 we first locate a cube C which surrounds dr encoded training samples from Z′ ( i.e. , Z after dimension reduction ) . These dr posterior vectors serve as references when analysing the distribution of latent holes3 ( cf . § 4.2 ) . We restrict the edges of the dr-dimensional C to be parallel to the dr latent dimensional axes and treat C as the range of our search . Next , we regard each sampled latent vector after dimension reduction z̃′i as a node , and in order to expand the search regions rapidly , we need to visit these nodes following a BFS-based procedure ( Skiena , 2008 ) . Therefore , our algorithm maintains a set Z′hub to keep track of all untraversed hub nodes , where the root ( aka . the first hub node ) is randomly initialised in C ( Step 10 ) . For each hub node , we define dr orthogonal paths , each of which is a line segment that passes through the hub node and is parallel to one dimension . At Step 12 , we log paths having not been previously processed in a set Π. Identifying Latent Holes . Following the principle of BFS , the TDC algorithm processes all nodes at the same depth ( i.e. , all nodes on the paths in Π ) before moving to the next depth . On each path , following Falorsi et al . ( 2018 ) and Xu et al . ( 2020 ) , at Step 15 we sequentially sample a series 3To avoid cherry-picking and parameter deredundancy , we select dr as the number of contained z̃′ ∈ Z′ . of z̃′i . To ensure the sampling is fine-grained , we set the interpolation interval at the 0.01 times minimum standard deviation of all elements in Dtrain ( see Step 4 ) . After that , we utilise the inverse transformation of PCA ( Developers , 2011 ) to reconstruct z̃′i to the original d-dimensional latent space at Step 16 and generate output samples through the decoder at Step 17 . One core question raised is how to choose the indicator I between the two existing ones which seem quite distinct ( cf . § 2.2 ) . We eventually select the scheme of Falorsi et al . ( 2018 ) ( i.e. , ILIP in Eq . ( 2 ) ) and further adopt the Wassertein distance as the metric for the sample space . Detailed justifications are provided in § 3.2 and § 3.3 , respectively . After all paths in Π are investigated , our algorithm pushes the tree search to its next depth by reloading the emptied Z′hub with newly identified latent variables in the holes ( Step 19 ) . The motivation for treating them as new hub nodes comes from our observation that holes tend to gather as clusters . In case that no hub node is added , which suggests the end of current BFS , TDC will bootstrap another tree by randomly picking a new root . The algorithm halts when more than Nhole holes are identified . In practice , we find that our tree-search strategy with dimension reduction not only boosts the efficiency from an algorithmic perspective , but is also highly parallelisable by nature4 and thus can reduce computational time . In theory , the time complexity of TDC can be reduced toO ( Irdr ) , where dr can be as small as 3 ( cf . § 4 ) and Ir is typically less than 2 , thanks to the parallelism of our algorithm . In experiments , when the device is equipped with a Nvidia GTX Titan-X GPU and a Intel i9-9900K CPU , in most cases TDC ( with dr at 8 ) can return more than 200 holes in less than 5 minutes , whereas the methods of Falorsi et al . ( 2018 ) and Xu et al . ( 2020 ) often need at least 30 minutes to find a hole in the same setup as our TDC . 3.2 PICKING INDICATOR FOR TDC Obviously , the indicator used by TDC ( Step 17 in Algorithm 1 ) plays a crucial role as it directly affects the effectiveness of identifying latent holes . By analysing the two existing indicators in § 2.2 , we demonstrate that ( 1 ) although developed under different intuitions , they can actually be unified within a common framework ; ( 2 ) although both indicators have been tested successfully in validating the presence of latent holes , the indicator of Falorsi et al . ( 2018 ) ( ILIP ) is more accurate as it has better completeness and is thus more suitable to our algorithm . To begin with , we prove the following lemma : Lemma 1 NLL ( x , P ) , the NLL of a data point x under a multivariate normal distribution with independent dimensions P can be numerically linked with DG , the so-called Generalized Squared Interpoint Distance ( Gnanadesikan & Kettenring , 1972 ) , as NLL ( x , P ) ≡ 1 2 DG ( x , µ ) + δ ( KP ) s.t . P = N ( µ , KP ) , ( 4 ) where µ denotes the mean , KP denotes the covariance matrix , DG is the so-called Generalized Squared Interpoint Distance ( Gnanadesikan & Kettenring , 1972 ) , and δ ( · ) is a single value function . Proof . See Appendix A . Based on this lemma , we find that the right hand of Eq . ( 3 ) is numerically equivalent to directly calculating NLL ( z̃i , Z ( t ) ) for posterior Z ( t ) , yielding IAGG ( i ) ≡ M∑ t=1 [ 1 2 DG ( z̃i , µ ( t ) ) + δ ( KZ ( t ) ) ] /M s.t . Z ( t ) = N ( µ ( t ) , KZ ( t ) ) . ( 5 ) Note that as Z ( t ) is deterministic , δ ( KZ ( t ) ) settles as a constant term . By integrating Eq . ( 2 ) , w.l.o.g. , we can theoretically prove that if a latent position is signalled to be discontinuous by the indicator of Xu et al . ( 2020 ) , it will be identified using that of Falorsi et al . ( 2018 ) . Proof . See Appendix B . Apart from theoretical proof , empirically we also observe cases showing ILIP has better completeness than IAGG . We present one toy example in Appendix C. To conclude , ILIP should be adopted to reduce the false-negative rate of TDC . 4Our implementation parallelises the computation process at two hierarchies : different paths at the same BFS depth and different z̃′ on the same path .
The paper is concerned with discontinuities in the latent space of Variational Autoencoders, specifically with finding those so called holes algorithmically. There are three main contributions: * A theoretical analysis of two existing algorithms for finding holes. The result shows that one is strictly more powerful than the other. * A novel algorithm, TDC, for finding holes that is substantially faster than the existing ones, primarily due to dimensionality reduction techniques. Different from previous algorithms, the hole criterion takes into account the ability of the decoder to generate from a point in latent space. * An empirical analysis of the density of latent holes in different types of VAEs and on varying datasets. Among other things, the paper claims to have found empirical evidence for the Latent Vacancy Hypothesis, which states that holes don't carry any information. To this end, they compare the quality of text generated from a hole to the quality of text generated from an untrained VAE.
SP:4c020f0efc7031e0850de38213a56b52ca7f6343
On the Latent Holes 🧀 of VAEs for Text Generation
1 INTRODUCTION . Variational Auto-Encoders ( VAEs ) are powerful unsupervised models for learning low-dimensional manifolds ( aka . a latent space ) from non-trivial high-dimensional data ( Kingma & Welling , 2014 ; Rezende et al. , 2014 ) . They have found successes in a number of downstream tasks across different application domains such as text classification ( Xu et al. , 2017 ) , transfer learning ( Higgins et al. , 2017b ) , image synthesis ( Huang et al. , 2018 ; Razavi et al. , 2019 ) , language generation ( Bowman et al. , 2016 ; He et al. , 2019 ) , and music composition ( Roberts et al. , 2018 ) . Various effort has been made to improve the capacity of VAEs , where the majority of the extensions are focused on increasing the flexibility of the prior and approximating posterior . For instance , Davidson et al . ( 2018 ) introduced the von Mises-Fisher ( vMF ) distribution to replace the standard Gaussian distribution ; Kalatzis et al . ( 2020 ) assumed a Riemannian structure over the latent space by adopting the Riemannian Brownian motion prior . A few recent studies attempted to investigate the problem more fundamentally , and revealed that there exist discontinuous regions ( we refer to them as “ latent holes ” following past literature ) in the latent space , which have a detrimental effect on model capacity . Falorsi et al . ( 2018 ) approached the problem from a theoretical perspective of manifold mismatch and showed that this undesirable phenomenon is due to the latent space ’ s topological incapability of accurately capturing the properties of a dataset . Xu et al . ( 2020 ) examined the obstacles that prevent sequential VAEs from performing well in unsupervised controllable text generation , and empirically discovered that manipulating the latent variables for semantic variations in text often leads to latent variables to reside in some latent holes . As a result , the decoding network fails to properly decode or generalise when the sampled latent variables land in those areas . Although the works on investigating latent holes are still relatively sparse , they have opened up new opportunities for improving VAE models , where one can design mechanisms directly engineered for mitigating the hole issue . However , it should be noted that existing works ( Falorsi et al. , 2018 ; Xu et al. , 2020 ) exclusively target at the encoder network when investigating holes in the latent space , and they merely explored its existence without providing further in-depth analysis of the phenomenon . It has also been revealed that the hole issue is more severe on text compared to the image domain , due to the discreteness of text data ( Xu et al. , 2020 ) . In this paper , we tackle the aforementioned issues by proposing a novel tree-based decoder-centric ( TDC ) algorithm for latent hole identification , with a focus on the text domain . In contrast to existing works which are encoder-centric , our approach is centric to the decoder network , as a decoder has a direct impact on the model ’ s performance , e.g. , for text generation . Our TDC algorithm is also highly efficient for latent hole searching when compared to existing approaches , owing to the dimension reduction and Breadth-First Search strategies . Another important technical contribution is that we theoretically unify the two prior indicators for latent hole identification , and evidence that the one of Falorsi et al . ( 2018 ) is more accurate , which forms the basis of our algorithm detailed in § 3 . In terms of analysing the latent hole phenomenon , we provide , for the first time , an in-depth empirical analysis that examines three important aspects : ( i ) how the holes impact VAE models ’ performance on text generation ; ( ii ) whether the holes are really vacant , i.e. , useful information is not captured by the holes at all ; and ( iii ) how the holes are distributed in the latent space . To validate our theory and to demonstrate the generalisability of our proposed TDC algorithm , we pre-train five strong and representative VAE models for producing sentences , including the state-of-the-art model . Comprehensive experiments on the text task involving four large-scale public datasets show that the output quality is strongly correlated with the density of latent holes ; that from the perspective of the decoder , the Latent Vacancy Hypothesis proposed by Xu et al . ( 2020 ) does not hold empirically ; and that holes are ubiquitous and densely distributed in the latent space . Our code will be made publicly available upon the acceptance of this paper . 2 PRELIMINARIES . 2.1 VARIATIONAL AUTOENCODER . A VAE is a generative model which defines a joint distribution over the observations x and the latent variable z̃ , i.e. , p ( x , z̃ ) = p ( x|z̃ ) p ( z̃ ) . Given a dataset X = { xi } Ni=1 with N i.i.d . datapoints , we need to optimise the marginal likelihood p ( X ) = 1N ∑N i ∫ p ( xi|z̃ ) p ( z̃ ) dz̃ over the entire training set . However , this marginal likelihood is intractable . A common solution is to maximise the Evidence Lower BOund ( ELBO ) via variational inference for every observation x : L ( θ , φ ; x ) = Eqφ ( z̃|x ) ( log pθ ( x|z̃ ) ) −DKL ( qφ ( z̃|x ) ‖p ( z̃ ) ) , ( 1 ) where qφ ( z̃|x ) is a variational posterior to approximate the true posterior p ( z̃|x ) . The variational posterior qφ ( z̃|x ) ( aka . encoder ) and the conditional distribution pθ ( x|z̃ ) ( aka . decoder ) are set up using two neural networks parameterised by φ and θ , respectively . Normally , the first term in Eq . ( 1 ) is the expected data reconstruction loss showing how well the model can reconstruct data given a latent variable . The second term is the KL-divergence of the approximate variational posterior from the prior , i.e. , a regularisation forcing the learned posterior to be as close to the prior as possible . 2.2 EXISTING LATENT HOLE INDICATORS . To our knowledge , there are only two prior works which directly determine whether a latent region is continuous or not . One work formalises latent holes based on the relative distance of pairwise points taken from the latent space and the sample space ( Falorsi et al. , 2018 ) . Concretely speaking , given a pair of vectors z̃i and z̃i+1 which are closely located on a latent path , and their corresponding samples x′i and x′i+1 in the sample space , a latent hole indicator is computed as ILIP ( i ) : = Dsample ( x ′ i , x ′ i+1 ) /Dlatent ( z̃i , z̃i+1 ) , ( 2 ) where Dsample and Dlatent respectively denote the metrics measuring the sample and latent spaces ( NB : Dlatent is an arbitrary metric , e.g. , the Euclidean distance and Riemannian distance ) . Falorsi et al . ( 2018 ) focused on the image domain and utilised Euclidean distance for both spaces . Based on the concept of Lipschitz continuity , Falorsi et al . ( 2018 ) then proposed to measure the continuity of a latent region as follows : under the premise that z̃i+1 does not land on a hole , z̃i is recognised as belonging to a hole if the corresponding ILIP ( i ) is a large outlier1 . Another line of work ( Xu et al. , 2020 ) signals latent holes based on the so-called aggregated posterior , with a focus on sequential VAEs for language modelling . This approach interpolates a series of vectors on a latent path at a small interval , and then scores the i-th latent vector z̃i as IAGG ( i ) : = ∑M t=1NLL ( z̃i , Z ( t ) ) /M , ( 3 ) 1Unless otherwise stated , outliers are detected by comparing the subject data point with a fixed bound , which is pre-determined based on a percentile of all data points . where Z ( t ) is the sample of the posterior distribution of the t-th out of the total M training samples , e.g. , when studying holes on the encoder side , this distribution can be computed using qφ ( z̃|x ) in Eq . ( 1 ) ( Xu et al. , 2020 ) . Z ( t ) serves as the reference when calculating the Negative Log-Likelihood ( NLL ) . After all the interpolated vectors on the latent path are traversed , similar to the first method , vectors with large outlier indicators ( IAGG ) are identified as in latent holes . We note that these two indicators actually stem from different intuitions . For ILIP , there is an underlying assumption that a mapping between the sample and latent spaces should have good stability in terms of relative distance change in order to guarantee good continuity in the latent space . In contrast , IAGG is based on the belief that small perturbations on the non-hole regions should not lead to large offsets on the absolute dissimilarity between posterior samples Z ( · ) and the sample z̃i , and hence the calculation is performed only in the latent space and only around one single latent position . While seemly distinct , we show that ( in § 3.2 ) both indicators actually have tight underlying connections and can be unified in a shared mathematical framework . Moreover , the first indicator ( ILIP ) is proofed to be more comprehensive than the second ( IAGG ) and thus can reduce false negatives when identifying holes in the latent space . This forms the basis of our algorithm in § 3 , which is the first attempt to identify a VAE decoder ’ s latent holes for language generation . 3 METHODOLOGY . In this section , we describe our tree-based decoder-centric ( TDC ) algorithm for latent hole identification , which consists of three main components . We first introduce our heuristic-based Breadth-First Search ( BFS ) algorithm for highly efficient latent space searching ( § 3.1 ) . We then theoretically proof , for the first time , that two existing holes indicators can be unified under the same framework and that ILIP is a more suitable choice for identifying latent holes ( § 3.2 ) . Finally , we extend ILIP to the text domain by incorporating the Wasserstein distance for the sample space ( § 3.3 ) . 3.1 TREE-BASED DECODER-CENTRIC LATENT HOLE IDENTIFICATION . As discussed earlier , existing works for investigating latent holes of VAEs all exclusively focus on the encoder network ( e.g. , Falorsi et al . ( 2018 ) ; Xu et al . ( 2020 ) ) , and they can not be trivially applied to the decoders ( which play ultimately important roles on generation tasks ) due to metric incompatibility , especially for VAEs in the text domain ( see detailed discussion in § 3.3 ) . Another drawback of existing indicators is that they have very limited efficiency . Theoretically , their time complexity for traversing a d-dimensional latent space with I interpolations per path is O ( Id ) at the optimal efficiency , which is computationally prohibitive as typically d and I are larger than 30 and 50 for VAEs in practice . Each path is parallel to one axis of the traversed latent space2 . Empirically , we observe that even finding a handful of latent holes has been shown to be difficult for existing methods ( Falorsi et al. , 2018 ; Xu et al. , 2020 ) . Therefore , we tackle both challenges by proposing a highly efficient algorithm for decoder-centric latent hole identification . The pipeline of our TDC algorithm is described in Algorithm 1 and we give a detailed discussion as follows . For the visualisation of TDC ’ s working process in practice , please see Fig . 1 . 2For example , in a 3-dimensional latent space with 4 interpolations per path , as each point is the intersection of 3 paths , 43 = 64 points in total are determined . The space is then equally divided into 64 cubes . Algorithm 1 TDC for latent hole identification Input : Trained VAE model w/ a d-dimensional latent space ; original training set X ; reduced dimension dr ; the desired number of detected vectors in latent holes Nhole Output : Zhole 1 : Z← ∅ ; Vtrain ← ∅ ; Dtrain ← ∅ 2 : ∀x ∈ X , Z← Z ∪ { z̃ } // z̃ is the encoded x 3 : ∀x ∈ X , Vtrain ← Vtrain ∪ { E ( x ) } // E ( · ) is the expectation 4 : ∀x ∈ X , Dtrain ← Dtrain ∪ { σ ( x ) } // σ ( · ) is the standard deviation 5 : Z′ ← PCA ( Z ) // Dimension reduced from d to dr 6 : C ← a randomly-picked closed cube which contains dr vectors of Z′ , w/ edges parallel to dr dimensional axes 7 : Zhole ← ∅ ; Z′hub ← ∅ ; Π← ∅ 8 : while |Zhole| ≤ Nhole do 9 : if Z′hub == ∅ then 10 : Z′hub ← { a random point in C } // Restart BFS 11 : end if 12 : Π← unvisited line segments : passing through vectors in Z′hub ∧ parallel to one of the dr dimensions ∧ w/ endpoints on C // Depth increases by one 13 : Z′hub ← ∅ 14 : for each path ( cf . § 2.2 ) in Π do 15 : Sample z̃′i on path at an interval of 0.01 ∗min ( Dtrain ) 16 : ∀i , z̃i ← INVERSE PCA ( z̃′i ) 17 : ∀i , decode z̃i to compute I ( i ) w/ Vtrain and Dtrain // Cf . Eq . ( 2 ) in § 2.2 18 : if I ( i ) is an outlier then 19 : Zhole ← Zhole ∪ { z̃i } ; Z′hub ← Z′hub ∪ { z̃′i } 20 : end if 21 : end for 22 : end while Dimensionality Reduction . One problem for the current indicators is their limited searching capacity ( as evidenced by their time complexity O ( Id ) ) over the target space . Concretely speaking , both indicators rely on signalling latent holes through 1-dimensional traversal , but a latent space normally has dozens of dimensions to guarantee modelling capacity . To alleviate this issue , after feeding all training samples in X to the forward pass of a trained VAE and storing the encoded latent variables in Z ( Step 2 ) , we perform dimension reduction using Principal Component Analysis ( PCA ) ( Jolliffe , 1987 ) and conduct a search in the resulting dr-dimensional space instead of the original d-dimensional space ( Step 5 ) . We further save the mathematical expectation and standard deviation of each training sample in Vtrain ( Step 3 ) and Dtrain ( Step 4 ) , respectively . In addition , instead of traversing unconstrained paths like past studies , we only visit latent vectors through paths parallel to the dr dimensions ( see Step 12 and the next paragraph ) . Such a setup is based on the intuition that these top principal components contain more information about the latent space , and thus they are more likely to be useful when capturing latent holes . Initialising Infrastructures for Search . To further boost efficiency , we propose to conduct a search on a tree-based structure within a pre-established cubic fence . To be more concrete , at Step 6 we first locate a cube C which surrounds dr encoded training samples from Z′ ( i.e. , Z after dimension reduction ) . These dr posterior vectors serve as references when analysing the distribution of latent holes3 ( cf . § 4.2 ) . We restrict the edges of the dr-dimensional C to be parallel to the dr latent dimensional axes and treat C as the range of our search . Next , we regard each sampled latent vector after dimension reduction z̃′i as a node , and in order to expand the search regions rapidly , we need to visit these nodes following a BFS-based procedure ( Skiena , 2008 ) . Therefore , our algorithm maintains a set Z′hub to keep track of all untraversed hub nodes , where the root ( aka . the first hub node ) is randomly initialised in C ( Step 10 ) . For each hub node , we define dr orthogonal paths , each of which is a line segment that passes through the hub node and is parallel to one dimension . At Step 12 , we log paths having not been previously processed in a set Π. Identifying Latent Holes . Following the principle of BFS , the TDC algorithm processes all nodes at the same depth ( i.e. , all nodes on the paths in Π ) before moving to the next depth . On each path , following Falorsi et al . ( 2018 ) and Xu et al . ( 2020 ) , at Step 15 we sequentially sample a series 3To avoid cherry-picking and parameter deredundancy , we select dr as the number of contained z̃′ ∈ Z′ . of z̃′i . To ensure the sampling is fine-grained , we set the interpolation interval at the 0.01 times minimum standard deviation of all elements in Dtrain ( see Step 4 ) . After that , we utilise the inverse transformation of PCA ( Developers , 2011 ) to reconstruct z̃′i to the original d-dimensional latent space at Step 16 and generate output samples through the decoder at Step 17 . One core question raised is how to choose the indicator I between the two existing ones which seem quite distinct ( cf . § 2.2 ) . We eventually select the scheme of Falorsi et al . ( 2018 ) ( i.e. , ILIP in Eq . ( 2 ) ) and further adopt the Wassertein distance as the metric for the sample space . Detailed justifications are provided in § 3.2 and § 3.3 , respectively . After all paths in Π are investigated , our algorithm pushes the tree search to its next depth by reloading the emptied Z′hub with newly identified latent variables in the holes ( Step 19 ) . The motivation for treating them as new hub nodes comes from our observation that holes tend to gather as clusters . In case that no hub node is added , which suggests the end of current BFS , TDC will bootstrap another tree by randomly picking a new root . The algorithm halts when more than Nhole holes are identified . In practice , we find that our tree-search strategy with dimension reduction not only boosts the efficiency from an algorithmic perspective , but is also highly parallelisable by nature4 and thus can reduce computational time . In theory , the time complexity of TDC can be reduced toO ( Irdr ) , where dr can be as small as 3 ( cf . § 4 ) and Ir is typically less than 2 , thanks to the parallelism of our algorithm . In experiments , when the device is equipped with a Nvidia GTX Titan-X GPU and a Intel i9-9900K CPU , in most cases TDC ( with dr at 8 ) can return more than 200 holes in less than 5 minutes , whereas the methods of Falorsi et al . ( 2018 ) and Xu et al . ( 2020 ) often need at least 30 minutes to find a hole in the same setup as our TDC . 3.2 PICKING INDICATOR FOR TDC Obviously , the indicator used by TDC ( Step 17 in Algorithm 1 ) plays a crucial role as it directly affects the effectiveness of identifying latent holes . By analysing the two existing indicators in § 2.2 , we demonstrate that ( 1 ) although developed under different intuitions , they can actually be unified within a common framework ; ( 2 ) although both indicators have been tested successfully in validating the presence of latent holes , the indicator of Falorsi et al . ( 2018 ) ( ILIP ) is more accurate as it has better completeness and is thus more suitable to our algorithm . To begin with , we prove the following lemma : Lemma 1 NLL ( x , P ) , the NLL of a data point x under a multivariate normal distribution with independent dimensions P can be numerically linked with DG , the so-called Generalized Squared Interpoint Distance ( Gnanadesikan & Kettenring , 1972 ) , as NLL ( x , P ) ≡ 1 2 DG ( x , µ ) + δ ( KP ) s.t . P = N ( µ , KP ) , ( 4 ) where µ denotes the mean , KP denotes the covariance matrix , DG is the so-called Generalized Squared Interpoint Distance ( Gnanadesikan & Kettenring , 1972 ) , and δ ( · ) is a single value function . Proof . See Appendix A . Based on this lemma , we find that the right hand of Eq . ( 3 ) is numerically equivalent to directly calculating NLL ( z̃i , Z ( t ) ) for posterior Z ( t ) , yielding IAGG ( i ) ≡ M∑ t=1 [ 1 2 DG ( z̃i , µ ( t ) ) + δ ( KZ ( t ) ) ] /M s.t . Z ( t ) = N ( µ ( t ) , KZ ( t ) ) . ( 5 ) Note that as Z ( t ) is deterministic , δ ( KZ ( t ) ) settles as a constant term . By integrating Eq . ( 2 ) , w.l.o.g. , we can theoretically prove that if a latent position is signalled to be discontinuous by the indicator of Xu et al . ( 2020 ) , it will be identified using that of Falorsi et al . ( 2018 ) . Proof . See Appendix B . Apart from theoretical proof , empirically we also observe cases showing ILIP has better completeness than IAGG . We present one toy example in Appendix C. To conclude , ILIP should be adopted to reduce the false-negative rate of TDC . 4Our implementation parallelises the computation process at two hierarchies : different paths at the same BFS depth and different z̃′ on the same path .
This paper studies the holes within the latent space of text VAEs. The major contribution is a hole detection algorithm, which firstly projects the latent representations to a principle subspace, then performs tree-based BFS to detect holes. However, this paper suffers from its unclear presentation of the algorithm (with many mistakes), concerns regarding algorithm scalability and sensitivity, and experiment settings.
SP:4c020f0efc7031e0850de38213a56b52ca7f6343
Physics-Informed Neural Operator for Learning Partial Differential Equations
1 INTRODUCTION . Machine learning-based methods are starting to show promise in scientific computing and especially in solving partial differential equations ( PDEs ) . They have demonstrated advantages in both efficiency and accuracy compared to conventional solvers . They are even able to tackle previously intractable problems such as higher-dimensional , multi-scale , high-contrast , and chaotic PDE systems ( Um et al. , 2020 ; Brunton et al. , 2020 ; Fan et al. , 2018 ; Long et al. , 2018 ; Han et al. , 2018 ; Bruno et al. , 2021 ) . Broadly , ML-based approaches for PDEs can be divided into two categories : optimizing to solve for a specific solution function of PDE vs. learning the solution operator over a family of PDEs . Optimization of solution function and PINN . Most ML-based methods , as well as the conventional solvers , fall into this category . Conventional solvers such as FDM and FEM usually discretize the domain into a grid and optimize/approximate the solution function on the grid , which imposes a truncation error . The Physics-Informed Neural Network ( PINN ) -type methods are proposed to overcome the discretization issue ( Raissi et al. , 2019 ) . They use a neural network as the ansatz of the solution function and take advantage of auto-differentiation to compute the exact , mesh-free derivatives . Recently , researchers have developed numerous variations of PINN with promising results on inverse problems and partially observed tasks ( Lu et al. , 2021a ; Zhu et al. , 2019 ; Smith et al. , 2021 ) . However , compared to conventional solvers , PINNs face several optimization issues : ( 1 ) the challenging optimization landscape from soft physics or PDE constraints ( Wang et al. , 2021a ) , ( 2 ) the difficulty to propagate information from the initial or boundary conditions to unseen parts of the interior or to future times ( Dwivedi & Srinivasan , 2020 ) , and ( 3 ) the sensitivity to hyper-parameters selection ( Sun et al. , 2020 ) . As a result , PINNs are still unable to compete with conventional solvers in most cases , and they often fail to converge on high-frequency or multi-scale PDEs ( Wang et al. , 2020b ; Fuks & Tchelepi , 2020 ; Raissi et al. , 2020 ) . In this work , we propose to overcome these optimization challenges by integrating operator learning with PINN . ( a ) learn the solution operator from a family of equations . ( b ) use the learned operator as ansatz to solve for a specific instance . Operator learning and neural operators . A recent alternative approach is to learn the solution operator of a family of PDEs , defined by the map from the input–initial conditions and boundary conditions , to the output–solution functions . In this case , usually , a dataset of input-output pairs from an existing solver is given . There are two main aspects to consider ( a ) model : to design models for learning highly complicated PDE solution operators , and ( b ) data : to be data-efficient and to improve generalization . Recent advances in operator learning replace traditional convolutional neural networks and U-Nets from computer vision with operator-based model tailored to PDEs with greatly improved model expressiveness ( Li et al. , 2020c ; Lu et al. , 2019 ; Patel et al. , 2021 ; Wang et al. , 2020a ; Duvall et al. , 2021 ) . Specifically , the neural operator generalizes the neural network to the operator setting where the input and output spaces are infinite-dimensional . The framework has shown success in learning resolution-invariant solution operators for highly non-linear problems such as turbulence flow ( Li et al. , 2020b ; a ) . However , the data challenges remain : ( 1 ) the need for training data , which assumes an existing solver or experimental setup , ( 2 ) the non-negligible generalization error , and ( 3 ) extrapolation to unseen conditions . These issues can be addressed by adding physics or PDE constraints to operator learning ( Zhu et al. , 2019 ; Wang et al. , 2021b ; Zhang et al. , 2021 ) . Our contributions . To overcome the shortcomings of both physics-informed optimization and data-driven operator learning , we propose the physics-informed neural operator ( PINO ) that combines operator learning with equation solving ( test-time optimization ) . It requires fewer or no data points to learn the operator and generalizes better . In PINO , we use the pre-trained operator as the ansatz to optimize for the solution function at test time , which reduces the generalization error . Compared to PINN , PINO has a much better optimization landscape and representation space , and hence , PINO converges faster and more accurately . Our contributions can be summarized as follows : • We propose the physics-informed neural operator ( PINO ) , combining the operator-learning and physics-informed settings . We introduce the pre-training and test-time optimization schemes that utilize both the data and equation constraints ( whichever are available ) . We develop an efficient method to compute the exact gradient for neural operators to incorporate the equation constraints . • By utilizing pre-trained operator ansatz , PINO overcomes the challenge of propagating information from the initial condition to future time steps with ( soft ) physics constraints . It can solve the 2d transient flow over an extremely long time period , where PINN and DeepONet ( Lu et al. , 2019 ) fail . Even without any pre-training and using only PDE constraints for the given instance , PINO still outperforms PINN by 20x smaller error and 25x speedup on the chaotic Kolmogorov flow , demonstrating superior expressivity of the neural operator over standard neural networks . • By utilizing the equation constraints , PINO requires fewer or no training data and generalizes better compared to FNO ( Li et al. , 2020c ) . On average it has 7 % smaller error on the transient and Kolmogorov flows , while matching the speedup of FNO ( 400x ) compared to the GPU-based pseudo-spectral solver ( He & Sun , 2007 ) , matching FNO . Further , the pre-trained PINO model on the Navier Stokes equation can be easily transferred to different Reynolds numbers ranging from 100 to 500 using test-time optimization . • We propose the forward and backward PINO models for inverse problems . Our approach accurately recovers the coefficient function in the Darcy flow which is 3000x faster than the conventional solvers using accelerated MCMC ( Cotter et al. , 2013 ) . Our major novelty and contributions are to use the pre-trained operator ansatz with instance-wise fine-tuning to overcome the optimization challenges in PINN and the generalization challenges in operator learning . Previous works such as PINN-DeepONet ( Wang et al. , 2021b ) and Physicsconstrained modeling ( Zhu et al. , 2019 ) use the PDE constraints in operator learning , like we do during the pre-training phase in PINO . However , we propose several methodological advances as well as extensive experiments to understand the optimization and generalization challenges . Our methodological advances include : ( 1 ) Instance-wise fine-tuning at test-time to further improve the fidelity of the operator ansatz . ( 2 ) Efficient Fourier-space methods for computing derivatives present in the PDE loss . ( 3 ) Efficient learning through the design of data augmentation and loss functions . ( 4 ) Novel formulation for inverse problems that results in accurate recovery as well as good speedups . PINN vs. PINO : pointwise vs. function-wise optimization . The neural operator ansatz in PINO has an easier optimization landscape and a more expressive representation space compared to the neural networks ansatz in PINN . The neural operator parameterizes the solution function as an aggregation of basis functions , and hence , the optimization is in the function space . This is easier than just optimizing a single function as in PINN . Further , we can learn these basis functions in the pre-training phase which makes the test-time optimization on the querying instance even easier . In this case , PINO does not need to solve from scratch . It just fine-tunes the solution function parameterized by the solution operator . Thus , PINO is much faster and more accurate compared to PINN . 2 PRELIMINARIES AND PROBLEM SETTINGS . 2.1 PROBLEM SETTINGS . We consider two natural class of PDEs . In the first , we consider the stationary system P ( u , a ) = 0 , in D ⊂ Rd u = g , in ∂D ( 1 ) where D is a bounded domain , a ∈ A ⊆ V is a PDE coefficient/parameter , u ∈ U is the unknown , and P : U ×A → F is a possibly non-linear partial differential operator with ( U , V , F ) a triplet of Banach spaces . Usually the function g is a fixed boundary condition ( potentially can be entered as a parameter ) . This formulation gives rise to the solution operator G† : A → U defined by a 7→ u . A prototypical example is the second-order elliptic equation P ( u , a ) = −∇ · ( a∇u ) + f . In the second setting , we consider the dynamical system du dt = R ( u ) , in D × ( 0 , ∞ ) u = g , in ∂D × ( 0 , ∞ ) u = a in D̄ × { 0 } ( 2 ) where a = u ( 0 ) ∈ A ⊆ V is the initial condition , u ( t ) ∈ U for t > 0 is the unknown , and R is a possibly non-linear partial differential operator with U , and V Banach spaces . As before , we take g to be a known boundary condition . We assume that u exists and is bounded for all time and for every u0 ∈ U . This formulation gives rise to the solution operator G† : A → C ( ( 0 , T ] ; U ) defined by a 7→ u. Prototypical examples include the Burgers ’ equation and the Navier-Stokes equation . 2.2 SOLVING EQUATION USING THE PHYSICS-INFORMED LOSS ( PINN ) . Given an instance a and a solution operator G† defined by equations ( 1 ) or ( 2 ) , we denote by u† = G† ( a ) the unique ground truth . The equation solving task is to approximate u† . This setting consists of the ML-enhanced conventional solvers such as learned finite element , finite difference , and multigrid solvers ( Kochkov et al. , 2021 ; Pathak et al. , 2021 ; Greenfeld et al. , 2019 ) , as well as purely neural network-based solvers such as the Physics-Informed Neural Networks ( PINNs ) , Deep Galerkin Method , and Deep Ritz Method ( Raissi et al. , 2019 ; Sirignano & Spiliopoulos , 2018 ; Weinan & Yu , 2018 ) . Especially , these PINN-type methods use a neural network uθ with parameters θ as the the ansatz to approximate the solution function u† . The parameters θ are found by minimizing the physics-informed loss with exact derivatives computed using automatic-differentiation ( autograd ) . In the stationary case , the physics-informed loss is defined by minimizing the l.h.s . of equation ( 1 ) in the squared norm of F . A typical choice is F = L2 ( D ) , giving the loss function Lpde ( a , uθ ) = ‖P ( a , uθ ) ‖2L2 ( D ) + α‖uθ|∂D − g‖ 2 L2 ( ∂D ) = ∫ D |P ( uθ ( x ) , a ( x ) ) |2dx+ α ∫ ∂D |uθ ( x ) − g ( x ) |2dx ( 3 ) In the case of a dynamical system , it minimizes the residual of equation ( 2 ) in some natural norm up to a fixed final time T > 0 . A typical choice is the L2 ( ( 0 , T ] ; L2 ( D ) ) norm , yielding Lpde ( a , uθ ) = ∫ T 0 ∫ D |duθ dt ( t , x ) −R ( uθ ) ( t , x ) |2dxdt+ α ∫ T 0 ∫ ∂D |uθ ( t , x ) − g ( t , x ) |2dxdt + β ∫ D |uθ ( 0 , x ) − a ( x ) |2dx ( 4 ) The PDE loss consists of the physics loss in the interior and the data loss on the boundary and initial conditions , with hyper-parameters α , β > 0 . It can be generalized to variational form as in ( Weinan & Yu , 2018 ) . Challenges of PINN PINNs take advantage of the universal approximability of neural networks , but , in return , suffer from the low-frequency induced bias . Empirically , PINNs often fail to solve challenging PDEs when the solution exhibits high-frequency or multi-scale structure ( Wang et al. , 2021a ; 2020b ; Fuks & Tchelepi , 2020 ; Raissi et al. , 2020 ) . Further , as an iterative solver , PINNs have difficulty propagating information from the initial condition or boundary condition to unseen parts of the interior or to future times ( Dwivedi & Srinivasan , 2020 ) . For example , in challenging problems such as turbulence , PINNs are only able to solve the PDE on a relatively small domain ( Jin et al. , 2021 ) , or otherwise , require extra observational data which is not always available in practice ( Raissi et al. , 2020 ; Cai et al. , 2021 ) . In this work , we propose to overcome the challenges posed by the optimization by integrating operator learning with PINNs .
The paper proposes the physics-informed neural operator (PINO). It combines the operating-learning and function-optimization frameworks, which improves convergence rates and accuracy over traditional methods. Experiments test the advantage of PINO.
SP:460930c4b1d73c6c5a7c03d5e14b987afcde8c2b
Physics-Informed Neural Operator for Learning Partial Differential Equations
1 INTRODUCTION . Machine learning-based methods are starting to show promise in scientific computing and especially in solving partial differential equations ( PDEs ) . They have demonstrated advantages in both efficiency and accuracy compared to conventional solvers . They are even able to tackle previously intractable problems such as higher-dimensional , multi-scale , high-contrast , and chaotic PDE systems ( Um et al. , 2020 ; Brunton et al. , 2020 ; Fan et al. , 2018 ; Long et al. , 2018 ; Han et al. , 2018 ; Bruno et al. , 2021 ) . Broadly , ML-based approaches for PDEs can be divided into two categories : optimizing to solve for a specific solution function of PDE vs. learning the solution operator over a family of PDEs . Optimization of solution function and PINN . Most ML-based methods , as well as the conventional solvers , fall into this category . Conventional solvers such as FDM and FEM usually discretize the domain into a grid and optimize/approximate the solution function on the grid , which imposes a truncation error . The Physics-Informed Neural Network ( PINN ) -type methods are proposed to overcome the discretization issue ( Raissi et al. , 2019 ) . They use a neural network as the ansatz of the solution function and take advantage of auto-differentiation to compute the exact , mesh-free derivatives . Recently , researchers have developed numerous variations of PINN with promising results on inverse problems and partially observed tasks ( Lu et al. , 2021a ; Zhu et al. , 2019 ; Smith et al. , 2021 ) . However , compared to conventional solvers , PINNs face several optimization issues : ( 1 ) the challenging optimization landscape from soft physics or PDE constraints ( Wang et al. , 2021a ) , ( 2 ) the difficulty to propagate information from the initial or boundary conditions to unseen parts of the interior or to future times ( Dwivedi & Srinivasan , 2020 ) , and ( 3 ) the sensitivity to hyper-parameters selection ( Sun et al. , 2020 ) . As a result , PINNs are still unable to compete with conventional solvers in most cases , and they often fail to converge on high-frequency or multi-scale PDEs ( Wang et al. , 2020b ; Fuks & Tchelepi , 2020 ; Raissi et al. , 2020 ) . In this work , we propose to overcome these optimization challenges by integrating operator learning with PINN . ( a ) learn the solution operator from a family of equations . ( b ) use the learned operator as ansatz to solve for a specific instance . Operator learning and neural operators . A recent alternative approach is to learn the solution operator of a family of PDEs , defined by the map from the input–initial conditions and boundary conditions , to the output–solution functions . In this case , usually , a dataset of input-output pairs from an existing solver is given . There are two main aspects to consider ( a ) model : to design models for learning highly complicated PDE solution operators , and ( b ) data : to be data-efficient and to improve generalization . Recent advances in operator learning replace traditional convolutional neural networks and U-Nets from computer vision with operator-based model tailored to PDEs with greatly improved model expressiveness ( Li et al. , 2020c ; Lu et al. , 2019 ; Patel et al. , 2021 ; Wang et al. , 2020a ; Duvall et al. , 2021 ) . Specifically , the neural operator generalizes the neural network to the operator setting where the input and output spaces are infinite-dimensional . The framework has shown success in learning resolution-invariant solution operators for highly non-linear problems such as turbulence flow ( Li et al. , 2020b ; a ) . However , the data challenges remain : ( 1 ) the need for training data , which assumes an existing solver or experimental setup , ( 2 ) the non-negligible generalization error , and ( 3 ) extrapolation to unseen conditions . These issues can be addressed by adding physics or PDE constraints to operator learning ( Zhu et al. , 2019 ; Wang et al. , 2021b ; Zhang et al. , 2021 ) . Our contributions . To overcome the shortcomings of both physics-informed optimization and data-driven operator learning , we propose the physics-informed neural operator ( PINO ) that combines operator learning with equation solving ( test-time optimization ) . It requires fewer or no data points to learn the operator and generalizes better . In PINO , we use the pre-trained operator as the ansatz to optimize for the solution function at test time , which reduces the generalization error . Compared to PINN , PINO has a much better optimization landscape and representation space , and hence , PINO converges faster and more accurately . Our contributions can be summarized as follows : • We propose the physics-informed neural operator ( PINO ) , combining the operator-learning and physics-informed settings . We introduce the pre-training and test-time optimization schemes that utilize both the data and equation constraints ( whichever are available ) . We develop an efficient method to compute the exact gradient for neural operators to incorporate the equation constraints . • By utilizing pre-trained operator ansatz , PINO overcomes the challenge of propagating information from the initial condition to future time steps with ( soft ) physics constraints . It can solve the 2d transient flow over an extremely long time period , where PINN and DeepONet ( Lu et al. , 2019 ) fail . Even without any pre-training and using only PDE constraints for the given instance , PINO still outperforms PINN by 20x smaller error and 25x speedup on the chaotic Kolmogorov flow , demonstrating superior expressivity of the neural operator over standard neural networks . • By utilizing the equation constraints , PINO requires fewer or no training data and generalizes better compared to FNO ( Li et al. , 2020c ) . On average it has 7 % smaller error on the transient and Kolmogorov flows , while matching the speedup of FNO ( 400x ) compared to the GPU-based pseudo-spectral solver ( He & Sun , 2007 ) , matching FNO . Further , the pre-trained PINO model on the Navier Stokes equation can be easily transferred to different Reynolds numbers ranging from 100 to 500 using test-time optimization . • We propose the forward and backward PINO models for inverse problems . Our approach accurately recovers the coefficient function in the Darcy flow which is 3000x faster than the conventional solvers using accelerated MCMC ( Cotter et al. , 2013 ) . Our major novelty and contributions are to use the pre-trained operator ansatz with instance-wise fine-tuning to overcome the optimization challenges in PINN and the generalization challenges in operator learning . Previous works such as PINN-DeepONet ( Wang et al. , 2021b ) and Physicsconstrained modeling ( Zhu et al. , 2019 ) use the PDE constraints in operator learning , like we do during the pre-training phase in PINO . However , we propose several methodological advances as well as extensive experiments to understand the optimization and generalization challenges . Our methodological advances include : ( 1 ) Instance-wise fine-tuning at test-time to further improve the fidelity of the operator ansatz . ( 2 ) Efficient Fourier-space methods for computing derivatives present in the PDE loss . ( 3 ) Efficient learning through the design of data augmentation and loss functions . ( 4 ) Novel formulation for inverse problems that results in accurate recovery as well as good speedups . PINN vs. PINO : pointwise vs. function-wise optimization . The neural operator ansatz in PINO has an easier optimization landscape and a more expressive representation space compared to the neural networks ansatz in PINN . The neural operator parameterizes the solution function as an aggregation of basis functions , and hence , the optimization is in the function space . This is easier than just optimizing a single function as in PINN . Further , we can learn these basis functions in the pre-training phase which makes the test-time optimization on the querying instance even easier . In this case , PINO does not need to solve from scratch . It just fine-tunes the solution function parameterized by the solution operator . Thus , PINO is much faster and more accurate compared to PINN . 2 PRELIMINARIES AND PROBLEM SETTINGS . 2.1 PROBLEM SETTINGS . We consider two natural class of PDEs . In the first , we consider the stationary system P ( u , a ) = 0 , in D ⊂ Rd u = g , in ∂D ( 1 ) where D is a bounded domain , a ∈ A ⊆ V is a PDE coefficient/parameter , u ∈ U is the unknown , and P : U ×A → F is a possibly non-linear partial differential operator with ( U , V , F ) a triplet of Banach spaces . Usually the function g is a fixed boundary condition ( potentially can be entered as a parameter ) . This formulation gives rise to the solution operator G† : A → U defined by a 7→ u . A prototypical example is the second-order elliptic equation P ( u , a ) = −∇ · ( a∇u ) + f . In the second setting , we consider the dynamical system du dt = R ( u ) , in D × ( 0 , ∞ ) u = g , in ∂D × ( 0 , ∞ ) u = a in D̄ × { 0 } ( 2 ) where a = u ( 0 ) ∈ A ⊆ V is the initial condition , u ( t ) ∈ U for t > 0 is the unknown , and R is a possibly non-linear partial differential operator with U , and V Banach spaces . As before , we take g to be a known boundary condition . We assume that u exists and is bounded for all time and for every u0 ∈ U . This formulation gives rise to the solution operator G† : A → C ( ( 0 , T ] ; U ) defined by a 7→ u. Prototypical examples include the Burgers ’ equation and the Navier-Stokes equation . 2.2 SOLVING EQUATION USING THE PHYSICS-INFORMED LOSS ( PINN ) . Given an instance a and a solution operator G† defined by equations ( 1 ) or ( 2 ) , we denote by u† = G† ( a ) the unique ground truth . The equation solving task is to approximate u† . This setting consists of the ML-enhanced conventional solvers such as learned finite element , finite difference , and multigrid solvers ( Kochkov et al. , 2021 ; Pathak et al. , 2021 ; Greenfeld et al. , 2019 ) , as well as purely neural network-based solvers such as the Physics-Informed Neural Networks ( PINNs ) , Deep Galerkin Method , and Deep Ritz Method ( Raissi et al. , 2019 ; Sirignano & Spiliopoulos , 2018 ; Weinan & Yu , 2018 ) . Especially , these PINN-type methods use a neural network uθ with parameters θ as the the ansatz to approximate the solution function u† . The parameters θ are found by minimizing the physics-informed loss with exact derivatives computed using automatic-differentiation ( autograd ) . In the stationary case , the physics-informed loss is defined by minimizing the l.h.s . of equation ( 1 ) in the squared norm of F . A typical choice is F = L2 ( D ) , giving the loss function Lpde ( a , uθ ) = ‖P ( a , uθ ) ‖2L2 ( D ) + α‖uθ|∂D − g‖ 2 L2 ( ∂D ) = ∫ D |P ( uθ ( x ) , a ( x ) ) |2dx+ α ∫ ∂D |uθ ( x ) − g ( x ) |2dx ( 3 ) In the case of a dynamical system , it minimizes the residual of equation ( 2 ) in some natural norm up to a fixed final time T > 0 . A typical choice is the L2 ( ( 0 , T ] ; L2 ( D ) ) norm , yielding Lpde ( a , uθ ) = ∫ T 0 ∫ D |duθ dt ( t , x ) −R ( uθ ) ( t , x ) |2dxdt+ α ∫ T 0 ∫ ∂D |uθ ( t , x ) − g ( t , x ) |2dxdt + β ∫ D |uθ ( 0 , x ) − a ( x ) |2dx ( 4 ) The PDE loss consists of the physics loss in the interior and the data loss on the boundary and initial conditions , with hyper-parameters α , β > 0 . It can be generalized to variational form as in ( Weinan & Yu , 2018 ) . Challenges of PINN PINNs take advantage of the universal approximability of neural networks , but , in return , suffer from the low-frequency induced bias . Empirically , PINNs often fail to solve challenging PDEs when the solution exhibits high-frequency or multi-scale structure ( Wang et al. , 2021a ; 2020b ; Fuks & Tchelepi , 2020 ; Raissi et al. , 2020 ) . Further , as an iterative solver , PINNs have difficulty propagating information from the initial condition or boundary condition to unseen parts of the interior or to future times ( Dwivedi & Srinivasan , 2020 ) . For example , in challenging problems such as turbulence , PINNs are only able to solve the PDE on a relatively small domain ( Jin et al. , 2021 ) , or otherwise , require extra observational data which is not always available in practice ( Raissi et al. , 2020 ; Cai et al. , 2021 ) . In this work , we propose to overcome the challenges posed by the optimization by integrating operator learning with PINNs .
The authors introduce physics-informed neural operator for learning partial differential equations (PDEs) from data with deep learning. This approach combines two recent and popular methods in the field of machine learning and PDEs, the physics-informed neural network (PINNs) for solving PDEs and Fourier neural operator (FNO) for learning solution operators. The paper takes advantages of both approaches to overcome convergence issues arising in PINNs by incorporating PDE constraints into FNO. Then, the authors apply their method to a number of challenging test cases and obtain better results than PINNs on PDE solving problems and FNO for learning solution operators.
SP:460930c4b1d73c6c5a7c03d5e14b987afcde8c2b
Physics-Informed Neural Operator for Learning Partial Differential Equations
1 INTRODUCTION . Machine learning-based methods are starting to show promise in scientific computing and especially in solving partial differential equations ( PDEs ) . They have demonstrated advantages in both efficiency and accuracy compared to conventional solvers . They are even able to tackle previously intractable problems such as higher-dimensional , multi-scale , high-contrast , and chaotic PDE systems ( Um et al. , 2020 ; Brunton et al. , 2020 ; Fan et al. , 2018 ; Long et al. , 2018 ; Han et al. , 2018 ; Bruno et al. , 2021 ) . Broadly , ML-based approaches for PDEs can be divided into two categories : optimizing to solve for a specific solution function of PDE vs. learning the solution operator over a family of PDEs . Optimization of solution function and PINN . Most ML-based methods , as well as the conventional solvers , fall into this category . Conventional solvers such as FDM and FEM usually discretize the domain into a grid and optimize/approximate the solution function on the grid , which imposes a truncation error . The Physics-Informed Neural Network ( PINN ) -type methods are proposed to overcome the discretization issue ( Raissi et al. , 2019 ) . They use a neural network as the ansatz of the solution function and take advantage of auto-differentiation to compute the exact , mesh-free derivatives . Recently , researchers have developed numerous variations of PINN with promising results on inverse problems and partially observed tasks ( Lu et al. , 2021a ; Zhu et al. , 2019 ; Smith et al. , 2021 ) . However , compared to conventional solvers , PINNs face several optimization issues : ( 1 ) the challenging optimization landscape from soft physics or PDE constraints ( Wang et al. , 2021a ) , ( 2 ) the difficulty to propagate information from the initial or boundary conditions to unseen parts of the interior or to future times ( Dwivedi & Srinivasan , 2020 ) , and ( 3 ) the sensitivity to hyper-parameters selection ( Sun et al. , 2020 ) . As a result , PINNs are still unable to compete with conventional solvers in most cases , and they often fail to converge on high-frequency or multi-scale PDEs ( Wang et al. , 2020b ; Fuks & Tchelepi , 2020 ; Raissi et al. , 2020 ) . In this work , we propose to overcome these optimization challenges by integrating operator learning with PINN . ( a ) learn the solution operator from a family of equations . ( b ) use the learned operator as ansatz to solve for a specific instance . Operator learning and neural operators . A recent alternative approach is to learn the solution operator of a family of PDEs , defined by the map from the input–initial conditions and boundary conditions , to the output–solution functions . In this case , usually , a dataset of input-output pairs from an existing solver is given . There are two main aspects to consider ( a ) model : to design models for learning highly complicated PDE solution operators , and ( b ) data : to be data-efficient and to improve generalization . Recent advances in operator learning replace traditional convolutional neural networks and U-Nets from computer vision with operator-based model tailored to PDEs with greatly improved model expressiveness ( Li et al. , 2020c ; Lu et al. , 2019 ; Patel et al. , 2021 ; Wang et al. , 2020a ; Duvall et al. , 2021 ) . Specifically , the neural operator generalizes the neural network to the operator setting where the input and output spaces are infinite-dimensional . The framework has shown success in learning resolution-invariant solution operators for highly non-linear problems such as turbulence flow ( Li et al. , 2020b ; a ) . However , the data challenges remain : ( 1 ) the need for training data , which assumes an existing solver or experimental setup , ( 2 ) the non-negligible generalization error , and ( 3 ) extrapolation to unseen conditions . These issues can be addressed by adding physics or PDE constraints to operator learning ( Zhu et al. , 2019 ; Wang et al. , 2021b ; Zhang et al. , 2021 ) . Our contributions . To overcome the shortcomings of both physics-informed optimization and data-driven operator learning , we propose the physics-informed neural operator ( PINO ) that combines operator learning with equation solving ( test-time optimization ) . It requires fewer or no data points to learn the operator and generalizes better . In PINO , we use the pre-trained operator as the ansatz to optimize for the solution function at test time , which reduces the generalization error . Compared to PINN , PINO has a much better optimization landscape and representation space , and hence , PINO converges faster and more accurately . Our contributions can be summarized as follows : • We propose the physics-informed neural operator ( PINO ) , combining the operator-learning and physics-informed settings . We introduce the pre-training and test-time optimization schemes that utilize both the data and equation constraints ( whichever are available ) . We develop an efficient method to compute the exact gradient for neural operators to incorporate the equation constraints . • By utilizing pre-trained operator ansatz , PINO overcomes the challenge of propagating information from the initial condition to future time steps with ( soft ) physics constraints . It can solve the 2d transient flow over an extremely long time period , where PINN and DeepONet ( Lu et al. , 2019 ) fail . Even without any pre-training and using only PDE constraints for the given instance , PINO still outperforms PINN by 20x smaller error and 25x speedup on the chaotic Kolmogorov flow , demonstrating superior expressivity of the neural operator over standard neural networks . • By utilizing the equation constraints , PINO requires fewer or no training data and generalizes better compared to FNO ( Li et al. , 2020c ) . On average it has 7 % smaller error on the transient and Kolmogorov flows , while matching the speedup of FNO ( 400x ) compared to the GPU-based pseudo-spectral solver ( He & Sun , 2007 ) , matching FNO . Further , the pre-trained PINO model on the Navier Stokes equation can be easily transferred to different Reynolds numbers ranging from 100 to 500 using test-time optimization . • We propose the forward and backward PINO models for inverse problems . Our approach accurately recovers the coefficient function in the Darcy flow which is 3000x faster than the conventional solvers using accelerated MCMC ( Cotter et al. , 2013 ) . Our major novelty and contributions are to use the pre-trained operator ansatz with instance-wise fine-tuning to overcome the optimization challenges in PINN and the generalization challenges in operator learning . Previous works such as PINN-DeepONet ( Wang et al. , 2021b ) and Physicsconstrained modeling ( Zhu et al. , 2019 ) use the PDE constraints in operator learning , like we do during the pre-training phase in PINO . However , we propose several methodological advances as well as extensive experiments to understand the optimization and generalization challenges . Our methodological advances include : ( 1 ) Instance-wise fine-tuning at test-time to further improve the fidelity of the operator ansatz . ( 2 ) Efficient Fourier-space methods for computing derivatives present in the PDE loss . ( 3 ) Efficient learning through the design of data augmentation and loss functions . ( 4 ) Novel formulation for inverse problems that results in accurate recovery as well as good speedups . PINN vs. PINO : pointwise vs. function-wise optimization . The neural operator ansatz in PINO has an easier optimization landscape and a more expressive representation space compared to the neural networks ansatz in PINN . The neural operator parameterizes the solution function as an aggregation of basis functions , and hence , the optimization is in the function space . This is easier than just optimizing a single function as in PINN . Further , we can learn these basis functions in the pre-training phase which makes the test-time optimization on the querying instance even easier . In this case , PINO does not need to solve from scratch . It just fine-tunes the solution function parameterized by the solution operator . Thus , PINO is much faster and more accurate compared to PINN . 2 PRELIMINARIES AND PROBLEM SETTINGS . 2.1 PROBLEM SETTINGS . We consider two natural class of PDEs . In the first , we consider the stationary system P ( u , a ) = 0 , in D ⊂ Rd u = g , in ∂D ( 1 ) where D is a bounded domain , a ∈ A ⊆ V is a PDE coefficient/parameter , u ∈ U is the unknown , and P : U ×A → F is a possibly non-linear partial differential operator with ( U , V , F ) a triplet of Banach spaces . Usually the function g is a fixed boundary condition ( potentially can be entered as a parameter ) . This formulation gives rise to the solution operator G† : A → U defined by a 7→ u . A prototypical example is the second-order elliptic equation P ( u , a ) = −∇ · ( a∇u ) + f . In the second setting , we consider the dynamical system du dt = R ( u ) , in D × ( 0 , ∞ ) u = g , in ∂D × ( 0 , ∞ ) u = a in D̄ × { 0 } ( 2 ) where a = u ( 0 ) ∈ A ⊆ V is the initial condition , u ( t ) ∈ U for t > 0 is the unknown , and R is a possibly non-linear partial differential operator with U , and V Banach spaces . As before , we take g to be a known boundary condition . We assume that u exists and is bounded for all time and for every u0 ∈ U . This formulation gives rise to the solution operator G† : A → C ( ( 0 , T ] ; U ) defined by a 7→ u. Prototypical examples include the Burgers ’ equation and the Navier-Stokes equation . 2.2 SOLVING EQUATION USING THE PHYSICS-INFORMED LOSS ( PINN ) . Given an instance a and a solution operator G† defined by equations ( 1 ) or ( 2 ) , we denote by u† = G† ( a ) the unique ground truth . The equation solving task is to approximate u† . This setting consists of the ML-enhanced conventional solvers such as learned finite element , finite difference , and multigrid solvers ( Kochkov et al. , 2021 ; Pathak et al. , 2021 ; Greenfeld et al. , 2019 ) , as well as purely neural network-based solvers such as the Physics-Informed Neural Networks ( PINNs ) , Deep Galerkin Method , and Deep Ritz Method ( Raissi et al. , 2019 ; Sirignano & Spiliopoulos , 2018 ; Weinan & Yu , 2018 ) . Especially , these PINN-type methods use a neural network uθ with parameters θ as the the ansatz to approximate the solution function u† . The parameters θ are found by minimizing the physics-informed loss with exact derivatives computed using automatic-differentiation ( autograd ) . In the stationary case , the physics-informed loss is defined by minimizing the l.h.s . of equation ( 1 ) in the squared norm of F . A typical choice is F = L2 ( D ) , giving the loss function Lpde ( a , uθ ) = ‖P ( a , uθ ) ‖2L2 ( D ) + α‖uθ|∂D − g‖ 2 L2 ( ∂D ) = ∫ D |P ( uθ ( x ) , a ( x ) ) |2dx+ α ∫ ∂D |uθ ( x ) − g ( x ) |2dx ( 3 ) In the case of a dynamical system , it minimizes the residual of equation ( 2 ) in some natural norm up to a fixed final time T > 0 . A typical choice is the L2 ( ( 0 , T ] ; L2 ( D ) ) norm , yielding Lpde ( a , uθ ) = ∫ T 0 ∫ D |duθ dt ( t , x ) −R ( uθ ) ( t , x ) |2dxdt+ α ∫ T 0 ∫ ∂D |uθ ( t , x ) − g ( t , x ) |2dxdt + β ∫ D |uθ ( 0 , x ) − a ( x ) |2dx ( 4 ) The PDE loss consists of the physics loss in the interior and the data loss on the boundary and initial conditions , with hyper-parameters α , β > 0 . It can be generalized to variational form as in ( Weinan & Yu , 2018 ) . Challenges of PINN PINNs take advantage of the universal approximability of neural networks , but , in return , suffer from the low-frequency induced bias . Empirically , PINNs often fail to solve challenging PDEs when the solution exhibits high-frequency or multi-scale structure ( Wang et al. , 2021a ; 2020b ; Fuks & Tchelepi , 2020 ; Raissi et al. , 2020 ) . Further , as an iterative solver , PINNs have difficulty propagating information from the initial condition or boundary condition to unseen parts of the interior or to future times ( Dwivedi & Srinivasan , 2020 ) . For example , in challenging problems such as turbulence , PINNs are only able to solve the PDE on a relatively small domain ( Jin et al. , 2021 ) , or otherwise , require extra observational data which is not always available in practice ( Raissi et al. , 2020 ; Cai et al. , 2021 ) . In this work , we propose to overcome the challenges posed by the optimization by integrating operator learning with PINNs .
This paper proposes Physics-Informed Neural Operator (PINO) by combining two previous methods, Fourier neural operators (FNO) and physics-informed neural networks (PINNs). Similar to one use case of FNO, PINO learns the solution operator over multiple instances of a parametric PDE family in the first phase. In the second phase, given an instance from the parametric PDE family, PINO fine-tunes the learned solution operator as a pre-trained model to work well for the particular instance. The proposed method is evaluated by using numerical experiments.
SP:460930c4b1d73c6c5a7c03d5e14b987afcde8c2b
Rethinking Adversarial Transferability from a Data Distribution Perspective
1 INTRODUCTION . Deep neural networks ( DNNs ) are widely used in various safety-critical fields , but they are vulnerable to adversarial examples ( Szegedy et al. , 2013 ) . Adversarial attacks are imperceptible to humans but catastrophic for the DNNs and can be transferred between different models ( Goodfellow et al. , 2015 ; Liu et al. , 2017 ) . Adversarial transferability enables attackers to generate adversarial examples from the source model to attack unknown target models , which has raised security concerns about the deployment of DNNs in practice . Understanding the essence of adversarial transferability is a fundamental problem in deep learning . On the one hand , some works show that the characteristics of the source model , such as model architecture ( Wu et al. , 2019 ) , model capacity ( Tramèr et al. , 2017 ) , and test accuracy ( Wu & Zhu , 2020 ) , influence adversarial examples ’ transferability . On the other hand , some works think that the data-relevant information may be the key factor for adversarial transferability . Ilyas et al . ( 2019 ) explain that adversarial perturbations are non-robust features and not meaningless bugs , but it is hard to specifically define non-robust features . We want to further study transferability quantitatively from the data distribution perspective . It has been empirically observed that DNNs are relatively robust to random noise ( Fawzi et al. , 2016 ) . However , in this work we find an intriguing phenomenon : some samples are sensitive to Gaussian noise , in the sense that injecting small Gaussian noise into these samples can fool different models trained on the same dataset . Furthermore , their adversarial counterparts generated by different source models have much stronger transferability against different target models than other samples . We hypothesize that these samples are in the low-density regions of the ground truth distribution both source and target models are trained on , and models are not well trained in these regions . Thus predictions of these samples are easy to be perturbed and even not robust to small random noises . We denote this kind of data as Low-Density Data ( LDD ) , while others as High-Density Data ( HDD ) . As shown in Fig . 1 ( Left ) , the attack success rate against different target models of LDD with different strengths of Gaussian noise is much higher than that of HDD . Furthermore , in Fig . 1 ( Right ) , the adversarial counterparts of LDD have much stronger transferability than the adversarial counterparts of HDD ( see Appendix B for details ) . This phenomenon reveals that the location of data plays a vital role in adversarial transferability and the adversarial examples of samples in the low-density region are strongly transferable . The most efficient direction towards the low-density region is −∇x log pD ( x , y ) , where pD ( x , y ) is the ground truth density of natural data . We name this direction Intrinsic Attack because it doesn ’ t depend on the models and only depends on the ground truth distribution . Thus , we propose to match the adversarial attack with intrinsic attack for generating strong transferable adversarial examples . We explore the potential of a classifier pθ , Λ ( y|x ) with parameters θ and structure hyper-parameters Λ ( see Sec . 3.1 ) to generate more transferable adversarial examples by aligning adversarial attack with intrinsic attack −∇x log pD ( x , y ) . The adversarial attack of pθ , Λ ( y|x ) is usually generated by PGD/FGSM method , and is determined by −∇x log pθ , Λ ( y|x ) . We match the Alignment between the Adversarial attack and Intrinsic attack ( AAI ) , EpD ( x , y ) [ ∇x log pθ , Λ ( y|x ) ‖∇x log pθ , Λ ( y|x ) ‖2 · ∇x log pD ( x , y ) ] , by modifying the structure parameters Λ for a pre-trained network . In order to maximize AAI , we should make pθ , Λ ( y|x ) smoother . Otherwise , ∇x log pθ , Λ ( y|x ) will oscillate frequently and hard to match∇x log pD ( x , y ) . For the commonly used ReLU network , we can smooth it by replacing ReLU activation with Softplus ( Nair & Hinton , 2010 ) with little change of the model ’ s output . Maennel et al . ( 2020 ) show that the early layers of a network learn the local statistics of the data distribution better than the later layers , which motivates us to decrease the impact of later layers when generating adversarial examples to utilize the data distribution-relevant information . We can closely match the adversarial attack with the intrinsic attack−∇x log pD ( x , y ) and improve the adversarial transferability by optimizing structure hyper-parameters Λ to maximize AAI as the objective function . We name our method as Intrinsic Adversarial Attack ( IAA ) . There are some interesting observations in our IAA experiments . Firstly , we find that the test accuracy of the source model may not be important . As shown in Fig 2 , the accuracy of the pre-trained model with Softplusβ=15 is around 60 % , but the adversarial transferability of this model is much stronger than the model with Softplusβ=45 . Secondly , although the existing methods ( Madry et al. , 2018 ; Wu et al. , 2019 ) can significantly decrease the top-1 accuracy of the target models , the top-5 accuracy is still high . IAA can both decrease the top-1 accuracy and top-5 accuracy . Furthermore , the existing methods ( Xie et al. , 2019 ; Wu et al. , 2019 ) can just slightly improve the one-step attack under different strengths , while our IAA surpasses the existing methods by a large margin . These phenomena verify our hypothesis that IAA pulls examples to the low-density region , which causes prediction difficulty to the target models . Our main contributions are summarized below : • We propose an effective metric , AAI , to evaluate the alignment of the model ’ s adversarial attack with intrinsic attack −∇x log pD ( x , y ) . Furthermore , we show that AAI is also an effective metric for adversarial transferability . • We propose the Intrinsic Adversarial Attack ( IAA ) by maximizing AAI to generate more transferable adversarial examples . • We conduct comprehensive transfer attack experiments from different source models against nine naturally trained models and three ensemble secured models , showing that IAA can significantly improve the state-of-the-art transferability ( both targeted and untargeted attack ) of adversarial examples ( even improve 20 % under some settings ) . 1The AAI metric for LDD ( 0.1264 ) is much larger than HDD ( 0.0457 ) , which shows that the direction of PGD attack on LDD aligns better than that on HDD ( The AAI metric on all test samples is 0.052 ) . 2 RELATED WORK . There are two types of adversarial attacks : white-box attacks and black-box attacks . White-box attacks assume that the attacker can completely access the structure and parameters of the target model . Typical examples of white-box attacks are FGSM ( Goodfellow et al. , 2015 ) , PGD ( Madry et al. , 2018 ) , and CW ( Carlini & Wagner , 2017 ) . The black-box attack assumes that the attacker only knows the output of the target model ( prediction or confidence ) . Black-box attacks are roughly divided into two types : estimating gradient with queries to the target model ( Papernot et al. , 2017 ; Su et al. , 2019 ; Yang et al. , 2020 ) and attacking a surrogate model ( Xie et al. , 2019 ; Dong et al. , 2018 ; Wu et al. , 2019 ) . Attacking a surrogate model is much more efficient and can reduce the risk of exposure . Thus , many existing works focused on adversarial transferability . Su et al . ( 2018 ) explore the factors influencing the transferability and show the architecture has greater influence than model capacity . Dong et al . ( 2018 ) show that the momentum of gradients can be used to improve the adversarial transferability . Xie et al . ( 2019 ) show the diversity of input data will enhance the adversarial transferability . Huang et al . ( 2019 ) fine-tune the adversarial examples by increasing perturbation on a pre-specified layer . Wang et al . ( 2020 ) propose a loss to decrease interactions between perturbation units during attacking . Wu et al . ( 2019 ) propose that reducing gradients from the residual modules is effective for improving transferability . Guo et al . ( 2020 ) removes ReLU activations in the later layers to get linear backpropagation and decreases the influence of intermediate layers . They only modify the backpropagation when generating adversarial examples while keeping the forward prediction as the original model . Based on this , Zhang et al . ( 2021 ) conjecture that backpropagating smoothly might be sufficient for improving transferability . There are also some works on adversarial attack and defense using generative models . Naseer et al . ( 2019 ) and Yang et al . ( 2021a ) learn adversarial perturbation through a conditional generative attacking model , which needs to be carefully designed for certain classes . Samangouei et al . ( 2018 ) ; Song et al . ( 2018 ) use GANs or autoregressive models to detect and purify adversarial examples . Du & Mordatch ( 2019 ) ; Hill et al . ( 2021 ) ; Srinivasan et al . ( 2021 ) ; Yoon et al . ( 2021 ) purify adversarial examples by EBM or score-based generative models . JEM ( Grathwohl et al. , 2020 ) shows that combining a classifier with EBM can help to obtain some robustness . However , adversarial attacks or purification based on generative models are computationally costly . We want to modify a normal classifier with little computation cost to enhance its adversarial transferability by maximizing our AAI metric . 3 METHODS . 3.1 ALIGNMENT BETWEEN THE ADVERSARIAL ATTACK AND INTRINSIC ATTACK For a classifier fθ , Λ parameterized by θ with structure hyper-parameters Λ ( e.g. , hyper-parameters for architecture , activation function , etc . ) , and data x , label y , total possible classes n , then fθ , Λ ( x ) [ k ] represents the kth output of the last layer . The conditional density pθ , Λ ( y|x ) can be expressed as : pθ , Λ ( y|x ) = exp ( fθ , Λ ( x ) [ y ] ) ∑n k=1 exp ( fθ , Λ ( x ) [ k ] ) . ( 1 ) The adversarial attack is usually based on−∇x log pθ , Λ ( y|x ) ( Madry et al. , 2018 ; Goodfellow et al. , 2015 ) . The most effective direction towards low-density region is intrinsic attack−∇x log pD ( x , y ) . To improve the adversarial transferability , we need to match model ’ s adversarial attack direction with intrinsic attack . We define the inner product of normalized −∇x log pθ , Λ ( y|x ) and −∇x log pD ( x , y ) to quantify the matching of the direction of adversarial attack and the intrinsic attack . Definition 1 ( AAI ) . For a classifier pθ , Λ ( y|x ) , the Alignment between its Adversarial attack and the Intrinsic attack is : AAI , EpD ( x , y ) [ ∇x log pθ , Λ ( y|x ) ‖∇x log pθ , Λ ( y|x ) ‖2 · ∇x log pD ( x , y ) ] , ( 2 ) where pD ( x , y ) is the ground truth joint distribution . Remark . ( 1 ) We use the normalized adversarial attack to remove the influence of scaling factor when comparing different models . ( 2 ) This definition is equivalent with a modified score matching objective as : 1 2 EpD ( x , y ) ∥∥∥∥ ∇x log pθ , Λ ( y|x ) ‖∇x log pθ , Λ ( y|x ) ‖2 −∇x log pD ( x , y ) ∥∥∥∥2 2 = −AAI + CpD , where CpD is a constant only depend on the ground truth distribution pD . As getting the gradient of pD ( x , y ) is not feasible , we use integration by parts ( Hyvärinen & Dayan , 2005 ) to move the gradient on pD ( x , y ) to model ’ s adversarial attack . With the smoothness assumption on ∇xpθ , Λ ( y|x ) , we have the following theorem : Theorem 1 . If ∇xpθ , Λ ( y|x ) is differentiable almost everywhere , then AAI = −EpD ( x , y ) [ ∇x · ∇xpθ , Λ ( y|x ) ‖∇xpθ , Λ ( y|x ) ‖2 ] . ( 3 ) Moreover , AAI = −EpD ( x , y ) Ep ( v ) [ vT∇x vT∇xpθ , Λ ( y|x ) ‖∇xpθ , Λ ( y|x ) ‖2 ] , ( 4 ) where p ( v ) is a distribution of random vector v such that Ep ( v ) [ vvT ] = I ( e.g. , the multivariate standard normal N ( 0 , I ) ) . This theorem makes it possible to calculate AAI without knowing the gradient of ground truth distribution when the model is smooth , see Appendix E for the proof . Combined with sliced score matching ( Song et al. , 2020 ) we can efficiently approximate AAI on discrete samples . However , for ReLU networks , the model ’ s second derivative is not well defined , which prevents us from using this theorem . Thus , we need to smooth the ReLU models for better modifying the model to maximize AAI and improve the transferability . One obvious way to improve the smoothness is to replace ReLU activation with some smooth activation . In this paper , we use Softplus to show that smoothness can greatly help us to improve transferability .
This paper presents a new adversarial attack method which could generate adversarial examples with higher transferability. The proposed method is based on the observation that low-density region of the training data is not well trained. To utilize this, the authors try to align the adversarial direction with the direction to decrease the ground truth density. The proposed method is theoretically support. Their experiments show that the proposed method outperforms multiple adversarial attack method in almost all evaluated scenario. I believe this could be a useful attack method for generating transferable adversarial examples, and providing a strong counterpart for future research on adversarial defense.
SP:1e8c197e57285e0fc7e05a458f8bf1513aff7a47
Rethinking Adversarial Transferability from a Data Distribution Perspective
1 INTRODUCTION . Deep neural networks ( DNNs ) are widely used in various safety-critical fields , but they are vulnerable to adversarial examples ( Szegedy et al. , 2013 ) . Adversarial attacks are imperceptible to humans but catastrophic for the DNNs and can be transferred between different models ( Goodfellow et al. , 2015 ; Liu et al. , 2017 ) . Adversarial transferability enables attackers to generate adversarial examples from the source model to attack unknown target models , which has raised security concerns about the deployment of DNNs in practice . Understanding the essence of adversarial transferability is a fundamental problem in deep learning . On the one hand , some works show that the characteristics of the source model , such as model architecture ( Wu et al. , 2019 ) , model capacity ( Tramèr et al. , 2017 ) , and test accuracy ( Wu & Zhu , 2020 ) , influence adversarial examples ’ transferability . On the other hand , some works think that the data-relevant information may be the key factor for adversarial transferability . Ilyas et al . ( 2019 ) explain that adversarial perturbations are non-robust features and not meaningless bugs , but it is hard to specifically define non-robust features . We want to further study transferability quantitatively from the data distribution perspective . It has been empirically observed that DNNs are relatively robust to random noise ( Fawzi et al. , 2016 ) . However , in this work we find an intriguing phenomenon : some samples are sensitive to Gaussian noise , in the sense that injecting small Gaussian noise into these samples can fool different models trained on the same dataset . Furthermore , their adversarial counterparts generated by different source models have much stronger transferability against different target models than other samples . We hypothesize that these samples are in the low-density regions of the ground truth distribution both source and target models are trained on , and models are not well trained in these regions . Thus predictions of these samples are easy to be perturbed and even not robust to small random noises . We denote this kind of data as Low-Density Data ( LDD ) , while others as High-Density Data ( HDD ) . As shown in Fig . 1 ( Left ) , the attack success rate against different target models of LDD with different strengths of Gaussian noise is much higher than that of HDD . Furthermore , in Fig . 1 ( Right ) , the adversarial counterparts of LDD have much stronger transferability than the adversarial counterparts of HDD ( see Appendix B for details ) . This phenomenon reveals that the location of data plays a vital role in adversarial transferability and the adversarial examples of samples in the low-density region are strongly transferable . The most efficient direction towards the low-density region is −∇x log pD ( x , y ) , where pD ( x , y ) is the ground truth density of natural data . We name this direction Intrinsic Attack because it doesn ’ t depend on the models and only depends on the ground truth distribution . Thus , we propose to match the adversarial attack with intrinsic attack for generating strong transferable adversarial examples . We explore the potential of a classifier pθ , Λ ( y|x ) with parameters θ and structure hyper-parameters Λ ( see Sec . 3.1 ) to generate more transferable adversarial examples by aligning adversarial attack with intrinsic attack −∇x log pD ( x , y ) . The adversarial attack of pθ , Λ ( y|x ) is usually generated by PGD/FGSM method , and is determined by −∇x log pθ , Λ ( y|x ) . We match the Alignment between the Adversarial attack and Intrinsic attack ( AAI ) , EpD ( x , y ) [ ∇x log pθ , Λ ( y|x ) ‖∇x log pθ , Λ ( y|x ) ‖2 · ∇x log pD ( x , y ) ] , by modifying the structure parameters Λ for a pre-trained network . In order to maximize AAI , we should make pθ , Λ ( y|x ) smoother . Otherwise , ∇x log pθ , Λ ( y|x ) will oscillate frequently and hard to match∇x log pD ( x , y ) . For the commonly used ReLU network , we can smooth it by replacing ReLU activation with Softplus ( Nair & Hinton , 2010 ) with little change of the model ’ s output . Maennel et al . ( 2020 ) show that the early layers of a network learn the local statistics of the data distribution better than the later layers , which motivates us to decrease the impact of later layers when generating adversarial examples to utilize the data distribution-relevant information . We can closely match the adversarial attack with the intrinsic attack−∇x log pD ( x , y ) and improve the adversarial transferability by optimizing structure hyper-parameters Λ to maximize AAI as the objective function . We name our method as Intrinsic Adversarial Attack ( IAA ) . There are some interesting observations in our IAA experiments . Firstly , we find that the test accuracy of the source model may not be important . As shown in Fig 2 , the accuracy of the pre-trained model with Softplusβ=15 is around 60 % , but the adversarial transferability of this model is much stronger than the model with Softplusβ=45 . Secondly , although the existing methods ( Madry et al. , 2018 ; Wu et al. , 2019 ) can significantly decrease the top-1 accuracy of the target models , the top-5 accuracy is still high . IAA can both decrease the top-1 accuracy and top-5 accuracy . Furthermore , the existing methods ( Xie et al. , 2019 ; Wu et al. , 2019 ) can just slightly improve the one-step attack under different strengths , while our IAA surpasses the existing methods by a large margin . These phenomena verify our hypothesis that IAA pulls examples to the low-density region , which causes prediction difficulty to the target models . Our main contributions are summarized below : • We propose an effective metric , AAI , to evaluate the alignment of the model ’ s adversarial attack with intrinsic attack −∇x log pD ( x , y ) . Furthermore , we show that AAI is also an effective metric for adversarial transferability . • We propose the Intrinsic Adversarial Attack ( IAA ) by maximizing AAI to generate more transferable adversarial examples . • We conduct comprehensive transfer attack experiments from different source models against nine naturally trained models and three ensemble secured models , showing that IAA can significantly improve the state-of-the-art transferability ( both targeted and untargeted attack ) of adversarial examples ( even improve 20 % under some settings ) . 1The AAI metric for LDD ( 0.1264 ) is much larger than HDD ( 0.0457 ) , which shows that the direction of PGD attack on LDD aligns better than that on HDD ( The AAI metric on all test samples is 0.052 ) . 2 RELATED WORK . There are two types of adversarial attacks : white-box attacks and black-box attacks . White-box attacks assume that the attacker can completely access the structure and parameters of the target model . Typical examples of white-box attacks are FGSM ( Goodfellow et al. , 2015 ) , PGD ( Madry et al. , 2018 ) , and CW ( Carlini & Wagner , 2017 ) . The black-box attack assumes that the attacker only knows the output of the target model ( prediction or confidence ) . Black-box attacks are roughly divided into two types : estimating gradient with queries to the target model ( Papernot et al. , 2017 ; Su et al. , 2019 ; Yang et al. , 2020 ) and attacking a surrogate model ( Xie et al. , 2019 ; Dong et al. , 2018 ; Wu et al. , 2019 ) . Attacking a surrogate model is much more efficient and can reduce the risk of exposure . Thus , many existing works focused on adversarial transferability . Su et al . ( 2018 ) explore the factors influencing the transferability and show the architecture has greater influence than model capacity . Dong et al . ( 2018 ) show that the momentum of gradients can be used to improve the adversarial transferability . Xie et al . ( 2019 ) show the diversity of input data will enhance the adversarial transferability . Huang et al . ( 2019 ) fine-tune the adversarial examples by increasing perturbation on a pre-specified layer . Wang et al . ( 2020 ) propose a loss to decrease interactions between perturbation units during attacking . Wu et al . ( 2019 ) propose that reducing gradients from the residual modules is effective for improving transferability . Guo et al . ( 2020 ) removes ReLU activations in the later layers to get linear backpropagation and decreases the influence of intermediate layers . They only modify the backpropagation when generating adversarial examples while keeping the forward prediction as the original model . Based on this , Zhang et al . ( 2021 ) conjecture that backpropagating smoothly might be sufficient for improving transferability . There are also some works on adversarial attack and defense using generative models . Naseer et al . ( 2019 ) and Yang et al . ( 2021a ) learn adversarial perturbation through a conditional generative attacking model , which needs to be carefully designed for certain classes . Samangouei et al . ( 2018 ) ; Song et al . ( 2018 ) use GANs or autoregressive models to detect and purify adversarial examples . Du & Mordatch ( 2019 ) ; Hill et al . ( 2021 ) ; Srinivasan et al . ( 2021 ) ; Yoon et al . ( 2021 ) purify adversarial examples by EBM or score-based generative models . JEM ( Grathwohl et al. , 2020 ) shows that combining a classifier with EBM can help to obtain some robustness . However , adversarial attacks or purification based on generative models are computationally costly . We want to modify a normal classifier with little computation cost to enhance its adversarial transferability by maximizing our AAI metric . 3 METHODS . 3.1 ALIGNMENT BETWEEN THE ADVERSARIAL ATTACK AND INTRINSIC ATTACK For a classifier fθ , Λ parameterized by θ with structure hyper-parameters Λ ( e.g. , hyper-parameters for architecture , activation function , etc . ) , and data x , label y , total possible classes n , then fθ , Λ ( x ) [ k ] represents the kth output of the last layer . The conditional density pθ , Λ ( y|x ) can be expressed as : pθ , Λ ( y|x ) = exp ( fθ , Λ ( x ) [ y ] ) ∑n k=1 exp ( fθ , Λ ( x ) [ k ] ) . ( 1 ) The adversarial attack is usually based on−∇x log pθ , Λ ( y|x ) ( Madry et al. , 2018 ; Goodfellow et al. , 2015 ) . The most effective direction towards low-density region is intrinsic attack−∇x log pD ( x , y ) . To improve the adversarial transferability , we need to match model ’ s adversarial attack direction with intrinsic attack . We define the inner product of normalized −∇x log pθ , Λ ( y|x ) and −∇x log pD ( x , y ) to quantify the matching of the direction of adversarial attack and the intrinsic attack . Definition 1 ( AAI ) . For a classifier pθ , Λ ( y|x ) , the Alignment between its Adversarial attack and the Intrinsic attack is : AAI , EpD ( x , y ) [ ∇x log pθ , Λ ( y|x ) ‖∇x log pθ , Λ ( y|x ) ‖2 · ∇x log pD ( x , y ) ] , ( 2 ) where pD ( x , y ) is the ground truth joint distribution . Remark . ( 1 ) We use the normalized adversarial attack to remove the influence of scaling factor when comparing different models . ( 2 ) This definition is equivalent with a modified score matching objective as : 1 2 EpD ( x , y ) ∥∥∥∥ ∇x log pθ , Λ ( y|x ) ‖∇x log pθ , Λ ( y|x ) ‖2 −∇x log pD ( x , y ) ∥∥∥∥2 2 = −AAI + CpD , where CpD is a constant only depend on the ground truth distribution pD . As getting the gradient of pD ( x , y ) is not feasible , we use integration by parts ( Hyvärinen & Dayan , 2005 ) to move the gradient on pD ( x , y ) to model ’ s adversarial attack . With the smoothness assumption on ∇xpθ , Λ ( y|x ) , we have the following theorem : Theorem 1 . If ∇xpθ , Λ ( y|x ) is differentiable almost everywhere , then AAI = −EpD ( x , y ) [ ∇x · ∇xpθ , Λ ( y|x ) ‖∇xpθ , Λ ( y|x ) ‖2 ] . ( 3 ) Moreover , AAI = −EpD ( x , y ) Ep ( v ) [ vT∇x vT∇xpθ , Λ ( y|x ) ‖∇xpθ , Λ ( y|x ) ‖2 ] , ( 4 ) where p ( v ) is a distribution of random vector v such that Ep ( v ) [ vvT ] = I ( e.g. , the multivariate standard normal N ( 0 , I ) ) . This theorem makes it possible to calculate AAI without knowing the gradient of ground truth distribution when the model is smooth , see Appendix E for the proof . Combined with sliced score matching ( Song et al. , 2020 ) we can efficiently approximate AAI on discrete samples . However , for ReLU networks , the model ’ s second derivative is not well defined , which prevents us from using this theorem . Thus , we need to smooth the ReLU models for better modifying the model to maximize AAI and improve the transferability . One obvious way to improve the smoothness is to replace ReLU activation with some smooth activation . In this paper , we use Softplus to show that smoothness can greatly help us to improve transferability .
This paper identifies that adversarial examples in the low-density region of the groud truth distribution have much stronger transferability. This observation leads to the AAI metric which evaluate the alignment of the model’s adversarial attack with intrinsic attack direction. The paper further identifies a set of model hyperparameters that can influence the AAI metric, and find the optimal hyperparameter choices to maximize AAI and generate more transferable adversarial examples.
SP:1e8c197e57285e0fc7e05a458f8bf1513aff7a47
Rethinking Adversarial Transferability from a Data Distribution Perspective
1 INTRODUCTION . Deep neural networks ( DNNs ) are widely used in various safety-critical fields , but they are vulnerable to adversarial examples ( Szegedy et al. , 2013 ) . Adversarial attacks are imperceptible to humans but catastrophic for the DNNs and can be transferred between different models ( Goodfellow et al. , 2015 ; Liu et al. , 2017 ) . Adversarial transferability enables attackers to generate adversarial examples from the source model to attack unknown target models , which has raised security concerns about the deployment of DNNs in practice . Understanding the essence of adversarial transferability is a fundamental problem in deep learning . On the one hand , some works show that the characteristics of the source model , such as model architecture ( Wu et al. , 2019 ) , model capacity ( Tramèr et al. , 2017 ) , and test accuracy ( Wu & Zhu , 2020 ) , influence adversarial examples ’ transferability . On the other hand , some works think that the data-relevant information may be the key factor for adversarial transferability . Ilyas et al . ( 2019 ) explain that adversarial perturbations are non-robust features and not meaningless bugs , but it is hard to specifically define non-robust features . We want to further study transferability quantitatively from the data distribution perspective . It has been empirically observed that DNNs are relatively robust to random noise ( Fawzi et al. , 2016 ) . However , in this work we find an intriguing phenomenon : some samples are sensitive to Gaussian noise , in the sense that injecting small Gaussian noise into these samples can fool different models trained on the same dataset . Furthermore , their adversarial counterparts generated by different source models have much stronger transferability against different target models than other samples . We hypothesize that these samples are in the low-density regions of the ground truth distribution both source and target models are trained on , and models are not well trained in these regions . Thus predictions of these samples are easy to be perturbed and even not robust to small random noises . We denote this kind of data as Low-Density Data ( LDD ) , while others as High-Density Data ( HDD ) . As shown in Fig . 1 ( Left ) , the attack success rate against different target models of LDD with different strengths of Gaussian noise is much higher than that of HDD . Furthermore , in Fig . 1 ( Right ) , the adversarial counterparts of LDD have much stronger transferability than the adversarial counterparts of HDD ( see Appendix B for details ) . This phenomenon reveals that the location of data plays a vital role in adversarial transferability and the adversarial examples of samples in the low-density region are strongly transferable . The most efficient direction towards the low-density region is −∇x log pD ( x , y ) , where pD ( x , y ) is the ground truth density of natural data . We name this direction Intrinsic Attack because it doesn ’ t depend on the models and only depends on the ground truth distribution . Thus , we propose to match the adversarial attack with intrinsic attack for generating strong transferable adversarial examples . We explore the potential of a classifier pθ , Λ ( y|x ) with parameters θ and structure hyper-parameters Λ ( see Sec . 3.1 ) to generate more transferable adversarial examples by aligning adversarial attack with intrinsic attack −∇x log pD ( x , y ) . The adversarial attack of pθ , Λ ( y|x ) is usually generated by PGD/FGSM method , and is determined by −∇x log pθ , Λ ( y|x ) . We match the Alignment between the Adversarial attack and Intrinsic attack ( AAI ) , EpD ( x , y ) [ ∇x log pθ , Λ ( y|x ) ‖∇x log pθ , Λ ( y|x ) ‖2 · ∇x log pD ( x , y ) ] , by modifying the structure parameters Λ for a pre-trained network . In order to maximize AAI , we should make pθ , Λ ( y|x ) smoother . Otherwise , ∇x log pθ , Λ ( y|x ) will oscillate frequently and hard to match∇x log pD ( x , y ) . For the commonly used ReLU network , we can smooth it by replacing ReLU activation with Softplus ( Nair & Hinton , 2010 ) with little change of the model ’ s output . Maennel et al . ( 2020 ) show that the early layers of a network learn the local statistics of the data distribution better than the later layers , which motivates us to decrease the impact of later layers when generating adversarial examples to utilize the data distribution-relevant information . We can closely match the adversarial attack with the intrinsic attack−∇x log pD ( x , y ) and improve the adversarial transferability by optimizing structure hyper-parameters Λ to maximize AAI as the objective function . We name our method as Intrinsic Adversarial Attack ( IAA ) . There are some interesting observations in our IAA experiments . Firstly , we find that the test accuracy of the source model may not be important . As shown in Fig 2 , the accuracy of the pre-trained model with Softplusβ=15 is around 60 % , but the adversarial transferability of this model is much stronger than the model with Softplusβ=45 . Secondly , although the existing methods ( Madry et al. , 2018 ; Wu et al. , 2019 ) can significantly decrease the top-1 accuracy of the target models , the top-5 accuracy is still high . IAA can both decrease the top-1 accuracy and top-5 accuracy . Furthermore , the existing methods ( Xie et al. , 2019 ; Wu et al. , 2019 ) can just slightly improve the one-step attack under different strengths , while our IAA surpasses the existing methods by a large margin . These phenomena verify our hypothesis that IAA pulls examples to the low-density region , which causes prediction difficulty to the target models . Our main contributions are summarized below : • We propose an effective metric , AAI , to evaluate the alignment of the model ’ s adversarial attack with intrinsic attack −∇x log pD ( x , y ) . Furthermore , we show that AAI is also an effective metric for adversarial transferability . • We propose the Intrinsic Adversarial Attack ( IAA ) by maximizing AAI to generate more transferable adversarial examples . • We conduct comprehensive transfer attack experiments from different source models against nine naturally trained models and three ensemble secured models , showing that IAA can significantly improve the state-of-the-art transferability ( both targeted and untargeted attack ) of adversarial examples ( even improve 20 % under some settings ) . 1The AAI metric for LDD ( 0.1264 ) is much larger than HDD ( 0.0457 ) , which shows that the direction of PGD attack on LDD aligns better than that on HDD ( The AAI metric on all test samples is 0.052 ) . 2 RELATED WORK . There are two types of adversarial attacks : white-box attacks and black-box attacks . White-box attacks assume that the attacker can completely access the structure and parameters of the target model . Typical examples of white-box attacks are FGSM ( Goodfellow et al. , 2015 ) , PGD ( Madry et al. , 2018 ) , and CW ( Carlini & Wagner , 2017 ) . The black-box attack assumes that the attacker only knows the output of the target model ( prediction or confidence ) . Black-box attacks are roughly divided into two types : estimating gradient with queries to the target model ( Papernot et al. , 2017 ; Su et al. , 2019 ; Yang et al. , 2020 ) and attacking a surrogate model ( Xie et al. , 2019 ; Dong et al. , 2018 ; Wu et al. , 2019 ) . Attacking a surrogate model is much more efficient and can reduce the risk of exposure . Thus , many existing works focused on adversarial transferability . Su et al . ( 2018 ) explore the factors influencing the transferability and show the architecture has greater influence than model capacity . Dong et al . ( 2018 ) show that the momentum of gradients can be used to improve the adversarial transferability . Xie et al . ( 2019 ) show the diversity of input data will enhance the adversarial transferability . Huang et al . ( 2019 ) fine-tune the adversarial examples by increasing perturbation on a pre-specified layer . Wang et al . ( 2020 ) propose a loss to decrease interactions between perturbation units during attacking . Wu et al . ( 2019 ) propose that reducing gradients from the residual modules is effective for improving transferability . Guo et al . ( 2020 ) removes ReLU activations in the later layers to get linear backpropagation and decreases the influence of intermediate layers . They only modify the backpropagation when generating adversarial examples while keeping the forward prediction as the original model . Based on this , Zhang et al . ( 2021 ) conjecture that backpropagating smoothly might be sufficient for improving transferability . There are also some works on adversarial attack and defense using generative models . Naseer et al . ( 2019 ) and Yang et al . ( 2021a ) learn adversarial perturbation through a conditional generative attacking model , which needs to be carefully designed for certain classes . Samangouei et al . ( 2018 ) ; Song et al . ( 2018 ) use GANs or autoregressive models to detect and purify adversarial examples . Du & Mordatch ( 2019 ) ; Hill et al . ( 2021 ) ; Srinivasan et al . ( 2021 ) ; Yoon et al . ( 2021 ) purify adversarial examples by EBM or score-based generative models . JEM ( Grathwohl et al. , 2020 ) shows that combining a classifier with EBM can help to obtain some robustness . However , adversarial attacks or purification based on generative models are computationally costly . We want to modify a normal classifier with little computation cost to enhance its adversarial transferability by maximizing our AAI metric . 3 METHODS . 3.1 ALIGNMENT BETWEEN THE ADVERSARIAL ATTACK AND INTRINSIC ATTACK For a classifier fθ , Λ parameterized by θ with structure hyper-parameters Λ ( e.g. , hyper-parameters for architecture , activation function , etc . ) , and data x , label y , total possible classes n , then fθ , Λ ( x ) [ k ] represents the kth output of the last layer . The conditional density pθ , Λ ( y|x ) can be expressed as : pθ , Λ ( y|x ) = exp ( fθ , Λ ( x ) [ y ] ) ∑n k=1 exp ( fθ , Λ ( x ) [ k ] ) . ( 1 ) The adversarial attack is usually based on−∇x log pθ , Λ ( y|x ) ( Madry et al. , 2018 ; Goodfellow et al. , 2015 ) . The most effective direction towards low-density region is intrinsic attack−∇x log pD ( x , y ) . To improve the adversarial transferability , we need to match model ’ s adversarial attack direction with intrinsic attack . We define the inner product of normalized −∇x log pθ , Λ ( y|x ) and −∇x log pD ( x , y ) to quantify the matching of the direction of adversarial attack and the intrinsic attack . Definition 1 ( AAI ) . For a classifier pθ , Λ ( y|x ) , the Alignment between its Adversarial attack and the Intrinsic attack is : AAI , EpD ( x , y ) [ ∇x log pθ , Λ ( y|x ) ‖∇x log pθ , Λ ( y|x ) ‖2 · ∇x log pD ( x , y ) ] , ( 2 ) where pD ( x , y ) is the ground truth joint distribution . Remark . ( 1 ) We use the normalized adversarial attack to remove the influence of scaling factor when comparing different models . ( 2 ) This definition is equivalent with a modified score matching objective as : 1 2 EpD ( x , y ) ∥∥∥∥ ∇x log pθ , Λ ( y|x ) ‖∇x log pθ , Λ ( y|x ) ‖2 −∇x log pD ( x , y ) ∥∥∥∥2 2 = −AAI + CpD , where CpD is a constant only depend on the ground truth distribution pD . As getting the gradient of pD ( x , y ) is not feasible , we use integration by parts ( Hyvärinen & Dayan , 2005 ) to move the gradient on pD ( x , y ) to model ’ s adversarial attack . With the smoothness assumption on ∇xpθ , Λ ( y|x ) , we have the following theorem : Theorem 1 . If ∇xpθ , Λ ( y|x ) is differentiable almost everywhere , then AAI = −EpD ( x , y ) [ ∇x · ∇xpθ , Λ ( y|x ) ‖∇xpθ , Λ ( y|x ) ‖2 ] . ( 3 ) Moreover , AAI = −EpD ( x , y ) Ep ( v ) [ vT∇x vT∇xpθ , Λ ( y|x ) ‖∇xpθ , Λ ( y|x ) ‖2 ] , ( 4 ) where p ( v ) is a distribution of random vector v such that Ep ( v ) [ vvT ] = I ( e.g. , the multivariate standard normal N ( 0 , I ) ) . This theorem makes it possible to calculate AAI without knowing the gradient of ground truth distribution when the model is smooth , see Appendix E for the proof . Combined with sliced score matching ( Song et al. , 2020 ) we can efficiently approximate AAI on discrete samples . However , for ReLU networks , the model ’ s second derivative is not well defined , which prevents us from using this theorem . Thus , we need to smooth the ReLU models for better modifying the model to maximize AAI and improve the transferability . One obvious way to improve the smoothness is to replace ReLU activation with some smooth activation . In this paper , we use Softplus to show that smoothness can greatly help us to improve transferability .
This paper proposes Intrinsic Adversarial Attack (IAA), a transfer attack method based by jointly matching data distribution. The key assumption of this paper is that the DNN might not be well trained on low-density regions (LDD). Therefore, taking data distribution into consideration during attack could potentially improve the transferability. Empirical evaluation on different model architectures, normal models, robustly trained models, and ensemble-based attack context, demonstrates the advantage of IAA.
SP:1e8c197e57285e0fc7e05a458f8bf1513aff7a47
Dynamic Least-Squares Regression
1 INTRODUCTION . The problem of least-squares regression ( LSR ) dates back to Gauss in 1821 ( Stigler , 1981 ) , and is the backbone of statistical inference ( Hastie et al. , 2001 ) , signal processing ( Rabiner & Gold , 1975 ) , convex optimization ( Bubeck , 2015 ) , control theory ( Chui , 1990 ) and network routing ( Lee & Sidford , 2014 ; Madry , 2013 ) . Given an overdetermined ( n d ) linear system A 2 Rn⇥d , b 2 Rn , the goal is to find the solution vector x that minimizes the mean squared error ( MSE ) min x2Rn kAx bk2 . ( 1 ) Among many other loss functions ( e.g. , ` p ) that have been studied for linear regression , ` 2-regression has been the most popular choice as it is at the same time robust to outliers , and admits a highaccuracy efficient solution . The computational task of least-squares regression arises naturally in high-dimensional statistics and has been the central of focus . The exact closed-form solution is given by the well-known Normal equation x ? = ( A > A ) 1A > b , which requires O ( nd2 ) time to compute using naive matrixmultiplication , or O ( nd ! 1 ) ⇡ O ( nd1.37 ) time using fast matrix-multiplication ( FMM ) ( Strassen , 1969 ) for the current FMM exponent of ! ⇡ 2.37 ( Le Gall , 2014 ; Alman & Williams , 2021 ) . Despite the elegance and simplicity of this closed-form solution , in practice the latter runtime is often too slow , especially in modern data analysis applications where both the dimension of the feature space ( d ) and the size of datasets ( n ) are overwhelmingly large . A more modest objective in attempt to circumvent this computational overhead , is to seek an ✏-accurate solution that satisfies kAx bk2 ( 1 + ✏ ) min x2Rd kAx bk2 . This was the primary motivation behined the development of the sketch-and-solve paradigm , where the idea is to first compress the matrix into one with fewer ( ⇠ d/✏2 ) rows and then to compute the standard LSR solution but over the smaller matrix . A long line of developments on this framework culminates in algorithms that run in close to input-sparsity time ( Sarlos , 2006 ; Clarkson & Woodruff , 2017 ; Nelson & Nguyên , 2013 ; Chepurko et al. , 2021 ) . In particular , a direct application of sketchand-solve yields an algorithm runs in eO ( nnz ( A ) ✏ 1 + d ! ) 1 , which is near optimal in the “ low 1In this paper we use eO ( · ) to hide polylogarithmic terms , and we use O✏ ( · ) to hide poly ( log d , ✏ 1 ) terms . precision ” regime ( ✏ = 1/ poly ( log d ) ) . Interestingly , when combined with more sophisticated ideas of preconditioning and ( conjugate ) gradient descent , the runtime of this algorithm in terms of the error ✏ can be further improved to eO ( nnz ( A ) log ( 1/✏ ) + d ! ) , which yields a high precision algorithm , i.e. , it can efficiently solve the problem to within polynomial accuracy ✏ = 1/ poly ( d ) . Dynamic least-squares In many real-world scenarios of the aforementioned applications , data is evolving in an online fashion either by nature or by design , and such applications require maintaining the solution ( 1 ) adaptively , where rows of the data matrix and their corresponding labels ( A ( t ) , b ( t ) ) arrive one-by-one incrementally . This is known as the dynamic least-squares regression problem . The origins of dynamic least-squares regression was in control theory of the 1950 ’ s ( Plackett , 1950 ) , in the context of dynamical linear systems . In this setup , the data matrix [ A ( t ) , b ( t ) ] corresponds to the set of measurement and it evolves in an online ( incremental ) fashion , and the goal is to efficiently maintain the ( exact ) solution to a noisy linear system b : = A ( t ) x ( t ) + ⇠ ( t ) without recomputing the LSR solution from scratch . The recursive least-squares ( RLS ) framework and the celebrated Kalman filter ( Kalman , 1960 ) provide a rather simple update rule for maintaining an exact solution for this problem , by maintaining the sample covariance matrix and using Woodburry ’ s identity ( which assert that an incremental update to [ A ( t ) , b ( t ) ] translates into a rank-1 update to the sample covariance matrix ) , and hence each update can be computed in O ( d2 ) time ( Kalman , 1960 ) . Beyond this classic motivation for dynamic LSR , a more timely motivation comes from modern deep learning applications : Most neural networks need to be frequently re-trained upon arrival on new training data , in order to improve prediction accuracy , and it is desirable to avoid recomputing weights from scratch . This problem of efficient incremental training of DNNs has been studied before in elastic machine learning ( Liberty et al. , 2020 ) and in the context of continual learning ( Parisi et al. , 2019 ) . Our work sheds light on this question by analyzing the minimal computational resources required for ` 2 loss-minimization . Despite the rich and versatile literature on static LSR , the understanding of the dynamic counterpart was so far quite limited : The previous best known result requires O ( d2 ) amortized update time ( by a direct application of the Woodbury identity ) . The basic questions we address in this papers are : Is it possible to achieve faster update time for maintaining an exact solution ? How about a smallapproximate solution – Is it then possible to achieve amortized O ( d ) or even input-sparsity time ? In this paper , we settle both of these questions and present an essentially complete characterization of the dynamic complexity of LSR . 1.1 OVERVIEW OF OUR RESULTS . Our first result is a negative answer to the first question above of maintaining exact ( or polynomialaccuracy ) LSR solutions in the dynamic setting – We prove that Kalman ’ s approach is essentially optimal , assuming the popular Online Matrix-Vector ( OMv ) Conjecture ( Henzinger et al. , 2015 ) 2 : Theorem 1.1 ( Hardness of exact dynamic LSR , informal ) . Assuming the OMv Conjecture , any dynamic algorithm that maintains an ✏ = 1/ poly ( d ) -approximate solution for the dynamic LSR problem over T = poly ( d ) iterations , must have ⌦ ( d2 o ( 1 ) ) amortized update time per iteration . Theorem 1.1 separates the static and the dynamic complexities of the exact LSR problem : As mentioned above , the static problem can be solved by batching rows together using FMM in time O ( Td ! 1 ) , whereas the dynamic problem requires ⌦ ( Td2 ) by Theorem 1.1 . Indeed , the implication Theorem 1.1 is stronger , it also separates the static and dynamic complexity of approximate LSR problem under the high precision regime , it asserts that a polylogarithmic dependence on the precision ( i.e . d poly ( log ( 1/✏ ) ) ) on update time is impossible ( assuming OMv ) , in sharp contrast to the static case . We next focus on an approximate version of this classic online problem , dynamic ✏-LSR , where the goal is to efficiently maintain , during all iterations t 2 [ T ] , an ✏-approximate solution under incremental row-updates to A ( t ) and labels b ( t ) , where efficiency is measured by the amortized 2This conjecture postulates that multiplying a fixed d ⇥ d matrix A with an online matrix B , column-bycolumn ( ABi ) , requires d3 o ( 1 ) time , in sharp contrast to the batch setting where this can be done using FMM in d ! ⌧ d3 time . See Section 4. update time for inserting a new row . A natural complexity benchmark for this dynamic problem is the aforementioned best static sketch-and-solve solution , which for n = T is eO ( nnz ( A ( T ) ) ✏ 1 + d ! ) = eO ( nnz ( A ) ✏ 1 ) for T d. Our main result is a provably efficient and practical dynamic data structure , whose total running time essentially matches the complexity of the offline problem : Theorem 1.2 ( Main result , informal version of Theorem 3.1 ) . For any accuracy parameter ✏ > 0 , there is a randomized dynamic data structure which , with probability at least 0.9 , maintains an ✏- approximate solution to the dynamic LSR problem simultaneously for all iterations t 2 [ T ] , with total update time O ( ✏ 2 nnz ( A ( T ) ) log ( T ) + ✏ 6d3 log5 ( T ) ) . Theorem 1.2 almost matches the fastest static sketching-based solution , up to polylogarithmic terms and the additive FMM term . When T d , this theorem shows that amortized update time of our algorithm is O ( d1+o ( 1 ) ) . 1.2 RELATED WORK . Sketching and sampling The least squares regression as a fundamental problem has been extensively studied in the literature . A long line of work ( Ailon & Chazelle , 2006 ; Clarkson & Woodruff , 2017 ; Nelson & Nguyên , 2013 ; Avron et al. , 2017 ; Cohen et al. , 2015 ; Woodruff , 2014 ; 2021 ) have focused on using dimension reduction technique ( sketching or sampling ) to speedup the computation task , culminates into algorithms that run in eO ( nnz ( A ) log ( 1/✏ ) + d ! ) time ( Clarkson & Woodruff , 2017 ) . See Appendix A for detailed discussions . Regression in online , streaming , and sliding window models Least-squares regressions have also been studied in various computational models , though the focus of these models are generally not the ( amortized ) running time . Our algorithm uses techniques developed by Cohen et al . ( 2020 ) , where they study the regression problem in the online model , with the goal of maintaining a spectral approximation of data matrix in the online stream . Their algorithm only needs to store O✏ ( d ) rows but the amortized running time is still ⌦ ( d2 ) ( see Section 3.1 for detailed discussions ) . In the streaming model , the main focus is the space complexity , and a direct application of random Gaussian sketch or count sketch reduces the space complexity to eO ( d2✏ 1 ) and it is shown to be tight ( Clarkson & Woodruff , 2009 ) . Recent work of ( Braverman et al. , 2020 ) studies regressions and other numerical linear algebra tasks in the sliding window model , where data come in an online stream and only the most recent updates form the underlying data set . The major focus of a sliding window model is still the space complexity , and there is no amortized running time guarantee . Disparity from online learning Our work crucially differs from online learning literature ( Hazan , 2019 ) , in that the main bottleneck in online regret-minimization and bandit problems is informationtheoretic , whereas the challenge in our loss-minimization problem is purely computational . See Appendix A for detailed discussions .
This paper studies incremental least-squares regression, where the goal is to maintain an $(1+\epsilon)$-approximate solution to $\min_x \left\Vert Ax-b\right\Vert_2^2$ for some $A\in\mathbb{R}^{n\times d}$, under row insertions to $\begin{pmatrix}A & b\end{pmatrix}$, while keeping the total runtime as low as possible. It builds on a work of Cohen et al. (2020), where it is shown that if, upon insertion of a row, we only keep (a multiple of) it with probability roughly equal to its current leverage score (otherwise we discard it), then the total number of rows that will be inserted is only $\widetilde{O}(d)$ and the matrix spectrally approximates the "true" matrix where all rows are kept. The main contribution of this paper is to make this algorithm faster, by improving the leverage score computation procedure. Instead of directly computing the leverage scores, the authors use the Johnson-Lindenstrauss lemma to be able to quickly approximate them. Then the main thing to be taken care of is maintaining certain dimension-reduced matrices that arise. In total the asymptotic amortized runtime goes down from $\widetilde{O}(d\cdot nnz(A))$ to $\widetilde{O}(nnz(A))$. Additionally, the authors give a negative result, which shows that, under the OMv conjecture, the amortized runtime is $\Omega(d^2)$ if we require a high-precision solution ($\epsilon=1/\mathrm{poly}(d)$). The theoretical result is accompanied by some synthetic and real experiments. In both, it seems that the runtime improvement is significant (e.g. up to 4x speedup in the real data when $\epsilon=1$).
SP:0d10eaac6836b37a301cbbe5213610a0a5d1e18c
Dynamic Least-Squares Regression
1 INTRODUCTION . The problem of least-squares regression ( LSR ) dates back to Gauss in 1821 ( Stigler , 1981 ) , and is the backbone of statistical inference ( Hastie et al. , 2001 ) , signal processing ( Rabiner & Gold , 1975 ) , convex optimization ( Bubeck , 2015 ) , control theory ( Chui , 1990 ) and network routing ( Lee & Sidford , 2014 ; Madry , 2013 ) . Given an overdetermined ( n d ) linear system A 2 Rn⇥d , b 2 Rn , the goal is to find the solution vector x that minimizes the mean squared error ( MSE ) min x2Rn kAx bk2 . ( 1 ) Among many other loss functions ( e.g. , ` p ) that have been studied for linear regression , ` 2-regression has been the most popular choice as it is at the same time robust to outliers , and admits a highaccuracy efficient solution . The computational task of least-squares regression arises naturally in high-dimensional statistics and has been the central of focus . The exact closed-form solution is given by the well-known Normal equation x ? = ( A > A ) 1A > b , which requires O ( nd2 ) time to compute using naive matrixmultiplication , or O ( nd ! 1 ) ⇡ O ( nd1.37 ) time using fast matrix-multiplication ( FMM ) ( Strassen , 1969 ) for the current FMM exponent of ! ⇡ 2.37 ( Le Gall , 2014 ; Alman & Williams , 2021 ) . Despite the elegance and simplicity of this closed-form solution , in practice the latter runtime is often too slow , especially in modern data analysis applications where both the dimension of the feature space ( d ) and the size of datasets ( n ) are overwhelmingly large . A more modest objective in attempt to circumvent this computational overhead , is to seek an ✏-accurate solution that satisfies kAx bk2 ( 1 + ✏ ) min x2Rd kAx bk2 . This was the primary motivation behined the development of the sketch-and-solve paradigm , where the idea is to first compress the matrix into one with fewer ( ⇠ d/✏2 ) rows and then to compute the standard LSR solution but over the smaller matrix . A long line of developments on this framework culminates in algorithms that run in close to input-sparsity time ( Sarlos , 2006 ; Clarkson & Woodruff , 2017 ; Nelson & Nguyên , 2013 ; Chepurko et al. , 2021 ) . In particular , a direct application of sketchand-solve yields an algorithm runs in eO ( nnz ( A ) ✏ 1 + d ! ) 1 , which is near optimal in the “ low 1In this paper we use eO ( · ) to hide polylogarithmic terms , and we use O✏ ( · ) to hide poly ( log d , ✏ 1 ) terms . precision ” regime ( ✏ = 1/ poly ( log d ) ) . Interestingly , when combined with more sophisticated ideas of preconditioning and ( conjugate ) gradient descent , the runtime of this algorithm in terms of the error ✏ can be further improved to eO ( nnz ( A ) log ( 1/✏ ) + d ! ) , which yields a high precision algorithm , i.e. , it can efficiently solve the problem to within polynomial accuracy ✏ = 1/ poly ( d ) . Dynamic least-squares In many real-world scenarios of the aforementioned applications , data is evolving in an online fashion either by nature or by design , and such applications require maintaining the solution ( 1 ) adaptively , where rows of the data matrix and their corresponding labels ( A ( t ) , b ( t ) ) arrive one-by-one incrementally . This is known as the dynamic least-squares regression problem . The origins of dynamic least-squares regression was in control theory of the 1950 ’ s ( Plackett , 1950 ) , in the context of dynamical linear systems . In this setup , the data matrix [ A ( t ) , b ( t ) ] corresponds to the set of measurement and it evolves in an online ( incremental ) fashion , and the goal is to efficiently maintain the ( exact ) solution to a noisy linear system b : = A ( t ) x ( t ) + ⇠ ( t ) without recomputing the LSR solution from scratch . The recursive least-squares ( RLS ) framework and the celebrated Kalman filter ( Kalman , 1960 ) provide a rather simple update rule for maintaining an exact solution for this problem , by maintaining the sample covariance matrix and using Woodburry ’ s identity ( which assert that an incremental update to [ A ( t ) , b ( t ) ] translates into a rank-1 update to the sample covariance matrix ) , and hence each update can be computed in O ( d2 ) time ( Kalman , 1960 ) . Beyond this classic motivation for dynamic LSR , a more timely motivation comes from modern deep learning applications : Most neural networks need to be frequently re-trained upon arrival on new training data , in order to improve prediction accuracy , and it is desirable to avoid recomputing weights from scratch . This problem of efficient incremental training of DNNs has been studied before in elastic machine learning ( Liberty et al. , 2020 ) and in the context of continual learning ( Parisi et al. , 2019 ) . Our work sheds light on this question by analyzing the minimal computational resources required for ` 2 loss-minimization . Despite the rich and versatile literature on static LSR , the understanding of the dynamic counterpart was so far quite limited : The previous best known result requires O ( d2 ) amortized update time ( by a direct application of the Woodbury identity ) . The basic questions we address in this papers are : Is it possible to achieve faster update time for maintaining an exact solution ? How about a smallapproximate solution – Is it then possible to achieve amortized O ( d ) or even input-sparsity time ? In this paper , we settle both of these questions and present an essentially complete characterization of the dynamic complexity of LSR . 1.1 OVERVIEW OF OUR RESULTS . Our first result is a negative answer to the first question above of maintaining exact ( or polynomialaccuracy ) LSR solutions in the dynamic setting – We prove that Kalman ’ s approach is essentially optimal , assuming the popular Online Matrix-Vector ( OMv ) Conjecture ( Henzinger et al. , 2015 ) 2 : Theorem 1.1 ( Hardness of exact dynamic LSR , informal ) . Assuming the OMv Conjecture , any dynamic algorithm that maintains an ✏ = 1/ poly ( d ) -approximate solution for the dynamic LSR problem over T = poly ( d ) iterations , must have ⌦ ( d2 o ( 1 ) ) amortized update time per iteration . Theorem 1.1 separates the static and the dynamic complexities of the exact LSR problem : As mentioned above , the static problem can be solved by batching rows together using FMM in time O ( Td ! 1 ) , whereas the dynamic problem requires ⌦ ( Td2 ) by Theorem 1.1 . Indeed , the implication Theorem 1.1 is stronger , it also separates the static and dynamic complexity of approximate LSR problem under the high precision regime , it asserts that a polylogarithmic dependence on the precision ( i.e . d poly ( log ( 1/✏ ) ) ) on update time is impossible ( assuming OMv ) , in sharp contrast to the static case . We next focus on an approximate version of this classic online problem , dynamic ✏-LSR , where the goal is to efficiently maintain , during all iterations t 2 [ T ] , an ✏-approximate solution under incremental row-updates to A ( t ) and labels b ( t ) , where efficiency is measured by the amortized 2This conjecture postulates that multiplying a fixed d ⇥ d matrix A with an online matrix B , column-bycolumn ( ABi ) , requires d3 o ( 1 ) time , in sharp contrast to the batch setting where this can be done using FMM in d ! ⌧ d3 time . See Section 4. update time for inserting a new row . A natural complexity benchmark for this dynamic problem is the aforementioned best static sketch-and-solve solution , which for n = T is eO ( nnz ( A ( T ) ) ✏ 1 + d ! ) = eO ( nnz ( A ) ✏ 1 ) for T d. Our main result is a provably efficient and practical dynamic data structure , whose total running time essentially matches the complexity of the offline problem : Theorem 1.2 ( Main result , informal version of Theorem 3.1 ) . For any accuracy parameter ✏ > 0 , there is a randomized dynamic data structure which , with probability at least 0.9 , maintains an ✏- approximate solution to the dynamic LSR problem simultaneously for all iterations t 2 [ T ] , with total update time O ( ✏ 2 nnz ( A ( T ) ) log ( T ) + ✏ 6d3 log5 ( T ) ) . Theorem 1.2 almost matches the fastest static sketching-based solution , up to polylogarithmic terms and the additive FMM term . When T d , this theorem shows that amortized update time of our algorithm is O ( d1+o ( 1 ) ) . 1.2 RELATED WORK . Sketching and sampling The least squares regression as a fundamental problem has been extensively studied in the literature . A long line of work ( Ailon & Chazelle , 2006 ; Clarkson & Woodruff , 2017 ; Nelson & Nguyên , 2013 ; Avron et al. , 2017 ; Cohen et al. , 2015 ; Woodruff , 2014 ; 2021 ) have focused on using dimension reduction technique ( sketching or sampling ) to speedup the computation task , culminates into algorithms that run in eO ( nnz ( A ) log ( 1/✏ ) + d ! ) time ( Clarkson & Woodruff , 2017 ) . See Appendix A for detailed discussions . Regression in online , streaming , and sliding window models Least-squares regressions have also been studied in various computational models , though the focus of these models are generally not the ( amortized ) running time . Our algorithm uses techniques developed by Cohen et al . ( 2020 ) , where they study the regression problem in the online model , with the goal of maintaining a spectral approximation of data matrix in the online stream . Their algorithm only needs to store O✏ ( d ) rows but the amortized running time is still ⌦ ( d2 ) ( see Section 3.1 for detailed discussions ) . In the streaming model , the main focus is the space complexity , and a direct application of random Gaussian sketch or count sketch reduces the space complexity to eO ( d2✏ 1 ) and it is shown to be tight ( Clarkson & Woodruff , 2009 ) . Recent work of ( Braverman et al. , 2020 ) studies regressions and other numerical linear algebra tasks in the sliding window model , where data come in an online stream and only the most recent updates form the underlying data set . The major focus of a sliding window model is still the space complexity , and there is no amortized running time guarantee . Disparity from online learning Our work crucially differs from online learning literature ( Hazan , 2019 ) , in that the main bottleneck in online regret-minimization and bandit problems is informationtheoretic , whereas the challenge in our loss-minimization problem is purely computational . See Appendix A for detailed discussions .
The paper considers solving the regression problem min_x |Ax-b|_2 in the online setting, where A in R^{n x d} and b in R^n are given row by row, one at each time. The main task is to maintain a good approximate solution x (meaning that |Ax-b|_2 <= (1+eps)*OPT) throughout this process, with the update time as small as possible. The paper shows that if there are T updates to A (the initial A may not be empty), the total update time will be O(eps^{-2} nnz(A) log T + poly(eps^{-1} d log T)). The first term O(eps^{-1}nnz(A)log T) matches the runtime in a typical sketching algorithm up to the log T factor, while the second term poly(eps^{-1} d log T) is much better in the dependence on T than the runtime of a simple sketching algorithm, which would be poly(d/eps)*T. This means that the amortized cost of each update is much smaller when T >> d. The paper also proves a lower bound of Omega(d^{2-o(1)}) amortized update time for T = poly(d) updates, assuming the Online Matrix-vector conjecture (which is on the amortized runtime of multiplying a matrix with a vector in the online setting).
SP:0d10eaac6836b37a301cbbe5213610a0a5d1e18c
Dynamic Least-Squares Regression
1 INTRODUCTION . The problem of least-squares regression ( LSR ) dates back to Gauss in 1821 ( Stigler , 1981 ) , and is the backbone of statistical inference ( Hastie et al. , 2001 ) , signal processing ( Rabiner & Gold , 1975 ) , convex optimization ( Bubeck , 2015 ) , control theory ( Chui , 1990 ) and network routing ( Lee & Sidford , 2014 ; Madry , 2013 ) . Given an overdetermined ( n d ) linear system A 2 Rn⇥d , b 2 Rn , the goal is to find the solution vector x that minimizes the mean squared error ( MSE ) min x2Rn kAx bk2 . ( 1 ) Among many other loss functions ( e.g. , ` p ) that have been studied for linear regression , ` 2-regression has been the most popular choice as it is at the same time robust to outliers , and admits a highaccuracy efficient solution . The computational task of least-squares regression arises naturally in high-dimensional statistics and has been the central of focus . The exact closed-form solution is given by the well-known Normal equation x ? = ( A > A ) 1A > b , which requires O ( nd2 ) time to compute using naive matrixmultiplication , or O ( nd ! 1 ) ⇡ O ( nd1.37 ) time using fast matrix-multiplication ( FMM ) ( Strassen , 1969 ) for the current FMM exponent of ! ⇡ 2.37 ( Le Gall , 2014 ; Alman & Williams , 2021 ) . Despite the elegance and simplicity of this closed-form solution , in practice the latter runtime is often too slow , especially in modern data analysis applications where both the dimension of the feature space ( d ) and the size of datasets ( n ) are overwhelmingly large . A more modest objective in attempt to circumvent this computational overhead , is to seek an ✏-accurate solution that satisfies kAx bk2 ( 1 + ✏ ) min x2Rd kAx bk2 . This was the primary motivation behined the development of the sketch-and-solve paradigm , where the idea is to first compress the matrix into one with fewer ( ⇠ d/✏2 ) rows and then to compute the standard LSR solution but over the smaller matrix . A long line of developments on this framework culminates in algorithms that run in close to input-sparsity time ( Sarlos , 2006 ; Clarkson & Woodruff , 2017 ; Nelson & Nguyên , 2013 ; Chepurko et al. , 2021 ) . In particular , a direct application of sketchand-solve yields an algorithm runs in eO ( nnz ( A ) ✏ 1 + d ! ) 1 , which is near optimal in the “ low 1In this paper we use eO ( · ) to hide polylogarithmic terms , and we use O✏ ( · ) to hide poly ( log d , ✏ 1 ) terms . precision ” regime ( ✏ = 1/ poly ( log d ) ) . Interestingly , when combined with more sophisticated ideas of preconditioning and ( conjugate ) gradient descent , the runtime of this algorithm in terms of the error ✏ can be further improved to eO ( nnz ( A ) log ( 1/✏ ) + d ! ) , which yields a high precision algorithm , i.e. , it can efficiently solve the problem to within polynomial accuracy ✏ = 1/ poly ( d ) . Dynamic least-squares In many real-world scenarios of the aforementioned applications , data is evolving in an online fashion either by nature or by design , and such applications require maintaining the solution ( 1 ) adaptively , where rows of the data matrix and their corresponding labels ( A ( t ) , b ( t ) ) arrive one-by-one incrementally . This is known as the dynamic least-squares regression problem . The origins of dynamic least-squares regression was in control theory of the 1950 ’ s ( Plackett , 1950 ) , in the context of dynamical linear systems . In this setup , the data matrix [ A ( t ) , b ( t ) ] corresponds to the set of measurement and it evolves in an online ( incremental ) fashion , and the goal is to efficiently maintain the ( exact ) solution to a noisy linear system b : = A ( t ) x ( t ) + ⇠ ( t ) without recomputing the LSR solution from scratch . The recursive least-squares ( RLS ) framework and the celebrated Kalman filter ( Kalman , 1960 ) provide a rather simple update rule for maintaining an exact solution for this problem , by maintaining the sample covariance matrix and using Woodburry ’ s identity ( which assert that an incremental update to [ A ( t ) , b ( t ) ] translates into a rank-1 update to the sample covariance matrix ) , and hence each update can be computed in O ( d2 ) time ( Kalman , 1960 ) . Beyond this classic motivation for dynamic LSR , a more timely motivation comes from modern deep learning applications : Most neural networks need to be frequently re-trained upon arrival on new training data , in order to improve prediction accuracy , and it is desirable to avoid recomputing weights from scratch . This problem of efficient incremental training of DNNs has been studied before in elastic machine learning ( Liberty et al. , 2020 ) and in the context of continual learning ( Parisi et al. , 2019 ) . Our work sheds light on this question by analyzing the minimal computational resources required for ` 2 loss-minimization . Despite the rich and versatile literature on static LSR , the understanding of the dynamic counterpart was so far quite limited : The previous best known result requires O ( d2 ) amortized update time ( by a direct application of the Woodbury identity ) . The basic questions we address in this papers are : Is it possible to achieve faster update time for maintaining an exact solution ? How about a smallapproximate solution – Is it then possible to achieve amortized O ( d ) or even input-sparsity time ? In this paper , we settle both of these questions and present an essentially complete characterization of the dynamic complexity of LSR . 1.1 OVERVIEW OF OUR RESULTS . Our first result is a negative answer to the first question above of maintaining exact ( or polynomialaccuracy ) LSR solutions in the dynamic setting – We prove that Kalman ’ s approach is essentially optimal , assuming the popular Online Matrix-Vector ( OMv ) Conjecture ( Henzinger et al. , 2015 ) 2 : Theorem 1.1 ( Hardness of exact dynamic LSR , informal ) . Assuming the OMv Conjecture , any dynamic algorithm that maintains an ✏ = 1/ poly ( d ) -approximate solution for the dynamic LSR problem over T = poly ( d ) iterations , must have ⌦ ( d2 o ( 1 ) ) amortized update time per iteration . Theorem 1.1 separates the static and the dynamic complexities of the exact LSR problem : As mentioned above , the static problem can be solved by batching rows together using FMM in time O ( Td ! 1 ) , whereas the dynamic problem requires ⌦ ( Td2 ) by Theorem 1.1 . Indeed , the implication Theorem 1.1 is stronger , it also separates the static and dynamic complexity of approximate LSR problem under the high precision regime , it asserts that a polylogarithmic dependence on the precision ( i.e . d poly ( log ( 1/✏ ) ) ) on update time is impossible ( assuming OMv ) , in sharp contrast to the static case . We next focus on an approximate version of this classic online problem , dynamic ✏-LSR , where the goal is to efficiently maintain , during all iterations t 2 [ T ] , an ✏-approximate solution under incremental row-updates to A ( t ) and labels b ( t ) , where efficiency is measured by the amortized 2This conjecture postulates that multiplying a fixed d ⇥ d matrix A with an online matrix B , column-bycolumn ( ABi ) , requires d3 o ( 1 ) time , in sharp contrast to the batch setting where this can be done using FMM in d ! ⌧ d3 time . See Section 4. update time for inserting a new row . A natural complexity benchmark for this dynamic problem is the aforementioned best static sketch-and-solve solution , which for n = T is eO ( nnz ( A ( T ) ) ✏ 1 + d ! ) = eO ( nnz ( A ) ✏ 1 ) for T d. Our main result is a provably efficient and practical dynamic data structure , whose total running time essentially matches the complexity of the offline problem : Theorem 1.2 ( Main result , informal version of Theorem 3.1 ) . For any accuracy parameter ✏ > 0 , there is a randomized dynamic data structure which , with probability at least 0.9 , maintains an ✏- approximate solution to the dynamic LSR problem simultaneously for all iterations t 2 [ T ] , with total update time O ( ✏ 2 nnz ( A ( T ) ) log ( T ) + ✏ 6d3 log5 ( T ) ) . Theorem 1.2 almost matches the fastest static sketching-based solution , up to polylogarithmic terms and the additive FMM term . When T d , this theorem shows that amortized update time of our algorithm is O ( d1+o ( 1 ) ) . 1.2 RELATED WORK . Sketching and sampling The least squares regression as a fundamental problem has been extensively studied in the literature . A long line of work ( Ailon & Chazelle , 2006 ; Clarkson & Woodruff , 2017 ; Nelson & Nguyên , 2013 ; Avron et al. , 2017 ; Cohen et al. , 2015 ; Woodruff , 2014 ; 2021 ) have focused on using dimension reduction technique ( sketching or sampling ) to speedup the computation task , culminates into algorithms that run in eO ( nnz ( A ) log ( 1/✏ ) + d ! ) time ( Clarkson & Woodruff , 2017 ) . See Appendix A for detailed discussions . Regression in online , streaming , and sliding window models Least-squares regressions have also been studied in various computational models , though the focus of these models are generally not the ( amortized ) running time . Our algorithm uses techniques developed by Cohen et al . ( 2020 ) , where they study the regression problem in the online model , with the goal of maintaining a spectral approximation of data matrix in the online stream . Their algorithm only needs to store O✏ ( d ) rows but the amortized running time is still ⌦ ( d2 ) ( see Section 3.1 for detailed discussions ) . In the streaming model , the main focus is the space complexity , and a direct application of random Gaussian sketch or count sketch reduces the space complexity to eO ( d2✏ 1 ) and it is shown to be tight ( Clarkson & Woodruff , 2009 ) . Recent work of ( Braverman et al. , 2020 ) studies regressions and other numerical linear algebra tasks in the sliding window model , where data come in an online stream and only the most recent updates form the underlying data set . The major focus of a sliding window model is still the space complexity , and there is no amortized running time guarantee . Disparity from online learning Our work crucially differs from online learning literature ( Hazan , 2019 ) , in that the main bottleneck in online regret-minimization and bandit problems is informationtheoretic , whereas the challenge in our loss-minimization problem is purely computational . See Appendix A for detailed discussions .
The paper discusses _Dynamic Least Squares_: the problem where the rows of a overdetermined least squares problem are revealed incrementally, and an algorithm has to maintain an accurate solution to the least squares system as these rows are revealed. In prior work, this problem has been studied in the context of space complexity, where tools like leverage score sampling minimize the number of rows an algorithm must store. In this work, the focus shifts to time complexity, where the authors focus on making those leverage score sampling algorithm more computationally efficient. The algorithm provided is matched with a compelling conditional lower bound. Some experiments are provided.
SP:0d10eaac6836b37a301cbbe5213610a0a5d1e18c
StyleNeRF: A Style-based 3D Aware Generator for High-resolution Image Synthesis
1 INTRODUCTION . Photo-realistic free-view image synthesis of real-world scenes is a long-standing problem in computer vision and computer graphics . Traditional graphics pipeline requires production-quality 3D models , computationally expensive rendering , and manual work , making it challenging to apply to large-scale image synthesis for a wide range of real-world scenes . In the meantime , Generative Adversarial Networks ( GANs , Goodfellow et al. , 2014 ) can be trained on a large number of unstructured images to synthesize high-quality images . However , most GAN models operate in 2D space and lack the 3D understanding of the training images , which results in their inability to synthesize images of the same scene with multi-view consistency and direct camera control . Natural images are the 2D projection of the 3D world . Hence , recent works on generative models ( Schwarz et al. , 2020 ; Chan et al. , 2021 ) enforce 3D structures by incorporating a neural radiance field ( NeRF , Mildenhall et al. , 2020 ) . However , these methods can not synthesize high-resolution images with delicate details due to the computationally expensive rendering process of NeRF . Furthermore , the slow rendering process leads to inefficient training and makes these models unsuitable for interactive applications . GIRAFFE ( Niemeyer & Geiger , 2021b ) combines NeRF with a CNN- based renderer , which has the potential to synthesize high-resolution images . However , this method falls short of 3D-consistent image generation and so far has not shown high-resolution results . We propose StyleNeRF , a new 3D-aware generative model for high-resolution 3D consistent image synthesis at interactive rates . It also allows control of the 3D camera pose and enables control of specific style attributes . StyleNeRF incorporates 3D scene representations into a style-based generative model . To prevent the expensive direct color image rendering from the original NeRF approach , we only use NeRF to produce a low-resolution feature map and upsample it progressively to high resolution . To improve 3D consistency , we propose several designs , including a desirable upsampler that achieves high consistency while mitigating artifacts in the outputs , a novel regularization term that forces the output to match the rendering result of the original NeRF and fixing the issues of view direction condition and noise injection . StyleNeRF is trained using unstructured real-world images . A progressive training strategy significantly improves the stability of learning real geometry . We evaluate StyleNeRF on various challenging datasets . StyleNeRF can synthesize photo-realistic 10242 images at interactive rates while achieving high multi-view consistency . None of the existing methods can achieve both characteristics . Additionally , StyleNeRF enables direct control on styles , and 3D camera poses even for the poses starkly different from training . 2 RELATED WORK . Neural Implicit Fields Representing 3D scenes as neural implicit fields has increasingly gained much attention . Michalkiewicz et al . ( 2019 ) ; Mescheder et al . ( 2019 ) ; Park et al . ( 2019 ) ; Peng et al . ( 2020 ) predict neural implicit fields with 3D supervision . Some of them ( Sitzmann et al. , 2019 ; Niemeyer et al. , 2019 ) assume that the ray color only lies on the geometry surface and propose differentiable renderers to learn a neural implicit surface representation . NeRF and and similar works ( Lombardi et al. , 2019 ; Mildenhall et al. , 2020 ; Liu et al. , 2020 ; Zhang et al. , 2020 ) utilize a volume rendering technique to render neural implicit volume representations for novel view synthesis . In this work , we focus on generative NeRF . Unlike the discussed methods , which require posed multi-view images , our approach only needs unstructured single-view images for training . Image Synthesis with GANs Starting from Goodfellow et al . ( 2014 ) , GANs have demonstrated high-quality results ( Durugkar et al. , 2017 ; Mordido et al. , 2018 ; Doan et al. , 2019 ; Zhang et al. , 2019 ; Brock et al. , 2018 ; Karras et al. , 2018 ) . StyleGANs ( Karras et al. , 2019 ; 2020b ) achieve SOTA quality and support different levels of style control . Karras et al . ( 2021 ) solve the “ texture sticking ” problem of 2D GANs in generating animations with 2D transformations . Some methods ( Härkönen et al. , 2020 ; Tewari et al. , 2020a ; Shen et al. , 2020 ; Abdal et al. , 2020 ; Tewari et al. , 2020b ; Leimkühler & Drettakis , 2021 ; Shoshan et al. , 2021 ) leverage disentangled properties in the latent space to enable explicit controls , most of which focus on faces . While these methods can synthesize face poses parameterized by two angles , extending them to general objects and controlling 3D cameras is not easy . Chen et al . ( 2021a ) proposed to generate segmentation maps from implicit fields to enable 3D control . However , it requires 3D meshes for pre-training . In contrast , our work can synthesize images for general objects , enabling explicit 3D camera control . 3D-Aware GANs Recently , 3D representations have been integrated into 2D generative models to enable camera control . Voxel-based GANs ( Henzler et al. , 2019 ; Nguyen-Phuoc et al. , 2019 ; 2020 ) lack fine details in the output due to resolution restriction . Radiance fields-based methods ( Schwarz et al. , 2020 ; Chan et al. , 2021 ; Niemeyer & Geiger , 2021a ) achieve higher quality but have difficulties in training on high-resolution images ( 5122 and beyond ) due to the expensive rendering process . GIRAFFE ( Niemeyer & Geiger , 2021b ) improves the training and rendering efficiency by combining NeRF with a CNN-based renderer ; GSN ( DeVries et al. , 2021 ) models a locally conditional NeRF with a similar renderer for unconstrained indoor scene generation . However , they both produce severe view-inconsistent artifacts due to their network designs ( e.g. , 3 × 3 Conv and upsampler ) . In contrast , our method can effectively preserve view consistency in image synthesis . 3 METHOD . 3.1 IMAGE SYNTHESIS AS NEURAL IMPLICIT FIELD RENDERING . Style-based Generative Neural Radiance Field We start by modeling a 3D scene as neural radiance field ( NeRF , Mildenhall et al. , 2020 ) . It is typically parameterized as multilayer perceptrons ( MLPs ) , which takes the position x ∈ R3 and viewing direction d ∈ S2 as input , and predicts the density σ ( x ) ∈ R+ and view-dependent color c ( x , d ) ∈ R3 . To model high-frequency details , follwing NeRF ( Mildenhall et al. , 2020 ) , we map each dimension of x and d with Fourier features : ζL ( x ) = [ sin ( 20x ) , cos ( 20x ) , . . . , sin ( 2L−1x ) , cos ( 2L−1x ) ] ( 1 ) We formalize StyleNeRF representations by conditioning NeRF with style vectors w as follows : φnw ( x ) = g n w ◦ gn−1w ◦ . . . ◦ g1w ◦ ζ ( x ) , where w = f ( z ) , z ∈ Z ( 2 ) Similar as StyleGAN2 ( Karras et al. , 2020b ) , f is a mapping network that maps noise vectors from the spherical Gaussian spaceZ to the style spaceW ; giw ( . ) is the ith layer MLP whose weight matrix is modulated by the input style vectorw . φnw ( x ) is the n-th layer feature of that point . We then use the extracted features to predict the density and color , respectively : σw ( x ) = hσ ◦ φnσw ( x ) , cw ( x , d ) = hc ◦ [ φncw ( x ) , ζ ( d ) ] , ( 3 ) where hσ and hc can be a linear projection or 2-layer MLPs . Different from the original NeRF , we assume nc > nσ for Equation ( 3 ) as the visual appearance generally needs more capacity to model than the geometry . The first min ( nσ , nc ) layers are shared in the network . Volume Rendering Image synthesis is modeled as volume rendering from a given camera pose p ∈ P . For simplicity , we assume a camera is located on the unit sphere pointing to the origin with a fixed field of view ( FOV ) . We sample the camera ’ s pitch & yaw from a uniform or Gaussian distribution . To render an image I ∈ RH×W×3 , we shoot a camera ray r ( t ) = o + td ( o is the camera origin ) for each pixel , and then calculate the color using the volume rendering equation : INeRFw ( r ) = ∫ ∞ 0 pw ( t ) cw ( r ( t ) , d ) dt , where pw ( t ) = exp ( − ∫ t 0 σw ( r ( s ) ) ds ) · σw ( r ( t ) ) ( 4 ) In practice , the above equation is discretized by accumulating sampled points along the ray . Following NeRF ( Mildenhall et al. , 2020 ) , stratified and hierarchical sampling are applied for more accurate discrete approximation to the continuous implicit function . Challenges Compared to 2D generative models ( e.g. , StyleGANs ( Karras et al. , 2019 ; 2020b ) ) , the images generated by NeRF-based models have 3D consistency , which is guaranteed by modeling the image synthesis as a physics process , and the neural 3D scene representation is invariant across different viewpoints . However , the drawbacks are apparent : these models cost much more computation to render an image at the exact resolution . For example , 2D GANs are 100 ∼ 1000 times more efficient to generate a 10242 image than NeRF-based models . Furthermore , NeRF consumes much more memory to cache the intermediate results for gradient back-propagation during training , making it difficult to train on high-resolution images . Both of these restrict the scope of applying NeRF-based models in high-quality image synthesis , especially at the training stage when calculating the objective function over the whole image is crucial . 3.2 APPROXIMATION FOR HIGH-RESOLUTION IMAGE GENERATION . In this section , we propose how to improve the efficiency of StyleNeRF by taking inspiration from 2D GANs . We observe that the image generation of 2D GANs ( e.g. , StyleGANs ) is fast due to two main reasons : ( 1 ) each pixel only takes single forward pass through the network ; ( 2 ) image features are generated progressively from coarse to fine , and the feature maps with higher resolutions typically have a smaller number of channels to save memory . In StyleNeRF , the first point can be partially achieved by early aggregating the features into the 2D space before the final colors are computed . In this way , each pixel is assigned with a feature vector , Furthermore , it only needs to pass through a network once rather than calling the network multiple times for all sampled points on the ray as NeRF does . We approximate Equation ( 4 ) as : IApproxw ( r ) = ∫ ∞ 0 pw ( t ) · hc ◦ [ φncw ( r ( t ) ) , ζ ( d ) ] dt ≈ hc ◦ [ φnc , nσw ( A ( r ) ) , ζ ( d ) ] , ( 5 ) where φn , nσw ( A ( r ) ) = gnw ◦ gn−1w ◦ . . . ◦ gnσ+1w ◦ A ( r ) and A ( r ) = ∫∞ 0 pw ( t ) · φnσw ( r ( t ) ) dt . The definitions of A ( . ) and φn , nσw ( . ) can be extended to the operations on a set of rays , each ray processed independently . Next , instead of using volume rendering to render a high-resolution feature map directly , we can employ NeRF to generate a downsampled feature map at a low resolution and then employ upsampling in 2D space to progressively increase into the required high resolution . We take two adjacent resolutions as an example . Suppose RL ∈ RH/2×W/2 and RH ∈ RH×W are the corresponding rays of the pixels in the low- and high-resolution images , respectively . To approximate the high-resolution feature map , we can up-sample in the low-resolution feature space : φn , nσw ( A ( RH ) ) ≈ Upsample ( φn , nσw ( A ( RL ) ) ) ( 6 ) Recursively inserting Upsample operators enables efficient high-resolution image synthesis as the computationally expensive volume rendering only needs to generate a low-resolution feature map . The efficiency is further improved when using fewer channels for higher resolution . While early aggregation and upsampling operations can accelerate the rendering process for highresolution image synthesis , they would come with scarification to the inherent consistency of NeRF . There are two reasons why they introduce inconsistency . First , the resulting model contains nonlinear transformations to capture spurious correlations in 2D observation , mainly when substantial ambiguity exists . For example , our training data are unstructured single-view images without sufficient multi-view supervision . Second , such a pixel-space operation like up-sampling would compromise 3D consistency . Therefore , naı̈ve model designs would lead to severe multi-view inconsistent outputs ( e.g. , when moving the camera to render images , hairs are constantly changing ) . In the following , we propose several designs and choices to alleviate the inconsistency in the outputs .
In this manuscript, authors proposed a novel 3D-aware generative model for photo-realistic high resolution image synthesis. The proposed method combines Neural Radiance Fields (NerF) and StyleGAN, and tackles the challenges of efficiency, multi-view consistency and rendering quality. Specifically, authors propose to use NeRF to render low resolution images before feeding them into 2D StyleGAN network to upsample the feature maps in order to obtain images with high resolution and therefore the proposed model can render images at interactive rates. Extensive experiments on numerous datasets demonstrate superior performance than prior state of art 3D generative view synthesis approaches and largely close the gap between 2D and 3D view synthesis methods.
SP:121fa4d034d563334ba12c898c706377957fabad
StyleNeRF: A Style-based 3D Aware Generator for High-resolution Image Synthesis
1 INTRODUCTION . Photo-realistic free-view image synthesis of real-world scenes is a long-standing problem in computer vision and computer graphics . Traditional graphics pipeline requires production-quality 3D models , computationally expensive rendering , and manual work , making it challenging to apply to large-scale image synthesis for a wide range of real-world scenes . In the meantime , Generative Adversarial Networks ( GANs , Goodfellow et al. , 2014 ) can be trained on a large number of unstructured images to synthesize high-quality images . However , most GAN models operate in 2D space and lack the 3D understanding of the training images , which results in their inability to synthesize images of the same scene with multi-view consistency and direct camera control . Natural images are the 2D projection of the 3D world . Hence , recent works on generative models ( Schwarz et al. , 2020 ; Chan et al. , 2021 ) enforce 3D structures by incorporating a neural radiance field ( NeRF , Mildenhall et al. , 2020 ) . However , these methods can not synthesize high-resolution images with delicate details due to the computationally expensive rendering process of NeRF . Furthermore , the slow rendering process leads to inefficient training and makes these models unsuitable for interactive applications . GIRAFFE ( Niemeyer & Geiger , 2021b ) combines NeRF with a CNN- based renderer , which has the potential to synthesize high-resolution images . However , this method falls short of 3D-consistent image generation and so far has not shown high-resolution results . We propose StyleNeRF , a new 3D-aware generative model for high-resolution 3D consistent image synthesis at interactive rates . It also allows control of the 3D camera pose and enables control of specific style attributes . StyleNeRF incorporates 3D scene representations into a style-based generative model . To prevent the expensive direct color image rendering from the original NeRF approach , we only use NeRF to produce a low-resolution feature map and upsample it progressively to high resolution . To improve 3D consistency , we propose several designs , including a desirable upsampler that achieves high consistency while mitigating artifacts in the outputs , a novel regularization term that forces the output to match the rendering result of the original NeRF and fixing the issues of view direction condition and noise injection . StyleNeRF is trained using unstructured real-world images . A progressive training strategy significantly improves the stability of learning real geometry . We evaluate StyleNeRF on various challenging datasets . StyleNeRF can synthesize photo-realistic 10242 images at interactive rates while achieving high multi-view consistency . None of the existing methods can achieve both characteristics . Additionally , StyleNeRF enables direct control on styles , and 3D camera poses even for the poses starkly different from training . 2 RELATED WORK . Neural Implicit Fields Representing 3D scenes as neural implicit fields has increasingly gained much attention . Michalkiewicz et al . ( 2019 ) ; Mescheder et al . ( 2019 ) ; Park et al . ( 2019 ) ; Peng et al . ( 2020 ) predict neural implicit fields with 3D supervision . Some of them ( Sitzmann et al. , 2019 ; Niemeyer et al. , 2019 ) assume that the ray color only lies on the geometry surface and propose differentiable renderers to learn a neural implicit surface representation . NeRF and and similar works ( Lombardi et al. , 2019 ; Mildenhall et al. , 2020 ; Liu et al. , 2020 ; Zhang et al. , 2020 ) utilize a volume rendering technique to render neural implicit volume representations for novel view synthesis . In this work , we focus on generative NeRF . Unlike the discussed methods , which require posed multi-view images , our approach only needs unstructured single-view images for training . Image Synthesis with GANs Starting from Goodfellow et al . ( 2014 ) , GANs have demonstrated high-quality results ( Durugkar et al. , 2017 ; Mordido et al. , 2018 ; Doan et al. , 2019 ; Zhang et al. , 2019 ; Brock et al. , 2018 ; Karras et al. , 2018 ) . StyleGANs ( Karras et al. , 2019 ; 2020b ) achieve SOTA quality and support different levels of style control . Karras et al . ( 2021 ) solve the “ texture sticking ” problem of 2D GANs in generating animations with 2D transformations . Some methods ( Härkönen et al. , 2020 ; Tewari et al. , 2020a ; Shen et al. , 2020 ; Abdal et al. , 2020 ; Tewari et al. , 2020b ; Leimkühler & Drettakis , 2021 ; Shoshan et al. , 2021 ) leverage disentangled properties in the latent space to enable explicit controls , most of which focus on faces . While these methods can synthesize face poses parameterized by two angles , extending them to general objects and controlling 3D cameras is not easy . Chen et al . ( 2021a ) proposed to generate segmentation maps from implicit fields to enable 3D control . However , it requires 3D meshes for pre-training . In contrast , our work can synthesize images for general objects , enabling explicit 3D camera control . 3D-Aware GANs Recently , 3D representations have been integrated into 2D generative models to enable camera control . Voxel-based GANs ( Henzler et al. , 2019 ; Nguyen-Phuoc et al. , 2019 ; 2020 ) lack fine details in the output due to resolution restriction . Radiance fields-based methods ( Schwarz et al. , 2020 ; Chan et al. , 2021 ; Niemeyer & Geiger , 2021a ) achieve higher quality but have difficulties in training on high-resolution images ( 5122 and beyond ) due to the expensive rendering process . GIRAFFE ( Niemeyer & Geiger , 2021b ) improves the training and rendering efficiency by combining NeRF with a CNN-based renderer ; GSN ( DeVries et al. , 2021 ) models a locally conditional NeRF with a similar renderer for unconstrained indoor scene generation . However , they both produce severe view-inconsistent artifacts due to their network designs ( e.g. , 3 × 3 Conv and upsampler ) . In contrast , our method can effectively preserve view consistency in image synthesis . 3 METHOD . 3.1 IMAGE SYNTHESIS AS NEURAL IMPLICIT FIELD RENDERING . Style-based Generative Neural Radiance Field We start by modeling a 3D scene as neural radiance field ( NeRF , Mildenhall et al. , 2020 ) . It is typically parameterized as multilayer perceptrons ( MLPs ) , which takes the position x ∈ R3 and viewing direction d ∈ S2 as input , and predicts the density σ ( x ) ∈ R+ and view-dependent color c ( x , d ) ∈ R3 . To model high-frequency details , follwing NeRF ( Mildenhall et al. , 2020 ) , we map each dimension of x and d with Fourier features : ζL ( x ) = [ sin ( 20x ) , cos ( 20x ) , . . . , sin ( 2L−1x ) , cos ( 2L−1x ) ] ( 1 ) We formalize StyleNeRF representations by conditioning NeRF with style vectors w as follows : φnw ( x ) = g n w ◦ gn−1w ◦ . . . ◦ g1w ◦ ζ ( x ) , where w = f ( z ) , z ∈ Z ( 2 ) Similar as StyleGAN2 ( Karras et al. , 2020b ) , f is a mapping network that maps noise vectors from the spherical Gaussian spaceZ to the style spaceW ; giw ( . ) is the ith layer MLP whose weight matrix is modulated by the input style vectorw . φnw ( x ) is the n-th layer feature of that point . We then use the extracted features to predict the density and color , respectively : σw ( x ) = hσ ◦ φnσw ( x ) , cw ( x , d ) = hc ◦ [ φncw ( x ) , ζ ( d ) ] , ( 3 ) where hσ and hc can be a linear projection or 2-layer MLPs . Different from the original NeRF , we assume nc > nσ for Equation ( 3 ) as the visual appearance generally needs more capacity to model than the geometry . The first min ( nσ , nc ) layers are shared in the network . Volume Rendering Image synthesis is modeled as volume rendering from a given camera pose p ∈ P . For simplicity , we assume a camera is located on the unit sphere pointing to the origin with a fixed field of view ( FOV ) . We sample the camera ’ s pitch & yaw from a uniform or Gaussian distribution . To render an image I ∈ RH×W×3 , we shoot a camera ray r ( t ) = o + td ( o is the camera origin ) for each pixel , and then calculate the color using the volume rendering equation : INeRFw ( r ) = ∫ ∞ 0 pw ( t ) cw ( r ( t ) , d ) dt , where pw ( t ) = exp ( − ∫ t 0 σw ( r ( s ) ) ds ) · σw ( r ( t ) ) ( 4 ) In practice , the above equation is discretized by accumulating sampled points along the ray . Following NeRF ( Mildenhall et al. , 2020 ) , stratified and hierarchical sampling are applied for more accurate discrete approximation to the continuous implicit function . Challenges Compared to 2D generative models ( e.g. , StyleGANs ( Karras et al. , 2019 ; 2020b ) ) , the images generated by NeRF-based models have 3D consistency , which is guaranteed by modeling the image synthesis as a physics process , and the neural 3D scene representation is invariant across different viewpoints . However , the drawbacks are apparent : these models cost much more computation to render an image at the exact resolution . For example , 2D GANs are 100 ∼ 1000 times more efficient to generate a 10242 image than NeRF-based models . Furthermore , NeRF consumes much more memory to cache the intermediate results for gradient back-propagation during training , making it difficult to train on high-resolution images . Both of these restrict the scope of applying NeRF-based models in high-quality image synthesis , especially at the training stage when calculating the objective function over the whole image is crucial . 3.2 APPROXIMATION FOR HIGH-RESOLUTION IMAGE GENERATION . In this section , we propose how to improve the efficiency of StyleNeRF by taking inspiration from 2D GANs . We observe that the image generation of 2D GANs ( e.g. , StyleGANs ) is fast due to two main reasons : ( 1 ) each pixel only takes single forward pass through the network ; ( 2 ) image features are generated progressively from coarse to fine , and the feature maps with higher resolutions typically have a smaller number of channels to save memory . In StyleNeRF , the first point can be partially achieved by early aggregating the features into the 2D space before the final colors are computed . In this way , each pixel is assigned with a feature vector , Furthermore , it only needs to pass through a network once rather than calling the network multiple times for all sampled points on the ray as NeRF does . We approximate Equation ( 4 ) as : IApproxw ( r ) = ∫ ∞ 0 pw ( t ) · hc ◦ [ φncw ( r ( t ) ) , ζ ( d ) ] dt ≈ hc ◦ [ φnc , nσw ( A ( r ) ) , ζ ( d ) ] , ( 5 ) where φn , nσw ( A ( r ) ) = gnw ◦ gn−1w ◦ . . . ◦ gnσ+1w ◦ A ( r ) and A ( r ) = ∫∞ 0 pw ( t ) · φnσw ( r ( t ) ) dt . The definitions of A ( . ) and φn , nσw ( . ) can be extended to the operations on a set of rays , each ray processed independently . Next , instead of using volume rendering to render a high-resolution feature map directly , we can employ NeRF to generate a downsampled feature map at a low resolution and then employ upsampling in 2D space to progressively increase into the required high resolution . We take two adjacent resolutions as an example . Suppose RL ∈ RH/2×W/2 and RH ∈ RH×W are the corresponding rays of the pixels in the low- and high-resolution images , respectively . To approximate the high-resolution feature map , we can up-sample in the low-resolution feature space : φn , nσw ( A ( RH ) ) ≈ Upsample ( φn , nσw ( A ( RL ) ) ) ( 6 ) Recursively inserting Upsample operators enables efficient high-resolution image synthesis as the computationally expensive volume rendering only needs to generate a low-resolution feature map . The efficiency is further improved when using fewer channels for higher resolution . While early aggregation and upsampling operations can accelerate the rendering process for highresolution image synthesis , they would come with scarification to the inherent consistency of NeRF . There are two reasons why they introduce inconsistency . First , the resulting model contains nonlinear transformations to capture spurious correlations in 2D observation , mainly when substantial ambiguity exists . For example , our training data are unstructured single-view images without sufficient multi-view supervision . Second , such a pixel-space operation like up-sampling would compromise 3D consistency . Therefore , naı̈ve model designs would lead to severe multi-view inconsistent outputs ( e.g. , when moving the camera to render images , hairs are constantly changing ) . In the following , we propose several designs and choices to alleviate the inconsistency in the outputs .
The paper presented StyleNeRF, a 3D-aware generative model for high-resolution image synthesis with high multi-view consistency. StyleNeRF integrates the neural radiance field (NeRF) into a style-based generator to improve rendering efficiency and 3D consistency. It performs volume rendering only to produce a low-resolution feature map, and progressively applies upsampling in 2D. It also presents a new upsampling module and a new regularization loss to enforce 3D consistency.
SP:121fa4d034d563334ba12c898c706377957fabad
StyleNeRF: A Style-based 3D Aware Generator for High-resolution Image Synthesis
1 INTRODUCTION . Photo-realistic free-view image synthesis of real-world scenes is a long-standing problem in computer vision and computer graphics . Traditional graphics pipeline requires production-quality 3D models , computationally expensive rendering , and manual work , making it challenging to apply to large-scale image synthesis for a wide range of real-world scenes . In the meantime , Generative Adversarial Networks ( GANs , Goodfellow et al. , 2014 ) can be trained on a large number of unstructured images to synthesize high-quality images . However , most GAN models operate in 2D space and lack the 3D understanding of the training images , which results in their inability to synthesize images of the same scene with multi-view consistency and direct camera control . Natural images are the 2D projection of the 3D world . Hence , recent works on generative models ( Schwarz et al. , 2020 ; Chan et al. , 2021 ) enforce 3D structures by incorporating a neural radiance field ( NeRF , Mildenhall et al. , 2020 ) . However , these methods can not synthesize high-resolution images with delicate details due to the computationally expensive rendering process of NeRF . Furthermore , the slow rendering process leads to inefficient training and makes these models unsuitable for interactive applications . GIRAFFE ( Niemeyer & Geiger , 2021b ) combines NeRF with a CNN- based renderer , which has the potential to synthesize high-resolution images . However , this method falls short of 3D-consistent image generation and so far has not shown high-resolution results . We propose StyleNeRF , a new 3D-aware generative model for high-resolution 3D consistent image synthesis at interactive rates . It also allows control of the 3D camera pose and enables control of specific style attributes . StyleNeRF incorporates 3D scene representations into a style-based generative model . To prevent the expensive direct color image rendering from the original NeRF approach , we only use NeRF to produce a low-resolution feature map and upsample it progressively to high resolution . To improve 3D consistency , we propose several designs , including a desirable upsampler that achieves high consistency while mitigating artifacts in the outputs , a novel regularization term that forces the output to match the rendering result of the original NeRF and fixing the issues of view direction condition and noise injection . StyleNeRF is trained using unstructured real-world images . A progressive training strategy significantly improves the stability of learning real geometry . We evaluate StyleNeRF on various challenging datasets . StyleNeRF can synthesize photo-realistic 10242 images at interactive rates while achieving high multi-view consistency . None of the existing methods can achieve both characteristics . Additionally , StyleNeRF enables direct control on styles , and 3D camera poses even for the poses starkly different from training . 2 RELATED WORK . Neural Implicit Fields Representing 3D scenes as neural implicit fields has increasingly gained much attention . Michalkiewicz et al . ( 2019 ) ; Mescheder et al . ( 2019 ) ; Park et al . ( 2019 ) ; Peng et al . ( 2020 ) predict neural implicit fields with 3D supervision . Some of them ( Sitzmann et al. , 2019 ; Niemeyer et al. , 2019 ) assume that the ray color only lies on the geometry surface and propose differentiable renderers to learn a neural implicit surface representation . NeRF and and similar works ( Lombardi et al. , 2019 ; Mildenhall et al. , 2020 ; Liu et al. , 2020 ; Zhang et al. , 2020 ) utilize a volume rendering technique to render neural implicit volume representations for novel view synthesis . In this work , we focus on generative NeRF . Unlike the discussed methods , which require posed multi-view images , our approach only needs unstructured single-view images for training . Image Synthesis with GANs Starting from Goodfellow et al . ( 2014 ) , GANs have demonstrated high-quality results ( Durugkar et al. , 2017 ; Mordido et al. , 2018 ; Doan et al. , 2019 ; Zhang et al. , 2019 ; Brock et al. , 2018 ; Karras et al. , 2018 ) . StyleGANs ( Karras et al. , 2019 ; 2020b ) achieve SOTA quality and support different levels of style control . Karras et al . ( 2021 ) solve the “ texture sticking ” problem of 2D GANs in generating animations with 2D transformations . Some methods ( Härkönen et al. , 2020 ; Tewari et al. , 2020a ; Shen et al. , 2020 ; Abdal et al. , 2020 ; Tewari et al. , 2020b ; Leimkühler & Drettakis , 2021 ; Shoshan et al. , 2021 ) leverage disentangled properties in the latent space to enable explicit controls , most of which focus on faces . While these methods can synthesize face poses parameterized by two angles , extending them to general objects and controlling 3D cameras is not easy . Chen et al . ( 2021a ) proposed to generate segmentation maps from implicit fields to enable 3D control . However , it requires 3D meshes for pre-training . In contrast , our work can synthesize images for general objects , enabling explicit 3D camera control . 3D-Aware GANs Recently , 3D representations have been integrated into 2D generative models to enable camera control . Voxel-based GANs ( Henzler et al. , 2019 ; Nguyen-Phuoc et al. , 2019 ; 2020 ) lack fine details in the output due to resolution restriction . Radiance fields-based methods ( Schwarz et al. , 2020 ; Chan et al. , 2021 ; Niemeyer & Geiger , 2021a ) achieve higher quality but have difficulties in training on high-resolution images ( 5122 and beyond ) due to the expensive rendering process . GIRAFFE ( Niemeyer & Geiger , 2021b ) improves the training and rendering efficiency by combining NeRF with a CNN-based renderer ; GSN ( DeVries et al. , 2021 ) models a locally conditional NeRF with a similar renderer for unconstrained indoor scene generation . However , they both produce severe view-inconsistent artifacts due to their network designs ( e.g. , 3 × 3 Conv and upsampler ) . In contrast , our method can effectively preserve view consistency in image synthesis . 3 METHOD . 3.1 IMAGE SYNTHESIS AS NEURAL IMPLICIT FIELD RENDERING . Style-based Generative Neural Radiance Field We start by modeling a 3D scene as neural radiance field ( NeRF , Mildenhall et al. , 2020 ) . It is typically parameterized as multilayer perceptrons ( MLPs ) , which takes the position x ∈ R3 and viewing direction d ∈ S2 as input , and predicts the density σ ( x ) ∈ R+ and view-dependent color c ( x , d ) ∈ R3 . To model high-frequency details , follwing NeRF ( Mildenhall et al. , 2020 ) , we map each dimension of x and d with Fourier features : ζL ( x ) = [ sin ( 20x ) , cos ( 20x ) , . . . , sin ( 2L−1x ) , cos ( 2L−1x ) ] ( 1 ) We formalize StyleNeRF representations by conditioning NeRF with style vectors w as follows : φnw ( x ) = g n w ◦ gn−1w ◦ . . . ◦ g1w ◦ ζ ( x ) , where w = f ( z ) , z ∈ Z ( 2 ) Similar as StyleGAN2 ( Karras et al. , 2020b ) , f is a mapping network that maps noise vectors from the spherical Gaussian spaceZ to the style spaceW ; giw ( . ) is the ith layer MLP whose weight matrix is modulated by the input style vectorw . φnw ( x ) is the n-th layer feature of that point . We then use the extracted features to predict the density and color , respectively : σw ( x ) = hσ ◦ φnσw ( x ) , cw ( x , d ) = hc ◦ [ φncw ( x ) , ζ ( d ) ] , ( 3 ) where hσ and hc can be a linear projection or 2-layer MLPs . Different from the original NeRF , we assume nc > nσ for Equation ( 3 ) as the visual appearance generally needs more capacity to model than the geometry . The first min ( nσ , nc ) layers are shared in the network . Volume Rendering Image synthesis is modeled as volume rendering from a given camera pose p ∈ P . For simplicity , we assume a camera is located on the unit sphere pointing to the origin with a fixed field of view ( FOV ) . We sample the camera ’ s pitch & yaw from a uniform or Gaussian distribution . To render an image I ∈ RH×W×3 , we shoot a camera ray r ( t ) = o + td ( o is the camera origin ) for each pixel , and then calculate the color using the volume rendering equation : INeRFw ( r ) = ∫ ∞ 0 pw ( t ) cw ( r ( t ) , d ) dt , where pw ( t ) = exp ( − ∫ t 0 σw ( r ( s ) ) ds ) · σw ( r ( t ) ) ( 4 ) In practice , the above equation is discretized by accumulating sampled points along the ray . Following NeRF ( Mildenhall et al. , 2020 ) , stratified and hierarchical sampling are applied for more accurate discrete approximation to the continuous implicit function . Challenges Compared to 2D generative models ( e.g. , StyleGANs ( Karras et al. , 2019 ; 2020b ) ) , the images generated by NeRF-based models have 3D consistency , which is guaranteed by modeling the image synthesis as a physics process , and the neural 3D scene representation is invariant across different viewpoints . However , the drawbacks are apparent : these models cost much more computation to render an image at the exact resolution . For example , 2D GANs are 100 ∼ 1000 times more efficient to generate a 10242 image than NeRF-based models . Furthermore , NeRF consumes much more memory to cache the intermediate results for gradient back-propagation during training , making it difficult to train on high-resolution images . Both of these restrict the scope of applying NeRF-based models in high-quality image synthesis , especially at the training stage when calculating the objective function over the whole image is crucial . 3.2 APPROXIMATION FOR HIGH-RESOLUTION IMAGE GENERATION . In this section , we propose how to improve the efficiency of StyleNeRF by taking inspiration from 2D GANs . We observe that the image generation of 2D GANs ( e.g. , StyleGANs ) is fast due to two main reasons : ( 1 ) each pixel only takes single forward pass through the network ; ( 2 ) image features are generated progressively from coarse to fine , and the feature maps with higher resolutions typically have a smaller number of channels to save memory . In StyleNeRF , the first point can be partially achieved by early aggregating the features into the 2D space before the final colors are computed . In this way , each pixel is assigned with a feature vector , Furthermore , it only needs to pass through a network once rather than calling the network multiple times for all sampled points on the ray as NeRF does . We approximate Equation ( 4 ) as : IApproxw ( r ) = ∫ ∞ 0 pw ( t ) · hc ◦ [ φncw ( r ( t ) ) , ζ ( d ) ] dt ≈ hc ◦ [ φnc , nσw ( A ( r ) ) , ζ ( d ) ] , ( 5 ) where φn , nσw ( A ( r ) ) = gnw ◦ gn−1w ◦ . . . ◦ gnσ+1w ◦ A ( r ) and A ( r ) = ∫∞ 0 pw ( t ) · φnσw ( r ( t ) ) dt . The definitions of A ( . ) and φn , nσw ( . ) can be extended to the operations on a set of rays , each ray processed independently . Next , instead of using volume rendering to render a high-resolution feature map directly , we can employ NeRF to generate a downsampled feature map at a low resolution and then employ upsampling in 2D space to progressively increase into the required high resolution . We take two adjacent resolutions as an example . Suppose RL ∈ RH/2×W/2 and RH ∈ RH×W are the corresponding rays of the pixels in the low- and high-resolution images , respectively . To approximate the high-resolution feature map , we can up-sample in the low-resolution feature space : φn , nσw ( A ( RH ) ) ≈ Upsample ( φn , nσw ( A ( RL ) ) ) ( 6 ) Recursively inserting Upsample operators enables efficient high-resolution image synthesis as the computationally expensive volume rendering only needs to generate a low-resolution feature map . The efficiency is further improved when using fewer channels for higher resolution . While early aggregation and upsampling operations can accelerate the rendering process for highresolution image synthesis , they would come with scarification to the inherent consistency of NeRF . There are two reasons why they introduce inconsistency . First , the resulting model contains nonlinear transformations to capture spurious correlations in 2D observation , mainly when substantial ambiguity exists . For example , our training data are unstructured single-view images without sufficient multi-view supervision . Second , such a pixel-space operation like up-sampling would compromise 3D consistency . Therefore , naı̈ve model designs would lead to severe multi-view inconsistent outputs ( e.g. , when moving the camera to render images , hairs are constantly changing ) . In the following , we propose several designs and choices to alleviate the inconsistency in the outputs .
This paper proposes StyleNeRF which combines NeRF and a style-based generator to improve rendering efficiency and 3D consistency in high-resolution image synthesis. In this paper, (1) The NeRF is used to produce a low-resolution feature map and upsample it progressively to high resolution. (2) Several designs are proposed to improve 3D consistency, including a desirable upsampler, a novel regularization term. (3) A progressive training strategy is adopted to significantly improves the stability of learning the real geometry.
SP:121fa4d034d563334ba12c898c706377957fabad
Improved Generalization Bound for Deep Neural Networks Using Geometric Functional Analysis
1 INTRODUCTION . The problem of generalization of deep neural networks from the perspective of theoretical analysis has recently received a considerable amount of interest ( Neyshabur et al. , 2015 ; Zhang et al. , 2017 ; Dziugaite & Roy , 2017 ; Neyshabur et al. , 2018 ; Golowich et al. , 2018 ; Nagarajan & Kolter , 2018 ; Daniely & Granot , 2019 ) . More specifically , most of the state-of-the-art bound are based on spectral norm based generalization bounds and have shown to give tighter and sharper bounds compared to conventional ones leveraging PAC Bayesian theory ( Bartlett et al. , 2017 ; Neyshabur et al. , 2015 ; 2018 ) . However , the bounds in such works are quite limited as they only apply in cases where the parameters are drawn from a distribution or when they are represented by fewer bits than required ( Nagarajan & Kolter , 2018 ) . In this paper , we provide a novel framework based on the foundational mathematics of geometric functional analysis to obtain a sharp bound . We show that this analysis has many advantages over the conventional conceptions which solely rely on stochastic assumptions ignoring the geometric structure of the neural networks and to the best of our knowledge this is the first work attempts to foray in this direction . We compare our result with that of Neyshabur et al . to show that our bound is better than the bounds derived using spectral norms . Geometric functional analysis deals with infinite dimensional vector spaces from a geometric perspective ( Holmes , 2012 ) , of its many applications it is widely in the theoretical analysis of wavelet theory ( Young , 2012 ) . In fact we believe this is the most suited framework for dealing with deep neural networks , as their parameters are generally huge and any frame work that is finite will not cover all possible models . Specifically , our approach involves using the covering number of a vector space to derive a bound for the generalization error of a given neural network . However , computing the covering number of a high dimensional vector space becomes an intractable problem as the size of the input space becomes sufficiently large . Thus , we make use of the Vitushkin ’ s inequality ( Friedland & Yomdin , 2014 ) to bound the covering numbers using the Lesbesgue measure , which is a tractable quantity . This bound along with functional inequalities forms the groundwork by which we extend it generalization problem of neural networks which also takes into account the geometry of the data input . Another by product of the analysis is that the bound obtained is in terms of the Frobenius norm of the weight matrices rather than its spectral norm , which has shown to scale more rapidly with the size of the matrix ( Vershynin , 2011 ) . We approach the neural network in a rather unorthodox manner by treating it as a recurrent polynomial function which can be approximated to some arbitrary degree ( Telgarsky , 2017 ) , as it is the most amicable framework for exploiting its geometric properties . We explain this in detail in the following sections along with other mathematical preliminaries . This is followed by several intermediate theorems , which are then used to derive our generalization bound . 2 RELATED WORK . The concept of generalization bounds were introduced in ( Bartlett , 1998 ) rather indirectly by analyzing the probability of misclassification . ( Zhang et al. , 2017 ) showed that uniform convergence over data points is what is required to understand the generalization of networks . Dziugaite & Roy ( 2017 ) obtained non vacuous bounds . ( Neyshabur et al. , 2017 ) compared the effect of norm based control , sharpness and robustness on generalization . ( Neyshabur et al. , 2018 ) used spectral norm to give a bound which incorporated the weights of the neural networks . ( Arora et al. , 2018 ) obtained sharp generalization bounds in terms of sample complexity . ( Bietti et al. , 2019 ) used Reproducible kernel Hilbert spaces for studying regularization of deep neural network from analytic viewpoint . 3 MATHEMATICAL PRELIMINARIES . 3.1 POLYNOMIAL FRAMEWORK OF NEURAL NETWORKS . Consider the mathematical formulation of Neural Networks , a neural network N with l layers is a function which takes an input vector x and returns a vector N ( x ) such that : N ( x ) = fl ( Wl . . . f2 ( W2f1 ( W1x ) ) . . . ) ( 1 ) where Wi is the weight matrix of network at layer ith layer , fi is the corresponding non-linear activation function . If xl = [ x1l . . . x nl l ] is the output of the l th layer with nl nodes , then : xl = gl ( Wlxl−1 ) ( 2 ) As mentioned earlier if the activation functions are approximated using polynomials then mathematically there are only polynomials at each node at every layer in the network , so in our analysis we consider the activation functions as polynomials with certain degrees . Let a ( l−1 , l ) ij be the weight of the neural network from the ith node in l − 1th layer to the jth node in the lth layer and Pl be the Polynomial approximation of the activation function . Then based on the above mathematical description of neural networks the output at 2nd layer with n2 nodes is x2 = [ P1 ( n1∑ i=1 a ( 1,2 ) i1 x i 1 ) , P1 ( n1∑ i=1 a ( 1,2 ) i2 x i 1 ) , . . . , P1 ( n1∑ i=1 a ( 1,2 ) in2 xi1 ) ] ( 3 ) Similarly for the 3rd layer , x3 can be obtained as x3 = [ P2 n2∑ j=1 a ( 2,3 ) j1 P1 ( n1∑ i=1 a ( 1,2 ) i1 x i 1 ) , P2 n2∑ j=1 a ( 2,3 ) j2 P1 ( n1∑ i=1 a ( 1,2 ) i2 x i 1 ) , . . . , P2 n2∑ j=1 a ( 2,3 ) jn3 P1 ( n1∑ i=1 a ( 1,2 ) in2 xi1 ) ] ( 4 ) Clearly , by standard properties of polynomials the above tuple is also a polynomial . Now , if we look into the pattern followed by each layer then the general form of the output at any arbitrary lth layer can be obtained as xl = [ Pl−1 nl−1∑ j=1 a ( l−1 , l ) j1 Pl−2 ( nl−2∑ i=1 a ( l−2 , l−1 ) i1 x i l−2 ) , Pl−1 nl−1∑ j=1 a ( l−1 , l ) j2 Pl−2 ( nl−2∑ i=1 a ( l−2 , l−1 ) i2 x i l−2 ) , . . . , Pl−1 nl−1∑ j=1 a ( l−1 , l ) jnl Pl−2 ( nl−2∑ i=1 a ( l−2 , l−1 ) inl−1 xil−2 ) ] ( 5 ) By the same logic applied hitherto the above tuple is also a polynomial . The reason for such an unconventional formulation of a neural network as in the above framework is to analyze the degree of the polynomials using some of its basic properties . Regarding degree of polynomials we have the following standard results : For any c1 , c2 , . . . ck ∈ R and polynomials P1 , P2 , . . . Pk deg ( c1P1 + . . .+ ckPk ) ≤ sup i= { 1 , ... , k } |deg ( Pi ) | ( 6 ) where deg ( . ) is the degree of the polynomial and for any polynomial Pa and Pb deg ( PaPb ) = deg ( Pa ) deg ( Pb ) ( 7 ) By applying equation ( 7 ) on the first element of the vector xl from equation ( 5 ) we get deg Pl−1 nl−1∑ j=1 a ( l−1 , l ) j1 Pl−2 ( nl−2∑ i=1 a ( l−2 , l−1 ) i1 x i l−2 ) = deg ( Pl−1 ) deg nl−1∑ j=1 a ( l−1 , l ) j1 Pl−2 ( nl−2∑ i=1 a ( l−2 , l−1 ) i1 x i l−2 ) ( 8 ) Similarly , by applying equation ( 6 ) on equation ( 8 ) we obtain deg ( Pl−1 ) deg nl−1∑ j=1 a ( l−1 , l ) j1 Pl−2 ( nl−2∑ i=1 a ( l−2 , l−1 ) i1 x i l−2 ) ≤ deg ( Pl−1 ) |deg ( Pl−2 ) | ( 9 ) By iterating over all the layers in the network and applying equation ( 9 ) we get deg ( Pl ) ≤ deg ( Pl−1 ) deg ( Pl−2 ) . . . deg ( P1 ) ( 10 ) We make use of the above inequality in the next sections in obtaining the generalization bound . 3.2 COVERING NUMBER . Covering number of a general topological space counts the number of spherical balls needed to cover the entire space ( Munkres , 2000 ) . This is relevant to our present analysis as it gleans the behaviour of a neural network on an unknown set by understanding its behaviour on a known one . Formally , M ( , V ) is the covering number of the space V , conceptually this gives a measure of generalizability of the neural network on potentially infinite and unknown datapoints when trained on a finite subset ( i.e . the training dataset ) . Thus , any bound on the covering number would imply that we can predict the lower limit of the number of datapoints essential for accurate prediction on unknown sets . 3.3 VITUSHKIN ’ S INEQUALITY . The Vitushkin ’ s inequality ( Friedland & Yomdin , 2014 ; Yomdin , 2011 ) has been widely used in geometric functional analysis for studying the behaviour of level sets of analytic functions ( Kovalenko , 2017 ) . Along with its many applications this inequality can be used to bound the covering number of a metric space V using the lesbesgue measure ( Burk , 2011 ; Bartle , 2014 ) . Formally , let P ( x , n , d ) = P ( x1 , x2 , . . . , xn ) be a polynomial of degree d in n variables , Bn be a ball of unit radius in n-dimensions and Vρ ( P ) be the set of all polynomials that is bounded by ρ , i.e . : Vρ ( P ) = { x ∈ Bn : |P ( x , n , d ) | ≤ ρ } ( 11 ) Then according to Vitushkin ’ s inequality : M ( , V ) ≤ n−1∑ i=0 Ci ( n , d ) ( 1 ) i + µn ( V ) ( 1 ) n ≤Md ( ) + µn ( V ) ( 1 ) n ( 12 ) where µn ( V ) is the n-dimensional Lesbesgue measure ( Bartle , 2014 ) of the set and Md ( ) are variables defined as : Ci ( n , d ) , 2 i ( n i ) ( d− i ) i Md ( ) , n−1∑ i=0 Ci ( n , d ) ( 1 ) i ( 13 ) 3.4 METRIC ( N , D ) -SPAN . Metric ( n , d ) -span measures the accuracy of approximation of the covering number with Lesbesgue measure , that is to say it determines how well the covering number can be approximated by knowing the Lesbesgue measure of that set . This transforms the intractable problem of computing the covering number of the set V into a tractable one , this is extremely important as this quantifies the accuracy of computational experiments to that of theoretical expressions . More formally , for any subset Z ⊂ Bn , we define a constant ωd ( Z ) which is the metric ( n , d ) -span of set Z denoted by : ωd ( Z ) = sup ≥0 n [ M ( , Z ) −Md ( ) ] ( 14 )
The paper considers the problem of obtaining generalization bounds for deep neural networks. The paper uses tools from geometric function analysis to derive bounds for the covering number of neural networks, and derive generalization bounds using the covering numbers. The main strength of the bound as claimed by the paper is that they depend on Frobenius norm rather than the spectral norm, but I have several concerns about the results.
SP:bacb5a7dd0580560f255a67e73d15baa92d7934c
Improved Generalization Bound for Deep Neural Networks Using Geometric Functional Analysis
1 INTRODUCTION . The problem of generalization of deep neural networks from the perspective of theoretical analysis has recently received a considerable amount of interest ( Neyshabur et al. , 2015 ; Zhang et al. , 2017 ; Dziugaite & Roy , 2017 ; Neyshabur et al. , 2018 ; Golowich et al. , 2018 ; Nagarajan & Kolter , 2018 ; Daniely & Granot , 2019 ) . More specifically , most of the state-of-the-art bound are based on spectral norm based generalization bounds and have shown to give tighter and sharper bounds compared to conventional ones leveraging PAC Bayesian theory ( Bartlett et al. , 2017 ; Neyshabur et al. , 2015 ; 2018 ) . However , the bounds in such works are quite limited as they only apply in cases where the parameters are drawn from a distribution or when they are represented by fewer bits than required ( Nagarajan & Kolter , 2018 ) . In this paper , we provide a novel framework based on the foundational mathematics of geometric functional analysis to obtain a sharp bound . We show that this analysis has many advantages over the conventional conceptions which solely rely on stochastic assumptions ignoring the geometric structure of the neural networks and to the best of our knowledge this is the first work attempts to foray in this direction . We compare our result with that of Neyshabur et al . to show that our bound is better than the bounds derived using spectral norms . Geometric functional analysis deals with infinite dimensional vector spaces from a geometric perspective ( Holmes , 2012 ) , of its many applications it is widely in the theoretical analysis of wavelet theory ( Young , 2012 ) . In fact we believe this is the most suited framework for dealing with deep neural networks , as their parameters are generally huge and any frame work that is finite will not cover all possible models . Specifically , our approach involves using the covering number of a vector space to derive a bound for the generalization error of a given neural network . However , computing the covering number of a high dimensional vector space becomes an intractable problem as the size of the input space becomes sufficiently large . Thus , we make use of the Vitushkin ’ s inequality ( Friedland & Yomdin , 2014 ) to bound the covering numbers using the Lesbesgue measure , which is a tractable quantity . This bound along with functional inequalities forms the groundwork by which we extend it generalization problem of neural networks which also takes into account the geometry of the data input . Another by product of the analysis is that the bound obtained is in terms of the Frobenius norm of the weight matrices rather than its spectral norm , which has shown to scale more rapidly with the size of the matrix ( Vershynin , 2011 ) . We approach the neural network in a rather unorthodox manner by treating it as a recurrent polynomial function which can be approximated to some arbitrary degree ( Telgarsky , 2017 ) , as it is the most amicable framework for exploiting its geometric properties . We explain this in detail in the following sections along with other mathematical preliminaries . This is followed by several intermediate theorems , which are then used to derive our generalization bound . 2 RELATED WORK . The concept of generalization bounds were introduced in ( Bartlett , 1998 ) rather indirectly by analyzing the probability of misclassification . ( Zhang et al. , 2017 ) showed that uniform convergence over data points is what is required to understand the generalization of networks . Dziugaite & Roy ( 2017 ) obtained non vacuous bounds . ( Neyshabur et al. , 2017 ) compared the effect of norm based control , sharpness and robustness on generalization . ( Neyshabur et al. , 2018 ) used spectral norm to give a bound which incorporated the weights of the neural networks . ( Arora et al. , 2018 ) obtained sharp generalization bounds in terms of sample complexity . ( Bietti et al. , 2019 ) used Reproducible kernel Hilbert spaces for studying regularization of deep neural network from analytic viewpoint . 3 MATHEMATICAL PRELIMINARIES . 3.1 POLYNOMIAL FRAMEWORK OF NEURAL NETWORKS . Consider the mathematical formulation of Neural Networks , a neural network N with l layers is a function which takes an input vector x and returns a vector N ( x ) such that : N ( x ) = fl ( Wl . . . f2 ( W2f1 ( W1x ) ) . . . ) ( 1 ) where Wi is the weight matrix of network at layer ith layer , fi is the corresponding non-linear activation function . If xl = [ x1l . . . x nl l ] is the output of the l th layer with nl nodes , then : xl = gl ( Wlxl−1 ) ( 2 ) As mentioned earlier if the activation functions are approximated using polynomials then mathematically there are only polynomials at each node at every layer in the network , so in our analysis we consider the activation functions as polynomials with certain degrees . Let a ( l−1 , l ) ij be the weight of the neural network from the ith node in l − 1th layer to the jth node in the lth layer and Pl be the Polynomial approximation of the activation function . Then based on the above mathematical description of neural networks the output at 2nd layer with n2 nodes is x2 = [ P1 ( n1∑ i=1 a ( 1,2 ) i1 x i 1 ) , P1 ( n1∑ i=1 a ( 1,2 ) i2 x i 1 ) , . . . , P1 ( n1∑ i=1 a ( 1,2 ) in2 xi1 ) ] ( 3 ) Similarly for the 3rd layer , x3 can be obtained as x3 = [ P2 n2∑ j=1 a ( 2,3 ) j1 P1 ( n1∑ i=1 a ( 1,2 ) i1 x i 1 ) , P2 n2∑ j=1 a ( 2,3 ) j2 P1 ( n1∑ i=1 a ( 1,2 ) i2 x i 1 ) , . . . , P2 n2∑ j=1 a ( 2,3 ) jn3 P1 ( n1∑ i=1 a ( 1,2 ) in2 xi1 ) ] ( 4 ) Clearly , by standard properties of polynomials the above tuple is also a polynomial . Now , if we look into the pattern followed by each layer then the general form of the output at any arbitrary lth layer can be obtained as xl = [ Pl−1 nl−1∑ j=1 a ( l−1 , l ) j1 Pl−2 ( nl−2∑ i=1 a ( l−2 , l−1 ) i1 x i l−2 ) , Pl−1 nl−1∑ j=1 a ( l−1 , l ) j2 Pl−2 ( nl−2∑ i=1 a ( l−2 , l−1 ) i2 x i l−2 ) , . . . , Pl−1 nl−1∑ j=1 a ( l−1 , l ) jnl Pl−2 ( nl−2∑ i=1 a ( l−2 , l−1 ) inl−1 xil−2 ) ] ( 5 ) By the same logic applied hitherto the above tuple is also a polynomial . The reason for such an unconventional formulation of a neural network as in the above framework is to analyze the degree of the polynomials using some of its basic properties . Regarding degree of polynomials we have the following standard results : For any c1 , c2 , . . . ck ∈ R and polynomials P1 , P2 , . . . Pk deg ( c1P1 + . . .+ ckPk ) ≤ sup i= { 1 , ... , k } |deg ( Pi ) | ( 6 ) where deg ( . ) is the degree of the polynomial and for any polynomial Pa and Pb deg ( PaPb ) = deg ( Pa ) deg ( Pb ) ( 7 ) By applying equation ( 7 ) on the first element of the vector xl from equation ( 5 ) we get deg Pl−1 nl−1∑ j=1 a ( l−1 , l ) j1 Pl−2 ( nl−2∑ i=1 a ( l−2 , l−1 ) i1 x i l−2 ) = deg ( Pl−1 ) deg nl−1∑ j=1 a ( l−1 , l ) j1 Pl−2 ( nl−2∑ i=1 a ( l−2 , l−1 ) i1 x i l−2 ) ( 8 ) Similarly , by applying equation ( 6 ) on equation ( 8 ) we obtain deg ( Pl−1 ) deg nl−1∑ j=1 a ( l−1 , l ) j1 Pl−2 ( nl−2∑ i=1 a ( l−2 , l−1 ) i1 x i l−2 ) ≤ deg ( Pl−1 ) |deg ( Pl−2 ) | ( 9 ) By iterating over all the layers in the network and applying equation ( 9 ) we get deg ( Pl ) ≤ deg ( Pl−1 ) deg ( Pl−2 ) . . . deg ( P1 ) ( 10 ) We make use of the above inequality in the next sections in obtaining the generalization bound . 3.2 COVERING NUMBER . Covering number of a general topological space counts the number of spherical balls needed to cover the entire space ( Munkres , 2000 ) . This is relevant to our present analysis as it gleans the behaviour of a neural network on an unknown set by understanding its behaviour on a known one . Formally , M ( , V ) is the covering number of the space V , conceptually this gives a measure of generalizability of the neural network on potentially infinite and unknown datapoints when trained on a finite subset ( i.e . the training dataset ) . Thus , any bound on the covering number would imply that we can predict the lower limit of the number of datapoints essential for accurate prediction on unknown sets . 3.3 VITUSHKIN ’ S INEQUALITY . The Vitushkin ’ s inequality ( Friedland & Yomdin , 2014 ; Yomdin , 2011 ) has been widely used in geometric functional analysis for studying the behaviour of level sets of analytic functions ( Kovalenko , 2017 ) . Along with its many applications this inequality can be used to bound the covering number of a metric space V using the lesbesgue measure ( Burk , 2011 ; Bartle , 2014 ) . Formally , let P ( x , n , d ) = P ( x1 , x2 , . . . , xn ) be a polynomial of degree d in n variables , Bn be a ball of unit radius in n-dimensions and Vρ ( P ) be the set of all polynomials that is bounded by ρ , i.e . : Vρ ( P ) = { x ∈ Bn : |P ( x , n , d ) | ≤ ρ } ( 11 ) Then according to Vitushkin ’ s inequality : M ( , V ) ≤ n−1∑ i=0 Ci ( n , d ) ( 1 ) i + µn ( V ) ( 1 ) n ≤Md ( ) + µn ( V ) ( 1 ) n ( 12 ) where µn ( V ) is the n-dimensional Lesbesgue measure ( Bartle , 2014 ) of the set and Md ( ) are variables defined as : Ci ( n , d ) , 2 i ( n i ) ( d− i ) i Md ( ) , n−1∑ i=0 Ci ( n , d ) ( 1 ) i ( 13 ) 3.4 METRIC ( N , D ) -SPAN . Metric ( n , d ) -span measures the accuracy of approximation of the covering number with Lesbesgue measure , that is to say it determines how well the covering number can be approximated by knowing the Lesbesgue measure of that set . This transforms the intractable problem of computing the covering number of the set V into a tractable one , this is extremely important as this quantifies the accuracy of computational experiments to that of theoretical expressions . More formally , for any subset Z ⊂ Bn , we define a constant ωd ( Z ) which is the metric ( n , d ) -span of set Z denoted by : ωd ( Z ) = sup ≥0 n [ M ( , Z ) −Md ( ) ] ( 14 )
This paper aims at proving generalization bound via geometric functional analysis. Although the topic is interesting, this paper suffers from an unclear organization and there are some unclear points in the proof (see the following for more details). Therefore, I tend to give a "reject" and I hope the authors can provide more explanations for the theorems and carefully polish the writing in the next version.
SP:bacb5a7dd0580560f255a67e73d15baa92d7934c
Improved Generalization Bound for Deep Neural Networks Using Geometric Functional Analysis
1 INTRODUCTION . The problem of generalization of deep neural networks from the perspective of theoretical analysis has recently received a considerable amount of interest ( Neyshabur et al. , 2015 ; Zhang et al. , 2017 ; Dziugaite & Roy , 2017 ; Neyshabur et al. , 2018 ; Golowich et al. , 2018 ; Nagarajan & Kolter , 2018 ; Daniely & Granot , 2019 ) . More specifically , most of the state-of-the-art bound are based on spectral norm based generalization bounds and have shown to give tighter and sharper bounds compared to conventional ones leveraging PAC Bayesian theory ( Bartlett et al. , 2017 ; Neyshabur et al. , 2015 ; 2018 ) . However , the bounds in such works are quite limited as they only apply in cases where the parameters are drawn from a distribution or when they are represented by fewer bits than required ( Nagarajan & Kolter , 2018 ) . In this paper , we provide a novel framework based on the foundational mathematics of geometric functional analysis to obtain a sharp bound . We show that this analysis has many advantages over the conventional conceptions which solely rely on stochastic assumptions ignoring the geometric structure of the neural networks and to the best of our knowledge this is the first work attempts to foray in this direction . We compare our result with that of Neyshabur et al . to show that our bound is better than the bounds derived using spectral norms . Geometric functional analysis deals with infinite dimensional vector spaces from a geometric perspective ( Holmes , 2012 ) , of its many applications it is widely in the theoretical analysis of wavelet theory ( Young , 2012 ) . In fact we believe this is the most suited framework for dealing with deep neural networks , as their parameters are generally huge and any frame work that is finite will not cover all possible models . Specifically , our approach involves using the covering number of a vector space to derive a bound for the generalization error of a given neural network . However , computing the covering number of a high dimensional vector space becomes an intractable problem as the size of the input space becomes sufficiently large . Thus , we make use of the Vitushkin ’ s inequality ( Friedland & Yomdin , 2014 ) to bound the covering numbers using the Lesbesgue measure , which is a tractable quantity . This bound along with functional inequalities forms the groundwork by which we extend it generalization problem of neural networks which also takes into account the geometry of the data input . Another by product of the analysis is that the bound obtained is in terms of the Frobenius norm of the weight matrices rather than its spectral norm , which has shown to scale more rapidly with the size of the matrix ( Vershynin , 2011 ) . We approach the neural network in a rather unorthodox manner by treating it as a recurrent polynomial function which can be approximated to some arbitrary degree ( Telgarsky , 2017 ) , as it is the most amicable framework for exploiting its geometric properties . We explain this in detail in the following sections along with other mathematical preliminaries . This is followed by several intermediate theorems , which are then used to derive our generalization bound . 2 RELATED WORK . The concept of generalization bounds were introduced in ( Bartlett , 1998 ) rather indirectly by analyzing the probability of misclassification . ( Zhang et al. , 2017 ) showed that uniform convergence over data points is what is required to understand the generalization of networks . Dziugaite & Roy ( 2017 ) obtained non vacuous bounds . ( Neyshabur et al. , 2017 ) compared the effect of norm based control , sharpness and robustness on generalization . ( Neyshabur et al. , 2018 ) used spectral norm to give a bound which incorporated the weights of the neural networks . ( Arora et al. , 2018 ) obtained sharp generalization bounds in terms of sample complexity . ( Bietti et al. , 2019 ) used Reproducible kernel Hilbert spaces for studying regularization of deep neural network from analytic viewpoint . 3 MATHEMATICAL PRELIMINARIES . 3.1 POLYNOMIAL FRAMEWORK OF NEURAL NETWORKS . Consider the mathematical formulation of Neural Networks , a neural network N with l layers is a function which takes an input vector x and returns a vector N ( x ) such that : N ( x ) = fl ( Wl . . . f2 ( W2f1 ( W1x ) ) . . . ) ( 1 ) where Wi is the weight matrix of network at layer ith layer , fi is the corresponding non-linear activation function . If xl = [ x1l . . . x nl l ] is the output of the l th layer with nl nodes , then : xl = gl ( Wlxl−1 ) ( 2 ) As mentioned earlier if the activation functions are approximated using polynomials then mathematically there are only polynomials at each node at every layer in the network , so in our analysis we consider the activation functions as polynomials with certain degrees . Let a ( l−1 , l ) ij be the weight of the neural network from the ith node in l − 1th layer to the jth node in the lth layer and Pl be the Polynomial approximation of the activation function . Then based on the above mathematical description of neural networks the output at 2nd layer with n2 nodes is x2 = [ P1 ( n1∑ i=1 a ( 1,2 ) i1 x i 1 ) , P1 ( n1∑ i=1 a ( 1,2 ) i2 x i 1 ) , . . . , P1 ( n1∑ i=1 a ( 1,2 ) in2 xi1 ) ] ( 3 ) Similarly for the 3rd layer , x3 can be obtained as x3 = [ P2 n2∑ j=1 a ( 2,3 ) j1 P1 ( n1∑ i=1 a ( 1,2 ) i1 x i 1 ) , P2 n2∑ j=1 a ( 2,3 ) j2 P1 ( n1∑ i=1 a ( 1,2 ) i2 x i 1 ) , . . . , P2 n2∑ j=1 a ( 2,3 ) jn3 P1 ( n1∑ i=1 a ( 1,2 ) in2 xi1 ) ] ( 4 ) Clearly , by standard properties of polynomials the above tuple is also a polynomial . Now , if we look into the pattern followed by each layer then the general form of the output at any arbitrary lth layer can be obtained as xl = [ Pl−1 nl−1∑ j=1 a ( l−1 , l ) j1 Pl−2 ( nl−2∑ i=1 a ( l−2 , l−1 ) i1 x i l−2 ) , Pl−1 nl−1∑ j=1 a ( l−1 , l ) j2 Pl−2 ( nl−2∑ i=1 a ( l−2 , l−1 ) i2 x i l−2 ) , . . . , Pl−1 nl−1∑ j=1 a ( l−1 , l ) jnl Pl−2 ( nl−2∑ i=1 a ( l−2 , l−1 ) inl−1 xil−2 ) ] ( 5 ) By the same logic applied hitherto the above tuple is also a polynomial . The reason for such an unconventional formulation of a neural network as in the above framework is to analyze the degree of the polynomials using some of its basic properties . Regarding degree of polynomials we have the following standard results : For any c1 , c2 , . . . ck ∈ R and polynomials P1 , P2 , . . . Pk deg ( c1P1 + . . .+ ckPk ) ≤ sup i= { 1 , ... , k } |deg ( Pi ) | ( 6 ) where deg ( . ) is the degree of the polynomial and for any polynomial Pa and Pb deg ( PaPb ) = deg ( Pa ) deg ( Pb ) ( 7 ) By applying equation ( 7 ) on the first element of the vector xl from equation ( 5 ) we get deg Pl−1 nl−1∑ j=1 a ( l−1 , l ) j1 Pl−2 ( nl−2∑ i=1 a ( l−2 , l−1 ) i1 x i l−2 ) = deg ( Pl−1 ) deg nl−1∑ j=1 a ( l−1 , l ) j1 Pl−2 ( nl−2∑ i=1 a ( l−2 , l−1 ) i1 x i l−2 ) ( 8 ) Similarly , by applying equation ( 6 ) on equation ( 8 ) we obtain deg ( Pl−1 ) deg nl−1∑ j=1 a ( l−1 , l ) j1 Pl−2 ( nl−2∑ i=1 a ( l−2 , l−1 ) i1 x i l−2 ) ≤ deg ( Pl−1 ) |deg ( Pl−2 ) | ( 9 ) By iterating over all the layers in the network and applying equation ( 9 ) we get deg ( Pl ) ≤ deg ( Pl−1 ) deg ( Pl−2 ) . . . deg ( P1 ) ( 10 ) We make use of the above inequality in the next sections in obtaining the generalization bound . 3.2 COVERING NUMBER . Covering number of a general topological space counts the number of spherical balls needed to cover the entire space ( Munkres , 2000 ) . This is relevant to our present analysis as it gleans the behaviour of a neural network on an unknown set by understanding its behaviour on a known one . Formally , M ( , V ) is the covering number of the space V , conceptually this gives a measure of generalizability of the neural network on potentially infinite and unknown datapoints when trained on a finite subset ( i.e . the training dataset ) . Thus , any bound on the covering number would imply that we can predict the lower limit of the number of datapoints essential for accurate prediction on unknown sets . 3.3 VITUSHKIN ’ S INEQUALITY . The Vitushkin ’ s inequality ( Friedland & Yomdin , 2014 ; Yomdin , 2011 ) has been widely used in geometric functional analysis for studying the behaviour of level sets of analytic functions ( Kovalenko , 2017 ) . Along with its many applications this inequality can be used to bound the covering number of a metric space V using the lesbesgue measure ( Burk , 2011 ; Bartle , 2014 ) . Formally , let P ( x , n , d ) = P ( x1 , x2 , . . . , xn ) be a polynomial of degree d in n variables , Bn be a ball of unit radius in n-dimensions and Vρ ( P ) be the set of all polynomials that is bounded by ρ , i.e . : Vρ ( P ) = { x ∈ Bn : |P ( x , n , d ) | ≤ ρ } ( 11 ) Then according to Vitushkin ’ s inequality : M ( , V ) ≤ n−1∑ i=0 Ci ( n , d ) ( 1 ) i + µn ( V ) ( 1 ) n ≤Md ( ) + µn ( V ) ( 1 ) n ( 12 ) where µn ( V ) is the n-dimensional Lesbesgue measure ( Bartle , 2014 ) of the set and Md ( ) are variables defined as : Ci ( n , d ) , 2 i ( n i ) ( d− i ) i Md ( ) , n−1∑ i=0 Ci ( n , d ) ( 1 ) i ( 13 ) 3.4 METRIC ( N , D ) -SPAN . Metric ( n , d ) -span measures the accuracy of approximation of the covering number with Lesbesgue measure , that is to say it determines how well the covering number can be approximated by knowing the Lesbesgue measure of that set . This transforms the intractable problem of computing the covering number of the set V into a tractable one , this is extremely important as this quantifies the accuracy of computational experiments to that of theoretical expressions . More formally , for any subset Z ⊂ Bn , we define a constant ωd ( Z ) which is the metric ( n , d ) -span of set Z denoted by : ωd ( Z ) = sup ≥0 n [ M ( , Z ) −Md ( ) ] ( 14 )
The authors study the generalization bound of neural networks. First, They assume that the activation functions as polynomials with certain degrees. Under this assumption, they prove a novel generalization bound using geometric functional analysis. The authors also compared their bounds with the method in (Neyshabur et al., 2018), showing that their bounds are better.
SP:bacb5a7dd0580560f255a67e73d15baa92d7934c
The Low-Rank Simplicity Bias in Deep Networks
1 INTRODUCTION . It has become conventional wisdom that the more layers one adds , the better a deep neural network ( DNN ) performs . This guideline is supported , in part , by theoretical results showing that deeper networks can require far fewer parameters than shallower networks to obtain the same modeling “ capacity ” ( Eldan & Shamir ( 2016 ) ) . While it is not surprising that deeper networks are more expressive than shallower networks , the fact that state-of-the-art deep networks do not overfit , despite being heavily over-parameterized1 , defies classical statistical theory ( Geman et al . ( 1992 ) ; Zhang et al . ( 2017 ) ; Belkin et al . ( 2019 ) ) . The belief that over-parameterization via depth improves generalization is used axiomatically in the design of neural networks . Unlike conventional regularization methods that penalize model complexity ( e.g. , ` 1/ ` 2 penalty ) , over-parameterization does not . Yet , like explicit regularization , over-parameterization appears to prevent the model from over-fitting ( Belkin et al . ( 2018 ) ; Nakkiran et al . ( 2019a ) ) . Why this implicit regularization works is still an ongoing area of research . Even in the zero-training error regime , it is commonly observed that increasing the number of parameters improves generalization performance . Currently , the status quo explanation for this phenomenon is that gradient descent in over-parameterized models acts as a nuclear norm regularizer ( Gunasekar et al . ( 2017 ) ; Arora et al . ( 2019a ) ; Li et al . ( 2020 ) ) . This work provides a new set of observations that expand the growing body of work on overparameterization and highlights the central role of depth in finding solutions that map to low effective rank embeddings for both linear and non-linear networks . Mainly , we make series of empirical observations that indicate deep networks have an inductive bias to find lower effective rank embeddings . First , we observe that random deep networks are biased to map data to a feature space whose Gram matrix has a low effective rank . Next , we find that this low effective rank phenomenon exists even after training with gradient descent . We further observe that the bias towards low effetive rank embeddings exists in a wide variety of common optimizers — even optimizers that do not use gradient descent . Moreover , we find that regardless of the initialization , the effective rank of the 1e.g. , Dosovitskiy et al . ( 2020 ) trains a 632 million parameter , 200+ layer model , on 1.3 million images . converged solution is largely dependent on the depth of the model . This set of observations leads us to conjecture that deeper networks are implicitly biased to find lower effective rank embeddings because the volume of functions that map to low effective rank embeddings increases with depth . We then leverage our observations to demonstrate how one could use “ depth '' as a practical regularizer to achieve better generalization performance on standard benchmarks such as CIFAR ( Krizhevsky et al . ( 2009 ) ) and ImageNet ( Russakovsky et al . ( 2015 ) ) . 2 PRELIMINARIES . 2.1 NEURAL NETWORKS AND OVER-PARAMETERIZATION . Simple linear network A simple linear neural network transforms input x ∈ Rn×1 to output ŷ ∈ Rm×1 , with a learnable parameter matrix W ∈ Rm×n , ŷ = Wx . ( 1 ) For notational convenience , we omit the bias term . Over-parameterized linear networks One can over-parameterize a linear neural network by defining d matrices { Wi } di=1 and multiplying them successively with input x : ŷ = WdWd−1 · · ·W1x = Wex , ( 2 ) whereWe = ∏d i=1Wi . As long as the matrices are of the correct dimensionality — matrixWd hasm columns , W1 has n rows , and all intermediate dimensions { dim ( Wi ) } d−1i=2 ≥ min ( m , n ) — then this over-parameterization expresses the same set of functions as a single-layer network . We disambiguate between the collapsed and expanded set of weights by referring to { Wi } as the over-parameterized weights and We as the end-to-end or the effective weights . Non-linear networks For non-linear network , activation function ψ ( e.g . ReLU ) is interleaved in between the weights matrices : ŷ = Wdψ ( Wd−1 . . . ψ ( W1 ( x ) ) ) ( 3 ) In contrast to linear networks , non-linear models become more expressive as more layers are added . 2.2 EFFECTIVE RANK . We characterize the rank of a matrix using a continuous measure known as the effective rank : Definition 1 ( Effective rank ; Roy & Vetterli ( 2007 ) ) . For any matrix A ∈ Rm×n , the effective rank ρ is defined as the Shannon entropy of the normalized singular values : ρ ( A ) = − min ( n , m ) ∑ i=1 σ̄i log ( σ̄i ) , where σ̄i = σi/ ∑ j σj are normalized singular values , such that ∑ i σ̄i = 1 . Also referred to as the spectral entropy . Without loss of generality , we drop the exponentiation for convenience . This measure gives us a meaningful representation of “ continuous rank ” , which is maximized when the magnitude of the singular values are all equal and minimized when a single singular value dominates relative to others . The effective rank provides us with a metric that summarizes the distribution envelope . Effective rank has been used in prior works ( Arora et al . ( 2019a ) ; Razin & Cohen ( 2020 ) ; Baratin et al . ( 2021 ) ) and we use this measure extensively throughout our work . We have also found that our observations are consistent with closest definition of rank in which we threshold the smallest singular values after normalization ( Appendix C ) . Similar to prior works , we refer to low effective rank as low rank here on out . 2.3 EMBEDDING MAPS . A parameteric function f { W } ∈ FW is a neural network parameterized with a set weights { W } = { W1 , . . . , Wd } that maps the input space to the output space X → Y . For a training dataset of size q , the input and output data is X ∈ Rn×q and Y ∈ Rm×q . Then , the predicted output is Ŷ = Wdψ ( Φ ) = f { W } ( X ) , where Φ ∈ Rn ′×q is the last-layer embedding and Wd ∈ Rm×n ′ is the last layer of the network . We analyze the embedding space by computing the effective rank on the Gram/kernel matrix K ∈ Rp×p where p is the size of the test set . The ij-th entry of the Gram matrix corresponds to a distance kernel Kij = κ ( φi , φj ) where φi corresponds to the i-th column of Φ . We use the model ’ s intermediate features before the linear classifier and use cosine distance kernel 2 , a common method for measuring distances in feature space ( Kiros et al . ( 2015 ) ; Zhang et al . ( 2018 ) ) . Since the dimensionality of the Gram-matrix does not depend on the model parameters , we can compare neural networks with different modeling capacities in the zero training error regime . Gram matrices are often used to analyze optimization and generalization properties of neural networks ( Zhang et al . ( 2019 ) ; Du et al . ( 2018 ; 2019 ) ; Wu et al . ( 2019 ) ; Arora et al . ( 2019b ) ) . In natural data , it is often assumed that we are trying to discover a low-rank relationship between the input and the label . For example , a model that overfits to every training sample without inferring any structure on the data will generally have a test gram-matrix that is higher rank than that of a model that has learned parsimonious representations . Lower rank on held-out data indicates less excess variability and is indicative for studying generalization and robustness . The intuition becomes clearer in linear networks , since the rank of Gram matrix depends on the rank of the linear transformation computed by the network . We illustrate this empirically in Appendix L , where we see that there is a tight relationship between the rank of the linear weight matrix and the resulting Gram matrix . 2.4 LEAST SQUARES . Given a dataset X , Y generated from W ∗ , the goal is to regress a parameterized function f { W } ( · ) to minimize the squared-distance ‖f { W } ( X ) − Y ‖22 . The rank ( W ∗ ) is a measure of the “ intrinsic dimensionality ” of the data and we refer to it as the task rank . In this work , we exclusively operate in the under-determined regime where we have fewer training examples than model parameters . This ensures that there is more than one minimizing solution . 3 THE INDUCTIVE PARAMETERIZATION BIAS OF DEPTH . Given that our models can always fit the data , what are the implications of searching for the solution in the over-parameterized model ? In linear models , this is equivalent to searching for solutions in { Wi } versus directly in We . One difference is that the gradient direction∇ { Wi } L ( { Wi } ) is usually different than ∇WeL ( We ) for a typical loss function L ( see Appendix I ) . The consequences of this difference have been previously studied in linear models by Arora et al . ( 2018 ; 2019a ) , where the 2cosine kernel : κ ( φi , φj ) = φiφ T j ‖φi‖‖φj‖ over-parameterized update rule has been shown to accelerate training and encourage singular values to decay faster , resulting in low nuclear-norm solution . Here we motivate a result from the perspective of parameter volume space . Conjecture 1 . Deeper networks have a greater proportion of parameter space that maps the input data to lower-rank embeddings ; hence , deeper models are more likely to converge to functions that learn simpler embeddings . We now provide a set of empirical observations that supports our conjecture . Our work and existing theoretical works on gradient descent biases are not mutually exclusive and are a likely compliment . We emphasize that we do not make any claims on the simplicity of the function , but only on the simplicity – lower effective rank – of the embeddings . 3.1 LOW-RANK SIMPLICITY BIAS OF DEEP NETWORKS . Observation 1 . Randomly initialized deep neural networks are biased to correspond to Gram matrices with a low effective rank . When sampling random neural networks , both linear and non-linear , we observed that the Gram matrices computed from deeper networks have lower effective rank . We quantify this observation by computing the distribution over the effective rank of the Gram matrix in Figure 1 . Here , the weights of the neural networks are initialized using uniform Wi ∼ U ( · , · ) or Normal distributions Wi ∼ N ( · , · ) . The input , output , and intermediate dimensions are 32 , giving parameters { Wi } ∈ Rd×32×32 for a network with d layers . We draw 4096 random parameter samples and compute the effective rank on the resulting Gram matrix . We see that the distribution density shifts towards the left ( lower effective rank ) when increasing the number of layers . These distributions have small overlap and smoothen out with increased depth . This observation shows that depth correlates with lower effective rank embeddings . The low-rank bias becomes more intuitive in linear models as there is a simple way to relate the Gram matrix to the weights of the model K ≈ ( Wd−1:1X ) T ( Wd−1:1X ) . Intuitively , if any constituent matrices are low-rank , then the product of matrices will also be low-rank – the product of matrices can only decrease the rank of the resulting matrix : rank ( AB ) ≤ min ( rank ( A ) , rank ( B ) ) ( Friedberg et al . ( 2003 ) ) . In Appendix L , we show that as the depth of the model increases , both the effective rank of the Gram matrix and the weights decrease together . Another way to interpret our observation is that for linear models , over-parameterization does not increase the expressivity of the function but re-weights the likelihood of a subset of parameters – the hypothesis class . For non-linear models , we can not make the same claims . Although uniformly sampling under the parameter distribution is an unbiased estimator of the volume of the parameter space , it is certainly possible that a sub-space of the parameters is more likely to be observed under gradient descent . Hence , by naively sampling networks , we may never encounter model parameters that gradient descent explores . In light of this , we repeat our experiment above by computing the PDF on randomly sampled parameters after taking n gradient descent steps . Observation 2 . Deep neural networks trained with gradient descent also learns to map data to simple embedding with low effective rank . Figure 2 illustrates the change in distribution as we train our model to convergence using gradient descent . Each randomly drawn network sample is trained to minimize the least-squares error . The initial distribution is plotted with dotted lines , and the converged distribution is plotted with solid lines . As the model is trained , the distribution of the rank shifts towards the ground-truth rank ( green line ) . Training the model with gradient descent results in a distribution that is still largely dependent on depth ; this reaffirms that the role of optimization does not remove the parameterization bias in deep models . In fact , if the bias stems from the model ’ s parameterization , the same bias must also exist under other common and natural choices of optimizers . We investigate this claim in the next section .
This paper conduct several controlled experiments and arrive at the following results: - Deep networks (both linear and non-linear) are biased towards learning low-rank embeddings at initialization. - This low-rank bias exists even after the training is done regardless of the initialization or training algorithm. This paper also proposes a new regularization method which is adding extra linear layers which does not increase the network's expressivity but biases the network more towards learning low-rank solutions.
SP:97b02d8f1a4adf5a8690c326d832c4ed614f07ea
The Low-Rank Simplicity Bias in Deep Networks
1 INTRODUCTION . It has become conventional wisdom that the more layers one adds , the better a deep neural network ( DNN ) performs . This guideline is supported , in part , by theoretical results showing that deeper networks can require far fewer parameters than shallower networks to obtain the same modeling “ capacity ” ( Eldan & Shamir ( 2016 ) ) . While it is not surprising that deeper networks are more expressive than shallower networks , the fact that state-of-the-art deep networks do not overfit , despite being heavily over-parameterized1 , defies classical statistical theory ( Geman et al . ( 1992 ) ; Zhang et al . ( 2017 ) ; Belkin et al . ( 2019 ) ) . The belief that over-parameterization via depth improves generalization is used axiomatically in the design of neural networks . Unlike conventional regularization methods that penalize model complexity ( e.g. , ` 1/ ` 2 penalty ) , over-parameterization does not . Yet , like explicit regularization , over-parameterization appears to prevent the model from over-fitting ( Belkin et al . ( 2018 ) ; Nakkiran et al . ( 2019a ) ) . Why this implicit regularization works is still an ongoing area of research . Even in the zero-training error regime , it is commonly observed that increasing the number of parameters improves generalization performance . Currently , the status quo explanation for this phenomenon is that gradient descent in over-parameterized models acts as a nuclear norm regularizer ( Gunasekar et al . ( 2017 ) ; Arora et al . ( 2019a ) ; Li et al . ( 2020 ) ) . This work provides a new set of observations that expand the growing body of work on overparameterization and highlights the central role of depth in finding solutions that map to low effective rank embeddings for both linear and non-linear networks . Mainly , we make series of empirical observations that indicate deep networks have an inductive bias to find lower effective rank embeddings . First , we observe that random deep networks are biased to map data to a feature space whose Gram matrix has a low effective rank . Next , we find that this low effective rank phenomenon exists even after training with gradient descent . We further observe that the bias towards low effetive rank embeddings exists in a wide variety of common optimizers — even optimizers that do not use gradient descent . Moreover , we find that regardless of the initialization , the effective rank of the 1e.g. , Dosovitskiy et al . ( 2020 ) trains a 632 million parameter , 200+ layer model , on 1.3 million images . converged solution is largely dependent on the depth of the model . This set of observations leads us to conjecture that deeper networks are implicitly biased to find lower effective rank embeddings because the volume of functions that map to low effective rank embeddings increases with depth . We then leverage our observations to demonstrate how one could use “ depth '' as a practical regularizer to achieve better generalization performance on standard benchmarks such as CIFAR ( Krizhevsky et al . ( 2009 ) ) and ImageNet ( Russakovsky et al . ( 2015 ) ) . 2 PRELIMINARIES . 2.1 NEURAL NETWORKS AND OVER-PARAMETERIZATION . Simple linear network A simple linear neural network transforms input x ∈ Rn×1 to output ŷ ∈ Rm×1 , with a learnable parameter matrix W ∈ Rm×n , ŷ = Wx . ( 1 ) For notational convenience , we omit the bias term . Over-parameterized linear networks One can over-parameterize a linear neural network by defining d matrices { Wi } di=1 and multiplying them successively with input x : ŷ = WdWd−1 · · ·W1x = Wex , ( 2 ) whereWe = ∏d i=1Wi . As long as the matrices are of the correct dimensionality — matrixWd hasm columns , W1 has n rows , and all intermediate dimensions { dim ( Wi ) } d−1i=2 ≥ min ( m , n ) — then this over-parameterization expresses the same set of functions as a single-layer network . We disambiguate between the collapsed and expanded set of weights by referring to { Wi } as the over-parameterized weights and We as the end-to-end or the effective weights . Non-linear networks For non-linear network , activation function ψ ( e.g . ReLU ) is interleaved in between the weights matrices : ŷ = Wdψ ( Wd−1 . . . ψ ( W1 ( x ) ) ) ( 3 ) In contrast to linear networks , non-linear models become more expressive as more layers are added . 2.2 EFFECTIVE RANK . We characterize the rank of a matrix using a continuous measure known as the effective rank : Definition 1 ( Effective rank ; Roy & Vetterli ( 2007 ) ) . For any matrix A ∈ Rm×n , the effective rank ρ is defined as the Shannon entropy of the normalized singular values : ρ ( A ) = − min ( n , m ) ∑ i=1 σ̄i log ( σ̄i ) , where σ̄i = σi/ ∑ j σj are normalized singular values , such that ∑ i σ̄i = 1 . Also referred to as the spectral entropy . Without loss of generality , we drop the exponentiation for convenience . This measure gives us a meaningful representation of “ continuous rank ” , which is maximized when the magnitude of the singular values are all equal and minimized when a single singular value dominates relative to others . The effective rank provides us with a metric that summarizes the distribution envelope . Effective rank has been used in prior works ( Arora et al . ( 2019a ) ; Razin & Cohen ( 2020 ) ; Baratin et al . ( 2021 ) ) and we use this measure extensively throughout our work . We have also found that our observations are consistent with closest definition of rank in which we threshold the smallest singular values after normalization ( Appendix C ) . Similar to prior works , we refer to low effective rank as low rank here on out . 2.3 EMBEDDING MAPS . A parameteric function f { W } ∈ FW is a neural network parameterized with a set weights { W } = { W1 , . . . , Wd } that maps the input space to the output space X → Y . For a training dataset of size q , the input and output data is X ∈ Rn×q and Y ∈ Rm×q . Then , the predicted output is Ŷ = Wdψ ( Φ ) = f { W } ( X ) , where Φ ∈ Rn ′×q is the last-layer embedding and Wd ∈ Rm×n ′ is the last layer of the network . We analyze the embedding space by computing the effective rank on the Gram/kernel matrix K ∈ Rp×p where p is the size of the test set . The ij-th entry of the Gram matrix corresponds to a distance kernel Kij = κ ( φi , φj ) where φi corresponds to the i-th column of Φ . We use the model ’ s intermediate features before the linear classifier and use cosine distance kernel 2 , a common method for measuring distances in feature space ( Kiros et al . ( 2015 ) ; Zhang et al . ( 2018 ) ) . Since the dimensionality of the Gram-matrix does not depend on the model parameters , we can compare neural networks with different modeling capacities in the zero training error regime . Gram matrices are often used to analyze optimization and generalization properties of neural networks ( Zhang et al . ( 2019 ) ; Du et al . ( 2018 ; 2019 ) ; Wu et al . ( 2019 ) ; Arora et al . ( 2019b ) ) . In natural data , it is often assumed that we are trying to discover a low-rank relationship between the input and the label . For example , a model that overfits to every training sample without inferring any structure on the data will generally have a test gram-matrix that is higher rank than that of a model that has learned parsimonious representations . Lower rank on held-out data indicates less excess variability and is indicative for studying generalization and robustness . The intuition becomes clearer in linear networks , since the rank of Gram matrix depends on the rank of the linear transformation computed by the network . We illustrate this empirically in Appendix L , where we see that there is a tight relationship between the rank of the linear weight matrix and the resulting Gram matrix . 2.4 LEAST SQUARES . Given a dataset X , Y generated from W ∗ , the goal is to regress a parameterized function f { W } ( · ) to minimize the squared-distance ‖f { W } ( X ) − Y ‖22 . The rank ( W ∗ ) is a measure of the “ intrinsic dimensionality ” of the data and we refer to it as the task rank . In this work , we exclusively operate in the under-determined regime where we have fewer training examples than model parameters . This ensures that there is more than one minimizing solution . 3 THE INDUCTIVE PARAMETERIZATION BIAS OF DEPTH . Given that our models can always fit the data , what are the implications of searching for the solution in the over-parameterized model ? In linear models , this is equivalent to searching for solutions in { Wi } versus directly in We . One difference is that the gradient direction∇ { Wi } L ( { Wi } ) is usually different than ∇WeL ( We ) for a typical loss function L ( see Appendix I ) . The consequences of this difference have been previously studied in linear models by Arora et al . ( 2018 ; 2019a ) , where the 2cosine kernel : κ ( φi , φj ) = φiφ T j ‖φi‖‖φj‖ over-parameterized update rule has been shown to accelerate training and encourage singular values to decay faster , resulting in low nuclear-norm solution . Here we motivate a result from the perspective of parameter volume space . Conjecture 1 . Deeper networks have a greater proportion of parameter space that maps the input data to lower-rank embeddings ; hence , deeper models are more likely to converge to functions that learn simpler embeddings . We now provide a set of empirical observations that supports our conjecture . Our work and existing theoretical works on gradient descent biases are not mutually exclusive and are a likely compliment . We emphasize that we do not make any claims on the simplicity of the function , but only on the simplicity – lower effective rank – of the embeddings . 3.1 LOW-RANK SIMPLICITY BIAS OF DEEP NETWORKS . Observation 1 . Randomly initialized deep neural networks are biased to correspond to Gram matrices with a low effective rank . When sampling random neural networks , both linear and non-linear , we observed that the Gram matrices computed from deeper networks have lower effective rank . We quantify this observation by computing the distribution over the effective rank of the Gram matrix in Figure 1 . Here , the weights of the neural networks are initialized using uniform Wi ∼ U ( · , · ) or Normal distributions Wi ∼ N ( · , · ) . The input , output , and intermediate dimensions are 32 , giving parameters { Wi } ∈ Rd×32×32 for a network with d layers . We draw 4096 random parameter samples and compute the effective rank on the resulting Gram matrix . We see that the distribution density shifts towards the left ( lower effective rank ) when increasing the number of layers . These distributions have small overlap and smoothen out with increased depth . This observation shows that depth correlates with lower effective rank embeddings . The low-rank bias becomes more intuitive in linear models as there is a simple way to relate the Gram matrix to the weights of the model K ≈ ( Wd−1:1X ) T ( Wd−1:1X ) . Intuitively , if any constituent matrices are low-rank , then the product of matrices will also be low-rank – the product of matrices can only decrease the rank of the resulting matrix : rank ( AB ) ≤ min ( rank ( A ) , rank ( B ) ) ( Friedberg et al . ( 2003 ) ) . In Appendix L , we show that as the depth of the model increases , both the effective rank of the Gram matrix and the weights decrease together . Another way to interpret our observation is that for linear models , over-parameterization does not increase the expressivity of the function but re-weights the likelihood of a subset of parameters – the hypothesis class . For non-linear models , we can not make the same claims . Although uniformly sampling under the parameter distribution is an unbiased estimator of the volume of the parameter space , it is certainly possible that a sub-space of the parameters is more likely to be observed under gradient descent . Hence , by naively sampling networks , we may never encounter model parameters that gradient descent explores . In light of this , we repeat our experiment above by computing the PDF on randomly sampled parameters after taking n gradient descent steps . Observation 2 . Deep neural networks trained with gradient descent also learns to map data to simple embedding with low effective rank . Figure 2 illustrates the change in distribution as we train our model to convergence using gradient descent . Each randomly drawn network sample is trained to minimize the least-squares error . The initial distribution is plotted with dotted lines , and the converged distribution is plotted with solid lines . As the model is trained , the distribution of the rank shifts towards the ground-truth rank ( green line ) . Training the model with gradient descent results in a distribution that is still largely dependent on depth ; this reaffirms that the role of optimization does not remove the parameterization bias in deep models . In fact , if the bias stems from the model ’ s parameterization , the same bias must also exist under other common and natural choices of optimizers . We investigate this claim in the next section .
This work proposes the hypothesis that deeper networks are inductively biased to find low-rank solutions (i.e., in the sense of gram matrix of features being low-rank) and presents empirical evidence to support the same. The authors thoroughly show that this inductive bias is a property of the parameterization of neural networks, and so remains resilient to changes in optimizer or initialization distribution. Based on this, they suggest linear over-parameterization as a way to further bias the network to low-rank solutions, which is then linked to increasing generalization performance.
SP:97b02d8f1a4adf5a8690c326d832c4ed614f07ea
The Low-Rank Simplicity Bias in Deep Networks
1 INTRODUCTION . It has become conventional wisdom that the more layers one adds , the better a deep neural network ( DNN ) performs . This guideline is supported , in part , by theoretical results showing that deeper networks can require far fewer parameters than shallower networks to obtain the same modeling “ capacity ” ( Eldan & Shamir ( 2016 ) ) . While it is not surprising that deeper networks are more expressive than shallower networks , the fact that state-of-the-art deep networks do not overfit , despite being heavily over-parameterized1 , defies classical statistical theory ( Geman et al . ( 1992 ) ; Zhang et al . ( 2017 ) ; Belkin et al . ( 2019 ) ) . The belief that over-parameterization via depth improves generalization is used axiomatically in the design of neural networks . Unlike conventional regularization methods that penalize model complexity ( e.g. , ` 1/ ` 2 penalty ) , over-parameterization does not . Yet , like explicit regularization , over-parameterization appears to prevent the model from over-fitting ( Belkin et al . ( 2018 ) ; Nakkiran et al . ( 2019a ) ) . Why this implicit regularization works is still an ongoing area of research . Even in the zero-training error regime , it is commonly observed that increasing the number of parameters improves generalization performance . Currently , the status quo explanation for this phenomenon is that gradient descent in over-parameterized models acts as a nuclear norm regularizer ( Gunasekar et al . ( 2017 ) ; Arora et al . ( 2019a ) ; Li et al . ( 2020 ) ) . This work provides a new set of observations that expand the growing body of work on overparameterization and highlights the central role of depth in finding solutions that map to low effective rank embeddings for both linear and non-linear networks . Mainly , we make series of empirical observations that indicate deep networks have an inductive bias to find lower effective rank embeddings . First , we observe that random deep networks are biased to map data to a feature space whose Gram matrix has a low effective rank . Next , we find that this low effective rank phenomenon exists even after training with gradient descent . We further observe that the bias towards low effetive rank embeddings exists in a wide variety of common optimizers — even optimizers that do not use gradient descent . Moreover , we find that regardless of the initialization , the effective rank of the 1e.g. , Dosovitskiy et al . ( 2020 ) trains a 632 million parameter , 200+ layer model , on 1.3 million images . converged solution is largely dependent on the depth of the model . This set of observations leads us to conjecture that deeper networks are implicitly biased to find lower effective rank embeddings because the volume of functions that map to low effective rank embeddings increases with depth . We then leverage our observations to demonstrate how one could use “ depth '' as a practical regularizer to achieve better generalization performance on standard benchmarks such as CIFAR ( Krizhevsky et al . ( 2009 ) ) and ImageNet ( Russakovsky et al . ( 2015 ) ) . 2 PRELIMINARIES . 2.1 NEURAL NETWORKS AND OVER-PARAMETERIZATION . Simple linear network A simple linear neural network transforms input x ∈ Rn×1 to output ŷ ∈ Rm×1 , with a learnable parameter matrix W ∈ Rm×n , ŷ = Wx . ( 1 ) For notational convenience , we omit the bias term . Over-parameterized linear networks One can over-parameterize a linear neural network by defining d matrices { Wi } di=1 and multiplying them successively with input x : ŷ = WdWd−1 · · ·W1x = Wex , ( 2 ) whereWe = ∏d i=1Wi . As long as the matrices are of the correct dimensionality — matrixWd hasm columns , W1 has n rows , and all intermediate dimensions { dim ( Wi ) } d−1i=2 ≥ min ( m , n ) — then this over-parameterization expresses the same set of functions as a single-layer network . We disambiguate between the collapsed and expanded set of weights by referring to { Wi } as the over-parameterized weights and We as the end-to-end or the effective weights . Non-linear networks For non-linear network , activation function ψ ( e.g . ReLU ) is interleaved in between the weights matrices : ŷ = Wdψ ( Wd−1 . . . ψ ( W1 ( x ) ) ) ( 3 ) In contrast to linear networks , non-linear models become more expressive as more layers are added . 2.2 EFFECTIVE RANK . We characterize the rank of a matrix using a continuous measure known as the effective rank : Definition 1 ( Effective rank ; Roy & Vetterli ( 2007 ) ) . For any matrix A ∈ Rm×n , the effective rank ρ is defined as the Shannon entropy of the normalized singular values : ρ ( A ) = − min ( n , m ) ∑ i=1 σ̄i log ( σ̄i ) , where σ̄i = σi/ ∑ j σj are normalized singular values , such that ∑ i σ̄i = 1 . Also referred to as the spectral entropy . Without loss of generality , we drop the exponentiation for convenience . This measure gives us a meaningful representation of “ continuous rank ” , which is maximized when the magnitude of the singular values are all equal and minimized when a single singular value dominates relative to others . The effective rank provides us with a metric that summarizes the distribution envelope . Effective rank has been used in prior works ( Arora et al . ( 2019a ) ; Razin & Cohen ( 2020 ) ; Baratin et al . ( 2021 ) ) and we use this measure extensively throughout our work . We have also found that our observations are consistent with closest definition of rank in which we threshold the smallest singular values after normalization ( Appendix C ) . Similar to prior works , we refer to low effective rank as low rank here on out . 2.3 EMBEDDING MAPS . A parameteric function f { W } ∈ FW is a neural network parameterized with a set weights { W } = { W1 , . . . , Wd } that maps the input space to the output space X → Y . For a training dataset of size q , the input and output data is X ∈ Rn×q and Y ∈ Rm×q . Then , the predicted output is Ŷ = Wdψ ( Φ ) = f { W } ( X ) , where Φ ∈ Rn ′×q is the last-layer embedding and Wd ∈ Rm×n ′ is the last layer of the network . We analyze the embedding space by computing the effective rank on the Gram/kernel matrix K ∈ Rp×p where p is the size of the test set . The ij-th entry of the Gram matrix corresponds to a distance kernel Kij = κ ( φi , φj ) where φi corresponds to the i-th column of Φ . We use the model ’ s intermediate features before the linear classifier and use cosine distance kernel 2 , a common method for measuring distances in feature space ( Kiros et al . ( 2015 ) ; Zhang et al . ( 2018 ) ) . Since the dimensionality of the Gram-matrix does not depend on the model parameters , we can compare neural networks with different modeling capacities in the zero training error regime . Gram matrices are often used to analyze optimization and generalization properties of neural networks ( Zhang et al . ( 2019 ) ; Du et al . ( 2018 ; 2019 ) ; Wu et al . ( 2019 ) ; Arora et al . ( 2019b ) ) . In natural data , it is often assumed that we are trying to discover a low-rank relationship between the input and the label . For example , a model that overfits to every training sample without inferring any structure on the data will generally have a test gram-matrix that is higher rank than that of a model that has learned parsimonious representations . Lower rank on held-out data indicates less excess variability and is indicative for studying generalization and robustness . The intuition becomes clearer in linear networks , since the rank of Gram matrix depends on the rank of the linear transformation computed by the network . We illustrate this empirically in Appendix L , where we see that there is a tight relationship between the rank of the linear weight matrix and the resulting Gram matrix . 2.4 LEAST SQUARES . Given a dataset X , Y generated from W ∗ , the goal is to regress a parameterized function f { W } ( · ) to minimize the squared-distance ‖f { W } ( X ) − Y ‖22 . The rank ( W ∗ ) is a measure of the “ intrinsic dimensionality ” of the data and we refer to it as the task rank . In this work , we exclusively operate in the under-determined regime where we have fewer training examples than model parameters . This ensures that there is more than one minimizing solution . 3 THE INDUCTIVE PARAMETERIZATION BIAS OF DEPTH . Given that our models can always fit the data , what are the implications of searching for the solution in the over-parameterized model ? In linear models , this is equivalent to searching for solutions in { Wi } versus directly in We . One difference is that the gradient direction∇ { Wi } L ( { Wi } ) is usually different than ∇WeL ( We ) for a typical loss function L ( see Appendix I ) . The consequences of this difference have been previously studied in linear models by Arora et al . ( 2018 ; 2019a ) , where the 2cosine kernel : κ ( φi , φj ) = φiφ T j ‖φi‖‖φj‖ over-parameterized update rule has been shown to accelerate training and encourage singular values to decay faster , resulting in low nuclear-norm solution . Here we motivate a result from the perspective of parameter volume space . Conjecture 1 . Deeper networks have a greater proportion of parameter space that maps the input data to lower-rank embeddings ; hence , deeper models are more likely to converge to functions that learn simpler embeddings . We now provide a set of empirical observations that supports our conjecture . Our work and existing theoretical works on gradient descent biases are not mutually exclusive and are a likely compliment . We emphasize that we do not make any claims on the simplicity of the function , but only on the simplicity – lower effective rank – of the embeddings . 3.1 LOW-RANK SIMPLICITY BIAS OF DEEP NETWORKS . Observation 1 . Randomly initialized deep neural networks are biased to correspond to Gram matrices with a low effective rank . When sampling random neural networks , both linear and non-linear , we observed that the Gram matrices computed from deeper networks have lower effective rank . We quantify this observation by computing the distribution over the effective rank of the Gram matrix in Figure 1 . Here , the weights of the neural networks are initialized using uniform Wi ∼ U ( · , · ) or Normal distributions Wi ∼ N ( · , · ) . The input , output , and intermediate dimensions are 32 , giving parameters { Wi } ∈ Rd×32×32 for a network with d layers . We draw 4096 random parameter samples and compute the effective rank on the resulting Gram matrix . We see that the distribution density shifts towards the left ( lower effective rank ) when increasing the number of layers . These distributions have small overlap and smoothen out with increased depth . This observation shows that depth correlates with lower effective rank embeddings . The low-rank bias becomes more intuitive in linear models as there is a simple way to relate the Gram matrix to the weights of the model K ≈ ( Wd−1:1X ) T ( Wd−1:1X ) . Intuitively , if any constituent matrices are low-rank , then the product of matrices will also be low-rank – the product of matrices can only decrease the rank of the resulting matrix : rank ( AB ) ≤ min ( rank ( A ) , rank ( B ) ) ( Friedberg et al . ( 2003 ) ) . In Appendix L , we show that as the depth of the model increases , both the effective rank of the Gram matrix and the weights decrease together . Another way to interpret our observation is that for linear models , over-parameterization does not increase the expressivity of the function but re-weights the likelihood of a subset of parameters – the hypothesis class . For non-linear models , we can not make the same claims . Although uniformly sampling under the parameter distribution is an unbiased estimator of the volume of the parameter space , it is certainly possible that a sub-space of the parameters is more likely to be observed under gradient descent . Hence , by naively sampling networks , we may never encounter model parameters that gradient descent explores . In light of this , we repeat our experiment above by computing the PDF on randomly sampled parameters after taking n gradient descent steps . Observation 2 . Deep neural networks trained with gradient descent also learns to map data to simple embedding with low effective rank . Figure 2 illustrates the change in distribution as we train our model to convergence using gradient descent . Each randomly drawn network sample is trained to minimize the least-squares error . The initial distribution is plotted with dotted lines , and the converged distribution is plotted with solid lines . As the model is trained , the distribution of the rank shifts towards the ground-truth rank ( green line ) . Training the model with gradient descent results in a distribution that is still largely dependent on depth ; this reaffirms that the role of optimization does not remove the parameterization bias in deep models . In fact , if the bias stems from the model ’ s parameterization , the same bias must also exist under other common and natural choices of optimizers . We investigate this claim in the next section .
The paper explores the effect of depth on a continuous estimate of rank (effective rank) of the data embeddings computed by feed-forward neural networks. On artificial datasets, the paper shows that at initialization (with common uniform or normal weight distributions), the effective rank of both linear and non-linear MLPs decreases with depth, and this is preserved after training. The results does not extend to network architectures with skip-connections such as ResNets. The authors claim that this low-rank bias of the embeddings help generalization on natural datasets, and show that a reparametrization of common architectures where the linear layers are replaced by products of linear layers improves test accuracy on CIFAR-10 and CIFAR-100.
SP:97b02d8f1a4adf5a8690c326d832c4ed614f07ea
Open Set Domain Adaptation with Zero-shot Learning on Graph
1 INTRODUCTION . In the last decades , deep learning models have shown good performance in various tasks , especially in visual perception . The training of the deep learning network relies on plenty of labeled data . However , most of the existing large labeled datasets are collected from the Internet . The images in these datasets are normative and unified , which are different from the images relevant for a specific application . Besides , depending on the application , the images may be obtained by different typed of visual sensors or with a different perspective of sensors . It costs a lot to retrain the classification model in different situations . In some typical applications , the samples in the real world are hard to gather or too large to label . Thus it is important to deal with the gap among domains . They should be able to utilize the well-labeled samples in the source domain to classify the samples in the unlabeled target domain which is related to domain adaptation . There are already some researches on domain adaptation , such as Ganin & Lempitsky ( 2015 ) , Long et al . ( 2015 ) , Long et al . ( 2016 ) , and Wang & Deng ( 2018 ) . The alignment of the domain gap makes the robot adapt well to dynamic and unstructured environments . Except for the domain gap among different datasets , the variation of the classes also makes it hard for the model to adapt to a new dataset . Depending on the application and the scale of different datasets , the model may come across classes that are not contained in the source domains . With the traditional domain adaptation methods , the unknown classes are mistakenly aligned due to the absence of training samples of unknown classes in the source domain . The imbalance of the types of classes brings over-fitting problems and is not suitable for classification in the open world . Thus it is important for the robot to reject the unknown classes and only align the shared classes . This problem is known as open set domain adaptation , which is first proposed by Panareda Busto & Gall ( 2017 ) and followed by for instance Saito et al . ( 2018 ) , Busto et al . ( 2018 ) , and Liu et al . ( 2019 ) . In the setting of the open set domain adaptation , the target domain contains both the classes of the source domain and the additional new classes . The model not only aligns the target domain to the source domain but also rejects the unknown classes . It is worth noting that previous open set domain adaptation methods typically classify all the additional new classes into one unknown class . However , the unknown class may contain classes that are worth learning . It may be more valuable to detect the unknown classes in detail and develop the ability to classify them with the former information . With the process of distinction and transferring , the model can expand its visual recognition ability with little labeled information . Since the unknown classes are not included in the source domain , the model lacks the labeled information for the new classes . Current open set domain adaptation methods can not give detailed classification on the unknown part with no labeled images . This problem is related to zero-shot learning . In the zero-shot learning problem , complementary information is collected to transfer the knowledge from the base classes to classify the unknown ones . Inspired by this , with the knowledge stored in the knowledge graph , the classifiers of the unknown classes can be obtained in the target domain with no labeled samples . Towards this end , we propose a generic model to align the gap between the labeled source domain and the unlabeled target domain while classifying the unknown classes in the target domain . The contributions of this paper mainly lies in tackling the following two difficulties . First , since the unknown classes are not contained in the source domain , we have no labeled samples for supervised training . The lack of labeled data may cause overfitting problem of the model , which means the model only classify the samples as the known classes and can not classify the unknown ones . It is necessary to utilize complementary information to support the inference . Thus we employ the knowledge graph to stores some prior knowledge of the known classes and the unknown classes , which contains the structural relations between different classes , beyond the individual attribute representation of each class . The structural information offers a bridge for the inference from the known classes to the unknown ones . With the employment of the graph convolution network , the information propagates among the graph and the unknown classes gather the information from their neighbor to generate their classifiers . These inference classifiers work as the initial classifiers of the classification model . The second difficulty is how to adapt the inference classifiers to the target domain . Since we only have labeled samples in the source domain , the inference classifiers are suitable to the source domain . It is not able to classify the unknown samples in the target domain because of the domain gap . Thus we introduce adversarial learning to align the domain gap . The classification model consists of two modules , the feature generator , and the classifier . Since the generator works to extracts the features of the samples and the classifier works to output the class probability , we train them simultaneously in an adversarial way . The classifier is trained to found a boundary for the unknown classes while the generator is trained to make the samples far from the boundary . With adversarial learning , the generator can deceive the classifier to generate aligned features in both domains and reject the unknown classes according to the unknown boundary . Thus the feature of the shared classes is aligned in both domains and the unknown classes are rejected as one class . With the adaptation in both domain gap and class gap , our model is able to classify objects in the dynamic and complex open world . We utilize the knowledge graph and the adversarial learning in a jointly trained framework . The two parts work together to align the shared classes in two spaces while generating classifiers for the unknown classes in the target domain . We further evaluate our method on digits datasets and demonstrate its effectiveness . 2 RELATED WORKS . 2.1 OPEN SET DOMAIN ADAPTATION . Open set domain adaptation goes beyond traditional close set domain adaptation . It considers a more realistic classification task , in which the target domain contains unknown samples that are not present in the source domain . Open set domain adaptation is first proposed by Busto et al . ( 2018 ) . They measure the distance between the target sample and the center of the source class to decide whether a target sample belongs to one of the source classes or the unknown class . However , they require the source domain to have unknown samples as well . Later on , Saito et al . ( 2018 ) propose open set back-propagation ( OSBP ) for source domain with no unknown samples . They utilize adversarial learning to train the feature generator and classifier . As the classifier tries to set a boundary for the unknown classes , the feature generator tries to deceive it . However , both of them only separate the unknown classes in the target domain , but can not give detailed classification on the unknown ones . The learnable information in the unknown space deserves deep exploitation . We have found few papers that consider the fine-grained classification of the unknown classes in open set domain adaptation , we aim to fill in the blanks . 2.2 ZERO-SHOT LEARNING . Zero-shot learning aims at generating classifiers for unknown classes with no labeled samples . Several pieces of research have been done on this area , such as Kipf & Welling ( 2016 ) Xian et al . ( 2017 ) . Due to the limitation of the available samples , some researchers extract complementary information from the related known classes to support the inference of the unknown ones . Among these methods , building the relationship between classes in form of a graph seems more reasonable . The special geometry of graphs well shows the complicated relationship and the unknown classes can gather adequate information from the known ones . Current zero-shot learning please refer to knowledge graphs for inference . Wang et al . ( 2018 ) built an unweighted knowledge graph combined with word embedding upon the graph convolutional network . With information propagation , novel nodes generate predictive classifiers with common sense . Kampffmeyer et al . ( 2019 ) improve upon this model and propose a dense graph propagation to prevent dilution of knowledge from distant nodes . Knowledge graphs intuitively present the stored information for the visual cognitive development . 2.3 GRAPH CONVOLUTIONAL NETWORK . Graph convolutional network ( GCN ) is a kind of graph neural network proposed by Kipf & Welling ( 2016 ) . GCN enables the nodes in the graph to share the intensity of statistics , which improves the efficiency of sampling . GCN can also be employed in non-euclidean space . From the perspective of the spatial domain , GCN iteratively aggregates neighborhood information . The propagation of information on the graph further exploits the structural information on the graph . GCN is first introduced by Bruna et al . ( 2013 ) . Then GCN is extended with a filtering method based on the recurrent Chebyshev polynomial . The improvement reduces the computational complexity a lot , which is equivalent to common CNNs in image operating . Kipf & Welling ( 2016 ) further simplify the framework to improve the scalability and robustness . They employed their model on the semisupervised learning on the graphs . Our model employs the framework of GCN to propagate the complementary information among nodes for the inference of classifiers . 3 APPROACH . 3.1 PROBLEM DEFINITION . In open set domain adaptation with zero-shot learning , we have a source domain Ds = { ( xsi , ysi ) } ns i=1 , which contains ns labeled samples , and a target domain Dt = { xtj } nt j=1 , which contains nt unlabeled samples . The class space in the source domain is Cs which we call known classes . Cs also is shared by the class space of the target domainCt . It is worth noting thatCt further contains additional unknown classes Cu , that is Ct = Cs ∨Cu . The source domain is sampled from the distribution qs , while the target domain is sampled from the distribution qt . In close set domain adaptation , qs 6= qt . In open set domain adaptation with zero-shot learning , we also define qs 6= qst . qst refers to the distribution of the known classes in the target domain . Note that the samples in the target domain are all unlabeled and the samples in the source domain are all labeled . 3.2 CLASSIFIER INFERENCE MODULE . With few labeled samples , the human can make good inferences on unfamiliar things with the related information that they obtain from books . Our model also extracts the task-based knowledge from a prestored knowledge graph . The inference graph is denoted as G = ( V , E ) , where V = { v1 , v2 , ... , vns , ... , vnt } is a node-set of all classes Ct. ns refers to the number of known classes . nt − ns refers to the number of unknown classes . The nodes in the prestored knowledge contain the attributes vi of different classes . E = { ei , j = ( vi , vj ) } is an edge set referring to the relationship among the graph . The edges in the prestored knowledge graph are based on the similarity of the attributes between different classes . Since we only have labeled data of the source domain . We first train the recognition model on the source domain Ds . Specifically , the pre-trained recognition model is denoted as C ( F ( ·|θ ) |w ) . The model consists of two parts , feature extractor F ( ·|θ ) and class classifier C ( ·|w ) . θ and w indicate the parameters of the model trained withDs = { ( x1 , y1 ) , ... , ( xns , ys ) } . The symbol xi refers to the source images of the ith class while yi refers to their label . Feature extractor F ( x|θ ) takes an image as input and figures out the feature vector of it as zi . The final classification score is computed as [ s1 , s2 , ... , sM ] = [ z Tw1 , z Tw2 , ... , z Twns ] ( 1 ) Thus the inference of the classifiers on unknown classes is to inference the classification weights ws on the unknown classes with the inference graph . With the framework of the graph convolutional network , Our model propagates information among nodes by exploring the class relationship . For one layer in GCN , a node aggregates information from the neighbors connected to it . GCN can also be extended to multiple layers to perform a deeper spread . Therefore , the unknown classes can utilize the information from the related known classes and predict the classification weights of their own . The mechanism of GCN is described as H ( l+1 ) = ReLu ( D̂− 1 2 ÊD̂− 1 2H ( l ) U ( l ) ) ( 2 ) where H ( l ) denotes the output of the lth layer , while for the first layer H0 = V . It uses Leaky ReLu as the nonlinear activation function . To reserve the self-information of the nodes , self-loops are added among the propagation , Ê = E + I , where E ∈ RN×N is the symmetric adjacency matrix and I ∈ RN×N represents identity matrix . Dii = ∑ j Eij normalizes rows in E to prevent the scale of input modified by E. The matrix U l is the weight matrix of the lth layer , which GCN regulates constantly to achieve better performance . Our model conducts two layers of GCN on the inference graph . Unknown classes learn the mechanism of end-to-end learning from known classes through propagation . The inference graph is trained to minimize the loss between the predicted classification weights and the ground-truth weights . The ground-truth weights refer to the classifiers of the known classes , which are extracted from the pretrained model on the source domain . LGCN = 1 M M∑ i=1 ( winfi − w train i ) 2 ( 3 ) wherewinf refers to the output of known classes on GCN.wtrain denotes the ground truth classifiers of the known classes obtained from the pre-trained model . With the supervision of the known classes , the unknown nodes in the inference graph can also generate classifier weights of their own . Finally , with the employment of GCN , the classifier inference module not only generates predictive classifiers of the unknown classes in the source domain but also provides more general classifiers of the known ones .
The paper formulates a novel problem in open-set domain adaptation and aims to classify the unknown classes in the target domain. This is different from the traditional open-set domain adaptation problem setting. To do this, additional knowledge of inter-class relations are employed and embedded so that knowledge learned from the shared classes can be transferred to the unknown classes.
SP:a9d638e2afc2e3a87c18c146e52d1351cfe73918
Open Set Domain Adaptation with Zero-shot Learning on Graph
1 INTRODUCTION . In the last decades , deep learning models have shown good performance in various tasks , especially in visual perception . The training of the deep learning network relies on plenty of labeled data . However , most of the existing large labeled datasets are collected from the Internet . The images in these datasets are normative and unified , which are different from the images relevant for a specific application . Besides , depending on the application , the images may be obtained by different typed of visual sensors or with a different perspective of sensors . It costs a lot to retrain the classification model in different situations . In some typical applications , the samples in the real world are hard to gather or too large to label . Thus it is important to deal with the gap among domains . They should be able to utilize the well-labeled samples in the source domain to classify the samples in the unlabeled target domain which is related to domain adaptation . There are already some researches on domain adaptation , such as Ganin & Lempitsky ( 2015 ) , Long et al . ( 2015 ) , Long et al . ( 2016 ) , and Wang & Deng ( 2018 ) . The alignment of the domain gap makes the robot adapt well to dynamic and unstructured environments . Except for the domain gap among different datasets , the variation of the classes also makes it hard for the model to adapt to a new dataset . Depending on the application and the scale of different datasets , the model may come across classes that are not contained in the source domains . With the traditional domain adaptation methods , the unknown classes are mistakenly aligned due to the absence of training samples of unknown classes in the source domain . The imbalance of the types of classes brings over-fitting problems and is not suitable for classification in the open world . Thus it is important for the robot to reject the unknown classes and only align the shared classes . This problem is known as open set domain adaptation , which is first proposed by Panareda Busto & Gall ( 2017 ) and followed by for instance Saito et al . ( 2018 ) , Busto et al . ( 2018 ) , and Liu et al . ( 2019 ) . In the setting of the open set domain adaptation , the target domain contains both the classes of the source domain and the additional new classes . The model not only aligns the target domain to the source domain but also rejects the unknown classes . It is worth noting that previous open set domain adaptation methods typically classify all the additional new classes into one unknown class . However , the unknown class may contain classes that are worth learning . It may be more valuable to detect the unknown classes in detail and develop the ability to classify them with the former information . With the process of distinction and transferring , the model can expand its visual recognition ability with little labeled information . Since the unknown classes are not included in the source domain , the model lacks the labeled information for the new classes . Current open set domain adaptation methods can not give detailed classification on the unknown part with no labeled images . This problem is related to zero-shot learning . In the zero-shot learning problem , complementary information is collected to transfer the knowledge from the base classes to classify the unknown ones . Inspired by this , with the knowledge stored in the knowledge graph , the classifiers of the unknown classes can be obtained in the target domain with no labeled samples . Towards this end , we propose a generic model to align the gap between the labeled source domain and the unlabeled target domain while classifying the unknown classes in the target domain . The contributions of this paper mainly lies in tackling the following two difficulties . First , since the unknown classes are not contained in the source domain , we have no labeled samples for supervised training . The lack of labeled data may cause overfitting problem of the model , which means the model only classify the samples as the known classes and can not classify the unknown ones . It is necessary to utilize complementary information to support the inference . Thus we employ the knowledge graph to stores some prior knowledge of the known classes and the unknown classes , which contains the structural relations between different classes , beyond the individual attribute representation of each class . The structural information offers a bridge for the inference from the known classes to the unknown ones . With the employment of the graph convolution network , the information propagates among the graph and the unknown classes gather the information from their neighbor to generate their classifiers . These inference classifiers work as the initial classifiers of the classification model . The second difficulty is how to adapt the inference classifiers to the target domain . Since we only have labeled samples in the source domain , the inference classifiers are suitable to the source domain . It is not able to classify the unknown samples in the target domain because of the domain gap . Thus we introduce adversarial learning to align the domain gap . The classification model consists of two modules , the feature generator , and the classifier . Since the generator works to extracts the features of the samples and the classifier works to output the class probability , we train them simultaneously in an adversarial way . The classifier is trained to found a boundary for the unknown classes while the generator is trained to make the samples far from the boundary . With adversarial learning , the generator can deceive the classifier to generate aligned features in both domains and reject the unknown classes according to the unknown boundary . Thus the feature of the shared classes is aligned in both domains and the unknown classes are rejected as one class . With the adaptation in both domain gap and class gap , our model is able to classify objects in the dynamic and complex open world . We utilize the knowledge graph and the adversarial learning in a jointly trained framework . The two parts work together to align the shared classes in two spaces while generating classifiers for the unknown classes in the target domain . We further evaluate our method on digits datasets and demonstrate its effectiveness . 2 RELATED WORKS . 2.1 OPEN SET DOMAIN ADAPTATION . Open set domain adaptation goes beyond traditional close set domain adaptation . It considers a more realistic classification task , in which the target domain contains unknown samples that are not present in the source domain . Open set domain adaptation is first proposed by Busto et al . ( 2018 ) . They measure the distance between the target sample and the center of the source class to decide whether a target sample belongs to one of the source classes or the unknown class . However , they require the source domain to have unknown samples as well . Later on , Saito et al . ( 2018 ) propose open set back-propagation ( OSBP ) for source domain with no unknown samples . They utilize adversarial learning to train the feature generator and classifier . As the classifier tries to set a boundary for the unknown classes , the feature generator tries to deceive it . However , both of them only separate the unknown classes in the target domain , but can not give detailed classification on the unknown ones . The learnable information in the unknown space deserves deep exploitation . We have found few papers that consider the fine-grained classification of the unknown classes in open set domain adaptation , we aim to fill in the blanks . 2.2 ZERO-SHOT LEARNING . Zero-shot learning aims at generating classifiers for unknown classes with no labeled samples . Several pieces of research have been done on this area , such as Kipf & Welling ( 2016 ) Xian et al . ( 2017 ) . Due to the limitation of the available samples , some researchers extract complementary information from the related known classes to support the inference of the unknown ones . Among these methods , building the relationship between classes in form of a graph seems more reasonable . The special geometry of graphs well shows the complicated relationship and the unknown classes can gather adequate information from the known ones . Current zero-shot learning please refer to knowledge graphs for inference . Wang et al . ( 2018 ) built an unweighted knowledge graph combined with word embedding upon the graph convolutional network . With information propagation , novel nodes generate predictive classifiers with common sense . Kampffmeyer et al . ( 2019 ) improve upon this model and propose a dense graph propagation to prevent dilution of knowledge from distant nodes . Knowledge graphs intuitively present the stored information for the visual cognitive development . 2.3 GRAPH CONVOLUTIONAL NETWORK . Graph convolutional network ( GCN ) is a kind of graph neural network proposed by Kipf & Welling ( 2016 ) . GCN enables the nodes in the graph to share the intensity of statistics , which improves the efficiency of sampling . GCN can also be employed in non-euclidean space . From the perspective of the spatial domain , GCN iteratively aggregates neighborhood information . The propagation of information on the graph further exploits the structural information on the graph . GCN is first introduced by Bruna et al . ( 2013 ) . Then GCN is extended with a filtering method based on the recurrent Chebyshev polynomial . The improvement reduces the computational complexity a lot , which is equivalent to common CNNs in image operating . Kipf & Welling ( 2016 ) further simplify the framework to improve the scalability and robustness . They employed their model on the semisupervised learning on the graphs . Our model employs the framework of GCN to propagate the complementary information among nodes for the inference of classifiers . 3 APPROACH . 3.1 PROBLEM DEFINITION . In open set domain adaptation with zero-shot learning , we have a source domain Ds = { ( xsi , ysi ) } ns i=1 , which contains ns labeled samples , and a target domain Dt = { xtj } nt j=1 , which contains nt unlabeled samples . The class space in the source domain is Cs which we call known classes . Cs also is shared by the class space of the target domainCt . It is worth noting thatCt further contains additional unknown classes Cu , that is Ct = Cs ∨Cu . The source domain is sampled from the distribution qs , while the target domain is sampled from the distribution qt . In close set domain adaptation , qs 6= qt . In open set domain adaptation with zero-shot learning , we also define qs 6= qst . qst refers to the distribution of the known classes in the target domain . Note that the samples in the target domain are all unlabeled and the samples in the source domain are all labeled . 3.2 CLASSIFIER INFERENCE MODULE . With few labeled samples , the human can make good inferences on unfamiliar things with the related information that they obtain from books . Our model also extracts the task-based knowledge from a prestored knowledge graph . The inference graph is denoted as G = ( V , E ) , where V = { v1 , v2 , ... , vns , ... , vnt } is a node-set of all classes Ct. ns refers to the number of known classes . nt − ns refers to the number of unknown classes . The nodes in the prestored knowledge contain the attributes vi of different classes . E = { ei , j = ( vi , vj ) } is an edge set referring to the relationship among the graph . The edges in the prestored knowledge graph are based on the similarity of the attributes between different classes . Since we only have labeled data of the source domain . We first train the recognition model on the source domain Ds . Specifically , the pre-trained recognition model is denoted as C ( F ( ·|θ ) |w ) . The model consists of two parts , feature extractor F ( ·|θ ) and class classifier C ( ·|w ) . θ and w indicate the parameters of the model trained withDs = { ( x1 , y1 ) , ... , ( xns , ys ) } . The symbol xi refers to the source images of the ith class while yi refers to their label . Feature extractor F ( x|θ ) takes an image as input and figures out the feature vector of it as zi . The final classification score is computed as [ s1 , s2 , ... , sM ] = [ z Tw1 , z Tw2 , ... , z Twns ] ( 1 ) Thus the inference of the classifiers on unknown classes is to inference the classification weights ws on the unknown classes with the inference graph . With the framework of the graph convolutional network , Our model propagates information among nodes by exploring the class relationship . For one layer in GCN , a node aggregates information from the neighbors connected to it . GCN can also be extended to multiple layers to perform a deeper spread . Therefore , the unknown classes can utilize the information from the related known classes and predict the classification weights of their own . The mechanism of GCN is described as H ( l+1 ) = ReLu ( D̂− 1 2 ÊD̂− 1 2H ( l ) U ( l ) ) ( 2 ) where H ( l ) denotes the output of the lth layer , while for the first layer H0 = V . It uses Leaky ReLu as the nonlinear activation function . To reserve the self-information of the nodes , self-loops are added among the propagation , Ê = E + I , where E ∈ RN×N is the symmetric adjacency matrix and I ∈ RN×N represents identity matrix . Dii = ∑ j Eij normalizes rows in E to prevent the scale of input modified by E. The matrix U l is the weight matrix of the lth layer , which GCN regulates constantly to achieve better performance . Our model conducts two layers of GCN on the inference graph . Unknown classes learn the mechanism of end-to-end learning from known classes through propagation . The inference graph is trained to minimize the loss between the predicted classification weights and the ground-truth weights . The ground-truth weights refer to the classifiers of the known classes , which are extracted from the pretrained model on the source domain . LGCN = 1 M M∑ i=1 ( winfi − w train i ) 2 ( 3 ) wherewinf refers to the output of known classes on GCN.wtrain denotes the ground truth classifiers of the known classes obtained from the pre-trained model . With the supervision of the known classes , the unknown nodes in the inference graph can also generate classifier weights of their own . Finally , with the employment of GCN , the classifier inference module not only generates predictive classifiers of the unknown classes in the source domain but also provides more general classifiers of the known ones .
They propose a new setting in open-set domain adaptation, where the goal is to classify known classes into their classes as well as cluster unknown classes well. A difference from an existing open-set domain adaptation is that it does only require separating unknown instances from known ones whereas this paper aims to cluster unknown instances. For this goal, they propose a model for open set domain adaptation with zero-shot learning on the unknown classes. They combine adversarial learning to align the two domains, and the knowledge graph is introduced to generate the classifiers for the unknown classes with the employment of the graph convolution network (GCN). They provide experiments on digits dataset and show the gain over baselines.
SP:a9d638e2afc2e3a87c18c146e52d1351cfe73918
Open Set Domain Adaptation with Zero-shot Learning on Graph
1 INTRODUCTION . In the last decades , deep learning models have shown good performance in various tasks , especially in visual perception . The training of the deep learning network relies on plenty of labeled data . However , most of the existing large labeled datasets are collected from the Internet . The images in these datasets are normative and unified , which are different from the images relevant for a specific application . Besides , depending on the application , the images may be obtained by different typed of visual sensors or with a different perspective of sensors . It costs a lot to retrain the classification model in different situations . In some typical applications , the samples in the real world are hard to gather or too large to label . Thus it is important to deal with the gap among domains . They should be able to utilize the well-labeled samples in the source domain to classify the samples in the unlabeled target domain which is related to domain adaptation . There are already some researches on domain adaptation , such as Ganin & Lempitsky ( 2015 ) , Long et al . ( 2015 ) , Long et al . ( 2016 ) , and Wang & Deng ( 2018 ) . The alignment of the domain gap makes the robot adapt well to dynamic and unstructured environments . Except for the domain gap among different datasets , the variation of the classes also makes it hard for the model to adapt to a new dataset . Depending on the application and the scale of different datasets , the model may come across classes that are not contained in the source domains . With the traditional domain adaptation methods , the unknown classes are mistakenly aligned due to the absence of training samples of unknown classes in the source domain . The imbalance of the types of classes brings over-fitting problems and is not suitable for classification in the open world . Thus it is important for the robot to reject the unknown classes and only align the shared classes . This problem is known as open set domain adaptation , which is first proposed by Panareda Busto & Gall ( 2017 ) and followed by for instance Saito et al . ( 2018 ) , Busto et al . ( 2018 ) , and Liu et al . ( 2019 ) . In the setting of the open set domain adaptation , the target domain contains both the classes of the source domain and the additional new classes . The model not only aligns the target domain to the source domain but also rejects the unknown classes . It is worth noting that previous open set domain adaptation methods typically classify all the additional new classes into one unknown class . However , the unknown class may contain classes that are worth learning . It may be more valuable to detect the unknown classes in detail and develop the ability to classify them with the former information . With the process of distinction and transferring , the model can expand its visual recognition ability with little labeled information . Since the unknown classes are not included in the source domain , the model lacks the labeled information for the new classes . Current open set domain adaptation methods can not give detailed classification on the unknown part with no labeled images . This problem is related to zero-shot learning . In the zero-shot learning problem , complementary information is collected to transfer the knowledge from the base classes to classify the unknown ones . Inspired by this , with the knowledge stored in the knowledge graph , the classifiers of the unknown classes can be obtained in the target domain with no labeled samples . Towards this end , we propose a generic model to align the gap between the labeled source domain and the unlabeled target domain while classifying the unknown classes in the target domain . The contributions of this paper mainly lies in tackling the following two difficulties . First , since the unknown classes are not contained in the source domain , we have no labeled samples for supervised training . The lack of labeled data may cause overfitting problem of the model , which means the model only classify the samples as the known classes and can not classify the unknown ones . It is necessary to utilize complementary information to support the inference . Thus we employ the knowledge graph to stores some prior knowledge of the known classes and the unknown classes , which contains the structural relations between different classes , beyond the individual attribute representation of each class . The structural information offers a bridge for the inference from the known classes to the unknown ones . With the employment of the graph convolution network , the information propagates among the graph and the unknown classes gather the information from their neighbor to generate their classifiers . These inference classifiers work as the initial classifiers of the classification model . The second difficulty is how to adapt the inference classifiers to the target domain . Since we only have labeled samples in the source domain , the inference classifiers are suitable to the source domain . It is not able to classify the unknown samples in the target domain because of the domain gap . Thus we introduce adversarial learning to align the domain gap . The classification model consists of two modules , the feature generator , and the classifier . Since the generator works to extracts the features of the samples and the classifier works to output the class probability , we train them simultaneously in an adversarial way . The classifier is trained to found a boundary for the unknown classes while the generator is trained to make the samples far from the boundary . With adversarial learning , the generator can deceive the classifier to generate aligned features in both domains and reject the unknown classes according to the unknown boundary . Thus the feature of the shared classes is aligned in both domains and the unknown classes are rejected as one class . With the adaptation in both domain gap and class gap , our model is able to classify objects in the dynamic and complex open world . We utilize the knowledge graph and the adversarial learning in a jointly trained framework . The two parts work together to align the shared classes in two spaces while generating classifiers for the unknown classes in the target domain . We further evaluate our method on digits datasets and demonstrate its effectiveness . 2 RELATED WORKS . 2.1 OPEN SET DOMAIN ADAPTATION . Open set domain adaptation goes beyond traditional close set domain adaptation . It considers a more realistic classification task , in which the target domain contains unknown samples that are not present in the source domain . Open set domain adaptation is first proposed by Busto et al . ( 2018 ) . They measure the distance between the target sample and the center of the source class to decide whether a target sample belongs to one of the source classes or the unknown class . However , they require the source domain to have unknown samples as well . Later on , Saito et al . ( 2018 ) propose open set back-propagation ( OSBP ) for source domain with no unknown samples . They utilize adversarial learning to train the feature generator and classifier . As the classifier tries to set a boundary for the unknown classes , the feature generator tries to deceive it . However , both of them only separate the unknown classes in the target domain , but can not give detailed classification on the unknown ones . The learnable information in the unknown space deserves deep exploitation . We have found few papers that consider the fine-grained classification of the unknown classes in open set domain adaptation , we aim to fill in the blanks . 2.2 ZERO-SHOT LEARNING . Zero-shot learning aims at generating classifiers for unknown classes with no labeled samples . Several pieces of research have been done on this area , such as Kipf & Welling ( 2016 ) Xian et al . ( 2017 ) . Due to the limitation of the available samples , some researchers extract complementary information from the related known classes to support the inference of the unknown ones . Among these methods , building the relationship between classes in form of a graph seems more reasonable . The special geometry of graphs well shows the complicated relationship and the unknown classes can gather adequate information from the known ones . Current zero-shot learning please refer to knowledge graphs for inference . Wang et al . ( 2018 ) built an unweighted knowledge graph combined with word embedding upon the graph convolutional network . With information propagation , novel nodes generate predictive classifiers with common sense . Kampffmeyer et al . ( 2019 ) improve upon this model and propose a dense graph propagation to prevent dilution of knowledge from distant nodes . Knowledge graphs intuitively present the stored information for the visual cognitive development . 2.3 GRAPH CONVOLUTIONAL NETWORK . Graph convolutional network ( GCN ) is a kind of graph neural network proposed by Kipf & Welling ( 2016 ) . GCN enables the nodes in the graph to share the intensity of statistics , which improves the efficiency of sampling . GCN can also be employed in non-euclidean space . From the perspective of the spatial domain , GCN iteratively aggregates neighborhood information . The propagation of information on the graph further exploits the structural information on the graph . GCN is first introduced by Bruna et al . ( 2013 ) . Then GCN is extended with a filtering method based on the recurrent Chebyshev polynomial . The improvement reduces the computational complexity a lot , which is equivalent to common CNNs in image operating . Kipf & Welling ( 2016 ) further simplify the framework to improve the scalability and robustness . They employed their model on the semisupervised learning on the graphs . Our model employs the framework of GCN to propagate the complementary information among nodes for the inference of classifiers . 3 APPROACH . 3.1 PROBLEM DEFINITION . In open set domain adaptation with zero-shot learning , we have a source domain Ds = { ( xsi , ysi ) } ns i=1 , which contains ns labeled samples , and a target domain Dt = { xtj } nt j=1 , which contains nt unlabeled samples . The class space in the source domain is Cs which we call known classes . Cs also is shared by the class space of the target domainCt . It is worth noting thatCt further contains additional unknown classes Cu , that is Ct = Cs ∨Cu . The source domain is sampled from the distribution qs , while the target domain is sampled from the distribution qt . In close set domain adaptation , qs 6= qt . In open set domain adaptation with zero-shot learning , we also define qs 6= qst . qst refers to the distribution of the known classes in the target domain . Note that the samples in the target domain are all unlabeled and the samples in the source domain are all labeled . 3.2 CLASSIFIER INFERENCE MODULE . With few labeled samples , the human can make good inferences on unfamiliar things with the related information that they obtain from books . Our model also extracts the task-based knowledge from a prestored knowledge graph . The inference graph is denoted as G = ( V , E ) , where V = { v1 , v2 , ... , vns , ... , vnt } is a node-set of all classes Ct. ns refers to the number of known classes . nt − ns refers to the number of unknown classes . The nodes in the prestored knowledge contain the attributes vi of different classes . E = { ei , j = ( vi , vj ) } is an edge set referring to the relationship among the graph . The edges in the prestored knowledge graph are based on the similarity of the attributes between different classes . Since we only have labeled data of the source domain . We first train the recognition model on the source domain Ds . Specifically , the pre-trained recognition model is denoted as C ( F ( ·|θ ) |w ) . The model consists of two parts , feature extractor F ( ·|θ ) and class classifier C ( ·|w ) . θ and w indicate the parameters of the model trained withDs = { ( x1 , y1 ) , ... , ( xns , ys ) } . The symbol xi refers to the source images of the ith class while yi refers to their label . Feature extractor F ( x|θ ) takes an image as input and figures out the feature vector of it as zi . The final classification score is computed as [ s1 , s2 , ... , sM ] = [ z Tw1 , z Tw2 , ... , z Twns ] ( 1 ) Thus the inference of the classifiers on unknown classes is to inference the classification weights ws on the unknown classes with the inference graph . With the framework of the graph convolutional network , Our model propagates information among nodes by exploring the class relationship . For one layer in GCN , a node aggregates information from the neighbors connected to it . GCN can also be extended to multiple layers to perform a deeper spread . Therefore , the unknown classes can utilize the information from the related known classes and predict the classification weights of their own . The mechanism of GCN is described as H ( l+1 ) = ReLu ( D̂− 1 2 ÊD̂− 1 2H ( l ) U ( l ) ) ( 2 ) where H ( l ) denotes the output of the lth layer , while for the first layer H0 = V . It uses Leaky ReLu as the nonlinear activation function . To reserve the self-information of the nodes , self-loops are added among the propagation , Ê = E + I , where E ∈ RN×N is the symmetric adjacency matrix and I ∈ RN×N represents identity matrix . Dii = ∑ j Eij normalizes rows in E to prevent the scale of input modified by E. The matrix U l is the weight matrix of the lth layer , which GCN regulates constantly to achieve better performance . Our model conducts two layers of GCN on the inference graph . Unknown classes learn the mechanism of end-to-end learning from known classes through propagation . The inference graph is trained to minimize the loss between the predicted classification weights and the ground-truth weights . The ground-truth weights refer to the classifiers of the known classes , which are extracted from the pretrained model on the source domain . LGCN = 1 M M∑ i=1 ( winfi − w train i ) 2 ( 3 ) wherewinf refers to the output of known classes on GCN.wtrain denotes the ground truth classifiers of the known classes obtained from the pre-trained model . With the supervision of the known classes , the unknown nodes in the inference graph can also generate classifier weights of their own . Finally , with the employment of GCN , the classifier inference module not only generates predictive classifiers of the unknown classes in the source domain but also provides more general classifiers of the known ones .
The paper considers the problem of open-set domain adaptation where the target domain has additional group of unknown classes and domain-shift with source domain. One interesting aspect of the paper is that the method utilizes a Knowledge Graph for zero-shot learning on the unknown classes. Further, the method utilizes an adversarial learning approach to align the source and target domain.
SP:a9d638e2afc2e3a87c18c146e52d1351cfe73918
Acceleration of Federated Learning with Alleviated Forgetting in Local Training
1 INTRODUCTION . Federated learning ( FL ) has emerged as a paradigm to train a global machine learning model in a distributed manner while taking privacy concerns and data protection regulations into consideration by keeping data on clients ( Voigt & Von dem Bussche , 2017 ) . The main challenge faced in FL is how to reduce the communication costs ( in training ) without degrading the performance of the final resultant model , especially when the data on different clients are not independently and identically distributed ( non-i.i.d . ) ( Yuan & Ma , 2020 ; Wang et al. , 2020b ) . The most popular FL algorithm is FedAvg ( McMahan et al. , 2017a ) . In each training round of FedAvg , local training steps are separately performed at every client and the locally trained models are transferred to the server . Then , the server aggregates the local models into a global model by simply averaging their parameters . Although FedAvg succeeds in many applications , its training processes often diverge when the data are non-i.i.d. , also known as heterogeneous , across the clients ( Li et al. , 2019 ; Zhao et al. , 2018 ) . Several FL algorithms have been designed to improve FedAvg and tackle the heterogeneity issue mainly by reducing the difference between locally trained parameters ( Li et al. , 2018 ; Karimireddy et al. , 2020 ) or aggregating these parameters into different groups ( Wang et al. , 2020a ; Yurochkin et al. , 2019 ) . However , the performance of these methods is still far from satisfactory when a deep neural network architecture is employed ( Rothchild et al. , 2020 ; Li et al. , 2021 ) . On the other hand , recent work in the literature ( Geiping et al. , 2020 ) shows that the transmission of trained model parameters does not ensure the protection of privacy . Privacy-sensitive information can be recovered ∗Minlie Huang and Tao Jiang are the co-corresponding authors . with gradient inversion attacks ( Zhu et al. , 2019 ) . Differential privacy ( DP ) ( McMahan et al. , 2017b ; Abadi et al. , 2016 ) is one of the most widely used strategies to prevent the leakage of private information . However , when DP is incorporated into FL , the performance of the resulting model decays significantly ( Jayaraman & Evans , 2019 ) . We observe that when the data are non-i.i.d . across the clients , the locally trained models suffer from severe forgetting of the knowledge of previous training data at the other clients ( i.e. , the well-known catastrophic forgetting issue ) , perhaps due to the discrepancy between local data distributions and the global data distribution . As shown in Figure 1 and supplementary Figure C.1 , this forgetting issue leads to a large increase in the loss concerning these training data under the non-i.i.d . setting , thereby slowing down the convergence speed . In this work , we propose a novel algorithm , FedReg , that reduces the communication costs in training by alleviating the catastrophic forgetting issue in the local training stage . FedReg reduces knowledge forgetting by regularizing the locally trained parameters with generated pseudo data , which are obtained by using modified local data to encode the knowledge of previous training data as learned by the global model . The potential conflict with the knowledge in the local data introduced by the pseudo data is dampened by the use of perturbed data , which are generated by making small perturbations to the local data , whose predictive values they help ensure . The generation of the pseudo data and perturbed data only relies on the global model received from the server and the local data on the current client . Thus , compared with FedAvg , no extra communication costs concerning the data on the other clients are incurred . Our extensive experiments demonstrate the superiority of FedReg in accelerating the FL training process , especially when the neural network architecture is deep and the clients ’ data are extremely heterogeneous . Furthermore , the pseudo data can be further utilized in classification problems to defend against gradient inversion attacks . More specifically , we show that with similar degree of protection of private information , the degradation in the performance of the global model learned by our method is much less than that learned by using FedAvg combined with DP . Our contributions . We demonstrate that when the data across clients are non-i.i.d. , catastrophic forgetting in the local training stage is an important factor that slows down the FL training process . We therefore propose a novel algorithm , FedReg , that accelerates FL by alleviating catastrophic forgetting with generated pseudo data . We also perform extensive experiments to establish the superiority of FedReg . We further show that in classification problems , the pseudo data generated in FedReg can help protect private information from gradient inversion attacks with much less impact on the performance of the resultant model compared with DP . 2 RELATED WORK . 2.1 FEDERATED LEARNING . FL is proposed to address privacy concerns in a distributed learning environment . In the FL paradigm , a client i keeps its local data Di on the client machine during the whole training process so that the server and other clients can not directly access Di . The objective is to find the parameter θ∗ that minimizes the loss on the global data ∪i∈CDi , where C is the set of clients , i.e. , θ∗ = argmin θ 1∑ i∈C |Di| ∑ d∈∪i∈CDi Lθ ( d ) , ( 1 ) In this equation , Lθ is the loss function with parameters θ , which can be cross-entropy or in some other custom-defined form . FedAvg ( McMahan et al. , 2017a ) and FedProx ( Li et al. , 2018 ) are the most widely used FL algorithms . In FedAvg , in a training round t , the server sends the initial parameters θ ( t−1 ) to a set of sampled clients C ( t ) . Then , the parameters are updated independently for S epochs on each of these clients to minimize the loss on the local data , and the locally trained parameters θ ( t , i ) are then sent to the server . The server aggregates the parameters by simply averaging over them and obtains the parameters θ ( t ) , i.e. , θ ( t ) = 1K ∑ i∈C ( t ) θ ( t , i ) , where K is the number of sampled clients in round t. FedAvg is unstable and diverge when the data are non-i.i.d . across different clients ( Li et al. , 2018 ) . FedProx stabilizes FedAvg by including a proximal term in the loss function to limit the distance between θ ( t , i ) and θ ( t−1 ) . Although FedProx provides a theoretical proof of convergence , empirically it fails to achieve good performances when deep neural network architectures are used ( Li et al. , 2021 ) . SCAFFOLD ( Karimireddy et al. , 2020 ) assumes that the heterogeneity of data leads to a client-drift in gradients and correlates the drift with gradient correction terms . As clients need to send extra information to the server , SCAFFOLD increases the risk of privacy leakage and doubles the communication burden compared with FedAvg . Furthermore , the accuracy of the correction terms is highly correlated with the training history of the client . Thus , the performance of SCAFFOLD decreases significantly when the number of clients is large , in which case each client is only sampled for few times and the estimation of the gradient correction terms is often inaccurate . FedCurv ( Shoham et al. , 2019 ) aims to tackle the forgetting issue on non-i.i.d . data with elastic weight consolidation ( Kirkpatrick et al. , 2017 ) . To achieve this , FedCurv needs to transfer Fisher information between the server and clients , which increases the communication costs to 2.5 times compared with FedAvg . Multiple methods ( Luo et al. , 2021 ; Hao et al. , 2021 ; Goetz & Tewari , 2020 ) have also tried to introduce synthesized data to help reduce the effect of heterogeneity , but they either rely on some specific architectures of neural networks ( Luo et al. , 2021 ) such as batch normalization ( Ioffe & Szegedy , 2015 ) or require the synthesized data to be shared with the server ( Hao et al. , 2021 ; Goetz & Tewari , 2020 ) , which contradicts the privacy protection objectives of FL . 2.2 CATASTROPHIC FORGETTING . Catastrophic forgetting occurs specifically when the neural network is trained sequentially on multiple tasks . In this case , the optimal parameters for the current task might perform poorly on the objectives of previous tasks . Many algorithms have been proposed to alleviate the forgetting issue . Memory-based methods ( Parisi et al. , 2019 ) have achieved excellent performances in accommodating new knowledge while retaining previously learned experience . Such memory-based methods , such as gradient episodic memory ( GEM ) ( Lopez-Paz & Ranzato , 2017 ) and averaged gradient episodic memory ( A-GEM ) ( Chaudhry et al. , 2018 ) , store a subset of data from previous tasks and replay the memorized data when training on the current task . For instance , A-GEM treats the losses on the episodic memories of previous tasks as inequality constraints in optimizing the objectives of current tasks and changes the model updates from the plain gradient g to g − wgref , where gref is the gradient computed from the loss on the memorized data and w is a non-negative weight . Unfortunately , these memory-based techniques are not suitable for FL due to privacy concerns . 2.3 GRADIENT INVERSION ATTACKS . FL provides a privacy guarantee by keeping the users ’ data on individual client machines locally and only sharing the model updates . However , recent research has shown that data information can be recovered from the parameter updates ( Geiping et al. , 2020 ; Zhu et al. , 2019 ) in the FedAvg framework by simply finding data with updates similar to the values returned from the client . DP , which avoids privacy leakage by adding noise to training data ( Sun et al. , 2019 ) or model updates ( Abadi et al. , 2016 ; McMahan et al. , 2017b ) , is the most widely used strategy to protect private information . When adding noise to model updates , such as differentially private SGD ( DPSGD ) ( Abadi et al. , 2016 ) , the noise level in DP is controlled by the gradient norm bound C and the noise scale σ. DP often causes a large performance degradation in the resultant model . 3 METHOD . Our main challenge is how to alleviate the forgetting of previously learned knowledge at each client without having to access data at the other clients in the local training stage . For any data set D , we denote the set of data near D within the Euclidean distance of δ as N ( D , δ ) = ∪d= ( x , y ) ∈D { ( x′ , y′ ) |0 < ∥x − x′∥ ≤ δ } . We assume that in round t on client i , ( 1 ) for all data d− ∈ ∪j∈C/ { i } Dj local to the other clients , the global model with parameter θ ( t−1 ) has a better feature representation than the local model with parameter θ ( t , i ) ; and ( 2 ) for any c > 0 , ∃ϵ , δ > 0 such that if ∀d′ = ( x′ , y′ ) ∈ N ( Di , δ ) , Lθ ( t , i ) ( ( x′ , fθ ( t−1 ) ( x′ ) ) ) − Lθ ( t−1 ) ( ( x′ , fθ ( t−1 ) ( x′ ) ) ) ≤ ϵ , then ∀d− = ( x− , y− ) ∈ ∪j∈C/ { i } Dj , Lθ ( t , i ) ( ( x− , fθ ( t−1 ) ( x− ) ) ) − Lθ ( t−1 ) ( ( x− , fθ ( t−1 ) ( x− ) ) ) ≤ c , where fθ is the prediction function with parameters θ . The assumption ( 2 ) guarantees that , in the local training stage , the range of changes in the predicted values of previous training data at the other clients can be controlled by constraining the changes in the predicted values of the local data near Di . Based on these assumptions , we first generate pseudo data and then alleviate the catastrophic forgetting issue by regularizing the locally trained parameters with the loss on the pseudo data . In other words , we hope that the pseudo data would achieve the same effect as the previous training data in constraining the local model . Note that FedReg does not assume any particular form of the loss function , but the method of modifying gradients to enhance privacy protection ( to be discussed below in Section 3.3 ) is currently only applicable to classification problems . The pseudo code of FedReg is provided in Appendix D .
The authors claim that in non-iid federated learning setups models experience catastrophic forgetting of previously encountered data. As a result, the performance of the model degrades and the convergence is slower. As a solution, the authors propose FedReg, a method to regularize the model with pseudo-data generated from the local data of the client. Two datasets are generated using the fast gradient sign method. The first dataset, termed pseudo-data, aims at simulating data of other clients in the system. The second dataset, termed perturbed data, aims at retaining the model power on the local dataset of the current client. These datasets are used along with the original data of the client to update the local model parameters. The authors further introduce a method to modify the gradients to enhance the protection of privacy. The authors compared their method against several baselines on MNIST, EMNIST, CIFAR-10, CIFAR-100, and CT images. The comparisons show that FedReg achieves significant improvements in accuracy and convergence, reduction in catastrophic forgetting, and better protection of privacy compared to baseline methods.
SP:9a7447196730e3d0003272aaa1c29b8ae21d9aad
Acceleration of Federated Learning with Alleviated Forgetting in Local Training
1 INTRODUCTION . Federated learning ( FL ) has emerged as a paradigm to train a global machine learning model in a distributed manner while taking privacy concerns and data protection regulations into consideration by keeping data on clients ( Voigt & Von dem Bussche , 2017 ) . The main challenge faced in FL is how to reduce the communication costs ( in training ) without degrading the performance of the final resultant model , especially when the data on different clients are not independently and identically distributed ( non-i.i.d . ) ( Yuan & Ma , 2020 ; Wang et al. , 2020b ) . The most popular FL algorithm is FedAvg ( McMahan et al. , 2017a ) . In each training round of FedAvg , local training steps are separately performed at every client and the locally trained models are transferred to the server . Then , the server aggregates the local models into a global model by simply averaging their parameters . Although FedAvg succeeds in many applications , its training processes often diverge when the data are non-i.i.d. , also known as heterogeneous , across the clients ( Li et al. , 2019 ; Zhao et al. , 2018 ) . Several FL algorithms have been designed to improve FedAvg and tackle the heterogeneity issue mainly by reducing the difference between locally trained parameters ( Li et al. , 2018 ; Karimireddy et al. , 2020 ) or aggregating these parameters into different groups ( Wang et al. , 2020a ; Yurochkin et al. , 2019 ) . However , the performance of these methods is still far from satisfactory when a deep neural network architecture is employed ( Rothchild et al. , 2020 ; Li et al. , 2021 ) . On the other hand , recent work in the literature ( Geiping et al. , 2020 ) shows that the transmission of trained model parameters does not ensure the protection of privacy . Privacy-sensitive information can be recovered ∗Minlie Huang and Tao Jiang are the co-corresponding authors . with gradient inversion attacks ( Zhu et al. , 2019 ) . Differential privacy ( DP ) ( McMahan et al. , 2017b ; Abadi et al. , 2016 ) is one of the most widely used strategies to prevent the leakage of private information . However , when DP is incorporated into FL , the performance of the resulting model decays significantly ( Jayaraman & Evans , 2019 ) . We observe that when the data are non-i.i.d . across the clients , the locally trained models suffer from severe forgetting of the knowledge of previous training data at the other clients ( i.e. , the well-known catastrophic forgetting issue ) , perhaps due to the discrepancy between local data distributions and the global data distribution . As shown in Figure 1 and supplementary Figure C.1 , this forgetting issue leads to a large increase in the loss concerning these training data under the non-i.i.d . setting , thereby slowing down the convergence speed . In this work , we propose a novel algorithm , FedReg , that reduces the communication costs in training by alleviating the catastrophic forgetting issue in the local training stage . FedReg reduces knowledge forgetting by regularizing the locally trained parameters with generated pseudo data , which are obtained by using modified local data to encode the knowledge of previous training data as learned by the global model . The potential conflict with the knowledge in the local data introduced by the pseudo data is dampened by the use of perturbed data , which are generated by making small perturbations to the local data , whose predictive values they help ensure . The generation of the pseudo data and perturbed data only relies on the global model received from the server and the local data on the current client . Thus , compared with FedAvg , no extra communication costs concerning the data on the other clients are incurred . Our extensive experiments demonstrate the superiority of FedReg in accelerating the FL training process , especially when the neural network architecture is deep and the clients ’ data are extremely heterogeneous . Furthermore , the pseudo data can be further utilized in classification problems to defend against gradient inversion attacks . More specifically , we show that with similar degree of protection of private information , the degradation in the performance of the global model learned by our method is much less than that learned by using FedAvg combined with DP . Our contributions . We demonstrate that when the data across clients are non-i.i.d. , catastrophic forgetting in the local training stage is an important factor that slows down the FL training process . We therefore propose a novel algorithm , FedReg , that accelerates FL by alleviating catastrophic forgetting with generated pseudo data . We also perform extensive experiments to establish the superiority of FedReg . We further show that in classification problems , the pseudo data generated in FedReg can help protect private information from gradient inversion attacks with much less impact on the performance of the resultant model compared with DP . 2 RELATED WORK . 2.1 FEDERATED LEARNING . FL is proposed to address privacy concerns in a distributed learning environment . In the FL paradigm , a client i keeps its local data Di on the client machine during the whole training process so that the server and other clients can not directly access Di . The objective is to find the parameter θ∗ that minimizes the loss on the global data ∪i∈CDi , where C is the set of clients , i.e. , θ∗ = argmin θ 1∑ i∈C |Di| ∑ d∈∪i∈CDi Lθ ( d ) , ( 1 ) In this equation , Lθ is the loss function with parameters θ , which can be cross-entropy or in some other custom-defined form . FedAvg ( McMahan et al. , 2017a ) and FedProx ( Li et al. , 2018 ) are the most widely used FL algorithms . In FedAvg , in a training round t , the server sends the initial parameters θ ( t−1 ) to a set of sampled clients C ( t ) . Then , the parameters are updated independently for S epochs on each of these clients to minimize the loss on the local data , and the locally trained parameters θ ( t , i ) are then sent to the server . The server aggregates the parameters by simply averaging over them and obtains the parameters θ ( t ) , i.e. , θ ( t ) = 1K ∑ i∈C ( t ) θ ( t , i ) , where K is the number of sampled clients in round t. FedAvg is unstable and diverge when the data are non-i.i.d . across different clients ( Li et al. , 2018 ) . FedProx stabilizes FedAvg by including a proximal term in the loss function to limit the distance between θ ( t , i ) and θ ( t−1 ) . Although FedProx provides a theoretical proof of convergence , empirically it fails to achieve good performances when deep neural network architectures are used ( Li et al. , 2021 ) . SCAFFOLD ( Karimireddy et al. , 2020 ) assumes that the heterogeneity of data leads to a client-drift in gradients and correlates the drift with gradient correction terms . As clients need to send extra information to the server , SCAFFOLD increases the risk of privacy leakage and doubles the communication burden compared with FedAvg . Furthermore , the accuracy of the correction terms is highly correlated with the training history of the client . Thus , the performance of SCAFFOLD decreases significantly when the number of clients is large , in which case each client is only sampled for few times and the estimation of the gradient correction terms is often inaccurate . FedCurv ( Shoham et al. , 2019 ) aims to tackle the forgetting issue on non-i.i.d . data with elastic weight consolidation ( Kirkpatrick et al. , 2017 ) . To achieve this , FedCurv needs to transfer Fisher information between the server and clients , which increases the communication costs to 2.5 times compared with FedAvg . Multiple methods ( Luo et al. , 2021 ; Hao et al. , 2021 ; Goetz & Tewari , 2020 ) have also tried to introduce synthesized data to help reduce the effect of heterogeneity , but they either rely on some specific architectures of neural networks ( Luo et al. , 2021 ) such as batch normalization ( Ioffe & Szegedy , 2015 ) or require the synthesized data to be shared with the server ( Hao et al. , 2021 ; Goetz & Tewari , 2020 ) , which contradicts the privacy protection objectives of FL . 2.2 CATASTROPHIC FORGETTING . Catastrophic forgetting occurs specifically when the neural network is trained sequentially on multiple tasks . In this case , the optimal parameters for the current task might perform poorly on the objectives of previous tasks . Many algorithms have been proposed to alleviate the forgetting issue . Memory-based methods ( Parisi et al. , 2019 ) have achieved excellent performances in accommodating new knowledge while retaining previously learned experience . Such memory-based methods , such as gradient episodic memory ( GEM ) ( Lopez-Paz & Ranzato , 2017 ) and averaged gradient episodic memory ( A-GEM ) ( Chaudhry et al. , 2018 ) , store a subset of data from previous tasks and replay the memorized data when training on the current task . For instance , A-GEM treats the losses on the episodic memories of previous tasks as inequality constraints in optimizing the objectives of current tasks and changes the model updates from the plain gradient g to g − wgref , where gref is the gradient computed from the loss on the memorized data and w is a non-negative weight . Unfortunately , these memory-based techniques are not suitable for FL due to privacy concerns . 2.3 GRADIENT INVERSION ATTACKS . FL provides a privacy guarantee by keeping the users ’ data on individual client machines locally and only sharing the model updates . However , recent research has shown that data information can be recovered from the parameter updates ( Geiping et al. , 2020 ; Zhu et al. , 2019 ) in the FedAvg framework by simply finding data with updates similar to the values returned from the client . DP , which avoids privacy leakage by adding noise to training data ( Sun et al. , 2019 ) or model updates ( Abadi et al. , 2016 ; McMahan et al. , 2017b ) , is the most widely used strategy to protect private information . When adding noise to model updates , such as differentially private SGD ( DPSGD ) ( Abadi et al. , 2016 ) , the noise level in DP is controlled by the gradient norm bound C and the noise scale σ. DP often causes a large performance degradation in the resultant model . 3 METHOD . Our main challenge is how to alleviate the forgetting of previously learned knowledge at each client without having to access data at the other clients in the local training stage . For any data set D , we denote the set of data near D within the Euclidean distance of δ as N ( D , δ ) = ∪d= ( x , y ) ∈D { ( x′ , y′ ) |0 < ∥x − x′∥ ≤ δ } . We assume that in round t on client i , ( 1 ) for all data d− ∈ ∪j∈C/ { i } Dj local to the other clients , the global model with parameter θ ( t−1 ) has a better feature representation than the local model with parameter θ ( t , i ) ; and ( 2 ) for any c > 0 , ∃ϵ , δ > 0 such that if ∀d′ = ( x′ , y′ ) ∈ N ( Di , δ ) , Lθ ( t , i ) ( ( x′ , fθ ( t−1 ) ( x′ ) ) ) − Lθ ( t−1 ) ( ( x′ , fθ ( t−1 ) ( x′ ) ) ) ≤ ϵ , then ∀d− = ( x− , y− ) ∈ ∪j∈C/ { i } Dj , Lθ ( t , i ) ( ( x− , fθ ( t−1 ) ( x− ) ) ) − Lθ ( t−1 ) ( ( x− , fθ ( t−1 ) ( x− ) ) ) ≤ c , where fθ is the prediction function with parameters θ . The assumption ( 2 ) guarantees that , in the local training stage , the range of changes in the predicted values of previous training data at the other clients can be controlled by constraining the changes in the predicted values of the local data near Di . Based on these assumptions , we first generate pseudo data and then alleviate the catastrophic forgetting issue by regularizing the locally trained parameters with the loss on the pseudo data . In other words , we hope that the pseudo data would achieve the same effect as the previous training data in constraining the local model . Note that FedReg does not assume any particular form of the loss function , but the method of modifying gradients to enhance privacy protection ( to be discussed below in Section 3.3 ) is currently only applicable to classification problems . The pseudo code of FedReg is provided in Appendix D .
This paper aims to alleviate forgetting in federated learning on non iid data. The method proposed FedReg focuses on regularizing locally trained parameters with the loss on generated pseudo data, which are based on adversarial examples of the global model in the previous step and the adversarial examples of the local model at current step. This paper experiments on several small scale dataset with large number of clients. It shows improved performance and less forgetting during the training.
SP:9a7447196730e3d0003272aaa1c29b8ae21d9aad
Acceleration of Federated Learning with Alleviated Forgetting in Local Training
1 INTRODUCTION . Federated learning ( FL ) has emerged as a paradigm to train a global machine learning model in a distributed manner while taking privacy concerns and data protection regulations into consideration by keeping data on clients ( Voigt & Von dem Bussche , 2017 ) . The main challenge faced in FL is how to reduce the communication costs ( in training ) without degrading the performance of the final resultant model , especially when the data on different clients are not independently and identically distributed ( non-i.i.d . ) ( Yuan & Ma , 2020 ; Wang et al. , 2020b ) . The most popular FL algorithm is FedAvg ( McMahan et al. , 2017a ) . In each training round of FedAvg , local training steps are separately performed at every client and the locally trained models are transferred to the server . Then , the server aggregates the local models into a global model by simply averaging their parameters . Although FedAvg succeeds in many applications , its training processes often diverge when the data are non-i.i.d. , also known as heterogeneous , across the clients ( Li et al. , 2019 ; Zhao et al. , 2018 ) . Several FL algorithms have been designed to improve FedAvg and tackle the heterogeneity issue mainly by reducing the difference between locally trained parameters ( Li et al. , 2018 ; Karimireddy et al. , 2020 ) or aggregating these parameters into different groups ( Wang et al. , 2020a ; Yurochkin et al. , 2019 ) . However , the performance of these methods is still far from satisfactory when a deep neural network architecture is employed ( Rothchild et al. , 2020 ; Li et al. , 2021 ) . On the other hand , recent work in the literature ( Geiping et al. , 2020 ) shows that the transmission of trained model parameters does not ensure the protection of privacy . Privacy-sensitive information can be recovered ∗Minlie Huang and Tao Jiang are the co-corresponding authors . with gradient inversion attacks ( Zhu et al. , 2019 ) . Differential privacy ( DP ) ( McMahan et al. , 2017b ; Abadi et al. , 2016 ) is one of the most widely used strategies to prevent the leakage of private information . However , when DP is incorporated into FL , the performance of the resulting model decays significantly ( Jayaraman & Evans , 2019 ) . We observe that when the data are non-i.i.d . across the clients , the locally trained models suffer from severe forgetting of the knowledge of previous training data at the other clients ( i.e. , the well-known catastrophic forgetting issue ) , perhaps due to the discrepancy between local data distributions and the global data distribution . As shown in Figure 1 and supplementary Figure C.1 , this forgetting issue leads to a large increase in the loss concerning these training data under the non-i.i.d . setting , thereby slowing down the convergence speed . In this work , we propose a novel algorithm , FedReg , that reduces the communication costs in training by alleviating the catastrophic forgetting issue in the local training stage . FedReg reduces knowledge forgetting by regularizing the locally trained parameters with generated pseudo data , which are obtained by using modified local data to encode the knowledge of previous training data as learned by the global model . The potential conflict with the knowledge in the local data introduced by the pseudo data is dampened by the use of perturbed data , which are generated by making small perturbations to the local data , whose predictive values they help ensure . The generation of the pseudo data and perturbed data only relies on the global model received from the server and the local data on the current client . Thus , compared with FedAvg , no extra communication costs concerning the data on the other clients are incurred . Our extensive experiments demonstrate the superiority of FedReg in accelerating the FL training process , especially when the neural network architecture is deep and the clients ’ data are extremely heterogeneous . Furthermore , the pseudo data can be further utilized in classification problems to defend against gradient inversion attacks . More specifically , we show that with similar degree of protection of private information , the degradation in the performance of the global model learned by our method is much less than that learned by using FedAvg combined with DP . Our contributions . We demonstrate that when the data across clients are non-i.i.d. , catastrophic forgetting in the local training stage is an important factor that slows down the FL training process . We therefore propose a novel algorithm , FedReg , that accelerates FL by alleviating catastrophic forgetting with generated pseudo data . We also perform extensive experiments to establish the superiority of FedReg . We further show that in classification problems , the pseudo data generated in FedReg can help protect private information from gradient inversion attacks with much less impact on the performance of the resultant model compared with DP . 2 RELATED WORK . 2.1 FEDERATED LEARNING . FL is proposed to address privacy concerns in a distributed learning environment . In the FL paradigm , a client i keeps its local data Di on the client machine during the whole training process so that the server and other clients can not directly access Di . The objective is to find the parameter θ∗ that minimizes the loss on the global data ∪i∈CDi , where C is the set of clients , i.e. , θ∗ = argmin θ 1∑ i∈C |Di| ∑ d∈∪i∈CDi Lθ ( d ) , ( 1 ) In this equation , Lθ is the loss function with parameters θ , which can be cross-entropy or in some other custom-defined form . FedAvg ( McMahan et al. , 2017a ) and FedProx ( Li et al. , 2018 ) are the most widely used FL algorithms . In FedAvg , in a training round t , the server sends the initial parameters θ ( t−1 ) to a set of sampled clients C ( t ) . Then , the parameters are updated independently for S epochs on each of these clients to minimize the loss on the local data , and the locally trained parameters θ ( t , i ) are then sent to the server . The server aggregates the parameters by simply averaging over them and obtains the parameters θ ( t ) , i.e. , θ ( t ) = 1K ∑ i∈C ( t ) θ ( t , i ) , where K is the number of sampled clients in round t. FedAvg is unstable and diverge when the data are non-i.i.d . across different clients ( Li et al. , 2018 ) . FedProx stabilizes FedAvg by including a proximal term in the loss function to limit the distance between θ ( t , i ) and θ ( t−1 ) . Although FedProx provides a theoretical proof of convergence , empirically it fails to achieve good performances when deep neural network architectures are used ( Li et al. , 2021 ) . SCAFFOLD ( Karimireddy et al. , 2020 ) assumes that the heterogeneity of data leads to a client-drift in gradients and correlates the drift with gradient correction terms . As clients need to send extra information to the server , SCAFFOLD increases the risk of privacy leakage and doubles the communication burden compared with FedAvg . Furthermore , the accuracy of the correction terms is highly correlated with the training history of the client . Thus , the performance of SCAFFOLD decreases significantly when the number of clients is large , in which case each client is only sampled for few times and the estimation of the gradient correction terms is often inaccurate . FedCurv ( Shoham et al. , 2019 ) aims to tackle the forgetting issue on non-i.i.d . data with elastic weight consolidation ( Kirkpatrick et al. , 2017 ) . To achieve this , FedCurv needs to transfer Fisher information between the server and clients , which increases the communication costs to 2.5 times compared with FedAvg . Multiple methods ( Luo et al. , 2021 ; Hao et al. , 2021 ; Goetz & Tewari , 2020 ) have also tried to introduce synthesized data to help reduce the effect of heterogeneity , but they either rely on some specific architectures of neural networks ( Luo et al. , 2021 ) such as batch normalization ( Ioffe & Szegedy , 2015 ) or require the synthesized data to be shared with the server ( Hao et al. , 2021 ; Goetz & Tewari , 2020 ) , which contradicts the privacy protection objectives of FL . 2.2 CATASTROPHIC FORGETTING . Catastrophic forgetting occurs specifically when the neural network is trained sequentially on multiple tasks . In this case , the optimal parameters for the current task might perform poorly on the objectives of previous tasks . Many algorithms have been proposed to alleviate the forgetting issue . Memory-based methods ( Parisi et al. , 2019 ) have achieved excellent performances in accommodating new knowledge while retaining previously learned experience . Such memory-based methods , such as gradient episodic memory ( GEM ) ( Lopez-Paz & Ranzato , 2017 ) and averaged gradient episodic memory ( A-GEM ) ( Chaudhry et al. , 2018 ) , store a subset of data from previous tasks and replay the memorized data when training on the current task . For instance , A-GEM treats the losses on the episodic memories of previous tasks as inequality constraints in optimizing the objectives of current tasks and changes the model updates from the plain gradient g to g − wgref , where gref is the gradient computed from the loss on the memorized data and w is a non-negative weight . Unfortunately , these memory-based techniques are not suitable for FL due to privacy concerns . 2.3 GRADIENT INVERSION ATTACKS . FL provides a privacy guarantee by keeping the users ’ data on individual client machines locally and only sharing the model updates . However , recent research has shown that data information can be recovered from the parameter updates ( Geiping et al. , 2020 ; Zhu et al. , 2019 ) in the FedAvg framework by simply finding data with updates similar to the values returned from the client . DP , which avoids privacy leakage by adding noise to training data ( Sun et al. , 2019 ) or model updates ( Abadi et al. , 2016 ; McMahan et al. , 2017b ) , is the most widely used strategy to protect private information . When adding noise to model updates , such as differentially private SGD ( DPSGD ) ( Abadi et al. , 2016 ) , the noise level in DP is controlled by the gradient norm bound C and the noise scale σ. DP often causes a large performance degradation in the resultant model . 3 METHOD . Our main challenge is how to alleviate the forgetting of previously learned knowledge at each client without having to access data at the other clients in the local training stage . For any data set D , we denote the set of data near D within the Euclidean distance of δ as N ( D , δ ) = ∪d= ( x , y ) ∈D { ( x′ , y′ ) |0 < ∥x − x′∥ ≤ δ } . We assume that in round t on client i , ( 1 ) for all data d− ∈ ∪j∈C/ { i } Dj local to the other clients , the global model with parameter θ ( t−1 ) has a better feature representation than the local model with parameter θ ( t , i ) ; and ( 2 ) for any c > 0 , ∃ϵ , δ > 0 such that if ∀d′ = ( x′ , y′ ) ∈ N ( Di , δ ) , Lθ ( t , i ) ( ( x′ , fθ ( t−1 ) ( x′ ) ) ) − Lθ ( t−1 ) ( ( x′ , fθ ( t−1 ) ( x′ ) ) ) ≤ ϵ , then ∀d− = ( x− , y− ) ∈ ∪j∈C/ { i } Dj , Lθ ( t , i ) ( ( x− , fθ ( t−1 ) ( x− ) ) ) − Lθ ( t−1 ) ( ( x− , fθ ( t−1 ) ( x− ) ) ) ≤ c , where fθ is the prediction function with parameters θ . The assumption ( 2 ) guarantees that , in the local training stage , the range of changes in the predicted values of previous training data at the other clients can be controlled by constraining the changes in the predicted values of the local data near Di . Based on these assumptions , we first generate pseudo data and then alleviate the catastrophic forgetting issue by regularizing the locally trained parameters with the loss on the pseudo data . In other words , we hope that the pseudo data would achieve the same effect as the previous training data in constraining the local model . Note that FedReg does not assume any particular form of the loss function , but the method of modifying gradients to enhance privacy protection ( to be discussed below in Section 3.3 ) is currently only applicable to classification problems . The pseudo code of FedReg is provided in Appendix D .
This paper considers the catastrophic forgetting issue in federated learning. The authors observe that this issue is (at least partially) responsible for slow convergence of existing FL methods when the data are not independently and identically distributed (non-i.i.d.) across different clients. This paper proposes FedReg, an algorithm to alleviate the catastrophic forgetting issue by regularizing the local model parameters on the generated pseudo data.
SP:9a7447196730e3d0003272aaa1c29b8ae21d9aad
Label-Efficient Semantic Segmentation with Diffusion Models
1 INTRODUCTION . Denoising diffusion probabilistic models ( DDPM ) ( Sohl-Dickstein et al. , 2015 ; Ho et al. , 2020 ) have recently outperformed alternative approaches to model the distribution of natural images both in the realism of individual samples and their diversity ( Dhariwal & Nichol , 2021 ) . These advantages of DDPM are successfully exploited in applications , such as colorization ( Song et al. , 2021 ) , inpainting ( Song et al. , 2021 ) , super-resolution ( Saharia et al. , 2021 ; Li et al. , 2021b ) , and semantic editing ( Meng et al. , 2021 ) , where DDPM often achieve more impressive results compared to GANs . So far , however , DDPM were not exploited as a source of effective image representations for discriminative computer vision problems . While the prior literature has demonstrated that various generative paradigms , such as GANs ( Donahue & Simonyan , 2019 ) or autoregressive models ( Chen et al. , 2020a ) , can be used to extract the representations for common vision tasks , it is not clear if DDPM can also serve as representation learners . In this paper , we provide an affirmative answer to this question in the context of semantic segmentation . In particular , we investigate the intermediate activations from the U-Net network that approximates the Markov step of the reverse diffusion process in DDPM . Intuitively , this network learns to denoise its input , and it is not clear why the intermediate activations should capture semantic information needed for high-level vision problems . Nevertheless , we show that on the certain diffusion steps , these activations do capture such information , therefore , can potentially be used as image representations for downstream tasks . Given these observations , we propose a simple semantic segmentation method , which exploits these representations and successfully works even if only a few labeled images are provided . On several datasets , we show that our DDPM-based segmentation method outperforms the existing baselines for the same amount of supervision . To sum up , the contributions of our paper are : 1 . We investigate the representations learned by the state-of-the-art DDPM and show that they capture high-level semantic information valuable for downstream vision tasks . 1anonymous URL 2 . We design a simple segmentation approach that exploits these representations and outperforms the alternatives in the few-shot operating point . 3 . We compare the DDPM-based representations with their GAN-based counterparts on the same datasets and demonstrate the advantages of the former in the context of semantic segmentation . 2 RELATED WORK . In this section , we briefly describe the existing research lines relevant to our work . Diffusion models ( Sohl-Dickstein et al. , 2015 ; Ho et al. , 2020 ) are a class of generative models that approximate the distribution of real images by the endpoint of the Markov chain that originates from a simple parametric distribution , typically a standard Gaussian . Each Markov step is modeled by a deep neural network that effectively learns to invert the diffusion process with a known Gaussian kernel . ( Ho et al. , 2020 ) highlighted the equivalence of diffusion models and score matching ( Song & Ermon , 2019 ; 2020 ) , showing them to be two different perspectives on the gradual conversion of a simple known distribution into a target distribution via the iterative denoising process . Very recent works ( Nichol & Dhariwal , 2021 ; Dhariwal & Nichol , 2021 ) have developed more powerful model architectures as well as different advanced objectives for DDPM , which led to the “ victory ” of DDPM over GANs in terms of generative quality and diversity . DDPM have been widely used in several applications , including image colorization ( Song et al. , 2021 ) , super-resolution ( Saharia et al. , 2021 ; Li et al. , 2021b ) , inpainting ( Song et al. , 2021 ) , semantic editing ( Meng et al. , 2021 ) . In our work , we demonstrate that one can also successfully use them for semantic segmentation . Image segmentation with generative models is an active research direction at the moment , however , existing methods are primarily based on GANs . The first line of works ( Voynov & Babenko , 2020 ; Voynov et al. , 2021 ; Melas-Kyriazi et al. , 2021 ) is based on the evidence that the latent spaces of the state-of-the-art GANs have directions corresponding to effects that influence the foreground/background pixels differently , which allows producing synthetic data to train segmentation models . However , the approaches from ( Voynov & Babenko , 2020 ; Voynov et al. , 2021 ; MelasKyriazi et al. , 2021 ) are currently able to perform binary segmentation only , and it is not clear if they can be used in the general setup of semantic segmentation . The second line of works ( Zhang et al. , 2021 ; Tritrong et al. , 2021 ; Xu & Zheng , 2021 ) is more relevant to our study since they are based on the intermediate representations obtained in GANs . In particular , the method proposed in ( Zhang et al. , 2021 ) trains a pixel class prediction model on these representations and confirms their label efficiency . In the experimental section , we compare the method from ( Zhang et al. , 2021 ) to our DDPM-based one and demonstrate several distinctive advantages of our solution . Representations from generative models for discriminative tasks . The usage of generative models as representation learners has been widely investigated for global prediction ( Donahue & Simonyan , 2019 ; Chen et al. , 2020a ) , and dense prediction problems ( Zhang et al. , 2021 ; Tritrong et al. , 2021 ; Xu & Zheng , 2021 ; Xu et al. , 2021 ) . While previous works highlighted the practical advantages of these representations , such as out-of-distribution robustness ( Li et al. , 2021a ) , generative models as representation learners receive less attention compared to alternative unsupervised methods , e.g. , based on contrastive learning ( Chen et al. , 2020b ) . The main reason is probably the difficulty of training a high-quality generative model on a complex , diverse dataset . However , given the recent success of DDPM on Imagenet ( Deng et al. , 2009 ) , one can expect that this direction will attract more attention in the future . 3 REPRESENTATIONS FROM DIFFUSION MODELS . In the following section , we investigate the image representations learned by diffusion models . First , we provide a brief overview of the DDPM framework . Then , we describe how to extract features from them and investigate what kind of semantic information these features might capture . Background . Diffusion models transform noise xT∼N ( 0 , I ) to the sample x0 by gradually denoising xT to less noisy samples xt . Formally , we are given a forward diffusion process : q ( xt|xt−1 ) : = N ( xt ; √ 1− βtxt−1 , βtI ) , ( 1 ) for some fixed variance schedule β1 , . . . , βt . Importantly , a noisy sample xt can be obtained directly from the data x0 : xt = √ ᾱtx0 + √ 1− ᾱt , ( 2 ) where ∼ N ( 0 , 1 ) and αt : = 1− βt , ᾱt : = ∏t s=1 αs . Pretrained DDPM approximates a reverse process : pθ ( xt−1|xt ) : = N ( xt ; µθ ( xt , t ) , Σθ ( xt , t ) ) . ( 3 ) In practice , rather than predicting the mean of the distribution in Equation ( 3 ) , the noise predictor network θ ( xt , t ) predicts the noise component at the step t ; the mean is then a linear combination of this noise component and xt . The covariance predictor Σθ ( xt , t ) can be either a fixed set of scalar covariances or learned as well ( the latter was shown to improve the quality of models ( Nichol & Dhariwal , 2021 ) ) . The denoising model θ ( xt , t ) is typically parameterized by different variants of the UNet architecture ( Ronneberger et al. , 2015 ) , and in our experiments we investigate the state-of-the-art one proposed in ( Dhariwal & Nichol , 2021 ) . Extracting representations . For a given real image x0 ∈ RH×W×3 , one can compute T sets of activation tensors from the noise predictor network θ ( xt , t ) . Formally for t = T . . . 1 we first corrupt x0 by adding a Gaussian noise : xt = √ ᾱtx0+ √ 1− ᾱt . The noisy xt is used as an input of θ ( xt , t ) parameterized by the UNet model . The UNet ’ s intermediate activations are then upsampled to H×W with bilinear interpolation . This allows treating them as pixel-level representations of x0 . 3.1 REPRESENTATION ANALYSIS . We analyze the representations produced by the noise predictor θ ( xt , t ) for different t. We consider the state-of-the-art DDPM checkpoints trained on the LSUN-Bedroom and FFHQ datasets2 . The intermediate activations from the noise predictor capture semantic information . For this experiment , we take a few images from the LSUN-Bedroom and FFHQ datasets and manually assign each pixel to one of the 28 and 34 semantic classes , respectively . Our goal is to understand whether the pixel-level representations produced by DDPM effectively capture the information about semantics . To this end , we train a multi-layer perceptron ( MLP ) to predict the pixel semantic label from its features produced by one of the 18 UNet decoder blocks on a specific diffusion step t. Note that we consider only the decoder activations because they also aggregate the encoder ones through the skip connections . MLP is trained on 20 images and evaluated on 20 hold-out ones . The predictive performance is measured in terms of mean IoU . 2https : //github.com/openai/guided-diffusion The evolution of predictive performance across the different blocks and diffusion steps t is presented in Figure 2 . The blocks are numbered from the deep to shallow ones . Figure 2 shows that the discriminability of the features produced by the noise predictor θ ( xt , t ) varies for different blocks and diffusion steps . In particular , the features corresponding to the later steps of the reverse diffusion process typically capture semantic information more effectively . In contrast , the ones corresponding to the early steps are generally uninformative . Across different blocks , the features produced by the layers in the middle of the UNet decoder appear to be the most informative on all diffusion steps . Additionally , we split the LSUN-Bedroom semantic classes into small-sized and big-sized based on the average area in the annotated dataset . Then , we evaluate mean IoU for these classes independently across the different UNet blocks and diffusion steps . The results are presented in Figure 3 . As expected , for big-sized objects , the predictive performance starts growing earlier in the reverse process . The shallow blocks ( 10 , 12 ) are more informative for small-sized objects , while the deeper ones ( 2 , 4 ) are for big-sized ones . Figure 2 implies that for certain UNet blocks and diffusion steps , similar DDPM-based representations correspond to the pixels of the same semantics . Figure 1 shows the k-means clusters ( k=5 ) formed by the features extracted from the blocks { 6 , 8 , 10 , 12 } on the diffusion steps { 50 , 250 , 450 , 650 , 850 } , and confirms that clusters can span coherent semantic objects and objectparts . In the block B=6 , the features correspond to coarse semantic masks , e.g. , they can not discriminate between various face parts . On the other extreme , the features from B=12 do not exhibit semantic meaningness , reaffirming the predictive performance behavior from Figure 2 . The block B=8 appears to be a “ sweet spot ” demonstrating fine-grained semantic fragmentation . Across different diffusion steps , the most meaningful features correspond to the later ones . We attribute this behavior to the fact that on the earlier diffusion steps , the global structure of a DDPM sample has not emerged yet , therefore , it is hardly possible to predict segmentation masks at this stage . This intuition is qualitatively confirmed by the masks in Figure 1 . For t=850 , the masks poorly reflect the content of actual images , while for smaller values of t , the masks and images are semantically coherent .
This paper explores to what extent Denoising Diffusion Probabilistic Models (DDPMs) serve as good representational learners for transfer or semi-supervised learning on downstream tasks. They are particularly interested in the semantic segmentation as a prototypical dense computer vision task. They find that DDPM do provide useful representations. In particular they show that the middle U-NET layers, at intermediate steps in the reverse diffusion process produce activations from which a simple MLP can infer good segmentations results (as measured by IoU). They demonstrate very good results in a substantial number of experiments in which a DDPM is learned from a large set of unlabeled images, and then the MLP is trained on a relatively small set of labelled in-domain images, and then evaluated. They show that a simple segmentation network trained on top of DDPM activations outperforming a wide array of baseline models, including DatasetGAN and other recent SOTA methods.
SP:7b1e5eed0da0d5d3c3618f7c848ae79e9e96dffe
Label-Efficient Semantic Segmentation with Diffusion Models
1 INTRODUCTION . Denoising diffusion probabilistic models ( DDPM ) ( Sohl-Dickstein et al. , 2015 ; Ho et al. , 2020 ) have recently outperformed alternative approaches to model the distribution of natural images both in the realism of individual samples and their diversity ( Dhariwal & Nichol , 2021 ) . These advantages of DDPM are successfully exploited in applications , such as colorization ( Song et al. , 2021 ) , inpainting ( Song et al. , 2021 ) , super-resolution ( Saharia et al. , 2021 ; Li et al. , 2021b ) , and semantic editing ( Meng et al. , 2021 ) , where DDPM often achieve more impressive results compared to GANs . So far , however , DDPM were not exploited as a source of effective image representations for discriminative computer vision problems . While the prior literature has demonstrated that various generative paradigms , such as GANs ( Donahue & Simonyan , 2019 ) or autoregressive models ( Chen et al. , 2020a ) , can be used to extract the representations for common vision tasks , it is not clear if DDPM can also serve as representation learners . In this paper , we provide an affirmative answer to this question in the context of semantic segmentation . In particular , we investigate the intermediate activations from the U-Net network that approximates the Markov step of the reverse diffusion process in DDPM . Intuitively , this network learns to denoise its input , and it is not clear why the intermediate activations should capture semantic information needed for high-level vision problems . Nevertheless , we show that on the certain diffusion steps , these activations do capture such information , therefore , can potentially be used as image representations for downstream tasks . Given these observations , we propose a simple semantic segmentation method , which exploits these representations and successfully works even if only a few labeled images are provided . On several datasets , we show that our DDPM-based segmentation method outperforms the existing baselines for the same amount of supervision . To sum up , the contributions of our paper are : 1 . We investigate the representations learned by the state-of-the-art DDPM and show that they capture high-level semantic information valuable for downstream vision tasks . 1anonymous URL 2 . We design a simple segmentation approach that exploits these representations and outperforms the alternatives in the few-shot operating point . 3 . We compare the DDPM-based representations with their GAN-based counterparts on the same datasets and demonstrate the advantages of the former in the context of semantic segmentation . 2 RELATED WORK . In this section , we briefly describe the existing research lines relevant to our work . Diffusion models ( Sohl-Dickstein et al. , 2015 ; Ho et al. , 2020 ) are a class of generative models that approximate the distribution of real images by the endpoint of the Markov chain that originates from a simple parametric distribution , typically a standard Gaussian . Each Markov step is modeled by a deep neural network that effectively learns to invert the diffusion process with a known Gaussian kernel . ( Ho et al. , 2020 ) highlighted the equivalence of diffusion models and score matching ( Song & Ermon , 2019 ; 2020 ) , showing them to be two different perspectives on the gradual conversion of a simple known distribution into a target distribution via the iterative denoising process . Very recent works ( Nichol & Dhariwal , 2021 ; Dhariwal & Nichol , 2021 ) have developed more powerful model architectures as well as different advanced objectives for DDPM , which led to the “ victory ” of DDPM over GANs in terms of generative quality and diversity . DDPM have been widely used in several applications , including image colorization ( Song et al. , 2021 ) , super-resolution ( Saharia et al. , 2021 ; Li et al. , 2021b ) , inpainting ( Song et al. , 2021 ) , semantic editing ( Meng et al. , 2021 ) . In our work , we demonstrate that one can also successfully use them for semantic segmentation . Image segmentation with generative models is an active research direction at the moment , however , existing methods are primarily based on GANs . The first line of works ( Voynov & Babenko , 2020 ; Voynov et al. , 2021 ; Melas-Kyriazi et al. , 2021 ) is based on the evidence that the latent spaces of the state-of-the-art GANs have directions corresponding to effects that influence the foreground/background pixels differently , which allows producing synthetic data to train segmentation models . However , the approaches from ( Voynov & Babenko , 2020 ; Voynov et al. , 2021 ; MelasKyriazi et al. , 2021 ) are currently able to perform binary segmentation only , and it is not clear if they can be used in the general setup of semantic segmentation . The second line of works ( Zhang et al. , 2021 ; Tritrong et al. , 2021 ; Xu & Zheng , 2021 ) is more relevant to our study since they are based on the intermediate representations obtained in GANs . In particular , the method proposed in ( Zhang et al. , 2021 ) trains a pixel class prediction model on these representations and confirms their label efficiency . In the experimental section , we compare the method from ( Zhang et al. , 2021 ) to our DDPM-based one and demonstrate several distinctive advantages of our solution . Representations from generative models for discriminative tasks . The usage of generative models as representation learners has been widely investigated for global prediction ( Donahue & Simonyan , 2019 ; Chen et al. , 2020a ) , and dense prediction problems ( Zhang et al. , 2021 ; Tritrong et al. , 2021 ; Xu & Zheng , 2021 ; Xu et al. , 2021 ) . While previous works highlighted the practical advantages of these representations , such as out-of-distribution robustness ( Li et al. , 2021a ) , generative models as representation learners receive less attention compared to alternative unsupervised methods , e.g. , based on contrastive learning ( Chen et al. , 2020b ) . The main reason is probably the difficulty of training a high-quality generative model on a complex , diverse dataset . However , given the recent success of DDPM on Imagenet ( Deng et al. , 2009 ) , one can expect that this direction will attract more attention in the future . 3 REPRESENTATIONS FROM DIFFUSION MODELS . In the following section , we investigate the image representations learned by diffusion models . First , we provide a brief overview of the DDPM framework . Then , we describe how to extract features from them and investigate what kind of semantic information these features might capture . Background . Diffusion models transform noise xT∼N ( 0 , I ) to the sample x0 by gradually denoising xT to less noisy samples xt . Formally , we are given a forward diffusion process : q ( xt|xt−1 ) : = N ( xt ; √ 1− βtxt−1 , βtI ) , ( 1 ) for some fixed variance schedule β1 , . . . , βt . Importantly , a noisy sample xt can be obtained directly from the data x0 : xt = √ ᾱtx0 + √ 1− ᾱt , ( 2 ) where ∼ N ( 0 , 1 ) and αt : = 1− βt , ᾱt : = ∏t s=1 αs . Pretrained DDPM approximates a reverse process : pθ ( xt−1|xt ) : = N ( xt ; µθ ( xt , t ) , Σθ ( xt , t ) ) . ( 3 ) In practice , rather than predicting the mean of the distribution in Equation ( 3 ) , the noise predictor network θ ( xt , t ) predicts the noise component at the step t ; the mean is then a linear combination of this noise component and xt . The covariance predictor Σθ ( xt , t ) can be either a fixed set of scalar covariances or learned as well ( the latter was shown to improve the quality of models ( Nichol & Dhariwal , 2021 ) ) . The denoising model θ ( xt , t ) is typically parameterized by different variants of the UNet architecture ( Ronneberger et al. , 2015 ) , and in our experiments we investigate the state-of-the-art one proposed in ( Dhariwal & Nichol , 2021 ) . Extracting representations . For a given real image x0 ∈ RH×W×3 , one can compute T sets of activation tensors from the noise predictor network θ ( xt , t ) . Formally for t = T . . . 1 we first corrupt x0 by adding a Gaussian noise : xt = √ ᾱtx0+ √ 1− ᾱt . The noisy xt is used as an input of θ ( xt , t ) parameterized by the UNet model . The UNet ’ s intermediate activations are then upsampled to H×W with bilinear interpolation . This allows treating them as pixel-level representations of x0 . 3.1 REPRESENTATION ANALYSIS . We analyze the representations produced by the noise predictor θ ( xt , t ) for different t. We consider the state-of-the-art DDPM checkpoints trained on the LSUN-Bedroom and FFHQ datasets2 . The intermediate activations from the noise predictor capture semantic information . For this experiment , we take a few images from the LSUN-Bedroom and FFHQ datasets and manually assign each pixel to one of the 28 and 34 semantic classes , respectively . Our goal is to understand whether the pixel-level representations produced by DDPM effectively capture the information about semantics . To this end , we train a multi-layer perceptron ( MLP ) to predict the pixel semantic label from its features produced by one of the 18 UNet decoder blocks on a specific diffusion step t. Note that we consider only the decoder activations because they also aggregate the encoder ones through the skip connections . MLP is trained on 20 images and evaluated on 20 hold-out ones . The predictive performance is measured in terms of mean IoU . 2https : //github.com/openai/guided-diffusion The evolution of predictive performance across the different blocks and diffusion steps t is presented in Figure 2 . The blocks are numbered from the deep to shallow ones . Figure 2 shows that the discriminability of the features produced by the noise predictor θ ( xt , t ) varies for different blocks and diffusion steps . In particular , the features corresponding to the later steps of the reverse diffusion process typically capture semantic information more effectively . In contrast , the ones corresponding to the early steps are generally uninformative . Across different blocks , the features produced by the layers in the middle of the UNet decoder appear to be the most informative on all diffusion steps . Additionally , we split the LSUN-Bedroom semantic classes into small-sized and big-sized based on the average area in the annotated dataset . Then , we evaluate mean IoU for these classes independently across the different UNet blocks and diffusion steps . The results are presented in Figure 3 . As expected , for big-sized objects , the predictive performance starts growing earlier in the reverse process . The shallow blocks ( 10 , 12 ) are more informative for small-sized objects , while the deeper ones ( 2 , 4 ) are for big-sized ones . Figure 2 implies that for certain UNet blocks and diffusion steps , similar DDPM-based representations correspond to the pixels of the same semantics . Figure 1 shows the k-means clusters ( k=5 ) formed by the features extracted from the blocks { 6 , 8 , 10 , 12 } on the diffusion steps { 50 , 250 , 450 , 650 , 850 } , and confirms that clusters can span coherent semantic objects and objectparts . In the block B=6 , the features correspond to coarse semantic masks , e.g. , they can not discriminate between various face parts . On the other extreme , the features from B=12 do not exhibit semantic meaningness , reaffirming the predictive performance behavior from Figure 2 . The block B=8 appears to be a “ sweet spot ” demonstrating fine-grained semantic fragmentation . Across different diffusion steps , the most meaningful features correspond to the later ones . We attribute this behavior to the fact that on the earlier diffusion steps , the global structure of a DDPM sample has not emerged yet , therefore , it is hardly possible to predict segmentation masks at this stage . This intuition is qualitatively confirmed by the masks in Figure 1 . For t=850 , the masks poorly reflect the content of actual images , while for smaller values of t , the masks and images are semantically coherent .
The paper demonstrates that the intermediate activations in Denoising diffusion probabilistic models (DDPM) can capture semantic information and thus can serve as representation for high-level vision tasks. The paper provides an interesting analysis of how well each layer at each diffusion step in DDPM can serve as a representation for semantic segmentation (Fig. 1 and Fig. 2). Also, through small-scale yet valid experiments, the method shows the learned intermediate activations from DDPM contain semantic cues well, and better than other generative approaches.
SP:7b1e5eed0da0d5d3c3618f7c848ae79e9e96dffe
Label-Efficient Semantic Segmentation with Diffusion Models
1 INTRODUCTION . Denoising diffusion probabilistic models ( DDPM ) ( Sohl-Dickstein et al. , 2015 ; Ho et al. , 2020 ) have recently outperformed alternative approaches to model the distribution of natural images both in the realism of individual samples and their diversity ( Dhariwal & Nichol , 2021 ) . These advantages of DDPM are successfully exploited in applications , such as colorization ( Song et al. , 2021 ) , inpainting ( Song et al. , 2021 ) , super-resolution ( Saharia et al. , 2021 ; Li et al. , 2021b ) , and semantic editing ( Meng et al. , 2021 ) , where DDPM often achieve more impressive results compared to GANs . So far , however , DDPM were not exploited as a source of effective image representations for discriminative computer vision problems . While the prior literature has demonstrated that various generative paradigms , such as GANs ( Donahue & Simonyan , 2019 ) or autoregressive models ( Chen et al. , 2020a ) , can be used to extract the representations for common vision tasks , it is not clear if DDPM can also serve as representation learners . In this paper , we provide an affirmative answer to this question in the context of semantic segmentation . In particular , we investigate the intermediate activations from the U-Net network that approximates the Markov step of the reverse diffusion process in DDPM . Intuitively , this network learns to denoise its input , and it is not clear why the intermediate activations should capture semantic information needed for high-level vision problems . Nevertheless , we show that on the certain diffusion steps , these activations do capture such information , therefore , can potentially be used as image representations for downstream tasks . Given these observations , we propose a simple semantic segmentation method , which exploits these representations and successfully works even if only a few labeled images are provided . On several datasets , we show that our DDPM-based segmentation method outperforms the existing baselines for the same amount of supervision . To sum up , the contributions of our paper are : 1 . We investigate the representations learned by the state-of-the-art DDPM and show that they capture high-level semantic information valuable for downstream vision tasks . 1anonymous URL 2 . We design a simple segmentation approach that exploits these representations and outperforms the alternatives in the few-shot operating point . 3 . We compare the DDPM-based representations with their GAN-based counterparts on the same datasets and demonstrate the advantages of the former in the context of semantic segmentation . 2 RELATED WORK . In this section , we briefly describe the existing research lines relevant to our work . Diffusion models ( Sohl-Dickstein et al. , 2015 ; Ho et al. , 2020 ) are a class of generative models that approximate the distribution of real images by the endpoint of the Markov chain that originates from a simple parametric distribution , typically a standard Gaussian . Each Markov step is modeled by a deep neural network that effectively learns to invert the diffusion process with a known Gaussian kernel . ( Ho et al. , 2020 ) highlighted the equivalence of diffusion models and score matching ( Song & Ermon , 2019 ; 2020 ) , showing them to be two different perspectives on the gradual conversion of a simple known distribution into a target distribution via the iterative denoising process . Very recent works ( Nichol & Dhariwal , 2021 ; Dhariwal & Nichol , 2021 ) have developed more powerful model architectures as well as different advanced objectives for DDPM , which led to the “ victory ” of DDPM over GANs in terms of generative quality and diversity . DDPM have been widely used in several applications , including image colorization ( Song et al. , 2021 ) , super-resolution ( Saharia et al. , 2021 ; Li et al. , 2021b ) , inpainting ( Song et al. , 2021 ) , semantic editing ( Meng et al. , 2021 ) . In our work , we demonstrate that one can also successfully use them for semantic segmentation . Image segmentation with generative models is an active research direction at the moment , however , existing methods are primarily based on GANs . The first line of works ( Voynov & Babenko , 2020 ; Voynov et al. , 2021 ; Melas-Kyriazi et al. , 2021 ) is based on the evidence that the latent spaces of the state-of-the-art GANs have directions corresponding to effects that influence the foreground/background pixels differently , which allows producing synthetic data to train segmentation models . However , the approaches from ( Voynov & Babenko , 2020 ; Voynov et al. , 2021 ; MelasKyriazi et al. , 2021 ) are currently able to perform binary segmentation only , and it is not clear if they can be used in the general setup of semantic segmentation . The second line of works ( Zhang et al. , 2021 ; Tritrong et al. , 2021 ; Xu & Zheng , 2021 ) is more relevant to our study since they are based on the intermediate representations obtained in GANs . In particular , the method proposed in ( Zhang et al. , 2021 ) trains a pixel class prediction model on these representations and confirms their label efficiency . In the experimental section , we compare the method from ( Zhang et al. , 2021 ) to our DDPM-based one and demonstrate several distinctive advantages of our solution . Representations from generative models for discriminative tasks . The usage of generative models as representation learners has been widely investigated for global prediction ( Donahue & Simonyan , 2019 ; Chen et al. , 2020a ) , and dense prediction problems ( Zhang et al. , 2021 ; Tritrong et al. , 2021 ; Xu & Zheng , 2021 ; Xu et al. , 2021 ) . While previous works highlighted the practical advantages of these representations , such as out-of-distribution robustness ( Li et al. , 2021a ) , generative models as representation learners receive less attention compared to alternative unsupervised methods , e.g. , based on contrastive learning ( Chen et al. , 2020b ) . The main reason is probably the difficulty of training a high-quality generative model on a complex , diverse dataset . However , given the recent success of DDPM on Imagenet ( Deng et al. , 2009 ) , one can expect that this direction will attract more attention in the future . 3 REPRESENTATIONS FROM DIFFUSION MODELS . In the following section , we investigate the image representations learned by diffusion models . First , we provide a brief overview of the DDPM framework . Then , we describe how to extract features from them and investigate what kind of semantic information these features might capture . Background . Diffusion models transform noise xT∼N ( 0 , I ) to the sample x0 by gradually denoising xT to less noisy samples xt . Formally , we are given a forward diffusion process : q ( xt|xt−1 ) : = N ( xt ; √ 1− βtxt−1 , βtI ) , ( 1 ) for some fixed variance schedule β1 , . . . , βt . Importantly , a noisy sample xt can be obtained directly from the data x0 : xt = √ ᾱtx0 + √ 1− ᾱt , ( 2 ) where ∼ N ( 0 , 1 ) and αt : = 1− βt , ᾱt : = ∏t s=1 αs . Pretrained DDPM approximates a reverse process : pθ ( xt−1|xt ) : = N ( xt ; µθ ( xt , t ) , Σθ ( xt , t ) ) . ( 3 ) In practice , rather than predicting the mean of the distribution in Equation ( 3 ) , the noise predictor network θ ( xt , t ) predicts the noise component at the step t ; the mean is then a linear combination of this noise component and xt . The covariance predictor Σθ ( xt , t ) can be either a fixed set of scalar covariances or learned as well ( the latter was shown to improve the quality of models ( Nichol & Dhariwal , 2021 ) ) . The denoising model θ ( xt , t ) is typically parameterized by different variants of the UNet architecture ( Ronneberger et al. , 2015 ) , and in our experiments we investigate the state-of-the-art one proposed in ( Dhariwal & Nichol , 2021 ) . Extracting representations . For a given real image x0 ∈ RH×W×3 , one can compute T sets of activation tensors from the noise predictor network θ ( xt , t ) . Formally for t = T . . . 1 we first corrupt x0 by adding a Gaussian noise : xt = √ ᾱtx0+ √ 1− ᾱt . The noisy xt is used as an input of θ ( xt , t ) parameterized by the UNet model . The UNet ’ s intermediate activations are then upsampled to H×W with bilinear interpolation . This allows treating them as pixel-level representations of x0 . 3.1 REPRESENTATION ANALYSIS . We analyze the representations produced by the noise predictor θ ( xt , t ) for different t. We consider the state-of-the-art DDPM checkpoints trained on the LSUN-Bedroom and FFHQ datasets2 . The intermediate activations from the noise predictor capture semantic information . For this experiment , we take a few images from the LSUN-Bedroom and FFHQ datasets and manually assign each pixel to one of the 28 and 34 semantic classes , respectively . Our goal is to understand whether the pixel-level representations produced by DDPM effectively capture the information about semantics . To this end , we train a multi-layer perceptron ( MLP ) to predict the pixel semantic label from its features produced by one of the 18 UNet decoder blocks on a specific diffusion step t. Note that we consider only the decoder activations because they also aggregate the encoder ones through the skip connections . MLP is trained on 20 images and evaluated on 20 hold-out ones . The predictive performance is measured in terms of mean IoU . 2https : //github.com/openai/guided-diffusion The evolution of predictive performance across the different blocks and diffusion steps t is presented in Figure 2 . The blocks are numbered from the deep to shallow ones . Figure 2 shows that the discriminability of the features produced by the noise predictor θ ( xt , t ) varies for different blocks and diffusion steps . In particular , the features corresponding to the later steps of the reverse diffusion process typically capture semantic information more effectively . In contrast , the ones corresponding to the early steps are generally uninformative . Across different blocks , the features produced by the layers in the middle of the UNet decoder appear to be the most informative on all diffusion steps . Additionally , we split the LSUN-Bedroom semantic classes into small-sized and big-sized based on the average area in the annotated dataset . Then , we evaluate mean IoU for these classes independently across the different UNet blocks and diffusion steps . The results are presented in Figure 3 . As expected , for big-sized objects , the predictive performance starts growing earlier in the reverse process . The shallow blocks ( 10 , 12 ) are more informative for small-sized objects , while the deeper ones ( 2 , 4 ) are for big-sized ones . Figure 2 implies that for certain UNet blocks and diffusion steps , similar DDPM-based representations correspond to the pixels of the same semantics . Figure 1 shows the k-means clusters ( k=5 ) formed by the features extracted from the blocks { 6 , 8 , 10 , 12 } on the diffusion steps { 50 , 250 , 450 , 650 , 850 } , and confirms that clusters can span coherent semantic objects and objectparts . In the block B=6 , the features correspond to coarse semantic masks , e.g. , they can not discriminate between various face parts . On the other extreme , the features from B=12 do not exhibit semantic meaningness , reaffirming the predictive performance behavior from Figure 2 . The block B=8 appears to be a “ sweet spot ” demonstrating fine-grained semantic fragmentation . Across different diffusion steps , the most meaningful features correspond to the later ones . We attribute this behavior to the fact that on the earlier diffusion steps , the global structure of a DDPM sample has not emerged yet , therefore , it is hardly possible to predict segmentation masks at this stage . This intuition is qualitatively confirmed by the masks in Figure 1 . For t=850 , the masks poorly reflect the content of actual images , while for smaller values of t , the masks and images are semantically coherent .
This paper proposes to treat deep activations of denoising diffusion probabilistic models trained on image datasets as unsupervised pixel features. To extract features for an image, one performs a fixed number of steps of the diffusion process, passes the resulting noisy image through the U-Net denoiser, and upsamples activations from a chosen layer. These pixel representations are used as inputs to simple classifiers that perform semantic segmentation. This approach is validated on three image datasets, where it shows strong results compared to baselines in a few-shot setting.
SP:7b1e5eed0da0d5d3c3618f7c848ae79e9e96dffe
Conditional GANs with Auxiliary Discriminative Classifier
1 INTRODUCTION . Generative adversarial networks ( GANs ) ( Goodfellow et al. , 2014 ) have been gained great progress in learning high-dimensional , complex data distribution such as natural images ( Karras et al. , 2019 ; 2020b ; a ; Brock et al. , 2019 ) . Standard GANs consist of a generator network that transfers a latent code sampled from a tractable distribution in the latent space to a data point in the data space and a discriminator network that attempts to distinguish between the real data and the generated one . The generator is trained in an adversarial game against the discriminator such that it can replicate the data distribution at the Nash equilibrium of the game . Remarkably , the training of GANs is notoriously unstable to reach the equilibrium , and thereby the generator is prone to mode collapse ( Salimans et al. , 2016 ; Lin et al. , 2018 ; Chen et al. , 2019 ) . In addition , practitioners are interested in controlling the properties of the generated samples ( Yan et al. , 2015 ; Tan et al. , 2020 ) in practical applications . A key solution to address the above issues is conditioning , leading to conditional GANs ( Mirza & Osindero , 2014 ) . Conditional GANs ( cGANs ) is a family variant of GANs that leverages the side information from annotated labels of samples to implement and train a conditional generator , and therefore achieve conditional image generation from class-label ( Odena et al. , 2017 ; Miyato & Koyama , 2018 ; Brock et al. , 2019 ) or text ( Reed et al. , 2016 ; Xu et al. , 2018 ; Zhu et al. , 2019 ) . To implement the conditional generator , the common technique nowadays injects the conditional information via conditional batch normalization ( de Vries et al. , 2017 ) . To train the conditional generator , a lot of efforts focus on effectively injecting the conditional information into the discriminator or classifier ( Odena , 2016 ; Miyato & Koyama , 2018 ; Zhou et al. , 2018 ; Kavalerov et al. , 2021 ; Kang & Park , 2020 ; Zhou et al. , 2020 ) . Among them , the auxiliary classifier generative adversarial network ( AC-GAN ) ( Odena et al. , 2017 ) has been widely used due to its simplicity and extensibility . Specifically , AC-GAN utilizes an auxiliary classifier that first attempts to recognize the label of data and then teaches the generator to produce label-consistent ( classifiable ) data . However , it has been reported that AC-GAN suffers from the low intra-class diversity problem on generated samples , especially on datasets with a large number of classes ( Odena et al. , 2017 ; Shu et al. , 2017 ; Gong et al. , 2019 ) . In this paper , we point out that the fundamental reason for the low intra-class diversity problem of AC-GAN is that the classifier is agnostic to the generated data distribution and thus can not provide informative guidance to the generator in learning the target distribution . Motivated by this observation , we propose a novel conditional GAN with an auxiliary discriminative classifier , namely ADC-GAN , to resolve the problem of AC-GAN by enabling the classifier to be aware of the generated data distribution . To this end , the discriminative classifier is trained to distinguish between the real and generated data while recognizing their labels . The discriminative property enables the classifier to provide the discrepancy between the real and generated data distributions analogy to the discriminator , and the classification property allows it to capture the dependencies between the data and labels . We show in theory that the generator of the proposed ADC-GAN can replicate the joint data and label distribution under the guidance of the discriminative classifier at the optima even without the discriminator , making our method robust to hyper-parameter and stable on training . We also discuss the superiority of ADC-GAN compared to two most related works ( TAC-GAN ( Gong et al. , 2019 ) and PD-GAN ( Miyato & Koyama , 2018 ) ) by analyzing their potential issues and limitations . Experimental results clearly show that the proposed ADC-GAN successfully resolves the problem of AC-GAN by faithfully learning the real joint data and label distribution . The advantages over competing cGANs in experiments conducted on both synthetic and real-world datasets verify the effectiveness of the proposed ADC-GAN in conditional generative modeling . 2 PRELIMINARIES AND OUR ANALYSIS . 2.1 GENERATIVE ADVERSARIAL NETWORKS . Generative adversarial networks ( GANs ) ( Goodfellow et al. , 2014 ) consist of two types of neural networks : the generator G : Z → X that maps a latent code z ∈ Z endowed with an easily sampled distribution PZ to a data point x ∈ X , and the discriminator D : X → [ 0 , 1 ] that distinguishes between real data that sampled from the real data distribution PX and fake data that sampled from the generated data distribution QX = G ◦ PZ implied by the generator . The goal of the generator is to confuse the discriminator by producing data that is as real as possible . Formally , the objective functions for the discriminator and the generator are defined as follows : min G max D V ( G , D ) = Ex∼PX [ logD ( x ) ] + Ex∼QX [ log ( 1−D ( x ) ) ] . ( 1 ) Theoretically , the learning of generator under an optimal discriminator can be regarded as minimizing the Jensen-Shannon ( JS ) divergence between the real data distribution and the generated data distribution , i.e. , minG JS ( PX‖QX ) . This would enable the generator to recover the real data distribution at its optima . However , the training of GANs is notoriously unstable , especially when lacking additional supervision such as conditional information . Moreover , the content of the generated images of GANs can not be specified in advance . 2.2 AC-GAN . Learning GANs with conditional information can not only improve the training stability and generation quality of GANs but also achieve conditional generation , which has more practical value than unconditional generation in real-world applications . One of the most representative conditional GANs is AC-GAN ( Odena et al. , 2017 ) , which utilizes an auxiliary classifier C : X → Y to learn the dependencies between the real data x ∼ PX and the label y ∼ PY and then enforce the conditional generator G : Z × Y → X to synthesize classifiable data as much as possible . The objective functions for the discriminator D , the auxiliary classifier C , and the generator G of AC-GAN are defined as follows1 : max D , C V ( G , D ) + λ · ( Ex , y∼PX , Y [ logC ( y|x ) ] ) , min G V ( G , D ) − λ · ( Ex , y∼QX , Y [ logC ( y|x ) ] ) , ( 2 ) where λ > 0 is a hyper-parameter , and QX , Y = G ◦ ( PZ × PY ) denotes the joint distribution of generated data and labels implied by the generator . 1We follow the common practice in the literature to adopt the stable version instead of the original one . Proposition 1 . The optimal classifier of AC-GAN outputs as follows : C∗ ( y|x ) = p ( x , y ) p ( x ) . ( 3 ) Theorem 1 . Given the optimal classifier , at the equilibrium point , optimizing the classification task for the generator of AC-GAN is equivalent to : min G KL ( QX , Y ‖PX , Y ) − KL ( QX‖PX ) +HQ ( Y |X ) , ( 4 ) where HQ ( Y |X ) = − ∫ ∑ y q ( x , y ) log q ( y|x ) dx is the conditional entropy of generated data . The proofs of Proposition 1 and Theorem 1 are referred to Appendix A.1 and A.2 , respectively . Our Theorem 1 exposes two shortcomings of AC-GAN . First , maximization of the KL divergence between the marginal generator distribution and the marginal data distribution maxG KL ( QX‖PX ) contradicts the goal of conditional generative modeling that matches QX , Y with PX , Y . Although this issue can be mitigated to some extent by the adversarial training objective between the discriminator and the generator that minimizes the JS divergence between the two marginal distributions , we find that it still has a negative impact on the training stability . Second , minimization of the entropy of label conditioned on data with respect to the generated distribution minGHQ ( Y |X ) will result in that the label of generated data should be completely determined by the data itself . In other words , it will force the generated data of each class away from the classification hyper-plane , explaining the low intra-class diversity of generated samples in AC-GAN especially when the distributions of different classes have non-negligible overlap , which is supported by the fact that state-of-the-art classifiers nor human can not achieve 100 % accuracy on real-world datasets ( Russakovsky et al. , 2015 ) . Note that the original version of AC-GAN , whose classifier is trained by both real and generated samples , could also suffer from the same issue ( see Appendix B ) . 3 THE PROPOSED METHOD : ADC-GAN . The goal of conditional generative modeling is to faithfully approximate the joint distribution of real data and labels regardless of the shape of the target joint distribution ( whether there is overlap between distributions of different classes ) . Note that the learning of the generator in AC-GAN is affected by the classifier . In other words , the reason for the consequence of Theorem 1 originates from Proposition 1 , which indicates that the optimal classifier of AC-GAN is agnostic to the density of the generated ( marginal or joint ) distribution ( q ( x ) or q ( x , y ) ) . Therefore , the classifier can not provide the discrepancy between the target distribution and the generated distribution , resulting in a biased learning objective to the generator . Recall that the optimal discriminator D∗ ( x ) = p ( x ) p ( x ) +q ( x ) is able to be aware of the real data density as well as the generated data density ( Goodfellow et al. , 2014 ) , and thus can provide the discrepancy p ( x ) q ( x ) = D∗ ( x ) 1−D∗ ( x ) between the real data distribution and the generated data distribution to unbiasedly optimize the generator . Intuitively , the densityaware ability on both real and generated data is caused by the fact that the discriminator attempts to distinguish between real and fake samples . Motivated by this observation , we propose to make the classifier to be distinguishable between real and fake samples , establishing a discriminative classifier Cd : X → Y × { 0 , 1 } that recognizes the label of real and fake samples discriminatively . Formally , the objective functions for the discriminator D , the discriminative classifier Cd , and the generator G of the proposed ADC-GAN are defined as follows : max D , Cd V ( G , D ) + λ · ( Ex , y∼PX , Y [ logCd ( y , 1|x ) ] + Ex , y∼QX , Y [ logCd ( y , 0|x ) ] ) , min G V ( G , D ) − λ · ( Ex , y∼QX , Y [ logCd ( y , 1|x ) ] − Ex , y∼QX , Y [ logCd ( y , 0|x ) ] ) , ( 5 ) where Cd ( y , 1|x ) ( reps. Cd ( y , 0|x ) ) denotes the probability that a data x is classified as the label y and real ( reps. fake ) data simultaneously . Proposition 2 . For fixed generator , the optimal classifier of ADC-GAN outputs as follows : C∗d ( y , 1|x ) = p ( x , y ) p ( x ) + q ( x ) , C∗d ( y , 0|x ) = q ( x , y ) p ( x ) + q ( x ) . ( 6 ) The proof is referred to Appendix A.3 . Proposition 2 confirms that the discriminative classifier be aware of the densities of the real and generated joint distributions , therefore it is able to provide the discrepancy p ( x , y ) q ( x , y ) = C∗d ( y,1|x ) C∗d ( y,0|x ) to unbiasedly optimize the generator as we prove below . Theorem 2 . Given the optimal classifier , at the equilibrium point , optimizing the classification task for the generator of ADC-GAN is equivalent to : min G KL ( QX , Y ‖PX , Y ) . ( 7 ) The proof is referred to Appendix A.4 . Theorem 2 suggests that the classifier itself can guarantee the generator to replicate the real joint distribution in theory regardless of the shape of the joint distribution . In practice , we retain the discriminator to train the generator and share all layers but the head of the classifier with the discriminator as illustrated in Figure 1 and Equation 5 for faster convergence speed . Coupled with the adversarial training against the discriminator , the generator of the proposed ADC-GAN , under the optimal discriminator and classifier , can be regarded as minimizing the following divergences : minG JS ( PX‖QX ) + λ · KL ( QX , Y ‖PX , Y ) . Since the optimal solution of conditional generative modeling belongs to the optimal solution set of generative modeling , i.e. , argminG KL ( QX , Y ‖PX , Y ) ⊆ argminG JS ( PX‖QX ) , learning with the discriminator will not change the convergence point of the generator that approximates the joint distribution of real data and labels regardless of the value of hyper-parameter λ > 0 . Furthermore , the hyper-parameter λ provides the flexibility to adjust the weight of conditional generative modeling .
This paper proposes the Auxiliary Discriminative Classifier GAN (ADC-GAN) to eliminate a contractionary objective and conditional entropy in ACGAN generator training. Specifically, the authors mathematically demonstrate that training ACGAN without a discriminative label classifier causes minimizing an undesirable divergence (KL(q(x)||p(x))) which conflicts with the joint distribution matching (KL(q(x,y)||p(x,y))). Also, they insist that the lack of intra-class diversity of ACGAN results from the absence of generator guidance for training the discriminator. To resolve all these issues, they devise a new classifier, the auxiliary discriminative classifier and deploy the new classifier directly on the ACGAN framework. Experiments demonstrate that ADC-GAN can successfully learn the joint distribution whose conditional marginals have non-negligible support overlap using MoG dataset. In addition, they show the effectiveness of ADCGAN compared to ACGAN, projection discriminator, and TAC-GAN on four benchmark datasets (CIFAR10, CIFAR100, Tiny-ImageNet, and ImageNet) using IS, FID, iFID metrics.
SP:f81454b460aac0ede0a0c9a238c8d4cd51396ee5
Conditional GANs with Auxiliary Discriminative Classifier
1 INTRODUCTION . Generative adversarial networks ( GANs ) ( Goodfellow et al. , 2014 ) have been gained great progress in learning high-dimensional , complex data distribution such as natural images ( Karras et al. , 2019 ; 2020b ; a ; Brock et al. , 2019 ) . Standard GANs consist of a generator network that transfers a latent code sampled from a tractable distribution in the latent space to a data point in the data space and a discriminator network that attempts to distinguish between the real data and the generated one . The generator is trained in an adversarial game against the discriminator such that it can replicate the data distribution at the Nash equilibrium of the game . Remarkably , the training of GANs is notoriously unstable to reach the equilibrium , and thereby the generator is prone to mode collapse ( Salimans et al. , 2016 ; Lin et al. , 2018 ; Chen et al. , 2019 ) . In addition , practitioners are interested in controlling the properties of the generated samples ( Yan et al. , 2015 ; Tan et al. , 2020 ) in practical applications . A key solution to address the above issues is conditioning , leading to conditional GANs ( Mirza & Osindero , 2014 ) . Conditional GANs ( cGANs ) is a family variant of GANs that leverages the side information from annotated labels of samples to implement and train a conditional generator , and therefore achieve conditional image generation from class-label ( Odena et al. , 2017 ; Miyato & Koyama , 2018 ; Brock et al. , 2019 ) or text ( Reed et al. , 2016 ; Xu et al. , 2018 ; Zhu et al. , 2019 ) . To implement the conditional generator , the common technique nowadays injects the conditional information via conditional batch normalization ( de Vries et al. , 2017 ) . To train the conditional generator , a lot of efforts focus on effectively injecting the conditional information into the discriminator or classifier ( Odena , 2016 ; Miyato & Koyama , 2018 ; Zhou et al. , 2018 ; Kavalerov et al. , 2021 ; Kang & Park , 2020 ; Zhou et al. , 2020 ) . Among them , the auxiliary classifier generative adversarial network ( AC-GAN ) ( Odena et al. , 2017 ) has been widely used due to its simplicity and extensibility . Specifically , AC-GAN utilizes an auxiliary classifier that first attempts to recognize the label of data and then teaches the generator to produce label-consistent ( classifiable ) data . However , it has been reported that AC-GAN suffers from the low intra-class diversity problem on generated samples , especially on datasets with a large number of classes ( Odena et al. , 2017 ; Shu et al. , 2017 ; Gong et al. , 2019 ) . In this paper , we point out that the fundamental reason for the low intra-class diversity problem of AC-GAN is that the classifier is agnostic to the generated data distribution and thus can not provide informative guidance to the generator in learning the target distribution . Motivated by this observation , we propose a novel conditional GAN with an auxiliary discriminative classifier , namely ADC-GAN , to resolve the problem of AC-GAN by enabling the classifier to be aware of the generated data distribution . To this end , the discriminative classifier is trained to distinguish between the real and generated data while recognizing their labels . The discriminative property enables the classifier to provide the discrepancy between the real and generated data distributions analogy to the discriminator , and the classification property allows it to capture the dependencies between the data and labels . We show in theory that the generator of the proposed ADC-GAN can replicate the joint data and label distribution under the guidance of the discriminative classifier at the optima even without the discriminator , making our method robust to hyper-parameter and stable on training . We also discuss the superiority of ADC-GAN compared to two most related works ( TAC-GAN ( Gong et al. , 2019 ) and PD-GAN ( Miyato & Koyama , 2018 ) ) by analyzing their potential issues and limitations . Experimental results clearly show that the proposed ADC-GAN successfully resolves the problem of AC-GAN by faithfully learning the real joint data and label distribution . The advantages over competing cGANs in experiments conducted on both synthetic and real-world datasets verify the effectiveness of the proposed ADC-GAN in conditional generative modeling . 2 PRELIMINARIES AND OUR ANALYSIS . 2.1 GENERATIVE ADVERSARIAL NETWORKS . Generative adversarial networks ( GANs ) ( Goodfellow et al. , 2014 ) consist of two types of neural networks : the generator G : Z → X that maps a latent code z ∈ Z endowed with an easily sampled distribution PZ to a data point x ∈ X , and the discriminator D : X → [ 0 , 1 ] that distinguishes between real data that sampled from the real data distribution PX and fake data that sampled from the generated data distribution QX = G ◦ PZ implied by the generator . The goal of the generator is to confuse the discriminator by producing data that is as real as possible . Formally , the objective functions for the discriminator and the generator are defined as follows : min G max D V ( G , D ) = Ex∼PX [ logD ( x ) ] + Ex∼QX [ log ( 1−D ( x ) ) ] . ( 1 ) Theoretically , the learning of generator under an optimal discriminator can be regarded as minimizing the Jensen-Shannon ( JS ) divergence between the real data distribution and the generated data distribution , i.e. , minG JS ( PX‖QX ) . This would enable the generator to recover the real data distribution at its optima . However , the training of GANs is notoriously unstable , especially when lacking additional supervision such as conditional information . Moreover , the content of the generated images of GANs can not be specified in advance . 2.2 AC-GAN . Learning GANs with conditional information can not only improve the training stability and generation quality of GANs but also achieve conditional generation , which has more practical value than unconditional generation in real-world applications . One of the most representative conditional GANs is AC-GAN ( Odena et al. , 2017 ) , which utilizes an auxiliary classifier C : X → Y to learn the dependencies between the real data x ∼ PX and the label y ∼ PY and then enforce the conditional generator G : Z × Y → X to synthesize classifiable data as much as possible . The objective functions for the discriminator D , the auxiliary classifier C , and the generator G of AC-GAN are defined as follows1 : max D , C V ( G , D ) + λ · ( Ex , y∼PX , Y [ logC ( y|x ) ] ) , min G V ( G , D ) − λ · ( Ex , y∼QX , Y [ logC ( y|x ) ] ) , ( 2 ) where λ > 0 is a hyper-parameter , and QX , Y = G ◦ ( PZ × PY ) denotes the joint distribution of generated data and labels implied by the generator . 1We follow the common practice in the literature to adopt the stable version instead of the original one . Proposition 1 . The optimal classifier of AC-GAN outputs as follows : C∗ ( y|x ) = p ( x , y ) p ( x ) . ( 3 ) Theorem 1 . Given the optimal classifier , at the equilibrium point , optimizing the classification task for the generator of AC-GAN is equivalent to : min G KL ( QX , Y ‖PX , Y ) − KL ( QX‖PX ) +HQ ( Y |X ) , ( 4 ) where HQ ( Y |X ) = − ∫ ∑ y q ( x , y ) log q ( y|x ) dx is the conditional entropy of generated data . The proofs of Proposition 1 and Theorem 1 are referred to Appendix A.1 and A.2 , respectively . Our Theorem 1 exposes two shortcomings of AC-GAN . First , maximization of the KL divergence between the marginal generator distribution and the marginal data distribution maxG KL ( QX‖PX ) contradicts the goal of conditional generative modeling that matches QX , Y with PX , Y . Although this issue can be mitigated to some extent by the adversarial training objective between the discriminator and the generator that minimizes the JS divergence between the two marginal distributions , we find that it still has a negative impact on the training stability . Second , minimization of the entropy of label conditioned on data with respect to the generated distribution minGHQ ( Y |X ) will result in that the label of generated data should be completely determined by the data itself . In other words , it will force the generated data of each class away from the classification hyper-plane , explaining the low intra-class diversity of generated samples in AC-GAN especially when the distributions of different classes have non-negligible overlap , which is supported by the fact that state-of-the-art classifiers nor human can not achieve 100 % accuracy on real-world datasets ( Russakovsky et al. , 2015 ) . Note that the original version of AC-GAN , whose classifier is trained by both real and generated samples , could also suffer from the same issue ( see Appendix B ) . 3 THE PROPOSED METHOD : ADC-GAN . The goal of conditional generative modeling is to faithfully approximate the joint distribution of real data and labels regardless of the shape of the target joint distribution ( whether there is overlap between distributions of different classes ) . Note that the learning of the generator in AC-GAN is affected by the classifier . In other words , the reason for the consequence of Theorem 1 originates from Proposition 1 , which indicates that the optimal classifier of AC-GAN is agnostic to the density of the generated ( marginal or joint ) distribution ( q ( x ) or q ( x , y ) ) . Therefore , the classifier can not provide the discrepancy between the target distribution and the generated distribution , resulting in a biased learning objective to the generator . Recall that the optimal discriminator D∗ ( x ) = p ( x ) p ( x ) +q ( x ) is able to be aware of the real data density as well as the generated data density ( Goodfellow et al. , 2014 ) , and thus can provide the discrepancy p ( x ) q ( x ) = D∗ ( x ) 1−D∗ ( x ) between the real data distribution and the generated data distribution to unbiasedly optimize the generator . Intuitively , the densityaware ability on both real and generated data is caused by the fact that the discriminator attempts to distinguish between real and fake samples . Motivated by this observation , we propose to make the classifier to be distinguishable between real and fake samples , establishing a discriminative classifier Cd : X → Y × { 0 , 1 } that recognizes the label of real and fake samples discriminatively . Formally , the objective functions for the discriminator D , the discriminative classifier Cd , and the generator G of the proposed ADC-GAN are defined as follows : max D , Cd V ( G , D ) + λ · ( Ex , y∼PX , Y [ logCd ( y , 1|x ) ] + Ex , y∼QX , Y [ logCd ( y , 0|x ) ] ) , min G V ( G , D ) − λ · ( Ex , y∼QX , Y [ logCd ( y , 1|x ) ] − Ex , y∼QX , Y [ logCd ( y , 0|x ) ] ) , ( 5 ) where Cd ( y , 1|x ) ( reps. Cd ( y , 0|x ) ) denotes the probability that a data x is classified as the label y and real ( reps. fake ) data simultaneously . Proposition 2 . For fixed generator , the optimal classifier of ADC-GAN outputs as follows : C∗d ( y , 1|x ) = p ( x , y ) p ( x ) + q ( x ) , C∗d ( y , 0|x ) = q ( x , y ) p ( x ) + q ( x ) . ( 6 ) The proof is referred to Appendix A.3 . Proposition 2 confirms that the discriminative classifier be aware of the densities of the real and generated joint distributions , therefore it is able to provide the discrepancy p ( x , y ) q ( x , y ) = C∗d ( y,1|x ) C∗d ( y,0|x ) to unbiasedly optimize the generator as we prove below . Theorem 2 . Given the optimal classifier , at the equilibrium point , optimizing the classification task for the generator of ADC-GAN is equivalent to : min G KL ( QX , Y ‖PX , Y ) . ( 7 ) The proof is referred to Appendix A.4 . Theorem 2 suggests that the classifier itself can guarantee the generator to replicate the real joint distribution in theory regardless of the shape of the joint distribution . In practice , we retain the discriminator to train the generator and share all layers but the head of the classifier with the discriminator as illustrated in Figure 1 and Equation 5 for faster convergence speed . Coupled with the adversarial training against the discriminator , the generator of the proposed ADC-GAN , under the optimal discriminator and classifier , can be regarded as minimizing the following divergences : minG JS ( PX‖QX ) + λ · KL ( QX , Y ‖PX , Y ) . Since the optimal solution of conditional generative modeling belongs to the optimal solution set of generative modeling , i.e. , argminG KL ( QX , Y ‖PX , Y ) ⊆ argminG JS ( PX‖QX ) , learning with the discriminator will not change the convergence point of the generator that approximates the joint distribution of real data and labels regardless of the value of hyper-parameter λ > 0 . Furthermore , the hyper-parameter λ provides the flexibility to adjust the weight of conditional generative modeling .
- This paper aims to solve the low intra-class diversity on generated images of AC-GAN, a classifier-based cGAN. - As far as I know, this is an important issue that limits classifier-based cGANs (the counterpart is the projection-based cGAN, i.e, PD-GAN). - The authors point out that the reason is that the classifier of AC-GAN is generator-agnostic and minimization of conditional entropy decreases the intra-class diversity. - The authors propose ADC-GAN (auxiliary discriminative classifier) to solve this problem, and theoretical analysis is also presented.
SP:f81454b460aac0ede0a0c9a238c8d4cd51396ee5
Conditional GANs with Auxiliary Discriminative Classifier
1 INTRODUCTION . Generative adversarial networks ( GANs ) ( Goodfellow et al. , 2014 ) have been gained great progress in learning high-dimensional , complex data distribution such as natural images ( Karras et al. , 2019 ; 2020b ; a ; Brock et al. , 2019 ) . Standard GANs consist of a generator network that transfers a latent code sampled from a tractable distribution in the latent space to a data point in the data space and a discriminator network that attempts to distinguish between the real data and the generated one . The generator is trained in an adversarial game against the discriminator such that it can replicate the data distribution at the Nash equilibrium of the game . Remarkably , the training of GANs is notoriously unstable to reach the equilibrium , and thereby the generator is prone to mode collapse ( Salimans et al. , 2016 ; Lin et al. , 2018 ; Chen et al. , 2019 ) . In addition , practitioners are interested in controlling the properties of the generated samples ( Yan et al. , 2015 ; Tan et al. , 2020 ) in practical applications . A key solution to address the above issues is conditioning , leading to conditional GANs ( Mirza & Osindero , 2014 ) . Conditional GANs ( cGANs ) is a family variant of GANs that leverages the side information from annotated labels of samples to implement and train a conditional generator , and therefore achieve conditional image generation from class-label ( Odena et al. , 2017 ; Miyato & Koyama , 2018 ; Brock et al. , 2019 ) or text ( Reed et al. , 2016 ; Xu et al. , 2018 ; Zhu et al. , 2019 ) . To implement the conditional generator , the common technique nowadays injects the conditional information via conditional batch normalization ( de Vries et al. , 2017 ) . To train the conditional generator , a lot of efforts focus on effectively injecting the conditional information into the discriminator or classifier ( Odena , 2016 ; Miyato & Koyama , 2018 ; Zhou et al. , 2018 ; Kavalerov et al. , 2021 ; Kang & Park , 2020 ; Zhou et al. , 2020 ) . Among them , the auxiliary classifier generative adversarial network ( AC-GAN ) ( Odena et al. , 2017 ) has been widely used due to its simplicity and extensibility . Specifically , AC-GAN utilizes an auxiliary classifier that first attempts to recognize the label of data and then teaches the generator to produce label-consistent ( classifiable ) data . However , it has been reported that AC-GAN suffers from the low intra-class diversity problem on generated samples , especially on datasets with a large number of classes ( Odena et al. , 2017 ; Shu et al. , 2017 ; Gong et al. , 2019 ) . In this paper , we point out that the fundamental reason for the low intra-class diversity problem of AC-GAN is that the classifier is agnostic to the generated data distribution and thus can not provide informative guidance to the generator in learning the target distribution . Motivated by this observation , we propose a novel conditional GAN with an auxiliary discriminative classifier , namely ADC-GAN , to resolve the problem of AC-GAN by enabling the classifier to be aware of the generated data distribution . To this end , the discriminative classifier is trained to distinguish between the real and generated data while recognizing their labels . The discriminative property enables the classifier to provide the discrepancy between the real and generated data distributions analogy to the discriminator , and the classification property allows it to capture the dependencies between the data and labels . We show in theory that the generator of the proposed ADC-GAN can replicate the joint data and label distribution under the guidance of the discriminative classifier at the optima even without the discriminator , making our method robust to hyper-parameter and stable on training . We also discuss the superiority of ADC-GAN compared to two most related works ( TAC-GAN ( Gong et al. , 2019 ) and PD-GAN ( Miyato & Koyama , 2018 ) ) by analyzing their potential issues and limitations . Experimental results clearly show that the proposed ADC-GAN successfully resolves the problem of AC-GAN by faithfully learning the real joint data and label distribution . The advantages over competing cGANs in experiments conducted on both synthetic and real-world datasets verify the effectiveness of the proposed ADC-GAN in conditional generative modeling . 2 PRELIMINARIES AND OUR ANALYSIS . 2.1 GENERATIVE ADVERSARIAL NETWORKS . Generative adversarial networks ( GANs ) ( Goodfellow et al. , 2014 ) consist of two types of neural networks : the generator G : Z → X that maps a latent code z ∈ Z endowed with an easily sampled distribution PZ to a data point x ∈ X , and the discriminator D : X → [ 0 , 1 ] that distinguishes between real data that sampled from the real data distribution PX and fake data that sampled from the generated data distribution QX = G ◦ PZ implied by the generator . The goal of the generator is to confuse the discriminator by producing data that is as real as possible . Formally , the objective functions for the discriminator and the generator are defined as follows : min G max D V ( G , D ) = Ex∼PX [ logD ( x ) ] + Ex∼QX [ log ( 1−D ( x ) ) ] . ( 1 ) Theoretically , the learning of generator under an optimal discriminator can be regarded as minimizing the Jensen-Shannon ( JS ) divergence between the real data distribution and the generated data distribution , i.e. , minG JS ( PX‖QX ) . This would enable the generator to recover the real data distribution at its optima . However , the training of GANs is notoriously unstable , especially when lacking additional supervision such as conditional information . Moreover , the content of the generated images of GANs can not be specified in advance . 2.2 AC-GAN . Learning GANs with conditional information can not only improve the training stability and generation quality of GANs but also achieve conditional generation , which has more practical value than unconditional generation in real-world applications . One of the most representative conditional GANs is AC-GAN ( Odena et al. , 2017 ) , which utilizes an auxiliary classifier C : X → Y to learn the dependencies between the real data x ∼ PX and the label y ∼ PY and then enforce the conditional generator G : Z × Y → X to synthesize classifiable data as much as possible . The objective functions for the discriminator D , the auxiliary classifier C , and the generator G of AC-GAN are defined as follows1 : max D , C V ( G , D ) + λ · ( Ex , y∼PX , Y [ logC ( y|x ) ] ) , min G V ( G , D ) − λ · ( Ex , y∼QX , Y [ logC ( y|x ) ] ) , ( 2 ) where λ > 0 is a hyper-parameter , and QX , Y = G ◦ ( PZ × PY ) denotes the joint distribution of generated data and labels implied by the generator . 1We follow the common practice in the literature to adopt the stable version instead of the original one . Proposition 1 . The optimal classifier of AC-GAN outputs as follows : C∗ ( y|x ) = p ( x , y ) p ( x ) . ( 3 ) Theorem 1 . Given the optimal classifier , at the equilibrium point , optimizing the classification task for the generator of AC-GAN is equivalent to : min G KL ( QX , Y ‖PX , Y ) − KL ( QX‖PX ) +HQ ( Y |X ) , ( 4 ) where HQ ( Y |X ) = − ∫ ∑ y q ( x , y ) log q ( y|x ) dx is the conditional entropy of generated data . The proofs of Proposition 1 and Theorem 1 are referred to Appendix A.1 and A.2 , respectively . Our Theorem 1 exposes two shortcomings of AC-GAN . First , maximization of the KL divergence between the marginal generator distribution and the marginal data distribution maxG KL ( QX‖PX ) contradicts the goal of conditional generative modeling that matches QX , Y with PX , Y . Although this issue can be mitigated to some extent by the adversarial training objective between the discriminator and the generator that minimizes the JS divergence between the two marginal distributions , we find that it still has a negative impact on the training stability . Second , minimization of the entropy of label conditioned on data with respect to the generated distribution minGHQ ( Y |X ) will result in that the label of generated data should be completely determined by the data itself . In other words , it will force the generated data of each class away from the classification hyper-plane , explaining the low intra-class diversity of generated samples in AC-GAN especially when the distributions of different classes have non-negligible overlap , which is supported by the fact that state-of-the-art classifiers nor human can not achieve 100 % accuracy on real-world datasets ( Russakovsky et al. , 2015 ) . Note that the original version of AC-GAN , whose classifier is trained by both real and generated samples , could also suffer from the same issue ( see Appendix B ) . 3 THE PROPOSED METHOD : ADC-GAN . The goal of conditional generative modeling is to faithfully approximate the joint distribution of real data and labels regardless of the shape of the target joint distribution ( whether there is overlap between distributions of different classes ) . Note that the learning of the generator in AC-GAN is affected by the classifier . In other words , the reason for the consequence of Theorem 1 originates from Proposition 1 , which indicates that the optimal classifier of AC-GAN is agnostic to the density of the generated ( marginal or joint ) distribution ( q ( x ) or q ( x , y ) ) . Therefore , the classifier can not provide the discrepancy between the target distribution and the generated distribution , resulting in a biased learning objective to the generator . Recall that the optimal discriminator D∗ ( x ) = p ( x ) p ( x ) +q ( x ) is able to be aware of the real data density as well as the generated data density ( Goodfellow et al. , 2014 ) , and thus can provide the discrepancy p ( x ) q ( x ) = D∗ ( x ) 1−D∗ ( x ) between the real data distribution and the generated data distribution to unbiasedly optimize the generator . Intuitively , the densityaware ability on both real and generated data is caused by the fact that the discriminator attempts to distinguish between real and fake samples . Motivated by this observation , we propose to make the classifier to be distinguishable between real and fake samples , establishing a discriminative classifier Cd : X → Y × { 0 , 1 } that recognizes the label of real and fake samples discriminatively . Formally , the objective functions for the discriminator D , the discriminative classifier Cd , and the generator G of the proposed ADC-GAN are defined as follows : max D , Cd V ( G , D ) + λ · ( Ex , y∼PX , Y [ logCd ( y , 1|x ) ] + Ex , y∼QX , Y [ logCd ( y , 0|x ) ] ) , min G V ( G , D ) − λ · ( Ex , y∼QX , Y [ logCd ( y , 1|x ) ] − Ex , y∼QX , Y [ logCd ( y , 0|x ) ] ) , ( 5 ) where Cd ( y , 1|x ) ( reps. Cd ( y , 0|x ) ) denotes the probability that a data x is classified as the label y and real ( reps. fake ) data simultaneously . Proposition 2 . For fixed generator , the optimal classifier of ADC-GAN outputs as follows : C∗d ( y , 1|x ) = p ( x , y ) p ( x ) + q ( x ) , C∗d ( y , 0|x ) = q ( x , y ) p ( x ) + q ( x ) . ( 6 ) The proof is referred to Appendix A.3 . Proposition 2 confirms that the discriminative classifier be aware of the densities of the real and generated joint distributions , therefore it is able to provide the discrepancy p ( x , y ) q ( x , y ) = C∗d ( y,1|x ) C∗d ( y,0|x ) to unbiasedly optimize the generator as we prove below . Theorem 2 . Given the optimal classifier , at the equilibrium point , optimizing the classification task for the generator of ADC-GAN is equivalent to : min G KL ( QX , Y ‖PX , Y ) . ( 7 ) The proof is referred to Appendix A.4 . Theorem 2 suggests that the classifier itself can guarantee the generator to replicate the real joint distribution in theory regardless of the shape of the joint distribution . In practice , we retain the discriminator to train the generator and share all layers but the head of the classifier with the discriminator as illustrated in Figure 1 and Equation 5 for faster convergence speed . Coupled with the adversarial training against the discriminator , the generator of the proposed ADC-GAN , under the optimal discriminator and classifier , can be regarded as minimizing the following divergences : minG JS ( PX‖QX ) + λ · KL ( QX , Y ‖PX , Y ) . Since the optimal solution of conditional generative modeling belongs to the optimal solution set of generative modeling , i.e. , argminG KL ( QX , Y ‖PX , Y ) ⊆ argminG JS ( PX‖QX ) , learning with the discriminator will not change the convergence point of the generator that approximates the joint distribution of real data and labels regardless of the value of hyper-parameter λ > 0 . Furthermore , the hyper-parameter λ provides the flexibility to adjust the weight of conditional generative modeling .
The paper is about improving conditional GANs. To be specifically, it also aims to resolve the bias issue of ACGAN by proposing a discriminative classifier. The discriminative classifier is a hybrid model of discriminator and classifier, where it has to not tell real or fake, but also the class. Preliminary analysis of the proposed method are provided. Experiments are conducted on the standard benchmarks.
SP:f81454b460aac0ede0a0c9a238c8d4cd51396ee5
CADDA: Class-wise Automatic Differentiable Data Augmentation for EEG Signals
1 Introduction . The interest in using deep learning for EEG related tasks has been rapidly growing in the last years , specially for applications in sleep staging , seizure detection and prediction , and brain-computer interfaces ( BCI ) ( Roy et al. , 2019 ) . Data augmentation is a well-known regularization technique , widely used to improve the generalization power of large models , specially in deep learning ( Krizhevsky et al. , 2012 ; Yaeger et al. , 1996 ; Simard et al. , 2003 ) . Not only does it help by synthetically increasing the size of the dataset used for training , it also creates useful inductive biases , as it encodes invariances of the data and the underlying decision function which the model does not have to learn from scratch ( Chen et al. , 2020a ; van der Maaten et al. , 2013 ) . Such invariant transforms are also a key ingredient for stateof-the-art self-supervised learning ( Chen et al. , 2020b ) . Unfortunately , these transforms have to be known a priori and the best augmentations to use often highly depend on the model architecture , the task , the dataset and even the training stage ( Ho et al. , 2019 ; Cubuk et al. , 2020 ) . Manually finding what augmentation to use for a new problem is a cumbersome task , and this motivated the proposal of several automatic data augmentation search algorithms ( Cubuk et al. , 2019 ) . The existing automatic data augmentation literature often focuses on computer vision problems only , and its application to other scientific domains such as neuroscience has been under-explored . Data augmentation is all the more important in this field , as brain data , be it functional MRI ( fMRI ) or electroencephalography ( EEG ) signals , is very scarce either because its acquisition is complicated and costly or because expert knowledge is required for labelling it , or both . Furthermore , while atomic transformations encoding suitable invariances for images are intuitive ( if you flip the picture of a cat horizontally it is still a cat ) , the same can not be said about functional brain signals such as EEG . Hence , automatic data augmentation search could be helpful not only to improve the performance of predictive models on EEG data , but also to discover interesting invariances present in brain signals . Another interesting aspect of data augmentation that has gotten little attention is the fact that suitable invariances often depend on the class considered . When doing object recognition on images , using color transformations during training can help the model to better recognize cars or lamps , which are invariant to it , but will probably hurt the performance for classes which are strongly defined by their color , such as apples or oranges . This also applies to neuroscience tasks , such as sleep staging which is part of a clinical exam conducted to characterize sleep disorders . As most commonly done ( Iber et al. , 2007 ) , it consists in assigning to windows of 30 s of signals a label among five : Wake ( W ) , Rapid Eye Movement ( REM ) and Non-REM of depth 1 , 2 or 3 ( N1 , N2 , N3 ) . While some sleep stages are strongly characterized by the presence of waves with a particular shape , such as spindles and Kcomplexes in the N2 stage , others are defined by the dominating frequencies in the signal , such as alpha and theta rhythms in W and N1 stages respectively ( Rosenberg & Van Hout , 2013 ) . This means that while randomly setting some small portion of a signal to zero might work to augment W or N1 signals , it might wash out important waves in N2 stages and slow down the learning for this class . This motivates the study of augmentations depending on the class . Of course , as this greatly increases the number of operations and parameters to set , handcrafting such augmentations is not conceivable and efficient automatic searching strategies are required , which is the central topic of this paper . Using black-box optimization algorithms as most automatic data augmentation papers suggest seemed unsuitable given the exponential increase in complexity of the problem when separate augmentations for each class are considered . In this paper , we extend the bilevel framework of AutoAugment ( Cubuk et al. , 2019 ) in order to search for class-wise ( CW ) data augmentation policies . First , Section 3 introduces three novel augmentation operations for EEG signals , and Section 4 quantifies on sleep staging and digit classification tasks how CW augmentations can enable gains in prediction performance by exploiting interesting invariances . Then , Section 5 introduces a novel differentiable relaxation of this extended problem which enables gradient-based policy learning . Finally , in Section 6 , we use the EEG sleep staging task in the class-agnostic setting to evaluate our approach against previously proposed gradient-based methods . In the class-wise setting , the CADDA method is compared against gradient-free methods that can suffer significantly from the dimension of policy learning problem . Furthermore , we carry an ablation study which clarifies the impact of each architecture choices that we propose . Our experiments also investigate density matching-based approaches ( Lim et al. , 2019 ; Hataya et al. , 2020 ) in low or medium data regimes . 2 Related Work . EEG Data Augmentation Given the relatively small size of available EEG datasets , part of the community has explored ways of generating more data from existing ones , e.g. , using generative models ( Hartmann et al. , 2018 ; Bouallegue & Djemal , 2020 ) or data augmentation strategies ( e.g. , Roy et al . 2019 ; Yin & Zhang 2017 ; Wang et al . 2018 ) . Here , we give a succinct review which is completed in Appendix B . The reader is referred to Roy et al . ( 2019 ) for a more detailed discussion on previous EEG data augmentation papers . Noise addition is the most straight-forward data augmentation that can be applied to either raw EEG signals ( Wang et al. , 2018 ) or to derived features ( Yin & Zhang , 2017 ) . Adding such transformed samples forces the estimator to learn a decision function that is invariant to the added noise . Other transforms have also been proposed to account for other sources of noise , such as label misalignment with the time shift ( Mohsenvand et al. , 2020 ) , positional noise for the sensors with sensor rotations ( Krell & Kim , 2017 ) or corrupted sensors with channel dropout ( Saeed et al. , 2021 ) . Other data augmentations aim at promoting some global properties in the model . While masking strategies such as time masking , bandstop filter ( Mohsenvand et al. , 2020 ) or sensors cutout ( Cheng et al. , 2020 ) ensure that the model does not rely on specific time segments , frequency bands or sensor , channel symmetry ( Deiss et al. , 2018 ) encourages the model to account for the brain bilateral symmetry . Likewise , the Fourier Transform ( FT ) surrogate ( Schwabedal et al. , 2019 ) consists in replacing the phases of Fourier coefficients by random numbers sampled uniformly from [ 0 , 2π ) . The authors of this transformation argue that EEG signals can be approximated by linear stationary processes , which are uniquely characterized by their Fourier amplitudes . Automatic Data Augmentation Automatic data augmentation ( ADA ) is about searching augmentations that , when applied during the model training , will minimize its validation loss , leading to greater generalization . Let Dtrain and Dvalid denote a training and validation set respectively , and let T be an augmentation policy , as defined in more detail in Section 4 . ADA is about finding algorithms solving the following bilevel optimization problem : min T L ( θ∗|Dvalid ) s.t . θ∗ ∈ arg min θ L ( θ|T ( Dtrain ) ) , ( 1 ) where θ denotes the parameters of some predictive model , and L ( θ|D ) its loss over set D. One of the first influential works in this area is AutoAugment ( Cubuk et al. , 2019 ) , where problem ( 1 ) is solved by fully training multiple times a smaller model on a subset of the training set with different augmentation policies and using the validation loss as a reward function in a reinforcement learning setting . The main drawback of the method is its enormous computation cost . Many alternative methods have been proposed since , differing mainly in terms of search space , search algorithm , and metric used to assess each policy . The first attempts to make AutoAugment more efficient consisted in carrying model and policy trainings jointly , as done with a genetic algorithm in Population-Based Augmentation ( Ho et al. , 2019 ) . A different way of alleviating the computation burden of AutoAugment is proposed in Tian et al . ( 2020 ) . Observing that data augmentation is mostly useful at the end of training , the authors propose to pre-train a shared model close to convergence with augmentations sampled uniformly , and then to use it to warmstart AutoAugment . The previous methods ( Cubuk et al. , 2019 ; Ho et al. , 2019 ; Lim et al. , 2019 ) use proxy tasks with small models and training subsets to carry the search . This idea is challenged in RandAugment ( Cubuk et al. , 2020 ) , where it is shown that optimal augmentations highly depend on the dataset size and model . RandAugment simply samples augmentations uniformly with the same shared magnitude , which can be tuned with a grid-search . Competitive results are obtained on computer vision tasks with this naive policy . A similar approach is proposed in Fons et al . ( 2021 ) , where all possible augmentations are weighted with learnable parameters and used to derive enlarged batches . Density Matching While all previously cited ADA methods try to solve in some sense the original problem ( 1 ) , Fast AutoAugment ( Lim et al. , 2019 ) suggests to solve a surrogate problem , by moving the policy T into the upper-level : min T L ( θ∗|T ( Dvalid ) ) s.t . θ∗ ∈ arg min θ L ( θ|Dtrain ) . ( 2 ) Problem ( 2 ) can be seen as a form of density matching ( Lim et al. , 2019 ) , where we look for augmentation policies such that the augmented validation set has the same distribution as the training set , as evaluated through the lens of the trained model . This greatly simplifies problem ( 1 ) which is no longer bilevel , allowing to train the model only once without augmentation . Computation is massively reduced , yet this simplification assumes the trained model has already captured meaningful invariances . This density matching objective has been later reused in Faster AutoAugment ( Hataya et al. , 2020 ) , where a Wasserstein GAN network ( Arjovsky et al. , 2017 ) is used instead of the trained classifier to assess the closeness between augmented and original data distributions . Gradient-based Automatic Data Augmentation Further efficiency improvements in ADA were obtained by exploring gradient-based optimization . In Online Hyper-parameter Learning ( Lin et al. , 2019 ) and Adversarial AutoAugment ( Zhang et al. , 2019 ) , policies are 0.0 2.5 5.0 7.5 10.0 12.5 15.0 17.5 20.0 Frequency ( Hz ) 10 20 30 40 V 2 /H z ( dB ) Sleep stage N2 Subject 1 Subject 2 Subject 1 w/ 0.5 Hz Freq . shift Figure 1 : Averaged power spectral density of N2 windows from one night sleep of two different subjects from the sleep Physionet dataset ( channel Pz-Oz used here ) ( Goldberger et al. , 2000 ) . We notice that peak frequencies are shifted . Applying a 0.5Hz frequency shift transform to subject 1 leads a power spectrum density more similar to subject 2. modeled as parametrized discrete distributions over possible transformations and updated using the REINFORCE gradient estimator ( Williams , 1992 ) . As such estimators are quite noisy , Faster AutoAugment ( Faster AA ) and DADA ( Li et al. , 2020 ) derive full continuous relaxations of the discrete original formalism of AutoAugment , allowing them to backpropagate directly through policies . We have revisited this idea in this work . Class-dependent Data Augmentation While class-dependent data generation has been studied in the GAN literature ( Mirza & Osindero , 2014 ) , to our knowledge , Hauberg et al . ( 2016 ) is the only work that has explored class-dependent data augmentations . It presents a method for learning a distribution of CW spatial distortions , by training a model to find the C1-diffeomorphism allowing to transform one example into another within the same class . Although the authors state it is applicable to other domains , it is only demonstrated for digit classification and its extension to other frameworks seems non-trivial . The main difference with our work is that Hauberg et al . ( 2016 ) learns transformations from scratch , while we try to learn which one to pick from a pool of existing operations and how to aggregate them .
The paper proposes an automatic differentiable data augmentation algorithm for EEG data that outperforms existing methods. They also propose novel augmentations for EEG that help the model to train better in low-labeled data regimes. They also show preliminary results showcasing that class-wise augmentation can be better than class agnostic augmentations for EEG data.
SP:19d0d6d651f83f8f0eeeae61357264bae7e1b204
CADDA: Class-wise Automatic Differentiable Data Augmentation for EEG Signals
1 Introduction . The interest in using deep learning for EEG related tasks has been rapidly growing in the last years , specially for applications in sleep staging , seizure detection and prediction , and brain-computer interfaces ( BCI ) ( Roy et al. , 2019 ) . Data augmentation is a well-known regularization technique , widely used to improve the generalization power of large models , specially in deep learning ( Krizhevsky et al. , 2012 ; Yaeger et al. , 1996 ; Simard et al. , 2003 ) . Not only does it help by synthetically increasing the size of the dataset used for training , it also creates useful inductive biases , as it encodes invariances of the data and the underlying decision function which the model does not have to learn from scratch ( Chen et al. , 2020a ; van der Maaten et al. , 2013 ) . Such invariant transforms are also a key ingredient for stateof-the-art self-supervised learning ( Chen et al. , 2020b ) . Unfortunately , these transforms have to be known a priori and the best augmentations to use often highly depend on the model architecture , the task , the dataset and even the training stage ( Ho et al. , 2019 ; Cubuk et al. , 2020 ) . Manually finding what augmentation to use for a new problem is a cumbersome task , and this motivated the proposal of several automatic data augmentation search algorithms ( Cubuk et al. , 2019 ) . The existing automatic data augmentation literature often focuses on computer vision problems only , and its application to other scientific domains such as neuroscience has been under-explored . Data augmentation is all the more important in this field , as brain data , be it functional MRI ( fMRI ) or electroencephalography ( EEG ) signals , is very scarce either because its acquisition is complicated and costly or because expert knowledge is required for labelling it , or both . Furthermore , while atomic transformations encoding suitable invariances for images are intuitive ( if you flip the picture of a cat horizontally it is still a cat ) , the same can not be said about functional brain signals such as EEG . Hence , automatic data augmentation search could be helpful not only to improve the performance of predictive models on EEG data , but also to discover interesting invariances present in brain signals . Another interesting aspect of data augmentation that has gotten little attention is the fact that suitable invariances often depend on the class considered . When doing object recognition on images , using color transformations during training can help the model to better recognize cars or lamps , which are invariant to it , but will probably hurt the performance for classes which are strongly defined by their color , such as apples or oranges . This also applies to neuroscience tasks , such as sleep staging which is part of a clinical exam conducted to characterize sleep disorders . As most commonly done ( Iber et al. , 2007 ) , it consists in assigning to windows of 30 s of signals a label among five : Wake ( W ) , Rapid Eye Movement ( REM ) and Non-REM of depth 1 , 2 or 3 ( N1 , N2 , N3 ) . While some sleep stages are strongly characterized by the presence of waves with a particular shape , such as spindles and Kcomplexes in the N2 stage , others are defined by the dominating frequencies in the signal , such as alpha and theta rhythms in W and N1 stages respectively ( Rosenberg & Van Hout , 2013 ) . This means that while randomly setting some small portion of a signal to zero might work to augment W or N1 signals , it might wash out important waves in N2 stages and slow down the learning for this class . This motivates the study of augmentations depending on the class . Of course , as this greatly increases the number of operations and parameters to set , handcrafting such augmentations is not conceivable and efficient automatic searching strategies are required , which is the central topic of this paper . Using black-box optimization algorithms as most automatic data augmentation papers suggest seemed unsuitable given the exponential increase in complexity of the problem when separate augmentations for each class are considered . In this paper , we extend the bilevel framework of AutoAugment ( Cubuk et al. , 2019 ) in order to search for class-wise ( CW ) data augmentation policies . First , Section 3 introduces three novel augmentation operations for EEG signals , and Section 4 quantifies on sleep staging and digit classification tasks how CW augmentations can enable gains in prediction performance by exploiting interesting invariances . Then , Section 5 introduces a novel differentiable relaxation of this extended problem which enables gradient-based policy learning . Finally , in Section 6 , we use the EEG sleep staging task in the class-agnostic setting to evaluate our approach against previously proposed gradient-based methods . In the class-wise setting , the CADDA method is compared against gradient-free methods that can suffer significantly from the dimension of policy learning problem . Furthermore , we carry an ablation study which clarifies the impact of each architecture choices that we propose . Our experiments also investigate density matching-based approaches ( Lim et al. , 2019 ; Hataya et al. , 2020 ) in low or medium data regimes . 2 Related Work . EEG Data Augmentation Given the relatively small size of available EEG datasets , part of the community has explored ways of generating more data from existing ones , e.g. , using generative models ( Hartmann et al. , 2018 ; Bouallegue & Djemal , 2020 ) or data augmentation strategies ( e.g. , Roy et al . 2019 ; Yin & Zhang 2017 ; Wang et al . 2018 ) . Here , we give a succinct review which is completed in Appendix B . The reader is referred to Roy et al . ( 2019 ) for a more detailed discussion on previous EEG data augmentation papers . Noise addition is the most straight-forward data augmentation that can be applied to either raw EEG signals ( Wang et al. , 2018 ) or to derived features ( Yin & Zhang , 2017 ) . Adding such transformed samples forces the estimator to learn a decision function that is invariant to the added noise . Other transforms have also been proposed to account for other sources of noise , such as label misalignment with the time shift ( Mohsenvand et al. , 2020 ) , positional noise for the sensors with sensor rotations ( Krell & Kim , 2017 ) or corrupted sensors with channel dropout ( Saeed et al. , 2021 ) . Other data augmentations aim at promoting some global properties in the model . While masking strategies such as time masking , bandstop filter ( Mohsenvand et al. , 2020 ) or sensors cutout ( Cheng et al. , 2020 ) ensure that the model does not rely on specific time segments , frequency bands or sensor , channel symmetry ( Deiss et al. , 2018 ) encourages the model to account for the brain bilateral symmetry . Likewise , the Fourier Transform ( FT ) surrogate ( Schwabedal et al. , 2019 ) consists in replacing the phases of Fourier coefficients by random numbers sampled uniformly from [ 0 , 2π ) . The authors of this transformation argue that EEG signals can be approximated by linear stationary processes , which are uniquely characterized by their Fourier amplitudes . Automatic Data Augmentation Automatic data augmentation ( ADA ) is about searching augmentations that , when applied during the model training , will minimize its validation loss , leading to greater generalization . Let Dtrain and Dvalid denote a training and validation set respectively , and let T be an augmentation policy , as defined in more detail in Section 4 . ADA is about finding algorithms solving the following bilevel optimization problem : min T L ( θ∗|Dvalid ) s.t . θ∗ ∈ arg min θ L ( θ|T ( Dtrain ) ) , ( 1 ) where θ denotes the parameters of some predictive model , and L ( θ|D ) its loss over set D. One of the first influential works in this area is AutoAugment ( Cubuk et al. , 2019 ) , where problem ( 1 ) is solved by fully training multiple times a smaller model on a subset of the training set with different augmentation policies and using the validation loss as a reward function in a reinforcement learning setting . The main drawback of the method is its enormous computation cost . Many alternative methods have been proposed since , differing mainly in terms of search space , search algorithm , and metric used to assess each policy . The first attempts to make AutoAugment more efficient consisted in carrying model and policy trainings jointly , as done with a genetic algorithm in Population-Based Augmentation ( Ho et al. , 2019 ) . A different way of alleviating the computation burden of AutoAugment is proposed in Tian et al . ( 2020 ) . Observing that data augmentation is mostly useful at the end of training , the authors propose to pre-train a shared model close to convergence with augmentations sampled uniformly , and then to use it to warmstart AutoAugment . The previous methods ( Cubuk et al. , 2019 ; Ho et al. , 2019 ; Lim et al. , 2019 ) use proxy tasks with small models and training subsets to carry the search . This idea is challenged in RandAugment ( Cubuk et al. , 2020 ) , where it is shown that optimal augmentations highly depend on the dataset size and model . RandAugment simply samples augmentations uniformly with the same shared magnitude , which can be tuned with a grid-search . Competitive results are obtained on computer vision tasks with this naive policy . A similar approach is proposed in Fons et al . ( 2021 ) , where all possible augmentations are weighted with learnable parameters and used to derive enlarged batches . Density Matching While all previously cited ADA methods try to solve in some sense the original problem ( 1 ) , Fast AutoAugment ( Lim et al. , 2019 ) suggests to solve a surrogate problem , by moving the policy T into the upper-level : min T L ( θ∗|T ( Dvalid ) ) s.t . θ∗ ∈ arg min θ L ( θ|Dtrain ) . ( 2 ) Problem ( 2 ) can be seen as a form of density matching ( Lim et al. , 2019 ) , where we look for augmentation policies such that the augmented validation set has the same distribution as the training set , as evaluated through the lens of the trained model . This greatly simplifies problem ( 1 ) which is no longer bilevel , allowing to train the model only once without augmentation . Computation is massively reduced , yet this simplification assumes the trained model has already captured meaningful invariances . This density matching objective has been later reused in Faster AutoAugment ( Hataya et al. , 2020 ) , where a Wasserstein GAN network ( Arjovsky et al. , 2017 ) is used instead of the trained classifier to assess the closeness between augmented and original data distributions . Gradient-based Automatic Data Augmentation Further efficiency improvements in ADA were obtained by exploring gradient-based optimization . In Online Hyper-parameter Learning ( Lin et al. , 2019 ) and Adversarial AutoAugment ( Zhang et al. , 2019 ) , policies are 0.0 2.5 5.0 7.5 10.0 12.5 15.0 17.5 20.0 Frequency ( Hz ) 10 20 30 40 V 2 /H z ( dB ) Sleep stage N2 Subject 1 Subject 2 Subject 1 w/ 0.5 Hz Freq . shift Figure 1 : Averaged power spectral density of N2 windows from one night sleep of two different subjects from the sleep Physionet dataset ( channel Pz-Oz used here ) ( Goldberger et al. , 2000 ) . We notice that peak frequencies are shifted . Applying a 0.5Hz frequency shift transform to subject 1 leads a power spectrum density more similar to subject 2. modeled as parametrized discrete distributions over possible transformations and updated using the REINFORCE gradient estimator ( Williams , 1992 ) . As such estimators are quite noisy , Faster AutoAugment ( Faster AA ) and DADA ( Li et al. , 2020 ) derive full continuous relaxations of the discrete original formalism of AutoAugment , allowing them to backpropagate directly through policies . We have revisited this idea in this work . Class-dependent Data Augmentation While class-dependent data generation has been studied in the GAN literature ( Mirza & Osindero , 2014 ) , to our knowledge , Hauberg et al . ( 2016 ) is the only work that has explored class-dependent data augmentations . It presents a method for learning a distribution of CW spatial distortions , by training a model to find the C1-diffeomorphism allowing to transform one example into another within the same class . Although the authors state it is applicable to other domains , it is only demonstrated for digit classification and its extension to other frameworks seems non-trivial . The main difference with our work is that Hauberg et al . ( 2016 ) learns transformations from scratch , while we try to learn which one to pick from a pool of existing operations and how to aggregate them .
THis paper proposes a special version of AutoAugment to search class-wise data augmentation policies for EEG data. The main contribution of this paper is a novel differentiable relaxation algorithm on EEG data (ADDA) that significantly efficiency of policy search. Through the EEG sleep staging task, the paper shows they achieved SOTA with 40% speed on efficiency and 1.4% accuracy increase.
SP:19d0d6d651f83f8f0eeeae61357264bae7e1b204
CADDA: Class-wise Automatic Differentiable Data Augmentation for EEG Signals
1 Introduction . The interest in using deep learning for EEG related tasks has been rapidly growing in the last years , specially for applications in sleep staging , seizure detection and prediction , and brain-computer interfaces ( BCI ) ( Roy et al. , 2019 ) . Data augmentation is a well-known regularization technique , widely used to improve the generalization power of large models , specially in deep learning ( Krizhevsky et al. , 2012 ; Yaeger et al. , 1996 ; Simard et al. , 2003 ) . Not only does it help by synthetically increasing the size of the dataset used for training , it also creates useful inductive biases , as it encodes invariances of the data and the underlying decision function which the model does not have to learn from scratch ( Chen et al. , 2020a ; van der Maaten et al. , 2013 ) . Such invariant transforms are also a key ingredient for stateof-the-art self-supervised learning ( Chen et al. , 2020b ) . Unfortunately , these transforms have to be known a priori and the best augmentations to use often highly depend on the model architecture , the task , the dataset and even the training stage ( Ho et al. , 2019 ; Cubuk et al. , 2020 ) . Manually finding what augmentation to use for a new problem is a cumbersome task , and this motivated the proposal of several automatic data augmentation search algorithms ( Cubuk et al. , 2019 ) . The existing automatic data augmentation literature often focuses on computer vision problems only , and its application to other scientific domains such as neuroscience has been under-explored . Data augmentation is all the more important in this field , as brain data , be it functional MRI ( fMRI ) or electroencephalography ( EEG ) signals , is very scarce either because its acquisition is complicated and costly or because expert knowledge is required for labelling it , or both . Furthermore , while atomic transformations encoding suitable invariances for images are intuitive ( if you flip the picture of a cat horizontally it is still a cat ) , the same can not be said about functional brain signals such as EEG . Hence , automatic data augmentation search could be helpful not only to improve the performance of predictive models on EEG data , but also to discover interesting invariances present in brain signals . Another interesting aspect of data augmentation that has gotten little attention is the fact that suitable invariances often depend on the class considered . When doing object recognition on images , using color transformations during training can help the model to better recognize cars or lamps , which are invariant to it , but will probably hurt the performance for classes which are strongly defined by their color , such as apples or oranges . This also applies to neuroscience tasks , such as sleep staging which is part of a clinical exam conducted to characterize sleep disorders . As most commonly done ( Iber et al. , 2007 ) , it consists in assigning to windows of 30 s of signals a label among five : Wake ( W ) , Rapid Eye Movement ( REM ) and Non-REM of depth 1 , 2 or 3 ( N1 , N2 , N3 ) . While some sleep stages are strongly characterized by the presence of waves with a particular shape , such as spindles and Kcomplexes in the N2 stage , others are defined by the dominating frequencies in the signal , such as alpha and theta rhythms in W and N1 stages respectively ( Rosenberg & Van Hout , 2013 ) . This means that while randomly setting some small portion of a signal to zero might work to augment W or N1 signals , it might wash out important waves in N2 stages and slow down the learning for this class . This motivates the study of augmentations depending on the class . Of course , as this greatly increases the number of operations and parameters to set , handcrafting such augmentations is not conceivable and efficient automatic searching strategies are required , which is the central topic of this paper . Using black-box optimization algorithms as most automatic data augmentation papers suggest seemed unsuitable given the exponential increase in complexity of the problem when separate augmentations for each class are considered . In this paper , we extend the bilevel framework of AutoAugment ( Cubuk et al. , 2019 ) in order to search for class-wise ( CW ) data augmentation policies . First , Section 3 introduces three novel augmentation operations for EEG signals , and Section 4 quantifies on sleep staging and digit classification tasks how CW augmentations can enable gains in prediction performance by exploiting interesting invariances . Then , Section 5 introduces a novel differentiable relaxation of this extended problem which enables gradient-based policy learning . Finally , in Section 6 , we use the EEG sleep staging task in the class-agnostic setting to evaluate our approach against previously proposed gradient-based methods . In the class-wise setting , the CADDA method is compared against gradient-free methods that can suffer significantly from the dimension of policy learning problem . Furthermore , we carry an ablation study which clarifies the impact of each architecture choices that we propose . Our experiments also investigate density matching-based approaches ( Lim et al. , 2019 ; Hataya et al. , 2020 ) in low or medium data regimes . 2 Related Work . EEG Data Augmentation Given the relatively small size of available EEG datasets , part of the community has explored ways of generating more data from existing ones , e.g. , using generative models ( Hartmann et al. , 2018 ; Bouallegue & Djemal , 2020 ) or data augmentation strategies ( e.g. , Roy et al . 2019 ; Yin & Zhang 2017 ; Wang et al . 2018 ) . Here , we give a succinct review which is completed in Appendix B . The reader is referred to Roy et al . ( 2019 ) for a more detailed discussion on previous EEG data augmentation papers . Noise addition is the most straight-forward data augmentation that can be applied to either raw EEG signals ( Wang et al. , 2018 ) or to derived features ( Yin & Zhang , 2017 ) . Adding such transformed samples forces the estimator to learn a decision function that is invariant to the added noise . Other transforms have also been proposed to account for other sources of noise , such as label misalignment with the time shift ( Mohsenvand et al. , 2020 ) , positional noise for the sensors with sensor rotations ( Krell & Kim , 2017 ) or corrupted sensors with channel dropout ( Saeed et al. , 2021 ) . Other data augmentations aim at promoting some global properties in the model . While masking strategies such as time masking , bandstop filter ( Mohsenvand et al. , 2020 ) or sensors cutout ( Cheng et al. , 2020 ) ensure that the model does not rely on specific time segments , frequency bands or sensor , channel symmetry ( Deiss et al. , 2018 ) encourages the model to account for the brain bilateral symmetry . Likewise , the Fourier Transform ( FT ) surrogate ( Schwabedal et al. , 2019 ) consists in replacing the phases of Fourier coefficients by random numbers sampled uniformly from [ 0 , 2π ) . The authors of this transformation argue that EEG signals can be approximated by linear stationary processes , which are uniquely characterized by their Fourier amplitudes . Automatic Data Augmentation Automatic data augmentation ( ADA ) is about searching augmentations that , when applied during the model training , will minimize its validation loss , leading to greater generalization . Let Dtrain and Dvalid denote a training and validation set respectively , and let T be an augmentation policy , as defined in more detail in Section 4 . ADA is about finding algorithms solving the following bilevel optimization problem : min T L ( θ∗|Dvalid ) s.t . θ∗ ∈ arg min θ L ( θ|T ( Dtrain ) ) , ( 1 ) where θ denotes the parameters of some predictive model , and L ( θ|D ) its loss over set D. One of the first influential works in this area is AutoAugment ( Cubuk et al. , 2019 ) , where problem ( 1 ) is solved by fully training multiple times a smaller model on a subset of the training set with different augmentation policies and using the validation loss as a reward function in a reinforcement learning setting . The main drawback of the method is its enormous computation cost . Many alternative methods have been proposed since , differing mainly in terms of search space , search algorithm , and metric used to assess each policy . The first attempts to make AutoAugment more efficient consisted in carrying model and policy trainings jointly , as done with a genetic algorithm in Population-Based Augmentation ( Ho et al. , 2019 ) . A different way of alleviating the computation burden of AutoAugment is proposed in Tian et al . ( 2020 ) . Observing that data augmentation is mostly useful at the end of training , the authors propose to pre-train a shared model close to convergence with augmentations sampled uniformly , and then to use it to warmstart AutoAugment . The previous methods ( Cubuk et al. , 2019 ; Ho et al. , 2019 ; Lim et al. , 2019 ) use proxy tasks with small models and training subsets to carry the search . This idea is challenged in RandAugment ( Cubuk et al. , 2020 ) , where it is shown that optimal augmentations highly depend on the dataset size and model . RandAugment simply samples augmentations uniformly with the same shared magnitude , which can be tuned with a grid-search . Competitive results are obtained on computer vision tasks with this naive policy . A similar approach is proposed in Fons et al . ( 2021 ) , where all possible augmentations are weighted with learnable parameters and used to derive enlarged batches . Density Matching While all previously cited ADA methods try to solve in some sense the original problem ( 1 ) , Fast AutoAugment ( Lim et al. , 2019 ) suggests to solve a surrogate problem , by moving the policy T into the upper-level : min T L ( θ∗|T ( Dvalid ) ) s.t . θ∗ ∈ arg min θ L ( θ|Dtrain ) . ( 2 ) Problem ( 2 ) can be seen as a form of density matching ( Lim et al. , 2019 ) , where we look for augmentation policies such that the augmented validation set has the same distribution as the training set , as evaluated through the lens of the trained model . This greatly simplifies problem ( 1 ) which is no longer bilevel , allowing to train the model only once without augmentation . Computation is massively reduced , yet this simplification assumes the trained model has already captured meaningful invariances . This density matching objective has been later reused in Faster AutoAugment ( Hataya et al. , 2020 ) , where a Wasserstein GAN network ( Arjovsky et al. , 2017 ) is used instead of the trained classifier to assess the closeness between augmented and original data distributions . Gradient-based Automatic Data Augmentation Further efficiency improvements in ADA were obtained by exploring gradient-based optimization . In Online Hyper-parameter Learning ( Lin et al. , 2019 ) and Adversarial AutoAugment ( Zhang et al. , 2019 ) , policies are 0.0 2.5 5.0 7.5 10.0 12.5 15.0 17.5 20.0 Frequency ( Hz ) 10 20 30 40 V 2 /H z ( dB ) Sleep stage N2 Subject 1 Subject 2 Subject 1 w/ 0.5 Hz Freq . shift Figure 1 : Averaged power spectral density of N2 windows from one night sleep of two different subjects from the sleep Physionet dataset ( channel Pz-Oz used here ) ( Goldberger et al. , 2000 ) . We notice that peak frequencies are shifted . Applying a 0.5Hz frequency shift transform to subject 1 leads a power spectrum density more similar to subject 2. modeled as parametrized discrete distributions over possible transformations and updated using the REINFORCE gradient estimator ( Williams , 1992 ) . As such estimators are quite noisy , Faster AutoAugment ( Faster AA ) and DADA ( Li et al. , 2020 ) derive full continuous relaxations of the discrete original formalism of AutoAugment , allowing them to backpropagate directly through policies . We have revisited this idea in this work . Class-dependent Data Augmentation While class-dependent data generation has been studied in the GAN literature ( Mirza & Osindero , 2014 ) , to our knowledge , Hauberg et al . ( 2016 ) is the only work that has explored class-dependent data augmentations . It presents a method for learning a distribution of CW spatial distortions , by training a model to find the C1-diffeomorphism allowing to transform one example into another within the same class . Although the authors state it is applicable to other domains , it is only demonstrated for digit classification and its extension to other frameworks seems non-trivial . The main difference with our work is that Hauberg et al . ( 2016 ) learns transformations from scratch , while we try to learn which one to pick from a pool of existing operations and how to aggregate them .
This paper studies gradient-based automatic data augmentation algorithms amenable to class-wise policies with exponentially larger search spaces. It presents a method, called CADDA, to address the problem of automatic data augmentation with application on EEG signals. The proposed method achieves good results for EEG sleep stage classification.
SP:19d0d6d651f83f8f0eeeae61357264bae7e1b204
Language Model Pre-training Improves Generalization in Policy Learning
1 INTRODUCTION . In recent years , language models ( LMs ) trained on open-domain text corpora have come to play a central role in machine learning approaches to natural language processing tasks ( Devlin et al. , 2018 ) . This includes tasks that are not purely linguistic , and additionally require nontrivial planning and reasoning capabilities : examples include as vision-language navigation ( Majumdar et al. , 2020 ; Fried et al. , 2018 ; Suglia et al. , 2021 ) , instruction following ( Zhang & Chai , 2021 ; Hill et al. , 2020 ) , and visual question answering ( Tsimpoukelli et al. , 2021 ) . Indeed , some of these tasks are so remotely connected to language modeling that it is natural to ask whether the capabilities that result from LM pre-training might extend to tasks that involve no language at all—and if so , how these capabilities might be accessed in a model trained only to process and generate natural language strings . In this paper , we study these questions through the lens of embodied decision-making , investigating the effectiveness of LM pretraining as a scaffold for learning control policies for interactive tasks featuring partial observability , large action spaces , complex states , and complex dynamics . We describe a series of experiments in the VirtualHome environment ( Puig et al. , 2018 ; 2020 ) in which LMs are used to initialize policies , and show that LM pre-training substantially improves generalization across common-place tasks in household environments . In Experiment 1 ( Section 6 ) , we encode the inputs to a policy—including observations , goals , and action histories—as templated English phrases ( e.g . representing the goal on ( fork , table ) as There is a fork on the table . ) as shown in Figure 1 . A pretrained LM is then fined-tuned to produce representations of these phrases that can be used to predict subsequent actions . For i.i.d . training and evaluation tasks , we find that this approach completes tasks at a rate comparable to the same transformer-based policy trained from scratch . For generalization to out-of-distribution tasks , however , LM pretraining confers substantial benefits : it improves task completion rates by nearly 20 % for tasks involving novel initial environment states and goals ( Figure 1 “ Transformer from scratch ” and “ Pretrained transformer ( natural encoding ) ” ) . Next , we conduct two experiments aimed at clarifying the role of this string-based encoding . We design Experiment 2A that uses random strings instead of natural language inputs and Experiment 2B that uses non string-based encodings to study different ways of building interfaces between input encodings and LMs . In Experiment 2A ( Section 7 ) , we replace the “ natural ” string encodings of Experiment 1 with an arbitrary mapping between logical goals and tokens ( e.g . serializing on ( fork , table ) as brought wise character trees fine order yet ) . This random encoding substantially ( by roughly 12 % ) degrades performance on out-of-distribution tasks , indicating that LM encoders are sensitive to the form of string encodings even when fine-tuned ( Figure 1 “ Pretrained transformer ( natural encoding ) ” and “ Pretrained transformer ( random encoding ) ” ) . In Experiment 2B , we investigate whether string-based encodings are necessary at all . We replace the model ’ s word embedding layer with a randomly initialized embedding layer that maps from discretized environment observations , goal , and history actions to a sequence of LM input vectors , and fine-tune this embedding layer jointly with the LM itself . This learned encoder performs almost the same as the encoding of Experiment 1 , indicating that effective encodings for non-linguistic tasks can be learned from scratch ( Figure 1 “ Pretrained transformer ( natural encoding ) ” and “ Pretrained transformer ( learned encoding ) ” ) . These experiments offer two main conclusions . First , they show that language modeling improves generalization in policy learning : initializing a policy with a neural LM ( pre-trained on a nextword prediction task with a large text corpus ) substantially improves out-of-distribution performance on ( non-linguistic ) tasks in an interactive environment . Second , they show that language-based environment encodings are not needed to benefit from LM pretraining : it is instead possible to learn an interface between observations , actions , and model-internal representations derived from text corpora . These results point the possible effectiveness of language modeling as a generalpurpose pre-training scheme to promote structured generalization in broader machine learning applications . 2 RELATED WORK . In recent years , word and sentence representations from pre-trained LMs ( Peters et al. , 2018 ; Devlin et al. , 2018 ; Radford et al. , 2018 ) have become ubiquitious in natural language processing , playing a key role in state-of-the-art models for tasks ranging from machine translation ( Zhu et al. , 2020 ) to task-oriented dialog ( Platanios et al. , 2021 ) . Some of the most successful applications of pretraining lie at the boundary of natural language processing and other domains , as in instruction following ( Hill et al. , 2020 ) and language-guided image retrieval ( Lu et al. , 2019 ) . Building on this past work , our experiments in this paper aim to explain whether these successes result entirely from improved processing of text , or instead from domain-general representational abilities . Below , we briefly survey existing applications of pretraining that motivate the current study . Learning representations of language From nearly the earliest days of the field , natural language processing researchers have observed that representations of words derived from distributional statis- tics in large text corpora serve as useful features for downstream tasks ( Deerwester et al. , 1990 ; Dumais , 2004 ) . The earliest versions of these representation learning schemes focused on isolated word forms ( Mikolov et al. , 2013 ; Pennington et al. , 2014 ) . However , recent years have seen a number of techniques for training ( masked or autoregressive ) language models to produce contextualized word representations ( which incorporate information neighboring words in sentences and paragraphs ) via a variety of masked-word prediction objectives ( Devlin et al. , 2018 ; Yang et al. , 2019 ) . Applications In addition to producing useful representations , these language models can be finetuned to perform language processing tasks other than language modeling by casting those tasks as word-prediction problems . Successful uses of representations from pretrained models include syntactic parsing ( Kitaev et al. , 2018 ) and language-to-code translation ( Wang et al. , 2019 ) ; successful adaptations of LM prediction heads include machine translation ( Zhu et al. , 2020 ) , sentiment classification ( Brown et al. , 2020 ) and style transfer ( Keskar et al. , 2019 ) . Text-based games ( Yao et al. , 2021 ; Yuan et al. , 2018 ; Ammanabrolu & Riedl , 2018 ; Côté et al. , 2018 ) inherently involve text as both the input and the output . Recent works ( Yao et al. , 2020 ) in text-based games use GPT-2 to solve the text-based games and get significant performance improvements . However , it is hard to describe 3D information using text and most of their experiments are in 2D environments . Included in these successes are a number of tasks that integrate language and other modalities , including visual question answering and image captioning ( Yang et al. , 2020 ) . In models that condition on both text and image data , several previous approaches have found that image representations can be injected directly into language models ’ embedding layers ( Tsimpoukelli et al. , 2021 ) using a similar mechanism to the one we describe in Experiment 2B . One of our main contributions is to show that approach works even for tasks in which only non-linguistic information is relevant to model predictions . What do LMs encode ? The possibility that LMs might encode non-linguistic information useful for other downstream tasks is suggested by a number of recent “ probing ” studies aimed at understanding their predictions and the structure of their internal representations . Pre-trained LMs can answer a non-trivial fraction of queries about both factual and common-sense knowledge ( Roberts et al. , 2020 ) . Their representations encode information about perceptual relations among concepts , including visual similarity among object classes ( Ilharco et al. , 2020 ) and the structure of color spaces ( Abdou et al. , 2021 ) . Finally , they appear to be capable of basic simulation , modeling changes in entity states and relations described by text ( Li et al. , 2021 ) . LM pretraining beyond language Two recent papers consider questions closely related to the ones investigated here : ( Brown et al. , 2020 ) show that the GPT-3 model is capable of performing a limited set of arithmetic and string manipulation tasks ; ( Lu et al. , 2021 ) show that pretrained LMs require very little fine-tuning to match the performance of task-specific models on several image classification and numerical sequence processing tasks . In this paper , we focus on non-linguistic tasks where the inputs and outputs do not involve language . To the best of our knowledge , the current study is the first to demonstrate improved generalization in a non-linguistic problem over a standard neural-network baseline using a pre-trained language model . 3 LANGUAGE MODELING AND POLICY LEARNING . We begin with a brief review of the ingredients of language modeling and policy learning tasks used in our experiments . 3.1 LANGUAGE MODELING . Our experiments in this paper focus on autoregressive , transformer-based language models ( Vaswani et al. , 2017 ) . These models are trained to fit a distribution pθ ( y ) over a text sequence y by decomposing it into a sequence of tokens y = { y1 , y2 , . . . , yn } via the chain rule : log pθ ( y ) = n∑ i=1 log pθ ( yi | y1 , y2 , . . . , yi−1 ) . ( 1 ) Each conditional distribution pθ ( yi|y1 , y2 , . . . , yi−1 ) is parameterized by a transformer neural network fθ ( y1 , y2 , . . . , yi−1 ) . This network encodes each conditioned token yi into a continuous embedding ei = g ( yi ) which is then fed into the transformer architecture and encoded into a categorical distribution over token values of yi . Our experiments utilize a standard language model , GPT-2 , that is trained on Webtext dataset ( Radford et al. , 2018 ) using Huggingface library ( Wolf et al. , 2019 ) . 3.2 POMDPS AND POLICY LEARNING . Our experiments explore the application of LMs to general sequential decision-making tasks in partially observed environments . These tasks may be formalized as partially observable Markov decision processes ( POMDPs ) . A POMDP is defined by a set of states S , a set of observations O , a set of actions A , and a transition model T ( st+1|st , at ) that predicts the next state st+1 based on the current state st and an action at . Importantly , in a POMDP setting , the observation ot only captures a portion of the underlying state st , and an optimal decision-making strategy ( a policy ) must incorporate both the current observation and the previous history of observations and actions . For experiments in this paper , policies are parametric models πψ ( at|g , h , ot ) that select actions given the goals g , history information h , and partial observations ot of the current state st. All our experiments use imitation learning ( Santara et al. , 2017 ; Ng et al. , 2000 ; Peng et al. , 2018 ) , specifically behavior cloning ( Pomerleau , 1991 ; 1989 ; Torabi et al. , 2018 ) , to train πψ . We collect a dataset of N̂ expert training trajectories D = { d1 , · · · , dN̂ } , where each individual trajectory consists of a set of goal , observations , and actions , i.e . di = { o1 , a1 , · · · , aT , g } , where T is the length of an expert trajectory . We then train a policy πψ ( at|g , ht , ot ) which maximizes the likelihood pψ ( a ) of the expert actions a = { a1 , · · · , aT } taken in a trajectory using supervised learning , log pψ ( a ) = T∑ t=1 log pψ ( at | g , ht , ot ) , ( 2 ) where ht consists of all history in the environment up to timestep t .
**After rebuttal**: I am keeping my score. But I will not fight against rejecting the paper. I think the results are promising but the scope of the experiments are limited and the claims need to be more precise. As pointed out in my discussion with the authors, there are also several important missing details that makes it hard to understand and appreciate the experimental settings. I like the idea of experiment 2B but the change from the string-based representation to the one-hot representation does not seem to be a significant change, as they both give the language model a sequence of word vectors. This may just show that the order of the words in the goal and history does not matter for the navigation decisions (which is kind of expected given the simple templates used to generate the string-based representation). The paper's claims would also be strengthened with reasonable explanations for the observed phenomena. The paper currently treats the experiment observations as "conclusions", which I think may be over-generalization given the limited scope of the experiments (one simulator, one type of current-state input representation). **Before rebuttal**: The paper proposes and studies the effectiveness of using pre-trained LMs to solve a sequential decision-making problem where the observations, goals, and actions are not originally represented in language. The authors design three experiments: 1. Convert the problem to language modeling and measure the effectiveness of pre-training the LM. 2. Compare performance of using the language input representation versus a random-string input representation. 3. Determine whether converting the inputs to texts is necessary. The paper concludes that (1) language modeling improves generalization in policy learning, (2) language-based environment encodings are not needed to benefit from LM-pretraining, and (3) the results point the possible effectiveness of language modeling as a general-purpose pre-training scheme.
SP:6982fbcb6e7f4e90d89cfdd2cb2e0b5d0bbd9f1d
Language Model Pre-training Improves Generalization in Policy Learning
1 INTRODUCTION . In recent years , language models ( LMs ) trained on open-domain text corpora have come to play a central role in machine learning approaches to natural language processing tasks ( Devlin et al. , 2018 ) . This includes tasks that are not purely linguistic , and additionally require nontrivial planning and reasoning capabilities : examples include as vision-language navigation ( Majumdar et al. , 2020 ; Fried et al. , 2018 ; Suglia et al. , 2021 ) , instruction following ( Zhang & Chai , 2021 ; Hill et al. , 2020 ) , and visual question answering ( Tsimpoukelli et al. , 2021 ) . Indeed , some of these tasks are so remotely connected to language modeling that it is natural to ask whether the capabilities that result from LM pre-training might extend to tasks that involve no language at all—and if so , how these capabilities might be accessed in a model trained only to process and generate natural language strings . In this paper , we study these questions through the lens of embodied decision-making , investigating the effectiveness of LM pretraining as a scaffold for learning control policies for interactive tasks featuring partial observability , large action spaces , complex states , and complex dynamics . We describe a series of experiments in the VirtualHome environment ( Puig et al. , 2018 ; 2020 ) in which LMs are used to initialize policies , and show that LM pre-training substantially improves generalization across common-place tasks in household environments . In Experiment 1 ( Section 6 ) , we encode the inputs to a policy—including observations , goals , and action histories—as templated English phrases ( e.g . representing the goal on ( fork , table ) as There is a fork on the table . ) as shown in Figure 1 . A pretrained LM is then fined-tuned to produce representations of these phrases that can be used to predict subsequent actions . For i.i.d . training and evaluation tasks , we find that this approach completes tasks at a rate comparable to the same transformer-based policy trained from scratch . For generalization to out-of-distribution tasks , however , LM pretraining confers substantial benefits : it improves task completion rates by nearly 20 % for tasks involving novel initial environment states and goals ( Figure 1 “ Transformer from scratch ” and “ Pretrained transformer ( natural encoding ) ” ) . Next , we conduct two experiments aimed at clarifying the role of this string-based encoding . We design Experiment 2A that uses random strings instead of natural language inputs and Experiment 2B that uses non string-based encodings to study different ways of building interfaces between input encodings and LMs . In Experiment 2A ( Section 7 ) , we replace the “ natural ” string encodings of Experiment 1 with an arbitrary mapping between logical goals and tokens ( e.g . serializing on ( fork , table ) as brought wise character trees fine order yet ) . This random encoding substantially ( by roughly 12 % ) degrades performance on out-of-distribution tasks , indicating that LM encoders are sensitive to the form of string encodings even when fine-tuned ( Figure 1 “ Pretrained transformer ( natural encoding ) ” and “ Pretrained transformer ( random encoding ) ” ) . In Experiment 2B , we investigate whether string-based encodings are necessary at all . We replace the model ’ s word embedding layer with a randomly initialized embedding layer that maps from discretized environment observations , goal , and history actions to a sequence of LM input vectors , and fine-tune this embedding layer jointly with the LM itself . This learned encoder performs almost the same as the encoding of Experiment 1 , indicating that effective encodings for non-linguistic tasks can be learned from scratch ( Figure 1 “ Pretrained transformer ( natural encoding ) ” and “ Pretrained transformer ( learned encoding ) ” ) . These experiments offer two main conclusions . First , they show that language modeling improves generalization in policy learning : initializing a policy with a neural LM ( pre-trained on a nextword prediction task with a large text corpus ) substantially improves out-of-distribution performance on ( non-linguistic ) tasks in an interactive environment . Second , they show that language-based environment encodings are not needed to benefit from LM pretraining : it is instead possible to learn an interface between observations , actions , and model-internal representations derived from text corpora . These results point the possible effectiveness of language modeling as a generalpurpose pre-training scheme to promote structured generalization in broader machine learning applications . 2 RELATED WORK . In recent years , word and sentence representations from pre-trained LMs ( Peters et al. , 2018 ; Devlin et al. , 2018 ; Radford et al. , 2018 ) have become ubiquitious in natural language processing , playing a key role in state-of-the-art models for tasks ranging from machine translation ( Zhu et al. , 2020 ) to task-oriented dialog ( Platanios et al. , 2021 ) . Some of the most successful applications of pretraining lie at the boundary of natural language processing and other domains , as in instruction following ( Hill et al. , 2020 ) and language-guided image retrieval ( Lu et al. , 2019 ) . Building on this past work , our experiments in this paper aim to explain whether these successes result entirely from improved processing of text , or instead from domain-general representational abilities . Below , we briefly survey existing applications of pretraining that motivate the current study . Learning representations of language From nearly the earliest days of the field , natural language processing researchers have observed that representations of words derived from distributional statis- tics in large text corpora serve as useful features for downstream tasks ( Deerwester et al. , 1990 ; Dumais , 2004 ) . The earliest versions of these representation learning schemes focused on isolated word forms ( Mikolov et al. , 2013 ; Pennington et al. , 2014 ) . However , recent years have seen a number of techniques for training ( masked or autoregressive ) language models to produce contextualized word representations ( which incorporate information neighboring words in sentences and paragraphs ) via a variety of masked-word prediction objectives ( Devlin et al. , 2018 ; Yang et al. , 2019 ) . Applications In addition to producing useful representations , these language models can be finetuned to perform language processing tasks other than language modeling by casting those tasks as word-prediction problems . Successful uses of representations from pretrained models include syntactic parsing ( Kitaev et al. , 2018 ) and language-to-code translation ( Wang et al. , 2019 ) ; successful adaptations of LM prediction heads include machine translation ( Zhu et al. , 2020 ) , sentiment classification ( Brown et al. , 2020 ) and style transfer ( Keskar et al. , 2019 ) . Text-based games ( Yao et al. , 2021 ; Yuan et al. , 2018 ; Ammanabrolu & Riedl , 2018 ; Côté et al. , 2018 ) inherently involve text as both the input and the output . Recent works ( Yao et al. , 2020 ) in text-based games use GPT-2 to solve the text-based games and get significant performance improvements . However , it is hard to describe 3D information using text and most of their experiments are in 2D environments . Included in these successes are a number of tasks that integrate language and other modalities , including visual question answering and image captioning ( Yang et al. , 2020 ) . In models that condition on both text and image data , several previous approaches have found that image representations can be injected directly into language models ’ embedding layers ( Tsimpoukelli et al. , 2021 ) using a similar mechanism to the one we describe in Experiment 2B . One of our main contributions is to show that approach works even for tasks in which only non-linguistic information is relevant to model predictions . What do LMs encode ? The possibility that LMs might encode non-linguistic information useful for other downstream tasks is suggested by a number of recent “ probing ” studies aimed at understanding their predictions and the structure of their internal representations . Pre-trained LMs can answer a non-trivial fraction of queries about both factual and common-sense knowledge ( Roberts et al. , 2020 ) . Their representations encode information about perceptual relations among concepts , including visual similarity among object classes ( Ilharco et al. , 2020 ) and the structure of color spaces ( Abdou et al. , 2021 ) . Finally , they appear to be capable of basic simulation , modeling changes in entity states and relations described by text ( Li et al. , 2021 ) . LM pretraining beyond language Two recent papers consider questions closely related to the ones investigated here : ( Brown et al. , 2020 ) show that the GPT-3 model is capable of performing a limited set of arithmetic and string manipulation tasks ; ( Lu et al. , 2021 ) show that pretrained LMs require very little fine-tuning to match the performance of task-specific models on several image classification and numerical sequence processing tasks . In this paper , we focus on non-linguistic tasks where the inputs and outputs do not involve language . To the best of our knowledge , the current study is the first to demonstrate improved generalization in a non-linguistic problem over a standard neural-network baseline using a pre-trained language model . 3 LANGUAGE MODELING AND POLICY LEARNING . We begin with a brief review of the ingredients of language modeling and policy learning tasks used in our experiments . 3.1 LANGUAGE MODELING . Our experiments in this paper focus on autoregressive , transformer-based language models ( Vaswani et al. , 2017 ) . These models are trained to fit a distribution pθ ( y ) over a text sequence y by decomposing it into a sequence of tokens y = { y1 , y2 , . . . , yn } via the chain rule : log pθ ( y ) = n∑ i=1 log pθ ( yi | y1 , y2 , . . . , yi−1 ) . ( 1 ) Each conditional distribution pθ ( yi|y1 , y2 , . . . , yi−1 ) is parameterized by a transformer neural network fθ ( y1 , y2 , . . . , yi−1 ) . This network encodes each conditioned token yi into a continuous embedding ei = g ( yi ) which is then fed into the transformer architecture and encoded into a categorical distribution over token values of yi . Our experiments utilize a standard language model , GPT-2 , that is trained on Webtext dataset ( Radford et al. , 2018 ) using Huggingface library ( Wolf et al. , 2019 ) . 3.2 POMDPS AND POLICY LEARNING . Our experiments explore the application of LMs to general sequential decision-making tasks in partially observed environments . These tasks may be formalized as partially observable Markov decision processes ( POMDPs ) . A POMDP is defined by a set of states S , a set of observations O , a set of actions A , and a transition model T ( st+1|st , at ) that predicts the next state st+1 based on the current state st and an action at . Importantly , in a POMDP setting , the observation ot only captures a portion of the underlying state st , and an optimal decision-making strategy ( a policy ) must incorporate both the current observation and the previous history of observations and actions . For experiments in this paper , policies are parametric models πψ ( at|g , h , ot ) that select actions given the goals g , history information h , and partial observations ot of the current state st. All our experiments use imitation learning ( Santara et al. , 2017 ; Ng et al. , 2000 ; Peng et al. , 2018 ) , specifically behavior cloning ( Pomerleau , 1991 ; 1989 ; Torabi et al. , 2018 ) , to train πψ . We collect a dataset of N̂ expert training trajectories D = { d1 , · · · , dN̂ } , where each individual trajectory consists of a set of goal , observations , and actions , i.e . di = { o1 , a1 , · · · , aT , g } , where T is the length of an expert trajectory . We then train a policy πψ ( at|g , ht , ot ) which maximizes the likelihood pψ ( a ) of the expert actions a = { a1 , · · · , aT } taken in a trajectory using supervised learning , log pψ ( a ) = T∑ t=1 log pψ ( at | g , ht , ot ) , ( 2 ) where ht consists of all history in the environment up to timestep t .
This paper investigates the effectiveness of the language model for training the policy in embodied environments. The authors use a pre-trained GPT-2 to initialize the policy, then show the generalization effect in policy learning. In the experiments, the authors demonstrated the language model shows a better generalization effect with simple baseline and ablation studies.
SP:6982fbcb6e7f4e90d89cfdd2cb2e0b5d0bbd9f1d
Language Model Pre-training Improves Generalization in Policy Learning
1 INTRODUCTION . In recent years , language models ( LMs ) trained on open-domain text corpora have come to play a central role in machine learning approaches to natural language processing tasks ( Devlin et al. , 2018 ) . This includes tasks that are not purely linguistic , and additionally require nontrivial planning and reasoning capabilities : examples include as vision-language navigation ( Majumdar et al. , 2020 ; Fried et al. , 2018 ; Suglia et al. , 2021 ) , instruction following ( Zhang & Chai , 2021 ; Hill et al. , 2020 ) , and visual question answering ( Tsimpoukelli et al. , 2021 ) . Indeed , some of these tasks are so remotely connected to language modeling that it is natural to ask whether the capabilities that result from LM pre-training might extend to tasks that involve no language at all—and if so , how these capabilities might be accessed in a model trained only to process and generate natural language strings . In this paper , we study these questions through the lens of embodied decision-making , investigating the effectiveness of LM pretraining as a scaffold for learning control policies for interactive tasks featuring partial observability , large action spaces , complex states , and complex dynamics . We describe a series of experiments in the VirtualHome environment ( Puig et al. , 2018 ; 2020 ) in which LMs are used to initialize policies , and show that LM pre-training substantially improves generalization across common-place tasks in household environments . In Experiment 1 ( Section 6 ) , we encode the inputs to a policy—including observations , goals , and action histories—as templated English phrases ( e.g . representing the goal on ( fork , table ) as There is a fork on the table . ) as shown in Figure 1 . A pretrained LM is then fined-tuned to produce representations of these phrases that can be used to predict subsequent actions . For i.i.d . training and evaluation tasks , we find that this approach completes tasks at a rate comparable to the same transformer-based policy trained from scratch . For generalization to out-of-distribution tasks , however , LM pretraining confers substantial benefits : it improves task completion rates by nearly 20 % for tasks involving novel initial environment states and goals ( Figure 1 “ Transformer from scratch ” and “ Pretrained transformer ( natural encoding ) ” ) . Next , we conduct two experiments aimed at clarifying the role of this string-based encoding . We design Experiment 2A that uses random strings instead of natural language inputs and Experiment 2B that uses non string-based encodings to study different ways of building interfaces between input encodings and LMs . In Experiment 2A ( Section 7 ) , we replace the “ natural ” string encodings of Experiment 1 with an arbitrary mapping between logical goals and tokens ( e.g . serializing on ( fork , table ) as brought wise character trees fine order yet ) . This random encoding substantially ( by roughly 12 % ) degrades performance on out-of-distribution tasks , indicating that LM encoders are sensitive to the form of string encodings even when fine-tuned ( Figure 1 “ Pretrained transformer ( natural encoding ) ” and “ Pretrained transformer ( random encoding ) ” ) . In Experiment 2B , we investigate whether string-based encodings are necessary at all . We replace the model ’ s word embedding layer with a randomly initialized embedding layer that maps from discretized environment observations , goal , and history actions to a sequence of LM input vectors , and fine-tune this embedding layer jointly with the LM itself . This learned encoder performs almost the same as the encoding of Experiment 1 , indicating that effective encodings for non-linguistic tasks can be learned from scratch ( Figure 1 “ Pretrained transformer ( natural encoding ) ” and “ Pretrained transformer ( learned encoding ) ” ) . These experiments offer two main conclusions . First , they show that language modeling improves generalization in policy learning : initializing a policy with a neural LM ( pre-trained on a nextword prediction task with a large text corpus ) substantially improves out-of-distribution performance on ( non-linguistic ) tasks in an interactive environment . Second , they show that language-based environment encodings are not needed to benefit from LM pretraining : it is instead possible to learn an interface between observations , actions , and model-internal representations derived from text corpora . These results point the possible effectiveness of language modeling as a generalpurpose pre-training scheme to promote structured generalization in broader machine learning applications . 2 RELATED WORK . In recent years , word and sentence representations from pre-trained LMs ( Peters et al. , 2018 ; Devlin et al. , 2018 ; Radford et al. , 2018 ) have become ubiquitious in natural language processing , playing a key role in state-of-the-art models for tasks ranging from machine translation ( Zhu et al. , 2020 ) to task-oriented dialog ( Platanios et al. , 2021 ) . Some of the most successful applications of pretraining lie at the boundary of natural language processing and other domains , as in instruction following ( Hill et al. , 2020 ) and language-guided image retrieval ( Lu et al. , 2019 ) . Building on this past work , our experiments in this paper aim to explain whether these successes result entirely from improved processing of text , or instead from domain-general representational abilities . Below , we briefly survey existing applications of pretraining that motivate the current study . Learning representations of language From nearly the earliest days of the field , natural language processing researchers have observed that representations of words derived from distributional statis- tics in large text corpora serve as useful features for downstream tasks ( Deerwester et al. , 1990 ; Dumais , 2004 ) . The earliest versions of these representation learning schemes focused on isolated word forms ( Mikolov et al. , 2013 ; Pennington et al. , 2014 ) . However , recent years have seen a number of techniques for training ( masked or autoregressive ) language models to produce contextualized word representations ( which incorporate information neighboring words in sentences and paragraphs ) via a variety of masked-word prediction objectives ( Devlin et al. , 2018 ; Yang et al. , 2019 ) . Applications In addition to producing useful representations , these language models can be finetuned to perform language processing tasks other than language modeling by casting those tasks as word-prediction problems . Successful uses of representations from pretrained models include syntactic parsing ( Kitaev et al. , 2018 ) and language-to-code translation ( Wang et al. , 2019 ) ; successful adaptations of LM prediction heads include machine translation ( Zhu et al. , 2020 ) , sentiment classification ( Brown et al. , 2020 ) and style transfer ( Keskar et al. , 2019 ) . Text-based games ( Yao et al. , 2021 ; Yuan et al. , 2018 ; Ammanabrolu & Riedl , 2018 ; Côté et al. , 2018 ) inherently involve text as both the input and the output . Recent works ( Yao et al. , 2020 ) in text-based games use GPT-2 to solve the text-based games and get significant performance improvements . However , it is hard to describe 3D information using text and most of their experiments are in 2D environments . Included in these successes are a number of tasks that integrate language and other modalities , including visual question answering and image captioning ( Yang et al. , 2020 ) . In models that condition on both text and image data , several previous approaches have found that image representations can be injected directly into language models ’ embedding layers ( Tsimpoukelli et al. , 2021 ) using a similar mechanism to the one we describe in Experiment 2B . One of our main contributions is to show that approach works even for tasks in which only non-linguistic information is relevant to model predictions . What do LMs encode ? The possibility that LMs might encode non-linguistic information useful for other downstream tasks is suggested by a number of recent “ probing ” studies aimed at understanding their predictions and the structure of their internal representations . Pre-trained LMs can answer a non-trivial fraction of queries about both factual and common-sense knowledge ( Roberts et al. , 2020 ) . Their representations encode information about perceptual relations among concepts , including visual similarity among object classes ( Ilharco et al. , 2020 ) and the structure of color spaces ( Abdou et al. , 2021 ) . Finally , they appear to be capable of basic simulation , modeling changes in entity states and relations described by text ( Li et al. , 2021 ) . LM pretraining beyond language Two recent papers consider questions closely related to the ones investigated here : ( Brown et al. , 2020 ) show that the GPT-3 model is capable of performing a limited set of arithmetic and string manipulation tasks ; ( Lu et al. , 2021 ) show that pretrained LMs require very little fine-tuning to match the performance of task-specific models on several image classification and numerical sequence processing tasks . In this paper , we focus on non-linguistic tasks where the inputs and outputs do not involve language . To the best of our knowledge , the current study is the first to demonstrate improved generalization in a non-linguistic problem over a standard neural-network baseline using a pre-trained language model . 3 LANGUAGE MODELING AND POLICY LEARNING . We begin with a brief review of the ingredients of language modeling and policy learning tasks used in our experiments . 3.1 LANGUAGE MODELING . Our experiments in this paper focus on autoregressive , transformer-based language models ( Vaswani et al. , 2017 ) . These models are trained to fit a distribution pθ ( y ) over a text sequence y by decomposing it into a sequence of tokens y = { y1 , y2 , . . . , yn } via the chain rule : log pθ ( y ) = n∑ i=1 log pθ ( yi | y1 , y2 , . . . , yi−1 ) . ( 1 ) Each conditional distribution pθ ( yi|y1 , y2 , . . . , yi−1 ) is parameterized by a transformer neural network fθ ( y1 , y2 , . . . , yi−1 ) . This network encodes each conditioned token yi into a continuous embedding ei = g ( yi ) which is then fed into the transformer architecture and encoded into a categorical distribution over token values of yi . Our experiments utilize a standard language model , GPT-2 , that is trained on Webtext dataset ( Radford et al. , 2018 ) using Huggingface library ( Wolf et al. , 2019 ) . 3.2 POMDPS AND POLICY LEARNING . Our experiments explore the application of LMs to general sequential decision-making tasks in partially observed environments . These tasks may be formalized as partially observable Markov decision processes ( POMDPs ) . A POMDP is defined by a set of states S , a set of observations O , a set of actions A , and a transition model T ( st+1|st , at ) that predicts the next state st+1 based on the current state st and an action at . Importantly , in a POMDP setting , the observation ot only captures a portion of the underlying state st , and an optimal decision-making strategy ( a policy ) must incorporate both the current observation and the previous history of observations and actions . For experiments in this paper , policies are parametric models πψ ( at|g , h , ot ) that select actions given the goals g , history information h , and partial observations ot of the current state st. All our experiments use imitation learning ( Santara et al. , 2017 ; Ng et al. , 2000 ; Peng et al. , 2018 ) , specifically behavior cloning ( Pomerleau , 1991 ; 1989 ; Torabi et al. , 2018 ) , to train πψ . We collect a dataset of N̂ expert training trajectories D = { d1 , · · · , dN̂ } , where each individual trajectory consists of a set of goal , observations , and actions , i.e . di = { o1 , a1 , · · · , aT , g } , where T is the length of an expert trajectory . We then train a policy πψ ( at|g , ht , ot ) which maximizes the likelihood pψ ( a ) of the expert actions a = { a1 , · · · , aT } taken in a trajectory using supervised learning , log pψ ( a ) = T∑ t=1 log pψ ( at | g , ht , ot ) , ( 2 ) where ht consists of all history in the environment up to timestep t .
This paper takes a transformer-based language model, pre-trained on a large text corpus (In this case GPT-2) and uses it for the symbolic version of the VirtualHome environment. The observation, goals and action history of the agent are encoded as text strings in a few various ways and fed as input to the transformer and the output of the model is pooled to predict the agent action. The paper demonstrates that in cases where the test distribution differs in some way from the training distribution, that using pre-trained transformers greatly improves performance on the task
SP:6982fbcb6e7f4e90d89cfdd2cb2e0b5d0bbd9f1d
Polyphonic Music Composition: An Adversarial Inverse Reinforcement Learning Approach
1 INTRODUCTION . Automatic music composition usages can vary from continuous generation of copyright free music for use in media to inspiration tools for musicians . With recent advances of neural networks and with the availability of large set of big data on digitized music scores composed by humans , the trend of automatic music composition has shifted to learning an embedded model from big data and then generating new music based on the learned model . Computation models used to generate music need to be able to find a balance between adhering to music theory rules and exploring new chord progressions in order to generate interesting and pleasing music harmonies . If the model sticks too much to music theory rules , the composed music can be harmonious but may also turn out to be dull and uninteresting . On the other hand , if the model only explores new chord progressions while ignoring music theory rules , the composed music may include inharmonious chord progressions . If we look at music composition problem from the symbolic level , it can be viewed as generating a sequence of music chords , in which selecting each chord ’ s vector representation is equivalent to an action . A chord in the composition is a set of notes played at the same time , with each note being represented by a pitch value . Reinforcement Learning ( RL ) can be used to formulate the creative problem of music composition by viewing it as a sequence of chord-selecting actions . The idea for music generation based on RL can be viewed as assigning a reward on the selected notes/chords while the music composition agent is deemed to maximize the accumulated reward by selecting a sequence of most appropriate chords to generate the piece of music . However , in this formulation designing a good reward signal can be a critical and challenging task . In order to overcome this limitation , instead of only manually and subjectively assigning the reward for each chord selection action , we propose using Inverse Reinforcement Learning ( IRL ) to learn a reward function based on the optimal actions taken from the composed master pieces of human expert musicians . Therefore , in this paper , we design a novel model that is able to learn a reward function from human composed songs and then use that reward function in a RL model that tunes a pre-trained model to improve the generation of piano harmonies . The model has three main training phases and uses the human composed songs as training data . First , we use deep supervised learning to pre-train a model to learn from the training human composed music data , then we learn a reward function from the same training data using IRL and finally we tune the pre-trained model with RL using the combination of learned reward function from IRL and a supporting music theory reward . 2 RELATED WORKS . Music Generation with deep learning models has been explored extensively from various perspectives . Music generation can be tackled from the audio signal waveform approach ( van den Oord et al. , 2016 ) or from the symbolic representation of music score that can be later transformed to the audio file . The latter approach has proven to be faster for generation purposes compared to generating the audio waveform directly , albeit with a trade-off in the range of sounds that are possible to generate . Recurrent Neural Networks ( RNN ) ( Sturm et al. , 2016 ) , Convolutional Neural Networks ( CNN ) ( Yang et al. , 2017 ) and Transformers ( Huang et al. , 2018 ) are the most common architectures used for music generation . Generative Adversarial Networks ( GAN ) ( Goodfellow et al. , 2014 ) based approaches have gained popularity recently due to their success in the image generation and natural language Q/A fields , with some authors also finding success in modeling sequence generation of music ( Guimaraes et al. , 2017 ) . GANs are famous for being able to generate pieces of music similar to given illustrative examples using a generator to compose music tracks and a discriminator to distinguish between the real compositions ( the given illustrative examples ) and the fake ones ( the tracks composed by the generator ) . However , when using GANs to generate music compositions directly , it tends to generate pieces of music too similar to the given illustrated examples that lack novelty and creativity . As RL is commonly used to learn a policy function that can maximize the accumulated reward based on actions carried out under a policy , it can be used in many different applications such as robot action sequences learning along with many others . Applying RL for music generation is a relatively new idea . The RL Tuner architecture proposed by the Google Magenta Team ( Jaques et al. , 2017 ) is one of the earliest works that combines a deep supervised learning model with deep RL for additional tuning . This model could only generate monophonic melody , but it was later expanded upon by Kotecha ( Kotecha , 2018a ) on his Bach2Bach model that could generate polyphonic harmonies using the same ideas from the RL Tuner architecture . Bach2Bach ’ s tuning is only done with monophonic notes though , so even if the original model is capable of modeling polyphonic chords , the action space used for RL tuning is limited to only monophonic notes . Our model goes a step further by using polyphonic chords as the actions when tuning the reward . Another of Bach2Bach model ’ s limitations is the difficulty of manually designing a reward signal . This is an important limitation because the tuning is highly dependent on the reward signal . IRL can be used to solve this , as it can help to learn a reward function from a set of expert demonstrations . One previous paper explored the use of IRL in the music domain ( Messer & Ranchod , 2014 ) . This paper used a small dataset with non-scalable RL and IRL algorithms . Furthermore , their approach only generated monophonic melodies . To our knowledge our approach is the first deep learning model based on IRL and adversarial learning that is able to generate polyphonic harmonies . 3 BACKGROUND . 3.1 BI-AXIAL LSTM . Daniel Johnson ( Johnson , 2017 ) introduced a new architecture called Bi-axial LSTM based on LSTM cells purposely built for music composition . This architecture takes inspiration from CNNs and is composed of 4 layers of LSTM cells with 2 layers having recurrent connections on a time axis and 2 layers having recurrent connections on a note axis . The input of the Bi-axial model represents both the polyphonic music nature as well as the difference in the articulation of a note . 3.2 DEEP Q-LEARNING . One of the most recent breakthroughs in RL came with the successful implementation of a deep learning model to learn a policy from a high-dimensional input by the Deep Mind team ( Mnih et al. , 2013 ) . Their approach , known as Deep Q-learning , uses a CNN trained with a variant of Q-learning that outputs the state-action value function . The main idea of this approach is to use a neural network to approximate the state-action value function normally represented in a tabular way in normal Qlearning . The state-action value function is now represented as a function of the state s , action a , and weights θ : Q ( s , a ; θ ) . In order to stabilize and improve learning some additional techniques like experience replay ( Lin , 1993 ) and using an additional Target Q-Network for estimating the target Q-value are used . 3.3 ADVERSARIAL INVERSE REINFORCEMENT LEARNING . IRL ’ s goal is to learn a reward function that can best explain observed expert behaviors . IRL ( followed by an RL algorithm to learn a policy ) can sometimes be more effective at learning from expert behaviors than supervised learning , as argued by Abbeel and Ng ( Abbeel & Ng , 2004 ) . The reward function learned by IRL algorithms is commonly represented as rθ ( s ) = θT · φ ( s ) , where θ is the learned weights and φ is a vector of features used to represent the state s. Fu proposed a new model-free scalable IRL algorithm based on an adversarial reward learning formulation called Adversarial Inverse Reinforcement Learning ( AIRL ) ( Fu et al. , 2017 ) . Fu uses concepts from Maximum Entropy IRL ( Ziebart et al. , 2008 ) and Generative Adversarial Network Guided Cost Learning ( GAN-GCL ) ( Finn et al. , 2016 ) to solve the IRl problem . In the AIRL algorithm the policy π works as the Generator and is trained to fool a discriminator by generating trajectories that eventually become similar to the expert trajectories . A special structure enforced in the discriminator allows the reward function rθ to be recovered from the discriminator . The AIRL algorithm alternates between training a discriminator to classify between expert trajectories and learner policy samples , and updating the policy to try to confuse the discriminator . 4 APPROACH . Our approach is to tune a pre-trained polyphonic generation model , in this case a Bi-axial LSTM , using Deep Q-Learning with the reward function obtained from the AIRL algorithm combined with a supporting music theory reward to generate harmonies that maximize the total reward . To accomplish this task , we proposed a design based on the RL Tuner ( Jaques et al. , 2017 ) introduced by the Google Magenta Team and later expanded upon by Kotecha ’ s Bach2Bach approach ( Kotecha , 2018a ) . Just like Bach2Bach , our approach trains a polyphonic harmony model and later tunes it using RL . The novelty of our approach is the use of an AIRL learned reward during the tuning process and the use of polyphonic chords as actions when training with RL . Our design is based on 3 main training phases : 1 . A Bi-axial LSTM model is trained on large data samples . This model will be referred as the pre-trained model . 2 . A state-action reward function is learned using AIRL from the same data set used to train the Bi-axial model . 3 . A Deep-Q Network is used for tuning the pre-trained Bi-axial model using a combination of the learned reward function from training phase 2 and a supporting music theory reward . In order to incorporate some music theory rules and penalize unwanted behavior we also incorporated some music theory rewards into the final reward function . Figure 1 shows all of the three training phases and the relations between them : 4.1 REWARD FUNCTION EXTRACTION USING AIRL . We use the AIRL algorithm from Fu ( Fu et al. , 2017 ) to learn a reward function from our training data . In order to apply the AIRL algorithm we need to model music generation as a RL problem . We define an action as a new chord being played , and the state is represented by the previous chord . The midi fragments can be transformed into pianorolls , with each pianoroll representing one trajectory . Our implementation uses the state-action variation of the discriminator proposed by Fu ( Fu et al. , 2017 ) . Having a total of 44 possible notes that can be played at the same time and with our model being polyphonic it is clear that both the state space and action space are too big to model with discrete values ( the total number of possible actions and states is 248 each ) . Policy gradient methods offer a way to deal with both continuous spaces and continuous actions and are needed to model polyphonic harmony generation as a RL problem . These methods learn the statistics of a probability distribution from which the action is then sampled instead of computing the probabilities for each of the possible actions . Following the AIRL algorithm , we need a stochastic parameterized policy that acts as a generator and a parameterized reward function that is part of the discriminator . The policy can be implemented using a Gaussian Policy , where the mean and standard deviation are the learnable parameters and are approximated with a basic Multilayer Perceptron ( MLP ) network . The reward function inside the discriminator is also approximated with a MLP network . During each training iteration the policy generates multiple trajectories of chords . A set of stateaction pairs is then sampled from the generated trajectories and combined with a set of state-action pairs sampled from the actual song fragments , which are considered the expert trajectories . This set containing half state-action pairs from the generated trajectories and half state-action pairs from the expert trajectories is used to train the discriminator to classify between the expert and generated trajectories . The reward function can be obtained thanks to the special structure imposed on the discriminator and updating the discriminator can be seen as updating the reward function . With this updated reward function , we can proceed to train the policy π using a policy gradient method .
This paper presents a method for polyphonic piano-based symbolic music generation based on previous work on RL-tuned recurrent networks. This paper adds an adversarial inverse reinforcement learning (AIRL) step to estimate a reward function which is used in tandem to music theoretic rewards during the Q-network tuning. The proposed model performs better than the untuned LSTM-based model on both subjective and objective metrics.
SP:d27bf1100a4d0adfedcf4291827f2b94c25db69a
Polyphonic Music Composition: An Adversarial Inverse Reinforcement Learning Approach
1 INTRODUCTION . Automatic music composition usages can vary from continuous generation of copyright free music for use in media to inspiration tools for musicians . With recent advances of neural networks and with the availability of large set of big data on digitized music scores composed by humans , the trend of automatic music composition has shifted to learning an embedded model from big data and then generating new music based on the learned model . Computation models used to generate music need to be able to find a balance between adhering to music theory rules and exploring new chord progressions in order to generate interesting and pleasing music harmonies . If the model sticks too much to music theory rules , the composed music can be harmonious but may also turn out to be dull and uninteresting . On the other hand , if the model only explores new chord progressions while ignoring music theory rules , the composed music may include inharmonious chord progressions . If we look at music composition problem from the symbolic level , it can be viewed as generating a sequence of music chords , in which selecting each chord ’ s vector representation is equivalent to an action . A chord in the composition is a set of notes played at the same time , with each note being represented by a pitch value . Reinforcement Learning ( RL ) can be used to formulate the creative problem of music composition by viewing it as a sequence of chord-selecting actions . The idea for music generation based on RL can be viewed as assigning a reward on the selected notes/chords while the music composition agent is deemed to maximize the accumulated reward by selecting a sequence of most appropriate chords to generate the piece of music . However , in this formulation designing a good reward signal can be a critical and challenging task . In order to overcome this limitation , instead of only manually and subjectively assigning the reward for each chord selection action , we propose using Inverse Reinforcement Learning ( IRL ) to learn a reward function based on the optimal actions taken from the composed master pieces of human expert musicians . Therefore , in this paper , we design a novel model that is able to learn a reward function from human composed songs and then use that reward function in a RL model that tunes a pre-trained model to improve the generation of piano harmonies . The model has three main training phases and uses the human composed songs as training data . First , we use deep supervised learning to pre-train a model to learn from the training human composed music data , then we learn a reward function from the same training data using IRL and finally we tune the pre-trained model with RL using the combination of learned reward function from IRL and a supporting music theory reward . 2 RELATED WORKS . Music Generation with deep learning models has been explored extensively from various perspectives . Music generation can be tackled from the audio signal waveform approach ( van den Oord et al. , 2016 ) or from the symbolic representation of music score that can be later transformed to the audio file . The latter approach has proven to be faster for generation purposes compared to generating the audio waveform directly , albeit with a trade-off in the range of sounds that are possible to generate . Recurrent Neural Networks ( RNN ) ( Sturm et al. , 2016 ) , Convolutional Neural Networks ( CNN ) ( Yang et al. , 2017 ) and Transformers ( Huang et al. , 2018 ) are the most common architectures used for music generation . Generative Adversarial Networks ( GAN ) ( Goodfellow et al. , 2014 ) based approaches have gained popularity recently due to their success in the image generation and natural language Q/A fields , with some authors also finding success in modeling sequence generation of music ( Guimaraes et al. , 2017 ) . GANs are famous for being able to generate pieces of music similar to given illustrative examples using a generator to compose music tracks and a discriminator to distinguish between the real compositions ( the given illustrative examples ) and the fake ones ( the tracks composed by the generator ) . However , when using GANs to generate music compositions directly , it tends to generate pieces of music too similar to the given illustrated examples that lack novelty and creativity . As RL is commonly used to learn a policy function that can maximize the accumulated reward based on actions carried out under a policy , it can be used in many different applications such as robot action sequences learning along with many others . Applying RL for music generation is a relatively new idea . The RL Tuner architecture proposed by the Google Magenta Team ( Jaques et al. , 2017 ) is one of the earliest works that combines a deep supervised learning model with deep RL for additional tuning . This model could only generate monophonic melody , but it was later expanded upon by Kotecha ( Kotecha , 2018a ) on his Bach2Bach model that could generate polyphonic harmonies using the same ideas from the RL Tuner architecture . Bach2Bach ’ s tuning is only done with monophonic notes though , so even if the original model is capable of modeling polyphonic chords , the action space used for RL tuning is limited to only monophonic notes . Our model goes a step further by using polyphonic chords as the actions when tuning the reward . Another of Bach2Bach model ’ s limitations is the difficulty of manually designing a reward signal . This is an important limitation because the tuning is highly dependent on the reward signal . IRL can be used to solve this , as it can help to learn a reward function from a set of expert demonstrations . One previous paper explored the use of IRL in the music domain ( Messer & Ranchod , 2014 ) . This paper used a small dataset with non-scalable RL and IRL algorithms . Furthermore , their approach only generated monophonic melodies . To our knowledge our approach is the first deep learning model based on IRL and adversarial learning that is able to generate polyphonic harmonies . 3 BACKGROUND . 3.1 BI-AXIAL LSTM . Daniel Johnson ( Johnson , 2017 ) introduced a new architecture called Bi-axial LSTM based on LSTM cells purposely built for music composition . This architecture takes inspiration from CNNs and is composed of 4 layers of LSTM cells with 2 layers having recurrent connections on a time axis and 2 layers having recurrent connections on a note axis . The input of the Bi-axial model represents both the polyphonic music nature as well as the difference in the articulation of a note . 3.2 DEEP Q-LEARNING . One of the most recent breakthroughs in RL came with the successful implementation of a deep learning model to learn a policy from a high-dimensional input by the Deep Mind team ( Mnih et al. , 2013 ) . Their approach , known as Deep Q-learning , uses a CNN trained with a variant of Q-learning that outputs the state-action value function . The main idea of this approach is to use a neural network to approximate the state-action value function normally represented in a tabular way in normal Qlearning . The state-action value function is now represented as a function of the state s , action a , and weights θ : Q ( s , a ; θ ) . In order to stabilize and improve learning some additional techniques like experience replay ( Lin , 1993 ) and using an additional Target Q-Network for estimating the target Q-value are used . 3.3 ADVERSARIAL INVERSE REINFORCEMENT LEARNING . IRL ’ s goal is to learn a reward function that can best explain observed expert behaviors . IRL ( followed by an RL algorithm to learn a policy ) can sometimes be more effective at learning from expert behaviors than supervised learning , as argued by Abbeel and Ng ( Abbeel & Ng , 2004 ) . The reward function learned by IRL algorithms is commonly represented as rθ ( s ) = θT · φ ( s ) , where θ is the learned weights and φ is a vector of features used to represent the state s. Fu proposed a new model-free scalable IRL algorithm based on an adversarial reward learning formulation called Adversarial Inverse Reinforcement Learning ( AIRL ) ( Fu et al. , 2017 ) . Fu uses concepts from Maximum Entropy IRL ( Ziebart et al. , 2008 ) and Generative Adversarial Network Guided Cost Learning ( GAN-GCL ) ( Finn et al. , 2016 ) to solve the IRl problem . In the AIRL algorithm the policy π works as the Generator and is trained to fool a discriminator by generating trajectories that eventually become similar to the expert trajectories . A special structure enforced in the discriminator allows the reward function rθ to be recovered from the discriminator . The AIRL algorithm alternates between training a discriminator to classify between expert trajectories and learner policy samples , and updating the policy to try to confuse the discriminator . 4 APPROACH . Our approach is to tune a pre-trained polyphonic generation model , in this case a Bi-axial LSTM , using Deep Q-Learning with the reward function obtained from the AIRL algorithm combined with a supporting music theory reward to generate harmonies that maximize the total reward . To accomplish this task , we proposed a design based on the RL Tuner ( Jaques et al. , 2017 ) introduced by the Google Magenta Team and later expanded upon by Kotecha ’ s Bach2Bach approach ( Kotecha , 2018a ) . Just like Bach2Bach , our approach trains a polyphonic harmony model and later tunes it using RL . The novelty of our approach is the use of an AIRL learned reward during the tuning process and the use of polyphonic chords as actions when training with RL . Our design is based on 3 main training phases : 1 . A Bi-axial LSTM model is trained on large data samples . This model will be referred as the pre-trained model . 2 . A state-action reward function is learned using AIRL from the same data set used to train the Bi-axial model . 3 . A Deep-Q Network is used for tuning the pre-trained Bi-axial model using a combination of the learned reward function from training phase 2 and a supporting music theory reward . In order to incorporate some music theory rules and penalize unwanted behavior we also incorporated some music theory rewards into the final reward function . Figure 1 shows all of the three training phases and the relations between them : 4.1 REWARD FUNCTION EXTRACTION USING AIRL . We use the AIRL algorithm from Fu ( Fu et al. , 2017 ) to learn a reward function from our training data . In order to apply the AIRL algorithm we need to model music generation as a RL problem . We define an action as a new chord being played , and the state is represented by the previous chord . The midi fragments can be transformed into pianorolls , with each pianoroll representing one trajectory . Our implementation uses the state-action variation of the discriminator proposed by Fu ( Fu et al. , 2017 ) . Having a total of 44 possible notes that can be played at the same time and with our model being polyphonic it is clear that both the state space and action space are too big to model with discrete values ( the total number of possible actions and states is 248 each ) . Policy gradient methods offer a way to deal with both continuous spaces and continuous actions and are needed to model polyphonic harmony generation as a RL problem . These methods learn the statistics of a probability distribution from which the action is then sampled instead of computing the probabilities for each of the possible actions . Following the AIRL algorithm , we need a stochastic parameterized policy that acts as a generator and a parameterized reward function that is part of the discriminator . The policy can be implemented using a Gaussian Policy , where the mean and standard deviation are the learnable parameters and are approximated with a basic Multilayer Perceptron ( MLP ) network . The reward function inside the discriminator is also approximated with a MLP network . During each training iteration the policy generates multiple trajectories of chords . A set of stateaction pairs is then sampled from the generated trajectories and combined with a set of state-action pairs sampled from the actual song fragments , which are considered the expert trajectories . This set containing half state-action pairs from the generated trajectories and half state-action pairs from the expert trajectories is used to train the discriminator to classify between the expert and generated trajectories . The reward function can be obtained thanks to the special structure imposed on the discriminator and updating the discriminator can be seen as updating the reward function . With this updated reward function , we can proceed to train the policy π using a policy gradient method .
This work proposes an approach to polyphonic music composition based on reinforcement learning. The approach constructs a reward function based on inverse reinforcement learning (IRL) using human demonstrations, in conjunction with a hand-crafted, music-theoretic reward. Empirical evaluation compares the approach based in IRL to a baseline LSTM density estimator.
SP:d27bf1100a4d0adfedcf4291827f2b94c25db69a
Polyphonic Music Composition: An Adversarial Inverse Reinforcement Learning Approach
1 INTRODUCTION . Automatic music composition usages can vary from continuous generation of copyright free music for use in media to inspiration tools for musicians . With recent advances of neural networks and with the availability of large set of big data on digitized music scores composed by humans , the trend of automatic music composition has shifted to learning an embedded model from big data and then generating new music based on the learned model . Computation models used to generate music need to be able to find a balance between adhering to music theory rules and exploring new chord progressions in order to generate interesting and pleasing music harmonies . If the model sticks too much to music theory rules , the composed music can be harmonious but may also turn out to be dull and uninteresting . On the other hand , if the model only explores new chord progressions while ignoring music theory rules , the composed music may include inharmonious chord progressions . If we look at music composition problem from the symbolic level , it can be viewed as generating a sequence of music chords , in which selecting each chord ’ s vector representation is equivalent to an action . A chord in the composition is a set of notes played at the same time , with each note being represented by a pitch value . Reinforcement Learning ( RL ) can be used to formulate the creative problem of music composition by viewing it as a sequence of chord-selecting actions . The idea for music generation based on RL can be viewed as assigning a reward on the selected notes/chords while the music composition agent is deemed to maximize the accumulated reward by selecting a sequence of most appropriate chords to generate the piece of music . However , in this formulation designing a good reward signal can be a critical and challenging task . In order to overcome this limitation , instead of only manually and subjectively assigning the reward for each chord selection action , we propose using Inverse Reinforcement Learning ( IRL ) to learn a reward function based on the optimal actions taken from the composed master pieces of human expert musicians . Therefore , in this paper , we design a novel model that is able to learn a reward function from human composed songs and then use that reward function in a RL model that tunes a pre-trained model to improve the generation of piano harmonies . The model has three main training phases and uses the human composed songs as training data . First , we use deep supervised learning to pre-train a model to learn from the training human composed music data , then we learn a reward function from the same training data using IRL and finally we tune the pre-trained model with RL using the combination of learned reward function from IRL and a supporting music theory reward . 2 RELATED WORKS . Music Generation with deep learning models has been explored extensively from various perspectives . Music generation can be tackled from the audio signal waveform approach ( van den Oord et al. , 2016 ) or from the symbolic representation of music score that can be later transformed to the audio file . The latter approach has proven to be faster for generation purposes compared to generating the audio waveform directly , albeit with a trade-off in the range of sounds that are possible to generate . Recurrent Neural Networks ( RNN ) ( Sturm et al. , 2016 ) , Convolutional Neural Networks ( CNN ) ( Yang et al. , 2017 ) and Transformers ( Huang et al. , 2018 ) are the most common architectures used for music generation . Generative Adversarial Networks ( GAN ) ( Goodfellow et al. , 2014 ) based approaches have gained popularity recently due to their success in the image generation and natural language Q/A fields , with some authors also finding success in modeling sequence generation of music ( Guimaraes et al. , 2017 ) . GANs are famous for being able to generate pieces of music similar to given illustrative examples using a generator to compose music tracks and a discriminator to distinguish between the real compositions ( the given illustrative examples ) and the fake ones ( the tracks composed by the generator ) . However , when using GANs to generate music compositions directly , it tends to generate pieces of music too similar to the given illustrated examples that lack novelty and creativity . As RL is commonly used to learn a policy function that can maximize the accumulated reward based on actions carried out under a policy , it can be used in many different applications such as robot action sequences learning along with many others . Applying RL for music generation is a relatively new idea . The RL Tuner architecture proposed by the Google Magenta Team ( Jaques et al. , 2017 ) is one of the earliest works that combines a deep supervised learning model with deep RL for additional tuning . This model could only generate monophonic melody , but it was later expanded upon by Kotecha ( Kotecha , 2018a ) on his Bach2Bach model that could generate polyphonic harmonies using the same ideas from the RL Tuner architecture . Bach2Bach ’ s tuning is only done with monophonic notes though , so even if the original model is capable of modeling polyphonic chords , the action space used for RL tuning is limited to only monophonic notes . Our model goes a step further by using polyphonic chords as the actions when tuning the reward . Another of Bach2Bach model ’ s limitations is the difficulty of manually designing a reward signal . This is an important limitation because the tuning is highly dependent on the reward signal . IRL can be used to solve this , as it can help to learn a reward function from a set of expert demonstrations . One previous paper explored the use of IRL in the music domain ( Messer & Ranchod , 2014 ) . This paper used a small dataset with non-scalable RL and IRL algorithms . Furthermore , their approach only generated monophonic melodies . To our knowledge our approach is the first deep learning model based on IRL and adversarial learning that is able to generate polyphonic harmonies . 3 BACKGROUND . 3.1 BI-AXIAL LSTM . Daniel Johnson ( Johnson , 2017 ) introduced a new architecture called Bi-axial LSTM based on LSTM cells purposely built for music composition . This architecture takes inspiration from CNNs and is composed of 4 layers of LSTM cells with 2 layers having recurrent connections on a time axis and 2 layers having recurrent connections on a note axis . The input of the Bi-axial model represents both the polyphonic music nature as well as the difference in the articulation of a note . 3.2 DEEP Q-LEARNING . One of the most recent breakthroughs in RL came with the successful implementation of a deep learning model to learn a policy from a high-dimensional input by the Deep Mind team ( Mnih et al. , 2013 ) . Their approach , known as Deep Q-learning , uses a CNN trained with a variant of Q-learning that outputs the state-action value function . The main idea of this approach is to use a neural network to approximate the state-action value function normally represented in a tabular way in normal Qlearning . The state-action value function is now represented as a function of the state s , action a , and weights θ : Q ( s , a ; θ ) . In order to stabilize and improve learning some additional techniques like experience replay ( Lin , 1993 ) and using an additional Target Q-Network for estimating the target Q-value are used . 3.3 ADVERSARIAL INVERSE REINFORCEMENT LEARNING . IRL ’ s goal is to learn a reward function that can best explain observed expert behaviors . IRL ( followed by an RL algorithm to learn a policy ) can sometimes be more effective at learning from expert behaviors than supervised learning , as argued by Abbeel and Ng ( Abbeel & Ng , 2004 ) . The reward function learned by IRL algorithms is commonly represented as rθ ( s ) = θT · φ ( s ) , where θ is the learned weights and φ is a vector of features used to represent the state s. Fu proposed a new model-free scalable IRL algorithm based on an adversarial reward learning formulation called Adversarial Inverse Reinforcement Learning ( AIRL ) ( Fu et al. , 2017 ) . Fu uses concepts from Maximum Entropy IRL ( Ziebart et al. , 2008 ) and Generative Adversarial Network Guided Cost Learning ( GAN-GCL ) ( Finn et al. , 2016 ) to solve the IRl problem . In the AIRL algorithm the policy π works as the Generator and is trained to fool a discriminator by generating trajectories that eventually become similar to the expert trajectories . A special structure enforced in the discriminator allows the reward function rθ to be recovered from the discriminator . The AIRL algorithm alternates between training a discriminator to classify between expert trajectories and learner policy samples , and updating the policy to try to confuse the discriminator . 4 APPROACH . Our approach is to tune a pre-trained polyphonic generation model , in this case a Bi-axial LSTM , using Deep Q-Learning with the reward function obtained from the AIRL algorithm combined with a supporting music theory reward to generate harmonies that maximize the total reward . To accomplish this task , we proposed a design based on the RL Tuner ( Jaques et al. , 2017 ) introduced by the Google Magenta Team and later expanded upon by Kotecha ’ s Bach2Bach approach ( Kotecha , 2018a ) . Just like Bach2Bach , our approach trains a polyphonic harmony model and later tunes it using RL . The novelty of our approach is the use of an AIRL learned reward during the tuning process and the use of polyphonic chords as actions when training with RL . Our design is based on 3 main training phases : 1 . A Bi-axial LSTM model is trained on large data samples . This model will be referred as the pre-trained model . 2 . A state-action reward function is learned using AIRL from the same data set used to train the Bi-axial model . 3 . A Deep-Q Network is used for tuning the pre-trained Bi-axial model using a combination of the learned reward function from training phase 2 and a supporting music theory reward . In order to incorporate some music theory rules and penalize unwanted behavior we also incorporated some music theory rewards into the final reward function . Figure 1 shows all of the three training phases and the relations between them : 4.1 REWARD FUNCTION EXTRACTION USING AIRL . We use the AIRL algorithm from Fu ( Fu et al. , 2017 ) to learn a reward function from our training data . In order to apply the AIRL algorithm we need to model music generation as a RL problem . We define an action as a new chord being played , and the state is represented by the previous chord . The midi fragments can be transformed into pianorolls , with each pianoroll representing one trajectory . Our implementation uses the state-action variation of the discriminator proposed by Fu ( Fu et al. , 2017 ) . Having a total of 44 possible notes that can be played at the same time and with our model being polyphonic it is clear that both the state space and action space are too big to model with discrete values ( the total number of possible actions and states is 248 each ) . Policy gradient methods offer a way to deal with both continuous spaces and continuous actions and are needed to model polyphonic harmony generation as a RL problem . These methods learn the statistics of a probability distribution from which the action is then sampled instead of computing the probabilities for each of the possible actions . Following the AIRL algorithm , we need a stochastic parameterized policy that acts as a generator and a parameterized reward function that is part of the discriminator . The policy can be implemented using a Gaussian Policy , where the mean and standard deviation are the learnable parameters and are approximated with a basic Multilayer Perceptron ( MLP ) network . The reward function inside the discriminator is also approximated with a MLP network . During each training iteration the policy generates multiple trajectories of chords . A set of stateaction pairs is then sampled from the generated trajectories and combined with a set of state-action pairs sampled from the actual song fragments , which are considered the expert trajectories . This set containing half state-action pairs from the generated trajectories and half state-action pairs from the expert trajectories is used to train the discriminator to classify between the expert and generated trajectories . The reward function can be obtained thanks to the special structure imposed on the discriminator and updating the discriminator can be seen as updating the reward function . With this updated reward function , we can proceed to train the policy π using a policy gradient method .
This paper introduces a novel pipeline for generating polyphonic music. To generate music, the authors first pretrained a bi-axial LSTM (in time and pitch dimensions) on a corpus of piano rolls. To finetune the model’s performance, the authors then viewed music generation as an RL task and further trained their LSTM-based model to compute the values (Q-functions) of adding particular notes to the next chord. To specify a reward function for their RL approach, the authors used adversarial inverse RL (AIRL), where the reward function was approximated by the discriminator network. The blind evaluation of generated music by volunteers has indicated the volunteers’ preference towards human-generated and the proposed-model-generated music, but not to the music generated by its constituent baseline approaches.
SP:d27bf1100a4d0adfedcf4291827f2b94c25db69a
Variational Component Decoder for Source Extraction from Nonlinear Mixture
1 INTRODUCTION . Signal extraction from nonlinear mixture is a recurring yet hard research problem in signal processing and representation learning . To tackle this problem , conventional methods can be divided into two categories . One is Blind Source Separation ( BSS ) that recovers all sources in the mixture ( Comon & Jutten , 2010 ) , the other is to leverage available prior knowledge to extract only the desired components from the mixture ( Leong et al. , 2008 ) . Following the hardness results of nonlinear BSS based on nonlinear Independent Component Analysis ( ICA ) ( Hyvärinen & Pajunen , 1999 ) , many attempts have been made to realize nonlinear ICA and to further connect it with representation learning ( Hyvärinen & Morioka , 2016 ; 2017 ; Khemakhem et al. , 2020 ) . However , in many practical scenarios , only one or few sources are supposed to be retrieved for the concerned application ; for example , heartbeat monitoring , especially that achieved by contact-free approaches ( Ha et al. , 2020 ) , demands the heartbeat signal ( waveform ) to be extracted out of the nonlinear mixture with other signals such as body movements and respiration . Compared with nonlinear BSS , nonlinear source extraction can be far more efficient and effective under these scenarios : on one hand , extracting only the source of interest could significantly reduce the computation cost for the same category of algorithms ( e.g. , deep-learning based signal extraction would be computationally cheaper than deep-learning based signal separation ) . On the other hand , if prior knowledge of the source is available , the training may substantially leverage such knowledge so as to sufficiently improve the ( later ) inference accuracy . Recently , there is a rising interest in investigating disentangled representation learning exploiting deep learning techniques . Different from conventional source separation methods that demand hardcoded rules , a deep learning model aims to learn the underlying generating factors automatically and adaptively . To this end , the frameworks of variational auto-encoder ( VAE ) ( Kingma & Welling , 2013 ) and generative adversarial network ( GAN ) ( Goodfellow et al. , 2014 ) are widely used , and variants modifying designs and training techniques to enhance disentanglement have also been proposed , such as β-VAE ( Higgins et al. , 2016 ) . However , as the existing proposals mostly focus on disentangling on the representation in image or video data ( Kingma & Welling , 2013 ; Higgins et al. , 2016 ; Fabius & Van Amersfoort , 2014 ; Yingzhen & Mandt , 2018 ) where signal mixture never take place , we can not directly apply the idea of disentangled representation learning to our problem of source extraction ( a special form of disentanglement ) from nonlinear time-series mixture . Though a few results have been obtained for disentangling the sources in nonlinear mixing using deep learning , they fall into the category of BSS ( Hyvärinen & Morioka , 2016 ; Khemakhem et al. , 2020 ) . In this paper , we propose supervised Variational Component Decoder ( sVCD ) as a robust deeplearning framework for source extraction from nonlinear mixture . As illustrated in Figure 1 , sVCD aims to recover the interested source y from observed signals x formed by source signals mixed in a nonlinear manner . In particular , sVCD involves an encoder to analyze the temporal features of the observed signals and hence to encode them to the hidden state ( posterior distributions in a latent space ) , and it then decodes the hidden state to recover the interested source . A modified variational inference is applied to help approximate the intractable posterior and to achieve a disentangled representation in the latent space dedicated to the interested source , guided by the prior knowledge applied to train sVCD . Essentially , while y is available for supervised training , sVCD takes x as the sole input during the testing phase to obtain ŷ . To summarize , our main contributions include : • We prove that nonlinear source extraction can be formulated as modified variational inference and achieved by maximizing a tighter variational lower bound . • We design a novel sequence-to-sequence ( Seq2Seq ) translation architecture ; it leverages the modified variational inference to extract the desired source from nonlinear mixture . • We provide empirical evidence that sVCD outperforms a state-of-the-art method based on extensive evaluations under different nonlinear mixing scenarios . The rest of the paper is organized as follows . Section 2 presents related works . Section 3 introduces the mathematical framework for source extraction from nonlinear mixture . Section 4 presents the details sVCD model . Section 5 introduces the datasets and reports the evaluation results . Finally , Section 6 concludes this paper and points out potential future applications . 2 RELATED WORKS . Numerous algorithms have been developed to solve the BSS problem ( Comon & Jutten , 2010 ) : they all aim to decompose signal mixtures into individual components without knowing information about the source signals or the mixing process . Among them , Non-negative Matrix Factorization ( NMF ) decomposes the signal by using low-rank approximations under the non-negative constraint ( Wang & Zhang , 2012 ) . Independent Component Analysis ( ICA ) assumes that the underlying signals are statistically independent to separate them ( Hyvärinen & Oja , 2000 ) . BSS achieved by masking and re-weighting the frequency spectrograms have also been implemented by Hidden Markov Models ( HMMs ) ( Roweis , 2000 ) and segmentation methods ( Bach & Jordan , 2005 ) . One common assumption of regular BSS is that the mixing process is linear , under which the statistical independence of the underlying sources is a sufficient condition to constrain the linear unmixing function . However , as we extend BSS to nonlinear mixture , the statistical independence of the sources can no longer be treated as a sufficient constraint for the unmixing ( Hyvärinen & Pajunen , 1999 ) . Harmeling et al . ( 2003 ) and Hyvärinen & Morioka ( 2016 ) have proposed to utilize temporal structure in the mixture to overcome this challenge . Furthermore , several properties on the mixed sources , e.g. , autocorrelation ( Sprekeler et al. , 2014 ) , general non-Gaussian temporal dependency ( Hyvärinen & Morioka , 2017 ) , or non-stationarity ( Hyvärinen & Morioka , 2016 ) , can also provide sufficient constraints for solving the problem . Aother broadly related topic is disentanglement representation learning ( Bengio et al. , 2013 ) . The word “ disentanglement ” means decoupling of generating factors . Unlike BSS performing separation in signal space , disentanglement representation learning uncovers the underlying factors of variation in latent space . With the development of deep learning , disentanglement representation learning based on VAEs has gained momentum ( Kingma & Welling , 2013 ) . By augmenting the lower bound formulation with the coefficient that regulates the independence prior , Higgins et al . ( 2016 ) proposes β-VAE , a framework to discover interpretable latent representations automatically . Subsequent works ( Burgess et al. , 2018 ; Rolinek et al. , 2019 ; Chen et al. , 2018 ) have led to significant accomplishments in understanding the capabilities of nonlinear disentanglement in VAEs . Researchers have also been seeking the formal definition of disentanglement in several works ( Ridgeway , 2016 ; Higgins et al. , 2018 ; Eastwood & Williams , 2018 ) . The aforementioned algorithms assume that the sources are completely unknown , however , in many practical cases , we have some prior knowledge available and do not actually have to perform source separation in a completely blind manner . As such , these algorithms can be extended to incorporate the knowledge from the priors . In Calhoun et al . ( 2005 ) , paradigm information was employed to aid ICA analysis , and the results are shown to be more robust to noise and outperform basic ICA . In another work ( Jeong et al. , 2009 ) , the original NMF algorithm for BSS is significantly improved by enforcing a constraint that requires disjointness under the semi-blind denoising framework . Last but not least , Kameoka et al . ( 2018 ) achieves source separation by leveraging conditional VAE ( Sohn et al. , 2015 ) with source class as labels in priors during training . All the aforementioned approaches do not seem to suit our need for extracting specific source ( s ) . 3 VARIATIONAL INFERENCE FOR SIGNAL EXTRACTION . Unlike VAE ( Kingma & Welling , 2013 ) that aims to recover input by finding an efficient encoding in latent space , our sVCD focuses on extracting a specific component from nonlinear mixture . Therefore , if we directly borrow the idea of variational inference from VAE , the variational lower bound will not be as tight . As such , we propose and prove a new lower bound for our problem setup , so as to endow a new mathematical framework for sVCD . Let x be a nonlinear mixture of several independent sources . In order to find a representation of x , Bayesian modeling ( Lee , 1989 ) can be used to encode the beliefs about the processes that generate x from all components into a model M with latent vectors z and parameters θM . The model is then “ learned ” by inferring z and adjusting the parameters θM . In other words , given the observed mixture x , Bayesian modeling aims to infer the posterior p ( z|x ) . However , since the posterior distribution is intractable , an optimization approach , which is called variational inference ( Blei et al. , 2017 ) , can be leveraged to approach the problem . To be specific , a surrogate distribution q ( z ) is employed to approximate p ( z|x ) by minimizing their KL divergence ( Van Erven & Harremos , 2014 ) . However , the KL divergence itself still involves the intractable posterior p ( z|x ) . To cope with this issue , the KL divergence is decomposed into : KL ( q ( z ) ‖p ( z|x ) ) = log p ( x ) − Eq ( z ) [ log p ( x , z ) q ( z ) ] . ( 1 ) Since the marginal log-likelihood log p ( x ) is independent of the variational distribution q ( z ) , the KL divergence can be minimized by maximizing the variational lower bound Eq ( z ) [ log p ( x , z ) q ( z ) ] . As a particular type of variational inference method , VAE uses deep neural networks to approximate the generative models . It should be noted that in VAE , the distribution q is conditioned on the observation x , and approximated by an encoder network q ( z|x ) . As such , the variational lower bound of VAE can be expressed as : Eq ( z|x ) [ log p ( x , z ) q ( z|x ) ] = Eq ( z|x ) [ log p ( x|z ) ] −KL ( q ( z|x ) ‖p ( z ) ) , ( 2 ) By slight modifications ( Higgins et al. , 2016 ; Kim & Mnih , 2018 ) , the latent representation z of VAE shows disentanglement properties , suggesting that a regular VAE can be used for separating mixed sources . However , unlike the scenario faced by VAE which is unsupervised and source-agnostic , our task is not completely “ blind ” , i.e. , prior knowledge about a specifically interested component y is available . In this case , the variational lower bound should be Eq̃ ( z|y ) [ log p ( y , z ) q̃ ( z|y ) ] , where q̃ ( z|y ) is an approximate posterior distribution in the form q̃ ( z|y ) = ∫ p ( z|x ) q ( x|y ) dx . It can be observed that the posterior q̃ ( z|y ) takes into account the effect of the mixing process q ( x|y ) , thus covering a broader class of distributions and becoming more expressive . We also notice that there is still the desired component y in the denominator . Considering the goal of extraction signal component from a nonlinear mixture , we would like to maximize Eq̃ ( z|y ) [ log p ( y , z ) q ( z|x ) ] instead , in which case x and y should be used as the input and output of the network , respectively . Therefore , we need to study this new lower bound specifically . Lemma 3.1 . We get a tighter lower bound for the source extraction problem : log p ( y ) ≥ Eq̃ ( z|y ) [ log p ( y , z ) q ( z|x ) ] ≥ Eq̃ ( z|y ) [ log p ( y , z ) q̃ ( z|y ) ] . ( 3 ) Proof . For the left inequality , by using Jensen ’ s inequality , we have : Eq̃ ( z|y ) [ log p ( y , z ) q ( z|x ) ] = ∫ q̃ ( z|y ) log p ( y , z ) q ( z|x ) dz = Eq ( x|y ) Eq ( z|x ) [ log p ( y , z ) q ( z|x ) ] ≤ logEq ( x|y ) Eq ( z|x ) [ p ( y , z ) q ( z|x ) ] = log p ( y ) . ( 4 ) For the right inequality , by using Jensen ’ s inequality , we have : Eq̃ ( z|y ) [ log p ( y , z ) q ( z|x ) ] = Eq̃ ( z|y ) [ log p ( y , z ) ] − Eq̃ ( z|y ) [ log q ( z|x ) ] ≥ Eq̃ ( z|y ) [ log p ( y , z ) ] − Eq̃ ( z|y ) [ q̃ ( z|y ) ] = Eq̃ ( z|y ) [ log p ( y , z ) q̃ ( z|y ) ] . ( 5 ) As a result , we can optimize the surrogate lower bound Eq̃ ( z|y ) [ log p ( y , z ) q ( z|x ) ] of sVCD , which is tighter than that of VAE , for the task of source extraction . This variational inference can be readily implemented by the sVCD network in Section 4 .
The paper proposes an approach for supervised non-linear regression for multivariate time-series using a sequence-to-sequence approach with self-attention and generative prior on the latent codes. The paper poses this as a source extraction from a nonlinear mixture. The paper shows how this can be applied to a synthetically created data set as well as two real world data sets. The first is heartbeat and respiration from radio frequency. The second is EEG with EOG and the goal is to remove the EOG from the EEG. The paper shows that the model is able to extract the signals in the example cases.
SP:af2d296d9fd547aaa5906380d556faf2ef47e997
Variational Component Decoder for Source Extraction from Nonlinear Mixture
1 INTRODUCTION . Signal extraction from nonlinear mixture is a recurring yet hard research problem in signal processing and representation learning . To tackle this problem , conventional methods can be divided into two categories . One is Blind Source Separation ( BSS ) that recovers all sources in the mixture ( Comon & Jutten , 2010 ) , the other is to leverage available prior knowledge to extract only the desired components from the mixture ( Leong et al. , 2008 ) . Following the hardness results of nonlinear BSS based on nonlinear Independent Component Analysis ( ICA ) ( Hyvärinen & Pajunen , 1999 ) , many attempts have been made to realize nonlinear ICA and to further connect it with representation learning ( Hyvärinen & Morioka , 2016 ; 2017 ; Khemakhem et al. , 2020 ) . However , in many practical scenarios , only one or few sources are supposed to be retrieved for the concerned application ; for example , heartbeat monitoring , especially that achieved by contact-free approaches ( Ha et al. , 2020 ) , demands the heartbeat signal ( waveform ) to be extracted out of the nonlinear mixture with other signals such as body movements and respiration . Compared with nonlinear BSS , nonlinear source extraction can be far more efficient and effective under these scenarios : on one hand , extracting only the source of interest could significantly reduce the computation cost for the same category of algorithms ( e.g. , deep-learning based signal extraction would be computationally cheaper than deep-learning based signal separation ) . On the other hand , if prior knowledge of the source is available , the training may substantially leverage such knowledge so as to sufficiently improve the ( later ) inference accuracy . Recently , there is a rising interest in investigating disentangled representation learning exploiting deep learning techniques . Different from conventional source separation methods that demand hardcoded rules , a deep learning model aims to learn the underlying generating factors automatically and adaptively . To this end , the frameworks of variational auto-encoder ( VAE ) ( Kingma & Welling , 2013 ) and generative adversarial network ( GAN ) ( Goodfellow et al. , 2014 ) are widely used , and variants modifying designs and training techniques to enhance disentanglement have also been proposed , such as β-VAE ( Higgins et al. , 2016 ) . However , as the existing proposals mostly focus on disentangling on the representation in image or video data ( Kingma & Welling , 2013 ; Higgins et al. , 2016 ; Fabius & Van Amersfoort , 2014 ; Yingzhen & Mandt , 2018 ) where signal mixture never take place , we can not directly apply the idea of disentangled representation learning to our problem of source extraction ( a special form of disentanglement ) from nonlinear time-series mixture . Though a few results have been obtained for disentangling the sources in nonlinear mixing using deep learning , they fall into the category of BSS ( Hyvärinen & Morioka , 2016 ; Khemakhem et al. , 2020 ) . In this paper , we propose supervised Variational Component Decoder ( sVCD ) as a robust deeplearning framework for source extraction from nonlinear mixture . As illustrated in Figure 1 , sVCD aims to recover the interested source y from observed signals x formed by source signals mixed in a nonlinear manner . In particular , sVCD involves an encoder to analyze the temporal features of the observed signals and hence to encode them to the hidden state ( posterior distributions in a latent space ) , and it then decodes the hidden state to recover the interested source . A modified variational inference is applied to help approximate the intractable posterior and to achieve a disentangled representation in the latent space dedicated to the interested source , guided by the prior knowledge applied to train sVCD . Essentially , while y is available for supervised training , sVCD takes x as the sole input during the testing phase to obtain ŷ . To summarize , our main contributions include : • We prove that nonlinear source extraction can be formulated as modified variational inference and achieved by maximizing a tighter variational lower bound . • We design a novel sequence-to-sequence ( Seq2Seq ) translation architecture ; it leverages the modified variational inference to extract the desired source from nonlinear mixture . • We provide empirical evidence that sVCD outperforms a state-of-the-art method based on extensive evaluations under different nonlinear mixing scenarios . The rest of the paper is organized as follows . Section 2 presents related works . Section 3 introduces the mathematical framework for source extraction from nonlinear mixture . Section 4 presents the details sVCD model . Section 5 introduces the datasets and reports the evaluation results . Finally , Section 6 concludes this paper and points out potential future applications . 2 RELATED WORKS . Numerous algorithms have been developed to solve the BSS problem ( Comon & Jutten , 2010 ) : they all aim to decompose signal mixtures into individual components without knowing information about the source signals or the mixing process . Among them , Non-negative Matrix Factorization ( NMF ) decomposes the signal by using low-rank approximations under the non-negative constraint ( Wang & Zhang , 2012 ) . Independent Component Analysis ( ICA ) assumes that the underlying signals are statistically independent to separate them ( Hyvärinen & Oja , 2000 ) . BSS achieved by masking and re-weighting the frequency spectrograms have also been implemented by Hidden Markov Models ( HMMs ) ( Roweis , 2000 ) and segmentation methods ( Bach & Jordan , 2005 ) . One common assumption of regular BSS is that the mixing process is linear , under which the statistical independence of the underlying sources is a sufficient condition to constrain the linear unmixing function . However , as we extend BSS to nonlinear mixture , the statistical independence of the sources can no longer be treated as a sufficient constraint for the unmixing ( Hyvärinen & Pajunen , 1999 ) . Harmeling et al . ( 2003 ) and Hyvärinen & Morioka ( 2016 ) have proposed to utilize temporal structure in the mixture to overcome this challenge . Furthermore , several properties on the mixed sources , e.g. , autocorrelation ( Sprekeler et al. , 2014 ) , general non-Gaussian temporal dependency ( Hyvärinen & Morioka , 2017 ) , or non-stationarity ( Hyvärinen & Morioka , 2016 ) , can also provide sufficient constraints for solving the problem . Aother broadly related topic is disentanglement representation learning ( Bengio et al. , 2013 ) . The word “ disentanglement ” means decoupling of generating factors . Unlike BSS performing separation in signal space , disentanglement representation learning uncovers the underlying factors of variation in latent space . With the development of deep learning , disentanglement representation learning based on VAEs has gained momentum ( Kingma & Welling , 2013 ) . By augmenting the lower bound formulation with the coefficient that regulates the independence prior , Higgins et al . ( 2016 ) proposes β-VAE , a framework to discover interpretable latent representations automatically . Subsequent works ( Burgess et al. , 2018 ; Rolinek et al. , 2019 ; Chen et al. , 2018 ) have led to significant accomplishments in understanding the capabilities of nonlinear disentanglement in VAEs . Researchers have also been seeking the formal definition of disentanglement in several works ( Ridgeway , 2016 ; Higgins et al. , 2018 ; Eastwood & Williams , 2018 ) . The aforementioned algorithms assume that the sources are completely unknown , however , in many practical cases , we have some prior knowledge available and do not actually have to perform source separation in a completely blind manner . As such , these algorithms can be extended to incorporate the knowledge from the priors . In Calhoun et al . ( 2005 ) , paradigm information was employed to aid ICA analysis , and the results are shown to be more robust to noise and outperform basic ICA . In another work ( Jeong et al. , 2009 ) , the original NMF algorithm for BSS is significantly improved by enforcing a constraint that requires disjointness under the semi-blind denoising framework . Last but not least , Kameoka et al . ( 2018 ) achieves source separation by leveraging conditional VAE ( Sohn et al. , 2015 ) with source class as labels in priors during training . All the aforementioned approaches do not seem to suit our need for extracting specific source ( s ) . 3 VARIATIONAL INFERENCE FOR SIGNAL EXTRACTION . Unlike VAE ( Kingma & Welling , 2013 ) that aims to recover input by finding an efficient encoding in latent space , our sVCD focuses on extracting a specific component from nonlinear mixture . Therefore , if we directly borrow the idea of variational inference from VAE , the variational lower bound will not be as tight . As such , we propose and prove a new lower bound for our problem setup , so as to endow a new mathematical framework for sVCD . Let x be a nonlinear mixture of several independent sources . In order to find a representation of x , Bayesian modeling ( Lee , 1989 ) can be used to encode the beliefs about the processes that generate x from all components into a model M with latent vectors z and parameters θM . The model is then “ learned ” by inferring z and adjusting the parameters θM . In other words , given the observed mixture x , Bayesian modeling aims to infer the posterior p ( z|x ) . However , since the posterior distribution is intractable , an optimization approach , which is called variational inference ( Blei et al. , 2017 ) , can be leveraged to approach the problem . To be specific , a surrogate distribution q ( z ) is employed to approximate p ( z|x ) by minimizing their KL divergence ( Van Erven & Harremos , 2014 ) . However , the KL divergence itself still involves the intractable posterior p ( z|x ) . To cope with this issue , the KL divergence is decomposed into : KL ( q ( z ) ‖p ( z|x ) ) = log p ( x ) − Eq ( z ) [ log p ( x , z ) q ( z ) ] . ( 1 ) Since the marginal log-likelihood log p ( x ) is independent of the variational distribution q ( z ) , the KL divergence can be minimized by maximizing the variational lower bound Eq ( z ) [ log p ( x , z ) q ( z ) ] . As a particular type of variational inference method , VAE uses deep neural networks to approximate the generative models . It should be noted that in VAE , the distribution q is conditioned on the observation x , and approximated by an encoder network q ( z|x ) . As such , the variational lower bound of VAE can be expressed as : Eq ( z|x ) [ log p ( x , z ) q ( z|x ) ] = Eq ( z|x ) [ log p ( x|z ) ] −KL ( q ( z|x ) ‖p ( z ) ) , ( 2 ) By slight modifications ( Higgins et al. , 2016 ; Kim & Mnih , 2018 ) , the latent representation z of VAE shows disentanglement properties , suggesting that a regular VAE can be used for separating mixed sources . However , unlike the scenario faced by VAE which is unsupervised and source-agnostic , our task is not completely “ blind ” , i.e. , prior knowledge about a specifically interested component y is available . In this case , the variational lower bound should be Eq̃ ( z|y ) [ log p ( y , z ) q̃ ( z|y ) ] , where q̃ ( z|y ) is an approximate posterior distribution in the form q̃ ( z|y ) = ∫ p ( z|x ) q ( x|y ) dx . It can be observed that the posterior q̃ ( z|y ) takes into account the effect of the mixing process q ( x|y ) , thus covering a broader class of distributions and becoming more expressive . We also notice that there is still the desired component y in the denominator . Considering the goal of extraction signal component from a nonlinear mixture , we would like to maximize Eq̃ ( z|y ) [ log p ( y , z ) q ( z|x ) ] instead , in which case x and y should be used as the input and output of the network , respectively . Therefore , we need to study this new lower bound specifically . Lemma 3.1 . We get a tighter lower bound for the source extraction problem : log p ( y ) ≥ Eq̃ ( z|y ) [ log p ( y , z ) q ( z|x ) ] ≥ Eq̃ ( z|y ) [ log p ( y , z ) q̃ ( z|y ) ] . ( 3 ) Proof . For the left inequality , by using Jensen ’ s inequality , we have : Eq̃ ( z|y ) [ log p ( y , z ) q ( z|x ) ] = ∫ q̃ ( z|y ) log p ( y , z ) q ( z|x ) dz = Eq ( x|y ) Eq ( z|x ) [ log p ( y , z ) q ( z|x ) ] ≤ logEq ( x|y ) Eq ( z|x ) [ p ( y , z ) q ( z|x ) ] = log p ( y ) . ( 4 ) For the right inequality , by using Jensen ’ s inequality , we have : Eq̃ ( z|y ) [ log p ( y , z ) q ( z|x ) ] = Eq̃ ( z|y ) [ log p ( y , z ) ] − Eq̃ ( z|y ) [ log q ( z|x ) ] ≥ Eq̃ ( z|y ) [ log p ( y , z ) ] − Eq̃ ( z|y ) [ q̃ ( z|y ) ] = Eq̃ ( z|y ) [ log p ( y , z ) q̃ ( z|y ) ] . ( 5 ) As a result , we can optimize the surrogate lower bound Eq̃ ( z|y ) [ log p ( y , z ) q ( z|x ) ] of sVCD , which is tighter than that of VAE , for the task of source extraction . This variational inference can be readily implemented by the sVCD network in Section 4 .
Authors present a novel approach that uses deep learning to solve non-linear Blind Source Separation problems. More specifically, their approach combines Seq2Seq and variational inference to extract one source of interest out of the nonlinear mixture. The generative model incorporates the prior beliefs about the source to be extracted.
SP:af2d296d9fd547aaa5906380d556faf2ef47e997
Variational Component Decoder for Source Extraction from Nonlinear Mixture
1 INTRODUCTION . Signal extraction from nonlinear mixture is a recurring yet hard research problem in signal processing and representation learning . To tackle this problem , conventional methods can be divided into two categories . One is Blind Source Separation ( BSS ) that recovers all sources in the mixture ( Comon & Jutten , 2010 ) , the other is to leverage available prior knowledge to extract only the desired components from the mixture ( Leong et al. , 2008 ) . Following the hardness results of nonlinear BSS based on nonlinear Independent Component Analysis ( ICA ) ( Hyvärinen & Pajunen , 1999 ) , many attempts have been made to realize nonlinear ICA and to further connect it with representation learning ( Hyvärinen & Morioka , 2016 ; 2017 ; Khemakhem et al. , 2020 ) . However , in many practical scenarios , only one or few sources are supposed to be retrieved for the concerned application ; for example , heartbeat monitoring , especially that achieved by contact-free approaches ( Ha et al. , 2020 ) , demands the heartbeat signal ( waveform ) to be extracted out of the nonlinear mixture with other signals such as body movements and respiration . Compared with nonlinear BSS , nonlinear source extraction can be far more efficient and effective under these scenarios : on one hand , extracting only the source of interest could significantly reduce the computation cost for the same category of algorithms ( e.g. , deep-learning based signal extraction would be computationally cheaper than deep-learning based signal separation ) . On the other hand , if prior knowledge of the source is available , the training may substantially leverage such knowledge so as to sufficiently improve the ( later ) inference accuracy . Recently , there is a rising interest in investigating disentangled representation learning exploiting deep learning techniques . Different from conventional source separation methods that demand hardcoded rules , a deep learning model aims to learn the underlying generating factors automatically and adaptively . To this end , the frameworks of variational auto-encoder ( VAE ) ( Kingma & Welling , 2013 ) and generative adversarial network ( GAN ) ( Goodfellow et al. , 2014 ) are widely used , and variants modifying designs and training techniques to enhance disentanglement have also been proposed , such as β-VAE ( Higgins et al. , 2016 ) . However , as the existing proposals mostly focus on disentangling on the representation in image or video data ( Kingma & Welling , 2013 ; Higgins et al. , 2016 ; Fabius & Van Amersfoort , 2014 ; Yingzhen & Mandt , 2018 ) where signal mixture never take place , we can not directly apply the idea of disentangled representation learning to our problem of source extraction ( a special form of disentanglement ) from nonlinear time-series mixture . Though a few results have been obtained for disentangling the sources in nonlinear mixing using deep learning , they fall into the category of BSS ( Hyvärinen & Morioka , 2016 ; Khemakhem et al. , 2020 ) . In this paper , we propose supervised Variational Component Decoder ( sVCD ) as a robust deeplearning framework for source extraction from nonlinear mixture . As illustrated in Figure 1 , sVCD aims to recover the interested source y from observed signals x formed by source signals mixed in a nonlinear manner . In particular , sVCD involves an encoder to analyze the temporal features of the observed signals and hence to encode them to the hidden state ( posterior distributions in a latent space ) , and it then decodes the hidden state to recover the interested source . A modified variational inference is applied to help approximate the intractable posterior and to achieve a disentangled representation in the latent space dedicated to the interested source , guided by the prior knowledge applied to train sVCD . Essentially , while y is available for supervised training , sVCD takes x as the sole input during the testing phase to obtain ŷ . To summarize , our main contributions include : • We prove that nonlinear source extraction can be formulated as modified variational inference and achieved by maximizing a tighter variational lower bound . • We design a novel sequence-to-sequence ( Seq2Seq ) translation architecture ; it leverages the modified variational inference to extract the desired source from nonlinear mixture . • We provide empirical evidence that sVCD outperforms a state-of-the-art method based on extensive evaluations under different nonlinear mixing scenarios . The rest of the paper is organized as follows . Section 2 presents related works . Section 3 introduces the mathematical framework for source extraction from nonlinear mixture . Section 4 presents the details sVCD model . Section 5 introduces the datasets and reports the evaluation results . Finally , Section 6 concludes this paper and points out potential future applications . 2 RELATED WORKS . Numerous algorithms have been developed to solve the BSS problem ( Comon & Jutten , 2010 ) : they all aim to decompose signal mixtures into individual components without knowing information about the source signals or the mixing process . Among them , Non-negative Matrix Factorization ( NMF ) decomposes the signal by using low-rank approximations under the non-negative constraint ( Wang & Zhang , 2012 ) . Independent Component Analysis ( ICA ) assumes that the underlying signals are statistically independent to separate them ( Hyvärinen & Oja , 2000 ) . BSS achieved by masking and re-weighting the frequency spectrograms have also been implemented by Hidden Markov Models ( HMMs ) ( Roweis , 2000 ) and segmentation methods ( Bach & Jordan , 2005 ) . One common assumption of regular BSS is that the mixing process is linear , under which the statistical independence of the underlying sources is a sufficient condition to constrain the linear unmixing function . However , as we extend BSS to nonlinear mixture , the statistical independence of the sources can no longer be treated as a sufficient constraint for the unmixing ( Hyvärinen & Pajunen , 1999 ) . Harmeling et al . ( 2003 ) and Hyvärinen & Morioka ( 2016 ) have proposed to utilize temporal structure in the mixture to overcome this challenge . Furthermore , several properties on the mixed sources , e.g. , autocorrelation ( Sprekeler et al. , 2014 ) , general non-Gaussian temporal dependency ( Hyvärinen & Morioka , 2017 ) , or non-stationarity ( Hyvärinen & Morioka , 2016 ) , can also provide sufficient constraints for solving the problem . Aother broadly related topic is disentanglement representation learning ( Bengio et al. , 2013 ) . The word “ disentanglement ” means decoupling of generating factors . Unlike BSS performing separation in signal space , disentanglement representation learning uncovers the underlying factors of variation in latent space . With the development of deep learning , disentanglement representation learning based on VAEs has gained momentum ( Kingma & Welling , 2013 ) . By augmenting the lower bound formulation with the coefficient that regulates the independence prior , Higgins et al . ( 2016 ) proposes β-VAE , a framework to discover interpretable latent representations automatically . Subsequent works ( Burgess et al. , 2018 ; Rolinek et al. , 2019 ; Chen et al. , 2018 ) have led to significant accomplishments in understanding the capabilities of nonlinear disentanglement in VAEs . Researchers have also been seeking the formal definition of disentanglement in several works ( Ridgeway , 2016 ; Higgins et al. , 2018 ; Eastwood & Williams , 2018 ) . The aforementioned algorithms assume that the sources are completely unknown , however , in many practical cases , we have some prior knowledge available and do not actually have to perform source separation in a completely blind manner . As such , these algorithms can be extended to incorporate the knowledge from the priors . In Calhoun et al . ( 2005 ) , paradigm information was employed to aid ICA analysis , and the results are shown to be more robust to noise and outperform basic ICA . In another work ( Jeong et al. , 2009 ) , the original NMF algorithm for BSS is significantly improved by enforcing a constraint that requires disjointness under the semi-blind denoising framework . Last but not least , Kameoka et al . ( 2018 ) achieves source separation by leveraging conditional VAE ( Sohn et al. , 2015 ) with source class as labels in priors during training . All the aforementioned approaches do not seem to suit our need for extracting specific source ( s ) . 3 VARIATIONAL INFERENCE FOR SIGNAL EXTRACTION . Unlike VAE ( Kingma & Welling , 2013 ) that aims to recover input by finding an efficient encoding in latent space , our sVCD focuses on extracting a specific component from nonlinear mixture . Therefore , if we directly borrow the idea of variational inference from VAE , the variational lower bound will not be as tight . As such , we propose and prove a new lower bound for our problem setup , so as to endow a new mathematical framework for sVCD . Let x be a nonlinear mixture of several independent sources . In order to find a representation of x , Bayesian modeling ( Lee , 1989 ) can be used to encode the beliefs about the processes that generate x from all components into a model M with latent vectors z and parameters θM . The model is then “ learned ” by inferring z and adjusting the parameters θM . In other words , given the observed mixture x , Bayesian modeling aims to infer the posterior p ( z|x ) . However , since the posterior distribution is intractable , an optimization approach , which is called variational inference ( Blei et al. , 2017 ) , can be leveraged to approach the problem . To be specific , a surrogate distribution q ( z ) is employed to approximate p ( z|x ) by minimizing their KL divergence ( Van Erven & Harremos , 2014 ) . However , the KL divergence itself still involves the intractable posterior p ( z|x ) . To cope with this issue , the KL divergence is decomposed into : KL ( q ( z ) ‖p ( z|x ) ) = log p ( x ) − Eq ( z ) [ log p ( x , z ) q ( z ) ] . ( 1 ) Since the marginal log-likelihood log p ( x ) is independent of the variational distribution q ( z ) , the KL divergence can be minimized by maximizing the variational lower bound Eq ( z ) [ log p ( x , z ) q ( z ) ] . As a particular type of variational inference method , VAE uses deep neural networks to approximate the generative models . It should be noted that in VAE , the distribution q is conditioned on the observation x , and approximated by an encoder network q ( z|x ) . As such , the variational lower bound of VAE can be expressed as : Eq ( z|x ) [ log p ( x , z ) q ( z|x ) ] = Eq ( z|x ) [ log p ( x|z ) ] −KL ( q ( z|x ) ‖p ( z ) ) , ( 2 ) By slight modifications ( Higgins et al. , 2016 ; Kim & Mnih , 2018 ) , the latent representation z of VAE shows disentanglement properties , suggesting that a regular VAE can be used for separating mixed sources . However , unlike the scenario faced by VAE which is unsupervised and source-agnostic , our task is not completely “ blind ” , i.e. , prior knowledge about a specifically interested component y is available . In this case , the variational lower bound should be Eq̃ ( z|y ) [ log p ( y , z ) q̃ ( z|y ) ] , where q̃ ( z|y ) is an approximate posterior distribution in the form q̃ ( z|y ) = ∫ p ( z|x ) q ( x|y ) dx . It can be observed that the posterior q̃ ( z|y ) takes into account the effect of the mixing process q ( x|y ) , thus covering a broader class of distributions and becoming more expressive . We also notice that there is still the desired component y in the denominator . Considering the goal of extraction signal component from a nonlinear mixture , we would like to maximize Eq̃ ( z|y ) [ log p ( y , z ) q ( z|x ) ] instead , in which case x and y should be used as the input and output of the network , respectively . Therefore , we need to study this new lower bound specifically . Lemma 3.1 . We get a tighter lower bound for the source extraction problem : log p ( y ) ≥ Eq̃ ( z|y ) [ log p ( y , z ) q ( z|x ) ] ≥ Eq̃ ( z|y ) [ log p ( y , z ) q̃ ( z|y ) ] . ( 3 ) Proof . For the left inequality , by using Jensen ’ s inequality , we have : Eq̃ ( z|y ) [ log p ( y , z ) q ( z|x ) ] = ∫ q̃ ( z|y ) log p ( y , z ) q ( z|x ) dz = Eq ( x|y ) Eq ( z|x ) [ log p ( y , z ) q ( z|x ) ] ≤ logEq ( x|y ) Eq ( z|x ) [ p ( y , z ) q ( z|x ) ] = log p ( y ) . ( 4 ) For the right inequality , by using Jensen ’ s inequality , we have : Eq̃ ( z|y ) [ log p ( y , z ) q ( z|x ) ] = Eq̃ ( z|y ) [ log p ( y , z ) ] − Eq̃ ( z|y ) [ log q ( z|x ) ] ≥ Eq̃ ( z|y ) [ log p ( y , z ) ] − Eq̃ ( z|y ) [ q̃ ( z|y ) ] = Eq̃ ( z|y ) [ log p ( y , z ) q̃ ( z|y ) ] . ( 5 ) As a result , we can optimize the surrogate lower bound Eq̃ ( z|y ) [ log p ( y , z ) q ( z|x ) ] of sVCD , which is tighter than that of VAE , for the task of source extraction . This variational inference can be readily implemented by the sVCD network in Section 4 .
Authors propose a supervised variational component decoder (sVCD) framework that estimates a single source signal sequence from non-linear mixtures. Proposed model relies on a sequence-to-sequence translating variational encoder-decoder architecture, where optimization is performed based on a variational lower bound on the source signal’s data likelihood. Experiments are performed on artificially generated nonlinear sequence mixtures, RF sensing data and an EEG-EOG dataset.
SP:af2d296d9fd547aaa5906380d556faf2ef47e997
Enforcing physics-based algebraic constraints for inference of PDE models on unstructured grids
1 INTRODUCTION . Multiple works have shown the capability of neural networks to solve complex physical problems and learn the behavior of physical systems from data . Examples include learning and solving ordinary differential equations ( ODEs ) [ 6 ] , partial differential equations ( PDEs ) [ 28 ; 20 ] and rigid body dynamics [ 31 ; 5 ] . Purely data-driven models are typically not forced to satisfy physical constraints of the system that generated the data . This might lead to unrealistic predictions that violate some known properties of the underlying physical system . Incorporation of relevant constraints allows to make a better use of the available data and makes predictions more physically plausible . The field dealing with physics-constrained learning is diverse and offers many approaches to adding constraints to models . We refer the reader to many reviews for details [ 30 ; 3 ; 36 ; 19 ] . The approach we consider in this work is based on forcing a model to satisfy algebraic constraints represented by a set of equalities and inequalities . This is the most commonly used approach which allows to represent a wide range of constraints and has been shown to work well in many cases [ 18 ; 17 ; 25 ] . However , while many constraints can be represented algebraically , it is not always clear how to evaluate and enforce them . Currently available approaches to enforcing algebraic constraints are limited to uniform grids and have a very narrow range of constraints they can enforce ( e.g . only pointwise , or specific differential constraints ) , see Section 5 for details of related work . Such approaches can be readily applied to models based on convolutional neural networks ( CNNs ) but can not be extended to recently developed models based on graph neural networks ( GNNs ) [ 33 ; 27 ; 15 ] and other models working on unstructured grids . We propose a much more general method which allows to enforce pointwise , differential and integral constraints on unstructured spatial grids and demonstrate its applicability in learning of PDE-driven dynamical systems and distributions of physical fields . The method is based on using a models ’ s output at the nodes of a grid to construct an interpolant and applying constraints directly to that interpolant ( Section 3 ) . Code and data will be made publicly available . 2 BACKGROUND . PDE-driven dynamical systems . Many physical systems can be described in terms of PDEs . Such systems are defined on a bounded domain on which they evolve over time . We consider continuous dynamical systems with state u ( t , x ) ∈ Rp that evolves over time t ∈ R≥0 and spatial locations x ∈ Ω ⊂ RD . For physical systems , D is typically limited to { 1 , 2 , 3 } although our method will work with any value of D. We assume the system is governed by an unknown PDE ∂u ( t , x ) ∂t = F ( x , u ( t , x ) , ∇xu ( t , x ) , ∇2xu ( t , x ) , ... ) ( 1 ) which describes the temporal evolution of the system in terms of the locations x , state u and its first and higher-order partial derivatives w.r.t . x . The goal of a data-driven PDE model is to learn the dynamics F from data . Data for learning F is collected by measuring the state of the system at observation locations ( x1 , . . . , xN ) over increasing time points ( t0 , . . . , tM ) . This results in a dataset ( y ( t0 ) , . . . , y ( tM ) ) , where y ( ti ) = ( u ( ti , x1 ) , . . . , u ( ti , xN ) ) is a collection of observations . The dataset is used to train the model to predict ( y ( t1 ) , . . . , y ( tM ) ) starting from the initial state y ( t0 ) . Training is typically done by minimizing an average loss between the model ’ s predictions u ( t ) and the data y ( t ) . PDE models differ in restrictions they impose on time points ( temporal grid ) and observation locations ( spatial grid ) . Some models require both grids to be uniform [ 23 ] , other models relax these requirements and allow arbitrary spatial [ 27 ] and spatio-temporal grids [ 15 ] . We build our algebraic constraints method using the model from [ 15 ] as the most general one . The model is based on application of the method of lines [ 32 ] to Equation 1 which results into a system of ODEs u̇ ( t ) : = du ( t , x1 ) dt ... du ( t , xN ) dt ≈ Fθ ( x1 , xN ( 1 ) , u1 , uN ( 1 ) ) ... Fθ ( xN , xN ( N ) , uN , uN ( N ) ) ( 2 ) which approximates the solution of Equation 1 at the observation locations xi using their neighboring points N ( i ) , where xN ( i ) and uN ( i ) are the neighbors ’ positions and states respectively , and ui is u ( t , xi ) . The approximate solution converges to the true solution as N increases . The true dynamics F is approximated by a parametric model Fθ whose parameters θ are learned by minimizing the difference between the model ’ s predictions u ( t ) = u ( 0 ) + ∫ t 0 u̇ ( τ ) dτ ( 3 ) and the data y ( t ) . The integral in Equation 3 is solved using a numerical ODE solver . In [ 15 ] , the function Fθ was represented by a graph neural network ( GNN ) which takes states and locations at an observation point i and its neighboring points N ( i ) . The observation points are connected into a grid using Delaunay triangulation which allows to naturally defineN ( i ) as a set of points connected to the point i . However , Fθ can be represented by other models and a different neighbor selection criterion can be used . The model parameters θ are learned by minimizing the MSE between y ( t ) and u ( t ) Ldata = 1 M M∑ i=1 ‖u ( ti ) − y ( ti ) ‖22 . ( 4 ) The gradient of Ldata w.r.t . θ is evaluated using the adjoint method as shown in [ 7 ] . Generative Adversarial Networks One of the tasks that we consider is learning distributions of physical fields . For that purpose we utilize generative adversarial networks ( GANs ) . A GAN is a generative model consisting of a generator and a discriminator [ 12 ] . The generator , G , learns to transform a random variable Z ∼ pZ over a latent space Z to the data space Y in such a way that the discriminator , D , can not tell the difference between samples generated by G and samples from the data distribution pdata . Both , G and D are learned by solving the following minimax problem min G max D V ( G , D ) = EY∼pdata [ logD ( Y ) ] + EZ∼pZ [ log ( 1−D ( G ( Z ) ) ) ] . ( 5 ) Solution of this problem exists and is unique with the optimal generator perfectly mimicking the data distribution [ 12 ] . 3 METHODS . In this section we presents an approach to evaluating pointwise , differential and integral constraints on unstructured grids . Then , we demonstrate how this approach can be used to enforce arbitrary soft and linear hard constraints . 3.1 EVALUATING CONSTRAINTS ON UNSTRUCTURED GRIDS . We assume the data y ( t ) is available at observation points ( x1 , . . . , xN ) and time points ( t1 , . . . , tM ) and that a model makes predictions u ( t ) at these points . We assume the predictions to be evaluations of an unknown underlying function . Since the underlying function is unknown , we can not impose constraints on it directly . Instead , we approximate it by an interpolant uf ( t , x ) and impose constraints on uf ( t , x ) ( Figure 1 ) . The approximation is constructed from u ( t ) by placing a basis function at each xi and representing uf ( t , x ) as uf ( t , x ) = N∑ j=1 αj ( t ) φj ( x ) , ( 6 ) where φj is a scalar basis function at xj and αj ∈ Rp . The coefficients αj ( t ) are obtained from u ( t ) ( see Section 3.4 ) . Next , we show how to evaluate constraints on uf ( t , x ) using basic building blocks . To avoid cluttered notation , we consider equality constraints and assume u ( t , x ) , x ∈ R. Generalization to inequality constraints , vector fields and higher spatial dimensions is straightforward . Pointwise constraints . Consider points z = ( z1 , . . . , zK ) in Ω on which a pointwise constraint h ( uf ( t , zi ) ) = 0 should be evaluated . Assume the function h : R→ R is representable in terms of a finite number of functions γm ( uf ( t , zi ) ) : R → R indexed by m. For example , should the constraint be h ( uf ) = 3uf + u2f = 0 , then we would define γ1 ( uf ) = uf , γ2 ( uf ) = u2f and h ( uf ) = 3 · γ1 ( uf ) + γ2 ( uf ) = 0 . Then , h can be evaluated by evaluating each γm as γm ( uf ( t , zi ) ) = γm N∑ j=1 αj ( t ) φj ( zi ) = γm ( Φi , ·α ( t ) ) , ( 7 ) where α ( t ) = ( α1 ( t ) , . . . , αN ( t ) ) T , Φ is K-by-N matrix with elements Φi , j = φj ( zi ) , and Φi , · is the i ’ th row of Φ . Differential constraints . Consider the same setup as before but now h ( uf ( t , zi ) ) = 0 consists of differential operators and is representable in terms of a finite number of functions ∂ qγm ( uf ( t , zi ) ) ∂zqi : R→ R indexed bym , where the derivative order q could be different for eachm . For example , should the constraint be h ( uf ) = 3uf + uf · ∂u2f ∂x = 0 , then we would define γ1 ( uf ) = uf , γ2 ( uf ) = u 2 f and h ( uf ) = 3 · γ1 ( uf ) + γ1 ( uf ) · ∂γ2 ( uf ) ∂z = 0 . Then , h can be evaluated by evaluating each ∂qγm ( uf ( t , zi ) ) ∂zqi using the generalization of the chain rule ( Appendix A ) which contains only two types of terms . The first type of terms dγmduf , . . . , dqγm duqf can be evaluated using automatic differentiation while the second type of terms ∂uf∂zi , . . . , ∂quf ∂zqi can be evaluated as ∂quf ∂zqi = N∑ j=1 αj ( t ) ∂qφj ( zi ) ∂zqi = Φ ( q ) i , · α ( t ) , ( 8 ) where Φ ( q ) i , j = ∂qφj ( zi ) ∂zqi . Mixed partial derivatives can be handled in a similar way ( Appendix A ) . Integral constraints . Consider the same setup as before but with h ( uf ( t , x ) ) =∫ Ω τ ( uf ( t , x ) ) dx = 0 , where the function τ : R → R is representable in terms of functions γm ( uf ( t , zi ) ) : R→ R similarly to the pointwise constraints . Then , ∫ Ω τ ( uf ( t , x ) ) dx can be evalu- ated using a numerical integration technique , e.g . midpoint rule , Gaussian quadrature or Monte-Carlo integration , as ∫ Ω τ ( uf ( t , x ) ) dx ≈ K∑ i=1 τ ( uf ( t , zi ) ) µi , ( 9 ) where K is the number of integration points , µi are integration coefficients which depend on the grid and integration method , and τ ( uf ( t , zi ) ) is evaluated as in Equation 7 .
The authors present a method to incorporate constraints into the output of learnable PDE models. They cover point-wise, differential, and integral constraints. They achieve this by representing the PDE solution in a basis, as is common for the variational method (e.g. pseudo-spectral method, and finite element method). The neural network outputs interpolation coefficients for each time step into the future. To implement the constraints, they have two methods: ‘soft constraints’, whereby a constraint-breaking penalty is applied to the neural network output and ‘hard constraints’, whereby the output of the network is projected on to constraint-satisfying solutions. This latter method is achieved by solving a convex programme. The authors test on a variety of benchmarks, demonstrating that their method works; although, it is hard to parse the experimental section for whether these results are significant.
SP:b3aff23abb861090b004f9d33436b69961421cf9
Enforcing physics-based algebraic constraints for inference of PDE models on unstructured grids
1 INTRODUCTION . Multiple works have shown the capability of neural networks to solve complex physical problems and learn the behavior of physical systems from data . Examples include learning and solving ordinary differential equations ( ODEs ) [ 6 ] , partial differential equations ( PDEs ) [ 28 ; 20 ] and rigid body dynamics [ 31 ; 5 ] . Purely data-driven models are typically not forced to satisfy physical constraints of the system that generated the data . This might lead to unrealistic predictions that violate some known properties of the underlying physical system . Incorporation of relevant constraints allows to make a better use of the available data and makes predictions more physically plausible . The field dealing with physics-constrained learning is diverse and offers many approaches to adding constraints to models . We refer the reader to many reviews for details [ 30 ; 3 ; 36 ; 19 ] . The approach we consider in this work is based on forcing a model to satisfy algebraic constraints represented by a set of equalities and inequalities . This is the most commonly used approach which allows to represent a wide range of constraints and has been shown to work well in many cases [ 18 ; 17 ; 25 ] . However , while many constraints can be represented algebraically , it is not always clear how to evaluate and enforce them . Currently available approaches to enforcing algebraic constraints are limited to uniform grids and have a very narrow range of constraints they can enforce ( e.g . only pointwise , or specific differential constraints ) , see Section 5 for details of related work . Such approaches can be readily applied to models based on convolutional neural networks ( CNNs ) but can not be extended to recently developed models based on graph neural networks ( GNNs ) [ 33 ; 27 ; 15 ] and other models working on unstructured grids . We propose a much more general method which allows to enforce pointwise , differential and integral constraints on unstructured spatial grids and demonstrate its applicability in learning of PDE-driven dynamical systems and distributions of physical fields . The method is based on using a models ’ s output at the nodes of a grid to construct an interpolant and applying constraints directly to that interpolant ( Section 3 ) . Code and data will be made publicly available . 2 BACKGROUND . PDE-driven dynamical systems . Many physical systems can be described in terms of PDEs . Such systems are defined on a bounded domain on which they evolve over time . We consider continuous dynamical systems with state u ( t , x ) ∈ Rp that evolves over time t ∈ R≥0 and spatial locations x ∈ Ω ⊂ RD . For physical systems , D is typically limited to { 1 , 2 , 3 } although our method will work with any value of D. We assume the system is governed by an unknown PDE ∂u ( t , x ) ∂t = F ( x , u ( t , x ) , ∇xu ( t , x ) , ∇2xu ( t , x ) , ... ) ( 1 ) which describes the temporal evolution of the system in terms of the locations x , state u and its first and higher-order partial derivatives w.r.t . x . The goal of a data-driven PDE model is to learn the dynamics F from data . Data for learning F is collected by measuring the state of the system at observation locations ( x1 , . . . , xN ) over increasing time points ( t0 , . . . , tM ) . This results in a dataset ( y ( t0 ) , . . . , y ( tM ) ) , where y ( ti ) = ( u ( ti , x1 ) , . . . , u ( ti , xN ) ) is a collection of observations . The dataset is used to train the model to predict ( y ( t1 ) , . . . , y ( tM ) ) starting from the initial state y ( t0 ) . Training is typically done by minimizing an average loss between the model ’ s predictions u ( t ) and the data y ( t ) . PDE models differ in restrictions they impose on time points ( temporal grid ) and observation locations ( spatial grid ) . Some models require both grids to be uniform [ 23 ] , other models relax these requirements and allow arbitrary spatial [ 27 ] and spatio-temporal grids [ 15 ] . We build our algebraic constraints method using the model from [ 15 ] as the most general one . The model is based on application of the method of lines [ 32 ] to Equation 1 which results into a system of ODEs u̇ ( t ) : = du ( t , x1 ) dt ... du ( t , xN ) dt ≈ Fθ ( x1 , xN ( 1 ) , u1 , uN ( 1 ) ) ... Fθ ( xN , xN ( N ) , uN , uN ( N ) ) ( 2 ) which approximates the solution of Equation 1 at the observation locations xi using their neighboring points N ( i ) , where xN ( i ) and uN ( i ) are the neighbors ’ positions and states respectively , and ui is u ( t , xi ) . The approximate solution converges to the true solution as N increases . The true dynamics F is approximated by a parametric model Fθ whose parameters θ are learned by minimizing the difference between the model ’ s predictions u ( t ) = u ( 0 ) + ∫ t 0 u̇ ( τ ) dτ ( 3 ) and the data y ( t ) . The integral in Equation 3 is solved using a numerical ODE solver . In [ 15 ] , the function Fθ was represented by a graph neural network ( GNN ) which takes states and locations at an observation point i and its neighboring points N ( i ) . The observation points are connected into a grid using Delaunay triangulation which allows to naturally defineN ( i ) as a set of points connected to the point i . However , Fθ can be represented by other models and a different neighbor selection criterion can be used . The model parameters θ are learned by minimizing the MSE between y ( t ) and u ( t ) Ldata = 1 M M∑ i=1 ‖u ( ti ) − y ( ti ) ‖22 . ( 4 ) The gradient of Ldata w.r.t . θ is evaluated using the adjoint method as shown in [ 7 ] . Generative Adversarial Networks One of the tasks that we consider is learning distributions of physical fields . For that purpose we utilize generative adversarial networks ( GANs ) . A GAN is a generative model consisting of a generator and a discriminator [ 12 ] . The generator , G , learns to transform a random variable Z ∼ pZ over a latent space Z to the data space Y in such a way that the discriminator , D , can not tell the difference between samples generated by G and samples from the data distribution pdata . Both , G and D are learned by solving the following minimax problem min G max D V ( G , D ) = EY∼pdata [ logD ( Y ) ] + EZ∼pZ [ log ( 1−D ( G ( Z ) ) ) ] . ( 5 ) Solution of this problem exists and is unique with the optimal generator perfectly mimicking the data distribution [ 12 ] . 3 METHODS . In this section we presents an approach to evaluating pointwise , differential and integral constraints on unstructured grids . Then , we demonstrate how this approach can be used to enforce arbitrary soft and linear hard constraints . 3.1 EVALUATING CONSTRAINTS ON UNSTRUCTURED GRIDS . We assume the data y ( t ) is available at observation points ( x1 , . . . , xN ) and time points ( t1 , . . . , tM ) and that a model makes predictions u ( t ) at these points . We assume the predictions to be evaluations of an unknown underlying function . Since the underlying function is unknown , we can not impose constraints on it directly . Instead , we approximate it by an interpolant uf ( t , x ) and impose constraints on uf ( t , x ) ( Figure 1 ) . The approximation is constructed from u ( t ) by placing a basis function at each xi and representing uf ( t , x ) as uf ( t , x ) = N∑ j=1 αj ( t ) φj ( x ) , ( 6 ) where φj is a scalar basis function at xj and αj ∈ Rp . The coefficients αj ( t ) are obtained from u ( t ) ( see Section 3.4 ) . Next , we show how to evaluate constraints on uf ( t , x ) using basic building blocks . To avoid cluttered notation , we consider equality constraints and assume u ( t , x ) , x ∈ R. Generalization to inequality constraints , vector fields and higher spatial dimensions is straightforward . Pointwise constraints . Consider points z = ( z1 , . . . , zK ) in Ω on which a pointwise constraint h ( uf ( t , zi ) ) = 0 should be evaluated . Assume the function h : R→ R is representable in terms of a finite number of functions γm ( uf ( t , zi ) ) : R → R indexed by m. For example , should the constraint be h ( uf ) = 3uf + u2f = 0 , then we would define γ1 ( uf ) = uf , γ2 ( uf ) = u2f and h ( uf ) = 3 · γ1 ( uf ) + γ2 ( uf ) = 0 . Then , h can be evaluated by evaluating each γm as γm ( uf ( t , zi ) ) = γm N∑ j=1 αj ( t ) φj ( zi ) = γm ( Φi , ·α ( t ) ) , ( 7 ) where α ( t ) = ( α1 ( t ) , . . . , αN ( t ) ) T , Φ is K-by-N matrix with elements Φi , j = φj ( zi ) , and Φi , · is the i ’ th row of Φ . Differential constraints . Consider the same setup as before but now h ( uf ( t , zi ) ) = 0 consists of differential operators and is representable in terms of a finite number of functions ∂ qγm ( uf ( t , zi ) ) ∂zqi : R→ R indexed bym , where the derivative order q could be different for eachm . For example , should the constraint be h ( uf ) = 3uf + uf · ∂u2f ∂x = 0 , then we would define γ1 ( uf ) = uf , γ2 ( uf ) = u 2 f and h ( uf ) = 3 · γ1 ( uf ) + γ1 ( uf ) · ∂γ2 ( uf ) ∂z = 0 . Then , h can be evaluated by evaluating each ∂qγm ( uf ( t , zi ) ) ∂zqi using the generalization of the chain rule ( Appendix A ) which contains only two types of terms . The first type of terms dγmduf , . . . , dqγm duqf can be evaluated using automatic differentiation while the second type of terms ∂uf∂zi , . . . , ∂quf ∂zqi can be evaluated as ∂quf ∂zqi = N∑ j=1 αj ( t ) ∂qφj ( zi ) ∂zqi = Φ ( q ) i , · α ( t ) , ( 8 ) where Φ ( q ) i , j = ∂qφj ( zi ) ∂zqi . Mixed partial derivatives can be handled in a similar way ( Appendix A ) . Integral constraints . Consider the same setup as before but with h ( uf ( t , x ) ) =∫ Ω τ ( uf ( t , x ) ) dx = 0 , where the function τ : R → R is representable in terms of functions γm ( uf ( t , zi ) ) : R→ R similarly to the pointwise constraints . Then , ∫ Ω τ ( uf ( t , x ) ) dx can be evalu- ated using a numerical integration technique , e.g . midpoint rule , Gaussian quadrature or Monte-Carlo integration , as ∫ Ω τ ( uf ( t , x ) ) dx ≈ K∑ i=1 τ ( uf ( t , zi ) ) µi , ( 9 ) where K is the number of integration points , µi are integration coefficients which depend on the grid and integration method , and τ ( uf ( t , zi ) ) is evaluated as in Equation 7 .
The paper proposes a two-folded method to enforce constraints of different natures (differential, integrals….) on a statistical model learned from physical data. The constraints are not enforced directly on the model but rather on “interpolant” functions that aims at completing the original model in between the observed grid points.
SP:b3aff23abb861090b004f9d33436b69961421cf9
Enforcing physics-based algebraic constraints for inference of PDE models on unstructured grids
1 INTRODUCTION . Multiple works have shown the capability of neural networks to solve complex physical problems and learn the behavior of physical systems from data . Examples include learning and solving ordinary differential equations ( ODEs ) [ 6 ] , partial differential equations ( PDEs ) [ 28 ; 20 ] and rigid body dynamics [ 31 ; 5 ] . Purely data-driven models are typically not forced to satisfy physical constraints of the system that generated the data . This might lead to unrealistic predictions that violate some known properties of the underlying physical system . Incorporation of relevant constraints allows to make a better use of the available data and makes predictions more physically plausible . The field dealing with physics-constrained learning is diverse and offers many approaches to adding constraints to models . We refer the reader to many reviews for details [ 30 ; 3 ; 36 ; 19 ] . The approach we consider in this work is based on forcing a model to satisfy algebraic constraints represented by a set of equalities and inequalities . This is the most commonly used approach which allows to represent a wide range of constraints and has been shown to work well in many cases [ 18 ; 17 ; 25 ] . However , while many constraints can be represented algebraically , it is not always clear how to evaluate and enforce them . Currently available approaches to enforcing algebraic constraints are limited to uniform grids and have a very narrow range of constraints they can enforce ( e.g . only pointwise , or specific differential constraints ) , see Section 5 for details of related work . Such approaches can be readily applied to models based on convolutional neural networks ( CNNs ) but can not be extended to recently developed models based on graph neural networks ( GNNs ) [ 33 ; 27 ; 15 ] and other models working on unstructured grids . We propose a much more general method which allows to enforce pointwise , differential and integral constraints on unstructured spatial grids and demonstrate its applicability in learning of PDE-driven dynamical systems and distributions of physical fields . The method is based on using a models ’ s output at the nodes of a grid to construct an interpolant and applying constraints directly to that interpolant ( Section 3 ) . Code and data will be made publicly available . 2 BACKGROUND . PDE-driven dynamical systems . Many physical systems can be described in terms of PDEs . Such systems are defined on a bounded domain on which they evolve over time . We consider continuous dynamical systems with state u ( t , x ) ∈ Rp that evolves over time t ∈ R≥0 and spatial locations x ∈ Ω ⊂ RD . For physical systems , D is typically limited to { 1 , 2 , 3 } although our method will work with any value of D. We assume the system is governed by an unknown PDE ∂u ( t , x ) ∂t = F ( x , u ( t , x ) , ∇xu ( t , x ) , ∇2xu ( t , x ) , ... ) ( 1 ) which describes the temporal evolution of the system in terms of the locations x , state u and its first and higher-order partial derivatives w.r.t . x . The goal of a data-driven PDE model is to learn the dynamics F from data . Data for learning F is collected by measuring the state of the system at observation locations ( x1 , . . . , xN ) over increasing time points ( t0 , . . . , tM ) . This results in a dataset ( y ( t0 ) , . . . , y ( tM ) ) , where y ( ti ) = ( u ( ti , x1 ) , . . . , u ( ti , xN ) ) is a collection of observations . The dataset is used to train the model to predict ( y ( t1 ) , . . . , y ( tM ) ) starting from the initial state y ( t0 ) . Training is typically done by minimizing an average loss between the model ’ s predictions u ( t ) and the data y ( t ) . PDE models differ in restrictions they impose on time points ( temporal grid ) and observation locations ( spatial grid ) . Some models require both grids to be uniform [ 23 ] , other models relax these requirements and allow arbitrary spatial [ 27 ] and spatio-temporal grids [ 15 ] . We build our algebraic constraints method using the model from [ 15 ] as the most general one . The model is based on application of the method of lines [ 32 ] to Equation 1 which results into a system of ODEs u̇ ( t ) : = du ( t , x1 ) dt ... du ( t , xN ) dt ≈ Fθ ( x1 , xN ( 1 ) , u1 , uN ( 1 ) ) ... Fθ ( xN , xN ( N ) , uN , uN ( N ) ) ( 2 ) which approximates the solution of Equation 1 at the observation locations xi using their neighboring points N ( i ) , where xN ( i ) and uN ( i ) are the neighbors ’ positions and states respectively , and ui is u ( t , xi ) . The approximate solution converges to the true solution as N increases . The true dynamics F is approximated by a parametric model Fθ whose parameters θ are learned by minimizing the difference between the model ’ s predictions u ( t ) = u ( 0 ) + ∫ t 0 u̇ ( τ ) dτ ( 3 ) and the data y ( t ) . The integral in Equation 3 is solved using a numerical ODE solver . In [ 15 ] , the function Fθ was represented by a graph neural network ( GNN ) which takes states and locations at an observation point i and its neighboring points N ( i ) . The observation points are connected into a grid using Delaunay triangulation which allows to naturally defineN ( i ) as a set of points connected to the point i . However , Fθ can be represented by other models and a different neighbor selection criterion can be used . The model parameters θ are learned by minimizing the MSE between y ( t ) and u ( t ) Ldata = 1 M M∑ i=1 ‖u ( ti ) − y ( ti ) ‖22 . ( 4 ) The gradient of Ldata w.r.t . θ is evaluated using the adjoint method as shown in [ 7 ] . Generative Adversarial Networks One of the tasks that we consider is learning distributions of physical fields . For that purpose we utilize generative adversarial networks ( GANs ) . A GAN is a generative model consisting of a generator and a discriminator [ 12 ] . The generator , G , learns to transform a random variable Z ∼ pZ over a latent space Z to the data space Y in such a way that the discriminator , D , can not tell the difference between samples generated by G and samples from the data distribution pdata . Both , G and D are learned by solving the following minimax problem min G max D V ( G , D ) = EY∼pdata [ logD ( Y ) ] + EZ∼pZ [ log ( 1−D ( G ( Z ) ) ) ] . ( 5 ) Solution of this problem exists and is unique with the optimal generator perfectly mimicking the data distribution [ 12 ] . 3 METHODS . In this section we presents an approach to evaluating pointwise , differential and integral constraints on unstructured grids . Then , we demonstrate how this approach can be used to enforce arbitrary soft and linear hard constraints . 3.1 EVALUATING CONSTRAINTS ON UNSTRUCTURED GRIDS . We assume the data y ( t ) is available at observation points ( x1 , . . . , xN ) and time points ( t1 , . . . , tM ) and that a model makes predictions u ( t ) at these points . We assume the predictions to be evaluations of an unknown underlying function . Since the underlying function is unknown , we can not impose constraints on it directly . Instead , we approximate it by an interpolant uf ( t , x ) and impose constraints on uf ( t , x ) ( Figure 1 ) . The approximation is constructed from u ( t ) by placing a basis function at each xi and representing uf ( t , x ) as uf ( t , x ) = N∑ j=1 αj ( t ) φj ( x ) , ( 6 ) where φj is a scalar basis function at xj and αj ∈ Rp . The coefficients αj ( t ) are obtained from u ( t ) ( see Section 3.4 ) . Next , we show how to evaluate constraints on uf ( t , x ) using basic building blocks . To avoid cluttered notation , we consider equality constraints and assume u ( t , x ) , x ∈ R. Generalization to inequality constraints , vector fields and higher spatial dimensions is straightforward . Pointwise constraints . Consider points z = ( z1 , . . . , zK ) in Ω on which a pointwise constraint h ( uf ( t , zi ) ) = 0 should be evaluated . Assume the function h : R→ R is representable in terms of a finite number of functions γm ( uf ( t , zi ) ) : R → R indexed by m. For example , should the constraint be h ( uf ) = 3uf + u2f = 0 , then we would define γ1 ( uf ) = uf , γ2 ( uf ) = u2f and h ( uf ) = 3 · γ1 ( uf ) + γ2 ( uf ) = 0 . Then , h can be evaluated by evaluating each γm as γm ( uf ( t , zi ) ) = γm N∑ j=1 αj ( t ) φj ( zi ) = γm ( Φi , ·α ( t ) ) , ( 7 ) where α ( t ) = ( α1 ( t ) , . . . , αN ( t ) ) T , Φ is K-by-N matrix with elements Φi , j = φj ( zi ) , and Φi , · is the i ’ th row of Φ . Differential constraints . Consider the same setup as before but now h ( uf ( t , zi ) ) = 0 consists of differential operators and is representable in terms of a finite number of functions ∂ qγm ( uf ( t , zi ) ) ∂zqi : R→ R indexed bym , where the derivative order q could be different for eachm . For example , should the constraint be h ( uf ) = 3uf + uf · ∂u2f ∂x = 0 , then we would define γ1 ( uf ) = uf , γ2 ( uf ) = u 2 f and h ( uf ) = 3 · γ1 ( uf ) + γ1 ( uf ) · ∂γ2 ( uf ) ∂z = 0 . Then , h can be evaluated by evaluating each ∂qγm ( uf ( t , zi ) ) ∂zqi using the generalization of the chain rule ( Appendix A ) which contains only two types of terms . The first type of terms dγmduf , . . . , dqγm duqf can be evaluated using automatic differentiation while the second type of terms ∂uf∂zi , . . . , ∂quf ∂zqi can be evaluated as ∂quf ∂zqi = N∑ j=1 αj ( t ) ∂qφj ( zi ) ∂zqi = Φ ( q ) i , · α ( t ) , ( 8 ) where Φ ( q ) i , j = ∂qφj ( zi ) ∂zqi . Mixed partial derivatives can be handled in a similar way ( Appendix A ) . Integral constraints . Consider the same setup as before but with h ( uf ( t , x ) ) =∫ Ω τ ( uf ( t , x ) ) dx = 0 , where the function τ : R → R is representable in terms of functions γm ( uf ( t , zi ) ) : R→ R similarly to the pointwise constraints . Then , ∫ Ω τ ( uf ( t , x ) ) dx can be evalu- ated using a numerical integration technique , e.g . midpoint rule , Gaussian quadrature or Monte-Carlo integration , as ∫ Ω τ ( uf ( t , x ) ) dx ≈ K∑ i=1 τ ( uf ( t , zi ) ) µi , ( 9 ) where K is the number of integration points , µi are integration coefficients which depend on the grid and integration method , and τ ( uf ( t , zi ) ) is evaluated as in Equation 7 .
This paper proposes a method to enforce physical constraints in deep learning models. It provides a nice summary of local, differential and integral constraints, and frames them in a Lagrangian setting. For a reason which I could not clearly follow, the paper focuses on GAN early on. This is intuitive to me, as the physical constraints could nicely stand on their own.
SP:b3aff23abb861090b004f9d33436b69961421cf9
TRAIL: Near-Optimal Imitation Learning with Suboptimal Data
1 INTRODUCTION . Imitation learning uses expert demonstration data to learn sequential decision making policies ( Schaal , 1999 ) . Such demonstrations , often produced by human experts , can be costly to obtain in large number . On the other hand , practical application domains , such as recommendation ( Afsar et al. , 2021 ) and dialogue ( Jiang et al. , 2021 ) systems , provide large quantities of offline data generated by suboptimal agents . Since the offline data is suboptimal in performance , using it directly for imitation learning is infeasible . While some prior works have proposed using suboptimal offline data for offline reinforcement learning ( RL ) ( Kumar et al. , 2019 ; Wu et al. , 2019 ; Levine et al. , 2020 ) , this would require reward information , which may be unavailable or infeasible to compute from suboptimal data ( Abbeel & Ng , 2004 ) . Nevertheless , conceptually , suboptimal offline datasets should contain useful information about the environment , if only we could distill that information into a useful form that can aid downstream imitation learning . One approach to leveraging suboptimal offline datasets is to use the offline data to extract a lowerdimensional latent action space , and then perform imitation learning on an expert dataset using this latent action space . If the latent action space is learned properly , one may hope that performing imitation learning in the latent space can reduce the need for large quantities of expert data . While a number of prior works have studied similar approaches in the context of hierarchical imitation and RL setting ( Parr & Russell , 1998 ; Dietterich et al. , 1998 ; Sutton et al. , 1999 ; Kulkarni et al. , 2016 ; Vezhnevets et al. , 2017 ; Nachum et al. , 2018a ; Ajay et al. , 2020 ; Pertsch et al. , 2020 ; Hakhamaneshi et al. , 2021 ) , such methods typically focus on the theoretical and practical benefits of temporal abstraction by extracting temporally extended skills from data or experience . That is , the main benefit of these approaches is that the latent action space operates at a lower temporal frequency than the original environment action space . We instead focus directly on the question of action representation : instead of learning skills that provide for temporal abstraction , we aim to directly reparameterize the action space in a way that provides for more sample-efficient downstream imitation without the need to reduce control frequency . Unlike learning temporal abstractions , action reparamtrization does not have to rely on any hierarchical structures in the offline data , and can therefore utilize highly suboptimal datasets ( e.g. , with random actions ) . Aiming for a provably-efficient approach to utilizing highly suboptimal offline datasets , we use first principles to derive an upper bound on the quality of an imitation learned policy involving three terms corresponding to ( 1 ) action representation and ( 2 ) action decoder learning on a suboptimal offline dataset , and finally , ( 3 ) behavioral cloning ( i.e. , max-likelihood learning of latent actions ) on an expert demonstration dataset . The first term in our bound immediately suggests a practical offline training objective based on a transition dynamics loss using an factored transition model . We show that under specific factorizations ( e.g. , low-dimensional or linear ) , one can guarantee improved sample efficiency on the expert dataset . Crucially , our mathematical results avoid the potential shortcomings of temporal skill extraction , as our bound is guaranteed to hold even when there is no temporal abstraction in the latent action space . We translate these mathematical results into an algorithm that we call Transition-Reparametrized Actions for Imitation Learning ( TRAIL ) . As shown in Figure 1 , TRAIL consists of a pretraining stage ( corresponding to the first two terms in our bound ) and a downstream imitation learning stage ( corresponding to the last term in our bound ) . During the pretraining stage , TRAIL uses an offline dataset to learn a factored transition model and a paired action decoder . During the downstream imitation learning stage , TRAIL first reparametrizes expert actions into the latent action space according to the learned transition model , and then learns a latent policy via behavioral cloning in the latent action space . During inference , TRAIL uses the imitation learned latent policy and action decoder in conjunction to act in the environment . In practice , TRAIL parametrizes the transition model as an energy-based model ( EBM ) for flexibility and trains the EBM with a contrastive loss . The EBM enables the low-dimensional factored transition model referenced by our theory , and we also show that one can recover the linear transition model in our theory by approximating the EBM with random Fourier features ( Rahimi et al. , 2007 ) . To summarize , our contributions include ( i ) a provably beneficial objective for learning action representations without temporal abstraction and ( ii ) a practical algorithm for optimizing the proposed objective by learning an EBM or linear transition model . An extensive evaluation on a set of navigation and locomotion tasks demonstrates the effectiveness of the proposed objective . TRAIL ’ s empirical success compared to a variety of existing methods suggests that the benefit of learning single-step action representations has been overlooked by previous temporal skill extraction methods . Additionally , TRAIL significantly improves behavioral cloning even when the offline dataset is unimodal or highly suboptimal ( e.g. , obtained from a random policy ) , whereas temporal skill extraction methods lead to degraded performance in these scenarios . Lastly , we show that TRAIL , without using reward labels , can perform similarly or better than offline reinforcement learning ( RL ) with orders of magnitude less expert data , suggesting new ways for offline learning of squential decision making policies . 2 RELATED WORK . Learning action abstractions is a long standing topic in the hierarchical RL literature ( Parr & Russell , 1998 ; Dietterich et al. , 1998 ; Sutton et al. , 1999 ; Kulkarni et al. , 2016 ; Nachum et al. , 2018a ) . A large body of work focusing on online skill discovery have been proposed as a means to improve exploration and sample complexity in online RL . For instance , Eysenbach et al . ( 2018 ) ; Sharma et al . ( 2019 ) ; Gregor et al . ( 2016 ) ; Warde-Farley et al . ( 2018 ) ; Liu et al . ( 2021 ) propose to learn a diverse set of skills by maximizing an information theoretic objective . Online skill discovery is also commonly seen in a hierarchical framework that learns a continuous space ( Vezhnevets et al. , 2017 ; Hausman et al. , 2018 ; Nachum et al. , 2018a ; 2019 ) or a discrete set of lower-level policies ( Bacon et al. , 2017 ; Stolle & Precup , 2002 ; Peng et al. , 2019 ) , upon which higher-level policies are trained to solve specific tasks . Different from these works , we focus on learning action representations offline from a fixed suboptimal dataset to accelerate imitation learning . Aside from online skill discovery , offline skill extraction focuses on learning temporally extended action abstractions from a fixed offline dataset . Methods for offline skill extraction generally involve maximum likelihood training of some latent variable models on the offline data , followed by downstream planning ( Lynch et al. , 2020 ) , imitation learning ( Kipf et al. , 2019 ; Ajay et al. , 2020 ; Hakhamaneshi et al. , 2021 ) , offline RL ( Ajay et al. , 2020 ; Zhou et al. , 2020 ) , or online RL ( Fox et al. , 2017 ; Krishnan et al. , 2017 ; Shankar & Gupta , 2020 ; Shankar et al. , 2019 ; Singh et al. , 2020 ; Pertsch et al. , 2020 ; 2021 ; Wang et al. , 2021 ) in the induced latent action space . Among these works , those that provide a theoretical analysis attribute the benefit of skill extraction predominantly to increased temporal abstraction as opposed to the learned action space being any “ easier ” to learn from than the raw action space ( Ajay et al. , 2020 ; Nachum et al. , 2018b ) . Unlike these methods , our analysis focuses on the advantage of a lower-dimensional reparametrized action space agnostic to temporal abstraction . Our method also applies to offline data that is highly suboptimal ( e.g. , contains random actions ) and potentially unimodal ( e.g. , without diverse skills to be extracted ) , which have been considered challenging by previous work ( Ajay et al. , 2020 ) . While we focus on reducing the complexity of the action space through the lens of action representation learning , there exists a disjoint set of work that focuses on accelerating RL with state representation learning ( Singh et al. , 1995 ; Ren & Krogh , 2002 ; Castro & Precup , 2010 ; Gelada et al. , 2019 ; Zhang et al. , 2020 ; Arora et al. , 2020 ; Nachum & Yang , 2021 ) , some of which have proposed to extract a latent state space from a learned dynamics model . Analogous to our own derivations , these works attribute the benefit of representation learning to a smaller latent state space reduced from a high-dimensional input state space ( e.g. , images ) . Lastly , there exist model-based approaches that utilizes offline data to learn model dynamics which in tern accelerates imitation ( Chang et al. , 2021 ; Rafailov et al. , 2021 ) . These work differ from our focus of using the offline data to learn latent action space . 3 PRELIMINARIES . In this section , we introduce the problem statements for imitation learning and learning-based control , and define relevant notations . Markov decision process . Consider an MDP ( Puterman , 1994 ) M : = 〈S , A , R , T , µ , γ〉 , consisting of a state space S , an action spaceA , a reward functionR : S×A→ R , a transition function T : S × A → ∆ ( S ) 1 , an initial state distribution µ ∈ ∆ ( S ) , and a discount factor γ ∈ [ 0 , 1 ) A policy π : S → ∆ ( A ) interacts with the environment starting at an initial state s0 ∼ µ . An action at ∼ π ( st ) is sampled and applied to the environment at each step t ≥ 0 . The environment produces a scalar reward R ( st , at ) and transitions into the next state st+1 ∼ T ( st , at ) . Note that we are specifically interested in the imitation learning setting , where the rewards produced by R are unobserved by the learner . The state visitation distribution dπ ( s ) induced by a policy π is defined as dπ ( s ) : = ( 1− γ ) ∑∞ t=0 γ t · Pr [ st = s|π , M ] . We relax the notation and use ( s , a ) ∼ dπ to denote s ∼ dπ , a ∼ π ( s ) . Learning goal . Imitation learning aims to recover an expert policy π∗ with access to only a fixed set of samples from the expert : Dπ∗ = { ( si , ai ) } ni=1 with si ∼ dπ∗ and ai ∼ π∗ ( si ) . One approach to imitation learning is to learn a policy π that minimizes some discrepancy between π and π∗ . In our analysis , we will use the total variation ( TV ) divergence in state visitation distributions , Diff ( π , π∗ ) = DTV ( d π‖dπ∗ ) , as the way to measure the discrepancy between π and π∗ . Our bounds can be easily modified to apply to other divergence measures such as the Kullback–Leibler ( KL ) divergence or difference in expected future returns . Behavioral cloning ( BC ) ( Pomerleau , 1989 ) solves the imitation learning problem by learning π from Dπ∗ via a maximum likelihood objective JBC ( π ) : = E ( s , a ) ∼ ( dπ∗ , π∗ ) [ − log π ( a|s ) ] , which optimizes an upper bound of Diff ( π , π∗ ) defined above ( Ross & Bagnell , 2010 ; Nachum & Yang , 2021 ) : Diff ( π , π∗ ) ≤ γ 1− γ √ 1 2 Edπ∗ [ DKL ( π∗ ( s ) ‖π ( s ) ) ] = γ 1− γ √ const ( π∗ ) + 1 2 JBC ( π ) . 1∆ ( X ) denotes the simplex over a set X . BC with suboptimal offline data . The standard BC objective ( i.e. , direct max-likelihood on Dπ∗ ) can struggle to attain good performance when the amount of expert demonstrations is limited ( Ross et al. , 2011 ; Tu et al. , 2021 ) . We assume access to an additional suboptimal offline dataset Doff = { ( si , ai , s′i ) } mi=1 , where the suboptimality is a result of ( i ) suboptimal action samples ai ∼ UnifA and ( ii ) lack of reward labels . We use ( s , a , s′ ) ∼ doff as a shorthand for simulating finite sampling from Doff via si ∼ doff , ai ∼ UnifA , s′i ∼ T ( si , ai ) , where doff is an unknown offline state distribution . We assume doff sufficiently covers the expert distribution ; i.e. , dπ∗ ( s ) > 0 ⇒ doff ( s ) > 0 for all s ∈ S. The uniform sampling of actions in Doff is largely for mathematical convenience , and in theory can be replaced with any distribution uniformly bounded from below by η > 0 , and our derived bounds will be scaled by 1|A|η as a result . This works focuses on how to utilize such a suboptimal Doff to provably accelerate BC .
The paper considers an imitation learning (IL) problem with both expert and suboptimal demonstrations. The paper claims that sub-optimal demonstrations can be used to learn latent action abstractions which can improve the efficiency of down-stream IL. To solve this problem, the paper proposes TRAIL, which pre-trains an action encoder-decoder and a latent transition model using sub-optimal data, and performs behavioral cloning (BC) with expert data to learn a policy in the latent action space. The paper derives error bounds showing that the pre-training step and the down-stream BC step contribute to solving an IL problem in the original space from the view of divergence minimization. The paper also derives a bound showing that an optimal action abstraction may improve the sample complexity of BC. Experiments indicate that TRAIL effectively learns from a limited number of expert demonstrations and is robust to the sub-optimality of sub-optimal demonstrations. Main contributions: An effective method to learn an expert policy from few expert data and a large set of sub-optimal data. The method is theoretically justified and empirically well-supported.
SP:5d92df04ac10df3f758eb86ec74fdca197fa25a3
TRAIL: Near-Optimal Imitation Learning with Suboptimal Data
1 INTRODUCTION . Imitation learning uses expert demonstration data to learn sequential decision making policies ( Schaal , 1999 ) . Such demonstrations , often produced by human experts , can be costly to obtain in large number . On the other hand , practical application domains , such as recommendation ( Afsar et al. , 2021 ) and dialogue ( Jiang et al. , 2021 ) systems , provide large quantities of offline data generated by suboptimal agents . Since the offline data is suboptimal in performance , using it directly for imitation learning is infeasible . While some prior works have proposed using suboptimal offline data for offline reinforcement learning ( RL ) ( Kumar et al. , 2019 ; Wu et al. , 2019 ; Levine et al. , 2020 ) , this would require reward information , which may be unavailable or infeasible to compute from suboptimal data ( Abbeel & Ng , 2004 ) . Nevertheless , conceptually , suboptimal offline datasets should contain useful information about the environment , if only we could distill that information into a useful form that can aid downstream imitation learning . One approach to leveraging suboptimal offline datasets is to use the offline data to extract a lowerdimensional latent action space , and then perform imitation learning on an expert dataset using this latent action space . If the latent action space is learned properly , one may hope that performing imitation learning in the latent space can reduce the need for large quantities of expert data . While a number of prior works have studied similar approaches in the context of hierarchical imitation and RL setting ( Parr & Russell , 1998 ; Dietterich et al. , 1998 ; Sutton et al. , 1999 ; Kulkarni et al. , 2016 ; Vezhnevets et al. , 2017 ; Nachum et al. , 2018a ; Ajay et al. , 2020 ; Pertsch et al. , 2020 ; Hakhamaneshi et al. , 2021 ) , such methods typically focus on the theoretical and practical benefits of temporal abstraction by extracting temporally extended skills from data or experience . That is , the main benefit of these approaches is that the latent action space operates at a lower temporal frequency than the original environment action space . We instead focus directly on the question of action representation : instead of learning skills that provide for temporal abstraction , we aim to directly reparameterize the action space in a way that provides for more sample-efficient downstream imitation without the need to reduce control frequency . Unlike learning temporal abstractions , action reparamtrization does not have to rely on any hierarchical structures in the offline data , and can therefore utilize highly suboptimal datasets ( e.g. , with random actions ) . Aiming for a provably-efficient approach to utilizing highly suboptimal offline datasets , we use first principles to derive an upper bound on the quality of an imitation learned policy involving three terms corresponding to ( 1 ) action representation and ( 2 ) action decoder learning on a suboptimal offline dataset , and finally , ( 3 ) behavioral cloning ( i.e. , max-likelihood learning of latent actions ) on an expert demonstration dataset . The first term in our bound immediately suggests a practical offline training objective based on a transition dynamics loss using an factored transition model . We show that under specific factorizations ( e.g. , low-dimensional or linear ) , one can guarantee improved sample efficiency on the expert dataset . Crucially , our mathematical results avoid the potential shortcomings of temporal skill extraction , as our bound is guaranteed to hold even when there is no temporal abstraction in the latent action space . We translate these mathematical results into an algorithm that we call Transition-Reparametrized Actions for Imitation Learning ( TRAIL ) . As shown in Figure 1 , TRAIL consists of a pretraining stage ( corresponding to the first two terms in our bound ) and a downstream imitation learning stage ( corresponding to the last term in our bound ) . During the pretraining stage , TRAIL uses an offline dataset to learn a factored transition model and a paired action decoder . During the downstream imitation learning stage , TRAIL first reparametrizes expert actions into the latent action space according to the learned transition model , and then learns a latent policy via behavioral cloning in the latent action space . During inference , TRAIL uses the imitation learned latent policy and action decoder in conjunction to act in the environment . In practice , TRAIL parametrizes the transition model as an energy-based model ( EBM ) for flexibility and trains the EBM with a contrastive loss . The EBM enables the low-dimensional factored transition model referenced by our theory , and we also show that one can recover the linear transition model in our theory by approximating the EBM with random Fourier features ( Rahimi et al. , 2007 ) . To summarize , our contributions include ( i ) a provably beneficial objective for learning action representations without temporal abstraction and ( ii ) a practical algorithm for optimizing the proposed objective by learning an EBM or linear transition model . An extensive evaluation on a set of navigation and locomotion tasks demonstrates the effectiveness of the proposed objective . TRAIL ’ s empirical success compared to a variety of existing methods suggests that the benefit of learning single-step action representations has been overlooked by previous temporal skill extraction methods . Additionally , TRAIL significantly improves behavioral cloning even when the offline dataset is unimodal or highly suboptimal ( e.g. , obtained from a random policy ) , whereas temporal skill extraction methods lead to degraded performance in these scenarios . Lastly , we show that TRAIL , without using reward labels , can perform similarly or better than offline reinforcement learning ( RL ) with orders of magnitude less expert data , suggesting new ways for offline learning of squential decision making policies . 2 RELATED WORK . Learning action abstractions is a long standing topic in the hierarchical RL literature ( Parr & Russell , 1998 ; Dietterich et al. , 1998 ; Sutton et al. , 1999 ; Kulkarni et al. , 2016 ; Nachum et al. , 2018a ) . A large body of work focusing on online skill discovery have been proposed as a means to improve exploration and sample complexity in online RL . For instance , Eysenbach et al . ( 2018 ) ; Sharma et al . ( 2019 ) ; Gregor et al . ( 2016 ) ; Warde-Farley et al . ( 2018 ) ; Liu et al . ( 2021 ) propose to learn a diverse set of skills by maximizing an information theoretic objective . Online skill discovery is also commonly seen in a hierarchical framework that learns a continuous space ( Vezhnevets et al. , 2017 ; Hausman et al. , 2018 ; Nachum et al. , 2018a ; 2019 ) or a discrete set of lower-level policies ( Bacon et al. , 2017 ; Stolle & Precup , 2002 ; Peng et al. , 2019 ) , upon which higher-level policies are trained to solve specific tasks . Different from these works , we focus on learning action representations offline from a fixed suboptimal dataset to accelerate imitation learning . Aside from online skill discovery , offline skill extraction focuses on learning temporally extended action abstractions from a fixed offline dataset . Methods for offline skill extraction generally involve maximum likelihood training of some latent variable models on the offline data , followed by downstream planning ( Lynch et al. , 2020 ) , imitation learning ( Kipf et al. , 2019 ; Ajay et al. , 2020 ; Hakhamaneshi et al. , 2021 ) , offline RL ( Ajay et al. , 2020 ; Zhou et al. , 2020 ) , or online RL ( Fox et al. , 2017 ; Krishnan et al. , 2017 ; Shankar & Gupta , 2020 ; Shankar et al. , 2019 ; Singh et al. , 2020 ; Pertsch et al. , 2020 ; 2021 ; Wang et al. , 2021 ) in the induced latent action space . Among these works , those that provide a theoretical analysis attribute the benefit of skill extraction predominantly to increased temporal abstraction as opposed to the learned action space being any “ easier ” to learn from than the raw action space ( Ajay et al. , 2020 ; Nachum et al. , 2018b ) . Unlike these methods , our analysis focuses on the advantage of a lower-dimensional reparametrized action space agnostic to temporal abstraction . Our method also applies to offline data that is highly suboptimal ( e.g. , contains random actions ) and potentially unimodal ( e.g. , without diverse skills to be extracted ) , which have been considered challenging by previous work ( Ajay et al. , 2020 ) . While we focus on reducing the complexity of the action space through the lens of action representation learning , there exists a disjoint set of work that focuses on accelerating RL with state representation learning ( Singh et al. , 1995 ; Ren & Krogh , 2002 ; Castro & Precup , 2010 ; Gelada et al. , 2019 ; Zhang et al. , 2020 ; Arora et al. , 2020 ; Nachum & Yang , 2021 ) , some of which have proposed to extract a latent state space from a learned dynamics model . Analogous to our own derivations , these works attribute the benefit of representation learning to a smaller latent state space reduced from a high-dimensional input state space ( e.g. , images ) . Lastly , there exist model-based approaches that utilizes offline data to learn model dynamics which in tern accelerates imitation ( Chang et al. , 2021 ; Rafailov et al. , 2021 ) . These work differ from our focus of using the offline data to learn latent action space . 3 PRELIMINARIES . In this section , we introduce the problem statements for imitation learning and learning-based control , and define relevant notations . Markov decision process . Consider an MDP ( Puterman , 1994 ) M : = 〈S , A , R , T , µ , γ〉 , consisting of a state space S , an action spaceA , a reward functionR : S×A→ R , a transition function T : S × A → ∆ ( S ) 1 , an initial state distribution µ ∈ ∆ ( S ) , and a discount factor γ ∈ [ 0 , 1 ) A policy π : S → ∆ ( A ) interacts with the environment starting at an initial state s0 ∼ µ . An action at ∼ π ( st ) is sampled and applied to the environment at each step t ≥ 0 . The environment produces a scalar reward R ( st , at ) and transitions into the next state st+1 ∼ T ( st , at ) . Note that we are specifically interested in the imitation learning setting , where the rewards produced by R are unobserved by the learner . The state visitation distribution dπ ( s ) induced by a policy π is defined as dπ ( s ) : = ( 1− γ ) ∑∞ t=0 γ t · Pr [ st = s|π , M ] . We relax the notation and use ( s , a ) ∼ dπ to denote s ∼ dπ , a ∼ π ( s ) . Learning goal . Imitation learning aims to recover an expert policy π∗ with access to only a fixed set of samples from the expert : Dπ∗ = { ( si , ai ) } ni=1 with si ∼ dπ∗ and ai ∼ π∗ ( si ) . One approach to imitation learning is to learn a policy π that minimizes some discrepancy between π and π∗ . In our analysis , we will use the total variation ( TV ) divergence in state visitation distributions , Diff ( π , π∗ ) = DTV ( d π‖dπ∗ ) , as the way to measure the discrepancy between π and π∗ . Our bounds can be easily modified to apply to other divergence measures such as the Kullback–Leibler ( KL ) divergence or difference in expected future returns . Behavioral cloning ( BC ) ( Pomerleau , 1989 ) solves the imitation learning problem by learning π from Dπ∗ via a maximum likelihood objective JBC ( π ) : = E ( s , a ) ∼ ( dπ∗ , π∗ ) [ − log π ( a|s ) ] , which optimizes an upper bound of Diff ( π , π∗ ) defined above ( Ross & Bagnell , 2010 ; Nachum & Yang , 2021 ) : Diff ( π , π∗ ) ≤ γ 1− γ √ 1 2 Edπ∗ [ DKL ( π∗ ( s ) ‖π ( s ) ) ] = γ 1− γ √ const ( π∗ ) + 1 2 JBC ( π ) . 1∆ ( X ) denotes the simplex over a set X . BC with suboptimal offline data . The standard BC objective ( i.e. , direct max-likelihood on Dπ∗ ) can struggle to attain good performance when the amount of expert demonstrations is limited ( Ross et al. , 2011 ; Tu et al. , 2021 ) . We assume access to an additional suboptimal offline dataset Doff = { ( si , ai , s′i ) } mi=1 , where the suboptimality is a result of ( i ) suboptimal action samples ai ∼ UnifA and ( ii ) lack of reward labels . We use ( s , a , s′ ) ∼ doff as a shorthand for simulating finite sampling from Doff via si ∼ doff , ai ∼ UnifA , s′i ∼ T ( si , ai ) , where doff is an unknown offline state distribution . We assume doff sufficiently covers the expert distribution ; i.e. , dπ∗ ( s ) > 0 ⇒ doff ( s ) > 0 for all s ∈ S. The uniform sampling of actions in Doff is largely for mathematical convenience , and in theory can be replaced with any distribution uniformly bounded from below by η > 0 , and our derived bounds will be scaled by 1|A|η as a result . This works focuses on how to utilize such a suboptimal Doff to provably accelerate BC .
The paper proposes an imitation learning algorithm, TRAIL, that can benefit from a large amount of suboptimal demonstrations besides a small amount of high-quality demonstrations. This is achieved through learning a factored transition model with action reparameterization from the suboptimal or even random demonstrations before doing behavior cloning. The authors analyze the error bound of the algorithm and show improved sample complexity with action reparameterization. Moreover, TRAIL is verified on a set of navigation and locomotion imitation learning tasks and it outperforms baselines based on temporal action abstraction in terms of task success rate.
SP:5d92df04ac10df3f758eb86ec74fdca197fa25a3
TRAIL: Near-Optimal Imitation Learning with Suboptimal Data
1 INTRODUCTION . Imitation learning uses expert demonstration data to learn sequential decision making policies ( Schaal , 1999 ) . Such demonstrations , often produced by human experts , can be costly to obtain in large number . On the other hand , practical application domains , such as recommendation ( Afsar et al. , 2021 ) and dialogue ( Jiang et al. , 2021 ) systems , provide large quantities of offline data generated by suboptimal agents . Since the offline data is suboptimal in performance , using it directly for imitation learning is infeasible . While some prior works have proposed using suboptimal offline data for offline reinforcement learning ( RL ) ( Kumar et al. , 2019 ; Wu et al. , 2019 ; Levine et al. , 2020 ) , this would require reward information , which may be unavailable or infeasible to compute from suboptimal data ( Abbeel & Ng , 2004 ) . Nevertheless , conceptually , suboptimal offline datasets should contain useful information about the environment , if only we could distill that information into a useful form that can aid downstream imitation learning . One approach to leveraging suboptimal offline datasets is to use the offline data to extract a lowerdimensional latent action space , and then perform imitation learning on an expert dataset using this latent action space . If the latent action space is learned properly , one may hope that performing imitation learning in the latent space can reduce the need for large quantities of expert data . While a number of prior works have studied similar approaches in the context of hierarchical imitation and RL setting ( Parr & Russell , 1998 ; Dietterich et al. , 1998 ; Sutton et al. , 1999 ; Kulkarni et al. , 2016 ; Vezhnevets et al. , 2017 ; Nachum et al. , 2018a ; Ajay et al. , 2020 ; Pertsch et al. , 2020 ; Hakhamaneshi et al. , 2021 ) , such methods typically focus on the theoretical and practical benefits of temporal abstraction by extracting temporally extended skills from data or experience . That is , the main benefit of these approaches is that the latent action space operates at a lower temporal frequency than the original environment action space . We instead focus directly on the question of action representation : instead of learning skills that provide for temporal abstraction , we aim to directly reparameterize the action space in a way that provides for more sample-efficient downstream imitation without the need to reduce control frequency . Unlike learning temporal abstractions , action reparamtrization does not have to rely on any hierarchical structures in the offline data , and can therefore utilize highly suboptimal datasets ( e.g. , with random actions ) . Aiming for a provably-efficient approach to utilizing highly suboptimal offline datasets , we use first principles to derive an upper bound on the quality of an imitation learned policy involving three terms corresponding to ( 1 ) action representation and ( 2 ) action decoder learning on a suboptimal offline dataset , and finally , ( 3 ) behavioral cloning ( i.e. , max-likelihood learning of latent actions ) on an expert demonstration dataset . The first term in our bound immediately suggests a practical offline training objective based on a transition dynamics loss using an factored transition model . We show that under specific factorizations ( e.g. , low-dimensional or linear ) , one can guarantee improved sample efficiency on the expert dataset . Crucially , our mathematical results avoid the potential shortcomings of temporal skill extraction , as our bound is guaranteed to hold even when there is no temporal abstraction in the latent action space . We translate these mathematical results into an algorithm that we call Transition-Reparametrized Actions for Imitation Learning ( TRAIL ) . As shown in Figure 1 , TRAIL consists of a pretraining stage ( corresponding to the first two terms in our bound ) and a downstream imitation learning stage ( corresponding to the last term in our bound ) . During the pretraining stage , TRAIL uses an offline dataset to learn a factored transition model and a paired action decoder . During the downstream imitation learning stage , TRAIL first reparametrizes expert actions into the latent action space according to the learned transition model , and then learns a latent policy via behavioral cloning in the latent action space . During inference , TRAIL uses the imitation learned latent policy and action decoder in conjunction to act in the environment . In practice , TRAIL parametrizes the transition model as an energy-based model ( EBM ) for flexibility and trains the EBM with a contrastive loss . The EBM enables the low-dimensional factored transition model referenced by our theory , and we also show that one can recover the linear transition model in our theory by approximating the EBM with random Fourier features ( Rahimi et al. , 2007 ) . To summarize , our contributions include ( i ) a provably beneficial objective for learning action representations without temporal abstraction and ( ii ) a practical algorithm for optimizing the proposed objective by learning an EBM or linear transition model . An extensive evaluation on a set of navigation and locomotion tasks demonstrates the effectiveness of the proposed objective . TRAIL ’ s empirical success compared to a variety of existing methods suggests that the benefit of learning single-step action representations has been overlooked by previous temporal skill extraction methods . Additionally , TRAIL significantly improves behavioral cloning even when the offline dataset is unimodal or highly suboptimal ( e.g. , obtained from a random policy ) , whereas temporal skill extraction methods lead to degraded performance in these scenarios . Lastly , we show that TRAIL , without using reward labels , can perform similarly or better than offline reinforcement learning ( RL ) with orders of magnitude less expert data , suggesting new ways for offline learning of squential decision making policies . 2 RELATED WORK . Learning action abstractions is a long standing topic in the hierarchical RL literature ( Parr & Russell , 1998 ; Dietterich et al. , 1998 ; Sutton et al. , 1999 ; Kulkarni et al. , 2016 ; Nachum et al. , 2018a ) . A large body of work focusing on online skill discovery have been proposed as a means to improve exploration and sample complexity in online RL . For instance , Eysenbach et al . ( 2018 ) ; Sharma et al . ( 2019 ) ; Gregor et al . ( 2016 ) ; Warde-Farley et al . ( 2018 ) ; Liu et al . ( 2021 ) propose to learn a diverse set of skills by maximizing an information theoretic objective . Online skill discovery is also commonly seen in a hierarchical framework that learns a continuous space ( Vezhnevets et al. , 2017 ; Hausman et al. , 2018 ; Nachum et al. , 2018a ; 2019 ) or a discrete set of lower-level policies ( Bacon et al. , 2017 ; Stolle & Precup , 2002 ; Peng et al. , 2019 ) , upon which higher-level policies are trained to solve specific tasks . Different from these works , we focus on learning action representations offline from a fixed suboptimal dataset to accelerate imitation learning . Aside from online skill discovery , offline skill extraction focuses on learning temporally extended action abstractions from a fixed offline dataset . Methods for offline skill extraction generally involve maximum likelihood training of some latent variable models on the offline data , followed by downstream planning ( Lynch et al. , 2020 ) , imitation learning ( Kipf et al. , 2019 ; Ajay et al. , 2020 ; Hakhamaneshi et al. , 2021 ) , offline RL ( Ajay et al. , 2020 ; Zhou et al. , 2020 ) , or online RL ( Fox et al. , 2017 ; Krishnan et al. , 2017 ; Shankar & Gupta , 2020 ; Shankar et al. , 2019 ; Singh et al. , 2020 ; Pertsch et al. , 2020 ; 2021 ; Wang et al. , 2021 ) in the induced latent action space . Among these works , those that provide a theoretical analysis attribute the benefit of skill extraction predominantly to increased temporal abstraction as opposed to the learned action space being any “ easier ” to learn from than the raw action space ( Ajay et al. , 2020 ; Nachum et al. , 2018b ) . Unlike these methods , our analysis focuses on the advantage of a lower-dimensional reparametrized action space agnostic to temporal abstraction . Our method also applies to offline data that is highly suboptimal ( e.g. , contains random actions ) and potentially unimodal ( e.g. , without diverse skills to be extracted ) , which have been considered challenging by previous work ( Ajay et al. , 2020 ) . While we focus on reducing the complexity of the action space through the lens of action representation learning , there exists a disjoint set of work that focuses on accelerating RL with state representation learning ( Singh et al. , 1995 ; Ren & Krogh , 2002 ; Castro & Precup , 2010 ; Gelada et al. , 2019 ; Zhang et al. , 2020 ; Arora et al. , 2020 ; Nachum & Yang , 2021 ) , some of which have proposed to extract a latent state space from a learned dynamics model . Analogous to our own derivations , these works attribute the benefit of representation learning to a smaller latent state space reduced from a high-dimensional input state space ( e.g. , images ) . Lastly , there exist model-based approaches that utilizes offline data to learn model dynamics which in tern accelerates imitation ( Chang et al. , 2021 ; Rafailov et al. , 2021 ) . These work differ from our focus of using the offline data to learn latent action space . 3 PRELIMINARIES . In this section , we introduce the problem statements for imitation learning and learning-based control , and define relevant notations . Markov decision process . Consider an MDP ( Puterman , 1994 ) M : = 〈S , A , R , T , µ , γ〉 , consisting of a state space S , an action spaceA , a reward functionR : S×A→ R , a transition function T : S × A → ∆ ( S ) 1 , an initial state distribution µ ∈ ∆ ( S ) , and a discount factor γ ∈ [ 0 , 1 ) A policy π : S → ∆ ( A ) interacts with the environment starting at an initial state s0 ∼ µ . An action at ∼ π ( st ) is sampled and applied to the environment at each step t ≥ 0 . The environment produces a scalar reward R ( st , at ) and transitions into the next state st+1 ∼ T ( st , at ) . Note that we are specifically interested in the imitation learning setting , where the rewards produced by R are unobserved by the learner . The state visitation distribution dπ ( s ) induced by a policy π is defined as dπ ( s ) : = ( 1− γ ) ∑∞ t=0 γ t · Pr [ st = s|π , M ] . We relax the notation and use ( s , a ) ∼ dπ to denote s ∼ dπ , a ∼ π ( s ) . Learning goal . Imitation learning aims to recover an expert policy π∗ with access to only a fixed set of samples from the expert : Dπ∗ = { ( si , ai ) } ni=1 with si ∼ dπ∗ and ai ∼ π∗ ( si ) . One approach to imitation learning is to learn a policy π that minimizes some discrepancy between π and π∗ . In our analysis , we will use the total variation ( TV ) divergence in state visitation distributions , Diff ( π , π∗ ) = DTV ( d π‖dπ∗ ) , as the way to measure the discrepancy between π and π∗ . Our bounds can be easily modified to apply to other divergence measures such as the Kullback–Leibler ( KL ) divergence or difference in expected future returns . Behavioral cloning ( BC ) ( Pomerleau , 1989 ) solves the imitation learning problem by learning π from Dπ∗ via a maximum likelihood objective JBC ( π ) : = E ( s , a ) ∼ ( dπ∗ , π∗ ) [ − log π ( a|s ) ] , which optimizes an upper bound of Diff ( π , π∗ ) defined above ( Ross & Bagnell , 2010 ; Nachum & Yang , 2021 ) : Diff ( π , π∗ ) ≤ γ 1− γ √ 1 2 Edπ∗ [ DKL ( π∗ ( s ) ‖π ( s ) ) ] = γ 1− γ √ const ( π∗ ) + 1 2 JBC ( π ) . 1∆ ( X ) denotes the simplex over a set X . BC with suboptimal offline data . The standard BC objective ( i.e. , direct max-likelihood on Dπ∗ ) can struggle to attain good performance when the amount of expert demonstrations is limited ( Ross et al. , 2011 ; Tu et al. , 2021 ) . We assume access to an additional suboptimal offline dataset Doff = { ( si , ai , s′i ) } mi=1 , where the suboptimality is a result of ( i ) suboptimal action samples ai ∼ UnifA and ( ii ) lack of reward labels . We use ( s , a , s′ ) ∼ doff as a shorthand for simulating finite sampling from Doff via si ∼ doff , ai ∼ UnifA , s′i ∼ T ( si , ai ) , where doff is an unknown offline state distribution . We assume doff sufficiently covers the expert distribution ; i.e. , dπ∗ ( s ) > 0 ⇒ doff ( s ) > 0 for all s ∈ S. The uniform sampling of actions in Doff is largely for mathematical convenience , and in theory can be replaced with any distribution uniformly bounded from below by η > 0 , and our derived bounds will be scaled by 1|A|η as a result . This works focuses on how to utilize such a suboptimal Doff to provably accelerate BC .
The paper proposes a method to accelerate behavioral cloning (BC) (especially in the low data regime) by utilizing a (much larger) auxiliary dataset of suboptimal behaviors. The authors claim that learning a good latent action representation (in this case, by learning a transition-based action representation from the auxiliary dataset) should make the imitation learning problem easier. The training is divided into two phases: (1) learning a factorized transition model in conjunction with an action embedding and action decoder, (2) learning a latent policy via the BC objective hoping that the transition-based representation accelerates the BC learning.
SP:5d92df04ac10df3f758eb86ec74fdca197fa25a3
Semi-supervised Long-tailed Recognition using Alternate Sampling
1 INTRODUCTION . Large-scale datasets , which contain sufficient data in each class , has been a major factor to the success of modern deep learning models for computer vision tasks , such as object recognition . These datasets are usually carefully curated and balanced to have an uniform data distribution over all classes . This balanced data distribution favors model training but could be impractical in many real world applications , where the frequency of samples from different classes can be imbalanced , leading to a long-tailed data distribution . As shown in Figure 1 ( b ) , several highly populated classes take up most of the labeled samples , and some of the classes only have very few samples during training . The long-tailed recognition problem has been widely studied in the literature . One major challenge in this setting ( Liu et al . ( 2019 ) ; Kang et al . ( 2020 ) ; Zhou et al . ( 2020 ) ) to deep learning model training is the tendency of under-fitting in less-populated classes . The root causes of this underfitting are the imbalanced training data distribution as well as the scarcity of data samples in the tail classes . More specifically , with an imbalanced training data distribution , when several head classes take up most of the training samples , tail classes contribute little in the training loss . The model is such that biased towards head classes . Prior works ( Lin et al . ( 2017 ) ; Cao et al . ( 2019 ) ; Kang et al . ( 2020 ) ; Zhou et al . ( 2020 ) ) tried to mitigate the issue by re-sampling the training data to be a balanced distribution or calibrating the sample weights in calculating the loss . However , still the scarcity of tail class data samples limits the intra-class variations and overall recognition accuracy . Methods focusing on few-shot learning have been introduced to address this problem through data augmentation and data synthesis ( Wang et al . ( 2018 ) ; Hariharan & Girshick ( 2017 ) ; Liu et al . ( 2020 ) ) . In this work , we resort to a different path to leverage massive unlabeled real data in training to help improve the long-tailed recognition accuracy . Since data collection is much cheaper and accessible comparing to data annotation , additional unlabeled real data could readily be available in many realworld scenarios . This semi-supervised learning setting has been intensively studied in the literature ( Laine & Aila ( 2016 ) ; Rasmus et al . ( 2015 ) ; Tarvainen & Valpola ( 2017 ) ; Berthelot et al . ( 2019 ) ; Sohn et al . ( 2020 ) ) . However , as shown in Figure 1 ( a ) , when we carefully look at the data distribution of the widely used benchmarks , we observe well-balanced labeled subset and unlabeled subset . As discussed above , the manually curated balanced distribution , can lead to a gap to real-world scenarios . This is especially true in unlabeled data . Without labels , people have no way to balance the data among classes . In this paper , we propose a more realistic and challenging setting , namely semi-supervised longtailed recognition . As shown in Figure 1 ( c ) , we assume a long-tailed data distribution of the overall dataset and both the labeled and unlabeled subsets of training data follow the same underlying longtailed data distribution . This setting generally resembles a realistic data collection and annotation workflow . After collecting the raw data , one has no knowledge of its class distribution before annotation . As it is expensive to annotate the full corpus , a common practice is to randomly sample a subset for annotation under a given labeling budget . When the raw data follows a long-tailed class distribution , we should expect the same in the labeled subset . While this new recognition paradigm shares the challenges in both semi-supervised learning and long-tailed recognition , there is no readily naive solution to it . Methods in long-tailed recognition rely on class labels to achieve balanced training , which are not available in the unlabeled portion in the semi-supervised long-tailed recognition . Prior semi-supervised methods without considering the long-tailed distribution could fail as well . Taking one of the competitive baseline methods for example , ( Yang & Xu ( 2020 ) ) proposed to firstly train a recognition model with the labeled subset to generate pseudo labels for the unlabeled subset , then the model is fine-tuned with the full training dataset . However , when the labeled subset follows a long-tailed distribution , the pseudo labels are much less accurate for tail classes than head classes . As a result , the overall pseudo labels quality could be too bad to leverage ( See Section 4.4 for results in CIFAR-10-SSLT and ImageNet-SSLT ) . To address the semi-supervised long-tailed recognition problem , we present a method designed specifically for this setting . We bring the successful class-balanced sampling strategy and combined it with model decoupling in an alternate learning framework to overcome the difficulty of balancing unlabeled training data . Inspired by ( Kang et al . ( 2020 ) ) , we decouple the recognition model into a feature embedding and a classifier , and train them with random sampling and class-balanced sampling respectively . As we are targeting at a semi-supervised setting , the classifier is only trained on labeled data to get around the difficulty of applying correctly class-balanced sampling on unlabeled data , aligning with the intuition that the classifier needs more robust supervision than the feature embedding . After that , with the proposed alternative learning framework , we improve model by updating the feature embedding and the classifier iteratively . We assign pseudo labels with the up-to-date classifier and observed gradually improved accuracy of pseudo labels over iterations . The pseudo labels are then incorporated in fine-tuning the feature embedding with a regularization term to limit its potential negative impacts . Similar iterative design has been proposed in semi-supervised learning literature ( Laine & Aila ( 2016 ) ; Tarvainen & Valpola ( 2017 ) ) but important implementation details differ . To summarize , in this paper , 1 ) we resort to semi-supervised learning to help improve long-tailed recognition accuracy and identify practical gap of current semi-supervised recognition datasets due to their well-balanced unlabeled subset ; 2 ) we propose a new recognition paradigm named semisupervised long-tailed recognition better resembling real-world data collection and annotation workflow ; 3 ) we propose a new alternative sampling method to address the semi-supervised long-tailed recognition and demonstrate significant improvements on several benchmarks . 2 RELATED WORK . Long-tailed recognition has been recently studied a lot ( Wang et al . ( 2017 ) ; Oh Song et al . ( 2016 ) ; Lin et al . ( 2017 ) ; Zhang et al . ( 2017 ) ; Liu et al . ( 2019 ) ; Wang & Hebert ( 2016 ) ) . Several approaches have been proposed , including metric learning ( Oh Song et al . ( 2016 ) ; Zhang et al . ( 2017 ) ) , loss weighting ( Lin et al . ( 2017 ) ) , and meta-learning ( Wang & Hebert ( 2016 ) ) . Some methods design dedicated loss functions to mitigate the data imbalanced problem . For example , lift loss ( Oh Song et al . ( 2016 ) ) introduces margins between many training samples . Range loss ( Zhang et al . ( 2017 ) ) encourages data from the same class to be close and different classes to be far away in the embedding space . The focal loss ( Lin et al . ( 2017 ) ) dynamically balances weights of positive , hard negative , and easy negative samples . As reported by ( Liu et al . ( 2019 ) ) , when applied to long-tailed recognition , many of these methods improved accuracy of the few-shot group , but at the cost of lower accuracy over the many-shot classes . Other methods , e.g . LDAM-DRW ( Cao et al . ( 2019 ) ) replace cross-entropy loss with LDAM loss . This adds a calibration factor to the original cross-entropy loss . When combined with loss reweighting , it improves the accuracy in all splits in long-tailed recognition . However , it can not be easily generalized to semi-supervised learning . Because both the calibration factor and the loss weight are calculated based on the number of samples of each class . In face recognition and person re-identification , the datasets are mostly with long-tailed distribution . LEAP ( Liu et al . ( 2020 ) ) augmented data samples from tail ( few-shot ) classes by transferring intra-class variations from head ( many-shot ) classes . Instead of data augmentation , we introduce unsupervised data to improve the performance of long-tailed recognition . A recent work ( Yang & Xu ( 2020 ) ) rethinks the value of labels in imbalance learning . As part of the discussion , semi-supervised learning is included . However , only the basic pseudo label solution and simple datasets , such as CIFAR and SVHN , are discussed . More recent works ( Kang et al . ( 2020 ) ; Zhou et al . ( 2020 ) ) with improved long-tailed recognition share the observation that feature embedding and the classifier should be trained with different sampling strategies . In this work , we adopt our method on this observation to learn the feature embedding model with random sampling and train the classifier with class-balanced sampling . This design is further closely compatible with semi-supervised learning under alternate learning . Semi-supervised learning has been extensively discussed in recognition discipline ( Laine & Aila ( 2016 ) ; Rasmus et al . ( 2015 ) ; Tarvainen & Valpola ( 2017 ) ) . One common observation is to optimize the traditional cross-entropy loss together with a regularization term that regulates the perturbation consistency of unlabelled data . Ladder net ( Rasmus et al . ( 2015 ) ) is introduced to minimise the reconstruction loss between the network outputs from a given sample and its perturbation . It is then simplified in ( Laine & Aila ( 2016 ) ) as two temporal modules : Π-Model and Temporal Ensembling . The Temporal Ensembling f g' Random Sampling f g Class-Balanced Sampling ( a ) Initialization procedure . A recognition model is first trained with random sampling . After that the feature embedding is used to train a new classifier with class-balanced sampling . In the diagram , CNN components that are updated during training are highlighted in red . f gU U ’ f g ’ D∪U ’ 𝐿 # $ % & f gD 𝐿 # ' ( Stage 1 Stage 2 Stage 3 ( b ) Diagram of alternate learning . CNN modules in green line is only used in forwarding . Those in red are fine-tuned with the corresponding loss . In Stage 1 , samples from U are forwarded through f and g. U ′ consists of samples from U , and pseudo labels acquired from g. In Stage 2 , f and g′ are trained on the combination of D and U ′ . In Stage 3 , only the classifier g is trained . f is fixed and only used in forwarding . encourages the output of the network from unlabeled data to be similar to its counterpart from previous training epoch . More recently , Mean Teacher ( Tarvainen & Valpola ( 2017 ) ) extends it by assembling along training . Instead of storing previous predictions , they assemble a Teacher model by calculating the moving average of the training network , i.e . the Student . The Teacher is then used to provide the consistency of predictions to the Student . In addition to that , MA-DNN ( Chen et al . ( 2018 ) ) introduces a memory module to maintain the category prototypes and provide regularization for learning with unlabeled data . Label propagation ( Li et al . ( 2018 ) ) is also considered with the help of label graph . More recently , Mixmatch ( Berthelot et al . ( 2019 ) ) and Fixmatch ( Sohn et al . ( 2020 ) ) improve the performance by introducing powerful data augmentations and perturbation consistencies . All the semi-supervised methods above do not separate labeled data during semi-supervised training . In fact , it is beneficial to combine labeled data and unlabeled data in a certain proportion ( Laine & Aila ( 2016 ) ; Tarvainen & Valpola ( 2017 ) ) . However , without further knowledge , we have no insight how to deal with this combination when long-tailed distribution is included . Furthermore , long-tailed learning methods require calibration or re-sampling based on the class distribution . This combination of labeled and unlabeled data makes the distribution unstable . In result , this is not suitable for long-tailed recognition . Recently , Salsa ( Rebuffi et al . ( 2020 ) ) proposes to decouple the supervised learning from semisupervised training . Our method follows the alternate training scheme from it , because it is surprisingly compatible with long-tailed learning . In practice , our method differs from Salsa in the following aspects . First , we adopt class-balanced sampling in supervised learning to deal with the long-tailed distribution . Second , we use supervised learning instead of self-supervised learning as initialization . We find that self-supervised learning results in inferior performance in long-tailed scenario . Third , the re-initialization is not needed . Because our initialization is already from supervised learning , there is not a specific starting point to re-initialize the model . In fact , this enhances the soft constraint between the two stages in ( Rebuffi et al . ( 2020 ) ) . With the models continuously optimized along alternate learning , our method achieves superior performance while maintains the same amount of training epochs as fine-tuning on pseudo labels .
This paper proposes a new setting--semi-supervised long-tailed recognition. To harness the imbalanced unlabeled data, the authors combined the decoupling in long-tailed recognition and pseudo-labeling in semi-supervised learning, which formulates a three-stage method. Stage 1 generates pseudo-labels with a classifier trained with class-aware resampling. Stage 2 fine-tunes the feature extractor on with pseudo-labeling. Stage 3 trains the classifier with class-aware resampling on top of the refined feature extractor. Experiments indicate that the proposed method outperforms baselines.
SP:935238eca487fe47d7539e122c692b639f8d2966
Semi-supervised Long-tailed Recognition using Alternate Sampling
1 INTRODUCTION . Large-scale datasets , which contain sufficient data in each class , has been a major factor to the success of modern deep learning models for computer vision tasks , such as object recognition . These datasets are usually carefully curated and balanced to have an uniform data distribution over all classes . This balanced data distribution favors model training but could be impractical in many real world applications , where the frequency of samples from different classes can be imbalanced , leading to a long-tailed data distribution . As shown in Figure 1 ( b ) , several highly populated classes take up most of the labeled samples , and some of the classes only have very few samples during training . The long-tailed recognition problem has been widely studied in the literature . One major challenge in this setting ( Liu et al . ( 2019 ) ; Kang et al . ( 2020 ) ; Zhou et al . ( 2020 ) ) to deep learning model training is the tendency of under-fitting in less-populated classes . The root causes of this underfitting are the imbalanced training data distribution as well as the scarcity of data samples in the tail classes . More specifically , with an imbalanced training data distribution , when several head classes take up most of the training samples , tail classes contribute little in the training loss . The model is such that biased towards head classes . Prior works ( Lin et al . ( 2017 ) ; Cao et al . ( 2019 ) ; Kang et al . ( 2020 ) ; Zhou et al . ( 2020 ) ) tried to mitigate the issue by re-sampling the training data to be a balanced distribution or calibrating the sample weights in calculating the loss . However , still the scarcity of tail class data samples limits the intra-class variations and overall recognition accuracy . Methods focusing on few-shot learning have been introduced to address this problem through data augmentation and data synthesis ( Wang et al . ( 2018 ) ; Hariharan & Girshick ( 2017 ) ; Liu et al . ( 2020 ) ) . In this work , we resort to a different path to leverage massive unlabeled real data in training to help improve the long-tailed recognition accuracy . Since data collection is much cheaper and accessible comparing to data annotation , additional unlabeled real data could readily be available in many realworld scenarios . This semi-supervised learning setting has been intensively studied in the literature ( Laine & Aila ( 2016 ) ; Rasmus et al . ( 2015 ) ; Tarvainen & Valpola ( 2017 ) ; Berthelot et al . ( 2019 ) ; Sohn et al . ( 2020 ) ) . However , as shown in Figure 1 ( a ) , when we carefully look at the data distribution of the widely used benchmarks , we observe well-balanced labeled subset and unlabeled subset . As discussed above , the manually curated balanced distribution , can lead to a gap to real-world scenarios . This is especially true in unlabeled data . Without labels , people have no way to balance the data among classes . In this paper , we propose a more realistic and challenging setting , namely semi-supervised longtailed recognition . As shown in Figure 1 ( c ) , we assume a long-tailed data distribution of the overall dataset and both the labeled and unlabeled subsets of training data follow the same underlying longtailed data distribution . This setting generally resembles a realistic data collection and annotation workflow . After collecting the raw data , one has no knowledge of its class distribution before annotation . As it is expensive to annotate the full corpus , a common practice is to randomly sample a subset for annotation under a given labeling budget . When the raw data follows a long-tailed class distribution , we should expect the same in the labeled subset . While this new recognition paradigm shares the challenges in both semi-supervised learning and long-tailed recognition , there is no readily naive solution to it . Methods in long-tailed recognition rely on class labels to achieve balanced training , which are not available in the unlabeled portion in the semi-supervised long-tailed recognition . Prior semi-supervised methods without considering the long-tailed distribution could fail as well . Taking one of the competitive baseline methods for example , ( Yang & Xu ( 2020 ) ) proposed to firstly train a recognition model with the labeled subset to generate pseudo labels for the unlabeled subset , then the model is fine-tuned with the full training dataset . However , when the labeled subset follows a long-tailed distribution , the pseudo labels are much less accurate for tail classes than head classes . As a result , the overall pseudo labels quality could be too bad to leverage ( See Section 4.4 for results in CIFAR-10-SSLT and ImageNet-SSLT ) . To address the semi-supervised long-tailed recognition problem , we present a method designed specifically for this setting . We bring the successful class-balanced sampling strategy and combined it with model decoupling in an alternate learning framework to overcome the difficulty of balancing unlabeled training data . Inspired by ( Kang et al . ( 2020 ) ) , we decouple the recognition model into a feature embedding and a classifier , and train them with random sampling and class-balanced sampling respectively . As we are targeting at a semi-supervised setting , the classifier is only trained on labeled data to get around the difficulty of applying correctly class-balanced sampling on unlabeled data , aligning with the intuition that the classifier needs more robust supervision than the feature embedding . After that , with the proposed alternative learning framework , we improve model by updating the feature embedding and the classifier iteratively . We assign pseudo labels with the up-to-date classifier and observed gradually improved accuracy of pseudo labels over iterations . The pseudo labels are then incorporated in fine-tuning the feature embedding with a regularization term to limit its potential negative impacts . Similar iterative design has been proposed in semi-supervised learning literature ( Laine & Aila ( 2016 ) ; Tarvainen & Valpola ( 2017 ) ) but important implementation details differ . To summarize , in this paper , 1 ) we resort to semi-supervised learning to help improve long-tailed recognition accuracy and identify practical gap of current semi-supervised recognition datasets due to their well-balanced unlabeled subset ; 2 ) we propose a new recognition paradigm named semisupervised long-tailed recognition better resembling real-world data collection and annotation workflow ; 3 ) we propose a new alternative sampling method to address the semi-supervised long-tailed recognition and demonstrate significant improvements on several benchmarks . 2 RELATED WORK . Long-tailed recognition has been recently studied a lot ( Wang et al . ( 2017 ) ; Oh Song et al . ( 2016 ) ; Lin et al . ( 2017 ) ; Zhang et al . ( 2017 ) ; Liu et al . ( 2019 ) ; Wang & Hebert ( 2016 ) ) . Several approaches have been proposed , including metric learning ( Oh Song et al . ( 2016 ) ; Zhang et al . ( 2017 ) ) , loss weighting ( Lin et al . ( 2017 ) ) , and meta-learning ( Wang & Hebert ( 2016 ) ) . Some methods design dedicated loss functions to mitigate the data imbalanced problem . For example , lift loss ( Oh Song et al . ( 2016 ) ) introduces margins between many training samples . Range loss ( Zhang et al . ( 2017 ) ) encourages data from the same class to be close and different classes to be far away in the embedding space . The focal loss ( Lin et al . ( 2017 ) ) dynamically balances weights of positive , hard negative , and easy negative samples . As reported by ( Liu et al . ( 2019 ) ) , when applied to long-tailed recognition , many of these methods improved accuracy of the few-shot group , but at the cost of lower accuracy over the many-shot classes . Other methods , e.g . LDAM-DRW ( Cao et al . ( 2019 ) ) replace cross-entropy loss with LDAM loss . This adds a calibration factor to the original cross-entropy loss . When combined with loss reweighting , it improves the accuracy in all splits in long-tailed recognition . However , it can not be easily generalized to semi-supervised learning . Because both the calibration factor and the loss weight are calculated based on the number of samples of each class . In face recognition and person re-identification , the datasets are mostly with long-tailed distribution . LEAP ( Liu et al . ( 2020 ) ) augmented data samples from tail ( few-shot ) classes by transferring intra-class variations from head ( many-shot ) classes . Instead of data augmentation , we introduce unsupervised data to improve the performance of long-tailed recognition . A recent work ( Yang & Xu ( 2020 ) ) rethinks the value of labels in imbalance learning . As part of the discussion , semi-supervised learning is included . However , only the basic pseudo label solution and simple datasets , such as CIFAR and SVHN , are discussed . More recent works ( Kang et al . ( 2020 ) ; Zhou et al . ( 2020 ) ) with improved long-tailed recognition share the observation that feature embedding and the classifier should be trained with different sampling strategies . In this work , we adopt our method on this observation to learn the feature embedding model with random sampling and train the classifier with class-balanced sampling . This design is further closely compatible with semi-supervised learning under alternate learning . Semi-supervised learning has been extensively discussed in recognition discipline ( Laine & Aila ( 2016 ) ; Rasmus et al . ( 2015 ) ; Tarvainen & Valpola ( 2017 ) ) . One common observation is to optimize the traditional cross-entropy loss together with a regularization term that regulates the perturbation consistency of unlabelled data . Ladder net ( Rasmus et al . ( 2015 ) ) is introduced to minimise the reconstruction loss between the network outputs from a given sample and its perturbation . It is then simplified in ( Laine & Aila ( 2016 ) ) as two temporal modules : Π-Model and Temporal Ensembling . The Temporal Ensembling f g' Random Sampling f g Class-Balanced Sampling ( a ) Initialization procedure . A recognition model is first trained with random sampling . After that the feature embedding is used to train a new classifier with class-balanced sampling . In the diagram , CNN components that are updated during training are highlighted in red . f gU U ’ f g ’ D∪U ’ 𝐿 # $ % & f gD 𝐿 # ' ( Stage 1 Stage 2 Stage 3 ( b ) Diagram of alternate learning . CNN modules in green line is only used in forwarding . Those in red are fine-tuned with the corresponding loss . In Stage 1 , samples from U are forwarded through f and g. U ′ consists of samples from U , and pseudo labels acquired from g. In Stage 2 , f and g′ are trained on the combination of D and U ′ . In Stage 3 , only the classifier g is trained . f is fixed and only used in forwarding . encourages the output of the network from unlabeled data to be similar to its counterpart from previous training epoch . More recently , Mean Teacher ( Tarvainen & Valpola ( 2017 ) ) extends it by assembling along training . Instead of storing previous predictions , they assemble a Teacher model by calculating the moving average of the training network , i.e . the Student . The Teacher is then used to provide the consistency of predictions to the Student . In addition to that , MA-DNN ( Chen et al . ( 2018 ) ) introduces a memory module to maintain the category prototypes and provide regularization for learning with unlabeled data . Label propagation ( Li et al . ( 2018 ) ) is also considered with the help of label graph . More recently , Mixmatch ( Berthelot et al . ( 2019 ) ) and Fixmatch ( Sohn et al . ( 2020 ) ) improve the performance by introducing powerful data augmentations and perturbation consistencies . All the semi-supervised methods above do not separate labeled data during semi-supervised training . In fact , it is beneficial to combine labeled data and unlabeled data in a certain proportion ( Laine & Aila ( 2016 ) ; Tarvainen & Valpola ( 2017 ) ) . However , without further knowledge , we have no insight how to deal with this combination when long-tailed distribution is included . Furthermore , long-tailed learning methods require calibration or re-sampling based on the class distribution . This combination of labeled and unlabeled data makes the distribution unstable . In result , this is not suitable for long-tailed recognition . Recently , Salsa ( Rebuffi et al . ( 2020 ) ) proposes to decouple the supervised learning from semisupervised training . Our method follows the alternate training scheme from it , because it is surprisingly compatible with long-tailed learning . In practice , our method differs from Salsa in the following aspects . First , we adopt class-balanced sampling in supervised learning to deal with the long-tailed distribution . Second , we use supervised learning instead of self-supervised learning as initialization . We find that self-supervised learning results in inferior performance in long-tailed scenario . Third , the re-initialization is not needed . Because our initialization is already from supervised learning , there is not a specific starting point to re-initialize the model . In fact , this enhances the soft constraint between the two stages in ( Rebuffi et al . ( 2020 ) ) . With the models continuously optimized along alternate learning , our method achieves superior performance while maintains the same amount of training epochs as fine-tuning on pseudo labels .
This paper proposes a long-tailed semi-supervised learning setting where both labeled and unlabeled data from a long-tailed distribution exist. To address this setting, they use an iterative decoupling training method, which is based on Kang et al 2020. The only difference is after initialization using the original decoupling method, pseudo labels are obtained from unlabeled data and the feature extractor is updated with pseudo labels, then the classifier is updated using the new feature representations. Two new benchmarks are provided, and the methods had improved performance over selected baselines.
SP:935238eca487fe47d7539e122c692b639f8d2966
Semi-supervised Long-tailed Recognition using Alternate Sampling
1 INTRODUCTION . Large-scale datasets , which contain sufficient data in each class , has been a major factor to the success of modern deep learning models for computer vision tasks , such as object recognition . These datasets are usually carefully curated and balanced to have an uniform data distribution over all classes . This balanced data distribution favors model training but could be impractical in many real world applications , where the frequency of samples from different classes can be imbalanced , leading to a long-tailed data distribution . As shown in Figure 1 ( b ) , several highly populated classes take up most of the labeled samples , and some of the classes only have very few samples during training . The long-tailed recognition problem has been widely studied in the literature . One major challenge in this setting ( Liu et al . ( 2019 ) ; Kang et al . ( 2020 ) ; Zhou et al . ( 2020 ) ) to deep learning model training is the tendency of under-fitting in less-populated classes . The root causes of this underfitting are the imbalanced training data distribution as well as the scarcity of data samples in the tail classes . More specifically , with an imbalanced training data distribution , when several head classes take up most of the training samples , tail classes contribute little in the training loss . The model is such that biased towards head classes . Prior works ( Lin et al . ( 2017 ) ; Cao et al . ( 2019 ) ; Kang et al . ( 2020 ) ; Zhou et al . ( 2020 ) ) tried to mitigate the issue by re-sampling the training data to be a balanced distribution or calibrating the sample weights in calculating the loss . However , still the scarcity of tail class data samples limits the intra-class variations and overall recognition accuracy . Methods focusing on few-shot learning have been introduced to address this problem through data augmentation and data synthesis ( Wang et al . ( 2018 ) ; Hariharan & Girshick ( 2017 ) ; Liu et al . ( 2020 ) ) . In this work , we resort to a different path to leverage massive unlabeled real data in training to help improve the long-tailed recognition accuracy . Since data collection is much cheaper and accessible comparing to data annotation , additional unlabeled real data could readily be available in many realworld scenarios . This semi-supervised learning setting has been intensively studied in the literature ( Laine & Aila ( 2016 ) ; Rasmus et al . ( 2015 ) ; Tarvainen & Valpola ( 2017 ) ; Berthelot et al . ( 2019 ) ; Sohn et al . ( 2020 ) ) . However , as shown in Figure 1 ( a ) , when we carefully look at the data distribution of the widely used benchmarks , we observe well-balanced labeled subset and unlabeled subset . As discussed above , the manually curated balanced distribution , can lead to a gap to real-world scenarios . This is especially true in unlabeled data . Without labels , people have no way to balance the data among classes . In this paper , we propose a more realistic and challenging setting , namely semi-supervised longtailed recognition . As shown in Figure 1 ( c ) , we assume a long-tailed data distribution of the overall dataset and both the labeled and unlabeled subsets of training data follow the same underlying longtailed data distribution . This setting generally resembles a realistic data collection and annotation workflow . After collecting the raw data , one has no knowledge of its class distribution before annotation . As it is expensive to annotate the full corpus , a common practice is to randomly sample a subset for annotation under a given labeling budget . When the raw data follows a long-tailed class distribution , we should expect the same in the labeled subset . While this new recognition paradigm shares the challenges in both semi-supervised learning and long-tailed recognition , there is no readily naive solution to it . Methods in long-tailed recognition rely on class labels to achieve balanced training , which are not available in the unlabeled portion in the semi-supervised long-tailed recognition . Prior semi-supervised methods without considering the long-tailed distribution could fail as well . Taking one of the competitive baseline methods for example , ( Yang & Xu ( 2020 ) ) proposed to firstly train a recognition model with the labeled subset to generate pseudo labels for the unlabeled subset , then the model is fine-tuned with the full training dataset . However , when the labeled subset follows a long-tailed distribution , the pseudo labels are much less accurate for tail classes than head classes . As a result , the overall pseudo labels quality could be too bad to leverage ( See Section 4.4 for results in CIFAR-10-SSLT and ImageNet-SSLT ) . To address the semi-supervised long-tailed recognition problem , we present a method designed specifically for this setting . We bring the successful class-balanced sampling strategy and combined it with model decoupling in an alternate learning framework to overcome the difficulty of balancing unlabeled training data . Inspired by ( Kang et al . ( 2020 ) ) , we decouple the recognition model into a feature embedding and a classifier , and train them with random sampling and class-balanced sampling respectively . As we are targeting at a semi-supervised setting , the classifier is only trained on labeled data to get around the difficulty of applying correctly class-balanced sampling on unlabeled data , aligning with the intuition that the classifier needs more robust supervision than the feature embedding . After that , with the proposed alternative learning framework , we improve model by updating the feature embedding and the classifier iteratively . We assign pseudo labels with the up-to-date classifier and observed gradually improved accuracy of pseudo labels over iterations . The pseudo labels are then incorporated in fine-tuning the feature embedding with a regularization term to limit its potential negative impacts . Similar iterative design has been proposed in semi-supervised learning literature ( Laine & Aila ( 2016 ) ; Tarvainen & Valpola ( 2017 ) ) but important implementation details differ . To summarize , in this paper , 1 ) we resort to semi-supervised learning to help improve long-tailed recognition accuracy and identify practical gap of current semi-supervised recognition datasets due to their well-balanced unlabeled subset ; 2 ) we propose a new recognition paradigm named semisupervised long-tailed recognition better resembling real-world data collection and annotation workflow ; 3 ) we propose a new alternative sampling method to address the semi-supervised long-tailed recognition and demonstrate significant improvements on several benchmarks . 2 RELATED WORK . Long-tailed recognition has been recently studied a lot ( Wang et al . ( 2017 ) ; Oh Song et al . ( 2016 ) ; Lin et al . ( 2017 ) ; Zhang et al . ( 2017 ) ; Liu et al . ( 2019 ) ; Wang & Hebert ( 2016 ) ) . Several approaches have been proposed , including metric learning ( Oh Song et al . ( 2016 ) ; Zhang et al . ( 2017 ) ) , loss weighting ( Lin et al . ( 2017 ) ) , and meta-learning ( Wang & Hebert ( 2016 ) ) . Some methods design dedicated loss functions to mitigate the data imbalanced problem . For example , lift loss ( Oh Song et al . ( 2016 ) ) introduces margins between many training samples . Range loss ( Zhang et al . ( 2017 ) ) encourages data from the same class to be close and different classes to be far away in the embedding space . The focal loss ( Lin et al . ( 2017 ) ) dynamically balances weights of positive , hard negative , and easy negative samples . As reported by ( Liu et al . ( 2019 ) ) , when applied to long-tailed recognition , many of these methods improved accuracy of the few-shot group , but at the cost of lower accuracy over the many-shot classes . Other methods , e.g . LDAM-DRW ( Cao et al . ( 2019 ) ) replace cross-entropy loss with LDAM loss . This adds a calibration factor to the original cross-entropy loss . When combined with loss reweighting , it improves the accuracy in all splits in long-tailed recognition . However , it can not be easily generalized to semi-supervised learning . Because both the calibration factor and the loss weight are calculated based on the number of samples of each class . In face recognition and person re-identification , the datasets are mostly with long-tailed distribution . LEAP ( Liu et al . ( 2020 ) ) augmented data samples from tail ( few-shot ) classes by transferring intra-class variations from head ( many-shot ) classes . Instead of data augmentation , we introduce unsupervised data to improve the performance of long-tailed recognition . A recent work ( Yang & Xu ( 2020 ) ) rethinks the value of labels in imbalance learning . As part of the discussion , semi-supervised learning is included . However , only the basic pseudo label solution and simple datasets , such as CIFAR and SVHN , are discussed . More recent works ( Kang et al . ( 2020 ) ; Zhou et al . ( 2020 ) ) with improved long-tailed recognition share the observation that feature embedding and the classifier should be trained with different sampling strategies . In this work , we adopt our method on this observation to learn the feature embedding model with random sampling and train the classifier with class-balanced sampling . This design is further closely compatible with semi-supervised learning under alternate learning . Semi-supervised learning has been extensively discussed in recognition discipline ( Laine & Aila ( 2016 ) ; Rasmus et al . ( 2015 ) ; Tarvainen & Valpola ( 2017 ) ) . One common observation is to optimize the traditional cross-entropy loss together with a regularization term that regulates the perturbation consistency of unlabelled data . Ladder net ( Rasmus et al . ( 2015 ) ) is introduced to minimise the reconstruction loss between the network outputs from a given sample and its perturbation . It is then simplified in ( Laine & Aila ( 2016 ) ) as two temporal modules : Π-Model and Temporal Ensembling . The Temporal Ensembling f g' Random Sampling f g Class-Balanced Sampling ( a ) Initialization procedure . A recognition model is first trained with random sampling . After that the feature embedding is used to train a new classifier with class-balanced sampling . In the diagram , CNN components that are updated during training are highlighted in red . f gU U ’ f g ’ D∪U ’ 𝐿 # $ % & f gD 𝐿 # ' ( Stage 1 Stage 2 Stage 3 ( b ) Diagram of alternate learning . CNN modules in green line is only used in forwarding . Those in red are fine-tuned with the corresponding loss . In Stage 1 , samples from U are forwarded through f and g. U ′ consists of samples from U , and pseudo labels acquired from g. In Stage 2 , f and g′ are trained on the combination of D and U ′ . In Stage 3 , only the classifier g is trained . f is fixed and only used in forwarding . encourages the output of the network from unlabeled data to be similar to its counterpart from previous training epoch . More recently , Mean Teacher ( Tarvainen & Valpola ( 2017 ) ) extends it by assembling along training . Instead of storing previous predictions , they assemble a Teacher model by calculating the moving average of the training network , i.e . the Student . The Teacher is then used to provide the consistency of predictions to the Student . In addition to that , MA-DNN ( Chen et al . ( 2018 ) ) introduces a memory module to maintain the category prototypes and provide regularization for learning with unlabeled data . Label propagation ( Li et al . ( 2018 ) ) is also considered with the help of label graph . More recently , Mixmatch ( Berthelot et al . ( 2019 ) ) and Fixmatch ( Sohn et al . ( 2020 ) ) improve the performance by introducing powerful data augmentations and perturbation consistencies . All the semi-supervised methods above do not separate labeled data during semi-supervised training . In fact , it is beneficial to combine labeled data and unlabeled data in a certain proportion ( Laine & Aila ( 2016 ) ; Tarvainen & Valpola ( 2017 ) ) . However , without further knowledge , we have no insight how to deal with this combination when long-tailed distribution is included . Furthermore , long-tailed learning methods require calibration or re-sampling based on the class distribution . This combination of labeled and unlabeled data makes the distribution unstable . In result , this is not suitable for long-tailed recognition . Recently , Salsa ( Rebuffi et al . ( 2020 ) ) proposes to decouple the supervised learning from semisupervised training . Our method follows the alternate training scheme from it , because it is surprisingly compatible with long-tailed learning . In practice , our method differs from Salsa in the following aspects . First , we adopt class-balanced sampling in supervised learning to deal with the long-tailed distribution . Second , we use supervised learning instead of self-supervised learning as initialization . We find that self-supervised learning results in inferior performance in long-tailed scenario . Third , the re-initialization is not needed . Because our initialization is already from supervised learning , there is not a specific starting point to re-initialize the model . In fact , this enhances the soft constraint between the two stages in ( Rebuffi et al . ( 2020 ) ) . With the models continuously optimized along alternate learning , our method achieves superior performance while maintains the same amount of training epochs as fine-tuning on pseudo labels .
This paper propose a new setting, named semi-supervised long-tailed recognition. They consider both of the labelled data and unlabelled data exhibit long-tailed distribution. To solve the problem, they propose an alternate sampling framework which learns the feature and classifier separately and update them iteratively. On two datasets, the results validate the efficacy of proposed method.
SP:935238eca487fe47d7539e122c692b639f8d2966
Unconditional Diffusion Guidance
1 INTRODUCTION . Diffusion models have recently emerged as an expressive and flexible family of generative models , delivering competitive sample quality and likelihood scores on image and audio synthesis tasks ( SohlDickstein et al. , 2015 ; Song & Ermon , 2019 ; Ho et al. , 2020 ; Song et al. , 2021b ; Kingma et al. , 2021 ; Song et al. , 2021a ) . These models have delivered audio synthesis performance rivaling the quality of autoregressive models with substantially fewer inference steps ( Chen et al. , 2021 ; Kong et al. , 2021 ) , and they have delivered ImageNet generation results outperforming BigGAN-deep ( Brock et al. , 2019 ) and VQ-VAE-2 ( Razavi et al. , 2019 ) in terms of FID score and classification accuracy score ( Ho et al. , 2021 ; Dhariwal & Nichol , 2021 ) . Dhariwal & Nichol ( 2021 ) proposed classifier guidance , a technique to boost the sample quality of a diffusion model using an extra trained classifier . Prior to classifier guidance , it was not known how to generate “ low temperature ” samples from a diffusion model similar to those produced by truncated BigGAN ( Brock et al. , 2019 ) or low temperature Glow ( Kingma & Dhariwal , 2018 ) : naive attempts , such as scaling the model score vectors or decreasing the amount of Gaussian noise added during diffusion sampling , are ineffective ( Dhariwal & Nichol , 2021 ) . Classifier guidance instead mixes a diffusion model ’ s score estimate with the input gradient of the log probability of a classifier . By varying the strength of the classifier gradient , Dhariwal & Nichol can trade off Inception score ( Salimans et al. , 2016 ) and FID score ( Heusel et al. , 2017 ) ( or precision and recall ) in a manner similar to varying the truncation parameter of BigGAN . We are interested in whether classifier guidance can be performed without a classifier . Because classifier guidance mixes a score estimate with a classifier gradient during sampling , classifier-guided diffusion sampling can be interpreted as attempting to confuse an image classifier with a gradientbased adversarial attack . This raises the question of whether classifier guidance is successful at boosting classifier-based metrics such as FID and Inception score ( IS ) simply because it is adversarial against such classifiers . Stepping in direction of classifier gradients also bears some resemblance to GAN training , particularly with nonparameteric generators ; this also raises the question of whether classifier-guided diffusion models perform well on classifier-based metrics because they are beginning to resemble GANs , which are already known to perform well on such metrics . To resolve these questions , we present unconditional guidance , our guidance method which avoids any classifier entirely . Rather than sampling in the direction of the gradient of an image classifier , unconditional guidance instead mixes the score estimates of a conditional diffusion model and a jointly trained unconditional diffusion model . By sweeping over the mixing weight , we attain a FID/IS tradeoff similar to that attained by classifier guidance . Our unconditional guidance results demonstrate that pure generative diffusion models are capable of synthesizing extremely high fidelity samples possible with other types of generative models . 2 BACKGROUND . We train diffusion models in continuous time ( Song et al. , 2021b ; Chen et al. , 2021 ; Kingma et al. , 2021 ) : letting x ∼ p ( x ) and z = { zλ |λ ∈ [ λmin , λmax ] } for hyperparameters λmin < λmax ∈ R , the forward process q ( z|x ) is the variance-preserving Markov process ( Sohl-Dickstein et al. , 2015 ) : q ( zλ|x ) = N ( αλx , σ2λI ) , where α2λ = 1/ ( 1 + e−λ ) , σ2λ = 1− α2λ ( 1 ) q ( zλ|zλ′ ) = N ( ( αλ/αλ′ ) zλ′ , σ2λ|λ′I ) , where λ < λ ′ , σ2λ|λ′ = ( 1− e λ−λ′ ) σ2λ ( 2 ) We will use the notation p ( z ) ( or p ( zλ ) ) to denote the marginal of z ( or zλ ) when x ∼ p ( x ) and z ∼ q ( z|x ) . Note that λ = logα2λ/σ2λ , so λ can be interpreted as the log signal-to-noise ratio of zλ , and the forward process runs in the direction of decreasing λ . Conditioned on x , the forward process can be described in reverse by the transitions q ( zλ′ |zλ , x ) = N ( µ̃λ′|λ ( zλ , x ) , σ̃2λ′|λI ) , where µ̃λ′|λ ( zλ , x ) = e λ−λ′ ( αλ′/αλ ) zλ + ( 1− eλ−λ ′ ) αλ′x , σ̃ 2 λ′|λ = ( 1− e λ−λ′ ) σ2λ′ ( 3 ) The reverse process generative model starts from pθ ( zλmin ) = N ( 0 , I ) . We specify the transitions : pθ ( zλ′ |zλ ) = N ( µ̃λ′|λ ( zλ , xθ ( zλ ) ) , ( σ̃2λ′|λ ) 1−v ( σ2λ|λ′ ) v ) ( 4 ) During sampling , we apply this transition along an increasing sequence λmin = λ1 < · · · < λT = λmax for T timesteps ; in other words , we follow the discrete time ancestral sampler of Sohl-Dickstein et al . ( 2015 ) ; Ho et al . ( 2020 ) . If the model xθ is correct , then as T →∞ , we obtain samples from an SDE whose sample paths are distributed as p ( z ) ( Song et al. , 2021b ) , and we use pθ ( z ) to denote the continuous time model distribution . The variance is a log-space interpolation of σ̃2λ′|λ and σ 2 λ|λ′ as suggested by Nichol & Dhariwal ( 2021 ) ; we found it effective to use a constant hyperparameter v rather than learned zλ-dependent v. Note that the variances simplify to σ̃2λ′|λ as λ ′ → λ , so v has an effect only when sampling with non-infinitesimal timesteps as done in practice . The reverse process mean comes from an estimate xθ ( zλ ) ≈ x plugged into q ( zλ′ |zλ , x ) ( Ho et al. , 2020 ; Kingma et al. , 2021 ) ( xθ also receives λ as input , but we suppress this to keep our notation clean ) . We parameterize xθ in terms of -prediction ( Ho et al. , 2020 ) : xθ ( zλ ) = ( zλ−σλ θ ( zλ ) ) /αλ , and we train on the objective E , λ [ ‖ θ ( zλ ) − ‖22 ] ( 5 ) where ∼ N ( 0 , I ) , zλ = αλx + σλ , and λ is drawn from a distribution p ( λ ) over [ λmin , λmax ] . This objective is denoising score matching ( Vincent , 2011 ; Hyvärinen & Dayan , 2005 ) over multiple noise scales ( Song & Ermon , 2019 ) , and when p ( λ ) is uniform , the objective is proportional to the variational lower bound on the marginal log likelihood of the latent variable model ∫ p ( x|z ) pθ ( z ) dz , ignoring the term for the unspecified decoder p ( x|z ) and for the prior at zλmin ( Kingma et al. , 2021 ) . If p ( λ ) is not uniform , the objective can be interpreted as weighted variational lower bound whose weighting can be tuned for sample quality ( Ho et al. , 2020 ; Kingma et al. , 2021 ) . We use a p ( λ ) inspired by the discrete time cosine noise schedule of Nichol & Dhariwal ( 2021 ) : we sample λ via λ = −2 log tan ( au+ b ) for uniformly distributed u ∈ [ 0 , 1 ] , where b = arctan ( e−λmax/2 ) and a = arctan ( e−λmin/2 ) − b . This represents a hyperbolic secant distribution modified to be supported on a bounded interval . For finite timestep generation , we use λ values corresponding to uniformly spaced u ∈ [ 0 , 1 ] , and the final generated sample is xθ ( zλmax ) . Because the loss for θ ( zλ ) is denoising score matching for all λ , the score θ ( zλ ) learned by our model estimates the gradient of the log-density of the distribution of our noisy data zλ , that is θ ( zλ ) ≈ σλ∇zλ log p ( zλ ) . Sampling from the learned diffusion model resembles using Langevin diffusion to sample from a sequence of distributions p ( zλ ) that converges to the conditional distribution p ( x ) of the original data x . In the case of conditional generative modeling , the data x is drawn jointly with conditioning information c , i.e . a class label for class-conditional image generation . The only modification to the model is that the reverse process function approximator receives c as input , as in θ ( zλ , c ) . 3 GUIDANCE . An interesting property of certain generative models , such as GANs and flow-based models , is the ability to perform truncated or low temperature sampling by decreasing the variance or range of noise inputs to the generative model at sampling time . The intended effect is to decrease the diversity of the samples while increasing the quality of each individual sample . Truncation in BigGAN ( Brock et al. , 2019 ) , for example , yields a tradeoff curve between FID score and Inception score for low and high amounts of truncation , respectively . Low temperature sampling in Glow ( Kingma & Dhariwal , 2018 ) has a similar effect . Unfortunately , straightforward attempts of implementing truncation or low temperature sampling in diffusion models are ineffective . For example , scaling model scores or decreasing the variance of Gaussian noise in the reverse process cause the diffusion model to generate blurry , low quality samples ( Dhariwal & Nichol , 2021 ) . 3.1 CLASSIFIER GUIDANCE . To obtain a truncation-like effect in diffusion models , Dhariwal & Nichol ( 2021 ) introduce classifier guidance , where the diffusion score θ ( zλ , c ) ≈ σλ∇zλ log p ( zλ|c ) is modified to include the gradient of the log likelihood of an auxiliary classifier model pθ ( c|zλ ) as follows : ̃θ ( zλ , c ) = θ ( zλ , c ) + wσλ∇zλ log pθ ( c|zλ ) ≈ σλ∇zλ [ log p ( zλ|c ) + w log pθ ( c|zλ ) ] , where w is a parameter that controls the strength of the classifier guidance . This modified score ̃θ ( zλ , c ) is then used in place of θ ( zλ , c ) when sampling from the diffusion model , resulting in approximate samples from the distribution p̃θ ( zλ|c ) ∝ pθ ( zλ|c ) pθ ( c|zλ ) w. Algorithm 1 Joint training a diffusion model with unconditional guidance Require : puncond : probability of unconditional training 1 : repeat 2 : ( x , c ) ∼ p ( x , c ) . Sample data with conditioning from the dataset 3 : c← ∅ with probability puncond . Randomly discard conditioning to train unconditionally 4 : λ ∼ p ( λ ) . Sample log SNR value 5 : ∼ N ( 0 , I ) 6 : zλ = αλx+ σλ . Corrupt data to the sampled log SNR value 7 : Take gradient step on ∇θ ‖ θ ( zλ , c ) − ‖2 . Optimization of denoising model 8 : until converged The effect is that of up-weighting the probability of data for which the classifier pθ ( c|zλ ) assigns high likelihood to the correct label : data that can be classified well scores high on the Inception score of perceptual quality ( Salimans et al. , 2016 ) , which rewards generative models for this by design . Dhariwal & Nichol therefore find that by setting w > 0 they can improve the Inception score of their diffusion model , at the expense of decreased diversity in their samples . Figure 2 illustrates the effect of numerically solved guidance p̃θ ( zλ|c ) ∝ pθ ( zλ|c ) pθ ( c|zλ ) w on a toy 2D example of three classes , in which the conditional distribution for each class is an isotropic Gaussian . The form of each conditional upon applying guidance is markedly non-Gaussian . As guidance strength is increased , each conditional places probability mass farther away from other classes and towards directions of high confidence given by logistic regression , and most of the mass becomes concentrated in smaller regions . This behavior can be seen as a simplistic manifestation of the Inception score boost and sample diversity decrease that occur when classifier guidance strength is increased in an ImageNet model . Applying classifier guidance with weight w + 1 to an unconditional model would theoretically lead to the same result as applying classifier guidance with weight w to a conditional model , because pθ ( zλ|c ) pθ ( c|zλ ) w ∝ pθ ( zλ ) pθ ( c|zλ ) w+1 ; or in terms of scores , θ ( zλ ) + ( w + 1 ) σλ∇zλ log pθ ( c|zλ ) ≈ σλ∇zλ [ log p ( zλ ) + ( w + 1 ) log pθ ( c|zλ ) ] = σλ∇zλ [ log p ( zλ|c ) + w log pθ ( c|zλ ) ] , but interestingly , Dhariwal & Nichol obtain their best results when applying classifier guidance to an already class-conditional model , as opposed to applying guidance to an unconditional model . For this reason , we will stay in the setup of guiding an already conditional model .
In this paper the authors propose an improvement for score-matching based generative modeling [1] resembling low temperature sampling as in GANs or flow-based models. Similarly to [2] they propose to modify the drift function used in the sampling step of the diffusion model by including the gradient of some classifier. However, contrary to [2] the classifier considered by the authors is implicit in the sense that it is purely defined by a conditional and an unconditional generative model. The authors show that using such a classifier allows to control a trade-off between IS and FID on the ImageNet dataset. The use of such implicit classifier also provides intuition on the guidance influence in score-based generative modeling: the model tries to reduce the unconditional likelihood while increasing the conditional likelihood. [1] Song, Sohl-Dickstein, Kingma, Kumar, Ermon, Poole -- Score-based Generative Modeling through Stochastic Differential Equations [2] Dhariwal, Nichol -- Diffusion Models Beat GANs on Image Synthesis
SP:5e647ea6f857d222ed538db72d17e7d806b2acde
Unconditional Diffusion Guidance
1 INTRODUCTION . Diffusion models have recently emerged as an expressive and flexible family of generative models , delivering competitive sample quality and likelihood scores on image and audio synthesis tasks ( SohlDickstein et al. , 2015 ; Song & Ermon , 2019 ; Ho et al. , 2020 ; Song et al. , 2021b ; Kingma et al. , 2021 ; Song et al. , 2021a ) . These models have delivered audio synthesis performance rivaling the quality of autoregressive models with substantially fewer inference steps ( Chen et al. , 2021 ; Kong et al. , 2021 ) , and they have delivered ImageNet generation results outperforming BigGAN-deep ( Brock et al. , 2019 ) and VQ-VAE-2 ( Razavi et al. , 2019 ) in terms of FID score and classification accuracy score ( Ho et al. , 2021 ; Dhariwal & Nichol , 2021 ) . Dhariwal & Nichol ( 2021 ) proposed classifier guidance , a technique to boost the sample quality of a diffusion model using an extra trained classifier . Prior to classifier guidance , it was not known how to generate “ low temperature ” samples from a diffusion model similar to those produced by truncated BigGAN ( Brock et al. , 2019 ) or low temperature Glow ( Kingma & Dhariwal , 2018 ) : naive attempts , such as scaling the model score vectors or decreasing the amount of Gaussian noise added during diffusion sampling , are ineffective ( Dhariwal & Nichol , 2021 ) . Classifier guidance instead mixes a diffusion model ’ s score estimate with the input gradient of the log probability of a classifier . By varying the strength of the classifier gradient , Dhariwal & Nichol can trade off Inception score ( Salimans et al. , 2016 ) and FID score ( Heusel et al. , 2017 ) ( or precision and recall ) in a manner similar to varying the truncation parameter of BigGAN . We are interested in whether classifier guidance can be performed without a classifier . Because classifier guidance mixes a score estimate with a classifier gradient during sampling , classifier-guided diffusion sampling can be interpreted as attempting to confuse an image classifier with a gradientbased adversarial attack . This raises the question of whether classifier guidance is successful at boosting classifier-based metrics such as FID and Inception score ( IS ) simply because it is adversarial against such classifiers . Stepping in direction of classifier gradients also bears some resemblance to GAN training , particularly with nonparameteric generators ; this also raises the question of whether classifier-guided diffusion models perform well on classifier-based metrics because they are beginning to resemble GANs , which are already known to perform well on such metrics . To resolve these questions , we present unconditional guidance , our guidance method which avoids any classifier entirely . Rather than sampling in the direction of the gradient of an image classifier , unconditional guidance instead mixes the score estimates of a conditional diffusion model and a jointly trained unconditional diffusion model . By sweeping over the mixing weight , we attain a FID/IS tradeoff similar to that attained by classifier guidance . Our unconditional guidance results demonstrate that pure generative diffusion models are capable of synthesizing extremely high fidelity samples possible with other types of generative models . 2 BACKGROUND . We train diffusion models in continuous time ( Song et al. , 2021b ; Chen et al. , 2021 ; Kingma et al. , 2021 ) : letting x ∼ p ( x ) and z = { zλ |λ ∈ [ λmin , λmax ] } for hyperparameters λmin < λmax ∈ R , the forward process q ( z|x ) is the variance-preserving Markov process ( Sohl-Dickstein et al. , 2015 ) : q ( zλ|x ) = N ( αλx , σ2λI ) , where α2λ = 1/ ( 1 + e−λ ) , σ2λ = 1− α2λ ( 1 ) q ( zλ|zλ′ ) = N ( ( αλ/αλ′ ) zλ′ , σ2λ|λ′I ) , where λ < λ ′ , σ2λ|λ′ = ( 1− e λ−λ′ ) σ2λ ( 2 ) We will use the notation p ( z ) ( or p ( zλ ) ) to denote the marginal of z ( or zλ ) when x ∼ p ( x ) and z ∼ q ( z|x ) . Note that λ = logα2λ/σ2λ , so λ can be interpreted as the log signal-to-noise ratio of zλ , and the forward process runs in the direction of decreasing λ . Conditioned on x , the forward process can be described in reverse by the transitions q ( zλ′ |zλ , x ) = N ( µ̃λ′|λ ( zλ , x ) , σ̃2λ′|λI ) , where µ̃λ′|λ ( zλ , x ) = e λ−λ′ ( αλ′/αλ ) zλ + ( 1− eλ−λ ′ ) αλ′x , σ̃ 2 λ′|λ = ( 1− e λ−λ′ ) σ2λ′ ( 3 ) The reverse process generative model starts from pθ ( zλmin ) = N ( 0 , I ) . We specify the transitions : pθ ( zλ′ |zλ ) = N ( µ̃λ′|λ ( zλ , xθ ( zλ ) ) , ( σ̃2λ′|λ ) 1−v ( σ2λ|λ′ ) v ) ( 4 ) During sampling , we apply this transition along an increasing sequence λmin = λ1 < · · · < λT = λmax for T timesteps ; in other words , we follow the discrete time ancestral sampler of Sohl-Dickstein et al . ( 2015 ) ; Ho et al . ( 2020 ) . If the model xθ is correct , then as T →∞ , we obtain samples from an SDE whose sample paths are distributed as p ( z ) ( Song et al. , 2021b ) , and we use pθ ( z ) to denote the continuous time model distribution . The variance is a log-space interpolation of σ̃2λ′|λ and σ 2 λ|λ′ as suggested by Nichol & Dhariwal ( 2021 ) ; we found it effective to use a constant hyperparameter v rather than learned zλ-dependent v. Note that the variances simplify to σ̃2λ′|λ as λ ′ → λ , so v has an effect only when sampling with non-infinitesimal timesteps as done in practice . The reverse process mean comes from an estimate xθ ( zλ ) ≈ x plugged into q ( zλ′ |zλ , x ) ( Ho et al. , 2020 ; Kingma et al. , 2021 ) ( xθ also receives λ as input , but we suppress this to keep our notation clean ) . We parameterize xθ in terms of -prediction ( Ho et al. , 2020 ) : xθ ( zλ ) = ( zλ−σλ θ ( zλ ) ) /αλ , and we train on the objective E , λ [ ‖ θ ( zλ ) − ‖22 ] ( 5 ) where ∼ N ( 0 , I ) , zλ = αλx + σλ , and λ is drawn from a distribution p ( λ ) over [ λmin , λmax ] . This objective is denoising score matching ( Vincent , 2011 ; Hyvärinen & Dayan , 2005 ) over multiple noise scales ( Song & Ermon , 2019 ) , and when p ( λ ) is uniform , the objective is proportional to the variational lower bound on the marginal log likelihood of the latent variable model ∫ p ( x|z ) pθ ( z ) dz , ignoring the term for the unspecified decoder p ( x|z ) and for the prior at zλmin ( Kingma et al. , 2021 ) . If p ( λ ) is not uniform , the objective can be interpreted as weighted variational lower bound whose weighting can be tuned for sample quality ( Ho et al. , 2020 ; Kingma et al. , 2021 ) . We use a p ( λ ) inspired by the discrete time cosine noise schedule of Nichol & Dhariwal ( 2021 ) : we sample λ via λ = −2 log tan ( au+ b ) for uniformly distributed u ∈ [ 0 , 1 ] , where b = arctan ( e−λmax/2 ) and a = arctan ( e−λmin/2 ) − b . This represents a hyperbolic secant distribution modified to be supported on a bounded interval . For finite timestep generation , we use λ values corresponding to uniformly spaced u ∈ [ 0 , 1 ] , and the final generated sample is xθ ( zλmax ) . Because the loss for θ ( zλ ) is denoising score matching for all λ , the score θ ( zλ ) learned by our model estimates the gradient of the log-density of the distribution of our noisy data zλ , that is θ ( zλ ) ≈ σλ∇zλ log p ( zλ ) . Sampling from the learned diffusion model resembles using Langevin diffusion to sample from a sequence of distributions p ( zλ ) that converges to the conditional distribution p ( x ) of the original data x . In the case of conditional generative modeling , the data x is drawn jointly with conditioning information c , i.e . a class label for class-conditional image generation . The only modification to the model is that the reverse process function approximator receives c as input , as in θ ( zλ , c ) . 3 GUIDANCE . An interesting property of certain generative models , such as GANs and flow-based models , is the ability to perform truncated or low temperature sampling by decreasing the variance or range of noise inputs to the generative model at sampling time . The intended effect is to decrease the diversity of the samples while increasing the quality of each individual sample . Truncation in BigGAN ( Brock et al. , 2019 ) , for example , yields a tradeoff curve between FID score and Inception score for low and high amounts of truncation , respectively . Low temperature sampling in Glow ( Kingma & Dhariwal , 2018 ) has a similar effect . Unfortunately , straightforward attempts of implementing truncation or low temperature sampling in diffusion models are ineffective . For example , scaling model scores or decreasing the variance of Gaussian noise in the reverse process cause the diffusion model to generate blurry , low quality samples ( Dhariwal & Nichol , 2021 ) . 3.1 CLASSIFIER GUIDANCE . To obtain a truncation-like effect in diffusion models , Dhariwal & Nichol ( 2021 ) introduce classifier guidance , where the diffusion score θ ( zλ , c ) ≈ σλ∇zλ log p ( zλ|c ) is modified to include the gradient of the log likelihood of an auxiliary classifier model pθ ( c|zλ ) as follows : ̃θ ( zλ , c ) = θ ( zλ , c ) + wσλ∇zλ log pθ ( c|zλ ) ≈ σλ∇zλ [ log p ( zλ|c ) + w log pθ ( c|zλ ) ] , where w is a parameter that controls the strength of the classifier guidance . This modified score ̃θ ( zλ , c ) is then used in place of θ ( zλ , c ) when sampling from the diffusion model , resulting in approximate samples from the distribution p̃θ ( zλ|c ) ∝ pθ ( zλ|c ) pθ ( c|zλ ) w. Algorithm 1 Joint training a diffusion model with unconditional guidance Require : puncond : probability of unconditional training 1 : repeat 2 : ( x , c ) ∼ p ( x , c ) . Sample data with conditioning from the dataset 3 : c← ∅ with probability puncond . Randomly discard conditioning to train unconditionally 4 : λ ∼ p ( λ ) . Sample log SNR value 5 : ∼ N ( 0 , I ) 6 : zλ = αλx+ σλ . Corrupt data to the sampled log SNR value 7 : Take gradient step on ∇θ ‖ θ ( zλ , c ) − ‖2 . Optimization of denoising model 8 : until converged The effect is that of up-weighting the probability of data for which the classifier pθ ( c|zλ ) assigns high likelihood to the correct label : data that can be classified well scores high on the Inception score of perceptual quality ( Salimans et al. , 2016 ) , which rewards generative models for this by design . Dhariwal & Nichol therefore find that by setting w > 0 they can improve the Inception score of their diffusion model , at the expense of decreased diversity in their samples . Figure 2 illustrates the effect of numerically solved guidance p̃θ ( zλ|c ) ∝ pθ ( zλ|c ) pθ ( c|zλ ) w on a toy 2D example of three classes , in which the conditional distribution for each class is an isotropic Gaussian . The form of each conditional upon applying guidance is markedly non-Gaussian . As guidance strength is increased , each conditional places probability mass farther away from other classes and towards directions of high confidence given by logistic regression , and most of the mass becomes concentrated in smaller regions . This behavior can be seen as a simplistic manifestation of the Inception score boost and sample diversity decrease that occur when classifier guidance strength is increased in an ImageNet model . Applying classifier guidance with weight w + 1 to an unconditional model would theoretically lead to the same result as applying classifier guidance with weight w to a conditional model , because pθ ( zλ|c ) pθ ( c|zλ ) w ∝ pθ ( zλ ) pθ ( c|zλ ) w+1 ; or in terms of scores , θ ( zλ ) + ( w + 1 ) σλ∇zλ log pθ ( c|zλ ) ≈ σλ∇zλ [ log p ( zλ ) + ( w + 1 ) log pθ ( c|zλ ) ] = σλ∇zλ [ log p ( zλ|c ) + w log pθ ( c|zλ ) ] , but interestingly , Dhariwal & Nichol obtain their best results when applying classifier guidance to an already class-conditional model , as opposed to applying guidance to an unconditional model . For this reason , we will stay in the setup of guiding an already conditional model .
This work proposed a method to trade-off sample diversity for sample quality in diffusion models, which is termed unconditional guidance. Different from the prior work called classifier guidance (Dhariwal & Nichol 2021) that relies on a classifier for providing the guidance signal, the proposed unconditional guidance mixes the score estimates of a conditional diffusion model and an unconditional diffusion model for a trade-off between sample quality and sample diversity. Experiments on ImageNet 64x64 and 128x128 showed that the proposed model can achieve the claimed quality-diversity tradeoff regarding FID and IS scores.
SP:5e647ea6f857d222ed538db72d17e7d806b2acde
Unconditional Diffusion Guidance
1 INTRODUCTION . Diffusion models have recently emerged as an expressive and flexible family of generative models , delivering competitive sample quality and likelihood scores on image and audio synthesis tasks ( SohlDickstein et al. , 2015 ; Song & Ermon , 2019 ; Ho et al. , 2020 ; Song et al. , 2021b ; Kingma et al. , 2021 ; Song et al. , 2021a ) . These models have delivered audio synthesis performance rivaling the quality of autoregressive models with substantially fewer inference steps ( Chen et al. , 2021 ; Kong et al. , 2021 ) , and they have delivered ImageNet generation results outperforming BigGAN-deep ( Brock et al. , 2019 ) and VQ-VAE-2 ( Razavi et al. , 2019 ) in terms of FID score and classification accuracy score ( Ho et al. , 2021 ; Dhariwal & Nichol , 2021 ) . Dhariwal & Nichol ( 2021 ) proposed classifier guidance , a technique to boost the sample quality of a diffusion model using an extra trained classifier . Prior to classifier guidance , it was not known how to generate “ low temperature ” samples from a diffusion model similar to those produced by truncated BigGAN ( Brock et al. , 2019 ) or low temperature Glow ( Kingma & Dhariwal , 2018 ) : naive attempts , such as scaling the model score vectors or decreasing the amount of Gaussian noise added during diffusion sampling , are ineffective ( Dhariwal & Nichol , 2021 ) . Classifier guidance instead mixes a diffusion model ’ s score estimate with the input gradient of the log probability of a classifier . By varying the strength of the classifier gradient , Dhariwal & Nichol can trade off Inception score ( Salimans et al. , 2016 ) and FID score ( Heusel et al. , 2017 ) ( or precision and recall ) in a manner similar to varying the truncation parameter of BigGAN . We are interested in whether classifier guidance can be performed without a classifier . Because classifier guidance mixes a score estimate with a classifier gradient during sampling , classifier-guided diffusion sampling can be interpreted as attempting to confuse an image classifier with a gradientbased adversarial attack . This raises the question of whether classifier guidance is successful at boosting classifier-based metrics such as FID and Inception score ( IS ) simply because it is adversarial against such classifiers . Stepping in direction of classifier gradients also bears some resemblance to GAN training , particularly with nonparameteric generators ; this also raises the question of whether classifier-guided diffusion models perform well on classifier-based metrics because they are beginning to resemble GANs , which are already known to perform well on such metrics . To resolve these questions , we present unconditional guidance , our guidance method which avoids any classifier entirely . Rather than sampling in the direction of the gradient of an image classifier , unconditional guidance instead mixes the score estimates of a conditional diffusion model and a jointly trained unconditional diffusion model . By sweeping over the mixing weight , we attain a FID/IS tradeoff similar to that attained by classifier guidance . Our unconditional guidance results demonstrate that pure generative diffusion models are capable of synthesizing extremely high fidelity samples possible with other types of generative models . 2 BACKGROUND . We train diffusion models in continuous time ( Song et al. , 2021b ; Chen et al. , 2021 ; Kingma et al. , 2021 ) : letting x ∼ p ( x ) and z = { zλ |λ ∈ [ λmin , λmax ] } for hyperparameters λmin < λmax ∈ R , the forward process q ( z|x ) is the variance-preserving Markov process ( Sohl-Dickstein et al. , 2015 ) : q ( zλ|x ) = N ( αλx , σ2λI ) , where α2λ = 1/ ( 1 + e−λ ) , σ2λ = 1− α2λ ( 1 ) q ( zλ|zλ′ ) = N ( ( αλ/αλ′ ) zλ′ , σ2λ|λ′I ) , where λ < λ ′ , σ2λ|λ′ = ( 1− e λ−λ′ ) σ2λ ( 2 ) We will use the notation p ( z ) ( or p ( zλ ) ) to denote the marginal of z ( or zλ ) when x ∼ p ( x ) and z ∼ q ( z|x ) . Note that λ = logα2λ/σ2λ , so λ can be interpreted as the log signal-to-noise ratio of zλ , and the forward process runs in the direction of decreasing λ . Conditioned on x , the forward process can be described in reverse by the transitions q ( zλ′ |zλ , x ) = N ( µ̃λ′|λ ( zλ , x ) , σ̃2λ′|λI ) , where µ̃λ′|λ ( zλ , x ) = e λ−λ′ ( αλ′/αλ ) zλ + ( 1− eλ−λ ′ ) αλ′x , σ̃ 2 λ′|λ = ( 1− e λ−λ′ ) σ2λ′ ( 3 ) The reverse process generative model starts from pθ ( zλmin ) = N ( 0 , I ) . We specify the transitions : pθ ( zλ′ |zλ ) = N ( µ̃λ′|λ ( zλ , xθ ( zλ ) ) , ( σ̃2λ′|λ ) 1−v ( σ2λ|λ′ ) v ) ( 4 ) During sampling , we apply this transition along an increasing sequence λmin = λ1 < · · · < λT = λmax for T timesteps ; in other words , we follow the discrete time ancestral sampler of Sohl-Dickstein et al . ( 2015 ) ; Ho et al . ( 2020 ) . If the model xθ is correct , then as T →∞ , we obtain samples from an SDE whose sample paths are distributed as p ( z ) ( Song et al. , 2021b ) , and we use pθ ( z ) to denote the continuous time model distribution . The variance is a log-space interpolation of σ̃2λ′|λ and σ 2 λ|λ′ as suggested by Nichol & Dhariwal ( 2021 ) ; we found it effective to use a constant hyperparameter v rather than learned zλ-dependent v. Note that the variances simplify to σ̃2λ′|λ as λ ′ → λ , so v has an effect only when sampling with non-infinitesimal timesteps as done in practice . The reverse process mean comes from an estimate xθ ( zλ ) ≈ x plugged into q ( zλ′ |zλ , x ) ( Ho et al. , 2020 ; Kingma et al. , 2021 ) ( xθ also receives λ as input , but we suppress this to keep our notation clean ) . We parameterize xθ in terms of -prediction ( Ho et al. , 2020 ) : xθ ( zλ ) = ( zλ−σλ θ ( zλ ) ) /αλ , and we train on the objective E , λ [ ‖ θ ( zλ ) − ‖22 ] ( 5 ) where ∼ N ( 0 , I ) , zλ = αλx + σλ , and λ is drawn from a distribution p ( λ ) over [ λmin , λmax ] . This objective is denoising score matching ( Vincent , 2011 ; Hyvärinen & Dayan , 2005 ) over multiple noise scales ( Song & Ermon , 2019 ) , and when p ( λ ) is uniform , the objective is proportional to the variational lower bound on the marginal log likelihood of the latent variable model ∫ p ( x|z ) pθ ( z ) dz , ignoring the term for the unspecified decoder p ( x|z ) and for the prior at zλmin ( Kingma et al. , 2021 ) . If p ( λ ) is not uniform , the objective can be interpreted as weighted variational lower bound whose weighting can be tuned for sample quality ( Ho et al. , 2020 ; Kingma et al. , 2021 ) . We use a p ( λ ) inspired by the discrete time cosine noise schedule of Nichol & Dhariwal ( 2021 ) : we sample λ via λ = −2 log tan ( au+ b ) for uniformly distributed u ∈ [ 0 , 1 ] , where b = arctan ( e−λmax/2 ) and a = arctan ( e−λmin/2 ) − b . This represents a hyperbolic secant distribution modified to be supported on a bounded interval . For finite timestep generation , we use λ values corresponding to uniformly spaced u ∈ [ 0 , 1 ] , and the final generated sample is xθ ( zλmax ) . Because the loss for θ ( zλ ) is denoising score matching for all λ , the score θ ( zλ ) learned by our model estimates the gradient of the log-density of the distribution of our noisy data zλ , that is θ ( zλ ) ≈ σλ∇zλ log p ( zλ ) . Sampling from the learned diffusion model resembles using Langevin diffusion to sample from a sequence of distributions p ( zλ ) that converges to the conditional distribution p ( x ) of the original data x . In the case of conditional generative modeling , the data x is drawn jointly with conditioning information c , i.e . a class label for class-conditional image generation . The only modification to the model is that the reverse process function approximator receives c as input , as in θ ( zλ , c ) . 3 GUIDANCE . An interesting property of certain generative models , such as GANs and flow-based models , is the ability to perform truncated or low temperature sampling by decreasing the variance or range of noise inputs to the generative model at sampling time . The intended effect is to decrease the diversity of the samples while increasing the quality of each individual sample . Truncation in BigGAN ( Brock et al. , 2019 ) , for example , yields a tradeoff curve between FID score and Inception score for low and high amounts of truncation , respectively . Low temperature sampling in Glow ( Kingma & Dhariwal , 2018 ) has a similar effect . Unfortunately , straightforward attempts of implementing truncation or low temperature sampling in diffusion models are ineffective . For example , scaling model scores or decreasing the variance of Gaussian noise in the reverse process cause the diffusion model to generate blurry , low quality samples ( Dhariwal & Nichol , 2021 ) . 3.1 CLASSIFIER GUIDANCE . To obtain a truncation-like effect in diffusion models , Dhariwal & Nichol ( 2021 ) introduce classifier guidance , where the diffusion score θ ( zλ , c ) ≈ σλ∇zλ log p ( zλ|c ) is modified to include the gradient of the log likelihood of an auxiliary classifier model pθ ( c|zλ ) as follows : ̃θ ( zλ , c ) = θ ( zλ , c ) + wσλ∇zλ log pθ ( c|zλ ) ≈ σλ∇zλ [ log p ( zλ|c ) + w log pθ ( c|zλ ) ] , where w is a parameter that controls the strength of the classifier guidance . This modified score ̃θ ( zλ , c ) is then used in place of θ ( zλ , c ) when sampling from the diffusion model , resulting in approximate samples from the distribution p̃θ ( zλ|c ) ∝ pθ ( zλ|c ) pθ ( c|zλ ) w. Algorithm 1 Joint training a diffusion model with unconditional guidance Require : puncond : probability of unconditional training 1 : repeat 2 : ( x , c ) ∼ p ( x , c ) . Sample data with conditioning from the dataset 3 : c← ∅ with probability puncond . Randomly discard conditioning to train unconditionally 4 : λ ∼ p ( λ ) . Sample log SNR value 5 : ∼ N ( 0 , I ) 6 : zλ = αλx+ σλ . Corrupt data to the sampled log SNR value 7 : Take gradient step on ∇θ ‖ θ ( zλ , c ) − ‖2 . Optimization of denoising model 8 : until converged The effect is that of up-weighting the probability of data for which the classifier pθ ( c|zλ ) assigns high likelihood to the correct label : data that can be classified well scores high on the Inception score of perceptual quality ( Salimans et al. , 2016 ) , which rewards generative models for this by design . Dhariwal & Nichol therefore find that by setting w > 0 they can improve the Inception score of their diffusion model , at the expense of decreased diversity in their samples . Figure 2 illustrates the effect of numerically solved guidance p̃θ ( zλ|c ) ∝ pθ ( zλ|c ) pθ ( c|zλ ) w on a toy 2D example of three classes , in which the conditional distribution for each class is an isotropic Gaussian . The form of each conditional upon applying guidance is markedly non-Gaussian . As guidance strength is increased , each conditional places probability mass farther away from other classes and towards directions of high confidence given by logistic regression , and most of the mass becomes concentrated in smaller regions . This behavior can be seen as a simplistic manifestation of the Inception score boost and sample diversity decrease that occur when classifier guidance strength is increased in an ImageNet model . Applying classifier guidance with weight w + 1 to an unconditional model would theoretically lead to the same result as applying classifier guidance with weight w to a conditional model , because pθ ( zλ|c ) pθ ( c|zλ ) w ∝ pθ ( zλ ) pθ ( c|zλ ) w+1 ; or in terms of scores , θ ( zλ ) + ( w + 1 ) σλ∇zλ log pθ ( c|zλ ) ≈ σλ∇zλ [ log p ( zλ ) + ( w + 1 ) log pθ ( c|zλ ) ] = σλ∇zλ [ log p ( zλ|c ) + w log pθ ( c|zλ ) ] , but interestingly , Dhariwal & Nichol obtain their best results when applying classifier guidance to an already class-conditional model , as opposed to applying guidance to an unconditional model . For this reason , we will stay in the setup of guiding an already conditional model .
The paper belongs to the class of diffusion-based generative models for generating synthetic images using class labels as guidance. It starts with a view of a recent work Dhariwal-Nichol (2021) where a classifier model is trained jointly with the diffusion-based generative model and the score (gradient of log probability) of the classifier is magnified and added to the score of the generative model to increase fidelity and the expense of diversity. In the view, Dhariwal-Nichol's approach resembles adversarial attacks of GAN-based approaches, motivating the key question that the paper addresses: whether we can train a generative model without a classifier but still enjoying the ability to trade diversity for fidelity. The answer presented in the paper is to replace the (explicit) classifier with an implicit classifier modeled as a conditioned generative model (conditioned on the class), and the weights between the conditioned generative model than the unconditioned generative model are shared by viewing the unconditioned generative model as part of the conditional model but with an additional null class. Experiments on ImageNet shows that the results compare favourably to Dhariwal-Nichol (2021) and Ho et al (2021), and in some cases slightly outperforming.
SP:5e647ea6f857d222ed538db72d17e7d806b2acde
Triangle and Four Cycle Counting with Predictions in Graph Streams
1 INTRODUCTION . Counting the number of cycles in a graph is a fundamental problem in the graph stream model ( e.g. , Atserias et al . ( 2008 ) ; Bera & Chakrabarti ( 2017 ) ; Seshadhri et al . ( 2013 ) ; Kolountzakis et al . ( 2010 ) ; Bar-Yossef et al . ( 2002 ) ; Kallaugher et al . ( 2019 ) ) . The special case of counting triangles is widely studied , as it has a vast range of applications . In particular , it provides important insights into the structural properties of networks ( Prat-Pérez et al. , 2012 ; Farkas et al. , 2011 ) , and is used to discover motifs in protein interaction networks ( Milo et al. , 2002 ) , understand social networks ( Foucault Welles et al. , 2010 ) , and evaluate large graph models ( Leskovec et al. , 2008 ) . See Al Hasan & Dave ( 2018 ) for a survey of these and other applications . Because of its importance , a large body of research has been devoted to space-efficient streaming algorithms for ( 1 + ) -approximate triangle counting . Such algorithms perform computation in one or few passes over the data using only a sub-linear amount of space . A common difficulty which arises in all previous works is the existence of heavy edges , i.e. , edges that are incident to many triangles ( four cycles ) . As sublinear space algorithms often rely on sampling of edges , and since a single heavy edge can greatly affect the number of triangles ( four cycles ) in a graph , sampling and storing these edges are often the key to an accurate estimation . Therefore , multiple techniques have been developed to determine whether a given edge is heavy or not . Recently , based on the observation that many underlying patterns in real-world data sets do not change quickly over time , machine learning techniques have been incorporated into the data stream model via the training of heavy-hitter oracles . Given access to such a learning-based oracle , a wide range of significant problems in data stream processing — including frequency estimation , estimating the number of distinct elements , Fp-Moments or ( k , p ) -Cascaded Norms — can all achieve space bounds that are better than those provided by “ classical ” algorithms , see , e.g. , Hsu et al . ( 2019a ) ; Cohen et al . ( 2020 ) ; Jiang et al . ( 2020 ) ; Eden et al . ( 2021 ) ; Du et al . ( 2021 ) . More gen- erally , learning-based approaches have had wide success in other algorithmic tasks , such as data structures ( Kraska et al. , 2018 ; Ferragina et al. , 2020 ; Mitzenmacher , 2018 ; Rae et al. , 2019 ; Vaidya et al. , 2021 ) , online algorithms ( Lykouris & Vassilvtiskii , 2018 ; Purohit et al. , 2018 ; Gollapudi & Panigrahi , 2019 ; Rohatgi , 2020 ; Wei , 2020 ; Mitzenmacher , 2020 ; Lattanzi et al. , 2020 ; Bamas et al. , 2020 ) , similarity search ( Wang et al. , 2016 ; Dong et al. , 2020 ) and combinatorial optimization ( Dai et al. , 2017 ; Balcan et al. , 2017 ; 2018a ; b ; 2019 ) . See the survey and references therein for additional works ( Mitzenmacher & Vassilvitskii , 2020 ) . Inspired by these recent advancements , we ask : is it possible to utilize a learned heavy edge oracle to improve the space complexity of subgraph counting in the graph stream model ? Our results demonstrate that the answer is yes . 1.1 OUR RESULTS AND COMPARISON TO PREVIOUS THEORETICAL WORKS . We present theoretical and empirical results in several graph streaming models , and with several notions of prediction oracles . Conceptually , it is useful to begin by studying perfect oracles that provide exact predictions . While instructive theoretically , such oracles are typically not available in practice . We then extend our theoretical results to noisy oracles that can provide inaccurate or wrong predictions . We validate the practicality of such oracles in two ways : by directly showing they can be constructed for multiple real datasets , and by showing that on those datasets , our algorithms attain significant empirical improvements over baselines , when given access to these oracles . We proceed to a precise account of our results . Let G = ( V , E ) denote the input graph , and let n , m , and T denote the number of vertices , edges , and triangles ( or four-cycles ) in G , respectively . There are two major graph edge streaming models : the adjacency list model and the arbitrary order model . We show that training heavy edge oracles is possible in practice in both models , and that such oracles make it possible to design new algorithms that significantly improve the space complexity of triangle and four-cycle counting , both in theory and in practice . Furthermore , our formalization of a heavy edge prediction framework makes it possible to show provable lower bounds as well . Our results are summarized in Table 1 . In our algorithms , we assume that we know a large-constant approximation of T for the purposes of setting various parameters . This is standard practice in the subgraph counting streaming literature ( e.g. , see ( Braverman et al. , 2013 , Section 1 ) , ( McGregor et al. , 2016 , Section 1.2 ) for an extensive discussions on this assumption ) . Moreover , when this assumption can not be directly carried over in practice , in Subsection F.3 we discuss how to adapt our algorithms to overcome this issue . 1.1.1 PERFECT ORACLE . Our first results apply for the case that the algorithms are given access to a perfect heavy edge oracle . That is , for some threshold ρ , the oracle perfectly predicts whether or not a given edge is incident to at least ρ triangles ( four cycles ) . We describe how to relax this assumption in Section 1.1.2 . Adjacency List Model All edges incident to the same node arrive together . We show : Theorem 1.1 . There exists a one-pass algorithm , Algorithm 1 , with space complexity1 Õ ( min ( −2m2/3/T 1/3 , −1m1/2 ) ) in the adjacency list model that , using a learning-based oracle , returns a ( 1± ) -approximation to the number T of triangles with probability at least2 7/10 . An overview of Algorithm 1 is given in Section 2 , and the full analysis is provided in Appendix B . Arbitrary Order Model In this model , the edges arrive in the stream in an arbitrary order . We present a one-pass algorithm for triangle counting and another one-pass algorithm for four cycle counting in this model , both reducing the number of passes compared to the currently best known space complexity algorithms . Our next result is as follows : Theorem 1.2 . There exists a one-pass algorithm , Algorithm 4 , with space complexity Õ ( −1 ( m/ √ T + √ m ) ) in the arbitrary order model that , using a learning-based oracle , returns a ( 1± ) -approximation to the number T of triangles with probability at least 7/10 . 1We use Õ ( f ) to denote O ( f · polylog ( f ) ) . 2For all of our algorithms , the success probability can be replaced by 1 − δ by running log ( 1/δ ) copies of the algorithm and taking the median . An overview of Algorithm 4 is given in Section 3 , and full details are provided in Appendix C. We also show non-trivial space lower bounds that hold even if appropriate predictors are available . In Theorem C.2 in Appendix C.3 , we provide a lower bound for this setting by giving a construction that requires Ω ( min ( m/ √ T , m3/2/T ) ) space even with the help of an oracle , proving that our result is nearly tight in some regimes . Therefore , the triangle counting problem remains non-trivial even when extra information is available . Four Cycle Counting . For four cycle counting in the arbitrary order model , we give Theorem 1.3 which is proven in Appendix D. Theorem 1.3 . There exists a one-pass algorithm , Algorithm 5 , with space complexity Õ ( T 1/3 + −2m/T 1/3 ) in the arbitrary order model that , using a learning-based oracle , returns a ( 1 ± ) - approximation to the number T of four cycles with probability at least 7/10 . To summarize our theoretical contributions , for the first set of results of counting triangles in the adjacency list model , our bounds always improve on the previous state of the art due to McGregor et al . ( 2016 ) for all values of m and T . For a concrete example , consider the case that T = Θ ( √ m ) . In this setting previous bounds result in an Õ ( m3/4 ) -space algorithm , while our algorithm only requires Õ ( √ m ) space ( for constant ) . For the other two problems of counting triangles and 4-cycles in the arbitrary arrival model , our space bounds have an additional additive term compared to McGregor et al . ( 2016 ) ( for triangles ) and Vorotnikova ( 2020 ) ( for 4-cycles ) but importantly run in a single pass rather than multiple passes . In the case where the input graph has high triangles density , T = Ω ( m/ 2 ) , our space bound is worse due to the additive factor . When T = O ( m/ 2 ) , our results achieve the same dependence on m and T as that of the previous algorithms with an improved dependency in . Moreover , the case T ≤ m/ 2 is natural for many real world datasets : for = 0.05 , this condition holds for all of the datasets in our experimental results ( see Table 2 ) . Regardless of the triangle density , a key benefit of our results is that they are achieved in a single pass rather than multiple passes . Finally , our results are for general graphs , and make no assumptions on the input graph ( unlike Pagh & Tsourakakis ( 2012 ) ; Kallaugher & Price ( 2017 ) ; Bera & Sheshadhri ( 2020 ) ) . Most of our algorithms are relatively simple and easy to implement and deploy . At the same time , some of our results require the use of novel techniques in this context , such as the use of exponential random variables ( see Section 2 ) . 1.1.2 NOISY ORACLES . The aforementioned triangle counting results are stated under the assumption that the algorithms are given access to perfect heavy edge oracles . In practice , this assumption is sometimes unrealistic . Hence , we consider several types of noisy oracles . The first such oracle , which we refer to as a K-noisy oracle , is defined below ( see Figure 4 in the Supplementary Section C.2 ) . Definition 1.1 . For an edge e = xy in the stream , define Ne as the number of triangles that contain both x and y . For a fixed constant K ≥ 1 and for a threshold ρ we say that an oracle Oρ is a K-noisy oracle if for every edge e , 1−K · ρNe ≤ Pr [ Oρ ( e ) = HEAVY ] ≤ K · Ne ρ . This oracle ensures that if an edge is extremely heavy or extremely light , it is classified correctly with high probability , but if the edge is close to the threshold , the oracle may be inaccurate . We further discuss the properties of this oracle in Section G. For this oracle , we prove the following two theorems . First , in the adjacency list model , we prove : Theorem 1.4 . Suppose that the oracle given to Algorithm 1 is a K-noisy oracle as defined in Definition 1.1 . Then with probability 2/3 , Algorithm 1 returns a value in ( 1 ± √ K· ) T , and uses space at most Õ ( min ( −2m2/3/T 1/3 , K· −1m1/2 ) ) . Hence , even if our oracle is inaccurate for edges near the threshold , our algorithm still obtains an effective approximation with low space in the adjacency list model . Likewise , for the arbitrary order model , we prove in Theorem C.1 that the O ( −1 ( m/ √ T + √ m ) ) 1-pass algorithm of Theorem 1.2 also works when Algorithm 4 is only given access to a K-noisy oracle . The proof of Theorem 1.4 is provided in Appendix B.1 , and the proof of Theorem C.1 is provided in Appendix C.2 . We remark that Theorems 1.4 and C.1 automatically imply Theorems 1.1 and 1.2 , since the perfect oracle is automatically a K-noisy oracle . ( Noisy ) Value Oracles In the adjacency list model , when we see an edge xy , we also have access to all the neighbors of either x or y , which makes it possible for the oracle to give a more accurate prediction . For an edge xy , let Rxy denote the number of triangles { x , z , y } so that x precedes z and z precedes y in the stream arrival order . Formally , Rxy = |z : { x , y , z } ∈ ∆ and x < s z < s y| where x < s y denotes that the adjacency list of x arrives before that of y in the stream . Motivated by our empirical results in Section F.7 , it is reasonable in some settings to assume we have access to oracles that can predict a good approximation to Rxy . We refer to such oracles as value oracles . In the first version of this oracle , we assume that the probability of approximation error decays linearly with the error from above but exponentially with the error from below . Definition 1.2 . Given an edge e , an ( α , β ) value-prediction oracle outputs a random value p ( e ) where E [ p ( e ) ] ≤ αRe + β , and Pr [ p ( e ) < Reλ − β ] ≤ Ke −λ for some constant K and any λ ≥ 1 . For this variant , we prove the following theorem . Theorem 1.5 . Given an oracle with parameters ( α , β ) , there exists a one-pass algorithm , Algorithm 2 , with space complexity O ( −2 log2 ( K/ ) ( α + mβ/T ) ) in the adjacency list model that returns a ( 1± ) -approximation to the number of triangles T with probability at least 7/10 . In the second version of this noisy oracle , we assume that the probability of approximation error decays linearly with the error from both above and below . For this variant , we prove that we can achieve the same guarantees as Theorem 1.5 up to logarithmic factors ( see Theorem B.1 ) . The algorithms and proofs for both Theorem 1.5 and Theorem B.1 appear in Appendix B.2 . Experiments We conduct experiments to verify our results for triangle counting on a variety of real world networks ( see Table 2 ) in both the arbitrary and adjacency list models . Our algorithms use additional information through predictors to improve empirical performance . The predictors are data dependent and include : memorizing heavy edges in a small portion of the first graph in a sequence of graphs , linear regression , and graph neural networks ( GNNs ) . Our experimental results show that we can achieve up to 5x decrease in estimation error while keeping the same amount of edges as other state of the art empirical algorithms . For more details , see Section 4 . In Section F.7 , we show that our noisy oracle models are realistic for real datasets . Related Empirical Works On the empirical side , most of the focus has been on triangle counting in the arbitrary order model for which there are several algorithms that work well in practice . We primarily focus on two state-of-the-art baselines , ThinkD ( Shin et al. , 2018 ) and WRS ( Shin , 2017 ) . In these works , the authors compare to previous empirical benchmarks such as the ones given in Stefani et al . ( 2017 ) ; Han & Sethu ( 2017 ) ; Lim & Kang ( 2015 ) and demonstrate that their algorithms achieve superior estimates over these benchmarks . There are also other empirical works such as Ahmed et al . ( 2017 ) and Ahmed & Duffield ( 2020 ) studying this model but they do not compare to either ThinkD or WRS . While these empirical papers demonstrate that their algorithm returns unbiased estimates , their theoretical guarantees on space is incomparable to the previously stated space bounds for theoretical algorithms in Table 1 . Nevertheless , we use ThinkD and WRS as part of our benchmarks due to their strong practical performance and code accessibility . Implicit Predictors in Prior Works The idea of using a predictor is implicit in many prior works . The optimal two pass triangle counting algorithm of McGregor et al . ( 2016 ) can be viewed as an implementation of a heavy edge oracle after the first pass . This oracle is even stronger than the Knoisy oracle as it is equivalent to an oracle that is always correct on an edge e if Ne either exceeds or is under the threshold ρ by a constant multiplicative factor . This further supports our choice of oracles in our theoretical results , as a stronger version of our oracle can be implemented using one additional pass through the data stream ( see Section G ) . Similarly , the optimal triangle counting streaming algorithm ( assuming a random order ) given in McGregor & Vorotnikova ( 2020 ) also implicitly defines a heavy edge oracle using a small initial portion of the random stream ( see Lemma 2.2 in McGregor & Vorotnikova ( 2020 ) ) . The random order assumption allows for the creation of such an oracle since heavy edges are likely to have many of their incident triangle edges appearing in an initial portion of the stream . We view these two prior works as theoretical justification for our oracle definitions . Lastly , the WRS algorithm also shares the feature of defining an implicit oracle : some space is reserved for keeping the most recent edges while the rest is used to keep a random sample of edges . This can be viewed as a specific variant of our model , where the oracle predicts recent edges as heavy . Preliminaries . G = ( V , E ) denotes the input graph , and n , m and T denote the number of vertices , edges and triangles ( or four-cycles ) inG , respectively . We useN ( v ) to denote the set of neighbors of a node v , and ∆ to denote the set of triangles . In triangle counting , for each xy ∈ E ( G ) , we recall that Nxy = |z : { x , y , z } ∈ ∆| is the number of triangles incident to edge xy , and Rxy = |z : { x , y , z } ∈ ∆ , x < s z < s y| is the number of triangles adjacent to xy with the third vertex z of the triangle between x and y in the adjacency list order . Table A summarizes the notation .
The paper proposes a one pass streaming algorithms for estimating the number of triangles in adjacency list and arbitrary order models and 4-cycle in arbitrary edge arrival order. The authors propose algorithms for these streaming models under the assumption of a "heavy" edge oracle/ML model. The paper support theoretical claims with empirical experiments.
SP:aa69cc79554eabf5cfd82a7f07ce851de9c16c7d
Triangle and Four Cycle Counting with Predictions in Graph Streams
1 INTRODUCTION . Counting the number of cycles in a graph is a fundamental problem in the graph stream model ( e.g. , Atserias et al . ( 2008 ) ; Bera & Chakrabarti ( 2017 ) ; Seshadhri et al . ( 2013 ) ; Kolountzakis et al . ( 2010 ) ; Bar-Yossef et al . ( 2002 ) ; Kallaugher et al . ( 2019 ) ) . The special case of counting triangles is widely studied , as it has a vast range of applications . In particular , it provides important insights into the structural properties of networks ( Prat-Pérez et al. , 2012 ; Farkas et al. , 2011 ) , and is used to discover motifs in protein interaction networks ( Milo et al. , 2002 ) , understand social networks ( Foucault Welles et al. , 2010 ) , and evaluate large graph models ( Leskovec et al. , 2008 ) . See Al Hasan & Dave ( 2018 ) for a survey of these and other applications . Because of its importance , a large body of research has been devoted to space-efficient streaming algorithms for ( 1 + ) -approximate triangle counting . Such algorithms perform computation in one or few passes over the data using only a sub-linear amount of space . A common difficulty which arises in all previous works is the existence of heavy edges , i.e. , edges that are incident to many triangles ( four cycles ) . As sublinear space algorithms often rely on sampling of edges , and since a single heavy edge can greatly affect the number of triangles ( four cycles ) in a graph , sampling and storing these edges are often the key to an accurate estimation . Therefore , multiple techniques have been developed to determine whether a given edge is heavy or not . Recently , based on the observation that many underlying patterns in real-world data sets do not change quickly over time , machine learning techniques have been incorporated into the data stream model via the training of heavy-hitter oracles . Given access to such a learning-based oracle , a wide range of significant problems in data stream processing — including frequency estimation , estimating the number of distinct elements , Fp-Moments or ( k , p ) -Cascaded Norms — can all achieve space bounds that are better than those provided by “ classical ” algorithms , see , e.g. , Hsu et al . ( 2019a ) ; Cohen et al . ( 2020 ) ; Jiang et al . ( 2020 ) ; Eden et al . ( 2021 ) ; Du et al . ( 2021 ) . More gen- erally , learning-based approaches have had wide success in other algorithmic tasks , such as data structures ( Kraska et al. , 2018 ; Ferragina et al. , 2020 ; Mitzenmacher , 2018 ; Rae et al. , 2019 ; Vaidya et al. , 2021 ) , online algorithms ( Lykouris & Vassilvtiskii , 2018 ; Purohit et al. , 2018 ; Gollapudi & Panigrahi , 2019 ; Rohatgi , 2020 ; Wei , 2020 ; Mitzenmacher , 2020 ; Lattanzi et al. , 2020 ; Bamas et al. , 2020 ) , similarity search ( Wang et al. , 2016 ; Dong et al. , 2020 ) and combinatorial optimization ( Dai et al. , 2017 ; Balcan et al. , 2017 ; 2018a ; b ; 2019 ) . See the survey and references therein for additional works ( Mitzenmacher & Vassilvitskii , 2020 ) . Inspired by these recent advancements , we ask : is it possible to utilize a learned heavy edge oracle to improve the space complexity of subgraph counting in the graph stream model ? Our results demonstrate that the answer is yes . 1.1 OUR RESULTS AND COMPARISON TO PREVIOUS THEORETICAL WORKS . We present theoretical and empirical results in several graph streaming models , and with several notions of prediction oracles . Conceptually , it is useful to begin by studying perfect oracles that provide exact predictions . While instructive theoretically , such oracles are typically not available in practice . We then extend our theoretical results to noisy oracles that can provide inaccurate or wrong predictions . We validate the practicality of such oracles in two ways : by directly showing they can be constructed for multiple real datasets , and by showing that on those datasets , our algorithms attain significant empirical improvements over baselines , when given access to these oracles . We proceed to a precise account of our results . Let G = ( V , E ) denote the input graph , and let n , m , and T denote the number of vertices , edges , and triangles ( or four-cycles ) in G , respectively . There are two major graph edge streaming models : the adjacency list model and the arbitrary order model . We show that training heavy edge oracles is possible in practice in both models , and that such oracles make it possible to design new algorithms that significantly improve the space complexity of triangle and four-cycle counting , both in theory and in practice . Furthermore , our formalization of a heavy edge prediction framework makes it possible to show provable lower bounds as well . Our results are summarized in Table 1 . In our algorithms , we assume that we know a large-constant approximation of T for the purposes of setting various parameters . This is standard practice in the subgraph counting streaming literature ( e.g. , see ( Braverman et al. , 2013 , Section 1 ) , ( McGregor et al. , 2016 , Section 1.2 ) for an extensive discussions on this assumption ) . Moreover , when this assumption can not be directly carried over in practice , in Subsection F.3 we discuss how to adapt our algorithms to overcome this issue . 1.1.1 PERFECT ORACLE . Our first results apply for the case that the algorithms are given access to a perfect heavy edge oracle . That is , for some threshold ρ , the oracle perfectly predicts whether or not a given edge is incident to at least ρ triangles ( four cycles ) . We describe how to relax this assumption in Section 1.1.2 . Adjacency List Model All edges incident to the same node arrive together . We show : Theorem 1.1 . There exists a one-pass algorithm , Algorithm 1 , with space complexity1 Õ ( min ( −2m2/3/T 1/3 , −1m1/2 ) ) in the adjacency list model that , using a learning-based oracle , returns a ( 1± ) -approximation to the number T of triangles with probability at least2 7/10 . An overview of Algorithm 1 is given in Section 2 , and the full analysis is provided in Appendix B . Arbitrary Order Model In this model , the edges arrive in the stream in an arbitrary order . We present a one-pass algorithm for triangle counting and another one-pass algorithm for four cycle counting in this model , both reducing the number of passes compared to the currently best known space complexity algorithms . Our next result is as follows : Theorem 1.2 . There exists a one-pass algorithm , Algorithm 4 , with space complexity Õ ( −1 ( m/ √ T + √ m ) ) in the arbitrary order model that , using a learning-based oracle , returns a ( 1± ) -approximation to the number T of triangles with probability at least 7/10 . 1We use Õ ( f ) to denote O ( f · polylog ( f ) ) . 2For all of our algorithms , the success probability can be replaced by 1 − δ by running log ( 1/δ ) copies of the algorithm and taking the median . An overview of Algorithm 4 is given in Section 3 , and full details are provided in Appendix C. We also show non-trivial space lower bounds that hold even if appropriate predictors are available . In Theorem C.2 in Appendix C.3 , we provide a lower bound for this setting by giving a construction that requires Ω ( min ( m/ √ T , m3/2/T ) ) space even with the help of an oracle , proving that our result is nearly tight in some regimes . Therefore , the triangle counting problem remains non-trivial even when extra information is available . Four Cycle Counting . For four cycle counting in the arbitrary order model , we give Theorem 1.3 which is proven in Appendix D. Theorem 1.3 . There exists a one-pass algorithm , Algorithm 5 , with space complexity Õ ( T 1/3 + −2m/T 1/3 ) in the arbitrary order model that , using a learning-based oracle , returns a ( 1 ± ) - approximation to the number T of four cycles with probability at least 7/10 . To summarize our theoretical contributions , for the first set of results of counting triangles in the adjacency list model , our bounds always improve on the previous state of the art due to McGregor et al . ( 2016 ) for all values of m and T . For a concrete example , consider the case that T = Θ ( √ m ) . In this setting previous bounds result in an Õ ( m3/4 ) -space algorithm , while our algorithm only requires Õ ( √ m ) space ( for constant ) . For the other two problems of counting triangles and 4-cycles in the arbitrary arrival model , our space bounds have an additional additive term compared to McGregor et al . ( 2016 ) ( for triangles ) and Vorotnikova ( 2020 ) ( for 4-cycles ) but importantly run in a single pass rather than multiple passes . In the case where the input graph has high triangles density , T = Ω ( m/ 2 ) , our space bound is worse due to the additive factor . When T = O ( m/ 2 ) , our results achieve the same dependence on m and T as that of the previous algorithms with an improved dependency in . Moreover , the case T ≤ m/ 2 is natural for many real world datasets : for = 0.05 , this condition holds for all of the datasets in our experimental results ( see Table 2 ) . Regardless of the triangle density , a key benefit of our results is that they are achieved in a single pass rather than multiple passes . Finally , our results are for general graphs , and make no assumptions on the input graph ( unlike Pagh & Tsourakakis ( 2012 ) ; Kallaugher & Price ( 2017 ) ; Bera & Sheshadhri ( 2020 ) ) . Most of our algorithms are relatively simple and easy to implement and deploy . At the same time , some of our results require the use of novel techniques in this context , such as the use of exponential random variables ( see Section 2 ) . 1.1.2 NOISY ORACLES . The aforementioned triangle counting results are stated under the assumption that the algorithms are given access to perfect heavy edge oracles . In practice , this assumption is sometimes unrealistic . Hence , we consider several types of noisy oracles . The first such oracle , which we refer to as a K-noisy oracle , is defined below ( see Figure 4 in the Supplementary Section C.2 ) . Definition 1.1 . For an edge e = xy in the stream , define Ne as the number of triangles that contain both x and y . For a fixed constant K ≥ 1 and for a threshold ρ we say that an oracle Oρ is a K-noisy oracle if for every edge e , 1−K · ρNe ≤ Pr [ Oρ ( e ) = HEAVY ] ≤ K · Ne ρ . This oracle ensures that if an edge is extremely heavy or extremely light , it is classified correctly with high probability , but if the edge is close to the threshold , the oracle may be inaccurate . We further discuss the properties of this oracle in Section G. For this oracle , we prove the following two theorems . First , in the adjacency list model , we prove : Theorem 1.4 . Suppose that the oracle given to Algorithm 1 is a K-noisy oracle as defined in Definition 1.1 . Then with probability 2/3 , Algorithm 1 returns a value in ( 1 ± √ K· ) T , and uses space at most Õ ( min ( −2m2/3/T 1/3 , K· −1m1/2 ) ) . Hence , even if our oracle is inaccurate for edges near the threshold , our algorithm still obtains an effective approximation with low space in the adjacency list model . Likewise , for the arbitrary order model , we prove in Theorem C.1 that the O ( −1 ( m/ √ T + √ m ) ) 1-pass algorithm of Theorem 1.2 also works when Algorithm 4 is only given access to a K-noisy oracle . The proof of Theorem 1.4 is provided in Appendix B.1 , and the proof of Theorem C.1 is provided in Appendix C.2 . We remark that Theorems 1.4 and C.1 automatically imply Theorems 1.1 and 1.2 , since the perfect oracle is automatically a K-noisy oracle . ( Noisy ) Value Oracles In the adjacency list model , when we see an edge xy , we also have access to all the neighbors of either x or y , which makes it possible for the oracle to give a more accurate prediction . For an edge xy , let Rxy denote the number of triangles { x , z , y } so that x precedes z and z precedes y in the stream arrival order . Formally , Rxy = |z : { x , y , z } ∈ ∆ and x < s z < s y| where x < s y denotes that the adjacency list of x arrives before that of y in the stream . Motivated by our empirical results in Section F.7 , it is reasonable in some settings to assume we have access to oracles that can predict a good approximation to Rxy . We refer to such oracles as value oracles . In the first version of this oracle , we assume that the probability of approximation error decays linearly with the error from above but exponentially with the error from below . Definition 1.2 . Given an edge e , an ( α , β ) value-prediction oracle outputs a random value p ( e ) where E [ p ( e ) ] ≤ αRe + β , and Pr [ p ( e ) < Reλ − β ] ≤ Ke −λ for some constant K and any λ ≥ 1 . For this variant , we prove the following theorem . Theorem 1.5 . Given an oracle with parameters ( α , β ) , there exists a one-pass algorithm , Algorithm 2 , with space complexity O ( −2 log2 ( K/ ) ( α + mβ/T ) ) in the adjacency list model that returns a ( 1± ) -approximation to the number of triangles T with probability at least 7/10 . In the second version of this noisy oracle , we assume that the probability of approximation error decays linearly with the error from both above and below . For this variant , we prove that we can achieve the same guarantees as Theorem 1.5 up to logarithmic factors ( see Theorem B.1 ) . The algorithms and proofs for both Theorem 1.5 and Theorem B.1 appear in Appendix B.2 . Experiments We conduct experiments to verify our results for triangle counting on a variety of real world networks ( see Table 2 ) in both the arbitrary and adjacency list models . Our algorithms use additional information through predictors to improve empirical performance . The predictors are data dependent and include : memorizing heavy edges in a small portion of the first graph in a sequence of graphs , linear regression , and graph neural networks ( GNNs ) . Our experimental results show that we can achieve up to 5x decrease in estimation error while keeping the same amount of edges as other state of the art empirical algorithms . For more details , see Section 4 . In Section F.7 , we show that our noisy oracle models are realistic for real datasets . Related Empirical Works On the empirical side , most of the focus has been on triangle counting in the arbitrary order model for which there are several algorithms that work well in practice . We primarily focus on two state-of-the-art baselines , ThinkD ( Shin et al. , 2018 ) and WRS ( Shin , 2017 ) . In these works , the authors compare to previous empirical benchmarks such as the ones given in Stefani et al . ( 2017 ) ; Han & Sethu ( 2017 ) ; Lim & Kang ( 2015 ) and demonstrate that their algorithms achieve superior estimates over these benchmarks . There are also other empirical works such as Ahmed et al . ( 2017 ) and Ahmed & Duffield ( 2020 ) studying this model but they do not compare to either ThinkD or WRS . While these empirical papers demonstrate that their algorithm returns unbiased estimates , their theoretical guarantees on space is incomparable to the previously stated space bounds for theoretical algorithms in Table 1 . Nevertheless , we use ThinkD and WRS as part of our benchmarks due to their strong practical performance and code accessibility . Implicit Predictors in Prior Works The idea of using a predictor is implicit in many prior works . The optimal two pass triangle counting algorithm of McGregor et al . ( 2016 ) can be viewed as an implementation of a heavy edge oracle after the first pass . This oracle is even stronger than the Knoisy oracle as it is equivalent to an oracle that is always correct on an edge e if Ne either exceeds or is under the threshold ρ by a constant multiplicative factor . This further supports our choice of oracles in our theoretical results , as a stronger version of our oracle can be implemented using one additional pass through the data stream ( see Section G ) . Similarly , the optimal triangle counting streaming algorithm ( assuming a random order ) given in McGregor & Vorotnikova ( 2020 ) also implicitly defines a heavy edge oracle using a small initial portion of the random stream ( see Lemma 2.2 in McGregor & Vorotnikova ( 2020 ) ) . The random order assumption allows for the creation of such an oracle since heavy edges are likely to have many of their incident triangle edges appearing in an initial portion of the stream . We view these two prior works as theoretical justification for our oracle definitions . Lastly , the WRS algorithm also shares the feature of defining an implicit oracle : some space is reserved for keeping the most recent edges while the rest is used to keep a random sample of edges . This can be viewed as a specific variant of our model , where the oracle predicts recent edges as heavy . Preliminaries . G = ( V , E ) denotes the input graph , and n , m and T denote the number of vertices , edges and triangles ( or four-cycles ) inG , respectively . We useN ( v ) to denote the set of neighbors of a node v , and ∆ to denote the set of triangles . In triangle counting , for each xy ∈ E ( G ) , we recall that Nxy = |z : { x , y , z } ∈ ∆| is the number of triangles incident to edge xy , and Rxy = |z : { x , y , z } ∈ ∆ , x < s z < s y| is the number of triangles adjacent to xy with the third vertex z of the triangle between x and y in the adjacency list order . Table A summarizes the notation .
The line of research of improving sketching data structures/sampling with the help of learned models is becoming quite popular. This paper follows this line of research and applies this paradigm to the problem of cycle counting in graph streams ( specifically triangles and four-cycles). It provides a theoretical framework for analyzing Oracle-based problems, analyzing the paradigm's space bounds in cycle counting, and providing lower bounds for the problems.
SP:aa69cc79554eabf5cfd82a7f07ce851de9c16c7d
Triangle and Four Cycle Counting with Predictions in Graph Streams
1 INTRODUCTION . Counting the number of cycles in a graph is a fundamental problem in the graph stream model ( e.g. , Atserias et al . ( 2008 ) ; Bera & Chakrabarti ( 2017 ) ; Seshadhri et al . ( 2013 ) ; Kolountzakis et al . ( 2010 ) ; Bar-Yossef et al . ( 2002 ) ; Kallaugher et al . ( 2019 ) ) . The special case of counting triangles is widely studied , as it has a vast range of applications . In particular , it provides important insights into the structural properties of networks ( Prat-Pérez et al. , 2012 ; Farkas et al. , 2011 ) , and is used to discover motifs in protein interaction networks ( Milo et al. , 2002 ) , understand social networks ( Foucault Welles et al. , 2010 ) , and evaluate large graph models ( Leskovec et al. , 2008 ) . See Al Hasan & Dave ( 2018 ) for a survey of these and other applications . Because of its importance , a large body of research has been devoted to space-efficient streaming algorithms for ( 1 + ) -approximate triangle counting . Such algorithms perform computation in one or few passes over the data using only a sub-linear amount of space . A common difficulty which arises in all previous works is the existence of heavy edges , i.e. , edges that are incident to many triangles ( four cycles ) . As sublinear space algorithms often rely on sampling of edges , and since a single heavy edge can greatly affect the number of triangles ( four cycles ) in a graph , sampling and storing these edges are often the key to an accurate estimation . Therefore , multiple techniques have been developed to determine whether a given edge is heavy or not . Recently , based on the observation that many underlying patterns in real-world data sets do not change quickly over time , machine learning techniques have been incorporated into the data stream model via the training of heavy-hitter oracles . Given access to such a learning-based oracle , a wide range of significant problems in data stream processing — including frequency estimation , estimating the number of distinct elements , Fp-Moments or ( k , p ) -Cascaded Norms — can all achieve space bounds that are better than those provided by “ classical ” algorithms , see , e.g. , Hsu et al . ( 2019a ) ; Cohen et al . ( 2020 ) ; Jiang et al . ( 2020 ) ; Eden et al . ( 2021 ) ; Du et al . ( 2021 ) . More gen- erally , learning-based approaches have had wide success in other algorithmic tasks , such as data structures ( Kraska et al. , 2018 ; Ferragina et al. , 2020 ; Mitzenmacher , 2018 ; Rae et al. , 2019 ; Vaidya et al. , 2021 ) , online algorithms ( Lykouris & Vassilvtiskii , 2018 ; Purohit et al. , 2018 ; Gollapudi & Panigrahi , 2019 ; Rohatgi , 2020 ; Wei , 2020 ; Mitzenmacher , 2020 ; Lattanzi et al. , 2020 ; Bamas et al. , 2020 ) , similarity search ( Wang et al. , 2016 ; Dong et al. , 2020 ) and combinatorial optimization ( Dai et al. , 2017 ; Balcan et al. , 2017 ; 2018a ; b ; 2019 ) . See the survey and references therein for additional works ( Mitzenmacher & Vassilvitskii , 2020 ) . Inspired by these recent advancements , we ask : is it possible to utilize a learned heavy edge oracle to improve the space complexity of subgraph counting in the graph stream model ? Our results demonstrate that the answer is yes . 1.1 OUR RESULTS AND COMPARISON TO PREVIOUS THEORETICAL WORKS . We present theoretical and empirical results in several graph streaming models , and with several notions of prediction oracles . Conceptually , it is useful to begin by studying perfect oracles that provide exact predictions . While instructive theoretically , such oracles are typically not available in practice . We then extend our theoretical results to noisy oracles that can provide inaccurate or wrong predictions . We validate the practicality of such oracles in two ways : by directly showing they can be constructed for multiple real datasets , and by showing that on those datasets , our algorithms attain significant empirical improvements over baselines , when given access to these oracles . We proceed to a precise account of our results . Let G = ( V , E ) denote the input graph , and let n , m , and T denote the number of vertices , edges , and triangles ( or four-cycles ) in G , respectively . There are two major graph edge streaming models : the adjacency list model and the arbitrary order model . We show that training heavy edge oracles is possible in practice in both models , and that such oracles make it possible to design new algorithms that significantly improve the space complexity of triangle and four-cycle counting , both in theory and in practice . Furthermore , our formalization of a heavy edge prediction framework makes it possible to show provable lower bounds as well . Our results are summarized in Table 1 . In our algorithms , we assume that we know a large-constant approximation of T for the purposes of setting various parameters . This is standard practice in the subgraph counting streaming literature ( e.g. , see ( Braverman et al. , 2013 , Section 1 ) , ( McGregor et al. , 2016 , Section 1.2 ) for an extensive discussions on this assumption ) . Moreover , when this assumption can not be directly carried over in practice , in Subsection F.3 we discuss how to adapt our algorithms to overcome this issue . 1.1.1 PERFECT ORACLE . Our first results apply for the case that the algorithms are given access to a perfect heavy edge oracle . That is , for some threshold ρ , the oracle perfectly predicts whether or not a given edge is incident to at least ρ triangles ( four cycles ) . We describe how to relax this assumption in Section 1.1.2 . Adjacency List Model All edges incident to the same node arrive together . We show : Theorem 1.1 . There exists a one-pass algorithm , Algorithm 1 , with space complexity1 Õ ( min ( −2m2/3/T 1/3 , −1m1/2 ) ) in the adjacency list model that , using a learning-based oracle , returns a ( 1± ) -approximation to the number T of triangles with probability at least2 7/10 . An overview of Algorithm 1 is given in Section 2 , and the full analysis is provided in Appendix B . Arbitrary Order Model In this model , the edges arrive in the stream in an arbitrary order . We present a one-pass algorithm for triangle counting and another one-pass algorithm for four cycle counting in this model , both reducing the number of passes compared to the currently best known space complexity algorithms . Our next result is as follows : Theorem 1.2 . There exists a one-pass algorithm , Algorithm 4 , with space complexity Õ ( −1 ( m/ √ T + √ m ) ) in the arbitrary order model that , using a learning-based oracle , returns a ( 1± ) -approximation to the number T of triangles with probability at least 7/10 . 1We use Õ ( f ) to denote O ( f · polylog ( f ) ) . 2For all of our algorithms , the success probability can be replaced by 1 − δ by running log ( 1/δ ) copies of the algorithm and taking the median . An overview of Algorithm 4 is given in Section 3 , and full details are provided in Appendix C. We also show non-trivial space lower bounds that hold even if appropriate predictors are available . In Theorem C.2 in Appendix C.3 , we provide a lower bound for this setting by giving a construction that requires Ω ( min ( m/ √ T , m3/2/T ) ) space even with the help of an oracle , proving that our result is nearly tight in some regimes . Therefore , the triangle counting problem remains non-trivial even when extra information is available . Four Cycle Counting . For four cycle counting in the arbitrary order model , we give Theorem 1.3 which is proven in Appendix D. Theorem 1.3 . There exists a one-pass algorithm , Algorithm 5 , with space complexity Õ ( T 1/3 + −2m/T 1/3 ) in the arbitrary order model that , using a learning-based oracle , returns a ( 1 ± ) - approximation to the number T of four cycles with probability at least 7/10 . To summarize our theoretical contributions , for the first set of results of counting triangles in the adjacency list model , our bounds always improve on the previous state of the art due to McGregor et al . ( 2016 ) for all values of m and T . For a concrete example , consider the case that T = Θ ( √ m ) . In this setting previous bounds result in an Õ ( m3/4 ) -space algorithm , while our algorithm only requires Õ ( √ m ) space ( for constant ) . For the other two problems of counting triangles and 4-cycles in the arbitrary arrival model , our space bounds have an additional additive term compared to McGregor et al . ( 2016 ) ( for triangles ) and Vorotnikova ( 2020 ) ( for 4-cycles ) but importantly run in a single pass rather than multiple passes . In the case where the input graph has high triangles density , T = Ω ( m/ 2 ) , our space bound is worse due to the additive factor . When T = O ( m/ 2 ) , our results achieve the same dependence on m and T as that of the previous algorithms with an improved dependency in . Moreover , the case T ≤ m/ 2 is natural for many real world datasets : for = 0.05 , this condition holds for all of the datasets in our experimental results ( see Table 2 ) . Regardless of the triangle density , a key benefit of our results is that they are achieved in a single pass rather than multiple passes . Finally , our results are for general graphs , and make no assumptions on the input graph ( unlike Pagh & Tsourakakis ( 2012 ) ; Kallaugher & Price ( 2017 ) ; Bera & Sheshadhri ( 2020 ) ) . Most of our algorithms are relatively simple and easy to implement and deploy . At the same time , some of our results require the use of novel techniques in this context , such as the use of exponential random variables ( see Section 2 ) . 1.1.2 NOISY ORACLES . The aforementioned triangle counting results are stated under the assumption that the algorithms are given access to perfect heavy edge oracles . In practice , this assumption is sometimes unrealistic . Hence , we consider several types of noisy oracles . The first such oracle , which we refer to as a K-noisy oracle , is defined below ( see Figure 4 in the Supplementary Section C.2 ) . Definition 1.1 . For an edge e = xy in the stream , define Ne as the number of triangles that contain both x and y . For a fixed constant K ≥ 1 and for a threshold ρ we say that an oracle Oρ is a K-noisy oracle if for every edge e , 1−K · ρNe ≤ Pr [ Oρ ( e ) = HEAVY ] ≤ K · Ne ρ . This oracle ensures that if an edge is extremely heavy or extremely light , it is classified correctly with high probability , but if the edge is close to the threshold , the oracle may be inaccurate . We further discuss the properties of this oracle in Section G. For this oracle , we prove the following two theorems . First , in the adjacency list model , we prove : Theorem 1.4 . Suppose that the oracle given to Algorithm 1 is a K-noisy oracle as defined in Definition 1.1 . Then with probability 2/3 , Algorithm 1 returns a value in ( 1 ± √ K· ) T , and uses space at most Õ ( min ( −2m2/3/T 1/3 , K· −1m1/2 ) ) . Hence , even if our oracle is inaccurate for edges near the threshold , our algorithm still obtains an effective approximation with low space in the adjacency list model . Likewise , for the arbitrary order model , we prove in Theorem C.1 that the O ( −1 ( m/ √ T + √ m ) ) 1-pass algorithm of Theorem 1.2 also works when Algorithm 4 is only given access to a K-noisy oracle . The proof of Theorem 1.4 is provided in Appendix B.1 , and the proof of Theorem C.1 is provided in Appendix C.2 . We remark that Theorems 1.4 and C.1 automatically imply Theorems 1.1 and 1.2 , since the perfect oracle is automatically a K-noisy oracle . ( Noisy ) Value Oracles In the adjacency list model , when we see an edge xy , we also have access to all the neighbors of either x or y , which makes it possible for the oracle to give a more accurate prediction . For an edge xy , let Rxy denote the number of triangles { x , z , y } so that x precedes z and z precedes y in the stream arrival order . Formally , Rxy = |z : { x , y , z } ∈ ∆ and x < s z < s y| where x < s y denotes that the adjacency list of x arrives before that of y in the stream . Motivated by our empirical results in Section F.7 , it is reasonable in some settings to assume we have access to oracles that can predict a good approximation to Rxy . We refer to such oracles as value oracles . In the first version of this oracle , we assume that the probability of approximation error decays linearly with the error from above but exponentially with the error from below . Definition 1.2 . Given an edge e , an ( α , β ) value-prediction oracle outputs a random value p ( e ) where E [ p ( e ) ] ≤ αRe + β , and Pr [ p ( e ) < Reλ − β ] ≤ Ke −λ for some constant K and any λ ≥ 1 . For this variant , we prove the following theorem . Theorem 1.5 . Given an oracle with parameters ( α , β ) , there exists a one-pass algorithm , Algorithm 2 , with space complexity O ( −2 log2 ( K/ ) ( α + mβ/T ) ) in the adjacency list model that returns a ( 1± ) -approximation to the number of triangles T with probability at least 7/10 . In the second version of this noisy oracle , we assume that the probability of approximation error decays linearly with the error from both above and below . For this variant , we prove that we can achieve the same guarantees as Theorem 1.5 up to logarithmic factors ( see Theorem B.1 ) . The algorithms and proofs for both Theorem 1.5 and Theorem B.1 appear in Appendix B.2 . Experiments We conduct experiments to verify our results for triangle counting on a variety of real world networks ( see Table 2 ) in both the arbitrary and adjacency list models . Our algorithms use additional information through predictors to improve empirical performance . The predictors are data dependent and include : memorizing heavy edges in a small portion of the first graph in a sequence of graphs , linear regression , and graph neural networks ( GNNs ) . Our experimental results show that we can achieve up to 5x decrease in estimation error while keeping the same amount of edges as other state of the art empirical algorithms . For more details , see Section 4 . In Section F.7 , we show that our noisy oracle models are realistic for real datasets . Related Empirical Works On the empirical side , most of the focus has been on triangle counting in the arbitrary order model for which there are several algorithms that work well in practice . We primarily focus on two state-of-the-art baselines , ThinkD ( Shin et al. , 2018 ) and WRS ( Shin , 2017 ) . In these works , the authors compare to previous empirical benchmarks such as the ones given in Stefani et al . ( 2017 ) ; Han & Sethu ( 2017 ) ; Lim & Kang ( 2015 ) and demonstrate that their algorithms achieve superior estimates over these benchmarks . There are also other empirical works such as Ahmed et al . ( 2017 ) and Ahmed & Duffield ( 2020 ) studying this model but they do not compare to either ThinkD or WRS . While these empirical papers demonstrate that their algorithm returns unbiased estimates , their theoretical guarantees on space is incomparable to the previously stated space bounds for theoretical algorithms in Table 1 . Nevertheless , we use ThinkD and WRS as part of our benchmarks due to their strong practical performance and code accessibility . Implicit Predictors in Prior Works The idea of using a predictor is implicit in many prior works . The optimal two pass triangle counting algorithm of McGregor et al . ( 2016 ) can be viewed as an implementation of a heavy edge oracle after the first pass . This oracle is even stronger than the Knoisy oracle as it is equivalent to an oracle that is always correct on an edge e if Ne either exceeds or is under the threshold ρ by a constant multiplicative factor . This further supports our choice of oracles in our theoretical results , as a stronger version of our oracle can be implemented using one additional pass through the data stream ( see Section G ) . Similarly , the optimal triangle counting streaming algorithm ( assuming a random order ) given in McGregor & Vorotnikova ( 2020 ) also implicitly defines a heavy edge oracle using a small initial portion of the random stream ( see Lemma 2.2 in McGregor & Vorotnikova ( 2020 ) ) . The random order assumption allows for the creation of such an oracle since heavy edges are likely to have many of their incident triangle edges appearing in an initial portion of the stream . We view these two prior works as theoretical justification for our oracle definitions . Lastly , the WRS algorithm also shares the feature of defining an implicit oracle : some space is reserved for keeping the most recent edges while the rest is used to keep a random sample of edges . This can be viewed as a specific variant of our model , where the oracle predicts recent edges as heavy . Preliminaries . G = ( V , E ) denotes the input graph , and n , m and T denote the number of vertices , edges and triangles ( or four-cycles ) inG , respectively . We useN ( v ) to denote the set of neighbors of a node v , and ∆ to denote the set of triangles . In triangle counting , for each xy ∈ E ( G ) , we recall that Nxy = |z : { x , y , z } ∈ ∆| is the number of triangles incident to edge xy , and Rxy = |z : { x , y , z } ∈ ∆ , x < s z < s y| is the number of triangles adjacent to xy with the third vertex z of the triangle between x and y in the adjacency list order . Table A summarizes the notation .
Counting small length cycles in graph streams is an important graph mining primitive. For example, triangles, i.e., cycles of length 3, play an important role in analyzing social networks. Due to the importance of triangle counting, a wide variety of streaming algorithms in different graph steaming models have been proposed over the years. This work asks the following question: if there is an oracle than can provide information to whether an edge participates in many or few triangles, can we improve the space required? This work comes as a natural contribution to a recent series of works on streaming algorithms that assume the existence of an oracle of some form. The authors formalize the notion of an oracle in two ways, similarly to classification and regression. The former is defined in definition 1.1 where the oracle decides whether or not an edge is "heavy", whereas the latter is termed as the "noisy value oracle" (definition 1.2). The authors contribute to the problem of counting C3s in the incidence and adjacency models assuming a learner, and for C4s in the edge stream model. The authors present first the key idea of their algorithm assuming a perfect oracle, and then show that under certain conditions it works for noisy oracles. For C4s An overview of their results is given in Table 1, together with a nice overview of the state-of-the-art algorithms. In terms of experiments, the authors illustrate a variety of learners, learned from in- and out-of-sample. They show that their methods achieve for some learners non-trivial improvement over various other competitors.
SP:aa69cc79554eabf5cfd82a7f07ce851de9c16c7d
Assessing two novel distance-based loss functions for few-shot image classification
1 INTRODUCTION . Despite the advances in deep learning research , it remains a challenge for the standard supervised learning to achieve satisfactory results when learning from just a small amount of labeled data . Current deep learning algorithms tend to overfit when they are given a small dataset for training , reducing their generalization capabilities . Moreover , there are many problem domains where obtaining labeled data can be very difficult or imply a lot of manual work to get the data with its ground truth , representing a problem for real world applications as it is time consuming and costly . Few-shot learning ( FSL ) methods has been proposed ( Koch et al . ( 2015 ) ; Snell et al . ( 2017 ) ; Vinyals et al . ( 2016 ) ; Sung et al . ( 2017 ) ; Finn et al . ( 2017 ) ; Nichol et al . ( 2018 ) ) to classify previously unseen data into a set of new classes , given only a small amount of labeled instances per class . The main challenge for FSL is to apply a fine-tuning process to an existing embedding network to adapt to new classes , with the problem that this could easily lead to overfitting due to the few labeled samples available for each class . There are two main FSL approaches : The first one is Meta-learning based methods ( Finn et al . ( 2017 ) ; Andrychowicz et al . ( 2016 ) ; Li & Malik ( 2016 ) ; Chen et al . ( 2017 ) ) , where the basic idea is to learn from diverse tasks and datasets and adapt the learned algorithm to novel datasets . The second are Metric-learning based methods ( Xing et al . ( 2003 ) ; Koch et al . ( 2015 ) ) , where the objective is to learn a pairwise similarity metric such that the score is high for similar samples and dissimilar samples get a low score . Later on , these metric learning methods started to adopt the meta learning policy to learn across tasks ( Snell et al . ( 2017 ) ; Vinyals et al . ( 2016 ) ; Sung et al . ( 2017 ) ) . The main objective of these methods is to learn an effective embedding network in order to extract useful features of the task and discriminate on the classes which we are trying to predict . From this basic learning setting , many extensions have been proposed to improve the performance of metric learning methods . Some of these works focus on pre-training the embedding network ( Chen et al . ( 2019a ) ) , others introduce task attention modules ( Chen et al . ( 2020 ) ; Li et al . ( 2019a ) ; Zheng et al . ( 2019 ) ) , whereas other try to optimize the embeddings ( Lee et al . ( 2019 ) ) and yet others try to use a variety of loss functions ( Zheng et al . ( 2019 ) ) . In this work , we propose two different loss functions based on the concepts of inter-class and intraclass distance . As showed in Figure 1 , these loss functions allow us to optimize the embedding network and learn more discriminative features across tasks . For one of the proposed loss functions , we take as inspiration one of the most widely used losses in metric-learning : the triplet loss . For the second one , we adopt an algorithm based on nearest neighbors distance . We demonstrate the effectiveness of our loss functions and show our competitive results compared with state-of-the-art methods . The rest of the paper is organized as follows : In Section 2 , we describe the related work in the few-shot learning problem . In Section 3 we described the proposed model . We first explain the Proto-triplet loss function , and then we explain the ICNN Loss function . Then we discuss some of the design choices we needed to take for the ICNN loss . In Section 4 we detail the experimental setup used for the implementation of the models . In Section 5 we show the results obtained and discuss about its performance . Finally , in Section 5 we present our conclusions and discuss the future work . 2 MOTIVATION AND RELATED WORK . 2.1 DEEP METRIC LEARNING . The goal of metric learning is to learn a similarity function from the data . More specifically , it aims to learn feature embeddings in a way that reduce the distance between embeddings corresponding to instances of the same class ( intra-class ) and increase the distance between embeddings corresponding to instances of different class . Deep metric learning uses an embedding network to learn the discriminative features that will be used to compute the similarity metric . Below we review the more relevant deep metric learning methods . One of the fundamental methods for metric learning is the Siamese Networks ( Koch et al . ( 2015 ) ) , which is a symmetric neural network architecture that consists on two subnetworks both having the same parameters . These networks learn its parameters by calculating a distance metric between the feature embeddings of each subnetwork each with a different input . The loss function used in Siamese Networks is the contrastive loss or pairwise ranking loss , which seeks for the distance of samples from the same class to be small and from different class to be large . The second important metric learning method is the Triplet Network ( Schroff et al . ( 2015 ) ) , which is also a symmetric neural network architecture but this method consist of three identical subnetworks sharing the same parameters . The input of the three subnetworks consist on three different images : The first one is the anchor ( the baseline image ) , the second is the positive sample ( an instance that belongs to the same class as the anchor ) , and the third is the negative sample ( an instance that belongs to a different class than the anchor ) . This network use the triplet loss to learn discriminative feature embeddings , and it works by ensuring that the anchor image is close to the positive images and far away from the negative images . These metric learning methods have been widely used for different purposes as image retrieval ( Wang et al . ( 2014 ) ) , face recognition ( Schroff et al . ( 2015 ) ; Taigman et al . ( 2014 ) ; Hu et al . ( 2014 ) ) , person re-identification ( Xiao et al . ( 2017 ) ) , video surveillance ( Huang et al . ( 2018 ) ) , threedimensional modelling ( Dai et al . ( 2017 ) ) , signature verification ( Bromley et al . ( 1993 ) ) , medical image analysis ( Annarumma & Montana ( 2017 ) ) , text understanding ( Mueller & Thyagarajan ( 2016 ) ; Benajiba et al . ( 2018 ) ) , among other problems . 2.2 META-LEARNING FOR FEW-SHOT LEARNING . As deep learning started to produce good results in many machine learning problems , some works proposed to use the meta-learning policy in order to optimize deep models Andrychowicz et al . ( 2016 ) ; Li & Malik ( 2016 ) ; Chen et al . ( 2017 ) . The meta-learning policy refers to learn across tasks and then adapt to new tasks , instead of learning to the level of samples . The meta-learning objective is to learn the parameters θ that minimize the loss across all tasks . Few-shot learning is the perfect process in which we can test meta-learning algorithms , because of the few-labeled data given to each task . The meta-learning approach to tackle a few-shot learning problem is divided into two stages : metatrain and meta-test . The meta-learning setup consists of episodic tasks , which can be seen as batches in traditional deep learning . A few-shot K-way C-shot image classification task is given K classes and C images per class . The task-specific dataset can be formulated as D = { Dtrain , Dtest } , where Dtrain = { ( Xi , yi ) } Ntraini=1 denotes the classes reserved for the training phase and Dtest = { ( Xi , yi ) } Ntesti=1 denotes the classes reserved for the testing phase . For each meta-train task T , K class labels are randomly chosen from Dtrain to form a support set and a query set . The support set , denoted by S , contains K × C samples ( K-way C-shot ) and the query set , denoted by Q , contains n number of randomly chosen samples from the K classes . The training phase use an episodic mechanism , where each episode E is loaded with a new random task taken from the training data . For the meta-test , the model is tested with a new task T constructed with classes that weren ’ t seen during the meta-train . We can summarize the few-shot learning methods based on what the model seeks to meta-learn . Some approaches consists on having a base-learner and a meta-learner , where meta-learner parameters are optimized by gradual learn across tasks to facilitate the fast learning of the base-learner for each specific task . MAML ( Finn et al . ( 2017 ) ) , is one of these methods and have the idea to search for a good parameter initialization such that the base learner can rapidly generalize with this initialization . Then , REPTILE ( Nichol et al . ( 2018 ) ) incorporates an L2 loss to simplify the computation of MAML . Further on , LEO ( Rusu et al . ( 2018 ) ) is proposed as a network to learn low dimension latent embedding of the model . Meta-SGD ( Li et al . ( 2017 ) ) also learns the base learner update direction and learning rate on the meta-learning process . Meta-Leearner LSTM ( Ravi & Larochelle ( 2017 ) ) propose to finetune the base learner by a LSTM-based meta-learner , which takes as input the loss and gradient of base learner with respect to each support sample . Other approaches seek to learn the similarity metric that is expected to be transferrable across different tasks . 2.3 METRIC META-LEARNING FOR FEW-SHOT LEARNING . There is a whole branch of meta-learning approaches to solve the few-shot learning problem by inheriting the main idea of metric learning . These approaches adopts the meta-learning setup to learn the similarity metric expected to generalize across different tasks . There are baseline methods which achieved important milestones for few-shot learning , such as Prototypical Networks ( Snell et al . ( 2017 ) ) , Matching Networks ( Vinyals et al . ( 2016 ) ) and Relation Networks ( Sung et al . ( 2017 ) ) . Prototypical Networks is the model which we are using as a basis , and it works by taking the center of support samples ’ embeddings from each class to create the class prototypes . Then , the model use a distance metric ( typically the euclidean distance ) to predict the probabilities for each query sample . The Matching Networks predicts the probability of query samples by measuring the cosine similarity between the query embedding and each support sample embedding . The Relation Networks adopts a learnable CNN as the pairwse similarity metric , which takes the concatenation of feature maps of support sample and query sample as input and outputs the relation score . These three methods can be considered as the base metric learning approaches for few-shot learning . Further on , some recent works focus on introducing task attention modules ( Chen et al . ( 2020 ) ; Li et al . ( 2019a ) ; Zheng et al . ( 2019 ) ) , whereas others try to optimize the embeddings ( Lee et al . ( 2019 ) ) and others add a second term to the loss function ( Zheng et al . ( 2019 ) ) . Up until now , there is a lack of research for loss functions which work for the problem of few-shot learning tackled from a metric-learning perspective . Our proposed model take part of these meta-learning approaches based on metric learning , by adopting the idea of the intra-class and inter-class variance into two different loss functions , which will help us to better optimize an embedding network to obtain more discriminant feature vectors .
The paper proposes two losses for meta-learning-based few-shot learning. The first loss is a triplet loss where the positive and negative anchors are replaced by class prototypes (averages of class members from the train set of each episode). The second loss is ICNN proposed in Garcıa and Ramırez (2021) for a different task. Experiments show improvement of up to 2% on miniImageNet compared to some (non-state of the art) baselines.
SP:8994616fe3cd4886dbe9fbe8dc341daced8f3917
Assessing two novel distance-based loss functions for few-shot image classification
1 INTRODUCTION . Despite the advances in deep learning research , it remains a challenge for the standard supervised learning to achieve satisfactory results when learning from just a small amount of labeled data . Current deep learning algorithms tend to overfit when they are given a small dataset for training , reducing their generalization capabilities . Moreover , there are many problem domains where obtaining labeled data can be very difficult or imply a lot of manual work to get the data with its ground truth , representing a problem for real world applications as it is time consuming and costly . Few-shot learning ( FSL ) methods has been proposed ( Koch et al . ( 2015 ) ; Snell et al . ( 2017 ) ; Vinyals et al . ( 2016 ) ; Sung et al . ( 2017 ) ; Finn et al . ( 2017 ) ; Nichol et al . ( 2018 ) ) to classify previously unseen data into a set of new classes , given only a small amount of labeled instances per class . The main challenge for FSL is to apply a fine-tuning process to an existing embedding network to adapt to new classes , with the problem that this could easily lead to overfitting due to the few labeled samples available for each class . There are two main FSL approaches : The first one is Meta-learning based methods ( Finn et al . ( 2017 ) ; Andrychowicz et al . ( 2016 ) ; Li & Malik ( 2016 ) ; Chen et al . ( 2017 ) ) , where the basic idea is to learn from diverse tasks and datasets and adapt the learned algorithm to novel datasets . The second are Metric-learning based methods ( Xing et al . ( 2003 ) ; Koch et al . ( 2015 ) ) , where the objective is to learn a pairwise similarity metric such that the score is high for similar samples and dissimilar samples get a low score . Later on , these metric learning methods started to adopt the meta learning policy to learn across tasks ( Snell et al . ( 2017 ) ; Vinyals et al . ( 2016 ) ; Sung et al . ( 2017 ) ) . The main objective of these methods is to learn an effective embedding network in order to extract useful features of the task and discriminate on the classes which we are trying to predict . From this basic learning setting , many extensions have been proposed to improve the performance of metric learning methods . Some of these works focus on pre-training the embedding network ( Chen et al . ( 2019a ) ) , others introduce task attention modules ( Chen et al . ( 2020 ) ; Li et al . ( 2019a ) ; Zheng et al . ( 2019 ) ) , whereas other try to optimize the embeddings ( Lee et al . ( 2019 ) ) and yet others try to use a variety of loss functions ( Zheng et al . ( 2019 ) ) . In this work , we propose two different loss functions based on the concepts of inter-class and intraclass distance . As showed in Figure 1 , these loss functions allow us to optimize the embedding network and learn more discriminative features across tasks . For one of the proposed loss functions , we take as inspiration one of the most widely used losses in metric-learning : the triplet loss . For the second one , we adopt an algorithm based on nearest neighbors distance . We demonstrate the effectiveness of our loss functions and show our competitive results compared with state-of-the-art methods . The rest of the paper is organized as follows : In Section 2 , we describe the related work in the few-shot learning problem . In Section 3 we described the proposed model . We first explain the Proto-triplet loss function , and then we explain the ICNN Loss function . Then we discuss some of the design choices we needed to take for the ICNN loss . In Section 4 we detail the experimental setup used for the implementation of the models . In Section 5 we show the results obtained and discuss about its performance . Finally , in Section 5 we present our conclusions and discuss the future work . 2 MOTIVATION AND RELATED WORK . 2.1 DEEP METRIC LEARNING . The goal of metric learning is to learn a similarity function from the data . More specifically , it aims to learn feature embeddings in a way that reduce the distance between embeddings corresponding to instances of the same class ( intra-class ) and increase the distance between embeddings corresponding to instances of different class . Deep metric learning uses an embedding network to learn the discriminative features that will be used to compute the similarity metric . Below we review the more relevant deep metric learning methods . One of the fundamental methods for metric learning is the Siamese Networks ( Koch et al . ( 2015 ) ) , which is a symmetric neural network architecture that consists on two subnetworks both having the same parameters . These networks learn its parameters by calculating a distance metric between the feature embeddings of each subnetwork each with a different input . The loss function used in Siamese Networks is the contrastive loss or pairwise ranking loss , which seeks for the distance of samples from the same class to be small and from different class to be large . The second important metric learning method is the Triplet Network ( Schroff et al . ( 2015 ) ) , which is also a symmetric neural network architecture but this method consist of three identical subnetworks sharing the same parameters . The input of the three subnetworks consist on three different images : The first one is the anchor ( the baseline image ) , the second is the positive sample ( an instance that belongs to the same class as the anchor ) , and the third is the negative sample ( an instance that belongs to a different class than the anchor ) . This network use the triplet loss to learn discriminative feature embeddings , and it works by ensuring that the anchor image is close to the positive images and far away from the negative images . These metric learning methods have been widely used for different purposes as image retrieval ( Wang et al . ( 2014 ) ) , face recognition ( Schroff et al . ( 2015 ) ; Taigman et al . ( 2014 ) ; Hu et al . ( 2014 ) ) , person re-identification ( Xiao et al . ( 2017 ) ) , video surveillance ( Huang et al . ( 2018 ) ) , threedimensional modelling ( Dai et al . ( 2017 ) ) , signature verification ( Bromley et al . ( 1993 ) ) , medical image analysis ( Annarumma & Montana ( 2017 ) ) , text understanding ( Mueller & Thyagarajan ( 2016 ) ; Benajiba et al . ( 2018 ) ) , among other problems . 2.2 META-LEARNING FOR FEW-SHOT LEARNING . As deep learning started to produce good results in many machine learning problems , some works proposed to use the meta-learning policy in order to optimize deep models Andrychowicz et al . ( 2016 ) ; Li & Malik ( 2016 ) ; Chen et al . ( 2017 ) . The meta-learning policy refers to learn across tasks and then adapt to new tasks , instead of learning to the level of samples . The meta-learning objective is to learn the parameters θ that minimize the loss across all tasks . Few-shot learning is the perfect process in which we can test meta-learning algorithms , because of the few-labeled data given to each task . The meta-learning approach to tackle a few-shot learning problem is divided into two stages : metatrain and meta-test . The meta-learning setup consists of episodic tasks , which can be seen as batches in traditional deep learning . A few-shot K-way C-shot image classification task is given K classes and C images per class . The task-specific dataset can be formulated as D = { Dtrain , Dtest } , where Dtrain = { ( Xi , yi ) } Ntraini=1 denotes the classes reserved for the training phase and Dtest = { ( Xi , yi ) } Ntesti=1 denotes the classes reserved for the testing phase . For each meta-train task T , K class labels are randomly chosen from Dtrain to form a support set and a query set . The support set , denoted by S , contains K × C samples ( K-way C-shot ) and the query set , denoted by Q , contains n number of randomly chosen samples from the K classes . The training phase use an episodic mechanism , where each episode E is loaded with a new random task taken from the training data . For the meta-test , the model is tested with a new task T constructed with classes that weren ’ t seen during the meta-train . We can summarize the few-shot learning methods based on what the model seeks to meta-learn . Some approaches consists on having a base-learner and a meta-learner , where meta-learner parameters are optimized by gradual learn across tasks to facilitate the fast learning of the base-learner for each specific task . MAML ( Finn et al . ( 2017 ) ) , is one of these methods and have the idea to search for a good parameter initialization such that the base learner can rapidly generalize with this initialization . Then , REPTILE ( Nichol et al . ( 2018 ) ) incorporates an L2 loss to simplify the computation of MAML . Further on , LEO ( Rusu et al . ( 2018 ) ) is proposed as a network to learn low dimension latent embedding of the model . Meta-SGD ( Li et al . ( 2017 ) ) also learns the base learner update direction and learning rate on the meta-learning process . Meta-Leearner LSTM ( Ravi & Larochelle ( 2017 ) ) propose to finetune the base learner by a LSTM-based meta-learner , which takes as input the loss and gradient of base learner with respect to each support sample . Other approaches seek to learn the similarity metric that is expected to be transferrable across different tasks . 2.3 METRIC META-LEARNING FOR FEW-SHOT LEARNING . There is a whole branch of meta-learning approaches to solve the few-shot learning problem by inheriting the main idea of metric learning . These approaches adopts the meta-learning setup to learn the similarity metric expected to generalize across different tasks . There are baseline methods which achieved important milestones for few-shot learning , such as Prototypical Networks ( Snell et al . ( 2017 ) ) , Matching Networks ( Vinyals et al . ( 2016 ) ) and Relation Networks ( Sung et al . ( 2017 ) ) . Prototypical Networks is the model which we are using as a basis , and it works by taking the center of support samples ’ embeddings from each class to create the class prototypes . Then , the model use a distance metric ( typically the euclidean distance ) to predict the probabilities for each query sample . The Matching Networks predicts the probability of query samples by measuring the cosine similarity between the query embedding and each support sample embedding . The Relation Networks adopts a learnable CNN as the pairwse similarity metric , which takes the concatenation of feature maps of support sample and query sample as input and outputs the relation score . These three methods can be considered as the base metric learning approaches for few-shot learning . Further on , some recent works focus on introducing task attention modules ( Chen et al . ( 2020 ) ; Li et al . ( 2019a ) ; Zheng et al . ( 2019 ) ) , whereas others try to optimize the embeddings ( Lee et al . ( 2019 ) ) and others add a second term to the loss function ( Zheng et al . ( 2019 ) ) . Up until now , there is a lack of research for loss functions which work for the problem of few-shot learning tackled from a metric-learning perspective . Our proposed model take part of these meta-learning approaches based on metric learning , by adopting the idea of the intra-class and inter-class variance into two different loss functions , which will help us to better optimize an embedding network to obtain more discriminant feature vectors .
This paper applies two losses to the few-shot learning model based on metric learning (similar to ProtoNet), which aims to utilize the intra- and inter-class distances. The first one is based on the original triplet loss and adjusted for the prototype network. The second one is based on the recently proposed Inter and Intra Class Nearest Neighbors Score (ICNN Score) (Garc´ıa Ram´ırez (2021)). The experimental results on miniImageNet show the proposed models achieve better performance than several previous metric-based approaches.
SP:8994616fe3cd4886dbe9fbe8dc341daced8f3917
Assessing two novel distance-based loss functions for few-shot image classification
1 INTRODUCTION . Despite the advances in deep learning research , it remains a challenge for the standard supervised learning to achieve satisfactory results when learning from just a small amount of labeled data . Current deep learning algorithms tend to overfit when they are given a small dataset for training , reducing their generalization capabilities . Moreover , there are many problem domains where obtaining labeled data can be very difficult or imply a lot of manual work to get the data with its ground truth , representing a problem for real world applications as it is time consuming and costly . Few-shot learning ( FSL ) methods has been proposed ( Koch et al . ( 2015 ) ; Snell et al . ( 2017 ) ; Vinyals et al . ( 2016 ) ; Sung et al . ( 2017 ) ; Finn et al . ( 2017 ) ; Nichol et al . ( 2018 ) ) to classify previously unseen data into a set of new classes , given only a small amount of labeled instances per class . The main challenge for FSL is to apply a fine-tuning process to an existing embedding network to adapt to new classes , with the problem that this could easily lead to overfitting due to the few labeled samples available for each class . There are two main FSL approaches : The first one is Meta-learning based methods ( Finn et al . ( 2017 ) ; Andrychowicz et al . ( 2016 ) ; Li & Malik ( 2016 ) ; Chen et al . ( 2017 ) ) , where the basic idea is to learn from diverse tasks and datasets and adapt the learned algorithm to novel datasets . The second are Metric-learning based methods ( Xing et al . ( 2003 ) ; Koch et al . ( 2015 ) ) , where the objective is to learn a pairwise similarity metric such that the score is high for similar samples and dissimilar samples get a low score . Later on , these metric learning methods started to adopt the meta learning policy to learn across tasks ( Snell et al . ( 2017 ) ; Vinyals et al . ( 2016 ) ; Sung et al . ( 2017 ) ) . The main objective of these methods is to learn an effective embedding network in order to extract useful features of the task and discriminate on the classes which we are trying to predict . From this basic learning setting , many extensions have been proposed to improve the performance of metric learning methods . Some of these works focus on pre-training the embedding network ( Chen et al . ( 2019a ) ) , others introduce task attention modules ( Chen et al . ( 2020 ) ; Li et al . ( 2019a ) ; Zheng et al . ( 2019 ) ) , whereas other try to optimize the embeddings ( Lee et al . ( 2019 ) ) and yet others try to use a variety of loss functions ( Zheng et al . ( 2019 ) ) . In this work , we propose two different loss functions based on the concepts of inter-class and intraclass distance . As showed in Figure 1 , these loss functions allow us to optimize the embedding network and learn more discriminative features across tasks . For one of the proposed loss functions , we take as inspiration one of the most widely used losses in metric-learning : the triplet loss . For the second one , we adopt an algorithm based on nearest neighbors distance . We demonstrate the effectiveness of our loss functions and show our competitive results compared with state-of-the-art methods . The rest of the paper is organized as follows : In Section 2 , we describe the related work in the few-shot learning problem . In Section 3 we described the proposed model . We first explain the Proto-triplet loss function , and then we explain the ICNN Loss function . Then we discuss some of the design choices we needed to take for the ICNN loss . In Section 4 we detail the experimental setup used for the implementation of the models . In Section 5 we show the results obtained and discuss about its performance . Finally , in Section 5 we present our conclusions and discuss the future work . 2 MOTIVATION AND RELATED WORK . 2.1 DEEP METRIC LEARNING . The goal of metric learning is to learn a similarity function from the data . More specifically , it aims to learn feature embeddings in a way that reduce the distance between embeddings corresponding to instances of the same class ( intra-class ) and increase the distance between embeddings corresponding to instances of different class . Deep metric learning uses an embedding network to learn the discriminative features that will be used to compute the similarity metric . Below we review the more relevant deep metric learning methods . One of the fundamental methods for metric learning is the Siamese Networks ( Koch et al . ( 2015 ) ) , which is a symmetric neural network architecture that consists on two subnetworks both having the same parameters . These networks learn its parameters by calculating a distance metric between the feature embeddings of each subnetwork each with a different input . The loss function used in Siamese Networks is the contrastive loss or pairwise ranking loss , which seeks for the distance of samples from the same class to be small and from different class to be large . The second important metric learning method is the Triplet Network ( Schroff et al . ( 2015 ) ) , which is also a symmetric neural network architecture but this method consist of three identical subnetworks sharing the same parameters . The input of the three subnetworks consist on three different images : The first one is the anchor ( the baseline image ) , the second is the positive sample ( an instance that belongs to the same class as the anchor ) , and the third is the negative sample ( an instance that belongs to a different class than the anchor ) . This network use the triplet loss to learn discriminative feature embeddings , and it works by ensuring that the anchor image is close to the positive images and far away from the negative images . These metric learning methods have been widely used for different purposes as image retrieval ( Wang et al . ( 2014 ) ) , face recognition ( Schroff et al . ( 2015 ) ; Taigman et al . ( 2014 ) ; Hu et al . ( 2014 ) ) , person re-identification ( Xiao et al . ( 2017 ) ) , video surveillance ( Huang et al . ( 2018 ) ) , threedimensional modelling ( Dai et al . ( 2017 ) ) , signature verification ( Bromley et al . ( 1993 ) ) , medical image analysis ( Annarumma & Montana ( 2017 ) ) , text understanding ( Mueller & Thyagarajan ( 2016 ) ; Benajiba et al . ( 2018 ) ) , among other problems . 2.2 META-LEARNING FOR FEW-SHOT LEARNING . As deep learning started to produce good results in many machine learning problems , some works proposed to use the meta-learning policy in order to optimize deep models Andrychowicz et al . ( 2016 ) ; Li & Malik ( 2016 ) ; Chen et al . ( 2017 ) . The meta-learning policy refers to learn across tasks and then adapt to new tasks , instead of learning to the level of samples . The meta-learning objective is to learn the parameters θ that minimize the loss across all tasks . Few-shot learning is the perfect process in which we can test meta-learning algorithms , because of the few-labeled data given to each task . The meta-learning approach to tackle a few-shot learning problem is divided into two stages : metatrain and meta-test . The meta-learning setup consists of episodic tasks , which can be seen as batches in traditional deep learning . A few-shot K-way C-shot image classification task is given K classes and C images per class . The task-specific dataset can be formulated as D = { Dtrain , Dtest } , where Dtrain = { ( Xi , yi ) } Ntraini=1 denotes the classes reserved for the training phase and Dtest = { ( Xi , yi ) } Ntesti=1 denotes the classes reserved for the testing phase . For each meta-train task T , K class labels are randomly chosen from Dtrain to form a support set and a query set . The support set , denoted by S , contains K × C samples ( K-way C-shot ) and the query set , denoted by Q , contains n number of randomly chosen samples from the K classes . The training phase use an episodic mechanism , where each episode E is loaded with a new random task taken from the training data . For the meta-test , the model is tested with a new task T constructed with classes that weren ’ t seen during the meta-train . We can summarize the few-shot learning methods based on what the model seeks to meta-learn . Some approaches consists on having a base-learner and a meta-learner , where meta-learner parameters are optimized by gradual learn across tasks to facilitate the fast learning of the base-learner for each specific task . MAML ( Finn et al . ( 2017 ) ) , is one of these methods and have the idea to search for a good parameter initialization such that the base learner can rapidly generalize with this initialization . Then , REPTILE ( Nichol et al . ( 2018 ) ) incorporates an L2 loss to simplify the computation of MAML . Further on , LEO ( Rusu et al . ( 2018 ) ) is proposed as a network to learn low dimension latent embedding of the model . Meta-SGD ( Li et al . ( 2017 ) ) also learns the base learner update direction and learning rate on the meta-learning process . Meta-Leearner LSTM ( Ravi & Larochelle ( 2017 ) ) propose to finetune the base learner by a LSTM-based meta-learner , which takes as input the loss and gradient of base learner with respect to each support sample . Other approaches seek to learn the similarity metric that is expected to be transferrable across different tasks . 2.3 METRIC META-LEARNING FOR FEW-SHOT LEARNING . There is a whole branch of meta-learning approaches to solve the few-shot learning problem by inheriting the main idea of metric learning . These approaches adopts the meta-learning setup to learn the similarity metric expected to generalize across different tasks . There are baseline methods which achieved important milestones for few-shot learning , such as Prototypical Networks ( Snell et al . ( 2017 ) ) , Matching Networks ( Vinyals et al . ( 2016 ) ) and Relation Networks ( Sung et al . ( 2017 ) ) . Prototypical Networks is the model which we are using as a basis , and it works by taking the center of support samples ’ embeddings from each class to create the class prototypes . Then , the model use a distance metric ( typically the euclidean distance ) to predict the probabilities for each query sample . The Matching Networks predicts the probability of query samples by measuring the cosine similarity between the query embedding and each support sample embedding . The Relation Networks adopts a learnable CNN as the pairwse similarity metric , which takes the concatenation of feature maps of support sample and query sample as input and outputs the relation score . These three methods can be considered as the base metric learning approaches for few-shot learning . Further on , some recent works focus on introducing task attention modules ( Chen et al . ( 2020 ) ; Li et al . ( 2019a ) ; Zheng et al . ( 2019 ) ) , whereas others try to optimize the embeddings ( Lee et al . ( 2019 ) ) and others add a second term to the loss function ( Zheng et al . ( 2019 ) ) . Up until now , there is a lack of research for loss functions which work for the problem of few-shot learning tackled from a metric-learning perspective . Our proposed model take part of these meta-learning approaches based on metric learning , by adopting the idea of the intra-class and inter-class variance into two different loss functions , which will help us to better optimize an embedding network to obtain more discriminant feature vectors .
This paper discusses the few-shot learning based on metric learning. In order to better measure the distance between samples of different classes, the authors propose two new metric loss terms considering both inter-class and intra-class distances of samples. The first metric loss is called Proto-Triplet Loss, which improves on the traditional Triplet Loss. The second metric loss is called ICNN loss, which is based on the Inter and Intra Class Nearest Neighbors Score (ICNNS). And the purpose of these two loss is to make the distances between samples of the same class as small as possible and the distances between samples of different classes as large as possible in few-shot learning learning.
SP:8994616fe3cd4886dbe9fbe8dc341daced8f3917
Public Data-Assisted Mirror Descent for Private Model Training
In this paper , we revisit the problem of using public data to improve the privacy/utility trade-offs for differentially private ( DP ) model training . Here , public data refers to auxiliary data sets that have no privacy concerns . We consider public training data sets that are from the same distribution as the private training data . For convex losses , we show that a variant of Mirror Descent provides population risk guarantees which are independent of the dimension of the model ( p ) . Specifically , we apply Mirror Descent with the loss generated by the public data as the mirror map , and using DP gradients of the loss generated by the private ( sensitive ) data . To obtain dimension independence , we requireG2Q ≤ p public data samples , where GQ is the Gaussian width of the smallest convex set Q such that the public loss functions are 1-strongly convex with respect to ‖ · ‖Q . We further show that our algorithm has a natural “ noise stability ” property : If in a bounded region around the current iterate , the public loss satisfies αv-strong convexity in a direction v , then using noisy gradients instead of the exact gradients shifts our next iterate in the direction v by an amount proportional to 1/αv ( in contrast with DP stochastic gradient descent ( DP-SGD ) , where the shift is isotropic ) . Analogous results in prior works had to explicitly learn the geometry using the public data in the form of preconditioner matrices . Our method is also applicable to non-convex losses , as it does not rely on convexity assumptions to ensure DP guarantees . We demonstrate the empirical efficacy of our algorithm by showing privacy/utility trade-offs on linear regression , deep learning benchmark datasets ( WikiText-2 , CIFAR-10 , and EMNIST ) . We show that our algorithm not only significantly improves over traditional DP-SGD , which does not have access to public data , but also improves over DP-SGD on models that have been pretrained with the public data to begin with . 1 INTRODUCTION . Differentially Private Stochastic Gradient Descent ( DP-SGD ) ( Song et al. , 2013 ; Bassily et al. , 2014 ; Abadi et al. , 2016 ) , and its variants ( Kairouz et al. , 2021b ) have become the de facto standard algorithms for training machine learning models with differential privacy ( DP ) ( Dwork et al. , 2006 ) . While DP-SGD is known to be optimal in terms of obtaining both optimal excess empirical risk ( Bassily et al. , 2014 ) , and excess population risk ( Bassily et al. , 2020b ) for convex losses , the obtained error guarantees suffer from an explicit polynomial dependence on the model dimension ( p ) . This polynomial dependence significantly impacts the privacy/utility trade-off when p ≥ npriv , where npriv is the number of private training samples . Thus , even empirically , when DP-SGD is used to train large deep learning models , there is a significant drop in accuracy compared to the nonprivate counterpart ( Papernot et al. , 2020 ) . In this paper , we revisit the problem of effectively using public data ( i.e. , data drawn from the same distribution as the private training data set , but without privacy concerns ) to improve the privacy/utility trade-offs for DP model training . Specifically , we design a central DP variant of mirror descent ( Nemirovsky & Yudin , 1983 ) that uses the loss function generated by the public data as the mirror map and DP gradients on the private/sensitive data as the linear term , ensuring population risk guarantees for convex losses with no explicit dependence on dimensions as long as npub ≥ p , where npub is the number of records in the public data set . We show both theoretically and empirically that our DP variant of mirror descent , assisted with public data , can improve the privacy-utility trade-offs by effectively reducing the variance in the noise added to the gradients in DP model training . Our empirical results are on standard benchmark data sets like CIFAR-10 , EMNIST , and WikiText-2 . Learning Geometry with Mirror Maps : Common to most DP model training algorithms , including DP-SGD , DP-FTRL ( Kairouz et al. , 2021b ) , and our algorithm , is a DP estimator of the gradient of the loss ∇θL ( θt ; Dpriv ) = ∑ d∈Dpriv ∇θ ` ( θt ; d ) generated by the private data set Dpriv at a given model state θt ∈ Rp . This DP estimator essentially adds isotropic Gaussian noise N ( 0 , σ2Ip ) to ∇θL ( θt ; Dpriv ) , where σ depends on the privacy parameters ( ε , δ ) and the maximum allowable value of ‖∇θ ` ( θt ; d ) ‖2 ( a.k.a . the clipping norm ( Abadi et al. , 2016 ) ) .1 It is well known that for most learning tasks , the set of gradients vectors in L ( θt ; Dpriv ) are seldom isotropic ( Gur-Ari et al. , 2018 ; Agarwal et al. , 2019 ) . Hence , it is natural to wonder if the Gaussian noise in the DP estimator can be made to respect the geometry of the gradients . Prior works ( Zhou et al. , 2020 ; Asi et al. , 2021 ; Kairouz et al. , 2021a ) have used public data ( Dpub ) to explicitly learn this geometry , mostly in the form of preconditioner matrices ( Duchi et al. , 2011 ) to be multiplied to the estimated noisy gradients . In this paper , we take an implicit approach towards respecting this geometry , by using the loss L ( θ ; Dpub ) generated by the public data as the mirror map in classical mirror descent . As a first order approximation ( formalized in Section 4 ) , one can view it as doing DP-SGD on L ( θ ; Dpriv ) while using L ( θ ; Dpub ) as a regularizer . This approach has the following advantages : ( i ) The information of the geometry is “ free ” , i.e. , one does not need to learn the preconditioner explicitly from the public data , ( ii ) Unlike prior works ( Zhou et al. , 2020 ; Kairouz et al. , 2021a ) , one does not need to assume that the gradients of L ( θ ; Dpriv ) lie in a fixed rank subspace , ( iii ) The achieved excess population risk guarantees have better dependence on npub = |Dpub| compared to prior results ( Asi et al. , 2021 ) , and ( iv ) Because the geometry is implicitly defined , the implementation does not need to maintain an additional data structure for the preconditioner , and hence is much easier to implement . Empirically , under our best-effort comparison , our baseline algorithm improves over the state of the art ( Asi et al. , 2021 ) .2 We note that differentially private mirror descent has been considered before by Talwar et al . ( 2014 ) and Wang et al . ( 2017 ) . Their results are not directly comparable to ours because ( i ) they do not have access to in-distribution public data ( ii ) as shown in Bassily et al . ( 2014 ) , without public data , it is impossible to achieve the dimension independent bounds we achieve ( iii ) in our experiments we solve unconstrained optimization problems , but those works choose the mirror map based on the constraint set rather than the data set . We note that the utility bounds we prove in this paper also apply to a public data-assisted variant of the accelerated mirror descent algorithm considered in Wang et al . ( 2017 ) . In-distribution vs. Out-of-distribution Public Data : Prior works have considered both settings where the public data set Dpub comes from the same distribution as the private data Dpriv ( a.k.a . indistribution ) ( Bassily et al. , 2018a ; Zhou et al. , 2020 ; Kairouz et al. , 2021a ; Asi et al. , 2021 ) , and where the distributions are different ( a.k.a . out-of-distribution ) ( Abadi et al. , 2016 ; Papernot et al. , 2016 ; 2018 ; Liu et al. , 2021 ) . In principle , our algorithm can be used in out-of-distribution settings , but our results in this paper are for the in-distribution case . In the in-distribution setting , it is typical that there are fewer public data samples available than private data samples – i.e. , npub npriv – as it is harder to obtain public data sets than ones with privacy constraints attached . In-distribution public data could come from either altruistic opt-in users ( Merriman , 2014 ; Avent et al. , 2017 ) or from users who are incentivized to provide such data ( e.g. , mechanical turks ) . Out-of-distribution public data may be easier to obtain but can have various degrees of freedom ; e.g. , the domains of private and public data may not be identical , the representation of some classes may vary , the distributions can be mean shifted , etc . It is usually hard to quantify these degrees of freedom to the extent that we can provide precise guarantees . Hence , we leave this aspect for future exploration , and work with the idealized assumption that the public data comes from the same distribution as the private data , or , at least , that the differences between these two distributions are not material . Design of Algorithms without Relying on Convexity for Privacy : While most of our theoretical utility guarantees are specific to convex functions , our algorithm can be used seamlessly in nonconvex settings . The main reason is that its DP guarantee does not rely on convexity . Prior work 1For the ease of presentation , at this point we do not consider the noise due to stochastic mini-batching . 2The implementation of Asi et al . ( 2021 ) is not publicly available . Since the algorithms can be sensitive to hyperparameter choices , for a fair comparison we directly consider the results quoted in ( Asi et al. , 2021 ) . that provided similar dimension-independent excess population risk guarantees under the the same conditions as ours ( i.e. , npub ≥ p ) ( Feldman et al. , 2018 ) heavily relied on convexity to ensure DP and hence , can not be used in non-convex settings . Choice of Benchmark for Empirical Comparison : Mirror descent ( Nemirovsky & Yudin , 1983 ; Hazan , 2019 ) as a first step optimizes the mirror map function . In our setting , this corresponds to pre-training on the public loss function L ( θ ; Dpub ) before running the DP optimization procedure on L ( θ ; Dpriv ) . Since pre-training on public data is intuitive and easy , we always compare to DP-SGD ( and its variants ) that have been pre-trained to convergence with the public loss . We show that our algorithm outperforms even pre-trained DP-SGD . To the best of our knowledge , ours is the only empirical work that compares to this strong ( but fair ) benchmark . Other Uses of Public Data in DP Learning : The use of in-distribution public data has been extensively explored both theoretically and empirically . On the theoretical side , it has been shown ( Alon et al. , 2019 ; Bassily et al. , 2020a ) that a combination of private and public data samples can yield asymptotically better worst-case PAC learning guarantees than either on their own . Another line of work ( Papernot et al. , 2016 ; 2018 ; Bassily et al. , 2018b ; Dwork & Feldman , 2018 ; Nandi & Bassily , 2020 ) considers public data that is unlabelled , but otherwise comes from the same distribution as the private data ; the primary goal is to use the private data to generate labels for the public data , which can then be used arbitrarily . So far only two papers have considered out-of-distribution data . Bassily et al . ( 2020c ) assume that whether a data record is public or private depends on its label ; e.g. , the public data may contain many negative examples , but few positive examples . They show that halfspaces can be learned in this model . Liu et al . ( 2021 ) consider synthetic data generation and provide guarantees that depend on the Rényi divergences between the public and private distributions . Abadi et al . ( 2016 ) and Tramer & Boneh ( 2020 ) provided techniques to effectively use out-of-distribution public data for pre-training for DP-SGD . However , they did not consider techniques to improve a pre-trained model using private and public data , which is the focus of our work .
In this paper, the authors study differentially private empirical risk minimization (DP-ERM). Specifically, they study the case where the constraint set $\mathcal{C}$ has additional geometric structure, i.e., its Gaussian width could much lower than the underlying dimension $p$, such as the $\ell_1$-norm ball. The paper has been studied previously. However, this paper assume there are some additional public data. Specifically, they apply Mirror Descent with the loss generated by the public data as the *mirror map*, and using DP gradients of the loss generated by the private (sensitive) data. They also provide some experiments to show the performance of their algorithm.
SP:8e0a5b11775310ef86e9d6a1631776ed8846794a
Public Data-Assisted Mirror Descent for Private Model Training
In this paper , we revisit the problem of using public data to improve the privacy/utility trade-offs for differentially private ( DP ) model training . Here , public data refers to auxiliary data sets that have no privacy concerns . We consider public training data sets that are from the same distribution as the private training data . For convex losses , we show that a variant of Mirror Descent provides population risk guarantees which are independent of the dimension of the model ( p ) . Specifically , we apply Mirror Descent with the loss generated by the public data as the mirror map , and using DP gradients of the loss generated by the private ( sensitive ) data . To obtain dimension independence , we requireG2Q ≤ p public data samples , where GQ is the Gaussian width of the smallest convex set Q such that the public loss functions are 1-strongly convex with respect to ‖ · ‖Q . We further show that our algorithm has a natural “ noise stability ” property : If in a bounded region around the current iterate , the public loss satisfies αv-strong convexity in a direction v , then using noisy gradients instead of the exact gradients shifts our next iterate in the direction v by an amount proportional to 1/αv ( in contrast with DP stochastic gradient descent ( DP-SGD ) , where the shift is isotropic ) . Analogous results in prior works had to explicitly learn the geometry using the public data in the form of preconditioner matrices . Our method is also applicable to non-convex losses , as it does not rely on convexity assumptions to ensure DP guarantees . We demonstrate the empirical efficacy of our algorithm by showing privacy/utility trade-offs on linear regression , deep learning benchmark datasets ( WikiText-2 , CIFAR-10 , and EMNIST ) . We show that our algorithm not only significantly improves over traditional DP-SGD , which does not have access to public data , but also improves over DP-SGD on models that have been pretrained with the public data to begin with . 1 INTRODUCTION . Differentially Private Stochastic Gradient Descent ( DP-SGD ) ( Song et al. , 2013 ; Bassily et al. , 2014 ; Abadi et al. , 2016 ) , and its variants ( Kairouz et al. , 2021b ) have become the de facto standard algorithms for training machine learning models with differential privacy ( DP ) ( Dwork et al. , 2006 ) . While DP-SGD is known to be optimal in terms of obtaining both optimal excess empirical risk ( Bassily et al. , 2014 ) , and excess population risk ( Bassily et al. , 2020b ) for convex losses , the obtained error guarantees suffer from an explicit polynomial dependence on the model dimension ( p ) . This polynomial dependence significantly impacts the privacy/utility trade-off when p ≥ npriv , where npriv is the number of private training samples . Thus , even empirically , when DP-SGD is used to train large deep learning models , there is a significant drop in accuracy compared to the nonprivate counterpart ( Papernot et al. , 2020 ) . In this paper , we revisit the problem of effectively using public data ( i.e. , data drawn from the same distribution as the private training data set , but without privacy concerns ) to improve the privacy/utility trade-offs for DP model training . Specifically , we design a central DP variant of mirror descent ( Nemirovsky & Yudin , 1983 ) that uses the loss function generated by the public data as the mirror map and DP gradients on the private/sensitive data as the linear term , ensuring population risk guarantees for convex losses with no explicit dependence on dimensions as long as npub ≥ p , where npub is the number of records in the public data set . We show both theoretically and empirically that our DP variant of mirror descent , assisted with public data , can improve the privacy-utility trade-offs by effectively reducing the variance in the noise added to the gradients in DP model training . Our empirical results are on standard benchmark data sets like CIFAR-10 , EMNIST , and WikiText-2 . Learning Geometry with Mirror Maps : Common to most DP model training algorithms , including DP-SGD , DP-FTRL ( Kairouz et al. , 2021b ) , and our algorithm , is a DP estimator of the gradient of the loss ∇θL ( θt ; Dpriv ) = ∑ d∈Dpriv ∇θ ` ( θt ; d ) generated by the private data set Dpriv at a given model state θt ∈ Rp . This DP estimator essentially adds isotropic Gaussian noise N ( 0 , σ2Ip ) to ∇θL ( θt ; Dpriv ) , where σ depends on the privacy parameters ( ε , δ ) and the maximum allowable value of ‖∇θ ` ( θt ; d ) ‖2 ( a.k.a . the clipping norm ( Abadi et al. , 2016 ) ) .1 It is well known that for most learning tasks , the set of gradients vectors in L ( θt ; Dpriv ) are seldom isotropic ( Gur-Ari et al. , 2018 ; Agarwal et al. , 2019 ) . Hence , it is natural to wonder if the Gaussian noise in the DP estimator can be made to respect the geometry of the gradients . Prior works ( Zhou et al. , 2020 ; Asi et al. , 2021 ; Kairouz et al. , 2021a ) have used public data ( Dpub ) to explicitly learn this geometry , mostly in the form of preconditioner matrices ( Duchi et al. , 2011 ) to be multiplied to the estimated noisy gradients . In this paper , we take an implicit approach towards respecting this geometry , by using the loss L ( θ ; Dpub ) generated by the public data as the mirror map in classical mirror descent . As a first order approximation ( formalized in Section 4 ) , one can view it as doing DP-SGD on L ( θ ; Dpriv ) while using L ( θ ; Dpub ) as a regularizer . This approach has the following advantages : ( i ) The information of the geometry is “ free ” , i.e. , one does not need to learn the preconditioner explicitly from the public data , ( ii ) Unlike prior works ( Zhou et al. , 2020 ; Kairouz et al. , 2021a ) , one does not need to assume that the gradients of L ( θ ; Dpriv ) lie in a fixed rank subspace , ( iii ) The achieved excess population risk guarantees have better dependence on npub = |Dpub| compared to prior results ( Asi et al. , 2021 ) , and ( iv ) Because the geometry is implicitly defined , the implementation does not need to maintain an additional data structure for the preconditioner , and hence is much easier to implement . Empirically , under our best-effort comparison , our baseline algorithm improves over the state of the art ( Asi et al. , 2021 ) .2 We note that differentially private mirror descent has been considered before by Talwar et al . ( 2014 ) and Wang et al . ( 2017 ) . Their results are not directly comparable to ours because ( i ) they do not have access to in-distribution public data ( ii ) as shown in Bassily et al . ( 2014 ) , without public data , it is impossible to achieve the dimension independent bounds we achieve ( iii ) in our experiments we solve unconstrained optimization problems , but those works choose the mirror map based on the constraint set rather than the data set . We note that the utility bounds we prove in this paper also apply to a public data-assisted variant of the accelerated mirror descent algorithm considered in Wang et al . ( 2017 ) . In-distribution vs. Out-of-distribution Public Data : Prior works have considered both settings where the public data set Dpub comes from the same distribution as the private data Dpriv ( a.k.a . indistribution ) ( Bassily et al. , 2018a ; Zhou et al. , 2020 ; Kairouz et al. , 2021a ; Asi et al. , 2021 ) , and where the distributions are different ( a.k.a . out-of-distribution ) ( Abadi et al. , 2016 ; Papernot et al. , 2016 ; 2018 ; Liu et al. , 2021 ) . In principle , our algorithm can be used in out-of-distribution settings , but our results in this paper are for the in-distribution case . In the in-distribution setting , it is typical that there are fewer public data samples available than private data samples – i.e. , npub npriv – as it is harder to obtain public data sets than ones with privacy constraints attached . In-distribution public data could come from either altruistic opt-in users ( Merriman , 2014 ; Avent et al. , 2017 ) or from users who are incentivized to provide such data ( e.g. , mechanical turks ) . Out-of-distribution public data may be easier to obtain but can have various degrees of freedom ; e.g. , the domains of private and public data may not be identical , the representation of some classes may vary , the distributions can be mean shifted , etc . It is usually hard to quantify these degrees of freedom to the extent that we can provide precise guarantees . Hence , we leave this aspect for future exploration , and work with the idealized assumption that the public data comes from the same distribution as the private data , or , at least , that the differences between these two distributions are not material . Design of Algorithms without Relying on Convexity for Privacy : While most of our theoretical utility guarantees are specific to convex functions , our algorithm can be used seamlessly in nonconvex settings . The main reason is that its DP guarantee does not rely on convexity . Prior work 1For the ease of presentation , at this point we do not consider the noise due to stochastic mini-batching . 2The implementation of Asi et al . ( 2021 ) is not publicly available . Since the algorithms can be sensitive to hyperparameter choices , for a fair comparison we directly consider the results quoted in ( Asi et al. , 2021 ) . that provided similar dimension-independent excess population risk guarantees under the the same conditions as ours ( i.e. , npub ≥ p ) ( Feldman et al. , 2018 ) heavily relied on convexity to ensure DP and hence , can not be used in non-convex settings . Choice of Benchmark for Empirical Comparison : Mirror descent ( Nemirovsky & Yudin , 1983 ; Hazan , 2019 ) as a first step optimizes the mirror map function . In our setting , this corresponds to pre-training on the public loss function L ( θ ; Dpub ) before running the DP optimization procedure on L ( θ ; Dpriv ) . Since pre-training on public data is intuitive and easy , we always compare to DP-SGD ( and its variants ) that have been pre-trained to convergence with the public loss . We show that our algorithm outperforms even pre-trained DP-SGD . To the best of our knowledge , ours is the only empirical work that compares to this strong ( but fair ) benchmark . Other Uses of Public Data in DP Learning : The use of in-distribution public data has been extensively explored both theoretically and empirically . On the theoretical side , it has been shown ( Alon et al. , 2019 ; Bassily et al. , 2020a ) that a combination of private and public data samples can yield asymptotically better worst-case PAC learning guarantees than either on their own . Another line of work ( Papernot et al. , 2016 ; 2018 ; Bassily et al. , 2018b ; Dwork & Feldman , 2018 ; Nandi & Bassily , 2020 ) considers public data that is unlabelled , but otherwise comes from the same distribution as the private data ; the primary goal is to use the private data to generate labels for the public data , which can then be used arbitrarily . So far only two papers have considered out-of-distribution data . Bassily et al . ( 2020c ) assume that whether a data record is public or private depends on its label ; e.g. , the public data may contain many negative examples , but few positive examples . They show that halfspaces can be learned in this model . Liu et al . ( 2021 ) consider synthetic data generation and provide guarantees that depend on the Rényi divergences between the public and private distributions . Abadi et al . ( 2016 ) and Tramer & Boneh ( 2020 ) provided techniques to effectively use out-of-distribution public data for pre-training for DP-SGD . However , they did not consider techniques to improve a pre-trained model using private and public data , which is the focus of our work .
In this paper, a new algorithm has been proposed which leverages in-distribution public data to provide improvements in private training. The algorithm uses the loss on public data (with a strongly convex loss function) as a “mirror map” to implement private mirror descent on the private data. It is shown to give dimension independent bounds in certain regimes. Empirically, on both synthetic and real world datasets it is shown to perform favourably compared to recent work.
SP:8e0a5b11775310ef86e9d6a1631776ed8846794a
Public Data-Assisted Mirror Descent for Private Model Training
In this paper , we revisit the problem of using public data to improve the privacy/utility trade-offs for differentially private ( DP ) model training . Here , public data refers to auxiliary data sets that have no privacy concerns . We consider public training data sets that are from the same distribution as the private training data . For convex losses , we show that a variant of Mirror Descent provides population risk guarantees which are independent of the dimension of the model ( p ) . Specifically , we apply Mirror Descent with the loss generated by the public data as the mirror map , and using DP gradients of the loss generated by the private ( sensitive ) data . To obtain dimension independence , we requireG2Q ≤ p public data samples , where GQ is the Gaussian width of the smallest convex set Q such that the public loss functions are 1-strongly convex with respect to ‖ · ‖Q . We further show that our algorithm has a natural “ noise stability ” property : If in a bounded region around the current iterate , the public loss satisfies αv-strong convexity in a direction v , then using noisy gradients instead of the exact gradients shifts our next iterate in the direction v by an amount proportional to 1/αv ( in contrast with DP stochastic gradient descent ( DP-SGD ) , where the shift is isotropic ) . Analogous results in prior works had to explicitly learn the geometry using the public data in the form of preconditioner matrices . Our method is also applicable to non-convex losses , as it does not rely on convexity assumptions to ensure DP guarantees . We demonstrate the empirical efficacy of our algorithm by showing privacy/utility trade-offs on linear regression , deep learning benchmark datasets ( WikiText-2 , CIFAR-10 , and EMNIST ) . We show that our algorithm not only significantly improves over traditional DP-SGD , which does not have access to public data , but also improves over DP-SGD on models that have been pretrained with the public data to begin with . 1 INTRODUCTION . Differentially Private Stochastic Gradient Descent ( DP-SGD ) ( Song et al. , 2013 ; Bassily et al. , 2014 ; Abadi et al. , 2016 ) , and its variants ( Kairouz et al. , 2021b ) have become the de facto standard algorithms for training machine learning models with differential privacy ( DP ) ( Dwork et al. , 2006 ) . While DP-SGD is known to be optimal in terms of obtaining both optimal excess empirical risk ( Bassily et al. , 2014 ) , and excess population risk ( Bassily et al. , 2020b ) for convex losses , the obtained error guarantees suffer from an explicit polynomial dependence on the model dimension ( p ) . This polynomial dependence significantly impacts the privacy/utility trade-off when p ≥ npriv , where npriv is the number of private training samples . Thus , even empirically , when DP-SGD is used to train large deep learning models , there is a significant drop in accuracy compared to the nonprivate counterpart ( Papernot et al. , 2020 ) . In this paper , we revisit the problem of effectively using public data ( i.e. , data drawn from the same distribution as the private training data set , but without privacy concerns ) to improve the privacy/utility trade-offs for DP model training . Specifically , we design a central DP variant of mirror descent ( Nemirovsky & Yudin , 1983 ) that uses the loss function generated by the public data as the mirror map and DP gradients on the private/sensitive data as the linear term , ensuring population risk guarantees for convex losses with no explicit dependence on dimensions as long as npub ≥ p , where npub is the number of records in the public data set . We show both theoretically and empirically that our DP variant of mirror descent , assisted with public data , can improve the privacy-utility trade-offs by effectively reducing the variance in the noise added to the gradients in DP model training . Our empirical results are on standard benchmark data sets like CIFAR-10 , EMNIST , and WikiText-2 . Learning Geometry with Mirror Maps : Common to most DP model training algorithms , including DP-SGD , DP-FTRL ( Kairouz et al. , 2021b ) , and our algorithm , is a DP estimator of the gradient of the loss ∇θL ( θt ; Dpriv ) = ∑ d∈Dpriv ∇θ ` ( θt ; d ) generated by the private data set Dpriv at a given model state θt ∈ Rp . This DP estimator essentially adds isotropic Gaussian noise N ( 0 , σ2Ip ) to ∇θL ( θt ; Dpriv ) , where σ depends on the privacy parameters ( ε , δ ) and the maximum allowable value of ‖∇θ ` ( θt ; d ) ‖2 ( a.k.a . the clipping norm ( Abadi et al. , 2016 ) ) .1 It is well known that for most learning tasks , the set of gradients vectors in L ( θt ; Dpriv ) are seldom isotropic ( Gur-Ari et al. , 2018 ; Agarwal et al. , 2019 ) . Hence , it is natural to wonder if the Gaussian noise in the DP estimator can be made to respect the geometry of the gradients . Prior works ( Zhou et al. , 2020 ; Asi et al. , 2021 ; Kairouz et al. , 2021a ) have used public data ( Dpub ) to explicitly learn this geometry , mostly in the form of preconditioner matrices ( Duchi et al. , 2011 ) to be multiplied to the estimated noisy gradients . In this paper , we take an implicit approach towards respecting this geometry , by using the loss L ( θ ; Dpub ) generated by the public data as the mirror map in classical mirror descent . As a first order approximation ( formalized in Section 4 ) , one can view it as doing DP-SGD on L ( θ ; Dpriv ) while using L ( θ ; Dpub ) as a regularizer . This approach has the following advantages : ( i ) The information of the geometry is “ free ” , i.e. , one does not need to learn the preconditioner explicitly from the public data , ( ii ) Unlike prior works ( Zhou et al. , 2020 ; Kairouz et al. , 2021a ) , one does not need to assume that the gradients of L ( θ ; Dpriv ) lie in a fixed rank subspace , ( iii ) The achieved excess population risk guarantees have better dependence on npub = |Dpub| compared to prior results ( Asi et al. , 2021 ) , and ( iv ) Because the geometry is implicitly defined , the implementation does not need to maintain an additional data structure for the preconditioner , and hence is much easier to implement . Empirically , under our best-effort comparison , our baseline algorithm improves over the state of the art ( Asi et al. , 2021 ) .2 We note that differentially private mirror descent has been considered before by Talwar et al . ( 2014 ) and Wang et al . ( 2017 ) . Their results are not directly comparable to ours because ( i ) they do not have access to in-distribution public data ( ii ) as shown in Bassily et al . ( 2014 ) , without public data , it is impossible to achieve the dimension independent bounds we achieve ( iii ) in our experiments we solve unconstrained optimization problems , but those works choose the mirror map based on the constraint set rather than the data set . We note that the utility bounds we prove in this paper also apply to a public data-assisted variant of the accelerated mirror descent algorithm considered in Wang et al . ( 2017 ) . In-distribution vs. Out-of-distribution Public Data : Prior works have considered both settings where the public data set Dpub comes from the same distribution as the private data Dpriv ( a.k.a . indistribution ) ( Bassily et al. , 2018a ; Zhou et al. , 2020 ; Kairouz et al. , 2021a ; Asi et al. , 2021 ) , and where the distributions are different ( a.k.a . out-of-distribution ) ( Abadi et al. , 2016 ; Papernot et al. , 2016 ; 2018 ; Liu et al. , 2021 ) . In principle , our algorithm can be used in out-of-distribution settings , but our results in this paper are for the in-distribution case . In the in-distribution setting , it is typical that there are fewer public data samples available than private data samples – i.e. , npub npriv – as it is harder to obtain public data sets than ones with privacy constraints attached . In-distribution public data could come from either altruistic opt-in users ( Merriman , 2014 ; Avent et al. , 2017 ) or from users who are incentivized to provide such data ( e.g. , mechanical turks ) . Out-of-distribution public data may be easier to obtain but can have various degrees of freedom ; e.g. , the domains of private and public data may not be identical , the representation of some classes may vary , the distributions can be mean shifted , etc . It is usually hard to quantify these degrees of freedom to the extent that we can provide precise guarantees . Hence , we leave this aspect for future exploration , and work with the idealized assumption that the public data comes from the same distribution as the private data , or , at least , that the differences between these two distributions are not material . Design of Algorithms without Relying on Convexity for Privacy : While most of our theoretical utility guarantees are specific to convex functions , our algorithm can be used seamlessly in nonconvex settings . The main reason is that its DP guarantee does not rely on convexity . Prior work 1For the ease of presentation , at this point we do not consider the noise due to stochastic mini-batching . 2The implementation of Asi et al . ( 2021 ) is not publicly available . Since the algorithms can be sensitive to hyperparameter choices , for a fair comparison we directly consider the results quoted in ( Asi et al. , 2021 ) . that provided similar dimension-independent excess population risk guarantees under the the same conditions as ours ( i.e. , npub ≥ p ) ( Feldman et al. , 2018 ) heavily relied on convexity to ensure DP and hence , can not be used in non-convex settings . Choice of Benchmark for Empirical Comparison : Mirror descent ( Nemirovsky & Yudin , 1983 ; Hazan , 2019 ) as a first step optimizes the mirror map function . In our setting , this corresponds to pre-training on the public loss function L ( θ ; Dpub ) before running the DP optimization procedure on L ( θ ; Dpriv ) . Since pre-training on public data is intuitive and easy , we always compare to DP-SGD ( and its variants ) that have been pre-trained to convergence with the public loss . We show that our algorithm outperforms even pre-trained DP-SGD . To the best of our knowledge , ours is the only empirical work that compares to this strong ( but fair ) benchmark . Other Uses of Public Data in DP Learning : The use of in-distribution public data has been extensively explored both theoretically and empirically . On the theoretical side , it has been shown ( Alon et al. , 2019 ; Bassily et al. , 2020a ) that a combination of private and public data samples can yield asymptotically better worst-case PAC learning guarantees than either on their own . Another line of work ( Papernot et al. , 2016 ; 2018 ; Bassily et al. , 2018b ; Dwork & Feldman , 2018 ; Nandi & Bassily , 2020 ) considers public data that is unlabelled , but otherwise comes from the same distribution as the private data ; the primary goal is to use the private data to generate labels for the public data , which can then be used arbitrarily . So far only two papers have considered out-of-distribution data . Bassily et al . ( 2020c ) assume that whether a data record is public or private depends on its label ; e.g. , the public data may contain many negative examples , but few positive examples . They show that halfspaces can be learned in this model . Liu et al . ( 2021 ) consider synthetic data generation and provide guarantees that depend on the Rényi divergences between the public and private distributions . Abadi et al . ( 2016 ) and Tramer & Boneh ( 2020 ) provided techniques to effectively use out-of-distribution public data for pre-training for DP-SGD . However , they did not consider techniques to improve a pre-trained model using private and public data , which is the focus of our work .
The paper is in the continuation of recent line of work that studies private algorithms when it has access to some public data. They also achieve a dimension independent bound as in some of the previous work. The idea of the paper is very simple: they use public data as the mirror map in the private mirror descent algorithm.
SP:8e0a5b11775310ef86e9d6a1631776ed8846794a
CDTrans: Cross-domain Transformer for Unsupervised Domain Adaptation
1 INTRODUCTION . Deep neural network have achieved remarkable success in a wide range of application scenarios but it still suffers poor generalization performance to other new domain because of the domain shift problem ( Csurka , 2017 ; Zhao et al. , 2020 ; Zhang et al. , 2020 ; Oza et al. , 2021 ) . To handle this issue and avoid the expensive laborious annotations , lots of research efforts ( Bousmalis et al. , 2017 ; Kuroki et al. , 2019 ; Wilson & Cook , 2020 ; VS et al. , 2021 ) are devoted on Unsupervised Domain Adaptation ( UDA ) . The UDA task aims to transfer knowledge learned from a labeled source domain to a different unlabeled target domain . In UDA , most approaches focus on aligning distributions of source and target domain and learning domain-invariant feature representations . One kind of such UDA methods are based on category-level alignment ( Kang et al. , 2019 ; Zhang et al. , 2019 ; Jiang et al. , 2020 ; Li et al. , 2021b ) , which have achieved promising results on public UDA datasets using deep convolution neural networks ( CNNs ) . The fundamental problems in category-level based alignment is the production of pseudo labels for samples in target domain to generate the input source-target pairs . However , the current CNNs-based methods are not robust to the generated noisy pseudo labels for accurate domain alignment ( Morerio et al. , 2020 ; Jiang et al. , 2020 ) . With the success of Transformer in natural language processing ( NLP ) ( Vaswani et al. , 2017 ; Devlin et al. , 2018 ) and vision tasks ( Dosovitskiy et al. , 2020 ; Han et al. , 2020 ; He et al. , 2021 ; Khan et al. , 2021 ) , it is found that cross-attention in Transformer is good at aligning different distributions , even from different modalities e.g. , vision-to-vision ( Li et al. , 2021e ) , vision-to-text ( Tsai et al. , 2019 ; Hu & Singh , 2021 ) and text-to-speech ( Li et al. , 2019 ) . And we find that it is robust to noise in pseudo labels to some extent . Hence , in this paper , we apply transformers to the UDA task to take advantage of its robustness to noise and super power for feature alignment to deal with the problems as described above in CNNs . In our experiment , we conclude that even with noise in the labeling pair , the cross-attention can still work well in aligning two distributions , thanks to the attention mechanism . To obtain more accurate pseudo labels , we designed a two-way center-aware labeling algorithm for samples in the target domain . The pseudo labels are produced based on the cross-domain similarity matrix , and a center-aware matching is involved to weight the matrix and weaken noise into the tolerable range . With the help of pseudo labels , we design the cross-domain transformer ( CDTrans ) for UDA . It consists of three weight-sharing transformer branches , of which two branches are for source and target data respectively and the third one is the feature alignment branch , whose inputs are from source-target pairs . The self-attention is applied in the source/target transformer branches and crossattention is involved in the feature alignment branch to conduct domain alignment . Such design explicitly enforces the framework to learn discriminative domain-specific and domain-invariant representations simultaneously . In summary , our contributions are three-fold : • We propose a weight-sharing triple-branch transformer framework , namely , CDTrans , for accurate unsupervised domain adaptation , taking advantage of its robustness to noisy labeling data and great power for feature alignment . • To produce pseudo labels with high quality , a two-way center-aware labeling method is proposed , and it boosts the final performance in the context of CDTrans . • CDTrans achieves the best performance compared to state-of-the-arts with a large margin on VisDA-2017 ( Peng et al. , 2017 ) and DomainNet ( Peng et al. , 2019 ) datasets . 2 RELATED WORK . 2.1 TRANSFORMER FOR VISION . Transformer is proposed in ( Vaswani et al. , 2017 ) to model sequential data in the field of NLP . Many works have shown its effectiveness for computer-vision tasks ( Han et al. , 2020 ; Khan et al. , 2021 ; Li et al. , 2021d ; Han et al. , 2021b ; Yu et al. , 2021 ; Li et al. , 2021c ; Yang et al. , 2021 ) . Pure Transformer based models are becoming more and more popular . For example , ViT ( Dosovitskiy et al. , 2020 ) is proposed recently by feeding transformer with sequences of image patches ; Touvron et al . ( Touvron et al. , 2021 ) propose DeiT that introduces a distillation strategy for transformers to help with ViT training ; many other ViT variants ( Yuan et al. , 2021a ; Wang et al. , 2021 ; Han et al. , 2021a ; Chen et al. , 2021 ; Ranftl et al. , 2021 ; Liu et al. , 2021 ) are proposed from then , which achieve promising performance compared with its counterpart CNNs for both image classification and downstream tasks , such as object detection ( Liu et al. , 2021 ) , semantic segmentation ( Yuan et al. , 2021b ) and object ReID ( He et al. , 2021 ) . For multi-modal based networks , there are several works ( Tsai et al. , 2019 ; Li et al. , 2021e ; Hu & Singh , 2021 ) that apply cross-attention for multi-modal feature fusion , which demonstrates that attention mechanism is powerful at distilling noise and feature alignment . This paper adopts cross-attention in the context of pure transformers for UDA tasks . 2.2 UNSUPERVISED DOMAIN ADAPTATION . There are mainly two levels for UDA methods : domain-level ( Tzeng et al. , 2014 ; Long et al. , 2015 ; Ghifary et al. , 2016 ; Tzeng et al. , 2017 ; Bousmalis et al. , 2017 ; Hoffman et al. , 2018 ) and categorylevel ( Saito et al. , 2018 ; Kang et al. , 2019 ; Du et al. , 2021 ; Li et al. , 2021a ) . Domain-level UDA mitigates the distribution divergence between the source and target domain by pulling them into the same distribution at different scale levels . The commonly used divergence measures include Maximum Mean Discrepancy ( MMD ) ( Gretton et al. , 2006 ; Tzeng et al. , 2014 ; Long et al. , 2015 ) and Correlation Alignment ( CORAL ) ( Sun et al. , 2016 ; Sun & Saenko , 2016 ) . Recently , some works ( Saito et al. , 2018 ; Du et al. , 2021 ; Li et al. , 2021a ) focus on the fine-grained category-level label distribution alignment through an adversarial manner between the feature extractor and two domain-specific classifiers . Unlike coarse-grained alignment at the domain scale , this approach aligns each category distribution between the source and target domain data by pushing the target samples to the distribution of source samples in each category . Obviously , the fine-grained alignment results in more accurate distribution alignment within the same label space . Although the adversarial approach achieves new improvements by fusing fine-grained alignment operations of source and target samples at the category level , it still does not solve the problem of noisy samples in the wrong category . Our method adopts Transformers for category-level UDA to solve the noise problem . 2.3 PSEUDO LABELING . Pseudo labeling ( Lee et al. , 2013 ) is first introduced for semi-supervised learning and gains popularity in domain adaptation tasks . It learns to label unlabeled data using predicted probabilities and performs fine-tuning together with labeled data . In terms of using pseudo labeling for domain adaptation tasks , ( Long et al. , 2017 ; 2018 ) adopt pseudo labels to conduct conditional distribution alignment ; ( Zhang et al. , 2018 ; Choi et al. , 2019 ) use pseudo labels as a regularization for domain adaptation ; Zou et al . ( 2018 ) designs a self-training framework by alternately solving pseudo labels ; Caron et al . ( 2018 ) propose a deep self-supervised method by generating pseudo labels via k-means cluster to progressively train the model ; Liang et al . ( 2020 ) develop a self-supervised pseudo labeling method to alleviate the effects of noisy pseudo labels . Based on Liang et al . ( 2020 ) , in this work , we propose a two-way center-aware labeling algorithm to further filter the noisy pseudo pairs . 3 THE PROPOSED METHOD . We first introduce the cross attention module and analyze its robustness to the noise in Section 3.1 . Then the two-way center-aware labeling method is presented in Section 3.2 . With the produced pseudo labels as inputs , our cross-domain transformer ( CDTrans ) is proposed in Section 3.3 , consisting of three weight-sharing transformers . 3.1 THE CROSS ATTENTION IN TRANSFORMER . 3.1.1 PRELIMINARY . Vision Transformer ( ViT ) ( Dosovitskiy et al. , 2020 ) has achieved comparable or even superior performance on computer vision tasks . One of the most important structures in ViT is the selfattention module ( Vaswani et al. , 2017 ) . In ViT , an image I ∈ RH×W×C is reshaped into a sequence of flattened 2D patches x ∈ RN× ( P 2·C ) , where ( H , W ) is the resolution of the original image , C is the number of channels , ( P , P ) is the resolution of each image patch , and N = HW/P 2 is the resulting number of patches . For self-attention , the patches are first projected into three vectors , i.e . queries Q ∈ RN×dk , keys K ∈ RN×dk and values V ∈ RN×dv . dk and dv indicates their dimensions . The output is computed as a weighted sum of the values , where the weight assigned to each value is computed by a compatibility function of the query with the corresponding key . The N patches serve as the inputs for the self-attention module , and the process can be formulated as below . The self-attention module aims to emphasize relationships among patches of the input image . Attnself ( Q , K , V ) = softmax ( QKT√ dk ) V ( 1 ) The cross-attention module is derived from the self-attention module . The difference is that the input of cross-attention is a pair of images , i.e . Is and It . Its query and key/value are from patches of Is and It respectively . The cross-attention module can be calculated as follows : Attncross ( Qs , Kt , Vt ) = softmax ( QsK T t√ dk ) Vt ( 2 ) where Qs ∈RM×dk are queries from M patches of image Is , and Kt ∈RN×dk , Vt ∈RN×dv are keys and values from N patches of image It . The output of the cross-attention module holds the same length M as the number of the queries . For each output , it is calculated by multiplying Vt with attention weights , which comes from the similarity between the corresponding query in Is and all the keys in It . As a result , among all patches in It , the patch that is more similar to the query of Is would hold a larger weight and contribute more to the output . In other words , the output of the cross-attention module manages to aggregate the two input images based on their similar patches . So far , many researchers have utilized the cross-attention for feature fusion , especially in multimodal tasks ( Tsai et al. , 2019 ; Li et al. , 2019 ; Hu & Singh , 2021 ; Li et al. , 2021e ) . In these works , the inputs of the cross-attention module are from two modalities , e.g . vision-to-text ( Tsai et al. , 2019 ; Hu & Singh , 2021 ) , text-to-speech ( Li et al. , 2019 ) and vision-to-vision ( Li et al. , 2021e ) . They apply the cross-attention to aggregate and align the information from two modalities . Given its great power in feature alignment , we propose to use the cross attention module to solve the unsupervised domain adaptation problem .
In this work, the authors propose a method for domain adaptation by introducing a new way of generating pseudo labels and a cross-transformer with classification and distillation losses. The authors used a cross-transformer where the queries come from the source domain and the values and keys come from the target domain, and try to minimize the output distribution difference between the cross branch and the target branch by a distillation loss. Since the transformers compare source and target in a patch-based manner, the authors find it is more robust to false-positive pairs. The authors do not focus on learning domain-invariant feature representation and mainly solve the domain adaptation problem by pseudo labeling. In four public datasets, the proposed method showed outstanding performance.
SP:c7c6429978499249cee3d57596a0143bbde4bd7c
CDTrans: Cross-domain Transformer for Unsupervised Domain Adaptation
1 INTRODUCTION . Deep neural network have achieved remarkable success in a wide range of application scenarios but it still suffers poor generalization performance to other new domain because of the domain shift problem ( Csurka , 2017 ; Zhao et al. , 2020 ; Zhang et al. , 2020 ; Oza et al. , 2021 ) . To handle this issue and avoid the expensive laborious annotations , lots of research efforts ( Bousmalis et al. , 2017 ; Kuroki et al. , 2019 ; Wilson & Cook , 2020 ; VS et al. , 2021 ) are devoted on Unsupervised Domain Adaptation ( UDA ) . The UDA task aims to transfer knowledge learned from a labeled source domain to a different unlabeled target domain . In UDA , most approaches focus on aligning distributions of source and target domain and learning domain-invariant feature representations . One kind of such UDA methods are based on category-level alignment ( Kang et al. , 2019 ; Zhang et al. , 2019 ; Jiang et al. , 2020 ; Li et al. , 2021b ) , which have achieved promising results on public UDA datasets using deep convolution neural networks ( CNNs ) . The fundamental problems in category-level based alignment is the production of pseudo labels for samples in target domain to generate the input source-target pairs . However , the current CNNs-based methods are not robust to the generated noisy pseudo labels for accurate domain alignment ( Morerio et al. , 2020 ; Jiang et al. , 2020 ) . With the success of Transformer in natural language processing ( NLP ) ( Vaswani et al. , 2017 ; Devlin et al. , 2018 ) and vision tasks ( Dosovitskiy et al. , 2020 ; Han et al. , 2020 ; He et al. , 2021 ; Khan et al. , 2021 ) , it is found that cross-attention in Transformer is good at aligning different distributions , even from different modalities e.g. , vision-to-vision ( Li et al. , 2021e ) , vision-to-text ( Tsai et al. , 2019 ; Hu & Singh , 2021 ) and text-to-speech ( Li et al. , 2019 ) . And we find that it is robust to noise in pseudo labels to some extent . Hence , in this paper , we apply transformers to the UDA task to take advantage of its robustness to noise and super power for feature alignment to deal with the problems as described above in CNNs . In our experiment , we conclude that even with noise in the labeling pair , the cross-attention can still work well in aligning two distributions , thanks to the attention mechanism . To obtain more accurate pseudo labels , we designed a two-way center-aware labeling algorithm for samples in the target domain . The pseudo labels are produced based on the cross-domain similarity matrix , and a center-aware matching is involved to weight the matrix and weaken noise into the tolerable range . With the help of pseudo labels , we design the cross-domain transformer ( CDTrans ) for UDA . It consists of three weight-sharing transformer branches , of which two branches are for source and target data respectively and the third one is the feature alignment branch , whose inputs are from source-target pairs . The self-attention is applied in the source/target transformer branches and crossattention is involved in the feature alignment branch to conduct domain alignment . Such design explicitly enforces the framework to learn discriminative domain-specific and domain-invariant representations simultaneously . In summary , our contributions are three-fold : • We propose a weight-sharing triple-branch transformer framework , namely , CDTrans , for accurate unsupervised domain adaptation , taking advantage of its robustness to noisy labeling data and great power for feature alignment . • To produce pseudo labels with high quality , a two-way center-aware labeling method is proposed , and it boosts the final performance in the context of CDTrans . • CDTrans achieves the best performance compared to state-of-the-arts with a large margin on VisDA-2017 ( Peng et al. , 2017 ) and DomainNet ( Peng et al. , 2019 ) datasets . 2 RELATED WORK . 2.1 TRANSFORMER FOR VISION . Transformer is proposed in ( Vaswani et al. , 2017 ) to model sequential data in the field of NLP . Many works have shown its effectiveness for computer-vision tasks ( Han et al. , 2020 ; Khan et al. , 2021 ; Li et al. , 2021d ; Han et al. , 2021b ; Yu et al. , 2021 ; Li et al. , 2021c ; Yang et al. , 2021 ) . Pure Transformer based models are becoming more and more popular . For example , ViT ( Dosovitskiy et al. , 2020 ) is proposed recently by feeding transformer with sequences of image patches ; Touvron et al . ( Touvron et al. , 2021 ) propose DeiT that introduces a distillation strategy for transformers to help with ViT training ; many other ViT variants ( Yuan et al. , 2021a ; Wang et al. , 2021 ; Han et al. , 2021a ; Chen et al. , 2021 ; Ranftl et al. , 2021 ; Liu et al. , 2021 ) are proposed from then , which achieve promising performance compared with its counterpart CNNs for both image classification and downstream tasks , such as object detection ( Liu et al. , 2021 ) , semantic segmentation ( Yuan et al. , 2021b ) and object ReID ( He et al. , 2021 ) . For multi-modal based networks , there are several works ( Tsai et al. , 2019 ; Li et al. , 2021e ; Hu & Singh , 2021 ) that apply cross-attention for multi-modal feature fusion , which demonstrates that attention mechanism is powerful at distilling noise and feature alignment . This paper adopts cross-attention in the context of pure transformers for UDA tasks . 2.2 UNSUPERVISED DOMAIN ADAPTATION . There are mainly two levels for UDA methods : domain-level ( Tzeng et al. , 2014 ; Long et al. , 2015 ; Ghifary et al. , 2016 ; Tzeng et al. , 2017 ; Bousmalis et al. , 2017 ; Hoffman et al. , 2018 ) and categorylevel ( Saito et al. , 2018 ; Kang et al. , 2019 ; Du et al. , 2021 ; Li et al. , 2021a ) . Domain-level UDA mitigates the distribution divergence between the source and target domain by pulling them into the same distribution at different scale levels . The commonly used divergence measures include Maximum Mean Discrepancy ( MMD ) ( Gretton et al. , 2006 ; Tzeng et al. , 2014 ; Long et al. , 2015 ) and Correlation Alignment ( CORAL ) ( Sun et al. , 2016 ; Sun & Saenko , 2016 ) . Recently , some works ( Saito et al. , 2018 ; Du et al. , 2021 ; Li et al. , 2021a ) focus on the fine-grained category-level label distribution alignment through an adversarial manner between the feature extractor and two domain-specific classifiers . Unlike coarse-grained alignment at the domain scale , this approach aligns each category distribution between the source and target domain data by pushing the target samples to the distribution of source samples in each category . Obviously , the fine-grained alignment results in more accurate distribution alignment within the same label space . Although the adversarial approach achieves new improvements by fusing fine-grained alignment operations of source and target samples at the category level , it still does not solve the problem of noisy samples in the wrong category . Our method adopts Transformers for category-level UDA to solve the noise problem . 2.3 PSEUDO LABELING . Pseudo labeling ( Lee et al. , 2013 ) is first introduced for semi-supervised learning and gains popularity in domain adaptation tasks . It learns to label unlabeled data using predicted probabilities and performs fine-tuning together with labeled data . In terms of using pseudo labeling for domain adaptation tasks , ( Long et al. , 2017 ; 2018 ) adopt pseudo labels to conduct conditional distribution alignment ; ( Zhang et al. , 2018 ; Choi et al. , 2019 ) use pseudo labels as a regularization for domain adaptation ; Zou et al . ( 2018 ) designs a self-training framework by alternately solving pseudo labels ; Caron et al . ( 2018 ) propose a deep self-supervised method by generating pseudo labels via k-means cluster to progressively train the model ; Liang et al . ( 2020 ) develop a self-supervised pseudo labeling method to alleviate the effects of noisy pseudo labels . Based on Liang et al . ( 2020 ) , in this work , we propose a two-way center-aware labeling algorithm to further filter the noisy pseudo pairs . 3 THE PROPOSED METHOD . We first introduce the cross attention module and analyze its robustness to the noise in Section 3.1 . Then the two-way center-aware labeling method is presented in Section 3.2 . With the produced pseudo labels as inputs , our cross-domain transformer ( CDTrans ) is proposed in Section 3.3 , consisting of three weight-sharing transformers . 3.1 THE CROSS ATTENTION IN TRANSFORMER . 3.1.1 PRELIMINARY . Vision Transformer ( ViT ) ( Dosovitskiy et al. , 2020 ) has achieved comparable or even superior performance on computer vision tasks . One of the most important structures in ViT is the selfattention module ( Vaswani et al. , 2017 ) . In ViT , an image I ∈ RH×W×C is reshaped into a sequence of flattened 2D patches x ∈ RN× ( P 2·C ) , where ( H , W ) is the resolution of the original image , C is the number of channels , ( P , P ) is the resolution of each image patch , and N = HW/P 2 is the resulting number of patches . For self-attention , the patches are first projected into three vectors , i.e . queries Q ∈ RN×dk , keys K ∈ RN×dk and values V ∈ RN×dv . dk and dv indicates their dimensions . The output is computed as a weighted sum of the values , where the weight assigned to each value is computed by a compatibility function of the query with the corresponding key . The N patches serve as the inputs for the self-attention module , and the process can be formulated as below . The self-attention module aims to emphasize relationships among patches of the input image . Attnself ( Q , K , V ) = softmax ( QKT√ dk ) V ( 1 ) The cross-attention module is derived from the self-attention module . The difference is that the input of cross-attention is a pair of images , i.e . Is and It . Its query and key/value are from patches of Is and It respectively . The cross-attention module can be calculated as follows : Attncross ( Qs , Kt , Vt ) = softmax ( QsK T t√ dk ) Vt ( 2 ) where Qs ∈RM×dk are queries from M patches of image Is , and Kt ∈RN×dk , Vt ∈RN×dv are keys and values from N patches of image It . The output of the cross-attention module holds the same length M as the number of the queries . For each output , it is calculated by multiplying Vt with attention weights , which comes from the similarity between the corresponding query in Is and all the keys in It . As a result , among all patches in It , the patch that is more similar to the query of Is would hold a larger weight and contribute more to the output . In other words , the output of the cross-attention module manages to aggregate the two input images based on their similar patches . So far , many researchers have utilized the cross-attention for feature fusion , especially in multimodal tasks ( Tsai et al. , 2019 ; Li et al. , 2019 ; Hu & Singh , 2021 ; Li et al. , 2021e ) . In these works , the inputs of the cross-attention module are from two modalities , e.g . vision-to-text ( Tsai et al. , 2019 ; Hu & Singh , 2021 ) , text-to-speech ( Li et al. , 2019 ) and vision-to-vision ( Li et al. , 2021e ) . They apply the cross-attention to aggregate and align the information from two modalities . Given its great power in feature alignment , we propose to use the cross attention module to solve the unsupervised domain adaptation problem .
This paper proposes a weight-sharing triple-branch transformer framework, or CDTrans for unsupervised domain adaptation. A two-way center-aware labeling method is proposed to provide better pseudo-labels. SOTA performances were achieved via the proposed method.
SP:c7c6429978499249cee3d57596a0143bbde4bd7c
CDTrans: Cross-domain Transformer for Unsupervised Domain Adaptation
1 INTRODUCTION . Deep neural network have achieved remarkable success in a wide range of application scenarios but it still suffers poor generalization performance to other new domain because of the domain shift problem ( Csurka , 2017 ; Zhao et al. , 2020 ; Zhang et al. , 2020 ; Oza et al. , 2021 ) . To handle this issue and avoid the expensive laborious annotations , lots of research efforts ( Bousmalis et al. , 2017 ; Kuroki et al. , 2019 ; Wilson & Cook , 2020 ; VS et al. , 2021 ) are devoted on Unsupervised Domain Adaptation ( UDA ) . The UDA task aims to transfer knowledge learned from a labeled source domain to a different unlabeled target domain . In UDA , most approaches focus on aligning distributions of source and target domain and learning domain-invariant feature representations . One kind of such UDA methods are based on category-level alignment ( Kang et al. , 2019 ; Zhang et al. , 2019 ; Jiang et al. , 2020 ; Li et al. , 2021b ) , which have achieved promising results on public UDA datasets using deep convolution neural networks ( CNNs ) . The fundamental problems in category-level based alignment is the production of pseudo labels for samples in target domain to generate the input source-target pairs . However , the current CNNs-based methods are not robust to the generated noisy pseudo labels for accurate domain alignment ( Morerio et al. , 2020 ; Jiang et al. , 2020 ) . With the success of Transformer in natural language processing ( NLP ) ( Vaswani et al. , 2017 ; Devlin et al. , 2018 ) and vision tasks ( Dosovitskiy et al. , 2020 ; Han et al. , 2020 ; He et al. , 2021 ; Khan et al. , 2021 ) , it is found that cross-attention in Transformer is good at aligning different distributions , even from different modalities e.g. , vision-to-vision ( Li et al. , 2021e ) , vision-to-text ( Tsai et al. , 2019 ; Hu & Singh , 2021 ) and text-to-speech ( Li et al. , 2019 ) . And we find that it is robust to noise in pseudo labels to some extent . Hence , in this paper , we apply transformers to the UDA task to take advantage of its robustness to noise and super power for feature alignment to deal with the problems as described above in CNNs . In our experiment , we conclude that even with noise in the labeling pair , the cross-attention can still work well in aligning two distributions , thanks to the attention mechanism . To obtain more accurate pseudo labels , we designed a two-way center-aware labeling algorithm for samples in the target domain . The pseudo labels are produced based on the cross-domain similarity matrix , and a center-aware matching is involved to weight the matrix and weaken noise into the tolerable range . With the help of pseudo labels , we design the cross-domain transformer ( CDTrans ) for UDA . It consists of three weight-sharing transformer branches , of which two branches are for source and target data respectively and the third one is the feature alignment branch , whose inputs are from source-target pairs . The self-attention is applied in the source/target transformer branches and crossattention is involved in the feature alignment branch to conduct domain alignment . Such design explicitly enforces the framework to learn discriminative domain-specific and domain-invariant representations simultaneously . In summary , our contributions are three-fold : • We propose a weight-sharing triple-branch transformer framework , namely , CDTrans , for accurate unsupervised domain adaptation , taking advantage of its robustness to noisy labeling data and great power for feature alignment . • To produce pseudo labels with high quality , a two-way center-aware labeling method is proposed , and it boosts the final performance in the context of CDTrans . • CDTrans achieves the best performance compared to state-of-the-arts with a large margin on VisDA-2017 ( Peng et al. , 2017 ) and DomainNet ( Peng et al. , 2019 ) datasets . 2 RELATED WORK . 2.1 TRANSFORMER FOR VISION . Transformer is proposed in ( Vaswani et al. , 2017 ) to model sequential data in the field of NLP . Many works have shown its effectiveness for computer-vision tasks ( Han et al. , 2020 ; Khan et al. , 2021 ; Li et al. , 2021d ; Han et al. , 2021b ; Yu et al. , 2021 ; Li et al. , 2021c ; Yang et al. , 2021 ) . Pure Transformer based models are becoming more and more popular . For example , ViT ( Dosovitskiy et al. , 2020 ) is proposed recently by feeding transformer with sequences of image patches ; Touvron et al . ( Touvron et al. , 2021 ) propose DeiT that introduces a distillation strategy for transformers to help with ViT training ; many other ViT variants ( Yuan et al. , 2021a ; Wang et al. , 2021 ; Han et al. , 2021a ; Chen et al. , 2021 ; Ranftl et al. , 2021 ; Liu et al. , 2021 ) are proposed from then , which achieve promising performance compared with its counterpart CNNs for both image classification and downstream tasks , such as object detection ( Liu et al. , 2021 ) , semantic segmentation ( Yuan et al. , 2021b ) and object ReID ( He et al. , 2021 ) . For multi-modal based networks , there are several works ( Tsai et al. , 2019 ; Li et al. , 2021e ; Hu & Singh , 2021 ) that apply cross-attention for multi-modal feature fusion , which demonstrates that attention mechanism is powerful at distilling noise and feature alignment . This paper adopts cross-attention in the context of pure transformers for UDA tasks . 2.2 UNSUPERVISED DOMAIN ADAPTATION . There are mainly two levels for UDA methods : domain-level ( Tzeng et al. , 2014 ; Long et al. , 2015 ; Ghifary et al. , 2016 ; Tzeng et al. , 2017 ; Bousmalis et al. , 2017 ; Hoffman et al. , 2018 ) and categorylevel ( Saito et al. , 2018 ; Kang et al. , 2019 ; Du et al. , 2021 ; Li et al. , 2021a ) . Domain-level UDA mitigates the distribution divergence between the source and target domain by pulling them into the same distribution at different scale levels . The commonly used divergence measures include Maximum Mean Discrepancy ( MMD ) ( Gretton et al. , 2006 ; Tzeng et al. , 2014 ; Long et al. , 2015 ) and Correlation Alignment ( CORAL ) ( Sun et al. , 2016 ; Sun & Saenko , 2016 ) . Recently , some works ( Saito et al. , 2018 ; Du et al. , 2021 ; Li et al. , 2021a ) focus on the fine-grained category-level label distribution alignment through an adversarial manner between the feature extractor and two domain-specific classifiers . Unlike coarse-grained alignment at the domain scale , this approach aligns each category distribution between the source and target domain data by pushing the target samples to the distribution of source samples in each category . Obviously , the fine-grained alignment results in more accurate distribution alignment within the same label space . Although the adversarial approach achieves new improvements by fusing fine-grained alignment operations of source and target samples at the category level , it still does not solve the problem of noisy samples in the wrong category . Our method adopts Transformers for category-level UDA to solve the noise problem . 2.3 PSEUDO LABELING . Pseudo labeling ( Lee et al. , 2013 ) is first introduced for semi-supervised learning and gains popularity in domain adaptation tasks . It learns to label unlabeled data using predicted probabilities and performs fine-tuning together with labeled data . In terms of using pseudo labeling for domain adaptation tasks , ( Long et al. , 2017 ; 2018 ) adopt pseudo labels to conduct conditional distribution alignment ; ( Zhang et al. , 2018 ; Choi et al. , 2019 ) use pseudo labels as a regularization for domain adaptation ; Zou et al . ( 2018 ) designs a self-training framework by alternately solving pseudo labels ; Caron et al . ( 2018 ) propose a deep self-supervised method by generating pseudo labels via k-means cluster to progressively train the model ; Liang et al . ( 2020 ) develop a self-supervised pseudo labeling method to alleviate the effects of noisy pseudo labels . Based on Liang et al . ( 2020 ) , in this work , we propose a two-way center-aware labeling algorithm to further filter the noisy pseudo pairs . 3 THE PROPOSED METHOD . We first introduce the cross attention module and analyze its robustness to the noise in Section 3.1 . Then the two-way center-aware labeling method is presented in Section 3.2 . With the produced pseudo labels as inputs , our cross-domain transformer ( CDTrans ) is proposed in Section 3.3 , consisting of three weight-sharing transformers . 3.1 THE CROSS ATTENTION IN TRANSFORMER . 3.1.1 PRELIMINARY . Vision Transformer ( ViT ) ( Dosovitskiy et al. , 2020 ) has achieved comparable or even superior performance on computer vision tasks . One of the most important structures in ViT is the selfattention module ( Vaswani et al. , 2017 ) . In ViT , an image I ∈ RH×W×C is reshaped into a sequence of flattened 2D patches x ∈ RN× ( P 2·C ) , where ( H , W ) is the resolution of the original image , C is the number of channels , ( P , P ) is the resolution of each image patch , and N = HW/P 2 is the resulting number of patches . For self-attention , the patches are first projected into three vectors , i.e . queries Q ∈ RN×dk , keys K ∈ RN×dk and values V ∈ RN×dv . dk and dv indicates their dimensions . The output is computed as a weighted sum of the values , where the weight assigned to each value is computed by a compatibility function of the query with the corresponding key . The N patches serve as the inputs for the self-attention module , and the process can be formulated as below . The self-attention module aims to emphasize relationships among patches of the input image . Attnself ( Q , K , V ) = softmax ( QKT√ dk ) V ( 1 ) The cross-attention module is derived from the self-attention module . The difference is that the input of cross-attention is a pair of images , i.e . Is and It . Its query and key/value are from patches of Is and It respectively . The cross-attention module can be calculated as follows : Attncross ( Qs , Kt , Vt ) = softmax ( QsK T t√ dk ) Vt ( 2 ) where Qs ∈RM×dk are queries from M patches of image Is , and Kt ∈RN×dk , Vt ∈RN×dv are keys and values from N patches of image It . The output of the cross-attention module holds the same length M as the number of the queries . For each output , it is calculated by multiplying Vt with attention weights , which comes from the similarity between the corresponding query in Is and all the keys in It . As a result , among all patches in It , the patch that is more similar to the query of Is would hold a larger weight and contribute more to the output . In other words , the output of the cross-attention module manages to aggregate the two input images based on their similar patches . So far , many researchers have utilized the cross-attention for feature fusion , especially in multimodal tasks ( Tsai et al. , 2019 ; Li et al. , 2019 ; Hu & Singh , 2021 ; Li et al. , 2021e ) . In these works , the inputs of the cross-attention module are from two modalities , e.g . vision-to-text ( Tsai et al. , 2019 ; Hu & Singh , 2021 ) , text-to-speech ( Li et al. , 2019 ) and vision-to-vision ( Li et al. , 2021e ) . They apply the cross-attention to aggregate and align the information from two modalities . Given its great power in feature alignment , we propose to use the cross attention module to solve the unsupervised domain adaptation problem .
This submission proposes a transformer framework for unsupervised domain adaptive classification tasks. In this submission, they conduct an exploration about cross attention layer and found that the cross attention layer is robust to pseudo label noise. Inspired by this, they construct a three branches architecture in this submission, which includes a source transformer, target transformer, a source-target transformer. Due to the robustness of the cross attention layer, the source-target transformer acts as a teacher to guide the other two branches.
SP:c7c6429978499249cee3d57596a0143bbde4bd7c
Offline Reinforcement Learning for Large Scale Language Action Spaces
1 INTRODUCTION . Building an end-to-end task-oriented dialogue agent is one of the promising applications of natural language processing ( NLP ) tasks , yet challenging due to large language action spaces and limited availability of human-annotated data . Recently , large-scale pre-trained language models ( LM ) have achieved remarkable successes in various NLP tasks with prohibitively large vocabulary ( Devlin et al. , 2019 ; Radford et al. , 2019 ; Brown et al. , 2020 ; Raffel et al. , 2019 ) . The current best performing end-to-end conversational agents for a task-oriented dialogue system utilize a pre-training on largescale corpus and fine-tuning on downstream tasks ( Ham et al. , 2020 ; Yang et al. , 2021 ; Lin et al. , 2020 ; Peng et al. , 2021 ) . This combination of pre-training and fine-tuning significantly improves overall performance in the task-oriented dialogues . However , supervised fine-tuning ( i.e . imitation learning of the dialogue corpus ) alone may not be sufficient to learn an optimal dialogue strategy since the corpus often contains suboptimal dialogues collected from human participants of diverse expertise levels . Thus , in order to optimize the task performance of the conversational agent , goaloriented training ( i.e . reinforcement learning ) is an essential and promising direction to pursue . Training a task-oriented conversational agent from a dialogue corpus can be naturally formulated as offline reinforcement learning ( RL ) problem ( Levine et al. , 2020 ; Fujimoto et al. , 2019 ; Jaques et al. , 2020 ) , which offers the prospect to optimize the policy solely from the fixed dataset without online environment interaction . Most of the existing offline RL methods are built on the off-policy ActorCritic framework , which performs iterative optimization of the policy ( i.e . actor ) and the actionvalue function ( i.e . critic ) ( Fujimoto et al. , 2019 ; Janner et al. , 2019 ; Kumar et al. , 2020 ) . Yet , a naive application of these offline RL methods generally results in poor dialogue strategies which generate responses in no way similar to human language ( Lewis et al. , 2017 ; Zhao et al. , 2019 ; Jang et al. , 2020 ) . To mitigate the aforementioned problem , discrete latent representation models for language actions have been proposed to disentangle the semantics of the utterance and the natural language generation ( Zhao et al. , 2019 ; Yarats & Lewis , 2018 ) . In that framework , goal-based training was performed in the space of the discrete latent variables instead of directly optimizing utterances . While these approaches can prevent degenerate responses in principle , they can not be straightforwardly applied to widely used large-scale LMs since most of them are not trained for discrete latent variables . One could make modifications to the LM to work with discrete latent variables but it would need to be pre-trained from scratch with a tremendous amount of data and time , which is undesirable . In this paper , we present an offline RL algorithm for task-oriented dialogue , which can be adopted for any generative pre-trained language model . Our algorithm , GPT-Critic , does not rely on policy gradient unlike actor-critic methods and is essentially free from the issue of diverging from human language . It starts with fine-tuning the GPT-2 model and learning the action-value function ( critic ) using the dialogue corpus . Then , GPT-Critic generates a strategically promising action that is selected based on the value estimated by the critic . GPT-Critic updates the policy through behavior cloning of the critic-guided self-generated responses . This is in contrast to the previous methods that perform weighted behavior cloning on the dialogue corpus , where the action choice is restricted to the support in the dataset ( Wang et al. , 2020 ) . Since GPT-Critic does not rely on policy gradient and updates the policy within the support of generated actions from the GPT-2 , it thus inherits GPT-2 ’ s ability to generate human-like responses . In the experiments , we demonstrate that GPT-Critic outperforms the state-of-the-art end-to-end dialogue agent in the task-oriented dialogue benchmarks including MultiWOZ ( Budzianowski et al. , 2018 ) and ConvLab ( Zhu et al. , 2020 ) . 2 BACKGROUND . 2.1 OFFLINE REINFORCEMENT LEARNING FOR TASK-ORIENTED DIALOGUES . We consider the task-oriented dialogue system that can be modeled as a partially observable Markov decision process ( POMDP ) defined by tuple 〈S , A , O , T , Z , R , γ〉 where S is the set of environment states s = 〈g , h〉 ( underlying state that consists of the user goal g and dialogue history h ) , A is the set of actions a ( a sequence of tokens which represents dialogue act and system response ) , O is the set of observations o ( user utterance ) , T ( s′|s , a ) = Pr ( st+1 = s′|st = s , at = a ) is the transition function , Z ( o|s′ , a ) = Pr ( ot+1 = o|st+1 = s′ , at = a ) is the observation probability , R ( g , h , a ) is the reward function indicating the utility of executing action a in history h and the user goal g , and γ ∈ ( 0 , 1 ) is a discount factor . The history at time step t , ht = { o0 , a0 , . . . ot−1 , at−1 , ot } , is a sequence of all previous observations and actions . Since the underlying state s ( e.g . user goal ) is not directly observable , the agent makes decisions based on the entire observation-action history . The policy π ( at|ht ) is mapping from history ht to a probability distribution over A . The goal is to find an optimal policy π∗ that maximizes the expected cumulative rewards , i.e . π∗ = arg maxπ Eπ [ ∑∞ t=0 γ tR ( g , ht , at ) ] . The action-value function of policy π is defined as Qπ ( h , a ) : = Eπ [ ∑∞ t=0 γ tR ( g , ht , at ) |h0 = h , a0 = a ] , where Qπ is a unique solution of the Bellman equation : Qπ ( h , a ) = Eg [ R ( g , h , a ) ] + γEπ [ Qπ ( h′ , a′ ) ] . Using offline RL for dialogue policy optimization , the agent optimizes the policy from the precollected dataset D = { { ( gj , hjt , a j t , r j t , h j t+1 ) T t=0 } Nj=1 } without online environment interaction during the intermediate stages of training . Prior offline RL algorithms ( Fujimoto et al. , 2019 ; Janner et al. , 2019 ; Kumar et al. , 2020 ) rely on off-policy actor-critic method , where the critic network is trained by minimizing the temporal differnce error with respect to the target policy π : arg min φ E ( ht , at , rt , ht+1 ) ∼D [ ( rt + γEat+1∼π ( ht+1 ) [ Qφ̄ ( ht+1 , at+1 ) ] −Qφ ( ht , at ) ) 2 ] ( 1 ) where φ̄ is the parameters of the target network . As discussed in the prior work ( Fujimoto et al. , 2019 ; Kumar et al. , 2020 ) , optimizing this loss can be challenging in the offline RL setting due to the overestimation issue in the bootstrapping process by taking out-of-distribution ( OOD ) actions to evaluate the value of the next state . 2.2 END-TO-END TASK-ORIENTED DIALOGUE SYSTEM . We focus on the MultiWOZ dataset ( Budzianowski et al. , 2018 ) , which is a representative benchmark for task-oriented dialogue . The MultiWOZ dataset is a fully-annotated corpus of human-human task-oriented conversations , which is collected via the Wizard-of-Oz setting ( Kelley , 1984 ) . The traditional approach to building a task-oriented dialogue system adopts a modular pipeline , which consists of the following four modules : 1 ) A natural language understanding ( NLU ) module ( Kim et al. , 2017 ; Zhu et al. , 2020 ) identifies the user ’ s intent and extracts the information of slots and their values , 2 ) A Dialogue state tracking ( DST ) module ( Williams et al. , 2013 ) infers the belief state , 3 ) A dialogue policy ( POL ) module decides the system action , 4 ) A natural language generation ( NLG ) module ( Wen et al. , 2015 ) generates the system response corresponding to the system action . Recently , end-to-end task-oriented dialogue methods leveraging the pre-trained language model have been proposed ( Yang et al. , 2021 ; Ham et al. , 2020 ; Lin et al. , 2020 ; Peng et al. , 2021 ; Hosseini-Asl et al. , 2020 ) , and significantly improves overall performance in the task-oriented dialogues . In this paper , our algorithm is built upon UBAR ( Yang et al. , 2021 ) , which is based on GPT-2 ( Radford et al. , 2019 ) and currently the state-of-the-art end-to-end dialogue agent for the MultiWOZ domain . 3 OFFLINE REINFORCEMENT LEARNING FOR END-TO-END TASK-ORIENTED DIALOGUE SYSTEMS . The corpus collected from human-human conversations inevitably contains unsuccessful dialogues in terms of task completion . For example , approximately 20 % dialogues of the MultiWOZ dataset fail to meet the user goal . Therefore , a naive behavior cloning of the whole dataset would limit the performance of the conversational agent since the dataset includes a lot of unsuccessful dialogues : an agent that imitates failure would be inevitably suboptimal . Yet , dropping the unsuccessful dialogues from the corpus is also undesirable , since they may contain some task-specific information that is useful to properly respond to user requests . We thus aim to revise unsuccessful dialogues into successful ones in order to prevent repeating the past failure while improving the task performance . In this section , we present GPT-Critic , an offline RL algorithm for task-oriented dialogue . Our GPTCritic is analogous to Actor-Critic method : GPT ( Actor ) decides which action to take while the Critic informs how good the action was and provides a signal for policy improvement . Still , GPTCritic is distinct from the Actor-Critic methods in that it does not rely on the policy gradients , which are generally known to cause the issue of diverging from human language ( Lewis et al. , 2017 ; Zhao et al. , 2019 ) . Instead , we sample a set of action candidates using GPT-2 and pick the best one using the critic , which constitutes a revised dialogue corpus . Then , we perform supervised fine-tuning of the GPT-2 on the revised dialogue corpus . This learning procedure of our GPT-Critic does not hurt the agent ’ s capability to generate human-like sentences , given that the generated action candidates were all natural-looking sentences due to the power of large pre-trained LM . Our algorithm is built upon the GPT-2 but it can be adopted for any generative pre-trained language model . 3.1 POLICY EVALUATION . Our GPT-Critic starts by training the action-value function ( i.e . critic ) , which can evaluate the candidates for the response . The architecture of the critic network basically follows GPT-2 with employing different last layers to compute the Q-value . The parameterization of the critic network Qφ is designed to share the parameters of the Transformer ( Vaswani et al. , 2017 ) layers of GPT-2 , where the parameters of the Transformer layers are only updated during the policy improvement step . The critic network of GPT-Critic is trained by minimizing the temporal difference error with respect to the dataset D : arg min φ E ( ht , at , rt , ht+1 , at+1 ) ∼D [ ( rt + γQφ̄ ( ht+1 , at+1 ) −Qφ ( ht , at ) ) 2 ] ( 2 ) where φ̄ is the parameters of the target network . Note that Eq . ( 2 ) is an on-policy evaluation on the dataset D , which can be optimized very stably since every at+1 is always an in-distribution sample of D. This is in contrast to Eq . ( 1 ) , which requires evaluation of out-of-distribution actions sampled from the target policy π . The OOD action-value estimation can be very unreliable if the target policy deviates much from the dataset . This kind of on-policy evaluation has been explored in the offline RL context for stable policy optimization ( Brandfonbrener et al. , 2021 ; Goo & Niekum , 2021 ) , but they are limited to only one-step policy improvement : once the policy π is improved by the initial on-policy Q-function ( i.e . π ( s ) = arg maxaQ ( s , a ) ) , the new policy deviates from the dataset policy , thus it requires off-policy evaluation for further policy iteration . In contrast , our GPT-Critic performs policy improvement by generating an improved dataset based on the learned critic , where we can perform on-policy evaluation on the new dataset again . As a consequence , GPT-Critic can enjoy the stable multi-step policy iteration through alternation between on-policy evaluation and policy improvement via revising dataset , which will be discussed in the following section .
This paper presents a reinforcement learning-based approach to building a task-oriented dialogue agent. Given a dialogue dataset annotated with rewards, the state-action value function is first trained by minimizing temporal differences. Then, a new training dataset is created by using the best actions selected among the candidates generated by the current policy (i.e., the language model). The policy is then updated by behavior cloning using the created dataset, and the whole process is repeated. The authors have conducted experiments using MultiWOZ and ConvLab and shown that this iterative process improves the performance of the agent.
SP:075222515d247ab5a2b691fa625741c5e2c9f2b9
Offline Reinforcement Learning for Large Scale Language Action Spaces
1 INTRODUCTION . Building an end-to-end task-oriented dialogue agent is one of the promising applications of natural language processing ( NLP ) tasks , yet challenging due to large language action spaces and limited availability of human-annotated data . Recently , large-scale pre-trained language models ( LM ) have achieved remarkable successes in various NLP tasks with prohibitively large vocabulary ( Devlin et al. , 2019 ; Radford et al. , 2019 ; Brown et al. , 2020 ; Raffel et al. , 2019 ) . The current best performing end-to-end conversational agents for a task-oriented dialogue system utilize a pre-training on largescale corpus and fine-tuning on downstream tasks ( Ham et al. , 2020 ; Yang et al. , 2021 ; Lin et al. , 2020 ; Peng et al. , 2021 ) . This combination of pre-training and fine-tuning significantly improves overall performance in the task-oriented dialogues . However , supervised fine-tuning ( i.e . imitation learning of the dialogue corpus ) alone may not be sufficient to learn an optimal dialogue strategy since the corpus often contains suboptimal dialogues collected from human participants of diverse expertise levels . Thus , in order to optimize the task performance of the conversational agent , goaloriented training ( i.e . reinforcement learning ) is an essential and promising direction to pursue . Training a task-oriented conversational agent from a dialogue corpus can be naturally formulated as offline reinforcement learning ( RL ) problem ( Levine et al. , 2020 ; Fujimoto et al. , 2019 ; Jaques et al. , 2020 ) , which offers the prospect to optimize the policy solely from the fixed dataset without online environment interaction . Most of the existing offline RL methods are built on the off-policy ActorCritic framework , which performs iterative optimization of the policy ( i.e . actor ) and the actionvalue function ( i.e . critic ) ( Fujimoto et al. , 2019 ; Janner et al. , 2019 ; Kumar et al. , 2020 ) . Yet , a naive application of these offline RL methods generally results in poor dialogue strategies which generate responses in no way similar to human language ( Lewis et al. , 2017 ; Zhao et al. , 2019 ; Jang et al. , 2020 ) . To mitigate the aforementioned problem , discrete latent representation models for language actions have been proposed to disentangle the semantics of the utterance and the natural language generation ( Zhao et al. , 2019 ; Yarats & Lewis , 2018 ) . In that framework , goal-based training was performed in the space of the discrete latent variables instead of directly optimizing utterances . While these approaches can prevent degenerate responses in principle , they can not be straightforwardly applied to widely used large-scale LMs since most of them are not trained for discrete latent variables . One could make modifications to the LM to work with discrete latent variables but it would need to be pre-trained from scratch with a tremendous amount of data and time , which is undesirable . In this paper , we present an offline RL algorithm for task-oriented dialogue , which can be adopted for any generative pre-trained language model . Our algorithm , GPT-Critic , does not rely on policy gradient unlike actor-critic methods and is essentially free from the issue of diverging from human language . It starts with fine-tuning the GPT-2 model and learning the action-value function ( critic ) using the dialogue corpus . Then , GPT-Critic generates a strategically promising action that is selected based on the value estimated by the critic . GPT-Critic updates the policy through behavior cloning of the critic-guided self-generated responses . This is in contrast to the previous methods that perform weighted behavior cloning on the dialogue corpus , where the action choice is restricted to the support in the dataset ( Wang et al. , 2020 ) . Since GPT-Critic does not rely on policy gradient and updates the policy within the support of generated actions from the GPT-2 , it thus inherits GPT-2 ’ s ability to generate human-like responses . In the experiments , we demonstrate that GPT-Critic outperforms the state-of-the-art end-to-end dialogue agent in the task-oriented dialogue benchmarks including MultiWOZ ( Budzianowski et al. , 2018 ) and ConvLab ( Zhu et al. , 2020 ) . 2 BACKGROUND . 2.1 OFFLINE REINFORCEMENT LEARNING FOR TASK-ORIENTED DIALOGUES . We consider the task-oriented dialogue system that can be modeled as a partially observable Markov decision process ( POMDP ) defined by tuple 〈S , A , O , T , Z , R , γ〉 where S is the set of environment states s = 〈g , h〉 ( underlying state that consists of the user goal g and dialogue history h ) , A is the set of actions a ( a sequence of tokens which represents dialogue act and system response ) , O is the set of observations o ( user utterance ) , T ( s′|s , a ) = Pr ( st+1 = s′|st = s , at = a ) is the transition function , Z ( o|s′ , a ) = Pr ( ot+1 = o|st+1 = s′ , at = a ) is the observation probability , R ( g , h , a ) is the reward function indicating the utility of executing action a in history h and the user goal g , and γ ∈ ( 0 , 1 ) is a discount factor . The history at time step t , ht = { o0 , a0 , . . . ot−1 , at−1 , ot } , is a sequence of all previous observations and actions . Since the underlying state s ( e.g . user goal ) is not directly observable , the agent makes decisions based on the entire observation-action history . The policy π ( at|ht ) is mapping from history ht to a probability distribution over A . The goal is to find an optimal policy π∗ that maximizes the expected cumulative rewards , i.e . π∗ = arg maxπ Eπ [ ∑∞ t=0 γ tR ( g , ht , at ) ] . The action-value function of policy π is defined as Qπ ( h , a ) : = Eπ [ ∑∞ t=0 γ tR ( g , ht , at ) |h0 = h , a0 = a ] , where Qπ is a unique solution of the Bellman equation : Qπ ( h , a ) = Eg [ R ( g , h , a ) ] + γEπ [ Qπ ( h′ , a′ ) ] . Using offline RL for dialogue policy optimization , the agent optimizes the policy from the precollected dataset D = { { ( gj , hjt , a j t , r j t , h j t+1 ) T t=0 } Nj=1 } without online environment interaction during the intermediate stages of training . Prior offline RL algorithms ( Fujimoto et al. , 2019 ; Janner et al. , 2019 ; Kumar et al. , 2020 ) rely on off-policy actor-critic method , where the critic network is trained by minimizing the temporal differnce error with respect to the target policy π : arg min φ E ( ht , at , rt , ht+1 ) ∼D [ ( rt + γEat+1∼π ( ht+1 ) [ Qφ̄ ( ht+1 , at+1 ) ] −Qφ ( ht , at ) ) 2 ] ( 1 ) where φ̄ is the parameters of the target network . As discussed in the prior work ( Fujimoto et al. , 2019 ; Kumar et al. , 2020 ) , optimizing this loss can be challenging in the offline RL setting due to the overestimation issue in the bootstrapping process by taking out-of-distribution ( OOD ) actions to evaluate the value of the next state . 2.2 END-TO-END TASK-ORIENTED DIALOGUE SYSTEM . We focus on the MultiWOZ dataset ( Budzianowski et al. , 2018 ) , which is a representative benchmark for task-oriented dialogue . The MultiWOZ dataset is a fully-annotated corpus of human-human task-oriented conversations , which is collected via the Wizard-of-Oz setting ( Kelley , 1984 ) . The traditional approach to building a task-oriented dialogue system adopts a modular pipeline , which consists of the following four modules : 1 ) A natural language understanding ( NLU ) module ( Kim et al. , 2017 ; Zhu et al. , 2020 ) identifies the user ’ s intent and extracts the information of slots and their values , 2 ) A Dialogue state tracking ( DST ) module ( Williams et al. , 2013 ) infers the belief state , 3 ) A dialogue policy ( POL ) module decides the system action , 4 ) A natural language generation ( NLG ) module ( Wen et al. , 2015 ) generates the system response corresponding to the system action . Recently , end-to-end task-oriented dialogue methods leveraging the pre-trained language model have been proposed ( Yang et al. , 2021 ; Ham et al. , 2020 ; Lin et al. , 2020 ; Peng et al. , 2021 ; Hosseini-Asl et al. , 2020 ) , and significantly improves overall performance in the task-oriented dialogues . In this paper , our algorithm is built upon UBAR ( Yang et al. , 2021 ) , which is based on GPT-2 ( Radford et al. , 2019 ) and currently the state-of-the-art end-to-end dialogue agent for the MultiWOZ domain . 3 OFFLINE REINFORCEMENT LEARNING FOR END-TO-END TASK-ORIENTED DIALOGUE SYSTEMS . The corpus collected from human-human conversations inevitably contains unsuccessful dialogues in terms of task completion . For example , approximately 20 % dialogues of the MultiWOZ dataset fail to meet the user goal . Therefore , a naive behavior cloning of the whole dataset would limit the performance of the conversational agent since the dataset includes a lot of unsuccessful dialogues : an agent that imitates failure would be inevitably suboptimal . Yet , dropping the unsuccessful dialogues from the corpus is also undesirable , since they may contain some task-specific information that is useful to properly respond to user requests . We thus aim to revise unsuccessful dialogues into successful ones in order to prevent repeating the past failure while improving the task performance . In this section , we present GPT-Critic , an offline RL algorithm for task-oriented dialogue . Our GPTCritic is analogous to Actor-Critic method : GPT ( Actor ) decides which action to take while the Critic informs how good the action was and provides a signal for policy improvement . Still , GPTCritic is distinct from the Actor-Critic methods in that it does not rely on the policy gradients , which are generally known to cause the issue of diverging from human language ( Lewis et al. , 2017 ; Zhao et al. , 2019 ) . Instead , we sample a set of action candidates using GPT-2 and pick the best one using the critic , which constitutes a revised dialogue corpus . Then , we perform supervised fine-tuning of the GPT-2 on the revised dialogue corpus . This learning procedure of our GPT-Critic does not hurt the agent ’ s capability to generate human-like sentences , given that the generated action candidates were all natural-looking sentences due to the power of large pre-trained LM . Our algorithm is built upon the GPT-2 but it can be adopted for any generative pre-trained language model . 3.1 POLICY EVALUATION . Our GPT-Critic starts by training the action-value function ( i.e . critic ) , which can evaluate the candidates for the response . The architecture of the critic network basically follows GPT-2 with employing different last layers to compute the Q-value . The parameterization of the critic network Qφ is designed to share the parameters of the Transformer ( Vaswani et al. , 2017 ) layers of GPT-2 , where the parameters of the Transformer layers are only updated during the policy improvement step . The critic network of GPT-Critic is trained by minimizing the temporal difference error with respect to the dataset D : arg min φ E ( ht , at , rt , ht+1 , at+1 ) ∼D [ ( rt + γQφ̄ ( ht+1 , at+1 ) −Qφ ( ht , at ) ) 2 ] ( 2 ) where φ̄ is the parameters of the target network . Note that Eq . ( 2 ) is an on-policy evaluation on the dataset D , which can be optimized very stably since every at+1 is always an in-distribution sample of D. This is in contrast to Eq . ( 1 ) , which requires evaluation of out-of-distribution actions sampled from the target policy π . The OOD action-value estimation can be very unreliable if the target policy deviates much from the dataset . This kind of on-policy evaluation has been explored in the offline RL context for stable policy optimization ( Brandfonbrener et al. , 2021 ; Goo & Niekum , 2021 ) , but they are limited to only one-step policy improvement : once the policy π is improved by the initial on-policy Q-function ( i.e . π ( s ) = arg maxaQ ( s , a ) ) , the new policy deviates from the dataset policy , thus it requires off-policy evaluation for further policy iteration . In contrast , our GPT-Critic performs policy improvement by generating an improved dataset based on the learned critic , where we can perform on-policy evaluation on the new dataset again . As a consequence , GPT-Critic can enjoy the stable multi-step policy iteration through alternation between on-policy evaluation and policy improvement via revising dataset , which will be discussed in the following section .
This paper proposes an offline RL method applied to an end-to-end task-oriented dialogue model, where the proposed GPT-Critic is built on GPT-2 and fine-tuned on the self-generated sentences for policy updating. The paper claims that it is free from the issue of diverging from human language (a common issue in standard RL), because it learns from the sentences directly sampled from the pre-trained language model. The conducted experiments show that the proposed model achieves better performance compared to other task-oriented end-to-end dialogue models in both offline and online settings (MultiWOZ and ConvLab respectively).
SP:075222515d247ab5a2b691fa625741c5e2c9f2b9
Offline Reinforcement Learning for Large Scale Language Action Spaces
1 INTRODUCTION . Building an end-to-end task-oriented dialogue agent is one of the promising applications of natural language processing ( NLP ) tasks , yet challenging due to large language action spaces and limited availability of human-annotated data . Recently , large-scale pre-trained language models ( LM ) have achieved remarkable successes in various NLP tasks with prohibitively large vocabulary ( Devlin et al. , 2019 ; Radford et al. , 2019 ; Brown et al. , 2020 ; Raffel et al. , 2019 ) . The current best performing end-to-end conversational agents for a task-oriented dialogue system utilize a pre-training on largescale corpus and fine-tuning on downstream tasks ( Ham et al. , 2020 ; Yang et al. , 2021 ; Lin et al. , 2020 ; Peng et al. , 2021 ) . This combination of pre-training and fine-tuning significantly improves overall performance in the task-oriented dialogues . However , supervised fine-tuning ( i.e . imitation learning of the dialogue corpus ) alone may not be sufficient to learn an optimal dialogue strategy since the corpus often contains suboptimal dialogues collected from human participants of diverse expertise levels . Thus , in order to optimize the task performance of the conversational agent , goaloriented training ( i.e . reinforcement learning ) is an essential and promising direction to pursue . Training a task-oriented conversational agent from a dialogue corpus can be naturally formulated as offline reinforcement learning ( RL ) problem ( Levine et al. , 2020 ; Fujimoto et al. , 2019 ; Jaques et al. , 2020 ) , which offers the prospect to optimize the policy solely from the fixed dataset without online environment interaction . Most of the existing offline RL methods are built on the off-policy ActorCritic framework , which performs iterative optimization of the policy ( i.e . actor ) and the actionvalue function ( i.e . critic ) ( Fujimoto et al. , 2019 ; Janner et al. , 2019 ; Kumar et al. , 2020 ) . Yet , a naive application of these offline RL methods generally results in poor dialogue strategies which generate responses in no way similar to human language ( Lewis et al. , 2017 ; Zhao et al. , 2019 ; Jang et al. , 2020 ) . To mitigate the aforementioned problem , discrete latent representation models for language actions have been proposed to disentangle the semantics of the utterance and the natural language generation ( Zhao et al. , 2019 ; Yarats & Lewis , 2018 ) . In that framework , goal-based training was performed in the space of the discrete latent variables instead of directly optimizing utterances . While these approaches can prevent degenerate responses in principle , they can not be straightforwardly applied to widely used large-scale LMs since most of them are not trained for discrete latent variables . One could make modifications to the LM to work with discrete latent variables but it would need to be pre-trained from scratch with a tremendous amount of data and time , which is undesirable . In this paper , we present an offline RL algorithm for task-oriented dialogue , which can be adopted for any generative pre-trained language model . Our algorithm , GPT-Critic , does not rely on policy gradient unlike actor-critic methods and is essentially free from the issue of diverging from human language . It starts with fine-tuning the GPT-2 model and learning the action-value function ( critic ) using the dialogue corpus . Then , GPT-Critic generates a strategically promising action that is selected based on the value estimated by the critic . GPT-Critic updates the policy through behavior cloning of the critic-guided self-generated responses . This is in contrast to the previous methods that perform weighted behavior cloning on the dialogue corpus , where the action choice is restricted to the support in the dataset ( Wang et al. , 2020 ) . Since GPT-Critic does not rely on policy gradient and updates the policy within the support of generated actions from the GPT-2 , it thus inherits GPT-2 ’ s ability to generate human-like responses . In the experiments , we demonstrate that GPT-Critic outperforms the state-of-the-art end-to-end dialogue agent in the task-oriented dialogue benchmarks including MultiWOZ ( Budzianowski et al. , 2018 ) and ConvLab ( Zhu et al. , 2020 ) . 2 BACKGROUND . 2.1 OFFLINE REINFORCEMENT LEARNING FOR TASK-ORIENTED DIALOGUES . We consider the task-oriented dialogue system that can be modeled as a partially observable Markov decision process ( POMDP ) defined by tuple 〈S , A , O , T , Z , R , γ〉 where S is the set of environment states s = 〈g , h〉 ( underlying state that consists of the user goal g and dialogue history h ) , A is the set of actions a ( a sequence of tokens which represents dialogue act and system response ) , O is the set of observations o ( user utterance ) , T ( s′|s , a ) = Pr ( st+1 = s′|st = s , at = a ) is the transition function , Z ( o|s′ , a ) = Pr ( ot+1 = o|st+1 = s′ , at = a ) is the observation probability , R ( g , h , a ) is the reward function indicating the utility of executing action a in history h and the user goal g , and γ ∈ ( 0 , 1 ) is a discount factor . The history at time step t , ht = { o0 , a0 , . . . ot−1 , at−1 , ot } , is a sequence of all previous observations and actions . Since the underlying state s ( e.g . user goal ) is not directly observable , the agent makes decisions based on the entire observation-action history . The policy π ( at|ht ) is mapping from history ht to a probability distribution over A . The goal is to find an optimal policy π∗ that maximizes the expected cumulative rewards , i.e . π∗ = arg maxπ Eπ [ ∑∞ t=0 γ tR ( g , ht , at ) ] . The action-value function of policy π is defined as Qπ ( h , a ) : = Eπ [ ∑∞ t=0 γ tR ( g , ht , at ) |h0 = h , a0 = a ] , where Qπ is a unique solution of the Bellman equation : Qπ ( h , a ) = Eg [ R ( g , h , a ) ] + γEπ [ Qπ ( h′ , a′ ) ] . Using offline RL for dialogue policy optimization , the agent optimizes the policy from the precollected dataset D = { { ( gj , hjt , a j t , r j t , h j t+1 ) T t=0 } Nj=1 } without online environment interaction during the intermediate stages of training . Prior offline RL algorithms ( Fujimoto et al. , 2019 ; Janner et al. , 2019 ; Kumar et al. , 2020 ) rely on off-policy actor-critic method , where the critic network is trained by minimizing the temporal differnce error with respect to the target policy π : arg min φ E ( ht , at , rt , ht+1 ) ∼D [ ( rt + γEat+1∼π ( ht+1 ) [ Qφ̄ ( ht+1 , at+1 ) ] −Qφ ( ht , at ) ) 2 ] ( 1 ) where φ̄ is the parameters of the target network . As discussed in the prior work ( Fujimoto et al. , 2019 ; Kumar et al. , 2020 ) , optimizing this loss can be challenging in the offline RL setting due to the overestimation issue in the bootstrapping process by taking out-of-distribution ( OOD ) actions to evaluate the value of the next state . 2.2 END-TO-END TASK-ORIENTED DIALOGUE SYSTEM . We focus on the MultiWOZ dataset ( Budzianowski et al. , 2018 ) , which is a representative benchmark for task-oriented dialogue . The MultiWOZ dataset is a fully-annotated corpus of human-human task-oriented conversations , which is collected via the Wizard-of-Oz setting ( Kelley , 1984 ) . The traditional approach to building a task-oriented dialogue system adopts a modular pipeline , which consists of the following four modules : 1 ) A natural language understanding ( NLU ) module ( Kim et al. , 2017 ; Zhu et al. , 2020 ) identifies the user ’ s intent and extracts the information of slots and their values , 2 ) A Dialogue state tracking ( DST ) module ( Williams et al. , 2013 ) infers the belief state , 3 ) A dialogue policy ( POL ) module decides the system action , 4 ) A natural language generation ( NLG ) module ( Wen et al. , 2015 ) generates the system response corresponding to the system action . Recently , end-to-end task-oriented dialogue methods leveraging the pre-trained language model have been proposed ( Yang et al. , 2021 ; Ham et al. , 2020 ; Lin et al. , 2020 ; Peng et al. , 2021 ; Hosseini-Asl et al. , 2020 ) , and significantly improves overall performance in the task-oriented dialogues . In this paper , our algorithm is built upon UBAR ( Yang et al. , 2021 ) , which is based on GPT-2 ( Radford et al. , 2019 ) and currently the state-of-the-art end-to-end dialogue agent for the MultiWOZ domain . 3 OFFLINE REINFORCEMENT LEARNING FOR END-TO-END TASK-ORIENTED DIALOGUE SYSTEMS . The corpus collected from human-human conversations inevitably contains unsuccessful dialogues in terms of task completion . For example , approximately 20 % dialogues of the MultiWOZ dataset fail to meet the user goal . Therefore , a naive behavior cloning of the whole dataset would limit the performance of the conversational agent since the dataset includes a lot of unsuccessful dialogues : an agent that imitates failure would be inevitably suboptimal . Yet , dropping the unsuccessful dialogues from the corpus is also undesirable , since they may contain some task-specific information that is useful to properly respond to user requests . We thus aim to revise unsuccessful dialogues into successful ones in order to prevent repeating the past failure while improving the task performance . In this section , we present GPT-Critic , an offline RL algorithm for task-oriented dialogue . Our GPTCritic is analogous to Actor-Critic method : GPT ( Actor ) decides which action to take while the Critic informs how good the action was and provides a signal for policy improvement . Still , GPTCritic is distinct from the Actor-Critic methods in that it does not rely on the policy gradients , which are generally known to cause the issue of diverging from human language ( Lewis et al. , 2017 ; Zhao et al. , 2019 ) . Instead , we sample a set of action candidates using GPT-2 and pick the best one using the critic , which constitutes a revised dialogue corpus . Then , we perform supervised fine-tuning of the GPT-2 on the revised dialogue corpus . This learning procedure of our GPT-Critic does not hurt the agent ’ s capability to generate human-like sentences , given that the generated action candidates were all natural-looking sentences due to the power of large pre-trained LM . Our algorithm is built upon the GPT-2 but it can be adopted for any generative pre-trained language model . 3.1 POLICY EVALUATION . Our GPT-Critic starts by training the action-value function ( i.e . critic ) , which can evaluate the candidates for the response . The architecture of the critic network basically follows GPT-2 with employing different last layers to compute the Q-value . The parameterization of the critic network Qφ is designed to share the parameters of the Transformer ( Vaswani et al. , 2017 ) layers of GPT-2 , where the parameters of the Transformer layers are only updated during the policy improvement step . The critic network of GPT-Critic is trained by minimizing the temporal difference error with respect to the dataset D : arg min φ E ( ht , at , rt , ht+1 , at+1 ) ∼D [ ( rt + γQφ̄ ( ht+1 , at+1 ) −Qφ ( ht , at ) ) 2 ] ( 2 ) where φ̄ is the parameters of the target network . Note that Eq . ( 2 ) is an on-policy evaluation on the dataset D , which can be optimized very stably since every at+1 is always an in-distribution sample of D. This is in contrast to Eq . ( 1 ) , which requires evaluation of out-of-distribution actions sampled from the target policy π . The OOD action-value estimation can be very unreliable if the target policy deviates much from the dataset . This kind of on-policy evaluation has been explored in the offline RL context for stable policy optimization ( Brandfonbrener et al. , 2021 ; Goo & Niekum , 2021 ) , but they are limited to only one-step policy improvement : once the policy π is improved by the initial on-policy Q-function ( i.e . π ( s ) = arg maxaQ ( s , a ) ) , the new policy deviates from the dataset policy , thus it requires off-policy evaluation for further policy iteration . In contrast , our GPT-Critic performs policy improvement by generating an improved dataset based on the learned critic , where we can perform on-policy evaluation on the new dataset again . As a consequence , GPT-Critic can enjoy the stable multi-step policy iteration through alternation between on-policy evaluation and policy improvement via revising dataset , which will be discussed in the following section .
The paper works on offline reinforcement learning for natural language action space setting, particularly for task-oriented dialogue management. The paper nicely incorporate the policy network (to sample agent response) and the q network (to evaluate the agent response) into a single GPT-2 network and propose a policy interation algorithm to optimize both the q and policy network. During policy evaluation, the q network is updated with sampled system actions and responses. During policy improvement, the sampled system actions and responses with maximum q values are used as labels to update the policy network. The model achieves SoTA performance on MultiWOZ dataset.
SP:075222515d247ab5a2b691fa625741c5e2c9f2b9
Relational Surrogate Loss Learning
1 INTRODUCTION . Evaluation metrics matter in machine learning since it depicts how well we want the models to perform . Nevertheless , most of them are non-differentiable and non-decomposable , thus we can not directly optimize them during training but resort to loss functions ( or surrogate losses ) , which serve exactly as a proxy of task metrics . For example , pose estimation task uses percentage of correct keypoints ( PCK ) ( Yang & Ramanan , 2012 ) to validate point-wise prediction accuracy , but it often adopts mean square error ( MSE ) as loss function . Neural machine translation task takes the sentence-level metric BLEU ( Papineni et al. , 2002 ) to evaluate the quality of predicted sentences , while using word-level cross-entropy loss ( CE Loss ) in training . Besides this manual proxy , some works ( Grabocka et al. , 2019 ; Patel et al. , 2020 ) propose to learn surrogate losses which approximate the metrics using deep neural networks ( DNN ) , so the optimization of metrics can be relaxed to a differentiable space . For example , taking predictions and labels as input , ( Grabocka et al. , 2019 ) approximates the outputs of surrogate losses and evaluation metrics by minimizing their L2 distances . Moreover , recent work even involves the prediction networks into the surrogate loss learning by alternatively updating the loss and predictions , i.e. , they train the surrogate losses after every epoch during training , then use the latest optimized losses to train prediction networks in the next epoch . For instance , ( Grabocka et al. , 2019 ) mainly focuses on the simple binary classification while LS-ED ( Patel et al. , 2020 ) chooses to adopt the surrogate losses in the post-tuning stage ( fine-tuning the models learned by original losses ) and achieves promising improvements . However , these methods often suffer from heavy computational consumption and do not perform well on large-scale challenging datasets . ∗Correspondence to : Shan You < youshan @ sensetime.com > . Both manual and learned surrogate losses follow an exact recovery manner ; namely , the surrogate losses should approximate the target metrics rigorously , and optimizing the surrogate loss is supposed to improve the evaluation metrics accordingly . However , this assumption does not always hold due to the approximation gap , bringing bias to the optimization and leading to sub-optimal results . Instead of pursuing an exact recovery of the evaluation metric , we are reminded of the purpose of metrics , which is to distinguish the performance of models . If a model has a smaller loss than the other model , its metric ought to be better . Nevertheless , current surrogate losses usually have weak relation with the evaluation metrics ( e.g. , CE Loss & BLEU in Figure 1 ( b ) ) . Ideally , the surrogate loss should maintain strong relation of evaluation metric to all models . In this paper , we leverage the ranking correlation as the relation between surrogate losses and evaluation metrics . Then a natural question raises , if the loss functions only require accurate relative rankings to discriminate the models , why do we need to approximate the metrics exactly ? In this way , we propose a method named Relational Surrogate Loss ( ReLoss ) to maximize this rank correlation directly . Concretely , our ReLoss directly leverages the simple Spearman ’ s rank correlation ( Dodge , 2008 ) as the learning objective . By adopting differentiable ranking method , the ranking correlation coefficient can be maximized through gradient descent . Compared to exactly recovering the metrics , our correlation-based optimization is much easier to learn , and our ReLoss , which is simply constructed by multi-layer perceptions , aligns well with the metrics and obtains significantly better correlations compared to the original losses . For example , the commonly used loss MSE in pose estimation only has 46.71 % Spearman ’ s rank correlation coefficient with the evaluation metric PCK , while our ReLoss enjoys 84.72 % relative improvement ( see Table 1 and Figure 1 ) . Our ReLoss generalizes well to various tasks and datasets . We learn ReLoss using randomly generated data and pre-collected network outputs , then the learned losses are integrated into the training of prediction networks as normal loss functions ( e.g. , cross-entropy loss ) , without any further finetuning . Note that we use the same surrogate losses with the same weights in each task , and we find that it is sufficient to obtain higher performance . Compared to previous works , our method is much easier to optimize and enjoys significant efficiency and performance improvements . Extensive experiments on the synthetic dataset and large-scale challenging datasets demonstrate our effectiveness . Moreover , our method outperforms the state-of-the-art methods in human pose estimation and machine reading comprehension tasks . For example , on human pose estimation task , our ReLoss outperforms the state-of-the-art method DARK ( Zhang et al. , 2020 ) by 0.2 % on COCO test-dev set ; on machine reading comprehension task , we achieve new state-of-the-art performance on DuReader 2.0 test set , outperforming all the competitive methods , and even obtain 7.5 % better ROUGE-L compared to human performance . 2 RELATED WORK . Surrogate loss learning . Since most of the metrics in deep learning tasks are non-differentiable and non-decomposable ( e.g. , accuracy , F1 , AUC , AP , etc . ) , surrogate losses aim to approximate the metrics to make them differentiable using neural networks . ( Grabocka et al. , 2019 ) first proposes to learn surrogate losses by approximating the metrics of tasks through a neural network , and the losses are optimized jointly with the prediction model via bilevel optimization . ( Patel et al. , 2020 ) learns the surrogate losses via a deep embedding where the Euclidean distance between the prediction and ground truth corresponds to the value of the metric . However , it is hard to obtain a precise prediction by directly optimizing the surrogate loss with such a strong constraint . We remind that the role of loss functions is to determine which model is better , but with the unavoidable existence of approximation gap , this determinability does not always hold . In addition , these methods both train the surrogate losses alternately with prediction networks , resulting in noticeable efficiency and generability deduction compared to regular losses . In our paper , instead of only focusing on point-to-point recovery , which ignores the rankings between relative values of metrics , we ease the optimization constraint by explicitly learning our ReLoss with rank correlation , and enjoy significant performance and efficiency improvements . Differentiable sorting & ranking . Differentiable sorting and ranking algorithms ( Adams & Zemel , 2011 ; Grover et al. , 2018 ; Blondel et al. , 2020 ; Petersen et al. , 2021 ) can be used in training neural networks with sorting and ranking supervision . Recent approach ( Blondel et al. , 2020 ) proposes to construct differentiable sorting and ranking operators as projections onto the permutahedron , i.e. , the convex hull of permutations , and using a reduction to isotonic optimization . ( Petersen et al. , 2021 ) proposes differentiable sorting networks by relaxing their pairwise conditional swap operations . In this paper , we can use any of these differentiable ranking algorithms to generate differentiable ranking vectors , then directly optimize the rank correlation coefficient for the supervision of our surrogate losses . The algorithm in ( Petersen et al. , 2021 ) is adopted for better performance . 3 PRELIMINARIES . For a given task with a metric function M ( y , ŷ ) , where y and ŷ denote the predicted labels and ground-truth labels , respectively , its loss function L ( y , ŷ ) can be formulated as : L ( y , ŷ ) = f ( y , ŷ ) , ( 1 ) where f can be any function with output ∈ R1 . In this paper , we tend to use a learned DNN ( fDNN ) with weights θl as a surrogate loss , i.e. , L ( y , ŷ ; θl ) = fDNN ( y , ŷ ; θl ) . ( 2 ) The surrogate losses are learned with the networks ’ outputs y and the corresponding metric values M ( y , ŷ ) , i.e. , θ∗l = argmin θl Os ( L ( y , ŷ ; θl ) , M ( y , ŷ ) ) , ( 3 ) where Os is the learning objective of surrogate loss . The prediction networks with weights θm are then optimized by descending the learned surrogate losses L ( y , ŷ ; θ∗l ) , i.e. , θ∗m = argmin θm L ( y , ŷ ; θ∗l ) . ( 4 ) Approximation-based optimization . To learn a surrogate loss w.r.t . a metric , an intuitive idea is to approximate the metric ’ s outputs , i.e. , learn the surrogate losses by minimizing the distances between the outputs of surrogate losses and their corresponding metric values , which is adopted in previous works ( Grabocka et al. , 2019 ; Patel et al. , 2020 ) , their learning objective Os is Os ( L ( y , ŷ ; θl ) , M ( y , ŷ ) ) =‖ L ( y , ŷ ; θl ) −M ( y , ŷ ) ‖22 , ( 5 ) we call this optimization as approximation-based optimization . However , it is hard for a DNN to fully recover the evaluation metric . We conduct toy experiments using a random weighted DNN with output ∈ R1 as an evaluation metric , and then the surrogate loss is learned using limited observations of the metric . As illustrated in Figure 2 ( a ) , since approximating a random network with random inputs is challenging , the errors between surrogate loss learned by approximation-based optimization and metric values are noticeably large . In order to validate the effectiveness of losses in training , we then train the input data with metric or learned losses , as shown in Figure 2 ( c ) , we illustrate the curves of metric values w.r.t . learned input data during training , and directly using metric as loss function obtains best metric value ( lower is better ) , but the performance of input data using approximation-based loss is getting worse . 4 LEARNING RELATIONAL SURROGATE LOSS . 4.1 RELATION AS RANK CORRELATION . Based on the previous discussion , the prior works adopt an unnecessary constraint by enforcing the surrogate losses to fully recover the evaluation metrics . However , the loss function only needs to have the same ranking relation to the metrics , i.e. , we just need to make the surrogate losses have the same ranking as metrics . In this paper , we obtain the relation between surrogate losses and evaluation metrics by using rank correlation as the learning objective , which we call correlationbased optimization . The relation between surrogate losses and evaluation metrics is measured by ranking correlation , which is a statistic that measures the relationship between rankings of the same variable . A ranking correlation coefficient measures the degree of similarity between two rankings and can be used to assess the relation ’ s significance . If the surrogate loss fully correlates to the evaluation metric , the descent of loss value will always obtain better metric values . Spearman ’ s rank correlation . For optimization of surrogate losses , we use the most commonly used Spearman ’ s rank correlation ( Dodge , 2008 ) . For two vectors a and b with size n , the Spearman ’ s rank correlation is defined as : ρS ( a , b ) = Cov ( ra , rb ) Std ( ra ) Std ( rb ) = 1 n−1 ∑n i=1 ( rai − E ( ra ) ) ( rbi − E ( rb ) ) Std ( ra ) Std ( rb ) , ( 6 ) where ra is the rank vector of a , Cov ( ra , rb ) is the covariance of the rank vectors , Std ( ra ) denotes the standard derivation of ra .
- This paper proposes a relational surrogate loss learning method (ReLoss) inspired by the fact that the evaluation metric and loss are used to distinguish whether one model is better or worse than another. - This paper provides extensive experiments that demonstrate the effectiveness of the proposed method. The performance and efficiency compared to existing surrogate loss methods are significant, and the performance compared to original losses is seem to be significant on various tasks.
SP:d901a65eae29085b39b42a527be4b01bb9370a30
Relational Surrogate Loss Learning
1 INTRODUCTION . Evaluation metrics matter in machine learning since it depicts how well we want the models to perform . Nevertheless , most of them are non-differentiable and non-decomposable , thus we can not directly optimize them during training but resort to loss functions ( or surrogate losses ) , which serve exactly as a proxy of task metrics . For example , pose estimation task uses percentage of correct keypoints ( PCK ) ( Yang & Ramanan , 2012 ) to validate point-wise prediction accuracy , but it often adopts mean square error ( MSE ) as loss function . Neural machine translation task takes the sentence-level metric BLEU ( Papineni et al. , 2002 ) to evaluate the quality of predicted sentences , while using word-level cross-entropy loss ( CE Loss ) in training . Besides this manual proxy , some works ( Grabocka et al. , 2019 ; Patel et al. , 2020 ) propose to learn surrogate losses which approximate the metrics using deep neural networks ( DNN ) , so the optimization of metrics can be relaxed to a differentiable space . For example , taking predictions and labels as input , ( Grabocka et al. , 2019 ) approximates the outputs of surrogate losses and evaluation metrics by minimizing their L2 distances . Moreover , recent work even involves the prediction networks into the surrogate loss learning by alternatively updating the loss and predictions , i.e. , they train the surrogate losses after every epoch during training , then use the latest optimized losses to train prediction networks in the next epoch . For instance , ( Grabocka et al. , 2019 ) mainly focuses on the simple binary classification while LS-ED ( Patel et al. , 2020 ) chooses to adopt the surrogate losses in the post-tuning stage ( fine-tuning the models learned by original losses ) and achieves promising improvements . However , these methods often suffer from heavy computational consumption and do not perform well on large-scale challenging datasets . ∗Correspondence to : Shan You < youshan @ sensetime.com > . Both manual and learned surrogate losses follow an exact recovery manner ; namely , the surrogate losses should approximate the target metrics rigorously , and optimizing the surrogate loss is supposed to improve the evaluation metrics accordingly . However , this assumption does not always hold due to the approximation gap , bringing bias to the optimization and leading to sub-optimal results . Instead of pursuing an exact recovery of the evaluation metric , we are reminded of the purpose of metrics , which is to distinguish the performance of models . If a model has a smaller loss than the other model , its metric ought to be better . Nevertheless , current surrogate losses usually have weak relation with the evaluation metrics ( e.g. , CE Loss & BLEU in Figure 1 ( b ) ) . Ideally , the surrogate loss should maintain strong relation of evaluation metric to all models . In this paper , we leverage the ranking correlation as the relation between surrogate losses and evaluation metrics . Then a natural question raises , if the loss functions only require accurate relative rankings to discriminate the models , why do we need to approximate the metrics exactly ? In this way , we propose a method named Relational Surrogate Loss ( ReLoss ) to maximize this rank correlation directly . Concretely , our ReLoss directly leverages the simple Spearman ’ s rank correlation ( Dodge , 2008 ) as the learning objective . By adopting differentiable ranking method , the ranking correlation coefficient can be maximized through gradient descent . Compared to exactly recovering the metrics , our correlation-based optimization is much easier to learn , and our ReLoss , which is simply constructed by multi-layer perceptions , aligns well with the metrics and obtains significantly better correlations compared to the original losses . For example , the commonly used loss MSE in pose estimation only has 46.71 % Spearman ’ s rank correlation coefficient with the evaluation metric PCK , while our ReLoss enjoys 84.72 % relative improvement ( see Table 1 and Figure 1 ) . Our ReLoss generalizes well to various tasks and datasets . We learn ReLoss using randomly generated data and pre-collected network outputs , then the learned losses are integrated into the training of prediction networks as normal loss functions ( e.g. , cross-entropy loss ) , without any further finetuning . Note that we use the same surrogate losses with the same weights in each task , and we find that it is sufficient to obtain higher performance . Compared to previous works , our method is much easier to optimize and enjoys significant efficiency and performance improvements . Extensive experiments on the synthetic dataset and large-scale challenging datasets demonstrate our effectiveness . Moreover , our method outperforms the state-of-the-art methods in human pose estimation and machine reading comprehension tasks . For example , on human pose estimation task , our ReLoss outperforms the state-of-the-art method DARK ( Zhang et al. , 2020 ) by 0.2 % on COCO test-dev set ; on machine reading comprehension task , we achieve new state-of-the-art performance on DuReader 2.0 test set , outperforming all the competitive methods , and even obtain 7.5 % better ROUGE-L compared to human performance . 2 RELATED WORK . Surrogate loss learning . Since most of the metrics in deep learning tasks are non-differentiable and non-decomposable ( e.g. , accuracy , F1 , AUC , AP , etc . ) , surrogate losses aim to approximate the metrics to make them differentiable using neural networks . ( Grabocka et al. , 2019 ) first proposes to learn surrogate losses by approximating the metrics of tasks through a neural network , and the losses are optimized jointly with the prediction model via bilevel optimization . ( Patel et al. , 2020 ) learns the surrogate losses via a deep embedding where the Euclidean distance between the prediction and ground truth corresponds to the value of the metric . However , it is hard to obtain a precise prediction by directly optimizing the surrogate loss with such a strong constraint . We remind that the role of loss functions is to determine which model is better , but with the unavoidable existence of approximation gap , this determinability does not always hold . In addition , these methods both train the surrogate losses alternately with prediction networks , resulting in noticeable efficiency and generability deduction compared to regular losses . In our paper , instead of only focusing on point-to-point recovery , which ignores the rankings between relative values of metrics , we ease the optimization constraint by explicitly learning our ReLoss with rank correlation , and enjoy significant performance and efficiency improvements . Differentiable sorting & ranking . Differentiable sorting and ranking algorithms ( Adams & Zemel , 2011 ; Grover et al. , 2018 ; Blondel et al. , 2020 ; Petersen et al. , 2021 ) can be used in training neural networks with sorting and ranking supervision . Recent approach ( Blondel et al. , 2020 ) proposes to construct differentiable sorting and ranking operators as projections onto the permutahedron , i.e. , the convex hull of permutations , and using a reduction to isotonic optimization . ( Petersen et al. , 2021 ) proposes differentiable sorting networks by relaxing their pairwise conditional swap operations . In this paper , we can use any of these differentiable ranking algorithms to generate differentiable ranking vectors , then directly optimize the rank correlation coefficient for the supervision of our surrogate losses . The algorithm in ( Petersen et al. , 2021 ) is adopted for better performance . 3 PRELIMINARIES . For a given task with a metric function M ( y , ŷ ) , where y and ŷ denote the predicted labels and ground-truth labels , respectively , its loss function L ( y , ŷ ) can be formulated as : L ( y , ŷ ) = f ( y , ŷ ) , ( 1 ) where f can be any function with output ∈ R1 . In this paper , we tend to use a learned DNN ( fDNN ) with weights θl as a surrogate loss , i.e. , L ( y , ŷ ; θl ) = fDNN ( y , ŷ ; θl ) . ( 2 ) The surrogate losses are learned with the networks ’ outputs y and the corresponding metric values M ( y , ŷ ) , i.e. , θ∗l = argmin θl Os ( L ( y , ŷ ; θl ) , M ( y , ŷ ) ) , ( 3 ) where Os is the learning objective of surrogate loss . The prediction networks with weights θm are then optimized by descending the learned surrogate losses L ( y , ŷ ; θ∗l ) , i.e. , θ∗m = argmin θm L ( y , ŷ ; θ∗l ) . ( 4 ) Approximation-based optimization . To learn a surrogate loss w.r.t . a metric , an intuitive idea is to approximate the metric ’ s outputs , i.e. , learn the surrogate losses by minimizing the distances between the outputs of surrogate losses and their corresponding metric values , which is adopted in previous works ( Grabocka et al. , 2019 ; Patel et al. , 2020 ) , their learning objective Os is Os ( L ( y , ŷ ; θl ) , M ( y , ŷ ) ) =‖ L ( y , ŷ ; θl ) −M ( y , ŷ ) ‖22 , ( 5 ) we call this optimization as approximation-based optimization . However , it is hard for a DNN to fully recover the evaluation metric . We conduct toy experiments using a random weighted DNN with output ∈ R1 as an evaluation metric , and then the surrogate loss is learned using limited observations of the metric . As illustrated in Figure 2 ( a ) , since approximating a random network with random inputs is challenging , the errors between surrogate loss learned by approximation-based optimization and metric values are noticeably large . In order to validate the effectiveness of losses in training , we then train the input data with metric or learned losses , as shown in Figure 2 ( c ) , we illustrate the curves of metric values w.r.t . learned input data during training , and directly using metric as loss function obtains best metric value ( lower is better ) , but the performance of input data using approximation-based loss is getting worse . 4 LEARNING RELATIONAL SURROGATE LOSS . 4.1 RELATION AS RANK CORRELATION . Based on the previous discussion , the prior works adopt an unnecessary constraint by enforcing the surrogate losses to fully recover the evaluation metrics . However , the loss function only needs to have the same ranking relation to the metrics , i.e. , we just need to make the surrogate losses have the same ranking as metrics . In this paper , we obtain the relation between surrogate losses and evaluation metrics by using rank correlation as the learning objective , which we call correlationbased optimization . The relation between surrogate losses and evaluation metrics is measured by ranking correlation , which is a statistic that measures the relationship between rankings of the same variable . A ranking correlation coefficient measures the degree of similarity between two rankings and can be used to assess the relation ’ s significance . If the surrogate loss fully correlates to the evaluation metric , the descent of loss value will always obtain better metric values . Spearman ’ s rank correlation . For optimization of surrogate losses , we use the most commonly used Spearman ’ s rank correlation ( Dodge , 2008 ) . For two vectors a and b with size n , the Spearman ’ s rank correlation is defined as : ρS ( a , b ) = Cov ( ra , rb ) Std ( ra ) Std ( rb ) = 1 n−1 ∑n i=1 ( rai − E ( ra ) ) ( rbi − E ( rb ) ) Std ( ra ) Std ( rb ) , ( 6 ) where ra is the rank vector of a , Cov ( ra , rb ) is the covariance of the rank vectors , Std ( ra ) denotes the standard derivation of ra .
The authors introduce a relational surrogate loss learning method (ReLoss) for replacing the original losses. The rationale and intuition behind are well-grounded. Experiments on various tasks and ablation studies prove the validity.
SP:d901a65eae29085b39b42a527be4b01bb9370a30
Relational Surrogate Loss Learning
1 INTRODUCTION . Evaluation metrics matter in machine learning since it depicts how well we want the models to perform . Nevertheless , most of them are non-differentiable and non-decomposable , thus we can not directly optimize them during training but resort to loss functions ( or surrogate losses ) , which serve exactly as a proxy of task metrics . For example , pose estimation task uses percentage of correct keypoints ( PCK ) ( Yang & Ramanan , 2012 ) to validate point-wise prediction accuracy , but it often adopts mean square error ( MSE ) as loss function . Neural machine translation task takes the sentence-level metric BLEU ( Papineni et al. , 2002 ) to evaluate the quality of predicted sentences , while using word-level cross-entropy loss ( CE Loss ) in training . Besides this manual proxy , some works ( Grabocka et al. , 2019 ; Patel et al. , 2020 ) propose to learn surrogate losses which approximate the metrics using deep neural networks ( DNN ) , so the optimization of metrics can be relaxed to a differentiable space . For example , taking predictions and labels as input , ( Grabocka et al. , 2019 ) approximates the outputs of surrogate losses and evaluation metrics by minimizing their L2 distances . Moreover , recent work even involves the prediction networks into the surrogate loss learning by alternatively updating the loss and predictions , i.e. , they train the surrogate losses after every epoch during training , then use the latest optimized losses to train prediction networks in the next epoch . For instance , ( Grabocka et al. , 2019 ) mainly focuses on the simple binary classification while LS-ED ( Patel et al. , 2020 ) chooses to adopt the surrogate losses in the post-tuning stage ( fine-tuning the models learned by original losses ) and achieves promising improvements . However , these methods often suffer from heavy computational consumption and do not perform well on large-scale challenging datasets . ∗Correspondence to : Shan You < youshan @ sensetime.com > . Both manual and learned surrogate losses follow an exact recovery manner ; namely , the surrogate losses should approximate the target metrics rigorously , and optimizing the surrogate loss is supposed to improve the evaluation metrics accordingly . However , this assumption does not always hold due to the approximation gap , bringing bias to the optimization and leading to sub-optimal results . Instead of pursuing an exact recovery of the evaluation metric , we are reminded of the purpose of metrics , which is to distinguish the performance of models . If a model has a smaller loss than the other model , its metric ought to be better . Nevertheless , current surrogate losses usually have weak relation with the evaluation metrics ( e.g. , CE Loss & BLEU in Figure 1 ( b ) ) . Ideally , the surrogate loss should maintain strong relation of evaluation metric to all models . In this paper , we leverage the ranking correlation as the relation between surrogate losses and evaluation metrics . Then a natural question raises , if the loss functions only require accurate relative rankings to discriminate the models , why do we need to approximate the metrics exactly ? In this way , we propose a method named Relational Surrogate Loss ( ReLoss ) to maximize this rank correlation directly . Concretely , our ReLoss directly leverages the simple Spearman ’ s rank correlation ( Dodge , 2008 ) as the learning objective . By adopting differentiable ranking method , the ranking correlation coefficient can be maximized through gradient descent . Compared to exactly recovering the metrics , our correlation-based optimization is much easier to learn , and our ReLoss , which is simply constructed by multi-layer perceptions , aligns well with the metrics and obtains significantly better correlations compared to the original losses . For example , the commonly used loss MSE in pose estimation only has 46.71 % Spearman ’ s rank correlation coefficient with the evaluation metric PCK , while our ReLoss enjoys 84.72 % relative improvement ( see Table 1 and Figure 1 ) . Our ReLoss generalizes well to various tasks and datasets . We learn ReLoss using randomly generated data and pre-collected network outputs , then the learned losses are integrated into the training of prediction networks as normal loss functions ( e.g. , cross-entropy loss ) , without any further finetuning . Note that we use the same surrogate losses with the same weights in each task , and we find that it is sufficient to obtain higher performance . Compared to previous works , our method is much easier to optimize and enjoys significant efficiency and performance improvements . Extensive experiments on the synthetic dataset and large-scale challenging datasets demonstrate our effectiveness . Moreover , our method outperforms the state-of-the-art methods in human pose estimation and machine reading comprehension tasks . For example , on human pose estimation task , our ReLoss outperforms the state-of-the-art method DARK ( Zhang et al. , 2020 ) by 0.2 % on COCO test-dev set ; on machine reading comprehension task , we achieve new state-of-the-art performance on DuReader 2.0 test set , outperforming all the competitive methods , and even obtain 7.5 % better ROUGE-L compared to human performance . 2 RELATED WORK . Surrogate loss learning . Since most of the metrics in deep learning tasks are non-differentiable and non-decomposable ( e.g. , accuracy , F1 , AUC , AP , etc . ) , surrogate losses aim to approximate the metrics to make them differentiable using neural networks . ( Grabocka et al. , 2019 ) first proposes to learn surrogate losses by approximating the metrics of tasks through a neural network , and the losses are optimized jointly with the prediction model via bilevel optimization . ( Patel et al. , 2020 ) learns the surrogate losses via a deep embedding where the Euclidean distance between the prediction and ground truth corresponds to the value of the metric . However , it is hard to obtain a precise prediction by directly optimizing the surrogate loss with such a strong constraint . We remind that the role of loss functions is to determine which model is better , but with the unavoidable existence of approximation gap , this determinability does not always hold . In addition , these methods both train the surrogate losses alternately with prediction networks , resulting in noticeable efficiency and generability deduction compared to regular losses . In our paper , instead of only focusing on point-to-point recovery , which ignores the rankings between relative values of metrics , we ease the optimization constraint by explicitly learning our ReLoss with rank correlation , and enjoy significant performance and efficiency improvements . Differentiable sorting & ranking . Differentiable sorting and ranking algorithms ( Adams & Zemel , 2011 ; Grover et al. , 2018 ; Blondel et al. , 2020 ; Petersen et al. , 2021 ) can be used in training neural networks with sorting and ranking supervision . Recent approach ( Blondel et al. , 2020 ) proposes to construct differentiable sorting and ranking operators as projections onto the permutahedron , i.e. , the convex hull of permutations , and using a reduction to isotonic optimization . ( Petersen et al. , 2021 ) proposes differentiable sorting networks by relaxing their pairwise conditional swap operations . In this paper , we can use any of these differentiable ranking algorithms to generate differentiable ranking vectors , then directly optimize the rank correlation coefficient for the supervision of our surrogate losses . The algorithm in ( Petersen et al. , 2021 ) is adopted for better performance . 3 PRELIMINARIES . For a given task with a metric function M ( y , ŷ ) , where y and ŷ denote the predicted labels and ground-truth labels , respectively , its loss function L ( y , ŷ ) can be formulated as : L ( y , ŷ ) = f ( y , ŷ ) , ( 1 ) where f can be any function with output ∈ R1 . In this paper , we tend to use a learned DNN ( fDNN ) with weights θl as a surrogate loss , i.e. , L ( y , ŷ ; θl ) = fDNN ( y , ŷ ; θl ) . ( 2 ) The surrogate losses are learned with the networks ’ outputs y and the corresponding metric values M ( y , ŷ ) , i.e. , θ∗l = argmin θl Os ( L ( y , ŷ ; θl ) , M ( y , ŷ ) ) , ( 3 ) where Os is the learning objective of surrogate loss . The prediction networks with weights θm are then optimized by descending the learned surrogate losses L ( y , ŷ ; θ∗l ) , i.e. , θ∗m = argmin θm L ( y , ŷ ; θ∗l ) . ( 4 ) Approximation-based optimization . To learn a surrogate loss w.r.t . a metric , an intuitive idea is to approximate the metric ’ s outputs , i.e. , learn the surrogate losses by minimizing the distances between the outputs of surrogate losses and their corresponding metric values , which is adopted in previous works ( Grabocka et al. , 2019 ; Patel et al. , 2020 ) , their learning objective Os is Os ( L ( y , ŷ ; θl ) , M ( y , ŷ ) ) =‖ L ( y , ŷ ; θl ) −M ( y , ŷ ) ‖22 , ( 5 ) we call this optimization as approximation-based optimization . However , it is hard for a DNN to fully recover the evaluation metric . We conduct toy experiments using a random weighted DNN with output ∈ R1 as an evaluation metric , and then the surrogate loss is learned using limited observations of the metric . As illustrated in Figure 2 ( a ) , since approximating a random network with random inputs is challenging , the errors between surrogate loss learned by approximation-based optimization and metric values are noticeably large . In order to validate the effectiveness of losses in training , we then train the input data with metric or learned losses , as shown in Figure 2 ( c ) , we illustrate the curves of metric values w.r.t . learned input data during training , and directly using metric as loss function obtains best metric value ( lower is better ) , but the performance of input data using approximation-based loss is getting worse . 4 LEARNING RELATIONAL SURROGATE LOSS . 4.1 RELATION AS RANK CORRELATION . Based on the previous discussion , the prior works adopt an unnecessary constraint by enforcing the surrogate losses to fully recover the evaluation metrics . However , the loss function only needs to have the same ranking relation to the metrics , i.e. , we just need to make the surrogate losses have the same ranking as metrics . In this paper , we obtain the relation between surrogate losses and evaluation metrics by using rank correlation as the learning objective , which we call correlationbased optimization . The relation between surrogate losses and evaluation metrics is measured by ranking correlation , which is a statistic that measures the relationship between rankings of the same variable . A ranking correlation coefficient measures the degree of similarity between two rankings and can be used to assess the relation ’ s significance . If the surrogate loss fully correlates to the evaluation metric , the descent of loss value will always obtain better metric values . Spearman ’ s rank correlation . For optimization of surrogate losses , we use the most commonly used Spearman ’ s rank correlation ( Dodge , 2008 ) . For two vectors a and b with size n , the Spearman ’ s rank correlation is defined as : ρS ( a , b ) = Cov ( ra , rb ) Std ( ra ) Std ( rb ) = 1 n−1 ∑n i=1 ( rai − E ( ra ) ) ( rbi − E ( rb ) ) Std ( ra ) Std ( rb ) , ( 6 ) where ra is the rank vector of a , Cov ( ra , rb ) is the covariance of the rank vectors , Std ( ra ) denotes the standard derivation of ra .
This paper proposes a surrogate loss learning method named ReLoss. The ReLoss learned by maximizing the relation between surrogate losses and evaluation metrics is used to replace the original losses. Extensive experiments on computer vision (CV) tasks (image classification, pose estimation, and scene text recognition) and natural language processing (NLP) tasks (machine reading comprehension and translation) are provided, showing the benefits.
SP:d901a65eae29085b39b42a527be4b01bb9370a30
Label Leakage and Protection in Two-party Split Learning
1 INTRODUCTION . With increasing concerns over data privacy in machine learning , federated learning ( FL ) ( McMahan et al. , 2017 ) has become a promising direction of study . Based on how sensitive data are distributed among parties , FL can be classified into different categories , notable among which are horizontal FL and vertical FL ( Yang et al. , 2019 ) . In contrast to horizontal FL where the data are partitioned by examples , vertical FL considers data partitioned by features ( including labels ) . As a canonical example of vertical FL , consider an online media platform A which displays advertisements from company B to its users , and charges B for each conversion ( e.g. , a user clicking the ad and buying the product ) . In this case , both parties have different features for each user : A has features on the user ’ s media viewing records , while B has the user ’ s conversion labels . B ’ s labels are not available to A because each user ’ s purchase behaviors happen entirely on B ’ s website/app . If both parties want to jointly learn a model to predict conversion without data sharing , split learning ( Gupta & Raskar , 2018 ; Vepakomma et al. , 2018 ) can be used to split the execution of a deep network between the parties on a layer-wise basis . In vanilla split learning , before training begins , both parties use Private Set Intersection ( PSI ) protocols ( Kolesnikov et al. , 2016 ; Pinkas et al. , 2018 ) to find the intersection of their data records and achieve an example ID alignment . This alignment paves the way for the split training phase . During training ( Figure 1 ) , the party without labels ( nonlabel party ) sends the intermediate layer ( cut layer ) outputs rather than the raw data to the party with labels ( label party ) , and the label party completes the rest of the forward computation to obtain the training loss . To compute the gradients with respect to model parameters , the label party initiates backpropagation from its training loss and computes its own parameters ’ gradients . To allow the non-label party to also compute gradients of its parameters , the label party also computes the gradients with respect to the cut layer outputs and communicates this information back to the non-label party . As a result of the ID alignment , despite not knowing the label party ’ s raw label data , the non-label party can identify the gradient value returned by the label party for each example . At first glance , the process of split learning appears privacy-preserving because only the intermediate computations of the cut layer—rather than raw features or labels—are communicated between the two parties . However , such “ gradient sharing ” schemes have been shown to be vulnerable to privacy leakage in horizontal FL settings ( e.g. , Zhu et al. , 2019 ) . In vertical FL ( and specifically split learning ) , it remains unclear whether the raw data can similarly be leaked during communication . In particular , as the raw labels often contain highly sensitive information ( e.g. , what a user has purchased ( in online advertising ) or whether a user has a disease or not ( in disease prediction ) Vepakomma et al . ( 2018 ) ) , developing a rigorous understanding of the threat of label leakage and its protection is particularly important . Towards this goal , we make the following contributions : 1 . We formalize a threat model for label leakage in two-party split learning in the context of binary classification ( Section 3.1 ) , and propose specific privacy quantification metrics to measure the severity of such threats ( Section 3.2 ) . 2 . We identify two simple and realistic methods within this threat model which can accurately recover the label party ’ s private label information ( Section 3.3 ) . 3 . We propose several random perturbation techniques to limit the label-stealing ability of the non-label party ( Section 4 ) . Among them , our principled approach Marvell directly searches for the optimal random perturbation noise structure to minimize label leakage ( as measured via our quantification metric ) against a worst-case adversarial non-label party . 4 . We experimentally demonstrate the effectiveness of our protection techniques and MARVELL ’ s improved privacy-utility tradeoffs compared to other protection baselines ( Section 5 ) . 2 RELATED WORK . Privacy leakage in split learning . Although raw data is not shared in federated learning , sensitive information may still be leaked when gradients and/or model parameters are communicated between parties . In horizontal FL , Zhu et al . ( 2019 ) showed that an honest-but-curious server can uncover the raw features and labels of a device by knowing the model architecture , parameters , and communicated gradient of the loss on the device ’ s data . Based on their techniques , Zhao et al . ( 2020 ) showed that the ground truth label of an example can be extracted by exploiting the directions of the gradients of the weights connected to the logits of different classes . Here we study a different setting—two-party split learning ( in vertical FL ) ( Yang et al. , 2019 ) , where no party has access to the model architecture or model parameters of the other party . In this setting , Vepakomma et al . ( 2019 ) studied how the forward communication of feature representations can leak the non-label party ’ s raw data to the label party . We instead study whether label information may be leaked from the label party to the non-label party during the backward communication . Despite the importance of maintaining the privacy of these labels , we are unaware of prior work that has studied this problem . Privacy protection and quantification . Techniques to protect communication privacy in FL generally fall into three categories : 1 ) cryptographic methods such as secure multi-party computation ( e.g. , Bonawitz et al. , 2017 ) ; 2 ) system-based methods including trusted execution environments ( Subramanyan et al. , 2017 ) ; and 3 ) perturbation methods that shuffle or modify the communicated messages ( e.g. , Abadi et al. , 2016 ; McMahan et al. , 2018 ; Erlingsson et al. , 2019 ; Cheu et al. , 2019 ; Zhu et al. , 2019 ) . Our protection techniques belong to the third category , as we add random perturbations to the gradients to protect the labels . Many randomness-based protection methods have been proposed in the domain of horizontal FL . In this case , differential privacy ( DP ) ( Dwork , 2006 ; Dwork et al. , 2014 ) is commonly used to measure the proposed random mechanisms ’ ability to anonymize the identity of any single participating example in the model iterates . However , in split learning , after PSI , both parties know exactly the identity of which example has participated in a given gradient update . As we explain in Section 3.1 , the object we aim to protect ( the communicated cut layer gradients ) , unlike the model iterates , is not an aggregate function of all the examples but are instead example-specific . As a result , DP and its variants ( e.g . label DP ( Chaudhuri & Hsu , 2011 ; Ghazi et al. , 2021 ) ) are not directly applicable metrics in our setting , and we instead propose a different metric ( discussed in Section 3.2 ) . 3 LABEL LEAKAGE IN SPLIT LEARNING . We first introduce the two-party split learning problem for binary classification , and then formally describe our threat model and privacy quantification metrics with two concrete attack examples . 3.1 TWO-PARTY SPLIT LEARNING IN BINARY CLASSIFICATION . Problem setup . Consider two parties learning a composition model h ◦ f jointly for a binary classification problem over the domain X × { 0 , 1 } ( Figure 1 ) . The non-label party owns the representation function f : X → Rd and each example ’ s raw feature X ∈ X while the label party owns the logit function h : Rd → R and each example ’ s label y ∈ { 0 , 1 } 1 . Let ` = h ( f ( X ) ) be the logit of the positive class whose predicted probability is given through the sigmoid function : p̃1 = 1/ ( 1 + exp ( − ` ) ) . We measure the loss of such prediction through the cross entropy loss L = log ( 1 + exp ( − ` ) ) + ( 1 − y ) ` . During model inference , the non-label party computes f ( X ) and sends it to the label party who will then execute the rest of forward computation in Figure 1 . Model training ( Figure 1 : backward gradient computation ) . To train the model using gradient descent , the label party starts by first computing the gradient of the loss L with respect to the logit dL d ` = ( p̃1 − y ) . Using the chain rule , the label party can then compute the gradient of L with respect to its function h ’ s parameters and perform the gradient updates . To also allow the non-label party to learn its function f , the label party needs to additionally compute the gradient with respect to cut layer feature f ( X ) and communicate it to the non-label party . We denote this gradient by g : = ∇f ( X ) L = ( p̃1 − y ) ∇zh ( z ) |z=f ( X ) ∈ Rd ( by chain rule ) . After receiving g , the non-label party continues the backpropagation towards f ’ s parameters and also perform the gradient updates . Why Not Differential Privacy ? Note that for a given iteration , the non-label party randomly chooses B example IDs to form a batch . Therefore , the identity of which examples are used is known to the non-label party by default . In addition , the communicated features f ( X ) and returned gradients g will both be matrices in RB×d with each row belonging to a specific example in the batch . The different gradients ( rows of the matrix ) are not with respect to the same model parameters , but are instead with respect to different examples ’ cut-layer features ; thus , no averaging over or shuffling of the rows of the gradient matrix can be done prior to communication to ensure correct computation of f ’ s parameters on the non-label party side . This example-aware and example-specific nature of the communicated gradient matrix makes differential privacy ( which focuses on anonymizing an example ’ s participation in an aggregate function ) inapplicable for this problem ( see also Section 2 ) . 3.2 THREAT MODEL AND PRIVACY QUANTIFICATION . Below we specify several key aspects of our threat model , including the adversary ’ s objective and capabilities , our metric for quantifying privacy loss , and the possible inclusion of side information . Adversary ’ s objective . At a given moment in time during training ( with f and h fixed ) , since the communicated cut layer gradient g is a deterministic function of f ( X ) and y ( see Section 3.1 ) , we consider an adversarial non-label party whose objective is to recover the label party ’ s hidden label y based on the information contained in g for every training example . Adversary ’ s capability . We consider an honest-but-curious non-label party which can not tamper with training by selecting which examples to include in a batch or sending incorrect features f ( X ) ; instead , we assume that the adversary follows the agreed-upon split training procedure while trying to guess the label y . This can be viewed as a binary classification problem where the ( input , output ) distribution is the induced distribution of ( g , y ) . We allow the adversary to use any binary classifier q : Rd → { 0 , 1 } to guess the labels . This classifier can be represented by a ( scoring function r , threshold t ) tuple , where r : Rd → R maps an example ’ s cut layer gradient to a real-valued score and the threshold t ∈ R determines a cut-off so that q ( g ) = 1 if r ( g ) > t and q ( g ) = 0 if r ( g ) ≤ t. Moving forward , we use this tuple representation to describe adversarial non-label party classifiers . Privacy loss quantification . As we consider binary classification , a natural metric to quantify the performance of an adverary ’ s scoring function r is the AUC of its ROC curve . Denote the unperturbed class-conditional distributions of the cut-layer gradients by P ( 1 ) and P ( 0 ) for the 1To simplify notation , we assume no additional features in the label party to compute the logit . The data leakage problem still holds true for other more complicated settings ( see WDL experiment setting in Section 5 ) . positive and negative class , respectively . The ROC curve of a scoring function r is a parametric curve t 7→ ( FPRr ( t ) , TPRr ( t ) ) ∈ [ 0 , 1 ] 2 which maps a threshold value t ∈ R to the corresponding ( False Positive Rate , True Positive Rate ) tuple of the classifier represented by ( r , t ) , with FPRr ( t ) : = P ( 0 ) ( { g : r ( g ) > t } ) and TPRr ( t ) : = P ( 1 ) ( { g : r ( g ) > t } ) . The AUC of the ROC curve of a scoring function r ( denote by AUC ( r ) ) can be expressed as an integral : AUC ( r ) = ∫ −∞ ∞ TPRr ( t ) dFPRr ( t ) ∈ [ 0 , 1 ] ( Leak AUC ) ( more details on this expression see Appendix A.1 . ) We use this value as the privacy loss quantification metric for a specific adversary scoring function r and refer to it as the leak AUC . This metric summarizes the predictive performance of all classifiers that can be constructed through all threshold values t and removes the need to tune this classifier-specific hyperparameter . The leak AUC being close to 1 implies that the corresponding scoring function r can very accurately recover the private label , whereas a value of around 0.5 means r is non-informative in predicting the labels . In practice , during batch training , the leak AUC of r can be estimated at every gradient update iteration using the minibatch of cut-layer gradients together with their labels . Side information . Among all the scoring functions within our threat model , it is conceivable that only some would recover the hidden labels accurately . Picking such effective ones would require the non-label party to have population-level side information specifically regarding the properties of ( and distinction between ) the positive and negative class ’ s cut-layer gradient distributions . Since we allow the adversary to pick any specific ( measurable ) scoring function , we implicitly allow for such population-level side information for the adversary . However , we assume the non-label party has no example-level side information that is different example by example . Thus we also don ’ t use local DP for privacy quantification ( detailed explanation in Appendix A.8 ) . Next we provide two example scoring functions which use population-level side-information to effectively recover the label .
This paper formulates a threat model on two-party split learning (parties have different features, with one party holding the labels) for binary classification, and provides insights about how simple functions on the gradients can be used to extract confidential label information. The authors then proceed with defenses to these attacks, based on random perturbations of the communicated gradients from one party to another. In doing so, the authors motivate a new measure for privacy termed the leak AUC, based on the AUC of the ROC curve.
SP:1d660d8b2497c51b08143c85a1969ddd76da2bc4