Visual quality inspection requires anomaly detection using limited defect data and accurate spatial localisation. This study evaluates Patch Distribution Modeling (PaDiM), a one-class framework that generates pixel-level anomaly maps using Mahalanobis distance scoring, across three purposively selected categories from each of the MVTec AD and VisA datasets and all three categories of BTAD. Dataset-level results for MVTec AD and VisA are reported as subset means, whereas the BTAD mean represents the complete three-category benchmark. Using ResNet-18, the mean pixel-level AUROC values were 0.9713 for MVTec AD, 0.9835 for VisA, and 0.9764 for BTAD, while the mean image-level AUROC ranged from 0.8194 to 0.9381. For the MVTec AD bottle category, Wide-ResNet-50-2 improved all four evaluation metrics, achieving an image-level AUROC of 1.0000. Counterfactual masking was performed to assess whether regions with high anomaly scores contributed to the image-level anomaly score. Masking the highest-scoring 5% of pixels reduced the score by 10.98%, compared with a 2.08% increase for a size-matched random control and no change (0.00%) for an inverse control. These findings indicate that the highlighted regions contributed more substantially to the anomaly score than either size-matched control, although their removal did not eliminate the remaining anomaly evidence. For the VisA candle category, a high pixel-level AUROC of 0.9827 was accompanied by a low mean intersection-over-union of 0.091, demonstrating that strong pixel-level anomaly ranking does not necessarily translate into accurate spatial overlap with actual defects. Overall, this study demonstrates the potential of PaDiM for anomaly detection while emphasising the limitations of spatial localisation. Its contribution lies in providing empirically evaluated and explicitly bounded spatial localisation rather than a direct explanation of the model's decision-making process.
SUBMITTED: 29 June 2026
ACCEPTED: 11 October 2026
PUBLISHED:
19 October 2026
SUBMITTED to ACCEPTED: 104 days
DOI:
https://doi.org/10.53623/amms.v3i1.1281