{"about":{"site":"https://codewithpapers.app","non_affiliation":"Code with Papers and Syntology are not affiliated with, endorsed by, or sponsored by Papers with Code, Meta, or the pwc-archive mirror.","licence":"CC BY-SA 4.0","licence_url":"https://creativecommons.org/licenses/by-sa/4.0/legalcode","attribution":"https://codewithpapers.app/attribution","modified":"archive material modified by Syntology; see the attribution page"},"url":"/paper/mambaad-exploring-state-space-models-for","title":"MambaAD: Exploring State Space Models for Multi-class Unsupervised Anomaly Detection","arxiv_id":"2404.06564","date":"2024-04-09","proceeding":null,"authors":["Haoyang He","Yuhu Bai","Jiangning Zhang","Qingdong He","Hongxu Chen","Zhenye Gan","Chengjie Wang","Xiangtai Li","Guanzhong Tian","Lei Xie"],"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.","url_abs":"https://arxiv.org/abs/2404.06564v3","url_pdf":"https://arxiv.org/pdf/2404.06564v3.pdf","source":{"archive":"pwc-archive (Hugging Face), CC BY-SA 4.0","snapshot":"2025-07-28","licence_url":"https://creativecommons.org/licenses/by-sa/4.0/legalcode","row_kind":"abstracts"},"code_links":[{"paper_slug":"mambaad-exploring-state-space-models-for","repo_url":"https://github.com/lewandofskee/mambaad","is_official":1,"mentioned_in_paper":0,"mentioned_in_github":1,"framework":"pytorch","reach":{"status":"ok"}},{"paper_slug":"mambaad-exploring-state-space-models-for","repo_url":"https://github.com/Fantasyele/LLaVA-KD","is_official":0,"mentioned_in_paper":0,"mentioned_in_github":1,"framework":"pytorch","reach":{"status":"ok"}},{"paper_slug":"mambaad-exploring-state-space-models-for","repo_url":"https://github.com/zhangzjn/ader","is_official":0,"mentioned_in_paper":0,"mentioned_in_github":1,"framework":"pytorch","reach":null}],"tasks":[{"task_slug":"anomaly-detection","task_name":"Anomaly Detection"},{"task_slug":"decoder","task_name":"Decoder"},{"task_slug":"long-range-modeling","task_name":"Long-range modeling"},{"task_slug":"mamba","task_name":"Mamba"},{"task_slug":"multi-class-anomaly-detection","task_name":"Multi-class Anomaly Detection"},{"task_slug":"state-space-models","task_name":"State Space Models"},{"task_slug":"unsupervised-anomaly-detection","task_name":"Unsupervised Anomaly Detection"}],"methods":[],"datasets_introduced":[],"methods_introduced":[],"results":[{"leaderboard":"/sota/multi-class-anomaly-detection-on-mvtec-ad","task":"Multi-class Anomaly Detection","dataset":"MVTec AD","model":"MambaAD","rank_in_archive_order":6,"of":13,"metrics":{"Detection AUROC":"98.6","Segmentation AUROC":"97.7"},"uses_additional_data":false}],"syntology":{"syntology_url":"https://syntology.ai/paper/2404.06564","atlas_url":"https://app.syntology.ai/?focus=2404.06564","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"2404.06564"}},"developers":"https://syntology.ai/developers","read_at":"2026-09-25T09:33:49+00:00","read_at_is":"when the build read Syntology's graph, not when any sample ran","claim":"Per-sample execution status on synthesized fixtures; not a correctness claim about the paper. Samples come from repositories linked to the paper, official or community; repo_kind says which.","repos":[{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/Fantasyele/LLaVA-KD","reach":{"status":"ok"}},{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/zhangzjn/ader","reach":null},{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/lewandofskee/mambaad","reach":{"status":"ok"}}],"summary":{"ran_draft_wrong":3},"by_repo_kind":{"official":{"samples":3,"ran":3,"repositories":1}},"repo_kind_vocabulary":{"official":"The archive marks this repository official for the paper","named_in_paper":"The archive records that the paper mentions this repository; it is not marked official","listed":"In the archive's code links for this paper, not marked official and not recorded as mentioned in the paper","found_in_text":"Syntology found this repository in the paper's own text; whether it is the authors' implementation is not asserted","community":"Not in the archive's code links for this paper; a community repository Syntology harvested"},"n_pointer_only_for_licence":3,"samples":[{"code_sha256_prefix":"d0ec5f5ba4dd797f","entry":"conv1x1","repo":"lewandofskee/MambaAD","repo_kind":"official","path":"model/mambaad.py","file_url":"https://github.com/lewandofskee/MambaAD/blob/HEAD/model/mambaad.py","link_basis":"first_harvest_node","language":"python","status":"ran_draft_wrong","verification_level":1,"contract_check":"OUTPUT_MISDECLARED","metamorphic_tier":"deterministic","behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"d0ec5f5ba4dd797f"}},{"code_sha256_prefix":"794a2ed91a5175bd","entry":"conv3x3","repo":"lewandofskee/MambaAD","repo_kind":"official","path":"model/mambaad.py","file_url":"https://github.com/lewandofskee/MambaAD/blob/HEAD/model/mambaad.py","link_basis":"first_harvest_node","language":"python","status":"ran_draft_wrong","verification_level":1,"contract_check":"OUTPUT_MISDECLARED","metamorphic_tier":"deterministic","behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"794a2ed91a5175bd"}},{"code_sha256_prefix":"0259b82a097aa35a","entry":"deconv2x2","repo":"lewandofskee/MambaAD","repo_kind":"official","path":"model/mambaad.py","file_url":"https://github.com/lewandofskee/MambaAD/blob/HEAD/model/mambaad.py","link_basis":"first_harvest_node","language":"python","status":"ran_draft_wrong","verification_level":1,"contract_check":"OUTPUT_MISDECLARED","metamorphic_tier":"deterministic","behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"0259b82a097aa35a"}}]},"arxiv_metadata":null,"syntology_extracted_results":null}