# A Novel Method for Wheat Spike Phenotyping Based on Instance Segmentation and Classification
###### Abstract  
The phenotypic analysis of wheat spikes plays an important role in wheat growth management, plant breeding, and yield estimation. However, the dense and tight arrangement of spikelets and grains on the spikes makes the phenotyping more challenging. This study proposed a rapid and accurate image-based method for in-field wheat spike phenotyping consisting of three steps: wheat spikelet segmentation, grain number classification, and total grain number counting. Wheat samples ranging from the early filling period to the mature period were involved in the study, including three varieties: Zhengmai 618, Yannong 19, and Sumai 8. In the first step, the in-field collected images of wheat spikes were optimized by perspective transformation, augmentation, and size reduction. The YOLOv8-seg instance segmentation model was used to segment spikelets from wheat spike images. In the second step, the number of grains in each spikelet was classified by a machine learning model like the Support Vector Machine (SVM) model, utilizing 52 image features extracted for each spikelet, involving shape, color, and texture features as the input. Finally, the total number of grains on each wheat spike was counted by adding the number of grains in the corresponding spikelets. The results showed that the YOLOv8-seg model achieved excellent segmentation performance, with an average precision (AP) @[0.50:0.95] and accuracy (A) of 0.858 and 100%. Meanwhile, the SVM model had good classification performance for the number of grains in spikelets, and the accuracy, precision, recall, and F1 score reached 0.855, 0.860, 0.865, and 0.863, respectively. Mean absolute error (MAE) and mean absolute percentage error (MAPE) were as low as 1.04 and 5% when counting the total number of grains in the frontal view wheat spike images. The proposed method meets the practical application requirements of obtaining trait parameters of wheat spikes and contributes to intelligent and non-destructive spike phenotyping. image; YOLOv8-seg; spikelet segmentation; machine learning; grain counting +
Footnote †: journal: Applied Sciences
yield estimation [6; 7]. Therefore, it is urgent to conduct wheat spike phenotyping accurately and count the number of grains in each spike in the field using rapid modern intelligent technology in the process of wheat breeding. In recent years, image analysis technology has been widely used in wheat spike phenotyping with the development of agricultural intelligence [8; 9; 10; 11]. Researchers have carried out an enormous amount of studies on the whole recognition and segmentation of wheat spikes in the field. In terms of traditional image processing methods, [PERSON] et al. [12] adopted a frequency filter and feature extraction, with different classification techniques, to segment wheat spikes based on RGB images. The results of the manual counting and algorithm counting exhibited high levels of accuracy and efficiency. [PERSON] et al. [13] automatically segmented the wheat spikes based on superpixel classification by exploiting features from RGB and multispectral cameras, and the support vector machine model yielded satisfactory segmentation and reached 94% accuracy. On the other hand, [PERSON] et al. [14; 15] and [PERSON] et al. [16] used different deep-learning models to realize the target recognition and instance segmentation of wheat spikes. The former research formed a YOLOv5s network with an improved attention mechanism, which can accurately detect the number of small-scale wheat spikes and better solve the problems of occlusion and cross-overlapping of the wheat spikes. The latter research proposed a network called WheatSpikeNet based on Cascade Mask RCNN architecture with model enhancements and hyperparameter tuning to provide state-of-the-art detection and segmentation performance on the SPIKE dataset. The above researchers only realized the separation of the whole wheat spikes from the field environment, while some research further focused on more detailed wheat spike phenotyping like spikelet or grain. [PERSON] et al.