In a modern factory, thousands of different parts roll off assembly lines every hour. To ensure quality, computer vision systems must spot "anomalies"—subtle scratches, dents, or missing components. Traditionally, this required a "one-model-per-category" approach: if you manufacture fifteen types of screws, you train fifteen separate AI models.
As Guoyang Xie and colleagues point out in their comprehensive roadmap of the field, this paradigm is a significant hurdle for scalable industrial deployment. It is memory-intensive, operationally complex, and fails to generalize. The research community is now shifting toward Unified Anomaly Detection: a single, category-agnostic model capable of detecting defects across diverse object types simultaneously.
The Problem of the Identity Shortcut
The most intuitive way to find an anomaly is to ask a model to "reconstruct" an image. If the model is trained only on healthy samples, it should fail to reconstruct a defect, leaving a high "reconstruction error" that signals an anomaly.
However, powerful neural networks like Transformers or Autoencoders often encounter the identity shortcut. As Zhiyuan You and Lei Cui explain in their seminal work on UniAD, a model might become so good at reconstruction that it accidentally learns to reconstruct the defect itself. If the model simply "copies" the input to the output, the anomaly disappears from the error map.
To break this shortcut, researchers use specialized architectural constraints:
- Neighbor-Masked Attention: In UniAD, the model is prevented from looking at a pixel's immediate neighbors when reconstructing it, forcing it to rely on global context.
- Feature Inversion: Jiangning Zhang and others proposed InvAD, which uses GAN-inspired feature inversion to ensure the model captures the "style" of normality rather than just copying pixels.
- Masking and Distillation: Yunkang Can introduced Masked Reverse Knowledge Distillation (MRKD), which forces the model to restore missing parts of an image, preventing it from overgeneralizing to defects.
Learning a Joint Distribution of Normality
The core challenge of a unified model is interference. A model might confuse a "normal" texture on a piece of leather with a "defect" on a polished metal surface.
Surprisingly, recent evidence suggests that training on multiple classes simultaneously can actually improve performance. Haonan Yin and the team behind LafitE found that learning a broad representation of normality across multiple domains reduces performance variance and makes the model more robust to difficult edge cases.
To manage this diversity, researchers are moving toward discrete prototypes. Instead of a continuous latent space, models like HVQ-Trans and VQ-Flow use Vector Quantization to map image features to a fixed set of "normal" templates. By forcing the model to use these hierarchical prototypes, any anomalous feature is "snapped" back to the nearest normal version, making the defect stand out clearly in the reconstruction error.
Efficiency and the Mamba Architecture
As models move from specialized to unified, computational efficiency becomes paramount. While Vision Transformers (ViT) have been the standard—as demonstrated by ViTAD—they suffer from quadratic complexity.
Haoyang He and Yuhu Bai recently introduced MambaAD, the first framework to apply State Space Models (SSMs) to this problem. By using the Mamba architecture, they achieved state-of-the-art accuracy with linear-time complexity, proving that a single universal model can be both more powerful and more efficient than a fleet of specialized ones.
Zero-Shot: The Ultimate Unification
The final frontier of this research direction is Zero-Shot Anomaly Detection (ZSAD). Here, the goal is to detect defects in an object the model has never seen before.
This is made possible by leveraging Vision-Language Models (VLMs) like CLIP. Donghyeong Kim and his team developed GenCLIP, which uses text prompts to define "anomaly-ness" generally. Similarly, Guoyang Xie et al. extended this to 3D with MVP-PCLIP, projecting 3D point clouds into 2D views that a pre-trained CLIP model can understand.
By treating anomaly detection as a semantic comparison between "normal" and "damaged" descriptions, these models eliminate the need for any category-specific training data, fulfilling the promise of a truly universal industrial inspector.