基于改进YOLOv8模型的木材缺陷检测
2025-08-03颜世运张慧斌籍浩恺丁禹程白岩杨春梅
关键词:木材检测;深度学习;损失函数;条件卷积;特征融合;YOLOv8;缺陷识别 中图分类号:TP391.41 文献标识码:A DOI:10.7525/j.issn.1006-8023.2025.04.010
Abstract:Tosolvetheproblemthatthetargetdetectionalgorithmisprone toleakageandlacksdetectionaccuracy ndetecting wood surface defects,this paper proposes an improved YOLOv8 model(YOLOv8-CBW,C,Band Ware abbreviations for CondSiLU,BiFPNand Wise-IoU)and constructs aself-made dataset containing various wood defects.Byoptimizing theoriginal YOLOv8 algorithmandcombining CondConv(conditional convolution)with SiLU(sigmoidweightedlinearunit)to formtheCondSiLUmodule insteadofthetraditionalconvolutionmodule,theflexibilityoffeature extraction is improved;the bidirectionalfeature pyramid network(BiFPN)is introduced toenhancethe multi-scale feature fusioncapability;andthe Wise-IoU(weighted intersection over union)loss functionreplaces the CIoU(complete intersectionoverunion)to improvetheadaptabilityand generalizationperformanceof the model tolow-qualitysamples. The experimental results show that the improved YOLOv8-CBW model improves the mAP5O(mean average precision at IoU threshold O.5O)and mAP50-95(mean average precision over IoU thresholds from 0.50 to 0.95)by 3.7% and (204号 3.9% ,respectively,compared with the YOLOv8 model,and it shows higher precision and stability in complex wood defectdetectiontasks.Theresearch in this paper provides new ideasfor wood defectdetection tasksand has good practical application prospects.
Keywords:Wood detection;deep learning;loss function;conditionalconvolution;feature fusion;YOLOv8;defect identification
0 引言
木材作为一种重要的可再生资源,具有重要的生态价值1和经济价值。木材表面缺陷检测是现代木材加工产业中的关键技术之一,能够通过自动化手段检测出裂缝、腐坏和死节等木材缺陷[2],为木材质量评估和分类提供技术支持,因此研究基于深度学习的木材缺陷检测技术对提高我国木材加工产业的技术水平具有重要意义。
一般的深度学习网络模型在处理木材表面缺陷这种含有多尺度特征的复杂场景时存在一定的局限性[3]。近些年来,随着目标检测技术的不断发展,基于深度学习的木材表面缺陷检测技术在应对多特征环境时,其检测精度和速度均有了显著的提升。其中,曹永鑫等[4]提出了基于YOLOv5改进的YOLOv5-LW(light-weightwood)模型,结合骨干网络与ECA(efficientchan-nelattention)注意力机制,增强模型对关键信息的关注能力。同时,融入特征融合网络MBiFPN(modifiedbi-directionalfeaturepyramidnetwork),减少了特征损失,还丰富了局部和细节特征,但检测速度明显下降,且由于ECA注意力机制在小目标检测上的精度问题,在检测细小木材缺陷方面,精度达不到生产要求,无法进一步推广;王正等5基于YOLOv7模型的木材缺陷检测算法改进,通过将ECA注意力机制与二级残差网络0 Res2Net. )相结合,构建了ECA-Res2Net模块,有效提升了网络对特征的提取能力,但对于小目标检测效果仍不够理想,检测精度不足以满足工业生产的需求,且检测速度较慢,无法满足实时性的要求。……
