spot_img
HomeResearch & DevelopmentUnsupervised Anomaly Detection: Balancing Local and Global Patterns

Unsupervised Anomaly Detection: Balancing Local and Global Patterns

TLDR: PRADOT is a novel unsupervised anomaly detection method that learns local and global ‘prototypes’ (representations of normal data) using optimal transport. It introduces a unique cost function that considers both feature similarity and spatial location, allowing it to better detect subtle, logical anomalies in images, alongside traditional structural defects. The method shows competitive performance on industrial image datasets like MVTec AD and MVTec AD LOCO, demonstrating its ability to capture the underlying organization of normal samples and improve the detection of incoherencies.

Unsupervised Anomaly Detection (UAD) is a crucial field in artificial intelligence, focusing on identifying unusual or defective parts within a sample without prior knowledge of what those defects might look like. This approach is particularly valuable in areas like industrial inspection and medical imaging, where obtaining labeled data for every possible anomaly is either too expensive or could introduce biases, limiting the detection of new or rare issues.

Traditional anomaly detection methods often struggle with complex, ‘logical’ anomalies – those that violate the expected structural or semantic organization of an image, rather than just being simple dents or scratches. This challenge has led researchers to explore new ways to capture the intricate patterns of normal data.

A recent research paper, titled “Learning local and global prototypes with optimal transport for unsupervised anomaly detection and localization,” introduces a novel UAD method called PRADOT (Prototype-based Anomaly Detection with Optimal Transport). Developed by Robin Trombetta and Carole Lartizien, PRADOT aims to overcome these limitations by learning both local and global representations of normal data, known as ‘prototypes’.

How PRADOT Works

At its core, PRADOT leverages a pre-trained image encoder, like ResNet50, to extract deep features from images. The key innovation lies in how it learns and uses prototypes. Prototypes are essentially discrete, representative features that capture the essence of normal patterns. PRADOT employs a mathematical framework called ‘optimal transport’ to efficiently learn these prototypes.

Optimal transport is a powerful tool for comparing probability distributions by finding the most cost-effective way to transform one distribution into another. In PRADOT, it’s used to assign each extracted image feature to its closest prototype, considering a unique ‘cost function’. This cost function is a blend of two components: a ‘feature-based cost’ (how similar the features are) and a ‘spatial-based cost’ (how close they are in terms of their location within the image). By adjusting a hyperparameter called ‘alpha’, the model can balance these two costs, allowing it to learn prototypes that are either more ‘global’ (focusing purely on feature similarity) or more ‘local’ (also considering spatial coherence).

During training, the model processes images in batches, extracting features and then using optimal transport to assign these features to the prototypes. The prototypes are then updated based on these assignments. At the testing phase, for any new image, the model calculates the minimum distance between its features and the learned prototypes. A higher distance indicates a greater likelihood of an anomaly. This process generates an ‘anomaly map’ that highlights the defective regions, and an overall image-level anomaly score.

Performance and Insights

The researchers evaluated PRADOT on two standard benchmarks for industrial image anomaly detection: MVTec AD and MVTec AD LOCO. MVTec AD LOCO is particularly important as it includes more complex, logical anomalies.

PRADOT demonstrated competitive performance, ranking second among compared methods on MVTec AD LOCO for both image-level classification and pixel-level localization. While it outperformed memory-based methods like PatchCore on logical anomalies, PatchCore still held an edge on MVTec AD, which primarily contains structural defects. This highlights PRADOT’s strength in identifying subtle incoherencies due to its ability to enforce structural constraints during prototype learning.

Ablation studies revealed several important insights. Averaging predictions from both global (alpha=0) and local (alpha>0) prototypes, as well as aggregating information from multiple feature scales, significantly improved performance. The number of prototypes per grid cell and the batch size also played crucial roles, with higher numbers generally leading to better results, though the model doesn’t require excessively large batch sizes.

The ‘alpha’ parameter’s impact was particularly interesting. A higher alpha value, which emphasizes the spatial constraint, proved more beneficial for detecting logical anomalies. Conversely, a lower alpha was better for structural imperfections. This confirms that PRADOT’s tailored cost function allows it to adapt to different types of anomalies.

The paper also includes visualizations that show how prototypes can be ‘reconstructed’ into image patches, demonstrating that the model learns semantically coherent representations. Furthermore, visualizations of the latent space illustrate how increasing alpha forces embeddings and prototypes to be more spatially coherent, aiding in the detection of logical inconsistencies.

Also Read:

Conclusion

PRADOT offers a robust and comprehensible approach to unsupervised anomaly detection. By combining prototype learning with optimal transport and a flexible cost function, it effectively captures the underlying organization of normal samples, leading to improved detection of both structural and logical anomalies. The simplicity and interpretability of the method make it a promising tool for various real-world applications. For more technical details, you can refer to the full research paper here.

Meera Iyer
Meera Iyerhttps://blogs.edgentiq.com
Meera Iyer is an AI news editor who blends journalistic rigor with storytelling elegance. Formerly a content strategist in a leading tech firm, Meera now tracks the pulse of India's Generative AI scene, from policy updates to academic breakthroughs. She's particularly focused on bringing nuanced, balanced perspectives to the fast-evolving world of AI-powered tools and media. You can reach her out at: [email protected]

- Advertisement -

spot_img

Gen AI News and Updates

spot_img

- Advertisement -