[Paper Review] PaDiM: a Patch Distribution Modeling Framework for Anomaly Detection and Localization
PaDiM proposes a novel one-class anomaly detection and localization framework using patch distribution modeling with pretrained CNNs and multivariate Gaussian distributions to model normal image patches. It achieves state-of-the-art performance on MVTec AD and STC datasets with low inference time and memory complexity, outperforming prior methods especially on non-aligned data.
We present a new framework for Patch Distribution Modeling, PaDiM, to concurrently detect and localize anomalies in images in a one-class learning setting. PaDiM makes use of a pretrained convolutional neural network (CNN) for patch embedding, and of multivariate Gaussian distributions to get a probabilistic representation of the normal class. It also exploits correlations between the different semantic levels of CNN to better localize anomalies. PaDiM outperforms current state-of-the-art approaches for both anomaly detection and localization on the MVTec AD and STC datasets. To match real-world visual industrial inspection, we extend the evaluation protocol to assess performance of anomaly localization algorithms on non-aligned dataset. The state-of-the-art performance and low complexity of PaDiM make it a good candidate for many industrial applications.
Motivation & Objective
- Address the challenge of anomaly detection and localization in industrial visual inspection where anomalies are rare and unlabeled.
- Overcome scalability issues of existing methods that rely on K-NN or fine-tuned deep networks during inference.
- Develop a method with low time and memory complexity independent of training dataset size for real-world deployment.
- Improve localization accuracy by modeling correlations across multiple semantic levels of a pretrained CNN.
- Extend evaluation to non-aligned datasets to better reflect real-world industrial inspection conditions.
Proposed method
- Utilizes a pretrained convolutional neural network (CNN) to extract patch-level embeddings from multiple feature map layers.
- Models each spatial patch position as a multivariate Gaussian distribution with learned mean μ and covariance Σ from training embeddings.
- Leverages cross-level correlations between different semantic levels of the CNN to improve localization precision.
- Computes anomaly scores using Mahalanobis distance in the embedded space, combining information from multiple layers.
- Employs a patch-based, non-parametric approach that avoids training deep networks at test time.
- Supports flexible backbone selection (e.g., ResNet-18, ResNet-50) to balance accuracy and inference speed.
Experimental results
Research questions
- RQ1Can a patch distribution modeling approach using pretrained CNNs achieve state-of-the-art performance in anomaly detection and localization?
- RQ2How does PaDiM perform on non-aligned datasets, which better reflect real-world industrial inspection scenarios?
- RQ3Does modeling cross-level correlations in CNN features improve localization accuracy compared to single-level approaches?
- RQ4Can PaDiM maintain low inference time and memory usage while outperforming K-NN-based or autoencoder-based methods?
- RQ5How does the method scale with increasing input resolution and dataset size in terms of time and memory complexity?
Key findings
- PaDiM achieves SOTA AUROC of 92.4% on all texture classes and 92.2% on all classes in the non-aligned MVTec AD benchmark.
- On the STC dataset, PaDiM-WR50-Rd550 achieves 92.1% AUROC on object classes and 70.8% PRO-score, outperforming VAE and SPADE.
- PaDiM’s performance degrades by only 5.3 percentage points on non-aligned MVTec AD, compared to 12.2 and 8.8 points for VAE and SPADE respectively.
- PaDiM-WR50-Rd550 has an inference time of 0.95 seconds on MVTec AD (CPU), significantly faster than SPADE’s 7.10 seconds with the same backbone.
- Memory usage of PaDiM is independent of training set size, requiring only 3.8 GB for MVTec AD and 5.2 GB for STC, compared to 37.0 GB for SPADE on STC.
- PaDiM’s training time is 150 seconds per class on MVTec AD (CPU), far faster than VAE’s 2h40 per class on a GPU, and avoids any fine-tuning.
Read this paper
Open the full text in the Nubint reader and ask about any passage as you read.
Read this paper on NubintThis review was generated by AI from the original paper. Please check the paper before citing it.