MoEAD: A Parameter-Efficient Model for Multi-class Anomaly Detection

Shiyuan Meng, Wenchao Meng, Qihang Zhou, Shizhong Li, Weiye Hou, Shibo HeECCV 2024

Abstract

In industrial smart manufacturing, detecting subtle defects across diverse product lines is critical. While deep learning has advanced anomaly detection (AD), existing solutions often force a trade-off between specialized "one-class" models that are difficult to scale and "unified" multi-class models that are too computationally intensive for edge deployment. This paper introduces MoEAD, a parameter-efficient unified model that leverages a novel Stacked Mixture of Experts (SMoE) architecture and extreme parameter sharing. MoEAD achieves state-of-the-art performance on benchmarks like MVTec-AD and VisA while significantly reducing the parameter count and computational footprint, making it ideal for resource-constrained factory environments.

Introduction

The "Goldilocks" problem in industrial anomaly detection refers to the difficulty of finding a model that is neither too specialized nor too massive. Traditional systems are typically "one-class" models, requiring a unique instance for every product type—from wood textures to complex circuit boards. While unified models can handle multiple classes simultaneously, they often rely on massive parameter sets to maintain accuracy, leading to high memory usage and slow inference speeds that preclude deployment on low-power edge devices.

The Challenge of Unified Anomaly Detection

Unified models must capture the distinct features of 15 or more different categories. To distinguish between a normal product and a defective one across such variety, models usually require significant "brainpower" (parameters).

Traditional anomaly detection often requires separate models for each object class, leading to high management overhead at scale.
The complexity grows linearly with the number of products, making deployment on edge devices impractical.

The core challenge is compressing these multi-class models without sacrificing the nuanced representation required for high-accuracy defect detection.

Methodology: The MoEAD Architecture

MoEAD utilizes a Vision Transformer (ViT) style decoder with three primary innovations designed for efficiency:

1. Extreme Parameter Sharing

To minimize the model's footprint, MoEAD reuses the same trainable parameters across all transformer blocks. This strategy drastically reduces the total parameter count by "squeezing" the model's depth while maintaining its functional capacity.

2. Mixture of Experts (MoE)

To prevent shared parameters from becoming overly generic, the standard Feed-Forward Network (FFN) in each block is replaced with an MoE layer. A router dynamically selects the two most relevant "experts" from a pool for each input token. This allows the model to specialize its processing—for instance, using specific experts for textures like carpets and others for geometric shapes like bolts.

3. Stacked Mixture of Experts (SMoE)

The authors further optimize the MoE layer by stacking two smaller MoE layers instead of using one large pool. This configuration provides a similar number of "routing paths" for data but uses significantly fewer parameters, maximizing combinatorial power at a lower computational cost.

The model employs a frozen EfficientNet-b4 backbone for feature extraction and follows a reconstruction-based training approach. Anomalies are identified by the model's inability to accurately reconstruct defective regions compared to normal training samples.

Experimental Results

The researchers evaluated MoEAD on the MVTec-AD and VisA datasets, which contain thousands of high-resolution images across diverse industrial categories.

  • Efficiency: MoEAD operates with only 4.9M parameters and 2.18G FLOPs, roughly half the computational cost of competing unified models like UniAD (7.7M parameters, 4.30G FLOPs).
  • Accuracy: On the MVTec-AD benchmark, MoEAD achieved an I-AUROC of 97.7%, ranking second only to the much larger HVQ-Trans (18M parameters).
  • Inference Speed: Due to its sparse routing and shared weights, MoEAD demonstrates the fastest inference speed among current state-of-the-art unified methods.

Conclusion and Future Work

MoEAD demonstrates that multi-class anomaly detection can be both high-performing and lightweight. By localizing complexity within a Stacked Mixture of Experts, the model achieves the efficiency required for edge deployment without a significant loss in accuracy. Future work will focus on incorporating Feature Pyramid architectures to process features at multiple scales, aiming to close the remaining accuracy gap for multi-scale defects.

Summary updated

BibTeX
@inproceedings{meng2024moead,
  author = {Shiyuan Meng and Wenchao Meng and Qihang Zhou and Shizhong Li and Weiye Hou and Shibo He},
  title = {{MoEAD: A Parameter-Efficient Model for Multi-class Anomaly Detection}},
  booktitle = {European Conference on Computer Vision},
  year = {2024},
  doi = {10.1007/978-3-031-73013-9\_20},
}
Figure