Transformer-Based Masked Reconstruction with Multi-Level Feature Fusion for Logical Anomaly Detection in Industrial Images

Transformer-Based Masked Reconstruction with Multi-Level Feature Fusion for Logical Anomaly Detection in Industrial Images

Seyed Hossein Mirbagheri1 Ali Mokhtarbaf2 Seyyed Javad Mirabedini3

1) M.A. Student, Department of Computer Engineering, Central Tehran Branch, Islamic Azad University, Tehran, Iran |
2) Assistant Professor, Department of Computer Engineering, Central Tehran Branch, Islamic Azad University, Tehran, Iran |
3) Assistant Professor, Department of Computer Engineering, Central Tehran Branch, Islamic Azad University, Tehran, Iran |

IOI Code : AAHD-ABKKEE
Publication : National Conference on Information Technology, Nanotechnology, Artificial Intelligence and Technological Futures Studies(itnaf.ir)
Abstract :
    Anomaly detection in industrial images is a fundamental challenge in intelligent quality control systems. The introduction of the MVTec LOCO AD dataset, which addresses logical anomalies—such as misplacement of components, incorrect assembly, and violation of spatial relationships—has attracted significant research attention. Detecting such anomalies requires an understanding of the global scene structure and semantic relationships among image components, rather than merely identifying superficial defects. In this paper, we propose a method based on masked reconstruction with a Transformer architecture and multi-level feature fusion for logical anomaly detection. By randomly masking a subset of image patches and training the model to reconstruct them based on the observable patches, the network is forced to learn normal patterns and structural relationships governing anomaly-free data. Furthermore, through the extraction and weighted combination of features from different layers of the Transformer encoder, the model simultaneously exploits local information (textures) and global information (structural relationships). Experimental results on the MVTec LOCO AD dataset demonstrate that the proposed method, with an average AUC-ROC of 0.957, outperforms CNN-based approaches as well as several Transformer-based methods. Moreover, the generated anomaly maps accurately localize regions with violated logical relationships.

Keywords : industrial anomaly detection logical anomaly masked reconstruction transformer multi level feature fusion mvtec loco ad