SIAD: Self-supervised Image Anomaly Detection System

Jiawei Li, Bolin Jiang, Yan Liu, Chengxiao Luo, Naiqi Li, Бин Чэн, Liu, Yan, Li, Yaowei, Huo, Enze, Chen, Bin · DOI

Abstract

Recent trends in AI-Generated Content (AIGC) have significantly boosted the application of visual inspection. However, most available systems operate in a human-in-the-loop manner and cannot provide long-term support for online applications. This paper introduces an automatic annotation system called SsaA, which utilizes self-supervised learning to continuously perform online visual inspection in manufacturing automation scenarios. By leveraging self-supervised learning, SsaA effectively establishes a visual inspection application for the entire manufacturing lifecycle. In the early stages, using only anomaly-free data, unsupervised algorithms process pretext tasks to generate coarse labels. Subsequently, supervised algorithms are trained for downstream tasks. With user-friendly web-based interfaces, SsaA is convenient to integrate and deploy, and it has already been adopted in real-life industrial applications.

The Challenge of Industrial Visual Inspection

In modern manufacturing, visual inspection is critical for quality control. However, most current AI systems rely heavily on experts to manually label thousands of images, creating a bottleneck that is slow, subjective, and expensive. Furthermore, industrial defects are often "open-set"—new types of scratches or cracks appear that the model has not seen during training. Traditional supervised models struggle with these unseen anomalies. There is a pressing need for a system that supports the entire production lifecycle, from the first day (with no defect data) to full-scale operation, with minimal human intervention.

Methodology: The Self-supervised Pipeline

The SIAD system employs a closed-loop architecture that utilizes Self-supervised Learning (SSL) to bridge the gap between unsupervised and supervised methods. The workflow consists of two main stages:

  1. The Pretext Task (Unsupervised): Initially, the system is fed only anomaly-free (normal) data. It uses generative models—such as AutoEncoders, UNets, or GAN Inversion—to learn the reconstruction of these normal images.
  2. The Downstream Task (Supervised): When new online data arrives, the pretext model attempts to reconstruct it. The difference (residual) between the original image and the reconstruction highlights potential anomalies. The system uses these differences to generate coarse pixel-level labels automatically, which are then used to train a supervised discriminant model for precise defect segmentation.
The SIAD system architecture illustrating the flow from unsupervised pretext tasks to supervised downstream tasks via self-supervised ties.

System Implementation and Usability

The system is delivered via a web-based interface built with Fabric.js, facilitating easy deployment and "auto-annotation with semantics." This interface allows the AI to suggest labels that a human can quickly verify or refine, significantly reducing the manual effort required for pixel-level modifications compared to traditional tools.

The SsaA web-based interface showing auto-annotation tools and defect segmentation on a bottle cap.

Datasets and Key Results

The system was evaluated using four prominent industrial datasets: MVTec-AD, BeanTech, TianChi-Fabric, and TianChi-Tile. Key insights from these evaluations include:

  • Lifecycle Adaptability: The system evolves with the production environment. As materials or lighting change, the unsupervised pretext task can be re-run to update the model without manual relabeling.
  • Handling Open-Set Problems: By learning only what a perfect product looks like, the system can theoretically flag any deviation as a defect, even if that specific defect type was never previously encountered.
  • Routine Performance: In tests on MVTec and BeanTech, using only 10 anomaly-free samples for the pretext task was sufficient to generate labels and train a downstream model that accurately identified broken products. For complex textures like fabric, GAN Inversion showed strong generalization abilities.

Future Directions

While SIAD reduces human effort, expert experience is still required to provide semantic meaning to auto-generated labels (e.g., distinguishing a "scratch" from a "stain"). Future work will focus on Automatic Evaluation methods to assess model performance without human-labeled ground truth and Semantic Automation to automatically categorize defect types using advanced NLP or few-shot learning.

Summary updated

BibTeX
@misc{li2022siad,
  author = {Jiawei Li and Bolin Jiang and Yan Liu and Chengxiao Luo and Naiqi Li and Бин Чэн and Liu, Yan and Li, Yaowei and Huo, Enze and Chen, Bin},
  title = {{SIAD: Self-supervised Image Anomaly Detection System}},
  year = {2022},
  eprint = {2208.04173},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2208.04173},
}
Figure