高级检索+

基于改进YOLOv8-Seg模型的香菇子实体表型参数测量方法

Measurement method for the phenotypic parameters of Lentinula edodes fruiting bodies based on improved YOLOv8-Seg model

  • 摘要: 针对生长发育期的香菇子实体缺少表型参数自动化测量手段的问题,该研究提出了一种基于改进YOLOv8-Seg模型的香菇子实体表型参数测量方法。通过在YOLOv8-Seg的快速池化层(spatial pyramid pooling fast,SPPF)后增添SE注意力机制模块,调整重要特征通道权重,增强模型对香菇子实体目标的识别准确率;在颈部网络中使用C2f-Faster模块替换C2f模块,用部分卷积(partial convolution)模块降低模型内存访问量,加快模型推理速度,构建了一种香菇子实体分割模型(YOLO-SF)。应用YOLO-SF模型对处于各生长阶段的香菇子实体菌柄、菌盖进行实例分割;利用OpenCV中的Cv2.minAreaRect函数获取菌柄菌盖分割区域的最小旋转外接矩形;基于提取的外接矩形像素点数目与游标卡尺测量值计算固定比例,应用线性拟合方法对测量参数校正,减小系统误差,实现香菇子实体四类表型参数(菌盖宽度、菌盖厚、菌柄直径、菌柄高)的测量。结果表明,YOLO-SF模型的精确率、召回率和平均精度均值分别达到99.5%、99.2%和80.7%,相较于YOLOv8-Seg模型分别提升了1.3、3.3和2.6个百分点;轻量化方面,浮点运算次数和参数量较YOLOv8-Seg模型分别降低了6.6%和12.1%,帧率由49.8帧/s上升至55.5帧/s;与Mask R-CNN、YOLACT、YOLOv5-Seg、YOLOv8-Seg和YOLOv8-Swin Transformer等其他主流分割模型相比,YOLO-SF模型的mAP50-95分别高出5.5、7.1、3.6、2.6和3.6个百分点。将香菇子实体表型参数拟合校正后测量的结果与固定比例测量结果进行对比,平均相对误差(mean relative error,MRE)小于2.7%,平均绝对误差(mean absolute error,MAE)小于0.5 mm。该方法可为香菇产量预测、栽培管理与育种提供理论基础和技术支持。

     

    Abstract: Here, an accurate measurement strategy was proposed for the phenotypic parameters of Lentinula edodes fruitingbodies during the growth and development stage using the improved YOLOv8-Seg model. The SE (squeeze and excitation attention) attention mechanism module was added after the backbone pooling layer of YOLOv8-Seg. The weights of important feature channels were adjusted to enhance the recognition accuracy of the model. The C2f-Faster module was used to replace the original C2f module in the neck network. Its PConv (partial convolution) module was used to reduce the memory access and model inference. Thus, a phenotypic parameter segmentation model (YOLO-SF) was constructed after enhancement. The images of Lentinula edodes fruiting bodies were collected from the early stage of growth to the mature stage. The total number of images was expanded to 2527 by data enhancement, such as random flipping, rotation, cropping, and adding noise. Then, the data was divided into a training set, verification set, and test set, according to the ratio of 8: 1: 1. A data set was constructed to fully meet the requirements of YOLOv8-Seg. The improved YOLO-SF model was used to segment the pileus and stipes of the fruiting body at each growth stage. Furthermore, the minimum rotation circumscribed rectangle of the segmented region was obtained with the help of cv2.minAreaRect function in the OpenCV platform. There was less influence of the difference in Lentinula edodes growth angle on the parameter measurement. According to the extracted number of external rectangular pixels and the vernier caliper measured value, the fixed ratio was calculated to determine the phenotypic measurement value of the image. The linear fitting method was used to correct the parameters in order to reduce the systematic error. Four types of phenotypic parameters were verified (including the stipe height, stipe diameter, pileus thickness, and pileus width) of Lentinula edodes fruiting bodies. The experimental results show that the accuracy, recall, and mAP50-95 of the YOLO-SF model at the mask evaluation index reached 99.5%, 99.2% and 80.7%, respectively, which were 1.3, 3.3, and 2.6 percentage points higher than those of the YOLOv8-Seg model. At the same time, the number of floating-point operations and the number of parameters of the YOLO-SF model were reduced by 6.6 % and 12.1% , compared with the original model. And the FPS increased from 49.8 to 55.5 frames/s. Compared with the mainstream segmentation models, such as Mask R-CNN, YOLACT, YOLOv5-Seg, YOLOv8-Seg and YOLOv8-Swin Transformer, the mAP50-95 of the improved model YOLO-SF was 5.5, 7.1, 3.6, 2.6 and 3.6 percentage points higher at the mask level, respectively. The relative average errors of the pileus width, pileus thickness, stipes diameter, and stipes height were 3.0%, 15.8%, 14.3% and 7.4%, respectively, according to the calculated fixed ratio to measure the phenotypic parameters of Lentinula edodes. Furthermore, the relative average errors were reduced by 1.9%, 3.7%, 3.0% and 2.4%, respectively, after linear fitting optimization. On the self-built data set, the improved model was effectively applied to the high-throughput automatic measurement of phenotypic parameters of fruiting bodies of Lentinula edodes. The findings can also provide technical support and a theoretical basis for the yield prediction, cultivation, and genetic breeding of Lentinula edodes.

     

/

返回文章
返回