基于Lite-YOLOv5s模型的刨花板表面缺陷检测方法
Detecting Method for Particleboard Surface Defects Based on the Lite-YOLOv5s Model
- 2023年37卷第3期 页码:58-67
DOI: 10.12326/j.2096-9694.2022230
扫 描 看 全 文
1.北京建筑材料科学研究总院有限公司,北京 100041
2.北京金隅集团股份有限公司,北京 100010
扫 描 看 全 文
王文财,党亚光,朱翔等.基于Lite-YOLOv5s模型的刨花板表面缺陷检测方法[J].木材科学与技术,2023,37(03):58-67.
WANG Wencai,DANG Yaguang,ZHU Xiang,et al.Detecting Method for Particleboard Surface Defects Based on the Lite-YOLOv5s Model[J].Chinese Journal of Wood Science and Technology,2023,37(03):58-67.
针对目前刨花板表面缺陷检测两阶段方法计算量大、机器学习识别方法鲁棒性低等问题,提出一种基于改进YOLOv5s的轻量化检测模型,即Lite-YOLOv5s。首先,在主干网络和颈部网络中引入Ghost Bottleneck模块以减少模型参数量,降低模型计算成本。其次,在主干网络中增加坐标注意力机制(coordinate attention,CA),并将空间金字塔池化模块(spatial pyramid pooling-fast,SPPF)替换为简化空间金字塔池化模块(simplify spatial pyramid pooling-fast,SimSPPF),保证模型在降低计算量的同时仍具有较好的检测效果。最后,在替换颈部网络中使用深度卷积模块(depth wise convolution,DWConv),进一步优化模型运行成本。应用Lite-YOLOv5s模型对某工厂刨花板四种表面缺陷数据集进行模型训练和验证,并将训练的模型用于刨花板图像的缺陷检测,结果表明:Lite-YOLOv5s模型针对刨花、胶斑、油污及粉尘斑四种缺陷的平均检测精度(mean average precious,mAP)可达90%以上,针对样本数量较少的漏芯缺陷mAP为75%以上;与原YOLOv5s模型相比,模型训练时间减少约3.58%,模型参数量下降约63.5%,模型权重文件大小下降约60.54%,模型浮点计算量下降约65.2%,在保证检测精度的前提下有效降低了模型运行成本,使其更容易部署在资源有限的边缘侧设备中。
In order to improve the current two-stage method for particleboard surface defects detection, including a large amount of computation and a low robustness of the machine learning recognition, this paper proposes a lightweight detection method based on modified YOLOv5s, namely Lite-YOLOv5s. First, the Ghost Bottleneck module is introduced into the backbone and neck networks to lower the model parameters and reduce the model calculation cost. Secondly, the Coordinate Attention (CA) mechanism is added to the backbone network, while the Spatial Pyramid Pooling-Fast (SPPF) module is replaced by the Simplify Spatial Pyramid Pooling-Fast (SimSPPF) module to ensure that the model can still have a good detection effect after reducing the amount of computation. Finally, in replacing the neck network, a Deep Wise Convolution module (DWConv) is used to further optimize the model operation cost. The Lite-YOLOv5s model was applied to model training and validation on four surface defect data sets of particleboards in a factory. Then the trained model was applied to defect detection of particleboard images. The results showed that the Lite-YOLOv5s model had more than 90% mAP for the four defects of shavings, glue spots, oil stains, and dust spots, and more than 75% mean average precious (mAP) for the core leakage defect with a small number of samples. Compared with the original YOLOv5s model, the model training time is reduced by about 3.58%, the model parameter amount is reduced by about 63.5%, the model weight file size is reduced by about 60.54%, and the model floating point calculation amount is reduced by about 65.2%. While the detection accuracy is maintained, the model running cost is effectively reduced as well as facilitating deployment in edge devices with limited resources.
刨花板表面缺陷检测图像Lite-YOLOv5s轻量化深度学习
particleboardsurface defect detectionimageLite-YOLOv5slightweightdeep learning
钱小瑜. 中国人造板在改革开放中走向辉煌[J]. 中国人造板, 2019, 26(6): 1-8.
臧洪伟. 刨花板生产中常见质量问题及处理方法[J]. 林业机械与木工设备, 2014, 42(9): 42-44.
GB/T 4897—2015,刨花板[S].
ZHAO Z Y, YANG X X, ZHOU Y C, et al. Real-time detection of particleboard surface defects based on improved YOLOV5 target detection[J]. Scientific Reports, 2021, 11: 21777. DOI:https://doi.org/10.1038/s41598-021-01084-xhttps://doi.org/10.1038/s41598-021-01084-x.
XIE Y H, WANG J C. Study on the identification of the wood surface defects based on texture features[J]. Optik - International Journal for Light and Electron Optics, 2015, 126(19): 2231-2235.
CHANG Z Y, CAO J, ZHANG Y Z. A novel image segmentation approach for wood plate surface defect classification through convex optimization[J].Journal of Forestry Research, 2018, 29(6): 1789-1795.
李超, 刘思佳, 曹军, 等. 基于PSO优选特征的实木板材缺陷的压缩感知分选方法[J]. 北京林业大学学报, 2015, 37(7): 117-122.
LI C, LIU S J, CAO J, et al. The method of wood defect recognition based on PSO feature selection and compressed sensing[J]. Journal of Beijing Forestry University, 2015, 37(7): 117-122.
王程程, 刘亚秋. 基于动态目标检测与跟踪算法(TLD)的刨花板表面缺陷检测技术[J]. 木材工业, 2018, 32(4): 44-47.
WANG C C, LIU Y Q. Detecting surface defects of particleboard based on tracking-learning detection technology[J]. China Wood Industry, 2018, 32(4): 44-47.
REN S Q, HE K M, GIRSHICK R, et al. Faster R-CNN: towards real-time object detection with region proposal networks[J]. IEEE Transactions on Pattern Analysis and Machine Intelligence, 2017, 39(6): 1137-1149. DOI: 10.1109/TPAMI. 2016.2577031http://dx.doi.org/10.1109/TPAMI.2016.2577031.
HE K M, GKIOXARI G, DOLLÁR P, et al. Mask R-CNN[C]//2017 IEEE International Conference on Computer Vision (ICCV). Venice, Italy. IEEE, 2017: 2980-2988.
LIU W, ANGUELOV D, ERHAN D, et al. SSD: single shot MultiBox detector[M]// Proceedings of the 14th European conference on computer vision. Amsterdam: Springer, 2016: 21-37.
Redmon J, Farhadi A. YOLOv3: An incremental improvement [EB/OL] (2018-04-18) https://arxiv.org/abs/1804.02767https://arxiv.org/abs/1804.02767.
彭煜, 肖书浩, 阮金华, 等. 基于Faster R-CNN的刨花板表面缺陷检测研究[J]. 组合机床与自动化加工技术, 2020(3): 91-94.
PENG Y, XIAO S H, RUAN J H, et al. Research on surface defect detection of particleboard based on faster R-CNN[J]. Modular Machine Tool & Automatic Manufacturing Technique, 2020(3): 91-94.
SHI J H, LI Z Y, ZHU T T, et al. Defect detection of industry wood veneer based on NAS and multi-channel mask R-CNN[J]. Sensors, 2020, 20(16): 4398.
陈龙现. 基于深度学习的刨花板表面缺陷实时检测系统研究[D]. 济南: 山东建筑大学, 2020.
朱豪, 周顺勇, 曾雅兰, 等. 基于改进YOLOv5s的木材表面缺陷检测模型[J]. 木材科学与技术, 2023(2): 8-15.
ZHU H, ZHOU S Y, ZENG Y L, et al. Detection model of wood surface defects based on improved YOLOv5s[J]. Chinese Journal of Wood Science and Technology, 2023(2): 8-15.
HAN K, WANG Y H, TIAN Q, et al. GhostNet: more features from cheap operations[C]//2020 IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR). Seattle, WA, USA. 2020: 1577-1586.
HOU Q B, ZHOU D Q, FENG J S. Coordinate attention for efficient mobile network design[C]//2021 IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR). Nashville, TN, USA, 2021: 13708-13717.
LI C Y, LI L L, JIANG H L, et al. YOLOv6: A Single-stage object detection framework for industrial applications[C]. Computer Vision and Pattern Recognition, 2022, arXiv: 2209.02976.
LI C, LI L, JIANG H, et al. YOLOv6: A single-stage object detection framework for industrial applications[EB/OL]. (2022-09-07) https://arxiv.org/abs/2209.02976https://arxiv.org/abs/2209.02976.
郭慧. 基于机器视觉的刨花板表面缺陷在线检测系统研究[D]. 北京: 中国林业科学研究院, 2019.
ZHAO Z Y, GE Z D, JIA M Y, et al. A particleboard surface defect detection method research based on the deep learning algorithm[J]. Sensors, 2022, 22(20): 7733.
Ultralytics. YOLOv5[EB/OL]. (2020-06-03)[2021-04-15]. https://github. com/ultralytics/yolov5https://github.com/ultralytics/yolov5.
ZHENG Z H, WANG P, LIU W, et al. Distance-IoU loss: faster and better learning for bounding box regression[J]. Proceedings of the AAAI Conference on Artificial Intelligence, 2020, 34(7): 12993-13000.
Neubeck A, Van Gool L. Efficient non-maximum suppression[C]//18th International Conference on Pattern Recognition. IEEE Computer Society, 2006: 850-855.
HU J, SHEN L, SUN G. Squeeze-and-excitation networks[C]//2018 IEEE/CVF Conference on Computer Vision and Pattern Recognition. IEEE, 2018: 7132-7141.
WOO S, PARK J, LEE J Y, et al. CBAM: Convolutional block attention module[M]//Computer Vision - ECCV 2018. Cham: Springer International Publishing, 2018: 3-19.
周传华, 夏徐东, 周东东, 等. 融合网格掩膜和残差坐标注意力的行人重识别[J]. 微电子学与计算机, 2022, 39(5): 30-38.
ZHOU C H, XIA X D, ZHOU D D, et al. Person re-identification combining gridmask and residual coordinate attention[J]. Microelectronics & Computer, 2022, 39(5): 30-38.
朱家松, 郑澳, 雷占占, 等. 基于改进Yolov5的地铁隧道附属设施与衬砌表观病害检测方法[J]. 铁道科学与工程学报, 2023, 20(3): 1008-1019.
ZHU J S, ZHENG A, LEI Z Z, et al. Metro tunnel accessorial facilities and lining diseases detection method based on improved Yolov5[J]. Journal of Railway Science and Engineering, 2023, 20(3): 1008-1019.
陆健强, 梁效, 余超然, 等. 基于坐标注意力机制与高效边界框回归损失的线虫快速识别[J]. 农业工程学报, 2022, 38(22): 123-132.
LU J Q, LIANG X, YU C R, et al. Fast identification of nematode via coordinate attention mechanism and efficient bounding box regression loss[J]. Transactions of the Chinese Society of Agricultural Engineering, 2022, 38(22): 123-132.
相关作者
相关机构
微信公众号