ReplayCAD: Generative Diffusion Replay for Continual Anomaly Detection

Lei Hu, Zhiyong Gan, Ling Deng, Jinglin Liang, Lingyu Liang +2 more
5/10/2025
18 citations
cs.CV

Official code: HULEI7/ReplayCAD (59 stars, Jupyter Notebook, last commit 2025-06-18).

Abstract

Continual Anomaly Detection (CAD) enables anomaly detection models in learning new classes while preserving knowledge of historical classes. CAD faces two key challenges: catastrophic forgetting and segmentation of small anomalous regions.

Show full abstract

Existing CAD methods store image distributions or patch features to mitigate catastrophic forgetting, but they fail to preserve pixel-level detailed features for accurate segmentation. To overcome this limitation, we propose ReplayCAD, a novel diffusion-driven generative replay framework that replay high-quality historical data, thus effectively preserving pixel-level detailed features. Specifically, we compress historical data by searching for a class semantic embedding in the conditional space of the pre-trained diffusion model, which can guide the model to replay data with fine-grained pixel details, thus improving the segmentation performance. However, relying solely on semantic features results in limited spatial diversity. Hence, we further use spatial features to guide data compression, achieving precise control of sample space, thereby generating more diverse data. Our method achieves state-of-the-art performance in both classification and segmentation, with notable improvements in segmentation: 11.5% on VisA and 8.1% on MVTec. Our source code is available at https://github.com/HULEI7/ReplayCAD.

View on arXivView PDF

Code Implementations(1)

HULEI7/ReplayCADOfficial100%

[IJCAI 2025] ReplayCAD: Generative Diffusion Replay for Continual Anomaly Detection

596Jupyter Notebook, PythonMay 6, 20251 years ago

Similar Papers

Cite this paper

@article{hu2025replaycad,
  title  = {ReplayCAD: Generative Diffusion Replay for Continual Anomaly Detection},
  author = {Lei Hu and Zhiyong Gan and Ling Deng and Jinglin Liang and Lingyu Liang and Shuangping Huang and Tianshui Chen},
  year   = {2025},
  eprint = {2505.06603},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2505.06603v1}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2505.06603.svg)](https://codeofpaper.com/paper/2505.06603)

Discussion