首页|基于改进YOLOv5算法的实木板材表面缺陷检测

基于改进YOLOv5算法的实木板材表面缺陷检测

扫码查看
实木板材在世界范围内被广泛地应用于建筑、家居、艺术等领域,由于板材表面存在着影响其性能的不同种类的缺陷,而人工去除实木板材缺陷生产效率较低,质量无法保证.为了解决实木板材表面缺陷检测中存在的效率低下及过分依靠工人主观判断的问题,将机器视觉和深度学习方法相结合,利用机器代替人对实木板材进行缺陷检测.具体使用彩色CCD相机采集了赤松和樟子松两种实木板材,裁剪成共计1 500张大小为2 048x2 048像素的木材图片,图片中包含着活节、死节、髓心及裂缝缺陷.在YOLOv5结构基础上,受到了 Vision Transformer的启发,在主干网络中使用了全局注意力模块来改进算法,并且针对实木板材的横向锯切方式修改了损失函数,以求在实木板材缺陷检测锯切这一任务中获得更好的效果.充分训练后在测试集上整体mAP达到0.974,召回率达到0.946,较未改进的YOLOv5分别提高了 5.98%和9.36%,表现出一定优越性.
Surface defect detection of solid wood board based on improvedYOLOv5 algorithm
Solid wood panels are widely used in construction,home furnishing,art and other fields around the world.Due to the different kinds of defects on the surface of the panels that affect their performance,the production effi-ciency of manually removing the defects of solid wood panels is low,and the quality cannot be guaranteed.In order to solve the problems of low efficiency and over-reliance on workers subjective judgment in the surface defect detec-tion of solid wood plates,this paper combines machine vision and deep learning methods,and uses machines instead of humans to detect defects in solid wood plates.Two kinds of solid wood plates of Pinus densiflora and Pinus sylves-tris var.mongolica were collected by color CCD camera,and cut into a total of 1 500 wood pictures with a size of 2 048 pixels and 2 048 pixels.The pictures contained living joints,dead joints,pith and crack defects.Based on the YOLOv5 structure,inspired by Vision Transformer,this paper uses the global attention module in the backbone net-work to improve the algorithm,and modifies the loss function for the lateral sawing method of solid wood plate,in or-der to obtain better results in the task of defect detection and sawing of solid wood plate.After full training,the over-all mAP on the test set reaches 0.974,and the recall rate reaches 0.946,which is 5.98%and 9.36%higher than the unmodified YOLOv5,respectively,showing certain advantages.

solid wood boarddefect detectingYOLOv5 algorithmVision Transformerwood process

沈胤熙、刘英、杨雨图

展开 >

南京林业大学机械电子工程学院,江苏南京 210037

实木板材 缺陷检测 YOLOv5算法 Vision Transformer 木材加工

2024

林业机械与木工设备
国家林业局哈尔滨林业机械研究所

林业机械与木工设备

影响因子:0.574
ISSN:2095-2953
年,卷(期):2024.52(3)
  • 12