  Visual anomaly detection plays a significant role in the development of
industrial automatic product quality inspection. As a result of the utmost
imbalance in the amount of normal and abnormal data, growing attention has been
given to unsupervised methods for defect detection. Although existing
reconstruction-based methods have been widely studied recently, establishing a
robust reconstruction model for various textured surface defect detection
remains a challenging task due to homogeneous and nonregular surface textures.
In this paper, we propose a novel unsupervised reconstruction-based method
called the normal reference attention and defective feature perception network
(NDP-Net) to accurately inspect a variety of textured defects. Unlike most
reconstruction-based methods, our NDP-Net first employs an encoding module that
extracts multi scale discriminative features of the surface textures, which is
augmented with the defect discriminative ability by the proposed artificial
defects and the novel pixel-level defect perception loss. Subsequently, a novel
reference-based attention module (RBAM) is proposed to leverage the normal
features of the fixed reference image to repair the defective features and
restrain the reconstruction of the defects. Next, the repaired features are fed
into a decoding module to reconstruct the normal textured background. Finally,
the novel multi scale defect segmentation module (MSDSM) is introduced for
precise defect detection and segmentation. In addition, a two-stage training
strategy is utilized to enhance the inspection performance.
