Dual-branch anomaly detection via feature embedding and anomaly synthesis

Zihao Chen, Shoubiao Tan · 2025

Detection methods based on anomaly synthesis have demonstrated significant applications in the task of detecting and localizing surface defects in industrial products. However, there are representation differences in texture features, morphological distributions, and other aspects between the anomalies generated by existing methods and the natural defects in real scenarios, which leads to performance bottlenecks in the application of current anomaly synthesis methods in real industrial settings. Inspired by the significant separation of abnormal and normal features in the feature embedding space, this study proposes a dual-branch anomaly detection and localization strategy ES based on feature embedding and anomaly synthesis to alleviate the limitations of anomaly synthesis methods in practical applications. This framework builds a feature memory bank of normal samples and implements parallel processing of test sample features during the inference stage: on the one hand, based on the nearest neighbor similarity measurement in the feature space, and on the other hand, through the classifier for analysis. Finally, a threshold-based anomaly map aggregation mechanism AMA is adopted to optimize and integrate the dual-branch anomaly score maps. Besides, this study further proposes a multiscale feature fusion framework MFF, which adopts hierarchical feature aggregation and cross-layer feature fusion methods to achieve complementary local details and global semantics, effectively improving the positioning accuracy. Experimental results show that ES achieves advanced results on the KSDD2 datasets, achieving 96.8% anomaly detection AUROC and 98.5% anomaly localization AUROC, and also achieves excellent performance on the KSDD and BottleCap datasets.

Read the paper · More papers on PaperTik