README.md
May 19, 2026 Β· View on GitHub
UniMMAD: Unified Multi-Modal and Multi-Class Anomaly Detection
via MoE-Driven Feature Decompression
CVPR 2026
PyTorch Implementation of CVPR 2026 "UniMMAD: Unified Multi-Modal and Multi-Class Anomaly Detection via MoE-Driven Feature Decompression". The first unified multi-modal and multi-class UAD model !!!
-
If you find this work useful, please star β the repo!
-
This project is released under Apache-2.0 License.
News
-
05.2026: We improved Input_Preprocess and released latest weight(All_Datasets_Mean:I-AUROC 92.5->93.2 I-F1max 91.3->92.3).
-
04.2026: Code optimization: Added cosine annealing LR; fixed loss display in faster_moe_inference; restored lost share_img slicing assignment in UniDataset.
-
03.2026: We have released the dataset, training/evaluation code, and pre-trained weights.π
-
02.2026: Accepted by CVPR 2026π
-
09.2025: We have released the arXiv paper of UniMMAD v1, link:https://arxiv.org/abs/2509.25934 .π
π TODO
- Release arXiv paper
- open training code
- open testing code
- release MMAD Datasets
- release pre-trained UniMMAD Weights
Introduction
UniMMAD, a unified framework for multi-modal and multi-class anomaly detection. At the core of UniMMAD is a Mixture-of-Experts (MoE)-driven feature decompression mechanism, which enables adaptive and disentangled reconstruction tailored to specific domains.This process is guided by a βgeneral β specificβ paradigm. In the encoding stage, multi-modal inputs of varying combinations are compressed into compact, general-purpose features. The encoder incorporates a feature compression module to suppress latent anomalies, encourage cross-modal interaction, and avoid shortcut learning. In the decoding stage, the general features are decompressed into modality-specific and class-specific forms via a sparsely-gated cross MoE, which dynamically selects expert pathways based on input modality and class. To further improve efficiency, we design a grouped dynamic filtering mechanism and a MoE-in-MoE structure, reducing parameter usage by 75% while maintaining sparse activation and fast inference. UniMMAD achieves state-of-the-art performance on 9 anomaly detection datasets, spanning 3 fields, 12 modalities, and 66 classes.
MMAD Task
Note: (a) Existing methods rely on specialized models tailored to individual modalities and classes. (b) The proposed UniMMAD model unifies multi-modal and multi-class anomaly detection tasks within a single framework. (c) Visual examples, with modalities highlighted in white, class names in yellow, and anomaly regions marked by red boxes. (d) Overview of the fields, modalities, and classes encompassed by UniMMAD.
Get Started
Environment
pip install -r requirements.txt
Train
-
Prepare Data: Download the dataset and define your root directory path in the config.json.
-
Encoder Weights: Download the WideResNet encoder weights and place them in the checkpoints folder (e.g., checkpoints/wide_resnet50_2.safetensors).
-
Launch Training:
accelerate launch main.py --mode train
Test
- Model Weights: Download the trained model weights and provide the path to checkpoint_path.
accelerate launch main.py --mode eval --resume checkpoint_path
Note: You can configure specific classes for training and testing in mmad_datasets/datasets_classes.
Data
root
|-- EyePre
|-- mvtec3d
|-- MulSen_AD
|-- BratsAD1K
|-- HyperAD
|-- LiverAD
|-- RetinaAD
Metric
We use the evaluation toolkit from PyADMetric_EvalToolkit, which supports AUROC, AUPR, AP, AUPRO, and F1-max. It leverages GPU acceleration, achieving a real-time evalution.
π datasets & checkpoints Links
| Item | Datasets | Model Weights (2026.4 v1.1) | Model Weights (2026.5 latest) |
|---|---|---|---|
| UniMMAD | Download | Download | Download |