This paper proposes a novel method for unsupervised anomaly detection (UAD). This method is based on prototype learning and introduces a novel metric that balances feature-based and spatial-based costs. Leveraging this metric, we learn local and global prototypes using optimal transport from latent representations extracted by a pre-trained image encoder. We demonstrate that structural constraints applied during prototype learning allow us to capture the underlying structure of normal samples, thereby enabling more effective detection of image anomalies. We achieve comparable performance to robust baseline models on two benchmarks for industrial image anomaly detection.