An autoencoder is trained only on normal data, learning to compress each point through a narrow bottleneck and reconstruct it back out. Because it has only ever seen normal patterns, it becomes very good at reconstructing them — but poor at reconstructing anything unusual. The purple surface below is the learned manifold: everywhere the network can faithfully reproduce. Each sphere is a data point; the line from a point down to the surface is its reconstruction error — the core signal used for anomaly scoring.
Reconstruction-error thresholding is popular precisely because it needs no labelled anomalies to train on — only a clean sample of normal behaviour — which is why it's widely used for fraud, sensor-fault and network-intrusion detection where anomalies are rare and constantly evolving.
An autoencoder trained only on normal data learns a smooth "normal" manifold; every point's distance from that manifold is its reconstruction error, and points scoring above a threshold get flagged as anomalies.
The purple surface is the manifold the autoencoder has learned to reconstruct faithfully. Green points sit close to it (low error, normal); red points sit far away (high error, flagged). Raising latent bottleneck capacity too far lets the network start reconstructing anomalies too, quietly eroding detection power.
Adjust anomaly rate, bottleneck size and the error threshold, and watch flagged/caught/false-alarm counts update live. Switch to density-based scoring to compare against nearest-neighbour methods like DBSCAN, LOF and One-Class SVM.
Reconstruction-error autoencoders need no labelled anomalies to train — just a clean sample of normal behaviour — which is why they're a go-to for fraud, sensor-fault and intrusion detection where true anomalies are rare and always changing.