Proceedings

ReplayCAD: Generative Diffusion Replay for Continual Anomaly Detection

Download BibTeX Cite

Proceedings of the Thirty-Fourth International Joint Conference on Artificial Intelligence. Main Track. Pages 2946-2954.

https://doi.org/10.24963/ijcai.2025/328

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. 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.

  1. [Aljundi et al., 2018] Rahaf Aljundi, Francesca Babiloni, Mohamed Elhoseiny, Marcus Rohrbach, and Tinne Tuyte- laars. Memory aware synapses: Learning what (not) to forget. In ECCV, pages 139-154, 2018.
  2. [Bergmann et al., 2019] Paul Bergmann, Michael Fauser, David Sattlegger, and Carsten Steger. Mvtec ad-a com- prehensive real-world dataset for unsupervised anomaly detection. In CVPR, pages 9592-9600, 2019.
  3. [Chaudhry et al., 2018] Arslan Chaudhry, Puneet K Doka- nia, Thalaiyasingam Ajanthan, and Philip HS Torr. Rie- mannian walk for incremental learning: Understanding forgetting and intransigence. In ECCV, pages 532-547, 2018.
  4. [Dai et al., 2023] Gang Dai, Yifan Zhang, Qingfeng Wang, Qing Du, Zhuliang Yu, Zhuoman Liu, and Shuangping Huang. Disentangling writer and character styles for hand- writing generation. In CVPR, pages 5977-5986, 2023.
  5. [Dai et al., 2024] Gang Dai, Yifan Zhang, Quhui Ke, Qiangya Guo, and Shuangping Huang. One-dm: One- shot diffusion mimicker for handwritten text generation. In ECCV, pages 410-427. Springer, 2024.
  6. [Deng and Li, 2022] Hanqiu Deng and Xingyu Li. Anomaly detection via reverse distillation from one-class embed- ding. In CVPR, pages 9737-9746, 2022.
  7. [Gao and Liu, 2023] Rui Gao and Weiwei Liu. Ddgr: Con- tinual learning with deep diffusion-based generative re- play. In ICML, pages 10744-10763. PMLR, 2023.
  8. [He et al., 2024] Haoyang He, Yuhu Bai, Jiangning Zhang, Qingdong He, Hongxu Chen, Zhenye Gan, Chengjie Wang, Xiangtai Li, Guanzhong Tian, and Lei Xie. Mambaad: Exploring state space models for multi- class unsupervised anomaly detection. arXiv preprint arXiv:2404.06564, 2024.
  9. [He et al., 2025] Liren He, Zhengkai Jiang, Jinlong Peng, Wenbing Zhu, Liang Liu, Qiangang Du, Xiaobin Hu, Mingmin Chi, Yabiao Wang, and Chengjie Wang. Learn- ing unified reference representation for unsupervised multi-class anomaly detection. In ECCV, pages 216-232. Springer, 2025.
  10. [Hu and Huang, 2025] Lei Hu and Shuangping Huang. En- hancing table structure recognition via bounding box guid- ance. In ICPR, pages 209-225. Springer, 2025.
  11. [Hu et al., 2024] Teng Hu, Jiangning Zhang, Ran Yi, Yuzhen Du, Xu Chen, Liang Liu, Yabiao Wang, and Chengjie Wang. Anomalydiffusion: Few-shot anomaly image gen- eration with diffusion model. In AAAI, volume 38, pages 8526-8534, 2024.
  12. [Kirillov et al., 2023] Alexander Kirillov, Eric Mintun, Nikhila Ravi, Hanzi Mao, Chloe Rolland, Laura Gustafson, Tete Xiao, Spencer Whitehead, Alexander C Berg, Wan-Yen Lo, et al. Segment anything. In ICCV, pages 4015-4026, 2023.
  13. [Kirkpatrick et al., 2017] James Kirkpatrick, Razvan Pas- canu, Neil Rabinowitz, Joel Veness, Guillaume Des- jardins, Andrei A Rusu, Kieran Milan, John Quan, Tiago Ramalho, Agnieszka Grabska-Barwinska, et al. Overcom- ing catastrophic forgetting in neural networks. Proceed- ings of the national academy of sciences, 114(13):3521- 3526, 2017.
  14. [Li et al., 2021] Chun-Liang Li, Kihyuk Sohn, Jinsung Yoon, and Tomas Pfister. Cutpaste: Self-supervised learn- ing for anomaly detection and localization. In CVPR, pages 9664-9674, 2021.
  15. [Li et al., 2022] Wujin Li, Jiawei Zhan, Jinbao Wang, Bizhong Xia, Bin-Bin Gao, Jun Liu, Chengjie Wang, and Feng Zheng. Towards continual adaptation in industrial anomaly detection. In ACMMM, pages 2871-2880, 2022.
  16. [Li et al., 2024] Wei Li, Jingyang Zhang, Pheng-Ann Heng, and Lixu Gu. Comprehensive generative replay for task- incremental segmentation with concurrent appearance and semantic forgetting. In MICCAI, pages 80-90. Springer, 2024.
  17. [Li et al., 2025] Xiaofan Li, Xin Tan, Zhuo Chen, Zhizhong Zhang, Ruixin Zhang, Rizen Guo, Guanna Jiang, Yulong Chen, Yanyun Qu, Lizhuang Ma, et al. One-for-more: Continual diffusion model for anomaly detection. arXiv preprint arXiv:2502.19848, 2025.
  18. [Liang et al., 2024] Jinglin Liang, Jin Zhong, Hanlin Gu, Zhongqi Lu, Xingxing Tang, Gang Dai, Shuangping Huang, Lixin Fan, and Qiang Yang. Diffusion-driven data replay: A novel approach to combat forgetting in feder- ated class continual learning. In ECCV, pages 303-319. Springer, 2024.
  19. [Liu et al., 2020] Xialei Liu, Chenshen Wu, Mikel Menta, Luis Herranz, Bogdan Raducanu, Andrew D Bagdanov, Shangling Jui, and Joost van de Weijer. Generative feature replay for class-incremental learning. In CVPRW, pages 226-227, 2020.
  20. [Liu et al., 2023] Zhikang Liu, Yiming Zhou, Yuansheng Xu, and Zilei Wang. Simplenet: A simple network for im- age anomaly detection and localization. In CVPR, pages 20402-20411, 2023.
  21. [Liu et al., 2024a] Jiaqi Liu, Kai Wu, Qiang Nie, Ying Chen, Bin-Bin Gao, Yong Liu, Jinbao Wang, Chengjie Wang, and Feng Zheng. Unsupervised continual anomaly de- tection with contrastively-learned prompt. In AAAI, vol- ume 38, pages 3639-3647, 2024.
  22. [Liu et al., 2024b] Jiaqi Liu, Guoyang Xie, Jinbao Wang, Shangnian Li, Chengjie Wang, Feng Zheng, and Yaochu Jin. Deep industrial image anomaly detection: A survey. Machine Intelligence Research, 21(1):104-135, 2024.
  23. [Mallya and Lazebnik, 2018] Arun Mallya and Svetlana Lazebnik. Packnet: Adding multiple tasks to a single net- work by iterative pruning. In CVPR, pages 7765-7773, 2018.
  24. [Mallya et al., 2018] Arun Mallya, Dillon Davis, and Svet- lana Lazebnik. Piggyback: Adapting a single network to multiple tasks by learning to mask weights. In ECCV, pages 67-82, 2018.
  25. [Pan et al., 2020] Pingbo Pan, Siddharth Swaroop, Alexan- der Immer, Runa Eschenhagen, Richard Turner, and Mo- hammad Emtiyaz E Khan. Continual deep learning by functional regularisation of memorable past. NIPS, 33:4453-4464, 2020.
  26. [Peng et al., 2024] Wenjie Peng, Hongxiang Huang, Tian- shui Chen, Quhui Ke, Gang Dai, and Shuangping Huang. Globally correlation-aware hard negative gener- ation. IJCV, pages 1-22, 2024.
  27. [Rebuffi et al., 2017] Sylvestre-Alvise Rebuffi, Alexander Kolesnikov, Georg Sperl, and Christoph H Lampert. icarl: Incremental classifier and representation learning. In CVPR, pages 2001-2010, 2017.
  28. [Reiss et al., 2021] Tal Reiss, Niv Cohen, Liron Bergman, and Yedid Hoshen. Panda: Adapting pretrained features for anomaly detection and segmentation. In CVPR, pages 2806-2814, 2021.
  29. [Riemer et al., 2019] Matthew Riemer, Tim Klinger, Djallel Bouneffouf, and Michele Franceschini. Scalable recollec- tions for continual lifelong learning. In AAAI, volume 33, pages 1352-1359, 2019.
  30. [Rombach et al., 2022] Robin Rombach, Andreas Blattmann, Dominik Lorenz, Patrick Esser, and Björn Ommer. High-resolution image synthesis with latent diffusion models. In CVPR, pages 10684-10695, 2022.
  31. [Roth et al., 2022] Karsten Roth, Latha Pemula, Joaquin Zepeda, Bernhard Schölkopf, Thomas Brox, and Peter Gehler. Towards total recall in industrial anomaly detec- tion. In CVPR, pages 14318-14328, 2022.
  32. [Shin et al., 2017] Hanul Shin, Jung Kwon Lee, Jaehong Kim, and Jiwon Kim. Continual learning with deep gener- ative replay. NIPS, 30, 2017.
  33. [Tang et al., 2025] Jiaqi Tang, Hao Lu, Xiaogang Xu, Ruizheng Wu, Sixing Hu, Tong Zhang, Tsz Wa Cheng, Ming Ge, Ying-Cong Chen, and Fugee Tsung. An incre- mental unified framework for small defect inspection. In ECCV, pages 307-324. Springer, 2025.
  34. [Wang et al., 2021] Liyuan Wang, Kuo Yang, Chongxuan Li, Lanqing Hong, Zhenguo Li, and Jun Zhu. Ordisco: Ef- fective and efficient usage of incremental unlabeled data for semi-supervised continual learning. In CVPR, pages 5383-5392, 2021.
  35. [Wu et al., 2024] Di Wu, Shicai Fan, Xue Zhou, Li Yu, Yuzhong Deng, Jianxiao Zou, and Baihong Lin. Unsu- pervised anomaly detection via masked diffusion posterior sampling. In IJCAI, pages 2442-2450, 2024. IJCAI
  36. [Yang et al., 2025] Shuai Yang, Zhifei Chen, Pengguang Chen, Xi Fang, Yixun Liang, Shu Liu, and Yingcong Chen. Defect spectrum: a granular look of large-scale de- fect datasets with rich semantics. In ECCV, pages 187- 203. Springer, 2025.
  37. [Yoon et al., 2017] Jaehong Yoon, Eunho Yang, Jeong- tae Lee, and Sung Ju Hwang. Lifelong learning with dynamically expandable networks. arXiv preprint arXiv:1708.01547, 2017.
  38. [You et al., 2022] Zhiyuan You, Lei Cui, Yujun Shen, Kai Yang, Xin Lu, Yu Zheng, and Xinyi Le. A unified model for multi-class anomaly detection. NIPS, 35:4571-4584, 2022.
  39. [Zavrtanik et al., 2021a] Vitjan Zavrtanik, Matej Kristan, and Danijel Skočaj. Draem-a discriminatively trained re- construction embedding for surface anomaly detection. In ICCV, pages 8330-8339, 2021.
  40. [Zavrtanik et al., 2021b] Vitjan Zavrtanik, Matej Kristan, and Danijel Skočaj. Draem-a discriminatively trained re- construction embedding for surface anomaly detection. In ICCV, pages 8330-8339, 2021.
  41. [Zhang et al., 2024a] Jiangning Zhang, Chengjie Wang, Xi- angtai Li, Guanzhong Tian, Zhucun Xue, Yong Liu, Guan- song Pang, and Dacheng Tao. Learning feature inversion for multi-class anomaly detection under general-purpose coco-ad benchmark. arXiv preprint arXiv:2404.10760, 2024.
  42. [Zhang et al., 2024b] Jiangning Zhang, Chengjie Wang, Xi- angtai Li, Guanzhong Tian, Zhucun Xue, Yong Liu, Guan- song Pang, and Dacheng Tao. Learning feature inversion for multi-class anomaly detection under general-purpose coco-ad benchmark. arXiv preprint arXiv:2404.10760, 2024.
  43. [Zhou and Paffenroth, 2017] Chong Zhou and Randy C Paf- fenroth. Anomaly detection with robust deep autoen- coders. In SIGKDD, pages 665-674, 2017.
  44. [Zou et al., 2022] Yang Zou, Jongheon Jeong, Latha Pemula, Dongqing Zhang, and Onkar Dabeer. Spot-the-difference self-supervised pre-training for anomaly detection and segmentation. In ECCV, pages 392-408. Springer, 2022.
  45. [Zuo et al., 2024] Zuo Zuo, Yao Wu, Baoqiang Li, Jiahao Dong, You Zhou, Lei Zhou, Yanyun Qu, and Zongze Wu. Clip-fsac: Boosting clip for few-shot anomaly classifica- tion with synthetic anomalies. In IJCAI, pages 1834-1842, 2024. IJCAI

References were extracted automatically from the PDF and may contain errors.

Welcome Future Conferences AI Journal Division IJCAI Proceedings About IJCAI IJCAI Awards