Article ID: 2025EDP7187
In the manufacturing of reconstituted stem silk, inconsistent cutting widths often occur, adversely affecting the final product's physical and chemical properties. Most traditional width measurement methods are time-consuming, labor-intensive, and suffer from limited estimation accuracy. To address these challenges, this study proposes a YOLOv7-BiFormer-NWD-based detection framework incorporating the BiFormer dynamic sparse attention mechanism and the Normalized Wasserstein Distance (NWD) loss function to enhance the detection of small and irregular targets. The model was evaluated on a custom-built dataset. It achieved a mAP@[0.5:0.95] of 75.65%, significantly surpassing the baseline YOLOv7 (67.01%) and achieving the best mAP@[0.5:0.95] among the evaluated models under our protocol (see Table 4). For width estimation, the Suzuki Contour Algorithm (SZA)-based maximum inscribed circle method that fits within the contour to estimate the stem width was employed, demonstrating high consistency with ISO 20193:2019 manual results, with a mean absolute error of 0.011 mm (maximum 0.02 mm) and relative errors < 1.3% in the ISO comparison, with measurement time reduced to 0.15 minutes per sample. The proposed system also showed excellent repeatability and reproducibility (Sr < 0.031 mm, SR < 0.052 mm), validating its effectiveness and suitability for high-precision industrial quality inspection.