Title: UniAG: Unified Anomaly Generation via Local Spatial-Texture Alignment Diffusion Model
Primary area: applications to computer vision, audio, language, and other modalities
Keywords: Anomaly Generation, Anomaly detection, Anomaly Localization

Abstract: Few-shot Anomaly Generation (FSAG) aims to enhance anomaly detection by generating realistic and diverse anomalies from a limited set of anomalous examples, addressing the challenge of scarce anomalous data in real-world scenarios. However, existing FSAG methods require training separate models for different anomaly types, leading to low training and deployment efficiency. Most importantly, the lack of sufficient realism and diversity limits the performance of anomaly detectors trained on them. To overcome these limitations, we propose UniAG, a unified model capable of generating realistic and diverse anomalies across multiple categories, thereby improving both generation efficiency and anomaly detection performance. Specifically, we propose a deep copy–paste anomaly generation strategy in which a Spatial-Texture Alignment Diffusion model (STA-DM) learns to fill local region masks with anomaly textures corresponding to user-specified categories. We further propose a novel generation condition with explicit spatial–category guidance instead of text embeddings for diffusion models, enabling realistic and diverse generation.  Experimental results show that UniAG outperforms existing methods both in anomaly generation quality and in downstream anomaly detection performance. Notably, we achieve a new state-of-the-art anomaly localization AUROC/AP performance $\mathbf{99.2/81.0}$ with only $\mathbf{4}$ anomaly examples and $\mathbf{500}$ generated samples for each anomaly on the comprehensive MVTec AD dataset.

TL;DR: We propose UniAG, a unified model that generates realistic and diverse anomalous results across multiple anomaly categories  to enhance anomaly detection tasks.