LADMIM: Logical Anomaly Detection with Masked Image Modeling in Discrete Latent Space
Shunsuke Sakai, Tatushito Hasegawa, Makoto Koshino
TL;DR
This work tackles industrial anomaly detection, focusing on logical anomalies arising from relationships between multiple objects. It introduces a dual-branch framework: HVQ-Trans acts as a structural detector and tokenizer, while LAViT uses Masked Image Modeling to predict the distribution over HVQ-Trans discrete latents in masked regions, addressing positional uncertainty in complex scenes. The approach achieves strong results on MVTecLOCO (average AUROC ~0.867), demonstrating complementary strengths between reconstructive and distribution-prediction signals and highlighting the benefit of predicting discrete latent distributions over pixels. The findings illuminate the potential of MIM with discrete latent targets for logical anomaly detection and suggest paths for further improvement via masking strategies and tokenizer refinements.
Abstract
Detecting anomalies such as incorrect combinations of objects or deviations in their positions is a challenging problem in industrial anomaly detection. Traditional methods mainly focus on local features of normal images, such as scratches and dirt, making detecting anomalies in the relationships between features difficult. Masked image modeling(MIM) is a self-supervised learning technique that predicts the feature representation of masked regions in an image. To reconstruct the masked regions, it is necessary to understand how the image is composed, allowing the learning of relationships between features within the image. We propose a novel approach that leverages the characteristics of MIM to detect logical anomalies effectively. To address blurriness in the reconstructed image, we replace pixel prediction with predicting the probability distribution of discrete latent variables of the masked regions using a tokenizer. We evaluated the proposed method on the MVTecLOCO dataset, achieving an average AUC of 0.867, surpassing traditional reconstruction-based and distillation-based methods.
