Unified Multi-Class Anomaly Detection

80 concepts58 papers2 proposals

In industrial visual inspection, the traditional paradigm relies on a strict constraint: one model per product category. If a factory line manufactures fifteen distinct parts, engineers must train, deploy, and maintain fifteen separate neural networks. As noted in A Unified Model for Multi-class Anomaly Detection and MambaAD: Exploring State Space Models for Multi-class Unsupervised Anomaly Detection, this "one-class-one-model" approach creates massive computational overhead, storage bottlenecks, and operational complexity. Subhrajit Nag emphasizes in WaferSegClassNet - A light-weight network for classification and segmentation of semiconductor wafer defects that this lack of scalability becomes a critical maintenance burden as manufacturing lines evolve and new failure modes emerge.

The goal of unified multi-class anomaly detection is to break this barrier. Instead of an array of specialized networks, a single universal model is trained on a mixed stream of defect-free data across multiple diverse categories simultaneously. The model must learn a shared representation of "normalcy" that spans completely different geometries and textures—from smooth metallic surfaces to intricate multi-part assemblies—without losing the precision required to spot a microscopic scratch.

The Core Conflict: Identity Shortcuts and Inter-Class Interference

Why can't we simply pool all normal images together and train a standard reconstruction network like an autoencoder? When a single model is forced to generalize across highly diverse distributions, it runs into two fundamental failure modes:

  1. The Identity Shortcut: To successfully reconstruct a wide variety of complex shapes, the network's capacity must be expanded. However, if the network becomes too powerful, it stops learning the underlying semantic structure of normalcy. Instead, it learns an identity mapping. At test time, it reconstructs anomalous regions just as perfectly as normal ones, causing the anomaly detection to fail.
  2. Inter-Class Interference: This is what Jaehyuk Heo describes as the "performance tax", and what Yixuan Zhou et al. characterize as "inter-class interference." The normal variations within one category (e.g., the natural grain of wood) might overlap with or look like deviations or defects in another category (e.g., a scratch on a smooth plastic surface). As explored in VQ-Flow: Taming Normalizing Flows for Multi-Class Anomaly Detection via Hierarchical Vector Quantization, the model struggles to distinguish between normal intra-class variations and anomalous inter-class deviations.

Breaking the Shortcut: Neighbor Masking and Noisy Bottlenecks

To prevent a unified model from taking the identity shortcut, researchers have redesigned how networks process and reconstruct features.

Zhiyuan You et al. introduced a transformer-based architecture in A Unified Model for Multi-class Anomaly Detection that employs neighbor-masked attention. By preventing a patch from attending to its immediate spatial neighbors during the reconstruction process, the model cannot simply copy-paste nearby pixels to fix a defect. It is forced to infer the missing region based on global context, ensuring that anomalies cannot be easily reconstructed.

Taking a more minimalist approach, Jia Guo et al. developed Dinomaly: The Less Is More Philosophy in Multi-Class Unsupervised Anomaly Detection, which uses standard Dropout as a "noisy bottleneck" alongside loose reconstruction constraints. By intentionally corrupting the intermediate representations, the network is blocked from passing pixel-perfect shortcut information, forcing it to rely on robust, category-agnostic features learned from foundation transformers.

Mitigating Interference: Memory Banks and Prompt Routing

To solve inter-class interference without relying on explicit class labels at test time, modern frameworks dynamically isolate or condition representations.

One strategy relies on structured memory. The authors of VQ-Flow: Taming Normalizing Flows for Multi-Class Anomaly Detection via Hierarchical Vector Quantization use hierarchical vector quantization to automatically discover "pseudo-classes" within an unlabeled multi-class dataset, modeling them as a mixed Gaussian distribution to prevent cross-category blurring. Similarly, Jaehyuk Heo introduces a framework in Multi-class Image Anomaly Detection for Practical Applications: Requirements and Robust Solutions that leverages semantic clustering to build hierarchical coreset memory banks, eliminating the performance drop typically seen when transitioning from single-class to multi-class models.

Another powerful mechanism is dynamic conditioning via prompt learning. Single-author frameworks have pioneered this space: Hossein Kashiani proposes ROADS: Robust Prompt-Driven Multi-Class Anomaly Detection Under Domain Shift, which uses hierarchical class-aware prompts to guide the network through distinct domain shifts, while Wenxi Lv introduces One-for-All Few-Shot Anomaly Detection via Instance-Induced Prompt Learning, utilizing an instance-induced prompt generator to create unique, image-specific prompts. These prompts dynamically route the shared network parameters, allowing the model to adapt its definition of "normalcy" on the fly for each specific object instance.

The Paradigm Shift: From Local CNNs to Global Foundation Models

The evolution of unified anomaly detection is deeply intertwined with architectural shifts. As surveyed by Arturo Mendoza et al. in Foundation models and Transformers for anomaly detection: A survey, the field has shifted away from local-receptive-field CNNs toward global-context Transformers and large-scale foundation models.

For instance, Haoyang He et al. introduced MambaAD: Exploring State Space Models for Multi-class Unsupervised Anomaly Detection, exploring State Space Models (SSMs) to achieve linear-time global modeling. This approach combines global context with local convolutional features to drastically reduce the computational footprint on factory edge devices—a constraint highlighted by Shiyuan Meng et al. in MoEAD: A Parameter-Efficient Model for Multi-class Anomaly Detection.

Furthermore, Guangyao Zhai et al. demonstrated in Foundation Visual Encoders Are Secretly Few-Shot Anomaly Detectors that pre-trained foundation visual encoders inherently encode a distance to a "natural image manifold." By training a lightweight, non-linear projector to map features back onto this manifold, a unified model can achieve state-of-the-art few-shot anomaly detection across entirely distinct domains without needing extensive category-specific retraining.

Key Foundational Work

HomebrewedDB: RGB-D Dataset for 6D Pose Estimation of 3D Objects (2019) — contributed 1 concept elements to this direction.
Deep Neural Networks for Object Detection (2013) — contributed 1 concept elements to this direction.
A Detect-Then-Retrieve Model for Multi-Domain Fashion Item Retrieval (2019) — contributed 1 concept elements to this direction.
History & citationVersion 1 · 2026-10-04

Current · Permanent link

View frozen version 1

Cite this direction

Latest version (a living page):

@misc{lacuna_unified_anomaly_detection_e50ebeb3,
  title = {unified anomaly detection},
  author = {{Lacuna}},
  howpublished = {Lacuna research direction},
  year = {2026},
  url = {https://lacuna.tiptreesystems.com/direction/unified-anomaly-detection/rdr_e50ebeb38eb542218fcd7fc197c3140e},
  note = {Latest version of a living research direction; cite a version for a fixed text. Accessed 2026-11-27},
}

This exact version (version 1, frozen text):

@misc{lacuna_unified_anomaly_detection_e50ebeb3_v1,
  title = {unified anomaly detection},
  author = {{Lacuna}},
  howpublished = {Lacuna research direction},
  year = {2026},
  url = {https://lacuna.tiptreesystems.com/direction/unified-anomaly-detection/rdr_e50ebeb38eb542218fcd7fc197c3140e/v/1},
  note = {Version 1, frozen 2026-10-04. Accessed 2026-11-27},
}
About

These directions overlap with this one through shared papers.

See something wrong? Report a mistake