Abstract
Unsupervised anomaly detection aims to detect defective parts of a sample byhaving access, during training, to a set of normal, i.e. defect-free, data. Ithas many applications in fields, such as industrial inspection or medicalimaging, where acquiring labels is costly or when we want to avoid introducingbiases in the type of anomalies that can be spotted. In this work, we propose anovel UAD method based on prototype learning and introduce a metric to comparea structured set of embeddings that balances a feature-based cost and aspatial-based cost. We leverage this metric to learn local and globalprototypes with optimal transport from latent representations extracted with apre-trained image encoder. We demonstrate that our approach can enforce astructural constraint when learning the prototypes, allowing to capture theunderlying organization of the normal samples, thus improving the detection ofincoherencies in images. Our model achieves performance that is on par withstrong baselines on two reference benchmarks for anomaly detection onindustrial images.