Getachew Shiferaw Tesfaye, Yao Li
School of Computer Science and Engineering, Southeast University, Nanjing 211189, China.
Key Laboratory of Computer Network and Information Integration, Southeast University, Ministry of Education, Nanjing 211189, China.
J Imaging. 2024 May 5;10(5):111. doi: 10.3390/jimaging10050111.
Accurately detecting defects while reconstructing a high-quality normal background in surface defect detection using unsupervised methods remains a significant challenge. This study proposes an unsupervised method that effectively addresses this challenge by achieving both accurate defect detection and a high-quality normal background reconstruction without noise. We propose an adaptive weighted structural similarity (AW-SSIM) loss for focused feature learning. AW-SSIM improves structural similarity (SSIM) loss by assigning different weights to its sub-functions of luminance, contrast, and structure based on their relative importance for a specific training sample. Moreover, it dynamically adjusts the Gaussian window's standard deviation (σ) during loss calculation to balance noise reduction and detail preservation. An artificial defect generation algorithm (ADGA) is proposed to generate an artificial defect closely resembling real ones. We use a two-stage training strategy. In the first stage, the model trains only on normal samples using AW-SSIM loss, allowing it to learn robust representations of normal features. In the second stage of training, the weights obtained from the first stage are used to train the model on both normal and artificially defective training samples. Additionally, the second stage employs a combined learned Perceptual Image Patch Similarity (LPIPS) and AW-SSIM loss. The combined loss helps the model in achieving high-quality normal background reconstruction while maintaining accurate defect detection. Extensive experimental results demonstrate that our proposed method achieves a state-of-the-art defect detection accuracy. The proposed method achieved an average area under the receiver operating characteristic curve (AuROC) of 97.69% on six samples from the MVTec anomaly detection dataset.
在使用无监督方法进行表面缺陷检测时,准确检测缺陷同时重建高质量的正常背景仍然是一项重大挑战。本研究提出了一种无监督方法,通过在无噪声的情况下实现准确的缺陷检测和高质量的正常背景重建,有效应对了这一挑战。我们提出了一种用于聚焦特征学习的自适应加权结构相似性(AW-SSIM)损失。AW-SSIM通过根据其亮度、对比度和结构子功能对特定训练样本的相对重要性分配不同权重,改进了结构相似性(SSIM)损失。此外,它在损失计算过程中动态调整高斯窗口的标准差(σ),以平衡降噪和细节保留。提出了一种人工缺陷生成算法(ADGA)来生成与真实缺陷非常相似的人工缺陷。我们使用两阶段训练策略。在第一阶段,模型仅使用AW-SSIM损失对正常样本进行训练,使其能够学习正常特征的鲁棒表示。在训练的第二阶段,将第一阶段获得的权重用于在正常和人工缺陷训练样本上对模型进行训练。此外,第二阶段采用了联合学习的感知图像块相似性(LPIPS)和AW-SSIM损失。这种联合损失有助于模型在保持准确缺陷检测的同时实现高质量的正常背景重建。大量实验结果表明,我们提出的方法实现了先进的缺陷检测精度。该方法在MVTec异常检测数据集的六个样本上,接收器操作特征曲线(AuROC)下的平均面积达到了97.69%。