Logical Anomaly Detection with Masked Image Modeling

TMLR Paper6348 Authors

31 Oct 2025 (modified: 25 Jan 2026)Under review for TMLREveryoneRevisionsBibTeXCC BY 4.0
Abstract: Detecting anomalies such as an incorrect combination of objects or deviations in their positions is a challenging problem in unsupervised anomaly detection (AD). Since conventional AD methods mainly focus on local patterns of normal images, they struggle with detecting logical anomalies that appear in the global patterns. To effectively detect these challenging logical anomalies, we introduce LADMIM (Logical Anomaly Detection with Masked Image Modeling), a novel unsupervised AD framework that harnesses the power of masked image modeling and discrete representation learning. Our core insight is that predicting the missing region forces the model to learn the long-range dependencies between patches. Specifically, we formulate AD as a mask completion task, which predicts the distribution of discrete latents in the masked region. As a distribution of discrete latents is invariant to the low-level variance in the pixel space, the model can desirably focus on the logical dependencies in the image, which improves accuracy in the logical AD. We evaluate the AD performance on five benchmarks and show that our approach achieves compatible performance without any pre-trained segmentation models. We also conduct comprehensive experiments to reveal the key factors that influence logical AD performance.
Submission Type: Long submission (more than 12 pages of main content)
Changes Since Last Submission: All changes are highlighted in red. We describe all changes in this updated manuscript. [section 2.1, 2nd paragraph] Add description about identity-shortcut [section 3.2, last paragraph] Add explanation why MSE error works for AD [section 4.3, 2nd paragraph] Delete description about anomaly leakage [section 4.3, 4th paragraph] Add description of the Tab. 4 [section 4.3, Tab.3, Fig.3, Tab. 4] Add and modify tables and figures. [section 4.3.2, Fig.4, Tab.7] Add table and figure [section 4.3.2, last paragraph] Add description of Fig.4 and Tab.7 [section 4.3.2, Tab.8/9] Modify Tab.8 and Add Tab.9 [section 4.3.3, 2nd and 3rd paragraph] Add description about adaptive masking in Tab.8. [section 4.3.4, 1st and 2nd paragraph] Add description about Tab.9 and Tab.10. [section 4.3, Fig.5] Add caption for the choice of discrete codebooks. [section 4.3.4, Fig.6] Add Fig.6. [section 4.3, Fig.7] Add a caption for the explanation of the presented images. [section 4.3.5, title] Modify title sentence. [section 4.3.5, 4th paragraph] Add description about Fig. 6. [section 4.5, Tab.12] Add Tab.12 [section 4.5, 1st paragraph] Add description about Tab.12 [section 5, 2nd paragraph] Add limitations.
Assigned Action Editor: ~Dahun_Kim1
Submission Number: 6348
Loading