Cesar Salcedo

Unsupervised Image Anomaly Detection

Apr 19, 2022

AlvarezLab at University of Rhode Island. Part of the Research Experience for Peruvian Undergraduates (REPU) program.
This work aimed to improve on the task of unsupervised image anomaly detection, where the learning algorithm is only given a set of unlabeled "normal" images (in-distribution dataset) and is expected to correctly tell between normal and anomalous (out-of-distribution) images. Based on the best solutions at the time, our first attempt followed the approach of using a generative models to learn the underlying distribution of images and then use the trained network to estimate the likelihood of new images. The following image shows the results of a Deep Convolutional Generative Adversarial Network (DCGAN) trained on a dataset of satelite ocean imagery.
(left) Images from the actual dataset. (right) Images generated by DCGAN.
(left) Images from the actual dataset. (right) Images generated by DCGAN.
At first we came across a very counterintuitive observation: in some ocassions, the likelihood estimation of the in-distribution dataset was lower than that of the out-of-distribution dataset. For example, in one experiment we trained a model on a set of 9 out of 10 classes from CIFAR dataset. After comparing the likelihood of the dataset conformed by the CIFAR class left behind vs. the likelihood of SVHN dataset we observed that SVHN was assigned higher likelihood than CIFAR. The following plot shows the likelihood estimation of both datasets.
Likelihood estimation of in-distribution vs. out-of-distribution datasets.
Likelihood estimation of in-distribution vs. out-of-distribution datasets.
Further research lead us to switch generative networks: instead of GANs we then used Normalizing Flows. The results of this project are detailed in the extended abstract of a paper that was left unfinished.

References