Spatial Attention Supervision for Defect Localization: Exploiting Ground-Truth Masks as Training Signal in Diffusion-Augmented Defect Detection
Not on the map. Why?
Abstract (arXiv)
Ground-truth defect masks in industrial inspection datasets are typically reserved for evaluation. This paper repurposes them as spatial supervision signals during training of classification networks, teaching a model not just what to predict but where to look. The method adds an activation-based attention alignment loss that steers convolutional feature maps toward defect regions, in a mixed-supervision formulation that also accommodates samples without masks, such as diffusion-generated images. Combined with DDPM augmentation, synthetic images contribute quantity while masks contribute spatial precision. We evaluate 85 models (four CNN backbones under a 2x2 data/training factorial over five seeds, plus a Swin-V2-T transformer baseline) on the MVTec-AD bottle benchmark, with localization measured on held-out defect images excluded from classifier gradient updates. Main findings: (1) attention-guided training improves activation-based localization (Pixel-AUROC) by +18.0% for EfficientNetB0 with augmentation (p=0.005, Cohen's d=2.6) and +18.7% for ResNet50 (p=0.008), significant in four of eight CNN settings (uncorrected for multiple comparisons) with no significant change in classification; (2) for EfficientNetB0 a data x training-mode interaction is significant (p=0.002), consistent with a super-additive effect (+13.6% combined vs +1.6% summed individual effects); (3) architectures with weaker spatial representations benefit most, whereas ConvNeXt-T shows no effect, apparently because its depthwise-convolution activations yield spatially uninformative channel-mean maps; (4) unsupervised PatchCore remains the strongest localizer (Pixel-AUROC=0.983), contextualizing the supervised gains. These results show that existing evaluation masks can act as practical training signals that measurably and reproducibly improve where defect classifiers attend.
Key facts. No citing papers in the map yet (data through 7 Oct 2026). Builds on 25 of its 34 references that are in the map. First posted on arXiv 5 Sep 2026.
Builds on
25 of 34 references.
References · 25
- 2015Deep Residual Learning for Image Recognitioncited by 51,809
- 2020Denoising Diffusion Probabilistic Modelscited by 20,851
- 2021Diffusion Models Beat GANs on Image Synthesiscited by 8,185
- 2016Grad-CAM: Visual Explanations from Deep Networks via Gradient-based Localizationcited by 6,690
- 2019EfficientNet: Rethinking Model Scaling for Convolutional Neural Networkscited by 6,415
- 2018MobileNetV2: Inverted Residuals and Linear Bottleneckscited by 4,773
- 2021Improved Denoising Diffusion Probabilistic Modelscited by 3,736
- 2022A ConvNet for the 2020scited by 3,545
- 2015Learning Deep Features for Discriminative Localizationcited by 2,430
- 2013Visualizing and Understanding Convolutional Networkscited by 2,278
- 2021Swin Transformer V2: Scaling Up Capacity and Resolutioncited by 1,215
- 2021Towards Total Recall in Industrial Anomaly Detectioncited by 772
13 more
- 2020Captum: A unified and generic model interpretability library for PyTorchcited by 542
- 2017Right for the Right Reasons: Training Differentiable Models by Constraining their Explanationscited by 293
- 2021FastFlow: Unsupervised Anomaly Detection and Localization via 2D Normalizing Flowscited by 225
- 2018Tell Me Where to Look: Guided Attention Inference Networkcited by 168
- 2023EfficientAD: Accurate Visual Anomaly Detection at Millisecond-Level Latenciescited by 157
- 2023AnomalyDiffusion: Few-Shot Anomaly Image Generation with Diffusion Modelcited by 110
- 2018Attention Branch Network: Learning of Attention Mechanism for Visual Explanationcited by 108
- 2018Self-produced Guidance for Weakly-supervised Object Localizationcited by 72
- 2025The MVTec AD 2 Dataset: Advanced Scenarios for Unsupervised Anomaly Detectioncited by 28
- 2025DefectFill: Realistic Defect Generation with Inpainting Diffusion Model for Visual Inspectioncited by 12
- 2025Enhancing Glass Defect Detection with Diffusion Models: Addressing Imbalanced Datasets in Manufacturing Quality Controlcited by 3
- 2025Region-Aware CAM: High-Resolution Weakly-Supervised Defect Segmentation via Salient Region Perceptioncited by 2
- 2024Machine Learning in Industrial Quality Control of Glass Bottle Printscited by 1
Built on by
Not cited yet.
Similar, not cited
Close in wording, no citation either way
- 2024DefFiller: Mask-Conditioned Diffusion for Salient Steel Surface Defect Generation
- 2024Leveraging Latent Diffusion Models for Training-Free In-Distribution Data Augmentation for Surface Defect Detection
- 2026Industrial Surface Defect Detection via Diffusion Generation and Asymmetric Student-Teacher Network
- 2024Diffusion-based Image Generation for In-distribution Data Augmentation in Surface Defect Detection
- 2025Generate Aligned Anomaly: Region-Guided Few-Shot Anomaly Image-Mask Pair Synthesis for Industrial Inspection
- 2025Semi-Supervised Defect Detection via Conditional Diffusion and CLIP-Guided Noise Filtering
- 2025ExDD: Explicit Dual Distribution Learning for Surface Defect Detection via Diffusion Synthesis
- 2025Bounding Box-Guided Diffusion for Synthesizing Industrial Images and Segmentation Map