Abstract:To address the issue of reconstruction networks in unsupervised defect detection failing to preserve detailed information of normal regions while simultaneously suppressing abnormal reconstructions, a defect detection method that combines self-attention and defect highlighting is proposed. First, the discrete wavelet transform ( DWT ) is introduced in the reconstruction network for downsampling, and the inverse discrete wavelet transform ( IDWT) is used for upsampling. Compared to traditional reconstruction networks, this method reduces the loss of detail information and performs frequency decomposition on features. Then self-attention modules are added into the skip connections to re-encode the features, enabling the features to focus on the details of the normal region. Additionally, a defect region highlighting module is designed, which utilizes features from normal samples to construct a feature library. By comparing the features extracted from the test image with the features in the library, an abnormal map is obtained. Finally, the abnormal map is combined with the reconstruction residual map to improve the results of defect localization. The proposed method is tested on the industrial defect detection dataset MVTec AD and achieved 99. 3% area under the receiver operating characteristic curve (AUROC) at the image level and 98. 3% at the pixel level, demonstrating high detection accuracy and robustness in unsupervised defect detection.