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.