Autoencoder
An autoencoder is a neural network trained to compress its input into a compact code and then rebuild the original from that code, learning useful features without needing labelled data.
An autoencoder has two halves. The encoder turns an input, such as an image, into a short list of numbers called a code or latent representation. The decoder tries to rebuild the original input from that code. Training simply measures how far the rebuilt version is from the original and adjusts both halves to shrink the gap. Because the input serves as its own target, no human labelling is needed.
The trick is usually a bottleneck. If the code has far fewer numbers than the input, the network cannot just copy what it is given; it has to learn which features matter most and discard the rest. In a well-known 2006 paper in Science, Geoffrey Hinton and Ruslan Salakhutdinov showed that a deep autoencoder with a 30-number code reconstructed images more accurately than the classic statistical method, principal component analysis, using the same number of components. The idea itself goes back to the 1980s, when researchers trained networks in what they called auto-association mode, and in 1989 Baldi and Hornik connected simple autoencoders to principal component analysis.
Several variants are common. A denoising autoencoder is fed deliberately corrupted inputs and learns to recover the clean version. A sparse autoencoder allows only a few of its internal units to be active at once. A variational autoencoder, introduced by Diederik Kingma and Max Welling in 2013, learns a probabilistic code that can be sampled to generate new data.
The uses follow from the design. Autoencoders compress data and reduce its dimensions for analysis. They can flag anomalies, such as unusual sensor readings, because inputs unlike the training data tend to be rebuilt badly, although some autoencoders reconstruct anomalies well enough to miss them. They clean up noisy images, including in medical imaging. They also sit inside generative AI: Stable Diffusion uses a variational autoencoder to compress images into a smaller latent space where the generation takes place, then decode the result back into pixels.
Autoencoders rarely make headlines by name, but the encode, compress and decode pattern they established runs through modern AI, from image generators to interpretability research.
Autoencoders are used to compress data, reduce its dimensions for analysis, remove noise from images and detect anomalies by spotting inputs that the model rebuilds poorly. Variational autoencoders also form part of image generators such as Stable Diffusion, where they translate between pixels and a compact latent space. It is usually described as unsupervised, because it learns from unlabelled data. The input acts as its own target: the network is scored on how well it reconstructs what it was given. This is why the approach is also discussed under self-supervised learning. A standard autoencoder maps each input to a single fixed code and is mainly used for compression and feature learning. A variational autoencoder maps each input to a probability distribution over codes, which makes its latent space smooth enough to sample from, so it can generate new examples as well as reconstruct old ones. A linear autoencoder with one hidden layer learns the same subspace as principal component analysis, although its weights are not the principal components themselves. Adding non-linear layers lets an autoencoder capture curved, more complex structure in the data, which is why deep autoencoders can compress images more faithfully than principal component analysis with the same number of components.Common questions
What is an autoencoder used for?
Is an autoencoder supervised or unsupervised?
What is the difference between an autoencoder and a variational autoencoder?
How is an autoencoder different from principal component analysis?
Search for "autoencoder tutorial", "denoising autoencoder" or "variational autoencoder explained" to see how they are built and used. Reliable sources include machine learning textbooks and university course notes, the framework tutorials published by PyTorch and TensorFlow, and the original papers. When reading claims about anomaly detection, look for evidence on real data, since performance depends heavily on how the reconstruction threshold is set.Finding more
Working out what this means for your business?
Aileron Shift builds the systems behind this site: AI newsrooms that research, write and publish on their own, marketing automation and WordPress hosting for companies that need to move faster than their competitors.