Unsupervised Anomaly Detection via Masked Diffusion Posterior Sampling

Read original: arXiv:2404.17900 - Published 4/30/2024 by Di Wu, Shicai Fan, Xue Zhou, Li Yu, Yuzhong Deng, Jianxiao Zou, Baihong Lin
Total Score

0

Unsupervised Anomaly Detection via Masked Diffusion Posterior Sampling

Sign in to get full access

or

If you already have an account, we'll log you in

Overview

  • This paper introduces a novel unsupervised anomaly detection method called Masked Diffusion Posterior Sampling (MDPS).
  • MDPS leverages a diffusion model to learn a representation of normal data, and then uses that representation to identify anomalies.
  • The key idea is to mask out parts of the input data and have the diffusion model reconstruct the missing information, with anomalous samples being harder to reconstruct.

Plain English Explanation

Unsupervised Anomaly Detection via Masked Diffusion Posterior Sampling presents a new way to identify unusual or "anomalous" data points without any labeled examples. The approach uses a type of AI model called a "diffusion model" to learn what normal data looks like.

The diffusion model is trained on a large dataset of normal samples. It learns to take a noisy version of the data, and gradually remove the noise to reconstruct the original. Anomalous samples are then identified as ones that are harder for the diffusion model to reconstruct accurately.

This is done by randomly "masking out" parts of the input data, and seeing how well the diffusion model can fill in the missing information. Normal samples are easy to reconstruct, while anomalous ones are more difficult. The difference in reconstruction quality is used as an anomaly score.

This technique builds on previous work in self-supervised representation learning and diffusion-based anomaly detection. The key innovation is using the diffusion posterior sampling process to efficiently identify anomalies without the need for any labeled data.

Technical Explanation

The core idea of Unsupervised Anomaly Detection via Masked Diffusion Posterior Sampling is to leverage a pre-trained diffusion model to learn a representation of normal data, and then use that representation to detect anomalies.

The method works as follows:

  1. Train a diffusion model on a large dataset of normal samples. This teaches the model to gradually remove noise from the data and reconstruct the original.
  2. For a given input, randomly mask out some of the features.
  3. Use the trained diffusion model to reconstruct the missing parts of the input.
  4. Compute an anomaly score based on the reconstruction quality - anomalous samples will be harder to reconstruct accurately.

This builds on prior work in self-supervised representation learning with masked diffusion and diffusion-based anomaly detection. The key innovation is leveraging the diffusion posterior sampling process to efficiently identify anomalies without any labeled data.

The authors evaluate their approach on several real-world anomaly detection datasets, and show that it outperforms other unsupervised methods. They also provide theoretical analysis to understand the properties of the learned representations.

Critical Analysis

The paper presents a promising new approach for unsupervised anomaly detection that builds on recent advances in diffusion models and self-supervised learning. A few potential limitations or areas for further research:

  • The method relies on having a large, representative dataset of "normal" samples to train the diffusion model. In practice, obtaining such a dataset may be challenging, especially for rare or complex anomalies.
  • The authors only evaluate on relatively simple, tabular datasets. More research is needed to understand how well the approach scales to high-dimensional, structured data like images or text.
  • The anomaly scoring mechanism, while intuitive, could potentially be improved. There may be more sophisticated ways to leverage the diffusion process to better distinguish anomalies.
  • The computational complexity of the diffusion model inference may limit the real-time applicability of the method for some use cases. Further efficiency improvements could be explored.

Overall, the Masked Diffusion Posterior Sampling approach is a compelling contribution to the field of unsupervised anomaly detection, and warrants further investigation and development.

Conclusion

Unsupervised Anomaly Detection via Masked Diffusion Posterior Sampling introduces a novel technique for identifying anomalies without any labeled data. By leveraging a pre-trained diffusion model to learn a representation of normal data, the method can effectively spot outliers based on their difficulty to reconstruct.

This work builds on recent advancements in self-supervised learning and diffusion-based models, demonstrating their potential for practical anomaly detection applications. While there are some limitations to address, the proposed approach shows promising results and opens up new directions for unsupervised anomaly detection research.



This summary was produced with help from an AI and may contain inaccuracies - check out the links to read the original source documents!

Follow @aimodelsfyi on 𝕏 →

Related Papers

Unsupervised Anomaly Detection via Masked Diffusion Posterior Sampling
Total Score

0

Unsupervised Anomaly Detection via Masked Diffusion Posterior Sampling

Di Wu, Shicai Fan, Xue Zhou, Li Yu, Yuzhong Deng, Jianxiao Zou, Baihong Lin

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.

Read more

4/30/2024

GLAD: Towards Better Reconstruction with Global and Local Adaptive Diffusion Models for Unsupervised Anomaly Detection
Total Score

0

GLAD: Towards Better Reconstruction with Global and Local Adaptive Diffusion Models for Unsupervised Anomaly Detection

Hang Yao, Ming Liu, Haolin Wang, Zhicun Yin, Zifei Yan, Xiaopeng Hong, Wangmeng Zuo

Diffusion models have shown superior performance on unsupervised anomaly detection tasks. Since trained with normal data only, diffusion models tend to reconstruct normal counterparts of test images with certain noises added. However, these methods treat all potential anomalies equally, which may cause two main problems. From the global perspective, the difficulty of reconstructing images with different anomalies is uneven. Therefore, instead of utilizing the same setting for all samples, we propose to predict a particular denoising step for each sample by evaluating the difference between image contents and the priors extracted from diffusion models. From the local perspective, reconstructing abnormal regions differs from normal areas even in the same image. Theoretically, the diffusion model predicts a noise for each step, typically following a standard Gaussian distribution. However, due to the difference between the anomaly and its potential normal counterpart, the predicted noise in abnormal regions will inevitably deviate from the standard Gaussian distribution. To this end, we propose introducing synthetic abnormal samples in training to encourage the diffusion models to break through the limitation of standard Gaussian distribution, and a spatial-adaptive feature fusion scheme is utilized during inference. With the above modifications, we propose a global and local adaptive diffusion model (abbreviated to GLAD) for unsupervised anomaly detection, which introduces appealing flexibility and achieves anomaly-free reconstruction while retaining as much normal information as possible. Extensive experiments are conducted on three commonly used anomaly detection datasets (MVTec-AD, MPDD, and VisA) and a printed circuit board dataset (PCB-Bank) we integrated, showing the effectiveness of the proposed method.

Read more

9/10/2024

Strategies for CT Reconstruction using Diffusion Posterior Sampling with a Nonlinear Model
Total Score

0

Strategies for CT Reconstruction using Diffusion Posterior Sampling with a Nonlinear Model

Xiao Jiang, Shudong Li, Peiqing Teng, Grace Gang, J. Webster Stayman

Diffusion Posterior Sampling(DPS) methodology is a novel framework that permits nonlinear CT reconstruction by integrating a diffusion prior and an analytic physical system model, allowing for one-time training for different applications. However, baseline DPS can struggle with large variability, hallucinations, and slow reconstruction. This work introduces a number of strategies designed to enhance the stability and efficiency of DPS CT reconstruction. Specifically, jumpstart sampling allows one to skip many reverse time steps, significantly reducing the reconstruction time as well as the sampling variability. Additionally, the likelihood update is modified to simplify the Jacobian computation and improve data consistency more efficiently. Finally, a hyperparameter sweep is conducted to investigate the effects of parameter tuning and to optimize the overall reconstruction performance. Simulation studies demonstrated that the proposed DPS technique achieves up to 46.72% PSNR and 51.50% SSIM enhancement in a low-mAs setting, and an over 31.43% variability reduction in a sparse-view setting. Moreover, reconstruction time is sped up from >23.5 s/slice to <1.5 s/slice. In a physical data study, the proposed DPS exhibits robustness on an anthropomorphic phantom reconstruction which does not strictly follow the prior distribution. Quantitative analysis demonstrates that the proposed DPS can accommodate various dose levels and number of views. With 10% dose, only a 5.60% and 4.84% reduction of PSNR and SSIM was observed for the proposed approach. Both simulation and phantom studies demonstrate that the proposed method can significantly improve reconstruction accuracy and reduce computational costs, greatly enhancing the practicality of DPS CT reconstruction.

Read more

7/19/2024

Provably Robust Score-Based Diffusion Posterior Sampling for Plug-and-Play Image Reconstruction
Total Score

0

Provably Robust Score-Based Diffusion Posterior Sampling for Plug-and-Play Image Reconstruction

Xingyu Xu, Yuejie Chi

In a great number of tasks in science and engineering, the goal is to infer an unknown image from a small number of measurements collected from a known forward model describing certain sensing or imaging modality. Due to resource constraints, this task is often extremely ill-posed, which necessitates the adoption of expressive prior information to regularize the solution space. Score-based diffusion models, due to its impressive empirical success, have emerged as an appealing candidate of an expressive prior in image reconstruction. In order to accommodate diverse tasks at once, it is of great interest to develop efficient, consistent and robust algorithms that incorporate unconditional score functions of an image prior distribution in conjunction with flexible choices of forward models. This work develops an algorithmic framework for employing score-based diffusion models as an expressive data prior in general nonlinear inverse problems. Motivated by the plug-and-play framework in the imaging community, we introduce a diffusion plug-and-play method (DPnP) that alternatively calls two samplers, a proximal consistency sampler based solely on the likelihood function of the forward model, and a denoising diffusion sampler based solely on the score functions of the image prior. The key insight is that denoising under white Gaussian noise can be solved rigorously via both stochastic (i.e., DDPM-type) and deterministic (i.e., DDIM-type) samplers using the unconditional score functions. We establish both asymptotic and non-asymptotic performance guarantees of DPnP, and provide numerical experiments to illustrate its promise in solving both linear and nonlinear image reconstruction tasks. To the best of our knowledge, DPnP is the first provably-robust posterior sampling method for nonlinear inverse problems using unconditional diffusion priors.

Read more

6/13/2024