Improving Anomaly Detection with Foundation-Model Synthesis and Wavelet-Domain Attention

Wensheng Wu, Zheming Lu, Ziqian Lu, Zewei He, Xuecheng Sun, Zhao Wang, Jungong Han, Yunlong YuarXiv 2026

TL;DR

This paper introduces a two-pronged strategy to supercharge industrial anomaly detection: FMAS, a training-free pipeline that uses foundation models (GPT-4, SAM, Stable Diffusion) to synthesize highly realistic defects, and WDAM, a plug-and-play wavelet-based attention module that sharpens a model's focus on anomaly-sensitive frequency bands. Together, they achieve state-of-the-art performance on major benchmarks with minimal computational overhead.

What Problem Does This Paper Address?

In the world of industrial manufacturing, anomalies (like scratches, dents, or missing components) are rare. This "data scarcity" makes training robust AI models difficult. Most current methods rely on unsupervised learning (training only on normal samples) or synthetic anomalies.

However, existing synthetic methods fall into two traps:

  1. Non-generative methods (like CutPaste) create "fake" defects that look like crude cut-and-paste jobs, failing to capture the complex textures of real-world damage.
  2. Generative methods (like GANs or Diffusion) produce better results but usually require extensive training or fine-tuning for every new object type.

Furthermore, standard neural networks often treat all image features equally, potentially missing subtle "frequency-domain" signatures—like the high-frequency jitter of a scratch—that distinguish a defect from a normal texture.

Methods

The authors propose two major innovations:

1. FMAS (Foundation Model-based Anomaly Synthesis)

Instead of training a new model to create defects, FMAS leverages the "common sense" of existing foundation models. As shown in the pipeline below, it works in three steps:

  • Prompting: GPT-4 generates descriptive text prompts based on the object class.
  • Masking: The Segment Anything Model (SAM) identifies the foreground object, ensuring defects aren't accidentally placed in the background.
  • Inpainting: Stable Diffusion uses the prompts and masks to "paint" realistic anomalies onto normal images.
  • Selection: An LPIPS-based filtering mechanism (the "Selector") keeps only the most plausible-looking samples.
Figure 3: Illustration of the proposed foundation model-based anomaly synthesis pipeline (FMAS).

2. WDAM (Wavelet Domain Attention Module)

Industrial defects often show up more clearly in specific frequency bands. WDAM uses the Discrete Wavelet Transform (DWT) to decompose feature maps into four sub-bands: Low-Low (LL), Low-High (LH), High-Low (HL), and High-High (HH).

Figure 4: The proposed Wavelet Domain Attention Module (WDAM) processes input feature maps through a frequency-aware attention mechanism. First, WDAM decomposes the spatial features into multiple frequency sub-bands using Discrete Wavelet Transform (DWT). An adaptive attention mechanism then selectively enhances or suppresses features in each sub-band based on their relevance to anomaly detection. Finally, the refined frequency components are reconstructed back into the spatial domain via Inverse Discrete Wavelet Transform (IDWT), effectively preserving critical defect-related patterns while suppressing noise.

By applying a learnable attention mechanism to these sub-bands, the model can dynamically "turn up the volume" on frequency components that signal a defect while suppressing background noise.

Datasets

The researchers evaluated their approach on two gold-standard industrial benchmarks:

  • MVTec AD: 15 categories of industrial objects and textures (e.g., bottles, cables, wood).
  • VisA: 12 categories of complex objects (e.g., printed circuit boards, cashew nuts).

They also used these to create two new synthetic datasets perfectly aligned with the benchmarks to prove the realism of their FMAS approach.

Key Insights and Ideas

  • Anomalies are Frequency-Specific: The authors observed that defects aren't distributed evenly across frequencies. For example, a scratch might be invisible in the low-frequency (LL) band but pop out in the high-frequency (HH) band. WDAM exploits this "spectral signature."
  • Foundation Models are "Zero-Shot" Defect Experts: By using GPT-4 and Stable Diffusion, the system can generate realistic defects for a new product (like a specific type of screw) immediately, without needing hundreds of real examples of broken screws to train on.
  • Realism Matters: The synthetic anomalies produced by FMAS achieved significantly lower FID (Fréchet Inception Distance) scores than previous methods, meaning they are statistically much closer to real-world defects.
Figure 1: Qualitative results showing anomaly samples generated by the proposed FMAS on the MVTec AD dataset, with red contours highlighting the anomalous regions.

Key Results

The combination of FMAS and WDAM provided a massive boost to existing baselines:

  • Performance Leap: Integrating these tools into the CutPaste baseline increased the average image-level AUROC by 4.77% and the Per-Region Overlap (PRO) score by a staggering 14.53% on MVTec AD.
  • State-of-the-Art: The final model outperformed recent high-performance competitors like EawT and AST on the VisA dataset.
  • Efficiency: Despite the added complexity, WDAM only adds a tiny amount of parameter overhead (increasing a WideResNet50-2 from 67.40MB to 67.59MB) and maintains fast inference times.

Limitations and Future Work

While FMAS creates visually and statistically realistic defects, the authors note that it doesn't strictly enforce physical authenticity. For instance, it might generate a "plausible-looking" crack that wouldn't actually occur given the material properties of the object.

Future work could involve:

  • Incorporating domain-specific physical constraints to ensure defects are physically possible.
  • Automating the parameter selection for Stable Diffusion, which currently requires some manual tuning.

Summary updated

BibTeX
@misc{wu2026improving,
  author = {Wensheng Wu and Zheming Lu and Ziqian Lu and Zewei He and Xuecheng Sun and Zhao Wang and Jungong Han and Yunlong Yu},
  title = {{Improving Anomaly Detection with Foundation-Model Synthesis and Wavelet-Domain Attention}},
  year = {2026},
  eprint = {2603.02964},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2603.02964},
}
Figure