# Autoencoder

> A network that packs data into a small code. Then it builds it back.

**Field:** Artificial Intelligence  
**Category:** Machine Learning  
**Also known as:** Auto-encoder

## Think of it like

Think of it like packing a small bag for a trip. You can only take what counts most.

## Definition

An autoencoder is a neural network that learns to squeeze data and rebuild it. The first half shrinks the input into a small code. The second half tries to rebuild the input from that code alone. The code is small, so the network has to keep only what matters most. The code helps to spot odd data and to make data smaller.

## Example

A factory feeds an autoencoder the sounds of healthy machines. When a machine starts to fail, the rebuilt sound is far from the real one, and an alarm goes off.

## Why it matters

It learns what normal looks like with no labels. That makes it handy for finding faults and for shrinking data.

## Common mistake

Making the code too big. Then the network just copies the input and learns nothing useful.

## Three principles

- **Squeeze.** Shrink the input to a code.
- **Rebuild.** Grow it back from the code.
- **Keep what matters.** A small code forces choices.

## Related terms

- [Dimensionality Reduction](https://learn.benibix.com/term/ai/dimensionality-reduction)
- [Anomaly Detection](https://learn.benibix.com/term/ai/anomaly-detection)
- [Neural Network](https://learn.benibix.com/term/ai/neural-network)
- [Generative Adversarial Network (GAN)](https://learn.benibix.com/term/ai/generative-adversarial-network)

## Taught in

- [GANs and Diffusion Models](https://learn.benibix.com/learn/ai-machine-learning/gans-and-diffusion-models): Machine Learning, 16/18

![A wide column of input numbers narrows to a small code in the middle, then widens again to a rebuilt copy of the input.](https://learn.benibix.com/diagrams/nn-autoencoder.svg)

---

Source: https://learn.benibix.com/term/ai/autoencoder
Author: Behnia Zarei (a developer in Vienna, Austria, who builds and teaches data, AI and business intelligence at BENIBIX)
Publisher: BENIBIX Learn (https://learn.benibix.com/)
Last updated: 2026-11-17
Licence: CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/). Quote freely with attribution.
