Abstract: Surface defect segmentation is the basis of industrial production, where pixel-level defect prediction plays a vital role in many applications. As a new trend, few-shot defect detection aims to recognize defects by combining information from a few defect samples. However, many traditional few-shot methods do not consider patch-level correlations between input images and memory banks. This work introduces a novel representation framework consisting hierarchical normal and defect memory banks for few-shot surface defect detection. We propose an adaptive feature bank updating scheme that dynamically integrates frequent features while discarding rare ones. We design a fine-grain feature replacement module rooted in a matching attention mechanism to highlight ambiguous regions for input images and use fused features to identify overall defects. On benchmark datasets, our strategy can obtain in-depth insights from multiple scales, which showcase superiority in generalization for unidentified anomalies better than others in experiments. The experimental results for the ten-shot scenarios demonstrate that the proposed method achieves an average pixel AUC of 88.6%, 93.7%, and 98.7% on three benchmark datasets, respectively, and with more genuine and pseudo anomalous samples, the proposed approach can achieve 98.5% and 95.5% in image AUC and pixel F1 score, respectively, outperforming the state-of-the-art with 1.2% and 24% in each metric.
Loading