Skip to content

What is Autoencoder?

An autoencoder is a neural network that learns to compress input data into a smaller representation and then reconstruct the original data from that compressed form.

It consists of two main parts: an encoder that maps the input to a low-dimensional latent space, and a decoder that tries to rebuild the input from this compressed code. Training minimizes the difference between the original input and the reconstruction.

Because it learns without labels, an autoencoder discovers useful patterns in the data on its own. The bottleneck layer forces the network to capture only the most important features.

Common variants include denoising autoencoders that remove noise and variational autoencoders that add probabilistic structure to the latent space.

Example

A photo of a handwritten digit is fed into an autoencoder; the network compresses the 784-pixel image into a 32-number code and then reconstructs a clean version of the same digit from that code.

Why it matters

Autoencoders enable unsupervised feature learning and dimensionality reduction, powering applications such as anomaly detection, image denoising, and the foundation of modern generative models.

Frequently asked questions

PCA is a linear method while an autoencoder can learn non-linear transformations, often capturing more complex structure in the data.