🤖 AI Summary
To address the challenge of jointly modeling long-range dependencies and ensuring computational efficiency in multi-class unsupervised anomaly detection—where CNNs and Transformers exhibit inherent trade-offs—this paper proposes MambaAD, the first framework to introduce state space models (SSMs), specifically the Mamba architecture, into this task. We design a Locality-Enhanced State Space (LSS) decoder that integrates five scanning strategies, eight-directional Hilbert curve serialization, and multi-kernel convolution to enable synergistic global-local representation learning. Additionally, MambaAD leverages a pre-trained encoder and a multi-scale feature fusion mechanism. Extensive experiments across six benchmark datasets and seven evaluation metrics demonstrate consistent superiority over CNN- and Transformer-based baselines, achieving new state-of-the-art performance. The code and pre-trained models are publicly released.
📝 Abstract
Recent advancements in anomaly detection have seen the efficacy of CNN- and transformer-based approaches. However, CNNs struggle with long-range dependencies, while transformers are burdened by quadratic computational complexity. Mamba-based models, with their superior long-range modeling and linear efficiency, have garnered substantial attention. This study pioneers the application of Mamba to multi-class unsupervised anomaly detection, presenting MambaAD, which consists of a pre-trained encoder and a Mamba decoder featuring (Locality-Enhanced State Space) LSS modules at multi-scales. The proposed LSS module, integrating parallel cascaded (Hybrid State Space) HSS blocks and multi-kernel convolutions operations, effectively captures both long-range and local information. The HSS block, utilizing (Hybrid Scanning) HS encoders, encodes feature maps into five scanning methods and eight directions, thereby strengthening global connections through the (State Space Model) SSM. The use of Hilbert scanning and eight directions significantly improves feature sequence modeling. Comprehensive experiments on six diverse anomaly detection datasets and seven metrics demonstrate state-of-the-art performance, substantiating the method's effectiveness. The code and models are available at https://lewandofskee.github.io/projects/MambaAD.