Template-guided Hierarchical Feature Restoration for Anomaly Detection
ICCV 2023 Institute of Automation, Chinese Academy of Sciences
Targeting for detecting anomalies of various sizes fo rcomplicated normal patterns, we propose a Template-guided Hierarchical Feature Restoration method, which in-troduces two key techniques, bottleneck compression and template-guided compensation, for anomaly-free feature restoration. Specially, our framework compresses hierar-chical features of an image by bottleneck structure to pre-serve the most crucial features shared among normal sam-ples. We design template-guided compensation to restorethe distorted features towards anomaly-free features. Par-ticularly, we choose the most similar normal sample as the template, and leverage hierarchical features from the tem-plate to compensate the distorted features. The bottleneck could partially filter out anomaly features, while the com-pensation further converts the reminding anomaly featurestowards normal with template guidance. Finally, anoma-lies are detected in terms of the cosine distance between the pre-trained features of an inference image and the corre-sponding restored anomaly-free features. Experimental re-sults demonstrate the effectiveness of our approach, which achieves the state-of-the-art performance on the MVTecLOCO AD dataset.