| Maize is one of the major food crops in China and is susceptible to weeds in the early stages of its growth and development.Weeds compete with early maize seedlings for light,water and soil resources,inhibiting the growth of young maize seedlings and leading to reduced yields and lower quality of agricultural products.With the rapid development of computer technology and electronics,numerous weed control systems have been proposed to achieve site-specific weed management strategies,where the most important part for such systems is an accurate and effective weed detection system.In this study,an improved YOLOX-Nano lightweight network is proposed to perform the object detection task of maize seedlings and their associated weeds in field environments.The main research work of this paper is as follows:(1)Data set establishment.Field images were collected to build a dataset of maize seedlings and their associated weeds,and the difficulties of the weed target detection task were analyzed.In this study,the dataset was collected and annotated in the corn field for corn seedlings and their associated weeds from the third to the fifth leaf stage,and data augmentation was used to expand the dataset in order to reduce the annotation workload and increase the size of the dataset.Mosaic and Mixup enhancement is also used for online data enhancement during model training.(2)Baseline model selection.The YOLOX-Nano lightweight object detection model was selected as the baseline model for this study after a comprehensive comparison to improve its detection accuracy by conducting preliminary training of the object detection models in the YOLO series to verify the detection effect of each model in the data set of this paper.The mean average precision(m AP)of the original YOLOX-Nano is 78.64%,the F1 value is77.32%,the number of parameters of the model is 0.9 M,the computational complexity is 2.2GFLOPs,and the average inference time on Jetson Xavier NX is 22.3 ms.(3)Model optimization improvement.The original YOLOX-Nano model is optimized and improved in terms of network structure and loss function,firstly,Ghost convolution is introduced to improve the feature extraction capability of the backbone network;then three CBAM attention mechanism modules are added at the connection between the backbone network and the neck network;later,the neck network of the model is optimized and improved by using GS-Bi FPN as the feature fusion network for feature map Finally,the head network is restructured by using a hybrid channel strategy to retain the number of channels of the input feature map,while the size of the convolution kernel of the depth separable convolution module in the detection head is increased to increase the sensory field of the detection head.After the improvement of the network structure is completed,the loss function for model training is improved by using EIo U loss as the bounding box regression loss and Focal Loss as the confidence loss for model training.The improved YOLOX-Nano model has a parametric number of 2.19 M,a computational complexity of 3.6 GFLOPs,an average inference time of 44.3 ms,an m AP value of 88.47%,and an F1 value of 85.42% on the Jetson Xavier NX.Compared with the original model,the m AP value of the improved YOLOX-Nano model is improved by 9.86% and the F1 value is improved by 8.10%.(4)Camera calibration and coordinate system transformation.The internal reference matrix and aberration matrix of the camera were obtained by the tessellation calibration method of Zhengyou Zhang,and the rotation matrix and translation matrix required for coordinate transformation were calculated by the correspondence between the pixel coordinate point positions and the parallel arm workspace point positions for subsequent coordinate transformation of the detection results.(5)Field test.The optimized model of YOLOX-Nano is deployed to the embedded edge intelligence device of the weeding testbed to perform the weed detection task.The real-world coordinates of the weeds were obtained by coordinate transformation to drive the weed control device by parallel arm for spot spraying,and its effectiveness in practical application was evaluated by field trials.The experimental results show that the improved YOLOX-Nano object detection model proposed in this study meets the needs of practical production and provides a reference for field weed control systems with limited hardware resources. |