## 6 Conclusions  
In this study, an improved tomato ripeness detection method is proposed that significantly improves the detection accuracy and efficiency of the model by combining Swin Transformer, Distributed Shift Convolution, and Focal-EIOU loss function in the YOLOv8 architecture. The method uses the multi-scale feature extraction capability of Swin Transformer to improve the model's ability to capture details in tomato images, especially the small differences between tomatoes at different ripening stages. Meanwhile, the introduction of distribution-shift convolution is used to efficiently handle feature extraction under different location and scale variations of tomatoes in the image while reducing the computational overhead. In addition, the Focal-EIOU loss function further improves thelocalization accuracy by focusing on difficult-to-detect tomato targets and optimizing the bounding box regression. The experimental results show that the improved model outperforms the traditional method in several evaluation metrics, demonstrates strong practicality and stability, and can better support the task of real-time tomato ripening monitoring in automated agriculture. The experimental results showed that the improved model achieved significant performance improvement, with mAP50 and Recall reaching 86.9% and 82.0%, respectively. Compared with the base YOLOv8s model, the improved model achieved a 2.3% improvement in mAP50 and a 6.8% improvement in Recall, showing a substantial improvement in the accuracy of our method in tomato ripeness detection. The improved model also performed very well in detection speed, reaching 190.34 FPS, which can meet the demand of real-time fast detection. Meanwhile, the number of parameters of the model is reduced from 11.13 M to 10.18 M, which means that the model is not only more lightweight but also effectively reduces the resource consumption while improving the computational efficiency, providing more possibilities for practical deployment on mobile devices. Through the validation of the ablation experiments, we demonstrate that the introduction of each module plays a positive role in improving the model performance, further confirming the effectiveness of each module in optimizing the model performance. This experiment also found that the improved YOLOv8s model showed better performance in tomato ripeness detection tasks by comparing it with the YOLOv5, YOLOv7-tiny, YOLOv8n, and YOLOv8m models. Compared with other models, the improved YOLOv8s model achieved significant advantages in both mAP50 and mAP50-95 metrics, showing higher detection accuracy. Meanwhile, the improved model shows better-balanced performance by maintaining higher inference speed while maintaining higher accuracy. These results indicate that the improved YOLOv8s model has significant advantages in the tomato ripening detection task and that the adopted improvement strategy plays an important role in the model's performance. In summary, the improved YOLOv8 algorithm proposed in this paper demonstrates excellent performance in tomato ripeness detection tasks, especially in complex scenarios. By optimizing the model structure and improving the detection accuracy, this study provides an effective technical tool for the agricultural field and promotes the progress of real-time tomato ripeness detection. These results not only provide a technical guarantee for the precise management of tomato planting but also provide new ideas for improving the efficiency and quality of agricultural production, which has important practical application value. Conceptualization, S.W. and J.X. ; methodology, S.W. and J.X. ; software, J.X. ; validation, S.W., J.X. and D.C.; formal analysis, S.W. ; investigation, J.X. ; resources, C.Z. ; data curation, D.C.; writing--original draft preparation, S.W. and J.X. ; writing--review and editing, S.W. and J.X. ; visualization, J.X. ; supervision, S.W. ; project administration, D.C. All authors have read and agreed to the published version of the manuscript.