AI in Motion

Autoencoders: Compress and Reconstruct

Deep LearningIntermediate1:266 chapters

Squeeze an image through a tiny bottleneck and rebuild it. Autoencoders learn compact representations — and can clean up noisy inputs.

📄 Illustrated notes · every chapter as a picture · printable

Shortcuts: Space play/pause · ←/→ 5 s · N/P chapter · M voice · C subtitles · F fullscreen

Quick quiz

3 questions to check your understanding.

Q1 What is an autoencoder trained to output?
Q2 Why is the bottleneck small?
Q3 How can autoencoders detect anomalies?

Go deeper

University-level written lectures in The AI Lecture Hall:

Transcript

Introduction. What if a network had to rebuild its own input, but through a very narrow gap? To succeed, it must learn what really matters. That is an autoencoder.

Compress and rebuild. The encoder squeezes a 196 pixel image into a code of just four numbers. The decoder tries to rebuild the image from those four numbers. Training minimises the difference between input and output, so the bottleneck is forced to keep only the essential information.

Denoising. A denoising autoencoder is given a noisy version of the image but trained to output the clean original. It learns what real images look like, so it can remove noise it has never seen before.

Uses. Autoencoders compress data, remove noise, and detect anomalies: if something reconstructs badly, it probably looks unlike the training data. Their codes also make useful features for other models.

VAEs. A variational autoencoder encodes each input as a small distribution instead of a single point. That keeps the latent space smooth and organised, so you can sample new codes and generate brand new images.

Recap. To recap. An encoder compresses and a decoder reconstructs. The bottleneck forces useful representations. Autoencoders denoise, compress and detect anomalies, and VAEs turn the idea into a generator.