An Improved YOLO Lightweight Wood Surface Defect Detection Model Integrated with a Dual-Path Fused Attention Network
Qing Yang, Siyuan Chen, Jiawen Zhang, Yin Feng Wu, Feng Xu · Forests · 2026
In response to the challenges of low detection efficiency, high omission rate in small target detection and high model complexity in wood surface defect detection, this study proposes a lightweight detection model based on YOLO, which integrates a dual-path integrated attention network (DFA-Net). The model is built on the enhanced YOLOv5 framework and achieves a balance of accuracy and efficiency through the collaborative optimization of multiple modules. Specifically, this paper designs a dual-path downsampling convolutional module (DP-DCM), combining wavelet transform with dual-path feature fusion to improve multi-scale feature extraction capabilities while reducing the number of parameters. Next, a fusion attention module (FAM) is designed to dynamically focus on defect features in complex backgrounds through channel and spatial attention mechanisms. Furthermore, a focal modulation network (FMNet) is introduced to enhance the robustness of the augmentation model in detecting small defects. Finally, the NWD Loss function is used to mitigate the localization bias of small targets. Experimental results show that the improved model achieves a 92.8% mAP rate on five types of defect datasets (dead knots, live knots, cracks, notches, and marrow). Compared with the baseline model, YOLOv5s, the performance of this model has been improved by 6.5%. The model runs at a detection speed of 105 FPS, and the number of parameters is only 5.8 million, which is better than models such as YOLOv8 and YOLOv9-t. While maintaining a lightweight design, this method achieves high precision and real-time performance on a consumer-grade GPU platform, indicating its practical applicability in automated wood inspection scenarios. The proposed approach provides an efficient solution for intelligent wood sorting, contributing to improved wood utilization and enhanced processing automation.