## 4 Results and Analysis
### Performance Comparison of Different Detection Algorithms
\begin{table}
\begin{tabular}{c c c c c c c c c c c c} \hline \hline \multirow{2}{*}{**Model**} & \multirow{2}{*}{**Categories**} & \multirow{2}{*}{**b\_Green**} & \multicolumn{2}{c}{**b\_Half**} & \multicolumn{2}{c}{**b\_Fully**} & \multicolumn{2}{c}{**l\_Green**} & \multicolumn{2}{c}{**l\_Half**} & \multicolumn{2}{c}{**l\_Fully Ripened**} \\ \cline{2-13}  & & **R(\%)** & **AP50(\%)** & **R(\%)** & **AP50(\%)** & **R(\%)** & **AP50(\%)** & **R(\%)** & **AP50(\%)** & **R(\%)** & **AP50(\%)** & **R(\%)** & **AP50(\%)** \\ \hline YOLOv5n & 75.9 & 88.2 & 77.8 & 87.5 & 82.9 & 79.5 & 72.6 & 82.8 & 67.3 & 76.0 & 73.0 & 81.8 \\ YOLOv7-tiny & 77.8 & 87.5 & 84.7 & 88.6 & 80.5 & 81.6 & 73.6 & 84.4 & 77.7 & 82.0 & 70.8 & 82.7 \\ YOLOv8n & 76.4 & 86.0 & 77.6 & 81.4 & 75.6 & 74.0 & 77.6 & 83.3 & 75.0 & 83.7 & **82.6** & 86.0 \\ YOLOv8m & 81.5 & **91.3** & 77.0 & 81.9 & 80.5 & 79.5 & 77.2 & 86.3 & 73.2 & **83.9** & 80.0 & 85.9 \\ YOLOv8s & 78.7 & 87.3 & 81.9 & 86.3 & 75.6 & 81.5 & 72.2 & 86.0 & 73.2 & 79.0 & 69.5 & **87.5** \\ Proposed method & **82.0** & 89.8 & **86.1** & **90.1** & **89.0** & **84.6** & **80.2** & **87.2** & 75.1 & 83.1 & 79.9 & 86.4 \\ \hline \hline \end{tabular}
\end{table} 
Table 6: Comparison of Recall rates and accuracy for each category of different models. Bold values indicate the optimal values in the results. \begin{table}
\begin{tabular}{c c c c c} \hline \hline
**Model** & **mAP50** & **mAP50-95** & **Inference Time (ms)** & **FPS** \\ \hline YOLOv5n & 0.826 & 0.648 & _7.7_ & 169.1 \\ YOLOv7-tiny & 0.845 & 0.643 & 17.1 & 156.2 \\ YOLOv8n & 0.824 & 0.681 & 2.6 & **288.05** \\ YOLOv8s & 0.846 & 0.713 & **4.0** & 204.13 \\ YOLOv8m & 0.848 & 0.721 & 6.6 & 134.25 \\ Proposed Method & **0.869** & **0.727** & 4.4 & 190.34 \\ \hline \hline \end{tabular}
\end{table} 
Table 5: Results of Comparative experiment. Bold values indicate the optimal values in the results. accuracy on different categories and infer the overall performance of the model from it, which provides an important reference for further improvements and optimizations, where (a) is the confusion matrix for detection using YOLOv8s; (b) is the confusion matrix after matrix (a) has been normalized in the column direction; (c) is the confusion matrix for detection by our method; and (d) is the confusion matrix after (c) has been normalized in the column direction. The rows of the matrix represent the predicted categories. The columns of the matrix denote the true categories. The elements on the diagonal lines indicate the number of correct predictions made by the model on the corresponding category, while the elements on the off-diagonal lines indicate the misclassification of the model on a certain category. It is clear from Figure 8 that there are two categories that have a lower probability of being correctly recognized with our method than YOLOv8s. One of these categories is b_green. For this category, the probability of our method misrecognizing it as both b_half ripened and background has decreased. But the probability of misrecognizing it as l_green has increased. This may be due to the fact that some of the features of the large green tomato in the picture are not obvious due to the shooting angle, distance, and other factors. Thus causing the model to recognize more tomatoes of category b_green as l_green. The other one is category b_half ripened. The probability of our method to recognize this category correctly is slightly lower than that of YOLOv8s, which may be due to the fact that some of the features of the fruits with category b_half ripened are too similar to those of b_green and b_fully ripened, which causes the model to fail to distinguish them correctly. However, for the other four categories, the probability of correct recognition by our model is greater than that of YOLOv8s.