Unsupervised visual anomaly detection is crucial for enhancing industrial production quality and efficiency. Among unsupervised methods, reconstruction approaches are popular due to their simplicity and effectiveness. The key aspect of reconstruction methods lies in the restoration of anomalous regions, which current methods have not satisfactorily achieved. To tackle this issue, we introduce a novel \uline{A}daptive \uline{M}ask \uline{I}npainting \uline{Net}work (AMI-Net) from the perspective of adaptive mask-inpainting. In contrast to traditional reconstruction methods that treat non-semantic image pixels as targets, our method uses a pre-trained network to extract multi-scale semantic features as reconstruction targets. Given the multiscale nature of industrial defects, we incorporate a training strategy involving random positional and quantitative masking. Moreover, we propose an innovative adaptive mask generator capable of generating adaptive masks that effectively mask anomalous regions while preserving normal regions. In this manner, the model can leverage the visible normal global contextual information to restore the masked anomalous regions, thereby effectively suppressing the reconstruction of defects. Extensive experimental results on the MVTec AD and BTAD industrial datasets validate the effectiveness of the proposed method. Additionally, AMI-Net exhibits exceptional real-time performance, striking a favorable balance between detection accuracy and speed, rendering it highly suitable for industrial applications. Code is available at: https://github.com/luow23/AMI-Net
翻译:无监督视觉异常检测对于提升工业生产质量和效率至关重要。在无监督方法中,重建方法因其简单性和有效性而广受欢迎。重建方法的关键在于对异常区域的修复,而现有方法尚未能令人满意地实现这一目标。为解决此问题,我们从自适应掩码修复的视角,提出了一种新颖的自适应掩码修复网络(AMI-Net)。与将非语义图像像素作为目标的传统重建方法不同,我们的方法使用预训练网络提取多尺度语义特征作为重建目标。鉴于工业缺陷的多尺度特性,我们采用了包含随机位置和数量掩码的训练策略。此外,我们提出了一种创新的自适应掩码生成器,能够生成有效掩蔽异常区域同时保留正常区域的自适应掩码。通过这种方式,模型可以利用可见的正常全局上下文信息来修复被掩蔽的异常区域,从而有效抑制缺陷的重建。在MVTec AD和BTAD工业数据集上的大量实验结果验证了所提方法的有效性。此外,AMI-Net展现出卓越的实时性能,在检测精度与速度之间取得了良好平衡,使其非常适用于工业应用。代码发布于:https://github.com/luow23/AMI-Net