## 4 Results and Analysis
### Performance Comparison of Different Detection Algorithms  
In this paper, several improvements are made to the original YOLOv8s model with the aim of increasing the accuracy and efficiency of the tomato ripeness detection task. The performance of the improved model was evaluated through a series of experiments and compared and analyzed with several benchmark models such as YOLOv5n, YOLOv7-tiny, YOLOv8n, and YOLOv8m. The experimental results are detailed in Table 5, which shows the comparative performance of the improved model with the other models on various metrics. From the experimental results, the detection accuracy of the improved model is higher than that of other models. The mAP50 of the improved model is 4.3%, 2.4%, 4.5%, 2.3%, and 2.1% higher than that of YOLOv5n, YOLOv7-tiny, YOLOv8n, YOLOv8s, and YOLOv8m, respectively. The mAP50-90 of the improved model is 7.9%, 8.4%, 4.6%, 1.4%, and 0.6% higher than YOLOv5n, YOLOv7-tiny, YOLOv8n, YOLOv8s, and YOLOv8m, respectively. From the point of view of FPS, although the improved model is not the fastest, it is second only to YOLOv8n and YOLOv8s and faster than YOLOv5n, YOLOv7-tiny, and YOLOv8m. Because we use the Focal-EIOU loss function, more detailed calculations are needed when focusing on targets that are difficult to predict and locate. And use Swin Transformer to increase the local receptive field to help the network capture more image features. So more inference time is needed. Although the inference speed of YOLOv8n and YOLOv8s is relatively faster than our model's, their accuracy is lower. This shows that the improved model not only improves the detection accuracy but also maintains a relatively high inference speed and has a good performance balance. Generally speaking, the improved YOLOv8s model has achieved good performance in the tomato maturity detection task, and its mAP50 and mAP50-95 indexes are significantly better than those of other models and maintain a high inference speed while maintaining a high accuracy. This shows that the improved model has obvious advantages in improving the accuracy and efficiency of tomato maturity detection. In addition, Table 6 shows the Recall and detection accuracy of different models for each category. It can be seen from the table that the Recall and accuracy of the improved model detection b_half ripened, b_fully ripened, and l_green are better than those of other models. Category b_green also has higher Recall than other models, and its accuracy is second only to YOLOv8m. Although the Recall and accuracy of categories l_half ripened and l_fully ripened are not the highest, they are also improved compared with the baseline model YOLOv8s. These results show that our improved model strengthens the ability to extract important features in complex environments. Overall, the improved model shows superior performance in most categories. Although the model still has room for improvement in the detection of small targets, overall the improved model has improved detection Precision and Recall compared with other benchmark models. To evaluate the detection performance of our improved model on the Laboro-Tomato dataset, we also used the confusion matrix. This is shown in Figure 8. Through the confusion matrix, we are able to get a comprehensive understanding of the model's prediction