Variational Autoencoders
A variational autoencoder (VAE) is a generative deep learning model that learns to compress data into a compact probabilistic representation, called a latent space, and then reconstruct it. Because it learns a smooth distribution rather than fixed codes, a VAE can generate new, realistic samples by drawing points from that latent space.
A VAE has two neural networks. The encoder maps each input, such as an image, to a probability distribution in the latent space, described by a mean and a variance. The decoder takes a point sampled from that distribution and tries to rebuild the original input. Training balances accurate reconstruction against keeping the latent space well organized.
In manufacturing, a VAE trained only on images of good parts learns to reconstruct them well. When it sees a defective part, the reconstruction error is high, which makes VAEs useful for anomaly detection when defect examples are rare. VAEs are also used to generate synthetic training data and as components inside some image generation models.
A VAE differs from a standard autoencoder, which learns fixed codes and is not designed to generate new data. Compared with generative adversarial networks (GANs), VAEs are generally more stable to train but tend to produce blurrier images.