Anomaly detection is a fundamental and challenging task in computer vision, which determines whether an image contains anomaly or not. Prior works using autoencoders for anomaly detection are based on pixel-wise learning in the continuous latent space, which is inefficient since images contain a lot of redundant information. Meanwhile, for most of the anomaly detection methods, the training set only contains normal data due to the unavailability or paucity of labeled anomalous data. However, an exposure to a fraction of labeled anomalous images, even infinitesimal in size in comparison to the amount of normal data, can significantly improve the anomaly detection performance while slightly increasing labeling costs. In this paper, we propose a Semi-Supervised Vector Quantized Variational Autoencoder (ss-VQ-VAE) for anomaly detection. Our ss-VQ-VAE leverages discretized latent space embeddings of VQ-VAE [1] to reduce noise and redundancies for better reconstruction of normal data in comparison with anomalous data. At the core of ss-VQ-VAE, we introduce a new loss to incorporate a few anomalous images available to train the model. In addition, based on the VQ-VAE architecture, we further propose an anomaly score that compares the encoded features of the input with the dictionary embeddings in VQ-VAE to make more accurate predictions. Experimental results on two datasets, MVTec and the corrosion dataset, show the significance of the novelties in our method. The code is available online 1 . 1 https://github.com/RenukaSharma/ss-vq-vae
Edward K.Y. YappNgoc Chi Nam Doan
Mengmeng ZhuangAndrija Sadikovic
Yuanyuan SunLili GuoYe LiLele XuYongming Wang
Ravindra RaoSaurjyesh HotaN. L. Bhanu Murthy