FSQR-Former: A Frequency–Spatial Query Refinement Transformer with Feature Feedback for Surface Defect Segmentation
Yang Yang, Xiaohui Zhu, Hongxi Guo, Wei Liu, Guangqiu Chen, Yongjian YangAccurate surface defect segmentation remains challenging when thin and low-contrast defects are embedded in repetitive textures, where local frequency variations may originate from both defects and background structures. This work presents FSQR-Former, a query-based mask-classification transformer that couples frequency–spatial query refinement with cross-stage feature feedback. Content-Decoupled Directional Wavelet Frequency Attention (CDWFA) applies Haar decomposition to visual features without explicitly added positional encodings and combines directional calibration with frequency gating informed by low-frequency context. Multi-Scale Query-Guided Sparse Attention (MS-QSA) enriches spatial features with neighborhood context and selectively aggregates tokens according to query compatibility. Query-to-Feature Feedback Modulation (Q2FM) converts refined query states into channel and spatial modulation signals for finer-scale features, coupling query refinement with feature recalibration during coarse-to-fine decoding. The three-run mean results of FSQR-Former indicate competitive benchmark performance on ESDIs-SOD and CrackSeg9k, with the best scores across all five evaluation metrics on ZJU-Leaper. Controlled ablations support the contributions of joint frequency–spatial refinement and query-conditioned feature feedback to pixel-wise accuracy and structural agreement. Complexity analysis further indicates a favorable balance between segmentation accuracy, computational cost, and parameter count.