AI in Motion

Deep LearningIntermediate1:26 video6 chapters

Autoencoders: Compress and Reconstruct — lecture notes

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

▶ Watch the animated lecture

0:001. Introduction

Introduction — Autoencoders: Compress and Reconstruct

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.

0:122. Compress and rebuild

Compress and rebuild — Autoencoders: Compress and Reconstruct

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.

0:313. Denoising

Denoising — Autoencoders: Compress and Reconstruct

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.

0:464. Uses

Uses — Autoencoders: Compress and Reconstruct

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.

0:595. VAEs

VAEs — Autoencoders: Compress and Reconstruct

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.

1:146. Recap

Recap — Autoencoders: Compress and Reconstruct

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.

Key takeaways

  • An autoencoder learns to reconstruct its input through a narrow bottleneck.
  • The encoder produces a compact code; the decoder rebuilds the input.
  • Denoising autoencoders learn to map noisy inputs to clean outputs.
  • Variational autoencoders learn a smooth latent space for generation.

Check yourself

  1. What is an autoencoder trained to output?
    Show answer

    Its own input (or a clean version of it) — The target is the input itself.

  2. Why is the bottleneck small?
    Show answer

    To force the network to keep only essential information — A narrow code prevents simply copying the input.

  3. How can autoencoders detect anomalies?
    Show answer

    Unusual inputs reconstruct poorly — High reconstruction error signals something unlike the training data.

Go deeper

© 2026 Janin A Apurba, CSE, AUST · Advanced ICT Officer, CNRS-UNHCR. All rights reserved. Notes for the animated lecture at https://ai-in-motion.vercel.app/watch/autoencoders.html