\section{Introduction}

	Existing machine learning methods, particularly deep learning models, typically require big data to pursue remarkable performances. 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~\cite{lucic2019high}. 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~\cite{mirza2014conditional} drops significantly~\cite{lucic2019high}. 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 in-distribution 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 generation with extra data, most related works focus on the in-distribution data~\cite{lucic2019high,gui2020review,donahue2019large}. When it comes to the out-of-distribution data, the majority of existing methods~\cite{noguchi2019image, yamaguchi2019effective,zhao2020leveraging}  attempt to forcibly train generative models on a large number of unlabeled data, and then transfer 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~\cite{miyato2018virtual, sun2019patch, berthelot2019mixmatch}, 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~\cite{bekker2018learning, kiryo2017positive} is an elegant way of handling this under-studied problem, where a model only has access to positive examples and unlabeled data. Therefore, it is possible to utilize pseudo labels predicted by a PU classifier on unlabeled data to guide the conditional generation. However, the predicted signals from the classifier tend to be noisy. Although there are a flurry of papers related to learning from noisy labels for classification~\cite{tasi2019noise,ge2020mutual,guo2019learning}, to our best knowledge, no work has considered to leverage the noisy labels seamlessly in joint classification and generation. The discussion about more related works can refer to Appendix~\ref{relatedworks}. 
	

	In this paper, we focus on the mutual benefits of conditional generation and PU classification, in settings where although little class-labeled data is available, extra unlabeled data, including out-of-distribution data, are provided. 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. Conversely, 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. To our best knowledge, we are the first to leverage the interplay between generative models and PU classifiers for mutual improvements.
	
	\section{Our Method}
	
	\subsection{Positive-Unlabeled Learning}\label{sec:PU}	
	
	\textbf{Traditional Binary Positive-Unlabeled Problem Setting} Let $X\in\mathbb{R}^d$ and $Y\in\{\pm1\}$ be the input and output variables and $p(x, y)$ is the joint distribution with marginal distribution $p_p(x)=p(x|Y=+1)$ and $p_n(x)=p(x|Y=-1)$. In particular, we denote $p(x)$ as the distribution of unlabeled data. $n_p$, $n_n$ and $n_u$ are the amount of positive, negative and unlabeled data, respectively.
	
	\textbf{Parallel Non-Negative PU Estimator} Vanilla PU learning~\cite{bekker2018learning, kiryo2017positive} employs unbiased and consistent estimator. Denote $g_{\theta}: \mathbb{R}^{d} \rightarrow \mathbb{R}$ as the score function parameterized by $\theta$, and $\ell: \mathbb{R} \times\{\pm 1\} \rightarrow \mathbb{R}$ as the loss function. The risk of $g_\theta$ can be approximated by its empirical version denoted as $\widehat{R}_{\mathrm{pn}}(g_\theta)$:	
	\begin{equation} \begin{aligned}
	\widehat{R}_{\mathrm{pn}}(g_\theta)=\pi_{\mathrm{p}} \widehat{R}_{\mathrm{p}}^{+}(g_\theta)+\pi_{\mathrm{n}} \widehat{R}_{\mathrm{n}}^{-}(g_\theta),
	\end{aligned} \end{equation}
	where $\pi_p$ represents the class prior probability, i.e. $P(Y=+1)$, with $\pi_p+\pi_n=1$, and $\widehat{R}_{\mathrm{p}}^{+}(g_\theta)=\frac{1}{n_p} \sum_{i=1}^{n_{\mathrm{p}}} \ell\left(g_\theta \left(x_{i}^{\mathrm{p}}\right),+1\right)$ and $\widehat{R}_{\mathrm{n}}^{-}(g_\theta)=\frac{1}{n_n} \sum_{i=1}^{n_{\mathrm{n}}} \ell\left(g_\theta \left(x_{i}^{\mathrm{n}}\right),-1\right)$. As negative data $x^n$ are unavailable, a common strategy is to offset $R_{\mathrm{n}}^{-}(g_\theta)$. We also know that $\pi_{\mathrm{n}} p_{\mathrm{n}}(x)=p(x)-\pi_{\mathrm{p}} p_{\mathrm{p}}(x)$, and hence $\pi_{\mathrm{n}} \widehat{R}_{\mathrm{n}}^{-}(g_\theta)=\widehat{R}_{\mathrm{u}}^{-}(g_\theta)-\pi_{\mathrm{p}} \widehat{R}_{\mathrm{p}}^{-}(g_\theta)$. Then the resulting unbiased risk estimator $	\widehat{R}_{\mathrm{pu}}(g_\theta)$ can be formulated as:	
	\begin{equation} \begin{aligned}
	\widehat{R}_{\mathrm{pu}}(g_\theta)=\pi_{\mathrm{p}} \widehat{R}_{\mathrm{p}}^{+}(g_\theta)-\pi_{\mathrm{p}} \widehat{R}_{\mathrm{p}}^{-}(g_\theta)+\widehat{R}_{\mathrm{u}}^{-}(g_\theta),
	\end{aligned} \end{equation}
	where $\widehat{R}_{\mathrm{p}}^{-}(g_\theta)=\frac{1}{n_p} \sum_{i=1}^{n_{\mathrm{p}}} \ell\left(g_\theta \left(x_{i}^{\mathrm{p}}\right),-1\right)$ and $\widehat{R}_{\mathrm{u}}^{-}(g_\theta)=\frac{1}{n_u} \sum_{i=1}^{n_{\mathrm{u}}} \ell\left(g_\theta \left(x_{i}^{\mathrm{u}}\right),-1\right)$. The advantage of this unbiased risk minimizer is that the optimal solution can be easily obtained if $g$ is linear in $\theta$. However, in real scenarios we tend to leverage more flexible models $g_\theta$, 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 \textit{non-negative risk}~\cite{kiryo2017positive} for our PU learning, which has been verified in \cite{kiryo2017positive} to allow deep neural network to mitigate overfitting. The non-negative PU estimator is formulated as:	
	\begin{equation} \begin{aligned}
	\widehat{R}_{\mathrm{pu}}(g_\theta)=\pi_{\mathrm{p}} \widehat{R}_{\mathrm{p}}^{+}(g_\theta)+\max \left\{0, \widehat{R}_{\mathrm{u}}^{-}(g_\theta)-\pi_{\mathrm{p}} \widehat{R}_{\mathrm{p}}^{-}(g_\theta)\right\}.
	\end{aligned} \end{equation}
	In pursue of the parallel implementation of $\widehat{R}_{\mathrm{pu}}(g_\theta)$, we replace $\max \left\{0, \widehat{R}_{\mathrm{u}}^{-}(g_\theta)-\pi_{\mathrm{p}} \widehat{R}_{\mathrm{p}}^{-}(g_\theta)\right\}$ with its lower bound $\frac{1}{N}\sum_{i=1}^{N}\max \left\{0, \widehat{R}_{\mathrm{u}}^{-}(g_\theta; \mathcal{X}^i_u)-\pi_{\mathrm{p}} \widehat{R}_{\mathrm{p}}^{-}(g_\theta; \mathcal{X}^i_p)\right\}$ where $\mathcal{X}^i_u$ and $\mathcal{X}^i_p$ denote as the unlabeled and positive data in the $i$-th mini-batch. $N$ is the number of batches.
	
	\textbf{From Binary PU to Multi-PU Learning} Previous PU learning  focuses on learning a classifier from positive and unlabeled data, and cannot easily be adapted to $K+1$ multi-classification tasks where $K$ represents the number of classes in the positive data. Xu et al.~\cite{xu2017multi} ever developed Multi-Positive and Unlabeled learning, but the proposed algorithm has not necessarily allowed 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 the $K+1$-class classifier $f_\theta$  as a score function $f_{\theta} = \left(f_{\theta}^{1}(x), \ldots, f_{\theta}^{K+1}(x)\right)$. After the \textit{softmax} function, we select the first $K$ positive data to construct cross-entropy loss $\ell^{\mathrm{CE}}$, i.e., $\ell^{\mathrm{CE}}(f_\theta(x), y)=\log \sum_{j=1}^{K+1} \exp \left(f_{\theta}^{j}(x)\right)-f_{\theta}^{y}(x)$ where $y\in [K]$. For the PU loss, we consider the composite function $h(f_\theta(x)): \mathbb{R}^{d} \rightarrow \mathbb{R}$ where $h(\cdot)$ conduct a logit transformation on the accumulative probability for the first $K$ classes, i.e., $h(f_\theta(x))=\text{ln}(\frac{p}{1-p})$ where $p=\sum_{j=1}^{K} \exp \left(f_{\theta}^{j}(x)\right) / \sum_{j=1}^{K+1} \exp \left(f_{\theta}^{j}(x)\right)$. The final mini-batch risk of our PU learning can be presented as:	
	\begin{equation} \begin{aligned}\label{eq:PU}
	\widetilde{R}_{\mathrm{pu}}(f_\theta; \mathcal{X}^i) = \pi_{\mathrm{p}} \widehat{R}_{\mathrm{p}}^{+}(h(f_\theta); \mathcal{X}^i_p) +  \max \left\{0, \widehat{R}_{\mathrm{u}}^{-}(h(f_\theta); \mathcal{X}^i_u)-\pi_{\mathrm{p}} \widehat{R}_{\mathrm{p}}^{-}(h(f_\theta); \mathcal{X}^i_p)\right\} 
	+ \widehat{R}_{\mathrm{p}}^{\mathrm{CE}}(f_\theta; \mathcal{X}^i_p),
	\end{aligned} \end{equation}
	where $\widehat{R}_{\mathrm{p}}^{\mathrm{CE}}(f_\theta; \mathcal{X}^i_p)=\frac{1}{n_p} \sum_{i=1}^{n_{\mathrm{p}}} \ell^{\mathrm{CE}} \left(f_\theta \left(x_{i}^{\mathrm{p}}\right),y\right)$.
	
	
	\subsection{Classifier-Noise-Invariant Conditional Generative Adversarial Network}\label{sec:CNI-CGAN}	
	
	\begin{figure}[b!]
		\centering
		\includegraphics[width=0.5\textwidth,trim=210 150 250 105,clip]{1Architecture.pdf}
		\caption{Model architecture of our Classifier-Noise-Invariant Conditional GAN~(CNI-CGAN). The output $x_g$ of the conditional generator $G$ is paired with a noisy label $\tilde{y}$ corrupted by the PU-dependent confusion matrix $\tilde{C}$. The discriminator $D$ distinguishes between whether a given labeled sample comes from the real data $(x_r, PU_{\theta}(x_r))$ or generated data $(x_g, \tilde{y})$.}
		\label{fig:architecture}
	\end{figure}
	

	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 pre-trained PU classifier. However, these predicted labels tend to be noisy, reducing the reliability of the supervision signals and thus worsening the performance for 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~\ref{fig:architecture}. In the following, we elaborate on each part of it.
	
	\textbf{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 generation. We denote the real data as $x_r$ and the predicted hard label through PU classifier as $PU_{\theta}(x_r)$, i.e., $PU_{\theta}(x_r)=\arg \max_i f^i_\theta(x_r)$, as displayed in Figure~\ref{fig:architecture}.  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_\theta$ to estimate a confusion matrix $\tilde{C}$ to model the label noise from the classifier. During generation, a real label $y$, while being fed into the generator $G$, will also be polluted by $\tilde{C}$ to compute a noisy label $\tilde{y}$, which then will be combined with the generated fake sample $x_g$ for the following discrimination. Finally, the discriminator $D$ will distinguish the real samples $[x_r, PU_\theta(x_r)]$ out of fake samples $[x_g, \tilde{y}]$. Overall, the noise ``generation'' mechanism from both sides can be balanced.
	
	\textbf{Estimation of $\tilde{C}$} The key in the design of $\tilde{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 $\tilde{C}$ is $k+1$ by $k+1$ and each entry $\tilde{C}_{ij}$ represents the probability of a generated sample $x_g$, given a label $i$, being classified as class $j$ by the PU classifier. Mathematically, we denote $\tilde{C}_{ij}$ as:	
	\begin{eqnarray} \begin{aligned}\label{eq:estimiation}
	\tilde{C}_{ij}=P(PU_{\theta}(x_g)=j|y=i)= \mathbb{E}_z[\mathbb{I}_{\{PU_{\theta}(x_g)=j | y=i\}}],
	\end{aligned} \end{eqnarray} 
	where $x_g=G(z,y=i)$ and $\mathbb{I}$ is the indicator operator. Owing to the stochastic optimization nature when training deep neural networks, we incorporate the estimation of $\tilde{C}$ in the processing of training by \textit{Exponential Moving Average~(EMA) method}. We formulate the update of $\tilde{C}^{(l+1)}$ in the $l$-th mini-batch as follows: 	
	\begin{eqnarray} \begin{aligned}
	\tilde{C}^{(l+1)}=\lambda \tilde{C}^{(l)}+ (1-\lambda) \Delta_{\mathcal{X}_l}^{\tilde{C}},
	\end{aligned} \end{eqnarray} 
	where $\Delta_{\mathcal{X}_l}^{\tilde{C}}$ denotes the incremental change of $\tilde{C}$ on the current $l$-th mini-batch data $\mathcal{X}_l$ via Eq.~\ref{eq:estimiation}. $\lambda$ is the averaging coefficient in EMA.
	
	\textbf{Theoretical Guarantee of Clean Data Distribution} Firstly, we denote $\mathcal{O}(x)$ as the oracle class of sample $x$ from an oracle classifier $\mathcal{O}(\cdot)$. Let $\pi_i, i=1,...,K\!+\!1$, be the class-prior probability of the class $i$ in the multi-postive unlabeled setting. Theorem~\ref{theorem:ours} proves the optimal condition of CNI-CGAN to guarantee the convergence to the clean data distribution. The proof is provided in Appendix~\ref{appendix_CNICGAN}.
	
	\begin{theorem}\label{theorem:ours}(Optimal Condition of CNI-CGAN) 
		Let $P^g$ be a probabilistic transition matrix where $P^g_{ij}=P(\mathcal{O}(x_g)=j|y=i)$ indicates the probability of sample $x_g$ 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 $\mathbf{r}$ where corresponding $\pi_r, r\in \mathbf{r}$ are equal.
		
		(2) If $P^g$ is an identity matrix and the generator $G$ in CNI-CGAN is optimal, then $p^r(x,y)=p^g(x,y)$ where $p^r(x,y)$ and $p^g(x,y)$ are the real and generating joint distribution, respectively. 
		
		
	\end{theorem} 
	



	
	\begin{algorithm}[b!]
		\setstretch{0.01}
		\caption{Alternating Minimization for PU Learning and Classifier-Noise-Invariant Generation.}
		\textbf{Input}: Training data ($\mathcal{X}_p$, $\mathcal{X}_u$). Batch size $M$ and hyper-parameter $\beta > 0$, $\lambda, \kappa \in (0,1)$. $L_0$ and $L \in N^+$. Initialization of $\tilde{C}^{(1)}$ as identity matrix. Number of batches $N$ during the training. \\
		\textbf{Output}: Model parameter for generator $G$, and $\theta$ for the PU classifier $f_\theta$. \\
		\begin{algorithmic}[1]
			\STATE / * \textit{Pre-train  PU classifier $f_\theta$} * /
		
			\FOR{$i$ = 1 to $N$} 
		
		
		
		
		
		
		
		
		
			
			\STATE Update $f_\theta$ by descending its stochastic gradient of $\widetilde{R}_{\mathrm{pu}}\left(f_{\theta} ; \mathcal{X}^{i}\right)$ via Eq.~\ref{eq:PU}.
			\ENDFOR
		
			
			\REPEAT
			
			\STATE / * \textit{Update  CNI-CGAN} * /
			
			\FOR{$l$ = 1 to $L$}			
			\STATE Sample $\{\mathbf{z}_1,...,\mathbf{z}_M \}$, $\{\mathbf{y}_1,...,\mathbf{y}_M \}$ and $\{\mathbf{x}_1,...,\mathbf{x}_M \}$ from $P_Z$, $P_Y$ and all training data, respectively, and then sample $\{\mathbf{\tilde{y}}_1,...,\mathbf{\tilde{y}}_M \}$ through the current $\tilde{C}^{(l)}$. Update the discriminator $D$ by ascending its stochastic gradient of
			
			$$\frac{1}{M}\sum_{i=1}^{M}[\phi(D(\mathbf{x}_i, PU_\theta(\mathbf{x}_i)))]+\phi(1-D(G(\mathbf{z}_i,\mathbf{y}_i), \mathbf{\tilde{y}}_i))]$$
			
			\STATE Sample $\{\mathbf{z}_1,...,\mathbf{z}_M \}$ and  $\{\mathbf{y}_1,...,\mathbf{y}_M \}$ from $P_Z$ and $P_Y$, and then sample $\{\mathbf{\tilde{y}}_1,...,\mathbf{\tilde{y}}_M \}$ through the current $\tilde{C}^{(l)}$. Update the generator $G$ by descending its stochastic gradient of
			
			$$\frac{1}{M}\sum_{i=1}^{M}[\phi(1-D(G(\mathbf{z}_i,\mathbf{y}_i), \mathbf{\tilde{y}}_i))+\beta \ell_{\mathrm{aux}}(\mathbf{y}_i, \mathbf{z}_i)]$$
			
			\IF{$l \ge L_0$} 
			
			\STATE Compute $\Delta_{\mathcal{X}_l}^{\tilde{C}} = \frac{1}{M}\sum_{i=1}^{M} \mathbb{I}_{\{PU_\theta(G(\mathbf{z}_i,\mathbf{y}_i))|\mathbf{y}_i\}}$ via Eq.~\ref{eq:estimiation}, and then estimate $\tilde{C}$ by 
			
			$$\tilde{C}^{(l+1)}=\lambda \tilde{C}^{(l)}+ (1-\lambda) \Delta_{\mathcal{X}_l}^{\tilde{C}}$$
			\ENDIF 
			
			\ENDFOR
			
			\STATE / * \textit{Update PU classifier via Data Augmentation} * /
			
			\STATE Sample $\{\mathbf{z}_1,...,\mathbf{z}_M \}$ and $\{\mathbf{y}_1,...,\mathbf{y}_M \}$ from $P_Z$ and $P_Y$, respectively, and then update the PU classifier $f_\theta$ by descending its stochastic gradient of
			
			$$\frac{1}{M} \sum_{i=1}^{M} \ell^{\mathrm{CE}} \left(f_\theta \left(G(\mathbf{z}_i,\mathbf{y}_i)\right),\mathbf{y}_i\right)$$
			
			\UNTIL convergence
			
		\end{algorithmic}
		\label{alg:framework}
	\end{algorithm}
	
	
	\textbf{The Auxiliary Loss} The optimal $G$ in CNI-CGAN can only guarantee $p^g(x,y)$ is close to $p^r(x,y)$ as the optimal permutation matrix $P^g$, i.e., a permutation matrix, is close to the identity matrix. Hence in practice, to ensure we can 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., $\sum_{i=1}^{K+1}P(\mathcal{O}(x_g)=i)|y=i)$. As $\mathcal{O}(\cdot)$ is intractable, we approximate it by the current PU classifier $PU_{\theta}(x_g)$. Then we obtain the auxiliary loss:	
	\begin{eqnarray} \begin{aligned}
	\ell_{\mathrm{aux}}(z, y)= \max \{ \kappa - \frac{1}{K+1}\sum_{i=1}^{K+1}\mathbb{E}_z(\mathbb{I}_{\{ PU_{\theta}(x_g)=i|y=i \}}),  0\},
	\end{aligned} \end{eqnarray} 
	where $\kappa \in (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. 
	
	\textbf{Comparison with RCGAN~\cite{thekumparampil2018robustness, kaneko2019label}} The theoretical property of CNI-CGAN has a major advantage over existing Robust CGAN~(RCGAN)~\cite{thekumparampil2018robustness, kaneko2019label}, for which the optimal condition can only be achieved when the label confusion matrix is known \textit{a priori}. Although heuristics can be employed, such as RCGAN-U~\cite{thekumparampil2018robustness}, to handle the unknown label noise setting, these approaches still lack the theoretical guarantee to converge to the clean data distribution. Additionally, 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 it as explained in Section~\ref{sec:PU}. It should be worthwhile to note that our CNI-CGAN conducts $K+1$ classes generation. To further clarify the optimization process of CNI-CGAN, we elaborate the training steps of $D$ and $G$, respectively.
	
	\noindent \textbf{D-Step:}	We train $D$ on an adversarial loss from both the real data and generated $(x_g, \tilde{y})$ where $\tilde{y}$ is corrupted by $\tilde{C}$. $\tilde{C}_y$ denotes the $y$-th row of $\tilde{C}$. We formulate the loss of $D$ as:
	\begin{eqnarray} \begin{aligned}
	\max_{D \in \mathcal{F}} \underset{x \sim p(x)}{\mathbb{E}}[\phi(D(x, PU_{\theta}(x)))]+\underset{z \sim P_Z, y \sim P_{Y} \atop \tilde{y} | y \sim \tilde{C}_{y}}{\mathbb{E}}[\phi(1-D(G(z,y), \tilde{y}))],
	\end{aligned} \end{eqnarray} 
	where $\mathcal{F}$ is a family of discriminators and $P_Z$ is the distribution of latent space vector $z$, e.g., a Normal distribution. $P_Y$ is a discrete uniform distribution on $[K+1]$ and $\phi$ is the measuring function.
	
	\noindent \textbf{G-Step:}	We train $G$ additionally on the auxiliary loss $\ell_{\mathrm{aux}}(z, y)$ as follows: 
	
	
	\begin{eqnarray} \begin{aligned}
	\min _{G \in \mathcal{G}} \underset{z \sim P_Z, y \sim P_{Y} \atop \tilde{y} | y \sim \tilde{C}_{y}}{\mathbb{E}}\left[\phi(1-D(G(z,y), \tilde{y}))+\beta\ell_{\mathrm{aux}}(z, y) \right],
	\end{aligned} \end{eqnarray} 	
	where $\beta$ controls the strength of auxiliary loss and $\mathcal{G}$ is a family of generators.
	
	
	\subsection{Training Framework}
	Firstly, we obtain a PU classifier $f_\theta$ trained on multi-positive and unlabeled dataset with the parallel non-negative estimator derived in Section~\ref{sec:PU}. Then we train our CNI-CGAN, described in Section~\ref{sec:CNI-CGAN}, on all data with pseudo labels predicted by the pre-trained PU classifier. As our CNI-CGAN is robust to noisy labels, we leverage the data generated by CNI-CGAN to conduct data augmentation to improve the PU classifier. Finally, we implement the joint optimization for the training of CNI-CGAN and the data augmentation of the PU classifier. We summarize the details in Algorithm~\ref{alg:framework} and Appendix~\ref{appendix:alg}.
	
	\textbf{Simultaneous Improvement on PU Learning and Generation with Extra Data} From the perspective of PU classification, due to the theoretical guarantee from Theorem~\ref{theorem:ours},  CNI-CGAN is capable of learning a clean data distribution out of noisy pseudo labels predicted by the pre-trained PU classifier. Hence, the following data augmentation has the potential to improve the generalization of PU classification regardless of the specific form of the PU estimator. From the perspective of generation with extra data, the predicted labels on unlabeled data from the PU classifier can provide the CNI-CGAN with more supervision signals, thus further improving the quality of generation. Due to the joint optimization, both the PU classification and the conditional generative models are able to improve each other reciprocally, as demonstrated in the following experiments.
	
	\section{Experiment}
	
	\textbf{Experimental Setup} We perform our approaches and several baselines on MNIST, Fashion-MNIST and CIFAR-10. We select the first 5 classes on MNIST and 5 non-clothes classes on Fashion-MNIST respectively for $K+1$ classification~($K=5$). To verify the consistent effectiveness of our method in the standard binary PU setting, we pick the 4 categories of transportation tools in CIFAR-10 as the one-class positive dataset. As for the baselines, the first is \textit{CGAN-P}, where a Vanilla CGAN~\cite{mirza2014conditional} is trained only on limited positive data. Another natural baseline is \textit{CGAN-A} where a Vanilla CGAN is trained on all data with labels given by the PU classifier. The last baseline is RCGAN-U~\cite{thekumparampil2018robustness} where the confusion matrix is totally learnable while training. For fair comparisons, we choose the same GAN architecture, and more details about hyper-parameters can be found in Appendix~\ref{appendix:experiement}. 
	
	\textbf{Evaluation} For MNIST and Fashion-MNIST, we mainly use \textit{Generator Label Accuracy}~\cite{thekumparampil2018robustness} and \textit{PU Accuracy} to evaluate the quality of generated images. \textit{Generator Label Accuracy} compares specified $y$ from CGANs to the true class of the generated examples through a pre-trained (almost) oracle classifier $f$. In experiments, we pre-trained two $K\!+\!1$ classifiers with 99.28$\%$ and 98.23$\%$ accuracy on the two datasets, respectively. Additionally, the increased \textit{PU Accuracy} measures the closeness between generated data distribution and test (almost real) data distribution for the PU classification, serving as a key indicator to reflect the quality of generated images. For CIFAR 10, we take the \textit{Inception Score} into consideration.
	
	\begin{figure}[t!]
		\centering
		\centering\includegraphics[width=0.9\textwidth,trim=10 10 10 0,clip]{3Classification.pdf}
		\caption{Generation and classification performance of CGAN-P, CGAN-A and Ours on three datasets. Results of CGAN-P on PU accuracy do not exist since CGAN-P generates only $K$ classes data rather than $K+1$ categories that the PU classifier needs.}
		\label{fig:classification}
	\end{figure}
	
	\subsection{Generation and Classification Performance}
	We set the whole training dataset as the unlabeled data and select certain amount of positive data with the ratio of \textit{Positive Rate}. Figure~\ref{fig:classification} presents the trend of Generator Label Accuracy, Inception Score and PU Accuracy as the Positive Rate increases. It turns out that CNI-CGAN outperforms CGAN-P and CGAN-A consistently especially when the Positive Rate is small, i.e. little positive data. Remarkably, our approach enhances the PU accuracy greatly when exposed to low positive rates, while CGAN-A even worsens the original PU classifier sometimes in this scenario due to the existence of too much label noise given by a less accurate PU classifier. Meanwhile, when more supervised positive data are given, the PU classifier generalizes better and then provides more accurate labels, conversely leading to more consistent and better performances for all methods. Besides, note that even though the CGAN-P achieves comparable generator label accuracy on MNIST, it results in a lower Inception Score. We demonstrate this in Appendix~\ref{appendix:experiement}.
	
























	To verify the advantage of theoretical property for our CNI-CGAN, we further compare it with RCGCN-U~\cite{thekumparampil2018robustness, kaneko2019label}, the heuristic version of robust generation against unknown noisy labels setting without the theoretical guarantee of optimal condition. As observed in Table~\ref{table_RCGANU}, our method outperforms RCGAN-U especially when the positive rate is low, and when the number of positive labeled data is relatively large, e.g., 10.0\%, both Ours and RCGAN-U obtain comparable performances.
	
	\begin{table}[htbp]
		\centering
		\caption{PU classification accuracy of RCGAN-U and Ours across three datasets. Final PU accuracy represents the accuracy of PU classifier after the data augmentation.}
		\scalebox{0.8}{
			\begin{tabular}{ccccccc}
				\hline
				\hline
				\multicolumn{2}{c}{\textbf{Final PU Accuracy $\backslash$ Positive Rates~(\%)}}&0.2\%&0.5\%&1.0\%&10.0\%\\
				\hline
				\multirow{3}*{MNIST}&Original PU&68.86&76.75&86.94&95.88\\
				~&RCGAN-U&87.95 &95.24&95.86 &\bf97.80\\
				~                   &Ours   &\bf96.33 &\bf96.43 &\bf96.71&\bf97.82 \\
				
				
				\hline	
				\multirow{3}*{Fashion-MNIST}&Original PU&80.68&88.25&93.05&95.99\\
				~&RCGAN-U &89.21   &92.05   &94.59 &\bf97.24\\
				~                   &Ours   &\bf89.23 &\bf93.82 &\bf95.16&\bf97.33 \\
				\hline	
				\multirow{3}*{CIFAR-10}&Original PU&76.79&80.63&85.53&88.43\\
				~&RCGAN-U &83.13  &86.22   &88.22   &\bf90.45\\
				~ &Ours   &\bf87.64&\bf87.92 &\bf88.60&\bf90.69 \\
				\hline
				\hline
		\end{tabular}		}
		\label{table_RCGANU}
	\end{table}
	
	
	\begin{figure}[b!]
		\centering
		\centering\includegraphics[width=0.9\textwidth,trim=10 180 30 180,clip]{2Visualization.pdf}
		\caption{Visualization of generated samples on three datasets. Rows below the red line represent the negative class. We highlight the erroneously generated images with red boxes on MNIST.}
		\label{fig:visualization}
	\end{figure}
	
	\textbf{Visualization} To further demonstrate the superiority of CNI-CGAN compared with the other baselines, we present some generated images within $K+1$ classes from CGAN-A, RCGAN-U and CNI-CGAN on MNIST, and high-quality images from CNI-CGAN on Fashion-MNIST and CIFAR-10, in Figure~\ref{fig:visualization}. In particular, we choose the positive rate as 0.2$\%$ on MNIST, yielding the initial PU classifier with 69.14$\%$ accuracy. Given the noisy labels on all data, our CNI-CGAN can generate more accurate images of each class visually compared with CGAN-A and RCGAN-U. Results of Fashion-MNIST and comparison with CGAN-P on CIFAR-10 can refer to Appendix~\ref{appendix:visualization}.
	
	\subsection{Robustness of Our Approach}
	
	\textbf{Robustness against the Initial PU accuracy} The auxiliary loss can help the CNI-CGAN to learn the clean data distribution regardless of the initial accuracy of PU classifiers. To verify that, we select distinct positive rates, yielding the pre-trained PU classifiers with different initial accuracies. Then we perform our method based on these PU classifiers. Figure~\ref{fig:speed} suggests that although better initial PU accuracy can be beneficial to the initial generation performance, our approach under different PU accuracies can still attain the similar generation quality after sufficient training.
	
	\begin{figure}[hbtp]
		\centering
		\centering\includegraphics[width=0.85\textwidth,trim=10 90 20 50,clip]{5Speed.pdf}
		\caption{Tendency of generation performance as the training iterations increaseon three datasets.}
		\label{fig:speed}
	\end{figure}

	\textbf{Robustness against the Unlabeled data} In real scenarios, we are more likely to have little knowledge about the extra data we have. To further verify the robustness of CNI-CGAN against the unknown distribution of extra data, we test different approaches across different amounts and distributions of the unlabeled data. Particularly, we consider two different types of distributions for unlabeled data. Type 1 is $[\frac{1}{K+1}, ... ,\frac{1}{K+1},\frac{1}{K+1}]$ where the number of data in each class, including the negative data, is even, while type 2 is $[\frac{1}{2K}, ... \frac{1}{2K},\frac{1}{2}]$ where the negative 
	data makes up half of all unlabeled data. In experiments, we focus on the PU Accuracy to evaluate both the generation quality and the improvement of PU learning. For MNIST, we choose 1$\%$ and 0.5$\%$ for two settings while we opt for 0.5$\%$ and 0.2$\%$ on both Fashion-MNIST and CIFAR-10. 
	
	\begin{figure}[htbp]
		\centering
		\centering\includegraphics[width=1.0\textwidth,trim=110 20 130 50,clip]{4Sensitivity.pdf}
		\caption{PU Classification accuracy of CGAN-A, RCGAN-U and Ours after joint optimization across different amounts and distribution types of unlabeled data.}
		\label{fig:sensitivity}
	\end{figure}
	
	Figure~\ref{fig:sensitivity} manifests that the accuracy of PU classifier exhibits a slight ascending tendency with the increasing of the number of unlabeled data. More importantly, our CNI-CGAN almost consistently outperforms other baselines across different amount of unlabeled data as well as distinct distributions of unlabeled data. This verifies the robustness of our proposal to the situation of extra data.
	
	
	\section{Discussion and Conclusion}
	
	In this paper, we proposed a new method, CNI-CGAN, to jointly exploit PU classification and conditional generation. It is, to our best knowledge, the first method of such kind to break the ceiling of class-label scarcity, by combining two promising yet separate methodologies to gain massive mutual improvements. CNI-CGAN can learn the clean data distribution from noisy labels given by a PU classifier, and then enhance the performance of PU classification through data augmentation in various settings. We have demonstrated, both theoretically and experimentally, the superiority of our proposal on diverse benchmark datasets in an exhaustive and comprehensive manner. In future, it will be promising to investigate learning strategies on imbalanced data, e.g., cost-sensitive learning~\cite{elkan2001foundations}, to extend our approach to broader settings, which will further cater to real-world scenarios where only highly unbalanced data are available.
	
	\section*{Broader Impact}
	The scarcity of class-labeled data is prevalent in real applications. Our method investigates the simultaneous improvement of both generation and classification, two basic settings in machine learning problem, under this circumstance by leveraging extra unlabeled data.  Our strategy has huge potential that can have beneficial impacts on any research and engineer fields where basic classification or generative models are built. The solution in our work is able to help reduce the appetite of labeled data, and can be further employed in a wide range of real tasks, including weakly and semi-supervised learning, medical imaging research as well as other artificial intelligence tasks. Then the tense for a large amount of labeled data can be eased, and the economical costs can be significantly saved by the leverage of our approach. However, there are also some potential risks for the deploy of our method in some real scenarios. As we normally have little knowledge about the extra data, the efficacy of our proposal in the heavily imbalanced situation can not be certainly reliable without the incorporation of any other imbalanced learning strategies.
	
	\bibliographystyle{plain}
	