Skip to main content
QUICK REVIEW

[Paper Review] AMI-Net: Adaptive Mask Inpainting Network for Industrial Anomaly Detection and Localization

Wei Luo, Haiming Yao|arXiv (Cornell University)|Dec 16, 2024
Digital Media Forensic DetectionComputer Science3 citations
TL;DR

AMI-Net proposes an adaptive mask inpainting network for unsupervised industrial anomaly detection that uses multi-scale semantic features as reconstruction targets and an adaptive mask generator to suppress defect reconstruction. By training with random positional and quantitative masking and testing with adaptive masks, it achieves high accuracy and real-time performance on MVTec AD and BTAD, outperforming existing methods while requiring only normal samples for training.

ABSTRACT

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

Motivation & Objective

  • Address the limitation of reconstruction-based methods in unsupervised anomaly detection, where autoencoders fail to suppress defect reconstruction due to strong generalization.
  • Overcome the instability and performance inconsistency of existing mask-based methods caused by random masks during inference.
  • Improve defect localization and detection by leveraging global contextual information from normal regions to restore masked anomalous regions.
  • Enable real-time deployment in industrial settings by balancing high detection accuracy with fast inference speed.
  • Extend applicability to diverse industrial defects, including texture surfaces and objects with posture variation, without requiring defect annotations.

Proposed method

  • Proposes an adaptive mask generator that creates instance-specific masks to fully cover anomalous regions while preserving normal regions during inference.
  • Uses a pre-trained vision transformer to extract multi-scale semantic features as reconstruction targets, replacing pixel-level reconstruction in standard autoencoders.
  • Introduces a training strategy with random positional and quantitative masking to simulate defects of varying sizes and locations.
  • Employs a separate decoder for visualization only, with the model trained solely on feature reconstruction to improve generalization and stability.
  • Leverages visible normal global context to guide inpainting of masked defect regions, effectively suppressing defect pattern generation.
  • Optimizes the reconstruction loss with a hyperparameter λ, finding λ = 0.5 yields optimal performance across image, instance, and pixel-level AP metrics.

Experimental results

Research questions

  • RQ1Can an adaptive mask generation strategy improve the robustness and stability of unsupervised anomaly detection in industrial settings?
  • RQ2Does using multi-scale semantic features as reconstruction targets outperform pixel-level reconstruction in suppressing defect pattern generation?
  • RQ3Can random masking during training enhance the model’s ability to generalize to defects of varying sizes and positions?
  • RQ4To what extent does the proposed method maintain high detection accuracy while achieving real-time inference speed?
  • RQ5How does AMI-Net perform on diverse industrial defect types, including texture surfaces and objects with posture variation?

Key findings

  • AMI-Net achieves state-of-the-art performance on MVTec AD and BTAD datasets, with the highest pixel-level average precision (AP) among unsupervised methods.
  • The model demonstrates optimal performance when the reconstruction loss hyperparameter λ is set to 0.5, balancing image, instance, and pixel-level AP metrics.
  • Visualizations show that AMI-Net successfully suppresses defect reconstruction, unlike vanilla autoencoders and existing mask-based methods that leak defect patterns.
  • AMI-Net achieves real-time inference speed, making it suitable for industrial deployment where low latency is critical.
  • Failure cases reveal limitations in detecting subtle or low-contrast defects and distinguishing defects from background texture, indicating room for improvement in discrimination capability.
  • The model maintains high stability across different test masks, unlike random-mask methods that suffer from performance inconsistency due to mask variation.

Read this paper

Open the full text in the Nubint reader and ask about any passage as you read.

Read this paper on Nubint

This review was generated by AI from the original paper. Please check the paper before citing it.