We address the problem of automatically detecting anomalies in images, i.e., patterns that do not conform to those appearing in a reference training set. This is a very important feature for enabling an intelligent system to autonomously check the validity of acquired data, thus performing a preliminary, automatic, diagnosis.
We approach this problem in a patch-wise manner, by learning a model to represent patches belonging to a training set of normal images. Here, we consider a model based on sparse representations, and we show that jointly monitoring the sparsity and the reconstruction error of such representation substantially improves the detection performance with respect to other approaches leveraging sparse models. As an illustrative application, we consider the detection of anomalies in scanning electron microscope (SEM) images, which is essential for supervising the production of nanofibrous materials.