# Improved Mask R-CNN Combined with Otsu Preprocessing for Rice Panicle Detection and Segmentation
## 3 Experimental Results and Analysis
### Results and Analysis
#### 3.2.2 Error Analysis  
Twenty randomly selected rice images at the milk ripening stage were detected and segmented using the three methods. The results were converted into grayscale images, and the SSIM values and pHash values were calculated with reference to the grayscale images to comprehensively measure the detection result accuracy. The reference grayscale images were then converted into rice panicle images after manual labeling. Some example images are shown in Figure 8. In some of the images, such as those in Figure 8a-c, the contrast between the rice panicle and background is obvious, while in others, such as those seen in Figure 8d-f the contrast between the two elements is poor.  
Figure 6: Examples of detection results using different methods.  
Figure 7: Results from different methods and examples of binarized images: (**a**) Original image; (**b**) Otsu; (**c**) Mask R-CNN; (**d**) Panicle-Mask.  
Table 2 shows the SSIM results obtained using the different methods. Analysis of the data in Table 2 showed that among those obtained with the three methods, the SSIM obtained by direct detection using the Mask R-CNN algorithm yielded the second-highest results, with a maximum of 92.31%. The results obtained using Otsu segmentation and the improved model were the highest, with minimum values above 88% and a maximum of 95.86%. The results obtained from the Otsu algorithm showed that the segmentation results were better for rice images 9, 12, and 13, where the color difference between the rice panicles and the background was larger, while the color difference was smaller for rice images 3, 5, 19, and 20. Images 3 and 20 were first preprocessed using the Otsu algorithm to remove interference from the background region, and then detected and segmented using the improved Mask R-CNN algorithm model. The obtained SSIM values improved by approximately 10%.  
\begin{table}
\begin{tabular}{c c c c} \hline
**No.** & **Otsu (\%)** & **Mask R-CNN (\%)** & **Panicle-Mask (\%)** \\ \hline  
\hline \end{tabular}
\end{table}
Table 2: SSIM values for the different methods.  
Figure 8: Example images from the test set: (**a**) No. 9; (**b**) No. 12; (**c**) No. 13; (**d**) No. 5; (**e**) No. 19; (**f**) No. 20.  
Table 3 shows the pHash results obtained using the different methods; the pattern of the data was approximately the same as that in Table 2. As seen in Table 3, the accuracy of the results obtained by directly using the Mask R-CNN algorithm for detection was low, with a maximum pHash value of 12, which may be related to the different growth characteristics of rice with different panicle shapes, sizes, and colors. The accuracy of the results obtained by using the Otsu algorithm showed overall improvements; specifically, the segmentation results for images 12 and 13 were more similar to the real results. The segmentation accuracy was further improved by combining the Otsu algorithm and Mask R-CNN in the Panicle-Mask algorithm, and the perceived hash value of all the detected rice images was no more than 5. The perceived hash value of images 12 and 13 was reduced to 2, which indicates that the results obtained by this method are very similar to the real results.