Unsupervised anomaly detection with memory bank and contrastive learning
Min Li, Zuobin Ying, Gang Li, Mingle Zhou, Jinghui He · Array · 2025
Using contrastive learning to optimize memory bank based storage features is an important issue in the field of image anomaly detection. Current memory-based anomaly detection methods, which are commonly based on pre-trained feature extractors, frequently encounter difficulties attributable to the suboptimal quality of features. Additionally, many patch-based methods primarily focus on localized feature differences, overlooking the broader contextual information crucial for robust anomaly detection. To address these issues, we propose a novel framework, named MemConNet, which combines contrastive learning to optimize memory features. Specifically, we propose to employ a pre-trained feature extraction backbone and apply Channel-Weighted Feature Recalibration (CWFR) and Multi-Scale Recalibration Pyramid (MSRP) to capture fine-grained details and broader contextual information, enhancing the channel features and ensuring that key features are emphasized. Secondly, we propose to leverage contrastive learning to refine feature distinctions, while utilizing a memory bank to store and compare normal feature representations, achieving higher precision in anomaly detection. Extensive experiments show that our MemConNet achieves 99.3% Image-level AUROC on the MVTec AD dataset and 97.1% Image-level AUROC on the ViSA dataset, which are 0.2% and 1.8% higher than the comparison methods, respectively, demonstrating excellent detection results.