MultiADS: Defect-aware Supervision for Multi-type Anomaly Detection and Segmentation in Zero-Shot Learning

Ylli Sadikaj, Hongkuan Zhou, Lavdim Halilaj, Stefan Schmid, Steffen Staab, Claudia Plant

TL;DR

This paper introduces MultiADS, a novel zero-shot learning approach for detecting and segmenting multiple types of defects in industrial products. Unlike previous methods that only distinguish between "normal" and "abnormal," MultiADS leverages vision-language models to identify specific defect types at the pixel level, significantly improving anomaly detection and segmentation accuracy.

What Problem Does This Paper Address?

Precise optical inspection is critical in manufacturing to minimize waste and costs. While detecting if a product is anomalous is important, knowing the specific type of defect (e.g., bent, cut, scratch) is crucial for automated repair and understanding root causes. Existing methods often fall into two camps: either they only detect the presence of any anomaly (binary classification) or they require extensive domain-specific training data. Approaches that use pre-trained vision-language models (VLMs) like CLIP often treat all anomalies as a single "abnormal" class, failing to capture the nuances of different defect types. This limits their ability to provide actionable insights for industrial applications. Furthermore, fine-tuning these models on specific domains can lead to overfitting and a loss of general knowledge.

Methods

MultiADS tackles this challenge by proposing a zero-shot learning framework that leverages the power of VLMs, specifically CLIP, to perform multi-type anomaly detection and segmentation. The core idea is to align image features with defect-specific textual descriptions.

Here's a breakdown of their approach:

  • Knowledge Base for Anomalies (KBA): They first build a knowledge base by gathering meta-data from existing industrial defect detection datasets. This KBA is enriched with supplementary defect-type properties (attributes) like size and shape. Defect types are grouped into superclasses (e.g., "bent" encompassing "bent lead" and "bent wire") to create abstract classes that capture a wider range of potential defects.
  • Defect-Aware Text Prompts: Using the KBA, they construct text prompts that are not just for "normal" and "abnormal" but for each specific defect type. This allows the model to learn a more nuanced understanding of anomalies.
  • CLIP Integration with Adapters: The standard CLIP architecture, with its image and text encoders, is used. However, to align image patch embeddings from multiple stages of the image encoder with text embeddings, they introduce learnable linear adapter layers. This allows for finer-grained alignment.
  • Multi-type Anomaly Segmentation (MTAS) Task: They define a new task: MTAS, which aims to determine the defect type at the pixel level. This goes beyond traditional anomaly segmentation.
  • Training Objective: A combination of focal loss (to handle class imbalance between normal and abnormal samples) and binary dice loss (for anomaly segmentation) is used.
  • Inference: During inference, they generate similarity maps for each defect type. For anomaly segmentation, these maps are averaged. For anomaly detection, a global anomaly score is computed alongside the anomaly map. They also introduce a "MultiADS-F" variant that filters out product-irrelevant defect types during inference, further improving performance.

Datasets

The paper evaluates MultiADS on five commonly used datasets for anomaly detection and segmentation:

  • MVTec-AD
  • VisA
  • MPDD
  • MAD (both real and simulated)
  • Real-IAD

Key Insights and Ideas

  • Beyond Binary: The Power of Multi-Type: The most significant insight is that moving beyond a simple "normal vs. abnormal" classification to identifying specific defect types dramatically improves the utility of anomaly detection systems in industrial settings.
  • Leveraging VLMs for Defect Semantics: By crafting defect-specific text prompts and aligning them with image features, MultiADS effectively taps into the rich semantic understanding embedded within VLMs, which traditional methods overlook.
  • KBA as a Crucial Prior: The construction of a structured Knowledge Base for Anomalies (KBA) is key to generating effective defect-aware text prompts, demonstrating the importance of domain knowledge in VLM adaptation.
  • Pixel-Level Defect Type Identification: The introduction of the Multi-type Anomaly Segmentation (MTAS) task and the MultiADS approach to address it is a novel contribution, pushing the boundaries of what's possible in automated visual inspection.

Key Results

MultiADS demonstrates strong performance across the board:

  • Multi-type Anomaly Segmentation (MTAS): MultiADS achieves high accuracy (AUROC) for pixel-level segmentation of distinct defects across all tested datasets, outperforming baselines.
  • Zero-Shot Anomaly Detection and Segmentation (ZSAD): MultiADS and its variant MultiADS-F are reported as the best overall performers on ZSAD tasks, particularly on challenging datasets like MAD and Real-IAD, outperforming 12 baselines.
  • Few-Shot Learning (FSAD): In few-shot settings, MultiADS also shows superior performance compared to competitive baselines like April-GAN and AnomalyGPT, demonstrating its robustness with limited data.
  • Qualitative Results: Visualizations show MultiADS successfully identifying and segmenting multiple defect types (e.g., broken and hole) within a single image, highlighting its ability to capture complex anomaly scenarios.

Limitations and Future Work

  • Computational Cost: While not explicitly detailed as a limitation, the use of multi-stage image embeddings and adapters might imply a higher computational cost compared to simpler methods.
  • Generalization to Unseen Defects: While MultiADS shows good generalization, the paper notes slightly lower accuracy for certain "unseen" defects (e.g., "extra" and "stuck" in Table 2), suggesting room for improvement.
  • Filtering Irrelevant Defects: The MultiADS-F variant shows improved performance by filtering product-irrelevant defect types. This suggests that the effectiveness of the learned prompts is sensitive to their relevance.
  • Future Work: The authors suggest exploring adapting their approach to learn text prompt embeddings, which could further enhance the model's ability to generate effective prompts automatically. They also plan to explore more advanced VLM architectures and training strategies.

Summary updated

BibTeX
@inproceedings{sadikaj2025multiads,
  author = {Ylli Sadikaj and Hongkuan Zhou and Lavdim Halilaj and Stefan Schmid and Steffen Staab and Claudia Plant},
  title = {{MultiADS: Defect-aware Supervision for Multi-type Anomaly Detection and Segmentation in Zero-Shot Learning}},
  booktitle = {IEEE/CVF International Conference on Computer Vision},
  year = {2025},
}
Figure