Unsupervised Industrial Anomaly Detection via Pattern Generative and Contrastive Networks