# A Novel Deep Learning Method for Detecting Strawberry Fruit
## 3 Experiments And Results
### Ablation Experiments of Different Improved Models  
The detection results of different improved models are shown in Table 6 and Figure 8. R-YOLO improved the detection speed by 32 FPS while maintaining the \(mAP_{0.5}\) value essentially unchanged. Compared with R-YOLO, RT-YOLO improved the \(mAP_{0.5}\) by 2.6 points, but the attention mechanism introduced an increase in FLOPs, which resulted in a slight reduction in the detection speed. Finally, RTF-YOLO integrated the focal loss function with RT-YOLO, which improved the model's recall rate and improved by more than 1 \(mAP_{0.5}\) point. Ultimately, compared with the original YOLOv5 model, our proposed RTF-YOLO model achieved an almost 3.6 point \(mAP_{0.5}\) improvement and a 23 FPS increase in detection speed. The confusion matrix of different improved models is shown in Figure 9. In the confusion matrix, the horizontal axis represents the ground truth labels, while the vertical axis represents the labels predicted by the model. The first two columns represent the counts of the ripen and unripen strawberry labels, respectively. Their sum equalled the total number of labels in the test dataset in Table 1, which was 820. The triplet attention mechanism boosted the feature extraction, which raised the count of accurately detected strawberries by 32. Unripened strawberries were susceptible to false detections and missed detections for resembling leaves in color. The focal loss function could enhance the learning capacity for these challenging objects. As a result, RTF-YOLO reduced the count of unripened strawberries' false and missed detections by six compared with RF-YOLO. \begin{table}
\begin{tabular}{l|c c c c c c c c} \hline \hline \(\alpha\) & \(\gamma\) & **1.00** & **1.20** & **1.40** & **1.60** & **2.00** & **2.40** & **3.00** & **5.00** \\ \hline
0.10 & 88.26 & 87.72 & 89.63 &  
The visualization results of different improved models are depicted in Figure 10. The \(r1\) label in the diagram signifies unripened strawberries, whereas the \(r2\) label signified \begin{table}
\begin{tabular}{l c c c c c c c c} \hline \hline \multirow{2}{*}{**Model**} & \multirow{2}{*}{\(\mathbf{P}\) (\%)} & \multirow{2}{*}{\(\mathbf{R}\) (\%)} & \multicolumn{3}{c}{\(\mathbf{AP_{0.5}\) (\%)} } & \multirow{2}{*}{\(\mathbf{mAP_{0.5}\) (\%)} } & \multirow{2}{*}{\(\mathbf{mAP_{0.75}\) (\%)} } & \multirow{2}{*}{\(\mathbf{mAP_{0.50.95}\) (\%)} } & \multirow{2}{*}{**FPS**} \\ \cline{5-9}  & & & **Unripen** & & & & & \\ \hline YOLOv5 & 89.67 & 77.21 & 82.60 & 90.50 & 86.55 & 62.08 & 55.61 & 122 \\ R-YOLO & 89.05 & 78.50 & 82.20 & 90.90 & 86.58 & 62.75 & 54.87 & **154** \\ RT-YOLO & 91.43 & 81.05 & 84.60 & 93.50 & 89.21 & 63.46 & 56.29 & 145 \\ RTF-YOLO & **91.92** & **81.43** & **86.30** & **94.30** & **90.24** & **64.84** & **57.65** & 145 \\ \hline \hline \end{tabular}
\end{table} 
Table 6: The ablation experiment results of different improved models. Figure 8: The precision–recall curves. (**a**) The recall–precision curve of different improved models. (**b**) The recall–precision curve of various categories obtained by RTF-YOLO. Figure 9: Comparative confusion matrices of various improved models. ripened strawberries. All the improved models demonstrated some enhancements in the occurrences of false positives and negatives. However, considering the overall performance, RTF-YOLO achieved the best results. For example, as shown in (a), the YOLOv5 model incorrectly detected the leaves in the bottom-right and right sides as unripened strawberry fruits. The RT-YOLO model resolved the false positive problem but introduced a false negative in the top right. RTF-YOLO, on the other hand, successfully addressed both types of problems. As shown in (b), YOLOv5 and R-YOLO suffered from false negatives for unripened strawberries, which had colors similar to the leaves. However, RTF-YOLO effectively eliminated false negatives by enhancing the learning of such challenging examples.