# Green Sweet Pepper Fruit and Peduncle Detection Using Mask R-CNN in Greenhouses
###### Abstract
For testing, group A uses eight, four, and two samples of red, mixed, and green sweet peppers, respectively. Group B balances the number of samples per color, 14 for each of the color varieties for training, and for testing, four for red and five for mixed and green each. The first model achieves a value of 89.76% in classification accuracy for group A, where more relevance is given to the red variety of sweet pepper. However, the same model for group B, where the same relevance is given to the red, green, and mixed color varieties, achieves a value of 77.43% in classification accuracy, showing a decrease of 12.33% in comparison. Likewise, for the second model, from which the best value metrics are reported, group A reaches a value of 90.03% and decreases to 87.88% in classification accuracy, thus again demonstrating the comparative difficulty in detecting the peduncle in the green variety of sweet pepper. Ref. [15] does not report processing times or related metrics. Regarding detection methods for other crops, ref. [16] proposes a multitask method for the detection of the main stem, secondary peduncles, and fruits of the tomato bunch (main key points) based on bounding boxes and key points (multi-task deep cascade learning network). Ref. [17] proposes a method for estimating grape cluster poses based on Mask R-CNN and point cloud segmentation, achieving a mean intersection over union (mIOU) for instance segmentation of 87.9%, and for the detection results a mean precision of 86.0%, a mean recall of 79.9%, and an F1-score of 0.828. Ref. [18] generates a parallel network structure based on a CNN and a transformer for the segmentation of instances of grape clusters and grape peduncles in strongly occluded scenarios, achieving an IoU (intersection over union) value for the grape peduncle segmentation of 72.1%, and a mIoU (mean intersection over union) value of the general model of 83.7%. Ref. [19] presents a computer vision system for the detection of fruits and localization of peduncles in tomato crop that achieves classifications of beef and cluster tomatoes of 80.8% and 87.5%, respectively. Ref. [20] proposes the use of the Mask R-CNN algorithm for the detection and segmentation of mature green tomatoes, achieving F1-scores for bounding boxes and mask regions of 92.0% when the IoU is equal to 0.5 and using a ResNet50+FPN as the backbone network. Ref. [21] proposes a method for peduncle cutting point localization and pose estimation based on YOLOv4-Tiny as a detector and YOLACT++ Network as an instance segmenter, achieving a detection accuracy of 92.7% and a _mAP_ of 73.1% for segmentation. After extensive research, it was identified that only [14; 15] constitute the state-of-the-art models of sweet pepper peduncle detection and simultaneous detection of sweet pepper fruits and peduncles; ergo, more research is needed to solve this issue. Traditional and isolated machine vision algorithms are no longer enough for the challenging task of detecting the fruit and peduncle of sweet pepper, and it is necessary to direct efforts to the use of deep neural network (DNN) methods [22], a technology that has proven to be more robust, and capable of solving these problems in a better way. Compared to previous traditional machine vision methods, deep neural network methods have positioned themselves as the most widely used for crop detection due to their strong and extensive ability to learn autonomously and perform feature extraction [23; 24]. Ref. [25] manages to optimize the structure of the VGGNet model (Visual Geometry Group, a classical convolutional neural network) and generate an eight-layer network, intended for the extraction of tomato organ features; for example, flower and fruit. Ref. [26] presents a work based on the LeNet convolutional neural network (CNN), which surpasses other traditional methods in accuracy and speed for the identification of multi-cluster kiwifruit. The adoption of the Fast R-CNN model [27] based on multimodal fusion information (near-infrared and RGB) is used for the detection of sweet peppers.