Crop localization is the key to realize smart agriculture.Crop seedlings and weeds have similar morphological and color characteristics;some crops are planted by dense sowing,resulting in seedlings often being obscured,which makes it difficult for automatic machine detection.To address the problem of obscured crop seedlings,this paper proposes two marking strategies and designs a crop seedling detection model combined with a lightweight transformer,which effectively solves the problem of obscured crop seedlings and provides a theoretical basis and technical support for later crop refinement management.The main work is as follows.1.To produce a crop seedling dataset,images of wheat,soybean,cucumber and radish seedlings with different light,angle and growth period were taken in an unweeded field,and a total of 2140 images were taken.The detection frames were labeled by labelimg software,and data enhancement was performed during model training using Mosic data enhancement method to improve the generalization ability and detection accuracy of the model.2.For the densely planted crops with complex morphology,it is very easy to generate errors in the labeling process and the large differences between different individuals will lead to the problem that the model cannot learn the feature logic.This paper proposes two dense crop data tagging methods for the whole crop and single leaf,respectively,to improve the average detection accuracy to 84.3% and 4.6% for dense crops,effectively improving the detection accuracy and reducing the occurrence of missed detection.3.A crop seedling target detection network with a visual transformer is designed based on the single-stage target detection network YOLOv5.The detection model yield parameters are optimized using a hyperparametric search algorithm based on genetic algorithm to obtain the best model performance.The focal loss was used to calculate the localization loss,and an average detection accuracy of 85.3% was obtained,with a 3.8% improvement in intensive crop detection accuracy.4.The influence of feature Query,Key and Value in transformer on detection accuracy is explored,and the light optimization of transformer mechanism is carried out based on this basis to improve the 17ms/Frame model computation speed. |