Autoencoder

An autoencoder is a neural network that learns to compress its input into a compact code and then reconstruct it. The bottleneck forces the model to capture the most important structure of the data, which makes autoencoders useful for representation learning, denoising, and anomaly detection.

What is an autoencoder?

An autoencoder is a network with two halves: an encoder that maps the input down to a compact representation, and a decoder that reconstructs the input from that representation. Because the code in the middle is smaller than the input, the model cannot simply copy the data through and must learn to keep only its most informative structure.
That learned code is a useful embedding, and the reconstruction behavior itself is informative, since inputs the model reconstructs poorly are often unusual.

Key takeaways

  • An autoencoder compresses input to a bottleneck, then reconstructs it.
  • The bottleneck forces it to learn compact, meaningful representations.
  • It supports denoising, anomaly detection, and embedding learning.

How it works

The network is trained to minimize the difference between its input and its reconstruction. The encoder learns to distill the input into a low-dimensional code, and the decoder learns to rebuild the input from it. Variants add useful properties: denoising autoencoders reconstruct clean data from corrupted input, and variational autoencoders learn a structured, probabilistic code suitable for generation.

Why it matters

Autoencoders are a simple, label-free way to learn representations and to flag anomalies, since a high reconstruction error points to data unlike anything seen in training. That makes them handy for surfacing outliers and rare cases in large datasets, a common curation need.

Frequently asked questions

What is the bottleneck in an autoencoder?

It is the compact middle representation that is smaller than the input, which forces the model to compress and keep only essential information.

How are autoencoders used for anomaly detection?

Inputs similar to the training data reconstruct well, while unusual inputs reconstruct poorly, so a high reconstruction error signals a likely anomaly.

Related terms

Last updated July 9, 2026

Building visual or physical AI?

Let's talk.