Skip to content

Mingxiu-Cai/RAID

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

48 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

RAID: Retrieval-Augmented Anomaly Detection

The official repository for RAID: Retrieval-Augmented Anomaly Detection, accepted at IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR 2026).

Image We propose RAID, a retrieval-augmented UAD framework designed for noise-resilient anomaly detection and localization. Unlike standard RAG that enriches context or knowledge, we focus on using retrieved normal samples to guide noise suppression in anomaly map generation. RAID retrieves class-, semantic-, and instance-level representations from a hierarchical vector database, forming a coarse-to-fine pipeline. A matching cost volume correlates the input with retrieved exemplars, followed by a guided Mixture-of-Experts (MoE) network that leverages the retrieved samples to adaptively suppress matching noise and produce fine-grained anomaly maps.

Installation

Create a new conda environment and install the required packages using the environment.yml file

conda env create -f environment.yml

πŸ“Š Dataset

Download and prepare the datasets MVTec-AD and VisA from their official sources.

πŸš€ Running

python run_train_visa.py --dataset VisA --num_seeds 1 --preprocess masking_only

or

python run_train_mvtec.py --dataset MVTec --num_seeds 1 --preprocess masking_only

This project is licensed under the MIT License - see the LICENSE file for details.

πŸ“° News

  • Nov 13, 2025 β€” Paper submitted to CVPR 2026
  • Feb 22, 2026 β€” Paper accepted πŸŽ‰
  • Feb 23, 2026 β€” Paper released on arXiv
  • Apr 12, 2026 β€” Code released

Acknowledgements

We sincerely thank AnomalyDINO and CostFilter-AD for their concise, effective, and well-organized implementations.

Citation

If you find this repository useful in your research/project, please consider citing the paper:

@article{cai2026raid,
  title={RAID: Retrieval-Augmented Anomaly Detection},
  author={Cai, Mingxiu and Zhang, Zhe and Wu, Gaochang and Chai, Tianyou and Zhu, Xiatian},
  journal={arXiv preprint arXiv:2602.19611},
  year={2026}
}

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages