Classify and Generate Reciprocally: Simultaneous Positive-Unlabelled Learning and Conditional Generation with Extra Data

1 INTRODUCTION . Existing machine learning methods , particularly deep learning models , typically require big data to pursue remarkable performance . For instance , conditional deep generative models are able to generate high-fidelity and diverse images , but they have to rely on vast amounts of labeled data ( Lucic et al. , 2019 ) . Nevertheless , it is often laborious or impractical to collect large-scale accurate class-labeled data in real-world scenarios , and thus the label scarcity is ubiquitous . Under such circumstances , the performance of classification and conditional generation ( Mirza & Osindero , 2014 ) drops significantly ( Lucic et al. , 2019 ) . At the same time , diverse unlabeled data are available in enormous quantities , and therefore a key issue is how to take advantage of the extra data to enhance the conditional generation or classification . Within the unlabeled data , both in-distribution and out-of-distribution data exist , where indistribution data conform to the distribution of the labeled data while out-of-distribution data do not . Our key insight is to harness the out-of-distribution data . In the generation with extra data , most related works focused on the in-distribution data ( Lucic et al. , 2019 ; Gui et al. , 2020 ; Donahue & Simonyan , 2019 ) . When it comes to the out-of-distribution data , the majority of existing methods ( Noguchi & Harada , 2019 ; Yamaguchi et al. , 2019 ; Zhao et al. , 2020 ) attempted to forcibly train generative models on a large amount of unlabeled data , and then transferred the learned knowledge of the pre-trained generator to the in-distribution data . In classification , a common setting to utilize unlabeled data is semi-supervised learning ( Miyato et al. , 2018 ; Sun et al. , 2019 ; Berthelot et al. , 2019 ) , which usually assumes that the unlabeled and labeled data come from the same distribution , ignoring their distributional mismatch . In contrast , Positive and Unlabeled ( PU ) Learning ( Bekker & Davis , 2020 ; Kiryo et al. , 2017 ) is an elegant way of handling this under-studied problem , where a model has the only access to positive samples and unlabeled data . Therefore , it is possible to utilize pseudo labels predicted by a PU classifier on unlabeled data to guide the conditional gen- eration . However , the predicted signals from the classifier tend to be noisy . Although there are a flurry of papers about learning from noisy labels for classification ( Tsung Wei Tsai , 2019 ; Ge et al. , 2020 ; Guo et al. , 2019 ) , to our best knowledge , no work has considered to leverage the noisy labels seamlessly in the joint classification and generation . Additionally , another work ( Hou et al. , 2018 ) leveraged GANs to recover both positive and negative data distribution to step away from overfitting , but they never considered the noise-invariant generation or their mutual improvement . The generative-discriminative complementary learning ( Xu et al. , 2019 ) was investigated in weakly supervised learning , but we are the first attempt to tackle the ( Multi- ) Positive and Unlabeled learning setting while developing the method of noise-invariant generation from noisy labels . Please refer to Section 5 for the discussion about more related works . In this paper , we focus on the mutual benefits of conditional generation and PU classification , when we are only accessible to little class-labeled data , but extra unlabeled data , including outof-distribution data , can be available . Firstly , a parallel non-negative multi-class PU estimator is derived to classify both the positive data of all classes and the negative data . Then we design a Classifier-Noise-Invariant Conditional Generative Adversarial Network ( CNI-CGAN ) that is able to learn the clean data distribution on all unlabeled data with noisy labels provided by the PU classifier . Simultaneously , we also leverage our CNI-CGAN to enhance the performance of the PU classification through data augmentation , demonstrating a reciprocal benefit for both generation and classification . We provide the theoretical analysis on the optimal condition of our CNI-CGAN and conduct extensive experiments to verify the superiority of our approach . 2 OUR METHOD . 2.1 POSITIVE-UNLABELED LEARNING . Traditional Binary Positive-Unlabeled Problem Setting Let X ∈ Rd and Y ∈ { ±1 } be the input and output variables and p ( x , y ) is the joint distribution with marginal distribution pp ( x ) = p ( x|Y = +1 ) and pn ( x ) = p ( x|Y = −1 ) . In particular , we denote p ( x ) as the distribution of unlabeled data . np , nn and nu are the amount of positive , negative and unlabeled data , respectively . Parallel Non-Negative PU Estimator Vanilla PU learning ( Bekker & Davis , 2020 ; Kiryo et al. , 2017 ; Du Plessis et al. , 2014 ; 2015 ) employs unbiased and consistent estimator . Denote gθ : Rd → R as the score function parameterized by θ , and ` : R× { ±1 } → R as the loss function . The risk of gθ can be approximated by its empirical version denoted as R̂pn ( gθ ) : R̂pn ( gθ ) = πpR̂ + p ( gθ ) + πnR̂ − n ( gθ ) , ( 1 ) where πp represents the class prior probability , i.e . πp = P ( Y = +1 ) with πp+πn = 1 . In addition , R̂+p ( gθ ) = 1 np ∑np i=1 ` ( gθ ( x p i ) , +1 ) and R̂ − n ( gθ ) = 1 nn ∑nn i=1 ` ( gθ ( x n i ) , −1 ) . As negative data xn are unavailable , a common strategy is to offset R−n ( gθ ) . We also know that πnpn ( x ) = p ( x ) − πppp ( x ) , and hence πnR̂−n ( gθ ) = R̂−u ( gθ ) − πpR̂−p ( gθ ) . Then the resulting unbiased risk estimator R̂pu ( gθ ) can be formulated as : R̂pu ( gθ ) = πpR̂ + p ( gθ ) − πpR̂−p ( gθ ) + R̂−u ( gθ ) , ( 2 ) where R̂−p ( gθ ) = 1 np ∑np i=1 ` ( gθ ( x p i ) , −1 ) and R̂−u ( gθ ) = 1nu ∑nu i=1 ` ( gθ ( x u i ) , −1 ) . The advantage of this unbiased risk minimizer is that the optimal solution can be easily obtained if g is linear in θ . However , in real scenarios we tend to leverage more flexible models gθ , e.g. , deep neural networks . This strategy will push the estimator to a point where it starts to suffer from overfitting . Hence , we decide to utilize non-negative risk ( Kiryo et al. , 2017 ) for our PU learning , which has been verified in ( Kiryo et al. , 2017 ) to allow deep neural network to mitigate overfitting . The non-negative PU estimator is formulated as : R̂pu ( gθ ) = πpR̂ + p ( gθ ) + max { 0 , R̂−u ( gθ ) − πpR̂−p ( gθ ) } . ( 3 ) In pursue of the parallel implementation of R̂pu ( gθ ) , we replace max { 0 , R̂−u ( gθ ) − πpR̂−p ( gθ ) } with its lower bound 1N ∑N i=1 max { 0 , R̂−u ( gθ ; X iu ) − πpR̂−p ( gθ ; X ip ) } where X iu and X ip denote as the unlabeled and positive data in the i-th mini-batch , and N is the number of batches . From Binary PU to Multi-PU Learning Previous PU learning focuses on learning a classifier from positive and unlabeled data , and can not easily be adapted to K + 1 multi-classification tasks where K represents the number of classes in the positive data . Multi-Positive and Unlabeled learning ( Xu et al. , 2017 ) was ever developed , but the proposed algorithm may not allow deep neural networks . Instead , we extend binary PU learning to multi-class version in a straightforward way by additionally incorporating cross entropy loss on all the positive data with labels for different classes . More precisely , we consider theK+1-class classifier fθ as a score function fθ = ( f1θ ( x ) , . . . , f K+1 θ ( x ) ) . After the softmax function , we select the first K positive data to construct cross-entropy loss ` CE , i.e. , ` CE ( fθ ( x ) , y ) = log ∑K+1 j=1 exp ( f jθ ( x ) ) − fyθ ( x ) where y ∈ [ K ] . For the PU loss , we consider the composite function h ( fθ ( x ) ) : Rd → R where h ( · ) conducts a logit transformation on the accumulative probability for the first K classes , i.e. , h ( fθ ( x ) ) = ln ( p1−p ) in which p = ∑K j=1 exp ( f jθ ( x ) ) / ∑K+1 j=1 exp ( f jθ ( x ) ) . The final mini-batch risk of our PU learning can be presented as : R̃pu ( fθ ; X i ) = πpR̂+p ( h ( fθ ) ; X ip ) + max { 0 , R̂−u ( h ( fθ ) ; X iu ) − πpR̂−p ( h ( fθ ) ; X ip ) } + R̂CEp ( fθ ; X ip ) , ( 4 ) where R̂CEp ( fθ ; X ip ) = 1np ∑np i=1 ` CE ( fθ ( x p i ) , y ) . 2.2 CLASSIFIER-NOISE-INVARIANT CONDITIONAL GENERATIVE ADVERSARIAL . NETWORK ( CNI-CGAN ) To leverage extra data , i.e. , all unlabeled data , to benefit the generation , we deploy our conditional generative model on all data with pseudo labels predicted by our PU classifier . However , these predicted labels tend to be noisy , reducing the reliability of the supervision signals and thus worsening the performance of the conditional generative model . Besides , the noise depends on the accuracy of the given PU classifier . To address this issue , we focus on developing a novel noise-invariant conditional GAN that is robust to noisy labels provided by a specified classifier , e.g . a PU classifier . We call our method Classifier-Noise-Invariant Conditional Generative Adversarial Network ( CNI-CGAN ) and the architecture is depicted in Figure 1 . In the following , we elaborate on each part of it . Principle of the Design of CNI-CGAN Albeit being noisy , the pseudo labels given by the PU classifier still provide rich information that we can exploit . The key is to take the noise generation mechanism into consideration during the generation . We denote the real data as xr and the predicted hard label through the PU classifier as PUθ ( xr ) , i.e. , PUθ ( xr ) = arg maxi f i θ ( xr ) , as displayed in Figure 1 . We let the generator “ imitate ” the noise generation mechanism to generate pseudo labels for the labeled data . With both pseudo and real labels , we can leverage the PU classifier fθ to estimate a confusion matrix C̃ to model the label noise from the classifier . During the generation , a real label y , while being fed into the generator G , will also be polluted by C̃ to compute a noisy label ỹ , which then will be combined with the generated fake sample xg for the following discrimination . Finally , the discriminator D will distinguish the real samples [ xr , PUθ ( xr ) ] out of fake samples [ xg , ỹ ] . Overall , the noise “ generation ” mechanism from both sides can be balanced . Estimation of C̃ The key in the design of C̃ is to estimate the label noise of the pre-trained PU classifier by considering all the samples of each class . More specifically , the confusion matrix C̃ is k+ 1 by k+ 1 and each entry C̃ij represents the probability of a generated sample xg , given a label i , being classified as class j by the PU classifier . Mathematically , we denote C̃ij as : C̃ij = P ( PUθ ( xg ) = j|y = i ) = Ez [ I { PUθ ( xg ) =j|y=i } ] , ( 5 ) where xg = G ( z , y = i ) and I is the indicator function . Owing to the stochastic optimization nature when training deep neural networks , we incorporate the estimation of C̃ in the processing of training by Exponential Moving Average ( EMA ) method . This choice can balance the utilization of information from previous training samples and the updated PU classifier to estimate C̃ . We formulate the update of C̃ ( l+1 ) in the l-th mini-batch as follows : C̃ ( l+1 ) = λC̃ ( l ) + ( 1− λ ) ∆C̃Xl , ( 6 ) where ∆C̃Xl denotes the incremental change of C̃ on the current l-th mini-batch data Xl via Eq . 5. λ is the averaging coefficient in EMA . Theoretical Guarantee of Clean Data Distribution Firstly , we denote O ( x ) as the oracle class of sample x from an oracle classifier O ( · ) . Let πi , i = 1 , ... , K+1 , be the class-prior probability of the class i in the multi-positive unlabeled setting . Theorem 1 proves the optimal condition of CNI-CGAN to guarantee the convergence to the clean data distribution . The proof is provided in Appendix A. Theorem 1 . ( Optimal Condition of CNI-CGAN ) Let P g be a probabilistic transition matrix where P gij = P ( O ( xg ) = j|y = i ) indicates the probability of sample xg with the oracle label j generated by G with the initial label i . We assume that the conditional sample space of each class is disjoint with each other , then ( 1 ) P g is a permutation matrix if the generator G in CNI-CGAN is optimal , with the permutation , compared with an identity matrix , only happens on rows r where corresponding πr , r ∈ r are equal . ( 2 ) If P g is an identity matrix and the generator G in CNI-CGAN is optimal , then pr ( x , y ) = pg ( x , y ) where pr ( x , y ) and pg ( x , y ) are the real and the generating joint distribution , respectively . Briefly speaking , CNI-CGAN can learn the clean data distribution if P g is an identity matrix . More importantly , the method we elaborate till now has already guaranteed Pg as a permutation matrix , which is very close to an identity one . We need an additional constraint , although the permutation happens only when same class-prior probabilities exist . The Auxiliary Loss The optimal G in CNI-CGAN can only guarantee that pg ( x , y ) is close to pr ( x , y ) as the optimal permutation matrix P g is close to the identity matrix . Hence in practice , to ensure that we can exactly learn an identity matrix for P g and thus achieve the clean data distribution , we introduce an auxiliary loss to encourage a larger trace of P g , i.e. , ∑K+1 i=1 P ( O ( xg ) = i ) |y = i ) . As O ( · ) is intractable , we approximate it by the current PU classifier PUθ ( xg ) . Then we obtain the auxiliary loss ` aux : ` aux ( z , y ) = max { κ− 1 K + 1 K+1∑ i=1 Ez ( I { PUθ ( xg ) =i|y=i } ) , 0 } , ( 7 ) where κ ∈ ( 0 , 1 ) is a hyper-parameter . With the support of auxiliary loss , P g has the tendency to converge to the identity matrix where CNI-CGAN can learn the clean data distribution even in the presence of noisy labels . Comparison with RCGAN ( Thekumparampil et al. , 2018 ; Kaneko et al. , 2019 ) The theoretical property of CNI-CGAN has a major advantage over existing Robust CGAN ( RCGAN ) ( Thekumparampil et al. , 2018 ; Kaneko et al. , 2019 ) , for which the optimal condition can only be achieved when the label confusion matrix is known a priori . Although heuristics can be employed , such as RCGAN-U ( Thekumparampil et al. , 2018 ) , to handle the unknown label noise setting , these approaches still lack the theoretical guarantee to converge to the clean data distribution . To guarantee the efficacy of our approach , one implicit and mild assumption is that our PU classifier will not overfit on the training data , while our non-negative estimator helps to ensure that it as explained in Section 2.1 . To further clarify the optimization process of CNI-CGAN , we elaborate the training steps of D and G , respectively . D-Step : We train D on an adversarial loss from both the real data and the generated ( xg , ỹ ) , where ỹ is corrupted by C̃ . C̃y denotes the y-th row of C̃ . We formulate the loss of D as : max D∈F E x∼p ( x ) [ φ ( D ( x , PUθ ( x ) ) ) ] + E z∼PZ , y∼PY ỹ|y∼C̃y [ φ ( 1−D ( G ( z , y ) , ỹ ) ) ] , ( 8 ) where F is a family of discriminators and PZ is the distribution of latent space vector z , e.g. , a Normal distribution . PY is a discrete uniform distribution on [ K + 1 ] and φ is the measuring function . G-Step : We train G additionally on the auxiliary loss ` aux ( z , y ) as follows : min G∈G E z∼PZ , y∼PY ỹ|y∼C̃y [ φ ( 1−D ( G ( z , y ) , ỹ ) ) + β ` aux ( z , y ) ] , ( 9 ) where β controls the strength of auxiliary loss and G is a family of generators . In summary , our CNI-CGAN conducts K+ 1 classes generation , which can be further leveraged to benefit the K+ 1 PU classification via data augmentation . Algorithm 1 Alternating Minimization for PU Learning and Classifier-Noise-Invariant Generation . Input : Training data ( Xp , Xu ) . Batch size M and hyper-parameter β > 0 , λ , κ ∈ ( 0 , 1 ) . L0 and L ∈ N+ . Initializing C̃ ( 1 ) as identity matrix . Number of batches N during the training . Output : Model parameter for generator G , and θ for the PU classifier fθ . 1 : / * Pre-train PU classifier fθ * / 2 : for i = 1 to N do 3 : Update fθ by descending its stochastic gradient of R̃pu ( fθ ; X i ) via Eq . 4 . 4 : end for 5 : repeat 6 : / * Update CNI-CGAN * / 7 : for l = 1 to L do 8 : Sample { z1 , ... , zM } , { y1 , ... , yM } and { x1 , ... , xM } from PZ , PY and all training data , respectively , and then sample { ỹ1 , ... , ỹM } through the current C̃ ( l ) . Then , update the discriminator D by ascending its stochastic gradient of 1 M M∑ i=1 [ φ ( D ( xi , PUθ ( xi ) ) ) ] + φ ( 1−D ( G ( zi , yi ) , ỹi ) ) ] . 9 : Sample { z1 , ... , zM } and { y1 , ... , yM } from PZ and PY , and then sample { ỹ1 , ... , ỹM } through the current C̃ ( l ) . Update the generator G by descending its stochastic gradient of 1 M M∑ i=1 [ φ ( 1−D ( G ( zi , yi ) , ỹi ) ) + β ` aux ( yi , zi ) ] . 10 : if l ≥ L0 then 11 : Compute ∆C̃Xl = 1 M ∑M i=1 I { PUθ ( G ( zi , yi ) ) |yi } via Eq . 5 , and then estimate C̃ by C̃ ( l+1 ) = λC̃ ( l ) + ( 1− λ ) ∆C̃Xl . 12 : end if 13 : end for 14 : / * Update PU classifier via Data Augmentation * / 15 : Sample { z1 , ... , zM } and { y1 , ... , yM } from PZ and PY , respectively , and then update the PU classifier fθ by descending its stochastic gradient of 1 M M∑ i=1 ` CE ( fθ ( G ( zi , yi ) ) , yi ) . 16 : until convergence

Summary: This paper targets at relieving the massive labeled data consumption of deep learning through the framework of semi-supervised learning. In particular, it finds out that two training approaches, Positive-Unlabeled classification and the conditional generation, can benefit each other. Jointly conducting these two approaches can push better performance on both tasks, thus eventually achieving better performance with a limited amount of labeled data. The authors combined the two tasks with a new type of GAN network. They further gave the corresponding theoretical proof for this new GAN model and verified its performance on the benchmark datasets.