C LASSIFICATION FROM P OSITIVE , U NLABELED AND B IASED N EGATIVE D ATA
Anonymous authors
Paper under double-blind review
A BSTRACT
Positive-unlabeled (PU) learning addresses the problem of learning a binary classiﬁer from positive (P) and unlabeled (U) data.
It is often applied to situations where negative (N) data are difﬁcult to be fully labeled.
However, collecting a non-representative N set that contains only a small portion of all possible N data can be much easier in many practical situations.
This paper studies a novel classiﬁcation framework which incorporates such biased N (bN) data in PU learning.
The fact that the training N data are biased also makes our work very different from those of standard semi-supervised learning.
We provide an empirical risk minimization-based method to address this PUbN classiﬁcation problem.
Our approach can be regarded as a variant of traditional example-reweighting algorithms, with the weight of each example computed through a preliminary step that draws inspiration from PU learning.
We also derive an estimation error bound for the proposed method.
Experimental results demonstrate the effectiveness of our algorithm in not only PUbN learning scenarios but also ordinary PU leaning scenarios on several benchmark datasets.
I NTRODUCTION
In conventional binary classiﬁcation, examples are labeled as either positive (P) or negative (N), and we train a classiﬁer on these labeled examples.
On the contrary, positive-unlabeled (PU) learning addresses the problem of learning a classiﬁer from P and unlabeled (U) data, without need of explicitly identifying N data (Elkan & Noto, 2008; Ward et al., 2009).
PU learning ﬁnds its usefulness in many real-world problems.
For example, in one-class remote sensing classiﬁcation (Li et al., 2011), we seek to extract a speciﬁc land-cover class from an image.
While it is easy to label examples of this speciﬁc land-cover class of interest, examples not belonging to this class are too diverse to be exhaustively annotated.
The same problem arises in text classiﬁcation, as it is difﬁcult or even impossible to compile a set of N samples that provides a comprehensive characterization of everything that is not in the P class (Liu et al., 2003; Fung et al., 2006).
Besides,
PU learning has also been applied to other domains such as outlier detection (Hido et al., 2008; Scott & Blanchard, 2009), medical diagnosis (Zuluaga et al., 2011), or time series classiﬁcation (Nguyen et al., 2011).
By carefully examining the above examples, we ﬁnd out that the most difﬁcult step is often to collect a fully representative N set, whereas only labeling a small portion of all possible N data is relatively easy.
Therefore, in this paper, we propose to study the problem of learning from P, U and biased N (bN) data, which we name PUbN learning hereinafter.
We suppose that in addition to P and U data, we also gather a set of bN samples, governed by a distribution distinct from the true N distribution.
As described previously, this can be viewed as an extension of PU learning, but such bias may also occur naturally in some real-world scenarios.
For instance, let us presume that we would like to judge whether a subject is affected by a particular disease based on the result of a physical examination.
While the data collected from the patients represent rather well the P distribution, healthy subjects that request the examination are in general highly biased with respect to the whole healthy subject population.
We are not the ﬁrst to be interested in learning with bN data.
In fact, both Li et al.
(2010) and
Fei & Liu (2015) attempted to solve similar problems in the context of text classiﬁcation.
Li et al.
(2010) simply discarded negative samples and performed ordinary PU classiﬁcation.
It was also mentioned in the paper that bN data could be harmful.
Fei & Liu (2015) adapted another strategy.
The authors considered even gathering unbiased U data is difﬁcult and learned the classiﬁer from only P and bN data.
However, their method is speciﬁc to text classiﬁcation because it relies on the use of effective similarity measures to evaluate similarity between documents.
Therefore, our work differs from these two in that the classiﬁer is trained simultaneously on P, U and bN data, without resorting to domain-speciﬁc knowledge.
The presence of U data allows us to address the problem from a statistical viewpoint, and thus the proposed method can be applied to any PUbN learning problem in principle.
In this paper, we develop an empirical risk minimization-based algorithm that combines both PU learning and importance weighting to solve the PUbN classiﬁcation problem, We ﬁrst estimate the probability that an example is sampled into the P or the bN set.
Based on this estimate, we regard bN
and U data as N examples with instance-dependent weights.
In particular, we assign larger weights to U examples that we believe to appear less often in the P and bN sets.
P data are treated as P examples with unity weight but also as N examples with usually small or zero weight whose actual value depends on the same estimate.
The contributions of the paper are three-fold:
We formulate the PUbN learning problem as an extension of PU learning and propose an empirical risk minimization-based method to address the problem.
We also theoretically establish an estimation error bound for the proposed method.
We experimentally demonstrate that the classiﬁcation performance can be effectively improved thanks to the use of bN data during training.
In other words, PUbN learning yields better performance than PU learning.
Our method can be easily adapted to ordinary PU learning.
Experimentally we show that the resulting algorithm allows us to obtain new state-of-the-art results on several PU learning tasks.
Relation with Semi-supervised Learning With P, N and U data available for training,
our
problem setup may seem similar to that of semi-supervised learning (Chapelle et al., 2010; Oliver et al., 2018).
Nonetheless, in our case, N data are biased and often represent only a small portion of the whole
N distribution.
Therefore, most of the existing methods designed for the latter cannot be directly applied to the PUbN classiﬁcation problem.
Furthermore, our focus is on deducing a risk estimator using the three sets of data, whereas in semi-supervised learning the main concern is often how U data can be utilized for regularization (Grandvalet & Bengio, 2005; Belkin et al., 2006; Laine & Aila, 2017; Miyato et al., 2016).
The two should be compatible and we believe adding such regularization to our algorithm can be beneﬁcial in many cases.
Relation with Dataset Shift PUbN learning can also be viewed as a special case of dataset shift(Quionero-Candela et al., 2009) if we consider that P and bN data are drawn from the training distribution while U data are drawn from the test distribution.
Covariate shift (Shimodaira, 2000;
Sugiyama & Kawanabe, 2012) is another special case of dataset shift that has been studied intensively.
In the covariate shift problem setting, training and test distributions have the same class conditional distribution and only differ in the marginal distribution of the independent variable.
One popular approach to tackle this problem is to reweight each training example according to the ratio of the test density to the training density (Huang et al., 2007; Sugiyama et al., 2008).
Nevertheless, simply training a classiﬁer on a reweighted version of the labeled set is not sufﬁcient in our case since there may be examples with zero probability to be labeled.
It is also important to notice that the problem of PUbN learning is intrinsically different from that of covariate shift and neither of the two is a special case of the other.
P ROBLEM S ETTING
In this section, we brieﬂy review the formulations of PN, PU and PNU classiﬁcation and introduce the problem of learning from P, U and bN data.
describe the same thing.
However, strictly speaking, sample selection bias actually refers to the case where training instances are ﬁrst drawn from the test distributions and then a subset of these data is systematically discarded due to a particular mechanism.
2. S TANDARD B INARY C LASSIFICATION
Let x 2 R d and y 2 f +1 ; (cid:0) 1 g be random variables following an unknown probability distribution with density p ( x ; y ) .
Let g : R d !
R be an arbitrary decision function for binary classiﬁcation and ℓ : R !
R + be a loss function of margin yg ( x ) that usually takes a small value for a large margin.
The goal of binary classiﬁcation is to ﬁnd g that minimizes the classiﬁcation risk:
[Equation]
where E ( x ;y ) (cid:24) p ( x ;y ) [ (cid:1) ] denotes the expectation over the joint distribution p ( x ; y ) .
When we care about classiﬁcation accuracy, ℓ is the zero-one loss ℓ 01 ( z ) =
(1 (cid:0) sign( z ))
= 2 .
However, for ease of optimization, ℓ 01 is often substituted with a surrogate loss such as the sigmoid loss ℓ sig ( z ) =
=
(1 + exp( z )) or the logistic loss ℓ log ( z ) =
ln(1 + exp( (cid:0) z )) during learning.
In standard supervised learning scenarios (PN classiﬁcation), we are given P and N data that are sampled independently from p ( x j y = +1) and p ( x j y = (cid:0) 1) as X P = f x P i g n P i =1 and X N = f x N i g n N i =1 .
Let us denote by R + P ( g ) =
E x (cid:24) p ( x j y =+1)
[ ℓ ( g ( x ))] , R (cid:0) N ( g ) =
E x (cid:24) p ( x j y
= (cid:0) 1) [ ℓ ( (cid:0) g ( x ))] partial risks and (cid:25) =
p ( y = 1) the P prior.
We have the equality R ( g ) =
(cid:25)R + P ( g ) + (1 (cid:0) (cid:25) )
R (cid:0) N ( g ) .
The classiﬁcation risk (1) can then be empirically approximated from data by
[Equation]
where ^ R + P ( g ) = 1 n P ∑ n P i =1 ℓ ( g ( x P i )) and ^ R (cid:0) N ( g )
= 1 n N ∑ n N i =1 ℓ ( (cid:0) g ( x N i )) .
By minimizing ^ R PN
( g ) we obtain the ordinary empirical risk minimizer ^ g PN .
2. PU C LASSIFICATION
In PU classiﬁcation, instead of N data X N we have only access to X U =
f x U i g n U
i =1 (cid:24) p
( x ) a set of
U samples drawn from the marginal density p ( x ) .
Several effective algorithms have been designed to address this problem.
Liu et al.
(2002) proposed the S-EM approach that ﬁrst identiﬁes reliable
N data in the U set and then runs the Expectation-Maximization (EM) algorithm to build the ﬁnal classiﬁer.
The biased support vector machine (Biased SVM) introduced in Liu et al. (2003) regards
U samples as N samples with smaller weights.
Mordelet & Vert (2014) solved the PU problem by aggregating classiﬁers trained to discriminate P data from a small random subsample of U data.
More recently, attention has been paid on the unbiased risk estimator proposed in du Plessis et al.
(2014) and du Plessis et al.
The key idea is to use the following equality:
[Equation]
where R (cid:0) U ( g ) =
E x (cid:24) p ( x ) [ ℓ ( (cid:0) g ( x ))] and R (cid:0) P ( g ) =
E x (cid:24) p ( x j y =+1)
[ ℓ ( (cid:0) g ( x ))] : This equality is acquired by exploiting the fact p ( x ) =
(cid:25)p ( x j y = +1)
+ (1 (cid:0) (cid:25) ) p ( x j y = (cid:0) 1) .
As a result, we can approximate the classiﬁcation risk (1) by
[Equation]
where ^ R (cid:0) P ( g ) = 1 n P ∑ n P i =1 ℓ ( (cid:0) g ( x P i )) and ^ R (cid:0) U ( g ) =
1 n U ∑ n U
i =1 ℓ ( (cid:0) g
( x U i )) .
We then minimize ^ R PU ( g ) to obtain another empirical risk minimizer ^ g PU .
Note that as the loss is always positive, the classiﬁcation risk (1) that ^ R PU ( g ) approximates is also positive.
However, Kiryo et al.
(2017) pointed out that when the model of g is too ﬂexible, that is, when the function class G is too large, ^ R PU
(^ g PU ) indeed goes negative and the model seriously overﬁts the training data.
To alleviate overﬁtting, the authors observed that R (cid:0) U ( g ) (cid:0) (cid:25)R (cid:0) P ( g ) =
(1 (cid:0) (cid:25) ) R (cid:0) N ( g ) (cid:21) 0 and proposed the non-negative risk estimator for PU learning:
[Equation]
In terms of implementation, stochastic optimization was used and when r = ^ R (cid:0) U ( g ) (cid:0) (cid:25) ^ R (cid:0) P ( g ) becomes negative for a mini-batch, they performed a step of gradient ascent along ∇ r to make the mini-batch less overﬁtted.
2. PNU C LASSIFICATION
In semi-supervised learning (PNU classiﬁcation), P, N and U data are all available.
An abundance of works have been dedicated to solving this problem.
Here we in particular introduce the PNU risk estimator proposed in Sakai et al.
By directly leveraging U data for risk estimation, it is the most comparable to our method.
The PNU risk is simply deﬁned as a linear combination of PN and
PU/NU risks.
Let us just consider the case where PN and PU risks are combined, then for some (cid:13) 2 [0 ; 1] , the PNU risk estimator is expressed as
[Equation]
We can again consider the non-negative correction by forcing the term (cid:13) (
[Equation]
R
[Equation]
N
[Equation]
)( ^ R (cid:0) U ( g ) (cid:0) (cid:25) ^ R (cid:0) P ( g )) to be non-negative.
In the rest of the paper, we refer to the resulting algorithm as non-negative PNU (nnPNU) learning (see Appendix D.4 for an alternative deﬁnition of nnPNU and the corresponding results).
2. PU B N C LASSIFICATION
In this paper, we study the problem of PUbN learning.
It differs from usual semi-supervised learning in the fact that labeled N data are not fully representative of the underlying N distribution p ( x j y = (cid:0) 1) .
To take this point into account, we introduce a latent random variable s and consider the joint distribution p ( x ; y; s ) with constraint p ( s = +
j x ; y = +1)
= 1 .
Equivalently, p ( y = (cid:0) 1 j x ; s = (cid:0) 1)
= 1 .
Let (cid:26) =
p ( y = (cid:0) 1 ; s = +1) .
Both (cid:25) and (cid:26) are assumed known throughout the paper.
In practice they often need to be estimated from data (Jain et al., 2016; Ramaswamy et al., 2016; du Plessis et al., 2017).
In place of ordinary N data we collect a set of bN samples
[Equation]
The goal remains the same: we would like to minimize the classiﬁcation risk (1).
M ETHOD
In this section, we propose a risk estimator for PUbN classiﬁcation and establish an estimation error bound for the proposed method.
Finally we show how our method can be applied to PU learning as a special case when no bN data are available.
3. R ISK E STIMATOR
Let R (cid:0) bN
( g ) =
E x (cid:24) p ( x j y = (cid:0) 1 ;s =+1)
[ ℓ ( (cid:0) g ( x ))] and R (cid:0) s = (cid:0) 1 ( g )
=
E x (cid:24) p ( x j s = (cid:0) 1)
[ ℓ ( (cid:0) g ( x ))] .
Since p ( x ) = p ( x ; y = +1)
+ p ( x ; y = (cid:0) 1 ; s = +1)
+ p ( x ; s = (cid:0) 1) , we have
[Equation]
g )
[Equation] [Equation]
The ﬁrst two terms on the right-hand side of the equation can be approximated directly from data by writing ^ R + P ( g ) =
1 n P ∑ n P i =1 ℓ ( g ( x P i )) and ^ R (cid:0) bN ( g ) =
1 n bN ∑ n bN i =1 ℓ ( (cid:0) g ( x bN i )) .
We therefore focus on the third term (cid:22) R (cid:0) s = (cid:0) 1 ( g ) :
=
(1 (cid:0) (cid:25) (cid:0) (cid:26) ) R (cid:0) s = (cid:0) 1 ( g ) .
Our approach is mainly based on the following theorem.
We relegate all proofs to the appendix.
Theorem 1.
Let (cid:27) ( x ) = p
( s = +
j x ) .
For all (cid:17) 2 [0 ; 1] and h : R d ! [0 ; 1] satisfying the condition h ( x ) > (cid:17) ) (cid:27) ( x ) > 0 , the risk (cid:22) R (cid:0) s = (cid:0) 1 ( g ) can be expressed as
[Equation]
In the theorem, (cid:22) R (cid:0) s = (cid:0) 1 ( g ) is decomposed into three terms, and when the expectation is substituted with the average over training samples, these three terms are approximated respectively using data from X U , X P and X bN .
The choice of h and (cid:17) is thus very crucial because it determines what each of the three terms tries to capture in practice.
Ideally, we would like h to be an approximation of (cid:27) .
Then, for x such that h ( x ) is close to 1, (cid:27) ( x ) is close to 1, so the last two terms on the righthand side of the equation can be reasonably evaluated using X P and X bN (i.e., samples drawn from p ( x j s = +1) ).
On the contrary, if h ( x ) is small, (cid:27) ( x ) is small and such samples can be hardly found in X P or X bN .
Consequently the ﬁrst term appeared in the decomposition is approximated with the help of X U .
Finally, in the empirical risk minimization paradigm, (cid:17) becomes a hyperparameter that controls how important U data is against P and bN data when we evaluate (cid:22) R (cid:0) s = (cid:0) 1 ( g ) .
The larger (cid:17) is, the more attention we would pay to U data.
One may be curious about why we do not simply approximate the whole risk using only U samples, that is, set (cid:17) to 1.
There are two main reasons.
On one hand, if we have a very small U set, which means n U ≪ n P and n U ≪ n bN , approximating a part of the risk with labeled samples should help us reduce the estimation error.
This may seem unrealistic but sometimes unbiased U samples can also be difﬁcult to collect (Ishida et al., 2018).
On the other hand, more importantly, we have empirically observed that when the model of g is highly ﬂexible, even a sample regarded as N with small weight gets classiﬁed as N in the latter stage of training and performance of the resulting classiﬁer can thus be severely degraded.
Introducing (cid:17) alleviates this problem by avoiding treating all U data as N samples.
As (cid:27) is not available in reality, we propose to replace (cid:27) by its estimate ^ (cid:27) in (6).
We further substitute h with the same estimate and obtain the following expression:
[Equation]
E x (cid:24) p ( x
[Equation]
s =
+1 ;
y =
[Equation] [Equation]
We notice that (cid:22) R s = (cid:0) 1 ;(cid:17); ^ (cid:27) depends both on (cid:17) and ^ (cid:27) .
It can be directly approximated from data by ^(cid:22)
R s = (cid:0) 1 ;(cid:17); ^ (cid:27) ( g ) =
1 n U n U
∑ i =
[Equation]
( x U i ) (cid:20) (cid:17) ℓ ( (cid:0) g
( x U i ))
(1 (cid:0) ^ (cid:27) ( x U i )) ]
+ (cid:25) n P n P ∑ i =
[ 1 ^
[Equation]
( x P i
[Equation]
>(cid:17) ℓ ( (cid:0) g ( x P i )) (cid:0) ^ (cid:27) ( x P i ) ^ (cid:27) ( x P i ) ] + (cid:26) n bN n bN
∑ i =
[ 1 ^
[Equation]
( x bN
[Equation]
(cid:17) ℓ ( (cid:0) g ( x bN i )) (cid:0) ^ (cid:27) ( x bN i ) ^ (cid:27) ( x bN i ) ) ] :
We are now able to derive the empirical version of Equation (5) as
[Equation]
Estimating (cid:27) If we regard s as a class label, the problem of estimating (cid:27) is then equivalent to training a probabilistic classiﬁer separating the classes with s =
+1 and s = (cid:0) 1 .
Observing that ( (cid:25) + (cid:26) )
E x (cid:24) p ( x j s =+1)
[ ℓ ( ϵg ( x ))]
= (cid:25) E x (cid:24) p ( x j y =+1)
[ ℓ ( ϵg ( x ))]
+ (cid:26) E x (cid:24) p ( x j y = (cid:0) 1 ;s =+1)
[ ℓ ( ϵg ( x ))] for ϵ 2 f +1 ; (cid:0) 1 g , it is straightforward to apply nnPU learning with availability of X P , X bN and X U to minimize E ( x ;s ) (cid:24) p ( x ;s ) [ ℓ ( sg ( x ))] .
In other words, here we regard X P and X bN as P and X U as U, and attempt to solve a PU learning problem by applying nnPU.
Since we are interested in the classposterior probabilities, we minimize the risk with respect to the logistic loss and apply the sigmoid function to the output of the model to get ^ (cid:27) ( x ) .
However, the above risk estimator accepts any reasonable ^ (cid:27) and we are not limited to using nnPU for computing ^ (cid:27) .
For example, the least-squares ﬁtting approach proposed in Kanamori et al.
(2009) for direct density ratio estimation can also be adapted to solving the problem.
3. E STIMATION E RROR B OUND
Here we establish an estimation error bound for the proposed method.
Let G be the function class from which we ﬁnd a function.
The Rademacher complexity of G for the samples of size n drawn from q ( x ) is deﬁned as
[Equation]
where
X = f x 1 ; : : : ; x n g and (cid:18) =
f (cid:18) 1 ; : : : ; (cid:18)
n g with each x i drawn from q ( x ) and (cid:18) i as a
Rademacher variable (Mohri et al., 2012).
In the following we will assume that R n;q ( G ) vanishes asymptotically as n ! 1 .
This holds for most of the common choices of G if proper regularization is considered (Bartlett & Mendelson, 2002; Golowich et al., 2018).
Assume additionally the existence of C g > 0 such that sup g 2G ∥ g ∥ 1 (cid:20) C g as well as C ℓ > 0 such that sup j z j(cid:20)
C g ℓ ( z ) (cid:20) C ℓ .
We also assume that ℓ is Lipschitz continuous on the interval [ (cid:0) C g ; C g ] with a Lipschitz constant
L ℓ .
Theorem 2.
Let g (cid:3) =
arg min g 2G R ( g ) be the true risk minimizer and ^ g PUbN ;(cid:17); ^ (cid:27) =
arg min g 2G ^ R PUbN ;(cid:17); ^ (cid:27) ( g ) be the PUbN empirical risk minimizer.
We suppose that ^ (cid:27) is a ﬁxed function independent of data used to compute ^ R PUbN ;(cid:17); ^ (cid:27) ( g ) and (cid:17) 2 (0 ; 1] .
Denote by p P ( x ) = p ( x j y = +1) and p bN ( x ) = p ( x j y = (cid:0) 1 ; s = +1) the P and bN marginals.
Let (cid:16) =
p (^ (cid:27) ( x ) (cid:20) (cid:17) ) and ϵ =
E x (cid:24) p ( x ) [ j ^ (cid:27) ( x ) (cid:0) (cid:27) ( x ) j 2 ] .
Then for any (cid:14) > 0 , with probability at least 1 (cid:0) (cid:14) ,
R
[Equation]
[Equation]
g
[Equation]
[Equation]
G
[Equation]
G
[Equation]
+
[Equation]
√
[Equation]
[Equation]
l (cid:17) √ [Equation] [Equation] =(cid:14) )
[Equation]
√
[Equation]
(cid:17) √
[Equation]
(cid:16) )
ϵ:
Theorem 2 shows that as n P ! 1 , n bN !
1 and n U ! 1 , we have R (^ g PUbN ;(cid:17); ^ (cid:27) ) (cid:0) R ( g (cid:3) ) !
2 C l p (cid:16)ϵ + 2( C l =(cid:17) ) √ (1 (cid:0) (cid:16) )
ϵ .
Furthermore, if there is C G > 0 such that R n;q ( G ) (cid:20) C G
=
p n 2 , the convergence rate is O p (1 = p n P + 1 = p n bN + 1 = p n U ) , where O p denotes the order in probability.
As for ϵ , knowing that ^ (cid:27) is also estimated from data in practice 3 , apparently its value depends on both the estimation algorithm and the number of samples that are involved in the estimation process.
For example, in our approach we applied nnPU with the logistic loss to obtain ^ (cid:27) , so the excess risk can be written as E x (cid:24) p ( x ) KL( (cid:27) ( x ) ∥ ^ (cid:27) ( x )) , where by abuse of notation
KL( p ∥ q ) =
p ln( p=q )+(1 (cid:0) p ) ln((1 (cid:0) p ) =
(1 (cid:0) q )) denotes the KL divergence between two Bernouilli distributions with parameters respectively p and q .
It is known that ϵ = E x (cid:24) p ( x ) [ j ^ (cid:27) ( x ) (cid:0) (cid:27) ( x ) j 2 ] (cid:20) (1 = 2) E x (cid:24) p ( x ) KL( (cid:27) ( x ) ∥ ^ (cid:27) ( x ))
(Zhang, 2004).
The excess risk itself can be decomposed into the sum of the estimation error and the approximation error.
Kiryo et al.
(2017) showed that under mild assumptions the estimation error part converges to zero when the sample size increases to inﬁnity in nnPU learning.
It is however impossible to get rid of the approximation error part which is ﬁxed once we ﬁx the function class G .
To circumvent this problem, we can either resort to kernel-based methods with universal kernels (Zhang, 2004) or simply enlarge the function class when we get more samples.
3. PU L EARNING R EVISITED
In PU learning scenarios, we only have P and U data and bN data are not available.
Nevertheless, if we let y play the role of s and ignore all the terms related to bN data, our algorithm is naturally applicable to PU learning.
Let us name the resulting algorithm PUbN n N, then
[Equation]
where ^ (cid:27) is an estimate of p ( y = +
j x ) and
[Equation]
PUbN n N can be viewed as a variant of the traditional two-step approach in PU learning which ﬁrst identiﬁes possible N data in U data and then perform ordinary PN classiﬁcation to distinguish P data from the identiﬁed N data.
However, being based on state-of-the-art nnPU learning, our method is more promising than other similar algorithms.
Moreover, by explicitly considering the posterior p ( y = +
j x ) , we attempt to correct the bias induced by the fact of only taking into account conﬁdent negative samples.
The beneﬁt of using an unbiased risk estimator is that the resulting algorithm is always statistically consistent, i.e., the estimation error converges in probability to zero as the number of samples grows to inﬁnity.
E XPERIMENTS
In this section, we experimentally investigate the proposed method and compare its performance against several baseline methods.
4. B ASIC S ETUP
We focus on training neural networks with stochastic optimization.
For simplicity, in an experiment, ^ (cid:27) and g always use the same model and are trained for the same number of epochs.
All models are learned using AMSGrad (Reddi et al., 2018) as the optimizer and the logistic loss as the surrogate loss unless otherwise speciﬁed.
To determine the value of (cid:17) , we introduce another hyperparameter (cid:28) and choose (cid:17) such that # f x 2 X U j ^ (cid:27) ( x ) (cid:20) (cid:17) g
= (cid:28) (1 (cid:0) (cid:25) (cid:0) (cid:26) ) n U .
In all the experiments, an additional validation set, equally composed of P, U and bN data, is sampled for both hyperparameter tuning and choosing the model parameters with the lowest validation loss among those obtained after every epoch.
Regarding the computation of the validation loss, we use the PU risk estimator (2) with the sigmoid loss for g and an empirical approximation of E x (cid:24) p ( x ) [ j ^ (cid:27) ( x ) (cid:0) (cid:27) ( x ) j 2 ] (cid:0) E x (cid:24) p ( x ) [ (cid:27) ( x ) 2 ] for ^ (cid:27) (see Appendix B).
4. E FFECTIVENESS OF THE A LGORITHM
We assess the performance of the proposed method on three benchmark datasets: MNIST, CIFARand 20 Newsgroups.
Experimental details are given in Appendix C. In particular, since all the three datasets are originally designed for multiclass classiﬁcation, we group different categories together to form a binary classiﬁcation problem.
Baselines.
When X bN is given, two baseline methods are considered.
The ﬁrst one is nnPNU adapted from (4).
In the second method, named as PU !
PN, we train two binary classiﬁers: one is learned with nnPU while we regard s as the class label, and the other is learned from X P and X bN to separate P samples from bN samples.
A sample is classiﬁed in the P class only if it is so classiﬁed by the two classiﬁers.
When X bN is not available, nnPU is compared with the proposed PUbN n N.
Sampling bN Data To sample X bN , we suppose that the bias of N data is caused by a latent prior probability change (Sugiyama & Storkey, 2007;
Hu et al., 2018) in the N class.
Let z 2 Z :=
[Table]
that a of X belongs to the latent
[Table]
f 1 ; : : : ; S g be some latent variable which we call a latent category, where S is a constant.
It is assumed
[Equation]
In the experiments
[Table]
the latent categories are the original class labels of the datasets.
Concrete deﬁnitions of X bN with experimental results are summarized in Table 1.
Results.
Overall, our proposed method consistently achieves the best or comparable performance in all the scenarios, including those of standard PU learning.
Additionally, using bN data can effectively help improving classiﬁcation performance.
However, the choice of algorithm is essential.
Both nnPNU and the naive PU !
PN are able to leverage bN data to enhance classiﬁcation accuracy in only relatively few tasks.
In the contrast, the proposed PUbN successfully reduce the misclassiﬁcation error most of the time.
Clearly, the performance gain that we can beneﬁt from the availability of bN data is case-dependent.
On CIFAR-10, the greatest improvement is achieved when we regard mammals (i.e. cat, deer, dog and horse) as P class and drawn samples from latent categories bird and frog as labeled negative data.
This is not surprising because birds and frogs are more similar to mammals than vehicles, which makes the classiﬁcation harder speciﬁcally for samples from these two latent categories.
By explicitly labeling these samples as N data, we allow the classiﬁer to make better predictions for these difﬁcult samples.
4. T HE P RESENCE OF B N D ATA H ELPS : A N I LLUSTRATION
Through experiments we have demonstrated that the presence of bN data effectively helps learning a better classiﬁer.
Here we would like to provide some intuition for the reason behind this.
Let us consider the MNIST learning task where X bN is uniformly sampled from the latent categories 1,and 5. We project the representations learned by the classiﬁer (i.e., the activation values of the last layer of the neural network) into a 2D plane using PCA for both nnPU and PUbN algorithms.
[Figure]
The results are shown in Figure 1.
Since for both nnPU and PUbN classiﬁers, the ﬁrst two principal components account around 90% of variance, we believe that this ﬁgure depicts fairly well the learned representations.
Thanks to the use of bN data, in the high-level feature space 1, 3, 5 and P data are further pushed away when we employ the proposed PUbN learning algorithm, and we are always able to separate 7, 9 from P to some extent.
This explains the better performance which is achieved by PUbN learning and the beneﬁt of incorporating bN data into the learning process.
C ONCLUSION
This paper studied the PUbN classiﬁcation problem, where a binary classiﬁer is trained on P, U and bN data.
The proposed method is a two-step approach inspired from both PU learning and importance weighting.
The key idea is to attribute appropriate weights to each example to evaluate the classiﬁcation risk using the three sets of data.
We theoretically established an estimation error bound for the proposed risk estimator and experimentally showed that our approach successfully leveraged bN data to improve the classiﬁcation performance on several real-world datasets.
A variant of our algorithm was able to achieve state-of-the-art results in PU learning.
A PPENDIX A P ROOFS A. P ROOF OF T HEOREM
We notice that (1 (cid:0) (cid:25) (cid:0) (cid:26) ) p ( x j s = (cid:0) 1) = p ( x ; s = (cid:0) 1) and that when h ( x ) > (cid:17) , we have p ( s = +
j x ) = (cid:27) ( x ) > 0 , which allows us to write p ( s = (cid:0) 1 j x ) =
( p ( s = (cid:0) 1 j x ) =p ( s = +
j x ))
p ( s = +
j x ) .
We can thus decompose (cid:22) R (cid:0) s = (cid:0) 1 ( g ) as following:
[Equation]
By writing p ( x
[Equation]
(cid:0) (cid:27) ( x ))
p ( x ) and p ( x ; s = +1)
=
p ( s = +
j x ) p ( x ) = (cid:27) ( x ) p ( x ) , we have
[Equation]
We obtain Equation (6) after replacing p ( x ; s = +1) by (cid:25)p ( x j y = +1)+
(cid:26)p ( x j y = (cid:0) 1 ; s = +1) .
A. P ROOF OF T HEOREM
For ^ (cid:27) and (cid:17) given, let us deﬁne
R PUbN ;
[Equation] [Equation]
The following lemma establishes the uniform deviation bound from ^ R PUbN ;(cid:17); ^ (cid:27) to R PUbN ;(cid:17); ^ (cid:27) .
Lemma 1.
Let ^ (cid:27) : R d !
[0 ; 1] be a ﬁxed function independent of data used to compute ^ R PUbN ;(cid:17); ^ (cid:27) and (cid:17) 2 (0 ; 1] .
For any (cid:14) > 0 , with probability at least 1 (cid:0) (cid:14) ,
[Equation]
Proof.
For ease of notation
[Equation]
let
[Table]
[Equation]
From the sub-additivity of the supremum operator
[Equation]
we have
[Equation]
As a consequence
[Equation]
to conclude the proof
[Equation]
it sufﬁces to prove that with probability at least 1 (cid:0) (cid:14)=
[Equation]
the following bounds hold separately:
[Equation]
Below we prove (8).
(9) and (10) are proven similarly.
Let ϕ x : R !
R + be the function deﬁned by ϕ x : z 7!
ℓ ( z ) + 1 ^
[Equation]
ℓ
[Equation]
z
[Equation]
1 (cid:0) ^ (cid:27) ( x ))
=
^ (cid:27) ( x )) .
For x 2 R d ; g 2 G , since ℓ ( g ( x )) 2 [0 ; C l ] , ℓ ( (cid:0) g ( x )) 2 [0 ; C l ] and 1 ^ (cid:27) ( x ) >(cid:17) ((1 (cid:0) ^ (cid:27) ( x ))
=
^ (cid:27) ( x ))
[0 ; (1 (cid:0) (cid:17) )
=(cid:17) ] , we always have ϕ x
( g ( x )) 2 [0 ; C l =(cid:17) ] .
Following the proof of Theorem 3.1 in Mohri et al.
(2012), it is then straightforward to show that with probability at least 1 (cid:0) (cid:14)= 3 , it holds that
[Equation]
where (cid:18)
=
f (cid:18) 1 ; : : : ; (cid:18) n P g and each (cid:18)
i is a Rademacher variable.
Also notice that for all x , ϕ x is a ( L l =(cid:17) )
-Lipschitz function on the interval [ (cid:0) C g ; C g ] .
By using a modiﬁed version of Talagrad’s concentration lemma (speciﬁcally, Lemma 26.9 in Shalev-Shwartz & Ben-David (2014)), we can show that, when the set X P is ﬁxed, we have
[Equation]
= (cid:18) i ϕ x
i ( g ( x i )) ]
(cid:20) L l (cid:17) E (cid:18)
[ sup g 2G n P n P ∑ i = (cid:18) i g ( x i ) ] :
After taking expectation over X P (cid:24) p n p P , we obtain the Equation (8).
However, what we really want to minimize is the true risk R ( g ) .
Therefore, we also need to bound the difference between R PUbN ;(cid:17); ^ (cid:27) ( g ) and R ( g ) , or equivalently, the difference between (cid:22)
R (cid:0) s = (cid:0) 1 ;(cid:17); ^ (cid:27) ( g ) and
(cid:22) R (cid:0) s = (cid:0) 1 ( g ) .
Lemma 2.
Let ^ (cid:27) : R d !
[0 ; 1] , (cid:17) 2 (0 ; 1] , (cid:16) =
p (^ (cid:27) (cid:20) (cid:17) ) and ϵ =
E x (cid:24) p ( x ) [ j ^ (cid:27) ( x ) (cid:0) (cid:27) ( x ) j 2 ] .
For all g 2 G , it holds that
[Equation]
Proof.
One one hand, we have
[Equation]
|
[Equation] [Equation]
On the other hand, we can express (cid:22) R (cid:0) s = (cid:0) 1 ;(cid:17); ^ (cid:27) ( g ) as (cid:22) R (cid:0) s = (cid:0) 1 ;(cid:17); ^ (cid:27) ( g ) =
[Equation]
( x ) (cid:20) [Equation] [Equation] x
[Equation]
The last equality follows from the fact p ( x ; s = +1) =
(cid:27) ( x ) p ( x ) .
[Equation]
s
[Equation]
(cid:0) 1 ;(cid:17); ^ (cid:27) ( g ) (cid:0) (cid:22) R (cid:0) s = (cid:0) 1 ( g )
j (cid:20)
j A 1 (cid:0)
A 2 j + j B 1 (cid:0) B 2 j , it is sufﬁcient to derive bounds for j A 1 (cid:0) A 2 j and j B 1 (cid:0) B 2 j separately.
For j B 1 (cid:0) B 2 j , we write
[Equation]
ϵ
From the second to the third line we use the Cauchy-Schwarz inequality.
j A 1 (cid:0)
A 2 j (cid:20) C l p (cid:16)ϵ can be proven similarly, which concludes the proof.
Combining lemma 1 and lemma 2, we know that with probability at least 1 (cid:0) (cid:14) , the following holds:
[Equation]
Finally, with probability at least 1 (cid:0) (cid:14) ,
[Equation]
The ﬁrst inequality uses the deﬁnition of ^ g PUbN ;(cid:17); ^ (cid:27) .
B V ALIDATION L OSS FOR E STIMATION OF (cid:27)
In terms of validation we want to choose the model for ^ (cid:27) such that J 0 (^ (cid:27) ) =
E x (cid:24) p ( x ) [ j ^ (cid:27) ( x ) (cid:0) (cid:27) ( x ) j 2 ] is minimized.
Since (cid:27) ( x ) p ( x ) = p ( x ; s = +1) , we have
J
[Equation]
= ∫
[Equation]
x
[Equation]
dx = ∫
[Equation]
∫
[Equation]
The last term does not depend on ^ (cid:27) and can be ignored if we want to identify ^ (cid:27) achieving the smallest
J (^ (cid:27) ) .
We denote by J (^ (cid:27) )
the sum of the ﬁrst two terms.
The middle term can be further expanded using ∫
[Equation]
The validation loss of an estimation ^ (cid:27) is then deﬁned as
[Equation]
It is also possible to minimize this value directly to acquire ^ (cid:27) .
In our experiments we decide to learn ^ (cid:27) by nnPU for a better comparison between different methods.
C D ETAILED E XPERIMENTAL S ETTING C. F ROM M ULTICLASS TO B INARY C LASS
In the experiments we work on multiclass classiﬁcation datasets.
Therefore it is necessary to deﬁne the P and N classes ourselves.
MNIST is processed in such a way that pair numbers 0, 2, 4, 6, 8 form the P class and impair numbers 1, 3, 5, 7, 9 form the N class.
Accordingly, (cid:25) = 0 : 49 .
For CIFAR-10, we consider two deﬁnitions of the P class.
The ﬁrst one corresponds to a quite natural task that aims to distinguish vehicles from animals.
Airplane, automobile, ship and truck are therefore deﬁned to be the P class while the N class is formed by bird, cat, deer, dog, frog and horse.
For the sake of diversity, we also study another task in which we attempt to distinguish the mammals from the non-mammals.
The P class is then formed by cat, deer, dog, and horse while the N class consists of the other six classes.
We have (cid:25) = 0 : 4 in the two cases.
As for 20 Newsgroups, alt., comp., misc.
and rec.
make up the P class whereas sci., soc.
and talk.
make up the N class.
This gives (cid:25) = 0 : 56 .
C. T RAINING , V ALIDATION AND T EST S ET
For the three datasets, we use the standard test examples as a held-out test set.
The test set size is thus of 10000 for MNIST and CIFAR-10, and 7528 for 20 Newsgroups.
Regarding the training set, we sample 500, 500 and 6000 P, bN and U training examples for MNIST and 20 Newsgroups, and 1000, 1000 and 10000 P, bN and U training examples for CIFAR-10.
The validation set is always ﬁve times smaller than the training set.
C. 20 N EWSGROUPS P REPROCESSING
The original 20 Newsgroups dataset contains raw text data and needs to be preprocessed into text feature vectors for classiﬁcation.
In our experiments we borrow the pre-trained ELMo word embedding (Peters et al., 2018) from https://allennlp.org/elmo.
The used 5.5B model was, according to the website, trained on a dataset of 5.5B tokens consisting of Wikipedia (1.9B) and all of the monolingual news crawl data from WMT 2008-2012 (3.6B).
For each word, we concatenate the features from the three layers of the ELMo model, and for each document, as suggested in R¨uckl´e et al.
(2018), we concatenate the average, minimum, and maximum computed along the word dimension.
This results in a 9216-dimensional feature vector for a single document.
C. M ODELS AND H YPERPARAMETERS
MNIST For MNIST, we use a standard ConvNet with ReLU.
This model contains two 5x5 convolutional layers and one fully-connected layer, with each convolutional layer followed by a 2x2 max pooling.
The channel sizes are 5-10-40.
The model is trained for 100 epochs with a weight decay of 10 (cid:0) 4 .
Each minibatch is made up of 10 P, 10 bN (if available) and 120 U samples.
The learning rate (cid:11) 2 f 10 (cid:0) 2 ; 10 (cid:0) 3 g and (cid:28) 2 f 0 : 5 ; 0 : 7 ; 0 : 9 g , (cid:13) 2 f 0 : 1 ; 0 : 3 ; 0 : 5 ; 0 : 7 ; 0 : 9 g are selected with validation data.
CIFAR-10 For CIFAR-10, we train PreAct ResNet-18 (He et al., 2016) for 200 epochs and the learning rate is divided by 10 after 80 epochs and 120 epochs.
This is a common practice and similar adjustment can be found in He et al.
The weight decay is set to 10 (cid:0) 4 .
The minibatch size is 1/100 of the number of training samples, and the initial learning rate is chosen from f 10 (cid:0) 2 ; 10 (cid:0) 3 g .
We also have (cid:28) 2 f 0 : 5 ; 0 : 7 ; 0 : 9 g and (cid:13) 2 f 0 : 1 ; 0 : 3 ; 0 : 5 ; 0 : 7 ; 0 : 9 g .
20 Newsgroups For 20 Newsgroups, with the extracted features, we simply train a multilayer perceptron with two hidden layers of 300 neurons for 50 epochs.
We use basically the same hyperparameters as for MNIST except that the learning rate (cid:11) is selected from f 5 (cid:1) 10 (cid:0) 3 ; 10 (cid:0) 3 ; 5 (cid:1) 10 (cid:0) 4 g .
D A DDITIONAL E XPERIMENTS D. W HY D OES PU B N n N O UTPERFORM NN PU ?
Our method, speciﬁcally designed for PUbN learning, naturally outperforms other baseline methods in this problem.
Nonetheless, Table 1 equally shows that the proposed method when applied to PU learning, achieves signiﬁcantly better performance than the state-of-the-art nnPU algorithm.
Here we numerically investigate the reason behind this phenomenon. Besides nnPU and PUbN n N, we compare with unbiased PU (uPU) learning (2). Both uPU and nnPU are learned with the sigmoid loss, learning rate 10 (cid:0) 3 for MNIST, initial learning rate 10 (cid:0) 4 for CIFAR-10, and learning rate 10 (cid:0) 4 for 20 Newsgroups.
This is because uPU learning is unstable with
[Figure]
the logistic loss.
The other parts of the experiments remain unchanged.
On the test sets we compute the false positive rates, false negative rates and misclassiﬁcation errors for the three methods and plot them in Figure 2.
We ﬁrst notice that PUbN n N still outperforms nnPU trained with the sigmoid loss.
In fact, the ﬁnal performance of the nnPU classiﬁer does not change much when we replace the logistic loss with the sigmoid loss.
In Kiryo et al.
, the authors observed that uPU overﬁts training data with the risk going to negative.
In other words, a large portion of U samples are classiﬁed to the N class.
This is conﬁrmed in our experiments by an increase of false negative rate and decrease of false positive rate.
nnPU remedies the problem by introducing the non-negative risk estimator (3).
While the non-negative correction successfully prevents false negative rate from going up, it also causes more N samples to be classiﬁed as P compared to uPU.
However, since the gain in terms of false negative rate is enormous, at the end nnPU achieves a lower misclassiﬁcation error.
By further identifying possible
N samples after nnPU learning, we expect that our algorithm can yield lower false positive rate than nnPU without misclassifying too many P samples as N as in the case of uPU.
Figure 2 suggests that this is effectively the case.
In particular, we observe that on MNIST, our method achieves the same false positive rate than uPU whereas its false negative rate is comparable to nnPU.
D. I NFLUENCE OF (cid:17) AND (cid:26)
In the proposed algorithm we introduce (cid:17) to control how (cid:22) R s = (cid:0) 1 ( g ) is approximated from data and assume that (cid:26) = p ( y = (cid:0) 1 ; s = +1) is given.
Here we conduct experiments to see how our method is affected by these two factors.
To assess the inﬂuence of (cid:17) , from Table 1 we pick four learning tasks and we choose (cid:28) from f 0 : 5 ; 0 : 7 ; 0 : 9 ; 2 g while all the other hyperparameters are ﬁxed.
Similarly to simulate the case where (cid:26) is misspeciﬁed, we replace it by (cid:26) ′ 2 f 0 : 8 (cid:26); (cid:26); 1 : 2 (cid:26) g in our learning method and run experiments with all hyperparameters being ﬁxed to a certain value.
However, we still use the true (cid:26) to compute (cid:17) from (cid:28) to ensure that we always use the same number of U samples in the second step of the algorithm independent of the choice of (cid:26) ′ .
The results are reported in Table 2 and Table 3.
We can see that the performance of the algorithm is sensitive to the choice of (cid:28) .
With larger value of (cid:28) , more U data are treated as N data in PUbN learning, and consequently it often leads to higher false negative rate and lower false positive rate.
The trade-off between these two measures is a classic problem in binary classiﬁcation.
In particular, when (cid:28) = 2 , a lot more U samples are involved in the computation of the PUbN risk (7), but this does not allow the classiﬁer to achieve a better performance.
We also observe that there is a positive correlation between the misclassiﬁcation rate and the validation loss, which conﬁrms that the optimal value of (cid:17) can be chosen without need of unbiased N data.
Table 3 shows that in general slight misspeciﬁcation of (cid:26) does not cause obvious degradation of the classiﬁcation performance.
In fact, misspeciﬁcation of (cid:26) mainly affect the weights of each sample when we compute ^ R PUbN ;(cid:17); ^ (cid:27) (due to the direct presence of (cid:26) in (7) and inﬂuence on estimating (cid:27) ).
However, as long as the variation of these weights remain in a reasonable range, the learning algorithm should yield classiﬁers with similar performances.
D. E STIMATING (cid:27) FROM S EPARATE D ATA
Theorem 2 suggests that ^ (cid:27) should be independent from the data used to compute ^ R PUbN ;(cid:17); ^ (cid:27) .
Therefore, here we investigate the performance of our algorithm when ^ (cid:27) and g are optimized using different sets of data.
We sample two training sets and two validation sets in such a way that they are all disjoint.
The size of a single training set and a single validation set is as indicated in Appendix
C.2, except for 20 Newsgroups we reduce the number of examples in a single set by half.
We then use different pairs of training and validation sets to learn ^ (cid:27) and g .
For 20 Newsgroups we also conduct standard experiments where ^ (cid:27) and g are learned on the same data, whereas for MNIST and
CIFAR-10 we resort to Table 1.
The results are presented in Table 4.
Estimating (cid:27) from separate data does not seem to beneﬁt much the ﬁnal classiﬁcation performance, despite the fact that it requires collecting twice more samples.
In fact, ^(cid:22) R (cid:0) s = (cid:0) 1 ;(cid:17); ^ (cid:27) ( g ) is a good approximation of (cid:22) R (cid:0) s = (cid:0) 1 ;(cid:17); ^ (cid:27) ( g ) as long as the function ^ (cid:27) is smooth enough and does not possess abrupt changes between data points.
With the use of non-negative correction, validation data and L2 regularization, the resulting ^ (cid:27) does not overﬁt training data so this should always be the case.
As a consequence, even if ^ (cid:27) and g are learned on the same data, we are still able to achieve small generalization error with sufﬁcient number of samples.
D. A LTERNATIVE D EFINITION OF NN PNU
In subsection 2.3, we deﬁne the nnPNU algorithm by forcing the estimator of the whole N partial risk to be positive.
However, notice that the term (cid:13) (1 (cid:0) (cid:25) ) ^ R (cid:0) N ( g ) is always positive and the chances are that including it simply makes non-negative correction weaker and is thus harmful to the ﬁnal classiﬁcation performance.
Therefore, here we consider an alternative deﬁnition of nnPNU where we only force the term (1 (cid:0) (cid:13) )
( ^ R (cid:0) U ( g ) (cid:0) (cid:25) ^
R (cid:0) P ( g )) to be positive.
We plug the resulting algorithm in the experiments of subsection 4.2 and summarize the results in Table 5 in which we denote the alternative version of nnPNU by nnPU+PN since it uses the same non-negative correction as nnPU.
The table indicates that neither of the two deﬁnitions of nnPNU consistently outperforms the other. [Table]
[Table] It also ensures that there is always a clear superiority of our proposed PUbN algorithm compared to nnPNU despite its possible variant that is considered here. [Table] [Table]
> 5 > others 4 : 60 (cid:6) 0 :5 : 10 (cid:6) 1 :
CIFARAirplane, automobile, ship, truck
Cat, dog, horse 10 : 25 (cid:6) 0 :10 : 87 (cid:6) 0 :
Horse > deer = frog > others 9 : 98 (cid:6) 0 :10 : 77 (cid:6) 0 :
CIFARCat, deer, dog, horse
Bird, frog 22 : 00 (cid:6) 0 :21 : 41 (cid:6) 1 :
Car, truck 22 : 00 (cid:6) 0 :21 : 80 (cid:6) 0 :20 Newsgroups alt., comp., misc.
, rec.
sci.
14 : 69 (cid:6) 0 :14 : 50 (cid:6) 1 :talk.
14 : 38 (cid:6) 0 :14 : 71 (cid:6) 1 :soc.
> talk. >
sci.
14 : 41 (cid:6) 0 :13 : 66 (cid:6) 0 :