CLIP-Core: A Few-Sample Anomaly Detection Method for Surface Defects

Read full text
Authors: Xu Liang, Junle Rao, Shuyou Lin
Cited by: 0
References: 24

Abstract

Few-shot anomaly detection plays a crucial role in automation inspection in industry. With only a minimal number of normal samples, this method can achieve anomaly identification and localization. Recent research has demonstrated that vision-language models—such as CLIP, which has undergone contrastive language–image pre-training—exhibit strong zero and few-shot generalization capabilities. However, existing CLIP-based methods present issues, such as an inability to fully leverage invariant image features, interference from feature noise, reliance on manual prompt design, and unstable image-level scoring. To address these challenges, this paper proposes the CLIP-Core model, which integrates a Mahalanobis distance memory bank and a trainable linear layer to enhance feature measurement and discrimination capabilities. Additionally, we introduce a trainable prompt and text feature reuse mechanism and further propose the CLIP-Core+ model based on CLIP-Core, resolving problems related to prompt design and inadequate image-level scoring. The experimental results on public datasets demonstrate that CLIP-Core+ outperforms existing few-shot anomaly detection methods with only four normal samples, achieving a 12.3% improvement in pixel-level Average Precision (AP). On the CSAD dataset, our method improves both image and pixel-level area under the receiver operating characteristic curve (Auroc) by 7% and 10.1%, respectively. In the glass bottle appearance defect dataset, our proposed method enhances image-level Auroc by 7.1%.

Fields of Study & Subjects

Industrial Vision Systems and Defect Detection Anomaly Detection Techniques and Applications Infrastructure Maintenance and Monitoring

Publication details

Journal / source
IEEE Access
Volume
14
Pages
20716–20733
Publication date
1 January 2026