Introduction
often comes with an implicit assumption: you want loads of labeled knowledge.
On the similar time, many fashions are able to discovering construction in knowledge with none labels in any respect.
Generative fashions, particularly, typically set up knowledge into significant clusters throughout unsupervised coaching. When skilled on photos, they could naturally separate digits, objects, or types of their latent representations.
This raises a easy however vital query:
If a mannequin has already found the construction of the information with out labels, how a lot supervision is definitely wanted to show it right into a classifier?
On this article, we discover this query utilizing a Gaussian Combination Variational Autoencoder (GMVAE) (Dilokthanakul et al., 2016).
Dataset
We use the EMNIST Letters dataset launched by Cohen et al. (2017), which is an extension of the unique MNIST dataset.
- Supply: NIST Particular Database 19
- Processed by: Cohen et al. (2017)
- Measurement: 145 600 photos (26 balanced lessons)
- Possession: U.S. Nationwide Institute of Requirements and Expertise (NIST)
- License: Public area (U.S. authorities work)
Disclaimer
The code offered on this article is meant for analysis and reproducibility functions solely.
It’s at present tailor-made to the MNIST and EMNIST datasets, and isn’t designed as a general-purpose framework.
Extending it to different datasets requires variations (knowledge preprocessing, structure tuning, and hyperparameter choice).Code and experiments can be found on GitHub:
This alternative will not be arbitrary. EMNIST is much extra ambiguous than the classical MNIST dataset, which makes it a greater benchmark to focus on the significance of probabilistic representations (Determine 1).
The GMVAE: Studying Construction in an Unsupervised Approach
A regular Variational Autoencoder (VAE) is a generative mannequin that learns a steady latent illustration of the information.
Extra exactly, every knowledge level is mapped to a multivariate regular distribution , known as the posterior.
Nonetheless, this isn’t adequate if we need to carry out clustering. With a typical Gaussian prior, the latent house tends to stay steady and doesn’t naturally separate into distinct teams.
That is the place GMVAE come into play.
A GMVAE extends the VAE by changing the prior with a mix of parts, the place is chosen beforehand.
To realize this, a brand new discrete latent variable is launched:
This permits the mannequin to be taught a posterior distribution over clusters:

Every element of the combination can then be interpreted as a cluster.
In different phrases, GMVAEs intrinsically be taught clusters throughout coaching.
The selection of controls a trade-off between expressivity and reliability.
- If is simply too small, clusters are likely to merge distinct types and even completely different letters, limiting the mannequin’s skill to seize fine-grained construction.
- If is simply too giant, clusters turn into too fragmented, making it tougher to estimate dependable label–cluster relationships from a restricted labeled subset.
We select as a compromise: giant sufficient to seize stylistic variations inside every class, but sufficiently small to make sure that every cluster is sufficiently represented within the labeled knowledge (Determine 1).

Completely different stylistic variants of the identical letter are captured, reminiscent of an uppercase F (c=36) and a lowercase f (c=0).
Nonetheless, clusters aren’t pure: as an example, element c=73 predominantly represents the letter “T”, but in addition consists of samples of “J”.
Turning Clusters Right into a Classifier
As soon as the GMVAE is skilled, every picture is related to a posterior distribution over clusters: .
In observe, when the variety of clusters is unknown, it may be handled as a hyperparameter and tuned through grid search.
A pure thought is to assign every knowledge level to a single cluster.
Nonetheless, clusters themselves don’t but have semantic which means. To attach clusters to labels, we’d like a labeled subset.
A pure baseline for this process is the classical cluster-then-label strategy: knowledge are first clustered utilizing an unsupervised technique (e.g. k-means or GMM), and every cluster is assigned a label primarily based on the labeled subset, sometimes through majority voting.
This corresponds to a tough project technique, the place every knowledge level is mapped to a single cluster earlier than labeling.
In distinction, our strategy doesn’t depend on a single cluster project.
As a substitute, it leverages the complete posterior distribution over clusters, permitting every knowledge level to be represented as a mix of clusters slightly than a single discrete project.
This may be seen as a probabilistic generalization of the cluster-then-label paradigm.
What number of labels are theoretically required?
In a great situation, clusters are completely pure: every cluster corresponds to a single class. In such a case, clusters would even have equal sizes.
Nonetheless on this best setting, suppose we will select which knowledge factors to label.
Then, a single labeled instance per cluster could be adequate — that’s, solely Ok labels in whole.
In our setting (N = 145 600, Ok = 100), this corresponds to solely 0.07% of labeled knowledge.
Nonetheless, in observe, we assume that labeled samples are drawn at random.
Underneath this assumption, and nonetheless assuming equal cluster sizes, we will derive an approximate decrease sure on the quantity of supervision wanted to cowl all clusters with a selected stage of confidence.
In our case (), we receive a minimal of roughly 0.6% labeled knowledge to cowl all clusters with 95% confidence.
We are able to loosen up the equal-size assumption and derive a extra normal inequality, though it doesn’t admit a closed-form resolution.
Sadly, all these calculations are optimistic:
in observe, clusters aren’t completely pure. A single cluster might, for instance, include each “i” and “l” in comparable proportions.
And now, how will we assign labels to the remaining knowledge?
We examine two other ways to assign labels to the remaining (unlabeled) knowledge:
- Onerous decoding: we ignore the chance distributions offered by the mannequin
- Tender decoding: we absolutely exploit them
Onerous decoding
The concept is easy.
First, we assign to every cluster a singular label by utilizing the labeled subset.
Extra exactly, we affiliate every cluster with probably the most frequent label among the many labeled factors assigned to it.
Now, given an unlabeled picture , we assign it to its probably cluster:

We then assign to the label related to this cluster, i.e. :

Nonetheless, this strategy suffers from two main limitations:
1. It ignores the mannequin’s uncertainty for a given enter (the GMVAE might “hesitate” between a number of clusters)
2. It assumes that clusters are pure, i.e. that every cluster corresponds to a single label — which is mostly not true
That is exactly what comfortable decoding goals to deal with.
Tender decoding
As a substitute of assuming that every cluster corresponds to a single label, we use the labeled subset to estimate, for every label , a chance vector of measurement :

This vector represents empirically the chance of belonging to every cluster , on condition that the true label is , which is definitely an empirical illustration of !
On the similar time, the GMVAE offers, for every picture , a posterior chance vector:

We then assign to the label that maximizes the similarity between and :

This comfortable resolution rule naturally takes under consideration:
- The mannequin’s uncertainty for , by utilizing the complete posterior slightly than solely its most
- The truth that clusters aren’t completely pure, by permitting every label to be related to a number of clusters
This may be interpreted as evaluating with , and deciding on the label whose cluster distribution greatest matches the posterior of !
A concrete instance the place comfortable decoding helps
To higher perceive why comfortable decoding can outperform the arduous rule, let’s take a look at a concrete instance (Determine 2).

On this case, the true label is e. The mannequin produces the cluster posterior distribution proven within the heart of the determine 2:

for clusters 76, 40, 35, 81, 61 respectively.
The arduous rule solely considers probably the most possible cluster:

Since cluster 76 is generally related to the label c, the arduous prediction turns into

which is inaccurate.
Tender decoding as an alternative aggregates info from all believable clusters.
Intuitively, this computes a weighted vote of clusters utilizing their posterior chances.
On this instance, a number of clusters strongly correspond to the right label e.
Approximating the vote:

whereas

Though cluster 76 clearly dominates the posterior, many of the chance mass really lies on clusters related to the right label. By aggregating these indicators, the comfortable rule accurately predicts

This illustrates the important thing limitation of arduous decoding: it discards many of the info contained within the posterior distribution . Tender decoding, then again, leverages the complete uncertainty of the generative mannequin.
How A lot Supervision Do We Want in Apply?
Idea apart, let’s see how this works on actual knowledge.
The purpose right here is twofold:
- to know what number of labeled samples are wanted to attain good accuracy
- to find out when comfortable decoding is helpful
To this finish, we progressively improve the variety of labeled samples and consider accuracy on the remaining knowledge.
We examine our strategy in opposition to customary baselines: logistic regression, MLP, and XGBoost.
Outcomes are reported as imply accuracy with confidence intervals (95%) over 5 random seeds (Determine 3).

Even with extraordinarily small labeled subsets, the classifier already performs surprisingly nicely.
Most notably, comfortable decoding considerably improves efficiency when supervision is scarce.
With solely 73 labeled samples — which means that a number of clusters aren’t represented — comfortable decoding achieves an absolute accuracy achieve of round 18 share factors in comparison with arduous decoding.
In addition to, with 0.2% labeled knowledge (291 samples out of 145 600 — roughly 3 labeled examples per cluster), the GMVAE-based classifier already reaches 80% accuracy.
Compared, XGBoost requires round 7% labeled knowledge — 35 instances extra supervision — to attain an identical efficiency.
This putting hole highlights a key level:
A lot of the construction required for classification is already realized throughout the unsupervised part — labels are solely wanted to interpret it.
Conclusion
Utilizing a GMVAE skilled fully with out labels, we see {that a} classifier might be constructed utilizing as little as 0.2% labeled knowledge.
The important thing commentary is that the unsupervised mannequin already learns a big a part of the construction required for classification.
Labels aren’t used to construct the illustration from scratch.
As a substitute, they’re solely used to interpret clusters that the mannequin has already found.
A easy arduous decoding rule already performs nicely, however leveraging the complete posterior distribution over clusters offers a small but constant enchancment, particularly when the mannequin is unsure.
Extra broadly, this experiment highlights a promising paradigm for label-efficient machine studying:
- be taught construction first
- add labels later
- use supervision primarily to interpret representations slightly than to assemble them
This implies that, in lots of circumstances, labels aren’t wanted to be taught — solely to call what has already been realized.
All experiments had been performed utilizing our personal implementation of GMVAE and analysis pipeline.
References
- Cohen, G., Afshar, S., Tapson, J., & van Schaik, A. (2017). EMNIST: Extending MNIST to handwritten letters.
- Dilokthanakul, N., Mediano, P. A., Garnelo, M., Lee, M. C., Salimbeni, H., Arulkumaran, Ok., & Shanahan, M. (2016). Deep Unsupervised Clustering with Gaussian Combination Variational Autoencoders.
© 2026 MUREX S.A.S. and Université Paris Dauphine — PSL
This work is licensed underneath the Artistic Commons Attribution 4.0 Worldwide License. To view a replica of this license, go to



