A semi-supervised classifier learns from a few labeled images and many unlabeled ones. It works best when its decision boundaries fall in the empty gaps between groups of data rather than cutting through them. One established way to push boundaries into those gaps is adversarial: a generator network produces fake images, and the classifier learns to recognise them as an extra class. The theory behind "bad GAN" semi-supervised learning says that the useful fakes are not realistic images. They are points in the low-density complement of the data, meaning the regions between classes where real data is rare. Finding that complement currently requires two expensive and fragile things: a pixel-space likelihood model that says where data is rare, and an adversarial generator trained to land there.
This proposal replaces both with a single frozen model that has been trained in two decoupled steps. The first step is an autoencoder that learns where the data lies, meaning the low-dimensional surface, or manifold, that the images occupy. The second step is a density model trained only on the autoencoder's compact codes, which learns how much data lies where on that surface. With these two pieces, complement points can be written down directly. Points between classes on the manifold are latent codes where the learned density dips. Points off the manifold are images pushed away from the learned surface. The classifier then trains against these constructed fakes with no generator and no minimax game. The claim is that this recovers or exceeds the benefit of an adversarially trained bad generator, at a fraction of the cost and instability. The proposal also asks a sharper question that the decomposition makes answerable for the first time: which half of the complement, on-manifold gaps or off-manifold points, actually drives the accuracy gain.
Core Claim
Good Semi-supervised Learning That Requires a Bad GAN (BadGAN) proves that a generator matching the data distribution gives the classifier nothing. It then builds a generator that is steered away from high-density regions using a pretrained PixelCNN++, a pixel-space autoregressive likelihood model. Diagnosing and Fixing Manifold Overfitting in Deep Generative Models proves that exactly this kind of full-dimensional likelihood model can reach arbitrarily high training likelihood without learning the relative density across the manifold. The same paper proves that a two-step procedure, an autoencoder followed by a density model trained on the latent codes, removes the pathology. BadGAN's density mask is therefore built on the object that manifold-overfitting theory says is unreliable. The remedy that theory prescribes is precisely the ingredient needed to define the complement.
The less obvious step is this. Once geometry and density are separated, the adversarial generator is redundant. A decoupled model already exposes the two coordinates of the complement: distance from the manifold, and density along it. The complement can be sampled by construction rather than learned by a second network.
The closest existing idea would swap PixelCNN++ for a two-step density model inside the BadGAN loop. We deliberately do not propose that, because the simpler non-adversarial version should work at least as well and is cheaper. Our method is therefore a frozen decoupled model, a deterministic complement sampler, and a K+1 classifier, where K+1 means the K real classes plus one "fake" class as in Improved Techniques for Training GANs. The adversarial variant appears only as a baseline.
Research Program
Stage one: learn the geometry. An encoder $g$ and decoder $G$ are trained purely by reconstruction on all labeled and unlabeled training images. The latent dimension $d$ is swept over 16–128. This follows the generalized-autoencoding step of the manifold-overfitting paper and the manifold phase of Flows for simultaneous manifold learning and density estimation.
Stage two: learn the density. With the autoencoder frozen, a normalizing flow is fit to the latent codes $z=g(x)$. A normalizing flow is an invertible network that gives exact likelihoods. The flow gives a density $q(z)$ on the manifold's coordinates. As a secondary geometry we will also try the injective-flow route of Trumpets: Injective Flows for Inference and Inverse Problems, which decouples an MSE phase from a likelihood phase and provides an exact inverse.
Stage three: construct the complement. Complement samples come in two families.
On-manifold gap samples. We draw pairs of unlabeled codes $z_a, z_b$ and find the lowest-density point on the straight path between them: $$ z^\star=\arg\min_{t\in[0,1]} \log q\big((1-t)z_a+t z_b\big), $$ Here $t$ indexes position along the path. We keep $z^\star$ only when its log-density falls a margin $\Delta$ below the lower of the two endpoints' log-densities, so that pairs within a single cluster (no real valley) are discarded. This requires no labels. The kept points are decoded to $G(z^\star)$.
Off-manifold samples. We take a real image $x$ and add noise projected onto the directions orthogonal to the decoder's tangent space at $g(x)$. The tangent space is estimated from a few Jacobian-vector products. The noise scale is calibrated so that the perturbed image's reconstruction error exceeds the 99th percentile on real data.
Stage four: train the classifier. A standard K+1 classifier is trained on four sources. Labeled images count as their class. Unlabeled images count as "any real class". Complement samples count as class K+1. Decoder reconstructions $G(g(x))$ of real images also count as "any real class".
This last source is a design choice we consider essential. Decoded samples are smoother than real images, so without it the classifier could learn the shortcut "blurry means fake". That shortcut would teach it nothing about class gaps. Conditional-entropy minimization on unlabeled data is included as in BadGAN, so the classifier-side objective matches BadGAN's and the comparison isolates the source of the fakes.
Analysis. The analysis asks where the complement samples lie. We measure their density under the latent flow and under an ambient PixelCNN++. We then check whether the two estimators disagree in the way manifold-overfitting theory predicts: the ambient model assigning high likelihood to off-density spikes. We also look at the classifier's margin along the path between two classes. If the method works, the classifier's confidence should drop sharply at $z^\star$ rather than somewhere arbitrary along the path.
Baselines
The naive reference is the same classifier trained only on the labeled images. It uses identical architecture, augmentation, and tuning budget. It tells us how much any unlabeled-data mechanism buys. We add a second reference: the K+1 classifier trained with labeled and unlabeled data plus conditional entropy but no fake class. This shows how much of any gain comes from entropy minimization alone.
The strongest existing competitor on this question is BadGAN Good Semi-supervised Learning That Requires a Bad GAN. It is the method whose theory motivates us and whose mechanism we replace. It reports 4.25% error on SVHN with 1,000 labels, 14.41% error on CIFAR-10 with 4,000 labels, and 79.5 test errors on MNIST with 100 labels. We will cite those numbers and also re-run BadGAN using the classifier architecture, epoch budget, and hyperparameter search budget of our method. Our method's budget includes the cost of stage one and stage two; BadGAN's includes its PixelCNN++ and generator. Beating it means lower mean error over five seeds on SVHN and CIFAR-10 at matched classifier capacity and no more total GPU hours. Matching its error at substantially lower compute and seed variance would count as a partial win worth reporting.
The standard adversarial reference is the feature-matching K+1 GAN of Improved Techniques for Training GANs. It reports 8.11% error on SVHN with 1,000 labels, and BadGAN cites a vanilla GAN semi-supervised result of 18.63% on CIFAR-10.
Two further baselines use prior methods on the same data. The first is manifold regularization from Semi-Supervised Learning With GANs: Revisiting Manifold Regularization, which penalizes the classifier for changing its output along small latent perturbations of a GAN generator. We run it with our frozen decoder in place of the jointly trained generator. That is exactly the "train first, then regularize a separate classifier" variant its authors suggested. No explicit error rate for it is found in the file on Lacuna. The second is a latent-space version of FlowGMM, Semi-Supervised Learning with Normalizing Flows, which classifies with a class-per-component Gaussian mixture in a flow's latent space. We fit it on our stage-one codes, so that it uses the same geometry but classifies by density rather than via a fake class.
Three ablations isolate the key ingredient. The first uses complement points chosen as random latent codes with no density criterion. The second chooses complement points using the ambient PixelCNN++ density instead of the latent flow. The third uses each complement family, on-manifold gaps and off-manifold points, alone. A fourth ablation removes the real-reconstruction inputs to test the blur shortcut.
Why not just…?
Why not just keep BadGAN and swap in a two-step density model for the PixelCNN++ mask? This is the obvious combination. It would probably help, because the manifold-overfitting results suggest the latent mask is more faithful than the pixel one. But it keeps the adversarial generator, and with it the instability and early-training sensitivity that BadGAN itself reports. Once a latent density exists, low-density points can be located directly, so the generator only relearns what the density already states. We include this hybrid as an extra baseline. If it clearly beats the non-adversarial sampler, we would conclude that the generator's diversity matters beyond density targeting. That would be a genuine finding against our simplification.
Why not just use consistency regularization such as the Π-model, which penalizes prediction changes under random perturbations? The file offers indirect evidence that density modeling adds something: BadGAN reports outperforming the Π-model on SVHN, and FlowGMM beats it on AG-News with 82.1% versus 80.2%. It contains no reported result on Lacuna for modern augmentation-heavy consistency methods on these splits. We are honest that such methods may well beat every generative approach here in raw accuracy. Our aim is instead to show that the generative complement mechanism can be made cheap and stable. We will also test whether it adds to consistency regularization when the two are combined, which is the practically relevant question.
Why not just classify in the decoupled latent space with a Gaussian mixture, skipping the fake class entirely? This is the most serious threat. It uses the same geometry and density and is simpler still. The difference is that a mixture classifier forces each class to be a single Gaussian blob in a latent space that was never shaped for classes. Our K+1 classifier works in pixel space with an unrestricted network and uses the latent density only to supply training signal. The latent-FlowGMM baseline settles this directly. If it matches our method, the conclusion is that decoupled density alone suffices and the fake class is unnecessary. We would report that outcome as the result.
Why not just apply manifold regularization with a frozen generator, as Lecouat et al. suggested? That regularizer tells the classifier to be smooth along the manifold, but it is blind to density. It treats a cluster centre and an inter-class gap identically, so it cannot say where boundaries should go. Running it on our exact frozen decoder isolates whether the density-guided complement adds anything over geometry-only smoothing.
Proposed Experiments and Decisive Checks
We start on the synthetic two-dimensional "two circles" and "four spins" data used by BadGAN, where decision boundaries and complement points can be plotted directly. We then run MNIST with 100 labels, SVHN with 1,000 labels, and CIFAR-10 with 4,000 labels, using the standard splits. We report mean and standard deviation of test error over five seeds, total GPU hours including all pretraining, and expected calibration error. FlowGMM's calibration reporting (ECE 0.108 reduced to 0.038 on CIFAR-10) shows that density-based methods can differ from discriminative ones on this axis.
The first decisive check is the family ablation. The theory predicts that on-manifold gap samples carry most of the benefit. If off-manifold samples alone match the full method, then BadGAN's gain would really come from off-manifold contrast, and the density model would be unnecessary. That would be a clean negative result about what "bad" generators are doing.
The second check compares ambient and latent density for choosing complement points at equal sample counts. If the ambient mask is as good, the manifold-overfitting argument does not bite at this scale, and the motivation weakens to cost alone.
The third check is the blur control. Removing reconstructions from the real class should hurt, and the trained classifier's fake-class probability on real reconstructions should be near zero when they are included. If it is not, the classifier is keying on decoder artifacts, and the reported gains should not be trusted.
Finally, we sweep the latent dimension $d$. Too small a $d$ should merge classes and erase valleys, and too large should re-introduce spiky densities. Locating that window tells practitioners how to set the method up on new data.
References
- Good Semi-supervised Learning That Requires a Bad GAN
- Diagnosing and Fixing Manifold Overfitting in Deep Generative Models
- Improved Techniques for Training GANs
- Flows for simultaneous manifold learning and density estimation
- Trumpets: Injective Flows for Inference and Inverse Problems
- Semi-Supervised Learning With GANs: Revisiting Manifold Regularization
- Semi-Supervised Learning with Normalizing Flows