TL;DR
SeaS (Separation and Sharing Fine-tuning) is a unified diffusion-based framework designed for industrial visual inspection that generates diverse anomaly images, globally consistent normal product images, and sharp, pixel-accurate defect masks within a single model per product. By explicitly modeling the visual asymmetry between uniform normal surfaces and highly erratic defects, SeaS significantly boosts performance across downstream unsupervised, synthesis-based, and fully supervised anomaly detection models.
What Problem Does This Paper Address?
Training effective defect detection and segmentation models in industrial settings is notoriously difficult due to extreme data scarcity: real-world production yields millions of normal products but very few defective samples.
Existing synthetic data solutions suffer from key limitations:
- Isolated capability: Prior approaches either only generate defects (often blending them onto existing normal images using rigid masks, which yields boundary artifacts) or only generate normal images.
- Model sprawl: Methods like DFMGAN require training separate, dedicated generator networks for every single defect category and for normal samples.
- Imprecise mask generation: Standard diffusion-based segmentation tools upsample low-resolution cross-attention maps, resulting in fuzzy, unreliable defect masks that degrade supervised segmentation training.
Methods
SeaS fine-tunes a pre-trained Stable Diffusion (v1-4) backbone using a shared U-Net that decouples product-level and defect-level representations:
[Normal Images] --> NA Loss (a <ob>) --------------------\
+--> Shared U-Net --> Discriminative Features
[Abnormal Images] --> DA Loss (a <ob> with <df1>..<dfN>) --/ |
v
[High-Res VAE Decoder Features] ----------------------------------------------> Refined Mask Prediction (RMP)
|
v
Pixel-Accurate Mask
- Unbalanced Abnormal (UA) Text Prompt: Rather than generic prompts like "damaged bottle", SeaS uses an asymmetric prompt:
a <ob> with <df1>, <df2>, ..., <dfN>. A single<ob>token models the globally uniform normal product, while multiple<dfn>tokens capture varied, localized defect attributes. - Decoupled Anomaly Alignment (DA) Loss: During defect training, DA loss aligns the cross-attention maps of
<dfn>tokens to ground-truth defect regions while suppressing<ob>activation inside anomaly regions. Averaging token responses allows recombination into novel, unseen defect variations. - Normal-image Alignment (NA) Loss: To preserve background fidelity without overfitting to the small set of defect images, normal images are simultaneously fed using only the
<ob>prompt. - Mixed Training: Batches uniformly mix normal and abnormal images across all defect types for a given product, training a single shared U-Net.
- Refined Mask Prediction (RMP) Branch: Directly predicting masks from diffusion cross-attention produces coarse, blurry boundaries. RMP fuses discriminative, mid-level U-Net decoder features (
up-2andup-3) with high-resolution structural features from the VAE decoder across three progressive Mask Refinement Modules (MRMs), supervised with Focal Loss.
Datasets
The authors evaluate SeaS on three standard industrial anomaly benchmarks:
- MVTec AD: 15 industrial product categories with up to 8 defect classes each.
- VisA: 12 object categories spanning 3 industrial domains.
- MVTec 3D AD (RGB images only): 10 product categories featuring complex geometric poses and varying illumination conditions.
Note: No new benchmark datasets are introduced.
Key Insights and Ideas
- Symmetry in prompts harms generation: Industrial defect synthesis has an inherent structural asymmetry—products must remain globally identical and authentic, while defects need maximum shape, color, and texture diversity. Standard prompt tuning treats both equally; assigning $1$ token to the base product and $N$ tokens to the anomaly explicitly mirrors physical reality.
- Attention decoupling unlocks combinatorial defects: Forcing individual defect tokens to latch onto separate visual attributes allows the model to mix features at inference time, synthesizing plausible anomalies never present in the few-shot training set.
- U-Net semantics + VAE edges: U-Net latent features are semantically rich (they know what is a defect vs. background) but spatially coarse. VAE decoder skip features retain pixel-level edge details but lack semantic context. Merging them in a progressive refinement module produces crisp, pixel-aligned masks without manual post-processing.
Key Results
- Generation Quality & Diversity: SeaS achieves leading Inception Scores (1.88 on MVTec AD, 1.95 on MVTec 3D AD) and intra-cluster diversity (IC-LPIPS of 0.34 and 0.30), outperforming GAN baselines (DFMGAN) and diffusion alternatives (AnomalyDiffusion) in both defect variation (IC-LPIPS(a)) and normal fidelity (KID).
- Downstream Synthesis-Based AD: Replacing synthetic pseudo-defects in DRAEM and GLASS with SeaS-generated anomalies improves average pixel-level Average Precision (AP) by +8.66%.
- Downstream Unsupervised AD: Augmenting normal training splits for PatchCore, HVQ-Trans, and MambaAD yields an average +1.10% gain in image-level AP by eliminating false positives.
- Supervised Segmentation: Training off-the-shelf segmentation models (BiSeNet V2, UPerNet, LFD) using 1,000 SeaS-generated image–mask pairs per defect type yields massive improvements, outperforming previous generative approaches by an average +12.79% IoU (+11.17% on MVTec AD, +11.71% on VisA, and +15.49% on MVTec 3D AD).
Limitations and Future Work
- Per-Product Fine-Tuning: While SeaS unifies all defect types and normal generation into one network, it still trains a separate model per product category rather than a single universal model for all industrial domains.
- Reliance on Masked Seeds: The pipeline operates in a few-shot setting (requiring roughly one-third of available anomaly samples with manual masks), making it dependent on having at least a handful of labeled real defects.
- Inference Latency: Relying on multi-step iterative latent diffusion sampling during data synthesis is computationally heavier than one-pass GAN-based generation methods.
Summary updated