Tomato Maturity Detection and Counting Model Based on MHSA-YOLOv8

Ping Li,Jishu Zheng,Peiyuan Li,Hanwei Long,Mai Li,Lihong Gao,Li,Zheng,Li,Long,Li,Gao
DOI: https://doi.org/10.3390/s23156701
IF: 3.9
2023-07-27
Sensors
Abstract:The online automated maturity grading and counting of tomato fruits has a certain promoting effect on digital supervision of fruit growth status and unmanned precision operations during the planting process. The traditional grading and counting of tomato fruit maturity is mostly done manually, which is time-consuming and laborious work, and its precision depends on the accuracy of human eye observation. The combination of artificial intelligence and machine vision has to some extent solved this problem. In this work, firstly, a digital camera is used to obtain tomato fruit image datasets, taking into account factors such as occlusion and external light interference. Secondly, based on the tomato maturity grading task requirements, the MHSA attention mechanism is adopted to improve YOLOv8's backbone to enhance the network's ability to extract diverse features. The Precision, Recall, F1-score, and mAP50 of the tomato fruit maturity grading model constructed based on MHSA-YOLOv8 were 0.806, 0.807, 0.806, and 0.864, respectively, which improved the performance of the model with a slight increase in model size. Finally, thanks to the excellent performance of MHSA-YOLOv8, the Precision, Recall, F1-score, and mAP50 of the constructed counting models were 0.990, 0.960, 0.975, and 0.916, respectively. The tomato maturity grading and counting model constructed in this study is not only suitable for online detection but also for offline detection, which greatly helps to improve the harvesting and grading efficiency of tomato growers. The main innovations of this study are summarized as follows: (1) a tomato maturity grading and counting dataset collected from actual production scenarios was constructed; (2) considering the complexity of the environment, this study proposes a new object detection method, MHSA-YOLOv8, and constructs tomato maturity grading models and counting models, respectively; (3) the models constructed in this study are not only suitable for online grading and counting but also for offline grading and counting.
engineering, electrical & electronic,chemistry, analytical,instruments & instrumentation
What problem does this paper attempt to address?
The paper aims to address the issues of tomato maturity grading and counting. Specifically, it focuses on the need for grading and counting tomatoes by maturity during actual cultivation and sales processes. Traditionally, these tasks have relied mainly on manual observation, which is not only time-consuming and labor-intensive but also limited in accuracy due to the precision of human vision. With the development of artificial intelligence and machine vision technology, this problem has been improved to some extent. To further enhance the level of automation, the authors first collected a dataset of tomato images in real production environments, considering factors such as occlusion and lighting interference. Secondly, based on the current state-of-the-art single-stage object detection method YOLOv8, they introduced a Multi-Head Self-Attention mechanism (MHSA) to enhance the feature extraction capability of the YOLOv8 backbone network, thereby proposing a new object detection method MHSA-YOLOv8. Using this method, they constructed tomato maturity grading and counting models, which are suitable for both online and offline detection, significantly improving the efficiency of harvesting and grading for tomato growers. The main innovations of the paper include: 1. Constructing a tomato grading and counting dataset that includes 3 different maturity categories, considering external lighting interference and occlusion issues in actual production. 2. Proposing an object detection method based on MHSA-YOLOv8, further enhancing the detection performance of the YOLOv8 model. 3. From the perspective of multi-task models, constructing tomato maturity grading and counting models separately, providing technical support for unmanned operations in the tomato cultivation process.