2022 年 30 巻 p. 495-504
Autoencoders have emerged as a popular method for unsupervised anomaly detection, but they still have difficulty detecting local anomalies in real-world images due to a lack of modeling fine details. We have assessed this difficulty from a new perspective: a mismatch of training and testing objectives. Specifically, we expect autoencoders to encode an unseen locally anomalous image, reconstruct normal regions completely, and repair abnormal parts during testing, even though they merely aim to minimize total reconstruction errors during training. To address this issue, we reconstruct a potentially anomalous masked region from encoding a potentially normal unmasked region conditionally with a mask, similarly to image inpainting, during both training and testing. Because the ideal mask for anomalies is unknown in advance, we iteratively construct an adaptive mask from an earlier anomaly score of the reconstruction error. Our proposed Iterative Image Inpainting for Anomaly Detection (I3AD) updates image inpainting and masking by turns, which engenders the expected objective to maximize the anomaly score during testing. Evaluated by the MVTec Anomaly Detection dataset, our method outperformed baseline reconstruction-based methods in several categories and demonstrated remarkable improvement, especially in high-frequency textures.