A latent space is the internal representation space where a model encodes observations into lower-dimensional coordinates. In an autoencoder, the middle layer maps each input to an embedding before reconstruction; in a variational autoencoder, each coordinate is represented probabilistically by a mean and variance. section 16.2.1 section 16.2.2
Latent spaces support several practical uses in representation-based outlier detection:
- Visualize embeddings when the middle layer has two or three neurons; points can reveal potential outliers, although the coordinates themselves are not intelligible. section 16.2.1
- Apply detectors such as KNN, isolation forests, convex hulls, or Mahalanobis distance directly to the encoded points. section 16.2.1
- Represent the random input to a generative adversarial network: the generator maps latent noise z to synthetic data, while a BiGAN encoder learns the inverse mapping. section 16.2.3
Two-neuron autoencoder representation
An autoencoder compresses each table row into two middle-layer values. Plotting those values produces one point per row, making unusual locations easy to inspect; the plot shows position, not an inherently meaningful interpretation of either axis. section 16.2.1

















