AnomalyFactory: Regard Anomaly Generation as Unsupervised Anomaly Localization
Ying Zhao
TL;DR
This work tackles the lack of diverse anomalous data for anomaly localization by introducing AnomalyFactory, a unified, cross-domain framework that learns two generators (BootGenerator and FlareGenerator) and one predictor (BlazeDetector) within a shared architecture to handle 82 categories across 5 industrial datasets. It expresses the generation/localization process as $I_{out} = I_{in}\cdot(1-H) + T\cdot H$, enabling concurrent anomaly generation and pixel-level localization; BootGenerator creates baseline anomaly images, FlareGenerator refines both anomaly images and heatmaps, and BlazeDetector performs heatmap-based localization. Across MVTecAD, VisA, MVTecLOCO, MADSim, and RealIAD, the method demonstrates superior generation diversity (higher IS/LPIPS) and accurate heatmaps while remaining scalable with a single model across domains. This approach reduces the need for multiple dataset-specific models and offers a practical path toward unified anomaly synthesis and localization in industrial settings.
Abstract
Recent advances in anomaly generation approaches alleviate the effect of data insufficiency on task of anomaly localization. While effective, most of them learn multiple large generative models on different datasets and cumbersome anomaly prediction models for different classes. To address the limitations, we propose a novel scalable framework, named AnomalyFactory, that unifies unsupervised anomaly generation and localization with same network architecture. It starts with a BootGenerator that combines structure of a target edge map and appearance of a reference color image with the guidance of a learned heatmap. Then, it proceeds with a FlareGenerator that receives supervision signals from the BootGenerator and reforms the heatmap to indicate anomaly locations in the generated image. Finally, it easily transforms the same network architecture to a BlazeDetector that localizes anomaly pixels with the learned heatmap by converting the anomaly images generated by the FlareGenerator to normal images. By manipulating the target edge maps and combining them with various reference images, AnomalyFactory generates authentic and diversity samples cross domains. Comprehensive experiments carried on 5 datasets, including MVTecAD, VisA, MVTecLOCO, MADSim and RealIAD, demonstrate that our approach is superior to competitors in generation capability and scalability.
