The precise segmentation of small-sized defects on wood surfaces is critical for the quality grading of glued laminated timber (GLT). Existing semantic segmentation models face core bottlenecks in this context: high miss rates, blurred boundary localization, and excessive size measurement errors. To address these issues, this paper proposes an improved Defect-Mask2Former model that integrates an Attention-Guided Pyramid Enhancement (AGPE) module and a Defect Boundary Calibration and Correction (DBCC) module. Through synergistic optimization, the model achieved pixel-level precise segmentation. To support model training and validation, a custom image acquisition device was designed, and the PlankDefSeg dataset was constructed, comprising 3500 pixel-level annotated images covering five defect types across six industrial wood species. Experimental results demonstrate that on the PlankDefSeg dataset, Defect-Mask2Former achieved a mean Intersection over Union (mIoU) of 85.34% for small-sized defects, a 17.84% improvement over the baseline Mask2Former. The miss rate was reduced from 20.78% to 5.83%, and the size measurement error was only 2.86%, strictly meeting the ≤3% accuracy requirement of the GB/T26899-2022 standard. The model achieved an inference speed of 27.6 FPS, satisfying real-time detection needs. By integrating the model into the GLT grading workflow, a grading accuracy of 94.3% was achieved, and the processing time per timber was reduced from 30 s to 1.5 s, a 20-fold efficiency improvement. This study provides reliable technical support for intelligent GLT quality grading and offers a reference solution for other industrial surface defect segmentation tasks.
Qin et al. (Mon,) studied this question.