# Improved Mask R-CNN Combined with Otsu Preprocessing for Rice Panicle Detection and Segmentation
## 1 Introduction
Interference from noise was reduced by applying area and height thresholds, however the method was just used for individual plants in a laboratory setting [15]. [PERSON] proposed a computer vision-based method for UAV-acquired rice spike images for detection and counting [16]. In summary, the above methods have a variety of limitations: color and texture alterations caused by uneven changes in light and noise; fuzzy boundaries caused by similarities between the panicle and leaf colors; and serious panicle adhesion in field environments, which leads to low detection accuracy or poor segmentation results. Developments in computer vision have led to the widespread adaptation of object detection, semantic segmentation and instance segmentation in agriculture [17; 18; 19; 20; 21; 22; 23; 24; 25; 26; 27; 28]. Recent studies have applied CNN to spike recognition and counting and segmenting gram crops in the field. [PERSON] constructed a wheat spike recognition model based on the characteristics of winter wheat images collected at the flowering stage in a large field environment, and trained the model for winter wheat spike counting using the gradient descent method [29]. [PERSON] estimated the spike density of wheat based on the Faster R-CNN algorithm with 91% counting accuracy [30]. [PERSON] constructed a semantic segmentation network for UAV images based on a deep learning image processing method to construct a semantic segmentation network for estimating the number of rice crops in large-area rice fields and experimentally found that, combined with excess green factor retraining, this method yielded better results [31]. [PERSON] applied a rice image dataset and data augmentation techniques to train three models for rice crop segmentation offline and found that SegNet-based fully CNN effectively improved accuracy and efficiency in rice spike segmentation [32]. However, in this method, there was a large amount of work required for dataset edging and manual annotation in photoshop. [PERSON] proposed a Mask R-CNN-based feature extraction and 3D recognition method for rice spike computed tomography (CT) images, extracting 3D spike grain features based on the Euclidean distance to calculate the maturing rate and determine rice spike fullness or dryness, however this method was not suitable for practical environment and the equipment was difficult to operate [33]. Theoretically, methods based on CNN are capable of detection and segmentation, but various factors in real-time field environments can interfere with these processes and have not been fully considered in the literature, and only separate studies on rice panicle detection or segmentation have been conducted. Typical object detection algorithms such as Faster R-CNN and the YOLO (you only look once) series mainly obtain target location information through analyzing rectangular boxes [18; 20]. Semantic segmentation can be used to distinguish individual pixels in the image but cannot distinguish between different individuals of the same target [22; 23]. In contrast, instance segmentation can be used to determine both the location information and semantic information of the target. However, the common instance segmentation algorithm SOLOv2 requires excessive training, and the boundary information from the PolarMask algorithm can be unclear [26; 27]. Mask R-CNN, another common instance segmentation algorithm, can be used to detect and segment rice panicles [34]. Compared with other algorithms, it implements a non-unique input image scale and has a faster detection speed. Using a constructed data set to directly train the model for detection, we can obtain information on the quantity, location and area occupancy of rice panicle, all without concern for false detections. However, the rice panicle distribution can be relatively tight, and the colors of the panicles and leaves vary unevenly, which leads to missed detection. Therefore, this paper proposes an improved Mask R-CNN combined with Otsu pre-processing for rice panicle detection and segmentation [35].