Skip to content
Conference

MetalDefect-SD: Adapting Stable Diffusion for Few-Shot Metal Surface Defect Automatic Segmentation

Aug 2026 · 2026 International Conference on Computer Perception and Neural Networks (CPNN) · pp. 55-63 · 0 citations · 16 references

Abstract

Few-shot segmentation of metal surface defects is challenging because pixel-level annotations are scarce, defect appearances vary widely, and reflective backgrounds often contain defect-like textures. Existing support-query methods and diffusion-based segmentation frameworks can exploit pretrained visual priors, but their support transfer may propagate unreliable background cues into the query representation. We propose MetalDefect-SD, a Stable Diffusion-based framework for support-conditioned defect mask prediction. Its main contribution is the Reliability-Guided Support-Query Interaction (RG-SQI) module, which combines a Defect-Background Self-Support Prototype (DBSSP) branch with Masked Gated Support-to-Query (MG-S2Q) Attention. DBSSP constructs complementary defect and background prototypes from the query latent to improve defect-background discrimination, while MG-S2Q uses the support mask as an attention bias and a learnable gate to regulate support feature propagation. We further adapt a Visual-to-Textual Condition Translator (VTCT) to map annotated support-region features into implicit text-compatible embeddings, enabling the diffusion U-Net to exploit conditional cross-attention without handcrafted prompts. The adapted U-Net predicts the clean query-mask latent in a single step, followed by decoding with a frozen variational autoencoder (VAE). On FSSD-12, MetalDefect-SD achieves 58.5% mean intersection-over-union (mIoU) and 72.5% foreground-background intersection-over-union (FB-IoU) in the 1-shot setting, and 59.0% mIoU and 74.8% FB-IoU in the 5-shot setting. These results demonstrate that reliability-aware support-query interaction improves foreground-background discrimination and enables effective diffusion-prior adaptation for data-efficient industrial defect segmentation. More broadly, this work demonstrates that pretrained diffusion priors can be adapted to data-efficient pixel-level industrial inspection when defect annotations are scarce. The framework therefore connects foundation-model adaptation, few-shot dense prediction, and automated manufacturing quality control.

View source

Similar papers

Open access Aug 2026

DAUNet: direction-aware U-Net enhanced for FPC surface defect segmentation

To support pixel-level surface defect segmentation for flexible printed circuits, this paper releases a synthetic segmentation dataset with fine-grained annotations for three typical defect categories, namely crush, stain, and scratch, to facilitate model training and evaluation. To address the challenges posed by larg...

Ming-Qing Feng, Tian-Xu Wang, Li-Zhi Feng et al. · 0 citations
Sep 2026

Hierarchical Dense Aggregation Network for Few-Shot Metal Surface Defect Segmentation

Few-shot defect segmentation (FSDS) has emerged as an effective approach to address the challenge of limited annotated samples in industrial quality inspection. However, existing methods often rely on features extracted from a single semantic level, without effectively suppressing noise interference, which leads to sub...

Hu Feng, Ke-Chen Song, Xian Tao et al. · 0 citations
Open access Sep 2026

FH-Net: Frequency-domain and hierarchical dual enhancement for few-shot surface defect segmentation

A novel few-shot surface defect segmentation method termed FH-Net is proposed, which aims to achieve high-precision segmentation of previously unseen categories using only a limited number of annotated samples and enriches support set feature diversity through foreground- and global-level amplitude perturbations in the...

Li-Li Fan, Zhang Yang, Fan Guo et al. · 0 citations
Open access Oct 2026

S3DNet: Support-Driven Spatial–Semantic Decoupling for Few-Shot Strip-Steel Surface Defect Segmentation

Few-shot strip-steel surface defect segmentation requires a model to identify unseen defect categories and delineate their precise boundaries from only a few annotated support images. This remains challenging because strip-steel defects are often small, elongated, low-contrast, and easily confused with repetitive backg...

Ju Zhao, Jing-Guang Yang, Feng-Ling Lei et al. · 0 citations
Open access Sep 2026

TDRPFormer: Texture-Debiased Reliable Prototype Transformer for Pixel-Level Steel Surface Defect Segmentation

Steel surface defect segmentation is a critical task in industrial visual inspection, with direct implications for quality assessment, process control, and in-service safety. However, complex steel-surface images often contain strong background textures, local reflections, machining traces, and low-contrast defects, wh...

Ming-Xiang Zhu, Zhi-Zhen Li, Hong-Yan Sun et al. · 0 citations
Open access Sep 2026

GSLD-QueryInst: global spatial and local detail attention for weld defect instance segmentation

X-ray weld defect instance segmentation provides important pixel-level information for automated weld quality assessment in industrial non-destructive testing. However, practical x-ray weld images often contain elongated defects with discontinuous mask predictions, small defects with weak responses, irregular boundarie...

Ye Li, Wei-Jie Zhao, Guo-Dong Li et al. · 0 citations

We use cookies to run the site and, with your consent, for analytics and to show ads. See our Cookie Policy.