Foreground-background separation transformer for weakly supervised surface defect detection

Published: 2025, Last Modified: 06 Nov 2025J. Intell. Manuf. 2025EveryoneRevisionsBibTeXCC BY-SA 4.0
Abstract: In industrial scenarios, weakly supervised pixel-level defect detection methods leverage image-level labels for training, significantly reducing the effort required for manual annotation. However, existing methods suffer from confusion or incompleteness in predicting defect regions since defects usually show weak appearances that are similar to the background. To address this issue, we propose a foreground–background separation transformer (FBSFormer) for weakly supervised pixel-level defect detection. FBSFormer introduces a foreground–background separation (FBS) module, which utilizes the attention map to separate the foreground defect feature and background feature and pushes their distance intrinsically by learning with opposite labels. In addition, we present an attention-map refinement (AMR) module, which aims to generate a more accurate attention map to better guide the separation of defect and background features. During the inference stage, the refined attention map is combined with the class activation map (CAM) corresponding to the defect feature of FBS to generate the final result. Extensive experiments are conducted on three industrial surface defect datasets including DAGM 2007, KolektorSDD2, and Magnetic Tile. The results demonstrate that the proposed approach achieves outstanding performance compared to the state-of-the-art methods.
Loading