| In response to the national policy of advocating the development of intelligent agriculture and actively improving the automation and intelligence of agricultural equipment,this study aims to construct efficient and accurate green fruit detection algorithms to meet the needs of early intelligent yield measurement in orchards and automated harvesting by picking robots,as well as to improve the level of orchard intelligence as well as automation.Due to the complex background of the orchard environment,the green fruit is easily confused with the background branches and leaves,and there are problems such as overlapping occlusion,which affect the performance of the orchard intelligent equipment vision system.Combined with the frontier deep learning theory,the fast and accurate green fruit detection algorithm based on the optimized attention mechanism is constructed to solve the difficulties of mixed detection and wrong detection.The main research contents are as follows:(1)The green fruit datasets are constructed.The apple and persimmon images are collected under different lighting and angle conditions;the collected images are filtered and then annotated,data enhanced and sample expanded.The apple and persimmon datasets include 533 and 1361images respectively,and the training and test sets are divided in a ratio of 7:3 to complete the construction of the green fruit dataset.(2)To address the problems of small sample size in the dataset and high complexity of the detection model,a fast detection model based on optimized DETR is designed.A bootstrapping method is used to expand the dataset to enrich the sample size;CNN is used to extract fruit features and generate prediction boxes through an encoder-decoder structure;redundant detection boxes are eliminated with the help of binary matching;migration learning is introduced in the training process to accelerate the convergence of the network.The experimental results show that the detection accuracy50 on the apple and persimmon datasets is 77.4%and 77.6%,respectively.(3)Aiming at the low accuracy and insensitivity of small target areas in green fruit detection,an accurate detection model with optimized Deformable DETR is proposed.The Res Ne Xt network is adopted as the backbone of the model to reduce information loss during feature extraction;a deformable attention mechanism is introduced to fuse multi-scale features,and a green fruit decoder generates detection boxes;the final detection results are obtained by eliminating redundant detection boxes with a feed-forward neural network.The experimental results show that the detection accuracy50 andon apple dataset is 80.4%and 35.4%respectively.In summary,the accuracy and efficiency of the green fruit detection model is optimized based on the attention mechanism to address the challenges of green detection in the actual environment of complex orchards,effectively alleviating the problem of mixing and missing green fruits with branch and leaf backgrounds.The new model provides theoretical guidance and technical support for orchard yield measurement during the growing stage and harvesting during the ripening stage,improves orchard intelligence and automation,and provides theoretical reference for the detection of other green fruits. |