FADE: A Detector-Oriented Few-Shot Anomaly Diffusion Engine for Industrial Visual Inspection
Abstract
Visual defect detection in manufacturing is constrained by the scarcity of real anomalous samples and by imbalance across defect categories and scales. This paper presents FADE (Few-shot Anomaly Diffusion Engine), a detector-oriented anomaly synthesis framework that transfers anomaly-related priors from large-scale pre-training to few-shot target-domain adaptation. FADE contains three components. Mask-Guided Attention extracts defect-focused visual conditioning tokens from an anomaly reference crop and its local anomaly mask, which separates reference-side defect appearance from target-side background content during localized synthesis. Dual-Reweighting for Class and Scale Imbalance modifies the denoising objective according to class frequency and defect area, reducing the dominance of frequent categories and nearly crop-filling easy samples. Difference-Based Precision Annotation converts residual differences between the synthesized anomalous image and the original normal target image into detector-compatible synthetic boxes under the global spatial constraint mask. The pipeline therefore couples offline anomaly synthesis with detector supervision for downstream localization. Experiments on a few-shot metallic-surface benchmark show that FADE preserves target-background consistency, maintains feature-space proximity to real defects, and improves detector training. Augmenting YOLOv8-m with 100 automatically annotated FADE instances increases mAP@0.5 from 51.8% to 70.1% and mAP@0.5:0.95 from 40.7% to 55.7% on the custom benchmark. On a five-category MVTec AD protocol, the corresponding scores increase from 72.8% to 83.2% and from 51.6% to 62.4%, respectively. Because generation and annotation are performed offline, the deployed detector and its inference cost remain unchanged.