  This paper presents a fast and principled approach for solving the visual
anomaly detection and segmentation problem. In this setup, we have access to
only anomaly-free training data and want to detect and identify anomalies of an
arbitrary nature on test data. We propose the application of linear statistical
dimensionality reduction techniques on the intermediate features produced by a
pretrained DNN on the training data, in order to capture the low-dimensional
subspace truly spanned by said features. We show that the \emph{feature
reconstruction error} (FRE), which is the $\ell_2$-norm of the difference
between the original feature in the high-dimensional space and the pre-image of
its low-dimensional reduced embedding, is extremely effective for anomaly
detection. Further, using the same feature reconstruction error concept on
intermediate convolutional layers, we derive FRE maps that provide pixel-level
spatial localization of the anomalies in the image (i.e. segmentation).
Experiments using standard anomaly detection datasets and DNN architectures
demonstrate that our method matches or exceeds best-in-class quality
performance, but at a fraction of the computational and memory cost required by
the state of the art. It can be trained and run very efficiently, even on a
traditional CPU.
