An autoencoder is trained only on normal data to compress each 8-channel sensor reading x through a narrow bottleneck and reconstruct it as x̂. The training loss is the mean squared reconstruction error:
L(x) = (1/n) Σᵢ (xᵢ − x̂ᵢ)²
Encoder: h = tanh(W₁x + b₁) (n → bottleneck)
Decoder: x̂ = W₂h + b₂ (bottleneck → n)
Trained by gradient descent: minimize E[L(x)] over normal x only
Because the bottleneck is narrower than the 8 input channels, the network can only learn the correlation structure shared across channels (here, two hidden sinusoidal factors that drive all 8 sensors together) — it cannot memorize every channel independently. When a real anomaly hits, it typically breaks that correlation by moving one or a few channels independently of the rest. The reconstruction snaps back toward the learned normal manifold, so the corrupted channels show a large per-channel error (xᵢ − x̂ᵢ)² while the untouched channels stay near zero.
- Bottleneck width — a wider bottleneck reconstructs everything well (including anomalies, hurting detection); a narrower one forces stronger compression and sharper anomaly contrast, but can under-fit normal data too.
- Per-channel bars — the front (actual) and back (reconstructed) column pair for each sensor; a bar's color runs green→red with that channel's own squared error, so the reddest bar is the diagnosed root cause, not just a single flagged/not-flagged bit.
- Adaptive threshold — mean + 3σ of the MSE measured on training-time (assumed normal) samples, recomputed as the stream evolves, the same rule production anomaly detectors use.
- Training toggle — freezes the weights so you can compare a still-learning network against a converged one on the same anomaly.
Real-world relevance: this per-feature attribution is what turns a bare "anomaly score" into an actionable alert in manufacturing (which sensor drifted?), IT operations (which metric spiked?) and fraud systems (which field is inconsistent?).