Proceedings

Unsupervised Anomaly Detection via Masked Diffusion Posterior Sampling

Download BibTeX Cite

Proceedings of the Thirty-Third International Joint Conference on Artificial Intelligence. Main Track. Pages 2442-2450.

https://doi.org/10.24963/ijcai.2024/270

Abstract

Reconstruction-based methods have been commonly used for unsupervised anomaly detection, in which a normal image is reconstructed and compared with the given test image to detect and locate anomalies. Recently, diffusion models have shown promising applications for anomaly detection due to their powerful generative ability. However, these models lack strict mathematical support for normal image reconstruction and unexpectedly suffer from low reconstruction quality. To address these issues, this paper proposes a novel and highly-interpretable method named Masked Diffusion Posterior Sampling (MDPS). In MDPS, the problem of normal image reconstruction is mathematically modeled as multiple diffusion posterior sampling for normal images based on the devised masked noisy observation model and the diffusion-based normal image prior under Bayesian framework. Using a metric designed from pixel-level and perceptual-level perspectives, MDPS can effectively compute the difference map between each normal posterior sample and the given test image. Anomaly scores are obtained by averaging all difference maps for multiple posterior samples. Exhaustive experiments on MVTec and BTAD datasets demonstrate that MDPS can achieve state-of-the-art performance in normal image reconstruction quality as well as anomaly detection and localization.

  1. [Akc ¸ay et al., 2019] Samet Akc ¸ay, Amir Atapour- Abarghouei, and Toby P Breckon. Skip-GANomaly: Skip connected and adversarially trained encoder-decoder anomaly detection. In International Joint Conference on Neural Networks (IJCNN), pages 1-8. IEEE, 2019.
  2. [Baur et al., 2021] Christoph Baur, Stefan Denner, Benedikt Wiestler, Nassir Navab, and Shadi Albarqouni. Autoen- coders for unsupervised anomaly segmentation in brain mr images: A comparative study. Medical Image Analysis, 69:101952, 2021.
  3. [Bercea et al., 2023] Cosmin I. Bercea, Michael Neumayr, Daniel Rueckert, and Julia A Schnabel. Mask, stitch, and re-sample: Enhancing robustness and generalizability in anomaly detection through automatic diffusion models. In ICML 3rd Workshop on Interpretable Machine Learning in Healthcare (IMLH), 2023.
  4. [Bergmann. et al., 2019] Paul Bergmann., Sindy Löwe., Michael Fauser., David Sattlegger., and Carsten Steger. Improving unsupervised defect segmentation by applying structural similarity to autoencoders. In International Joint Conference on Computer Vision, Imaging and Computer Graphics Theory and Applications (VISIGRAPP), pages 372-380. INSTICC, SciTePress, 2019.
  5. [Bergmann et al., 2021] Paul Bergmann, Kilian Batzner, Michael Fauser, David Sattlegger, and Carsten Steger. The MVTec anomaly detection dataset: a comprehensive real- world dataset for unsupervised anomaly detection. Inter- national Journal of Computer Vision, 129(4):1038-1059, 2021.
  6. [Chung et al., 2023] Hyungjin Chung, Jeongsol Kim, Michael Thompson Mccann, Marc Louis Klasky, and Jong Chul Ye. Diffusion posterior sampling for general noisy inverse problems. In International Conference on Learning Representations (ICLR), 2023.
  7. [Contreras-Cruz et al., 2023] Marco A. Contreras-Cruz, Fer- nando E. Correa-Tome, Rigoberto Lopez-Padilla, and Juan-Pablo Ramirez-Paredes. Generative adversarial net- works for anomaly detection in aerial images. Computers and Electrical Engineering, 106:108470, 2023.
  8. [Defard et al., 2021] Thomas Defard, Aleksandr Setkov, An- gelique Loesch, and Romaric Audigier. Padim: a patch distribution modeling framework for anomaly detection and localization. In International Conference on Pattern Recognition (ICPR), pages 475-489. Springer, 2021.
  9. [Dehaene et al., 2020] David Dehaene, Oriel Frigo, Sébastien Combrexelle, and Pierre Eline. Iterative energy-based projection on a normal data manifold for anomaly localization. In International Conference on Learning Representations (ICLR), 2020.
  10. [Dhariwal and Nichol, 2021] Prafulla Dhariwal and Alexan- der Nichol. Diffusion models beat gans on image synthe- sis. Advances in Neural Information Processing Systems (NIPS), 34:8780-8794, 2021.
  11. [Diers and Pigorsch, 2023] Jan Diers and Christian Pig- orsch. A survey of methods for automated quality con- trol based on images. International Journal of Computer Vision, pages 1-29, 2023.
  12. [Gonzalez-Jimenez et al., 2023] Alvaro Gonzalez-Jimenez, Simone Lionetti, Marc Pouly, and Alexander A Navarini. Sano: Score-based diffusion model for anomaly localiza- tion in dermatology. In IEEE Conference on Computer Vi- sion and Pattern Recognition (CVPR), pages 2987-2993, 2023.
  13. [Ho et al., 2020] Jonathan Ho, Ajay Jain, and Pieter Abbeel. Denoising diffusion probabilistic models. Advances in Neural Information Processing Systems (NIPS), 33:6840- 6851, 2020.
  14. [Lei et al., 2023] Jiarui Lei, Xiaobo Hu, Yue Wang, and Dong Liu. Pyramidflow: High-resolution defect con- trastive localization using pyramid normalizing flow. In IEEE Conference on Computer Vision and Pattern Recog- nition (CVPR), pages 14143-14152, 2023.
  15. [Liu et al., 2020] Wenqian Liu, Runze Li, Meng Zheng, Srikrishna Karanam, Ziyan Wu, Bir Bhanu, Richard J Radke, and Octavia Camps. Towards visually explain- ing variational autoencoders. In IEEE Conference on Computer Vision and Pattern Recognition (CVPR), pages 8642-8651, 2020.
  16. [Liu et al., 2023] Ruikang Liu, Weiming Liu, Zhongxing Zheng, Liang Wang, Liang Mao, Qisheng Qiu, and Guangzheng Ling. Anomaly-gan: A data augmentation method for train surface anomaly detection. Expert Sys- tems with Applications, 228:120284, 2023.
  17. [Lu et al., 2023] Fanbin Lu, Xufeng Yao, Chi-Wing Fu, and Jiaya Jia. Removing anomalies as noises for industrial defect localization. In IEEE International Conference on Computer Vision (ICCV), pages 16166-16175, 2023.
  18. [Mishra et al., 2021] Pankaj Mishra, Riccardo Verk, Daniele Fornasier, Claudio Piciarelli, and Gian Luca Foresti. Vt- adl: A vision transformer network for image anomaly de- tection and localization. In International Symposium on Industrial Electronics (ISIE), pages 01-06. IEEE, 2021.
  19. [Pinaya et al., 2022] Walter H. L. Pinaya, Mark S. Graham, and et al. Fast unsupervised brain anomaly detection and segmentation with diffusion models. In International Conference on Medical image computing and computer- assisted intervention, pages 705-714. Springer, 2022.
  20. [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 IEEE Conference on Computer Vision and Pattern Recognition (CVPR), pages 14318-14328, 2022.
  21. [Ruff et al., 2021] Lukas Ruff, Jacob R Kauffmann, Robert A Vandermeulen, Grégoire Montavon, Woj- ciech Samek, Marius Kloft, Thomas G Dietterich, and Klaus-Robert Müller. A unifying review of deep and shallow anomaly detection. Proceedings of the IEEE, 109(5):756-795, 2021.
  22. [Schlegl et al., 2017] Thomas Schlegl, Philipp Seeböck, Se- bastian M Waldstein, Ursula Schmidt-Erfurth, and Georg Langs. Unsupervised anomaly detection with generative adversarial networks to guide marker discovery. In Inter- national Conference on Information Processing in Medi- cal Imaging, pages 146-157. Springer, 2017.
  23. [Schlegl et al., 2019] Thomas Schlegl, Philipp Seeböck, Se- bastian M Waldstein, Georg Langs, and Ursula Schmidt- Erfurth. f-anogan: Fast unsupervised anomaly detection with generative adversarial networks. Medical image anal- ysis, 54:30-44, 2019.
  24. [Song et al., 2021a] Jiaming Song, Chenlin Meng, and Ste- fano Ermon. Denoising diffusion implicit models. In Inter- national Conference on Learning Representations (ICLR), 2021.
  25. [Song et al., 2021b] Yang Song, Jascha Sohl-Dickstein, Diederik P Kingma, Abhishek Kumar, Stefano Ermon, and Ben Poole. Score-based generative modeling through stochastic differential equations. In International Confer- ence on Learning Representations (ICLR), 2021.
  26. [Song et al., 2022] Jouwon Song, Kyeongbo Kong, Ye-In Park, Seong-Gyun Kim, and Suk-Ju Kang. Anomaly seg- mentation network using self-supervised learning. In AAAI Workshop on AI for Design and Manufacturing (ADAM), 2022.
  27. [Sun et al., 2023] Zhongju Sun, Jian Wang, and Yakun Li. Ramfae: a novel unsupervised visual anomaly detection method based on autoencoder. International Journal of Machine Learning and Cybernetics, 2023.
  28. [Tang et al., 2020] Ta-Wei Tang, Wei-Han Kuo, Jauh-Hsiang Lan, Chien-Fang Ding, Hakiem Hsu, and Hong-Tsu Young. Anomaly detection neural network with dual auto- encoders gan and its industrial inspection applications. Sensors, 20(12):3336, 2020.
  29. [Wolleb et al., 2022] Julia Wolleb, Florentin Bieder, Robin Sandkühler, and Philippe C Cattin. Diffusion models for medical anomaly detection. In International Conference on Medical image computing and computer-assisted inter- vention, pages 35-45. Springer, 2022.
  30. [Wyatt et al., 2022] Julian Wyatt, Adam Leach, Sebastian M Schmon, and Chris G Willcocks. Anoddpm: Anomaly de- tection with denoising diffusion probabilistic models using simplex noise. In IEEE Conference on Computer Vision and Pattern Recognition (CVPR), pages 650-656, 2022.
  31. [Xia et al., 2022] Xuan Xia, Xizhou Pan, Nan Li, Xing He, Lin Ma, Xiaoguang Zhang, and Ning Ding. Gan-based anomaly detection: A review. Neurocomputing, 493:497- 535, 2022.
  32. [You et al., 2022a] Zhiyuan You, Lei Cui, Yujun Shen, Kai Yang, Xin Lu, Yu Zheng, and Xinyi Le. A unified model for multi-class anomaly detection. Advances in Neural Information Processing Systems (NIPS), 35:4571-4584, 2022.
  33. [You et al., 2022b] Zhiyuan You, Kai Yang, Wenhan Luo, Lei Cui, Yu Zheng, and Xinyi Le. ADTR: Anomaly de- tection transformer with feature reconstruction. In In- ternational Conference on Neural Information Processing (ICONIP), pages 298-310. Springer, 2022.
  34. [Zagoruyko and Komodakis, 2016] Sergey Zagoruyko and Nikos Komodakis. Wide residual networks. In British Machine Vision Conference (BMVC), 2016.
  35. [Zavrtanik et al., 2021] Vitjan Zavrtanik, Matej Kristan, and Danijel Skočaj. Draem-a discriminatively trained re- construction embedding for surface anomaly detection. In IEEE International Conference on Computer Vision (ICCV), pages 8330-8339, 2021.
  36. [Zhang et al., 2018] Richard Zhang, Phillip Isola, Alexei A Efros, Eli Shechtman, and Oliver Wang. The unreasonable effectiveness of deep features as a perceptual metric. In IEEE Conference on Computer Vision and Pattern Recog- nition (CVPR), pages 586-595, 2018.

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

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