| As the world’s largest tomato production country,China’s tomato output accounted for about 31% of the world.With the increase of labor costs year by year,the development of intelligent tomato industry has become the future trend.Intelligent tomato cultivation and picking is of great significance for improving agricultural efficiency and product quality.However,due to the variety of tomato fruit shapes,colors,sizes,and easy to be affected by occlusion,traditional target detection methods are often difficult to accurately identify the position and state of tomato.Therefore,in view of the problems prone to tomato identification in different environments,this paper carries out relevant research on tomato detection methods based on deep learning.The main research contents and conclusions are as follows:(1)An improved Swin-YOLO target detection network based on shifted windows self-attention is proposed.Based on the YOLOv5 network,a shifted windows self-attention module is added to the Neck area to enhance the network’s ability to collect and integrate feature information.At the same time,the Concat structure of the original network is changed to add new branches to realize multi-scale feature fusion and alleviate the problem of shallow feature loss caused by new levels.Finally,SIo U loss function is used to replace the original loss function CIo U as the regression loss function of boundary frame to improve the location accuracy of boundary frame.The recognition rate of the improved model was improved in COCO dataset,which preliminarily verified its feasibility in tomato fruit detection.(2)Proposed the Swin GA-YOLO tomato detection network optimized by genetic algorithm.Swin GA-YOLO is the optimized version of Swin-YOLO on tomato dataset.The selection of genetic algorithm and mutation operator are used to optimize the structure and other super parameters of the improved network,so as to improve the fitness of the network for tomato detection task and give full play to the higher performance of the network.In this study,the experiment was carried out on the self-made tomato dataset and compared with the original network model.The results show that Swin GA-YOLO can achieve an average recognition accuracy of 84.7%,which is 2.9% higher than that of the original network model.When the average occlusion rate of tomato fruit was less than 30% and greater than 30%,the recognition rate increased by 2.1% and 4.2%,respectively.Under the three different occlusion relationships of interfruit occlusion,background occlusion and compound occlusion,the recognition rate increased by 0.7%,4.2% and 2.7%,respectively.In different stages of tomato development,the recognition rate increased slightly,which increased by 2.0%,3.5% and 3.2% for unripe,semi-ripe and ripe fruits,respectively,among which,the recognition rate increased most for semi-ripe tomatoes which were easy to be confused.This study effectively improved the problem of missing and false detection of tomato fruits due to more shielding,smaller target and difficult identification of maturity.(3)Develop a two-platform tomato fruit detection system.On the mobile end,Android Studio was used to design the interactive interface of tomato fruit detection APP,and Pytorch neural network model file was deployed to realize the functions of local model switching,parameter adjustment,image selection recognition,photo recognition,real-time detection,fruit counting and cloud detection.The desktop is based on the IDEA platform and developed with Java GUI components,which can be used for local image detection,cloud detection record management and statistical analysis. |