Introduction
normally comes with an implicit assumption: you want loads of labeled information.
On the identical time, many fashions are able to discovering construction in information with none labels in any respect.
Generative fashions, particularly, typically manage information into significant clusters throughout unsupervised coaching. When skilled on pictures, they could naturally separate digits, objects, or kinds 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)
- Dimension: 145 600 pictures (26 balanced courses)
- Possession: U.S. Nationwide Institute of Requirements and Know-how (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 presently tailor-made to the MNIST and EMNIST datasets, and isn’t designed as a general-purpose framework.
Extending it to different datasets requires diversifications (information preprocessing, structure tuning, and hyperparameter choice).Code and experiments can be found on GitHub: https://github.com/murex/gmvae-label-decoding
This selection isn’t arbitrary. EMNIST is much extra ambiguous than the classical MNIST dataset, which makes it a greater benchmark to spotlight the significance of probabilistic representations (Determine 1).
The GMVAE: Studying Construction in an Unsupervised Approach
A typical Variational Autoencoder (VAE) is a generative mannequin that learns a steady latent illustration of the information.
Extra exactly, every information level is mapped to a multivariate regular distribution , known as the posterior.
Nonetheless, this isn’t ample if we wish to carry out clustering. With a typical Gaussian prior, the latent area 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 study a posterior distribution over clusters:

Every part of the combination can then be interpreted as a cluster.
In different phrases, GMVAEs intrinsically study 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 kinds and even completely different letters, limiting the mannequin’s skill to seize fine-grained construction.
- If is simply too massive, clusters turn into too fragmented, making it more durable to estimate dependable label–cluster relationships from a restricted labeled subset.
We select as a compromise: massive sufficient to seize stylistic variations inside every class, but sufficiently small to make sure that every cluster is sufficiently represented within the labeled information (Determine 1).

Completely different stylistic variants of the identical letter are captured, akin to an uppercase F (c=36) and a lowercase f (c=0).
Nonetheless, clusters should not pure: as an example, part 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 by way of grid search.
A pure thought is to assign every information level to a single cluster.
Nonetheless, clusters themselves don’t but have semantic that means. To attach clusters to labels, we want a labeled subset.
A pure baseline for this job is the classical cluster-then-label strategy: information 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, usually by way of majority voting.
This corresponds to a tough project technique, the place every information level is mapped to a single cluster earlier than labeling.
In distinction, our strategy doesn’t depend on a single cluster project.
As an alternative, it leverages the total posterior distribution over clusters, permitting every information level to be represented as a mix of clusters somewhat 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 an excellent 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 are able to select which information factors to label.
Then, a single labeled instance per cluster can be ample — that’s, solely Ok labels in complete.
In our setting (N = 145 600, Ok = 100), this corresponds to solely 0.07% of labeled information.
Nonetheless, in observe, we assume that labeled samples are drawn at random.
Underneath this assumption, and nonetheless assuming equal cluster sizes, we are able to 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 information to cowl all clusters with 95% confidence.
We will chill out the equal-size assumption and derive a extra basic inequality, though it doesn’t admit a closed-form resolution.
Sadly, all these calculations are optimistic:
in observe, clusters should not completely pure. A single cluster could, for instance, include each “i” and “l” in comparable proportions.
And now, how will we assign labels to the remaining information?
We evaluate two other ways to assign labels to the remaining (unlabeled) information:
- Laborious decoding: we ignore the chance distributions offered by the mannequin
- Gentle decoding: we absolutely exploit them
Laborious decoding
The thought is easy.
First, we assign to every cluster a singular label through the use of 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 could “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 usually not true
That is exactly what gentle decoding goals to deal with.
Gentle decoding
As an alternative 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 identical time, the GMVAE gives, for every picture , a posterior chance vector:

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

This gentle resolution rule naturally takes under consideration:
- The mannequin’s uncertainty for , through the use of the total posterior somewhat than solely its most
- The truth that clusters should not 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 gentle decoding helps
To raised perceive why gentle decoding can outperform the laborious 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 middle of the determine 2:

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

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

which is inaccurate.
Gentle decoding as a substitute aggregates data from all believable clusters.
Intuitively, this computes a weighted vote of clusters utilizing their posterior possibilities.
On this instance, a number of clusters strongly correspond to the right label e.
Approximating the vote:

whereas

Regardless that 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 gentle rule appropriately predicts

This illustrates the important thing limitation of laborious decoding: it discards many of the data contained within the posterior distribution . Gentle decoding, alternatively, leverages the total uncertainty of the generative mannequin.
How A lot Supervision Do We Want in Follow?
Principle apart, let’s see how this works on actual information.
The purpose right here is twofold:
- to grasp what number of labeled samples are wanted to realize good accuracy
- to find out when gentle decoding is helpful
To this finish, we progressively enhance the variety of labeled samples and consider accuracy on the remaining information.
We evaluate our strategy in opposition to normal 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 effectively.
Most notably, gentle decoding considerably improves efficiency when supervision is scarce.
With solely 73 labeled samples — that means that a number of clusters should not represented — gentle decoding achieves an absolute accuracy acquire of round 18 share factors in comparison with laborious decoding.
Moreover, with 0.2% labeled information (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 information — 35 instances extra supervision — to realize an analogous efficiency.
This hanging hole highlights a key level:
Many of the construction required for classification is already discovered throughout the unsupervised section — labels are solely wanted to interpret it.
Conclusion
Utilizing a GMVAE skilled totally with out labels, we see {that a} classifier might be constructed utilizing as little as 0.2% labeled information.
The important thing commentary is that the unsupervised mannequin already learns a big a part of the construction required for classification.
Labels should not used to construct the illustration from scratch.
As an alternative, they’re solely used to interpret clusters that the mannequin has already found.
A easy laborious decoding rule already performs effectively, however leveraging the total posterior distribution over clusters gives a small but constant enchancment, particularly when the mannequin is unsure.
Extra broadly, this experiment highlights a promising paradigm for label-efficient machine studying:
- study construction first
- add labels later
- use supervision primarily to interpret representations somewhat than to assemble them
This implies that, in lots of instances, labels should not wanted to study — solely to call what has already been discovered.
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 beneath the Artistic Commons Attribution 4.0 Worldwide License. To view a duplicate of this license, go to https://creativecommons.org/licenses/by/4.0/

