Semi-supervised Gaussian Mixture Model

Machine Learning
Introduced by
Nigam, K.; McCallum, A. K.; Thrun, S.; Mitchell, T.
Year
2000
Type
Generative semi-supervised classifier
Family
Machine learning

What does it do?

The Semi-supervised Gaussian Mixture Model (SS-GMM) is a generative classifier that fits a Gaussian mixture to labeled and unlabeled data with the Expectation-Maximization (EM) algorithm.

Labeled points are meant to anchor component identity to known classes, while unlabeled points contribute to the density estimates. The approach is most useful when labels are scarce and the class-conditional distributions are reasonably close to Gaussian.

The intuition behind the method

Suppose you have a few labeled examples and many unlabeled ones. A purely supervised model ignores the unlabeled data, and a purely unsupervised mixture ignores the labels. SS-GMM models the data as a mixture of Gaussian components and uses the labels to tie components to classes, while unlabeled points are assigned to components probabilistically. Each EM iteration refits the Gaussians to the whole data set, so information from the few labels can spread to the unlabeled points through the shared density structure, provided that the components actually follow the class structure.

History

The Gaussian-mixture formulation of SS-GMM has no single attributed originator in the supplied sources, and the name is a descriptive label. Closely related precedents include Nigam, McCallum, Thrun and Mitchell (2000), who applied EM to text classification with labeled and unlabeled documents, and the review of semi-supervised learning by Chapelle, Scholkopf and Zien (2006), which covers generative models and the assumptions used here.

When to use it

Choose SS-GMM when labeled examples are few, unlabeled examples are plentiful, and the features are continuous and the class-conditional distributions are roughly Gaussian, possibly after a transformation. It suits problems with a moderate number of features, where covariance estimates remain stable. Avoid it when features are mainly categorical or strongly non-Gaussian, when the number of classes is large relative to the labeled sample, or when the clusters in the data do not correspond to class boundaries, since the cluster assumption is then violated. In those situations a discriminative semi-supervised method, such as a semi-supervised SVM or label propagation, may match the data geometry better.

Limitations and considerations

  • Fit deteriorates when the class-conditional distributions are far from Gaussian, and then nonlinear transformations or kernel-based methods may be needed.
  • EM converges to a local optimum, so results depend on initialization and need several restarts.
  • In high-dimensional spaces the covariance matrices are poorly estimated unless they are regularized, constrained to be diagonal or tied, or the dimension is reduced first.
  • If the clusters in the unlabeled data do not follow the class boundaries, the unlabeled points pull the components in the wrong direction and can reduce accuracy.
  • The EM updates use all points at each iteration, so very large unlabeled sets require stochastic or mini-batch variants.

Source conditions do not replace independent scientific review or validation by an analysis engine.

Strengths

  • Uses unlabeled points in the parameter estimates, which can help when labeling is expensive.
  • Gives class posteriors from a fitted probability model. These posteriors are not guaranteed to be calibrated and can be overconfident when labels are few or the Gaussian assumption fits poorly.
  • The generative model and EM updates are explicit, so each parameter update can be checked against the formulas.
  • Handles several classes in one model rather than through one-vs-rest decomposition.
  • Multiple Gaussians per class can represent within-class multimodality.

Applications

  • Text and document classification with few labeled documents. Nigam et al. (2000) applied EM to labeled and unlabeled documents in this setting. Documents are not the continuous features this model assumes, so that work is a related precedent rather than a direct application.
  • Illustrative use case: medical image analysis where expert annotation is costly and unlabeled scans are available.
  • Illustrative use case: gene expression or other bioinformatics data with partial class labels.
  • Illustrative use case: sensor or time-series classification where ground-truth labels are sparse.
  • Illustrative use case: anomaly detection in which the density of the normal class is modeled from mostly unlabeled data.

How it works

How it works

1

Initialize the component means, covariances and mixing weights. The starting values can come from the labeled subset alone (for example, class-conditional means) or from k-means on all available data. The number of components K is commonly set to the number of known classes, although some implementations allow several components per class.

2

For each point, the formula computes the responsibility r_ik, the posterior probability that point i belongs to component k under the current parameters. For labeled points, the label constraint in the next step is applied to these responsibilities.

Formula
r_{ik} = \frac{\pi_k \mathcal{N}(x_i|\mu_k,\Sigma_k)}{\sum_j \pi_j \mathcal{N}(x_i|\mu_j,\Sigma_j)}
3

This step is where labeled data enter the model. For a labeled point with a known class, the responsibilities are restricted to the components assigned to that class, so component identities stay tied to class meaning. One simple implementation sets the responsibility of every component not assigned to the known class to zero and renormalizes over the remaining components. Without a constraint of this kind, EM on the data alone can produce clusters whose indices have no fixed relation to the labels. The exact form of the constraint is implementation-specific and should be chosen by the user.

4

The means and covariances are updated as responsibility-weighted averages over the data points. The mixing weights are updated as the average responsibility of each component over all points, labeled and unlabeled together. An unlabeled point therefore contributes fractional counts to every component, which can stabilize estimates where labeled points are few. An extra weight lambda on labeled points, if used, must be added explicitly to these updates; it is not part of the basic updates.

Formula
\mu_k = \frac{\sum_i r_{ik} x_i}{\sum_i r_{ik}},\quad \Sigma_k = \frac{\sum_i r_{ik}(x_i-\mu_k)(x_i-\mu_k)^T}{\sum_i r_{ik}}
5

Use the observed-data log-likelihood of the mixture, the sum over all points of the logarithm of the mixture density, as the convergence quantity. Repeat the E- and M-steps until its increase falls below a small tolerance chosen by the user. Because EM reaches only a local optimum, the final parameters depend on the starting values, so several random restarts are normally compared.

6

A new point x* is assigned to the component k with the largest weighted density, pi_k times the Gaussian density at x*, and that component's class label is returned. The normalized posterior probabilities across components can be reported as confidence scores, but they are only as reliable as the fitted model.

Formula
\hat{y} = \arg\max_k \pi_k \mathcal{N}(x^*|\mu_k,\Sigma_k)

Common pitfalls

  • Accepting the first converged solution from a single initialization; the final mixture can differ across starts.
  • Setting K equal to the number of classes when a class has several sub-populations, which can leave that class's density poorly represented.
  • Fitting full covariance matrices in a high-dimensional feature space with few samples per component, which makes the estimates unstable.
  • Assuming unlabeled data will help. If the cluster assumption fails, added unlabeled data can degrade classification.
  • Giving labeled and unlabeled points equal weight when unlabeled points greatly outnumber labeled ones. A labeled-point weight lambda, applied explicitly in the parameter updates, is one common way to counter this.

Frequently asked questions

How does SS-GMM differ from a fully unsupervised GMM?

An unsupervised GMM finds clusters without class labels, so its component indices have no fixed meaning. SS-GMM adds label information through the label-constraint step, which ties components to classes, while the unlabeled points still contribute to the density estimates in the M-step.

What if unlabeled data seem to hurt my accuracy?

This usually means the cluster assumption does not hold, so the natural density clusters do not match the class boundaries and the unlabeled points move the components the wrong way. Plotting the data in two dimensions (for example with PCA or t-SNE) can show whether the clusters match the classes. Increasing the weight on labeled points or switching to a discriminative semi-supervised method are the usual next steps.

How many Gaussian components should I use per class?

Start with one component per class. Add components only where a class shows clear multimodal structure. Comparing model orders on held-out labeled data is more informative than the training likelihood, but with a small labeled set the comparison is itself noisy, so interpret it cautiously.

Should I use full, diagonal, or tied covariance matrices?

Full covariance is the most flexible but needs many samples per component. A diagonal covariance, which assumes the features are independent within each component, is the more stable choice when there are many features. A tied covariance, shared by all components, reduces the number of parameters and suits classes with similar spread.

Is there a weight for labeled vs. unlabeled contributions?

Some implementations multiply the labeled contribution by a factor lambda greater than 1, because unlabeled points usually far outnumber labeled ones. Without such a weight, the unlabeled points can dominate the parameter updates and reduce the influence of the labels. The weight is an implementation choice that must be added explicitly to the update equations.

Related methods

Sources

  1. Chapelle, O., Scholkopf, B., & Zien, A. (Eds.). (2006). Semi-Supervised Learning. MIT Press.

    ISBN: 978-0-262-03358-9
  2. Nigam, K., McCallum, A. K., Thrun, S., & Mitchell, T. (2000). Text classification from labeled and unlabeled documents using EM. Machine Learning, 39(2-3), 103-134.

    Open DOI reference