| In recent years,with the popularization and progress of deep learning technology,various smart devices have achieved unprecedented vigorous development.Intelligent weeding equipment represented by drones has been widely used in the agricultural field because of its high efficiency and convenience,effectively alleviating the problems of agricultural labor shortage and uneven application of pesticides.Due to the limited computing and storage resources of terminal weeding equipment such as drones,the intelligent development of agriculture has been limited.How to build a highperformance,low-storage,and low-computation deep learning model based on the limited resources of terminal equipment is a major challenge for the development of agricultural intelligence.At present,there have been many related studies on deep learning weed classification methods,but most of these studies focus on the performance improvement of server-side classification models,and less research on performance optimization and terminal deployment of mobile-end classification models.Therefore,this paper considers the resource constraints of the terminal device,and optimizes,improves and deploys the mobile-end lightweight weed classification model by using weighted loss function,knowledge distillation,quantitative deployment and other methods.The main research content can be divided into three parts:(1)Research on weed classification method based on mobile terminal lightweight depth model.Firstly,the research and comparison of the server-side Res Net series models based on transfer learning and the mobile-side Mobile Net series models are carried out,and the optimal models of the two series are established.Then according to the data set,the optimal model uses the semi-supervised knowledge distillation method and the method of setting the weighted Softmax loss function.The experimental results demonstrate the effectiveness of the two methods in improving the accuracy of the model.Finally,the teacher model is used to guide and optimize the student model,so as to obtain a lightweight weed classification model for mobile terminals with high performance,low storage and low computation.The experimental results show that the weed classification model improved by the proposed knowledge distillation and setting the weighted Softmax loss function can achieve a good effect of 0.8%increase in accuracy,7.8% reduction in inference time,and 80% reduction in model size.(2)Research on quantification and deployment of weed classification model based on Paddle Paddle.First,quantify the parameters of the weed classification model on the Paddle Paddle server platform to reduce the model scale,and then deploy the quantified weed classification model on the hardware device Raspberry Pi 3B+ for experimental comparison.The experimental results show that the inference time of the mobile model is only about 1/10 of that of the server model.The inference speed of weed classification on Raspberry Pi 3B+ is about 6fps,and the quantified miscellaneous Grass classification model size is reduced by more than 40%,demonstrating the effectiveness of quantization for model size reduction.(3)Research on the structure optimization method of weed classification model based on attention mechanism.In this paper,a weed classification model with more balanced performance is obtained by replacing the attention mechanism module in the model and optimizing the model structure.In the experiment,two important indicators,test accuracy and model parameters,were used to measure the comprehensive performance of the weed classification model.The experimental results show that the Mobile Net_CBAM weed classification model based on the CBAM attention mechanism loses 0.3% in accuracy compared to the Mobile Net V3_Large model based on the SE-Net attention mechanism,but the model parameter size is reduced by 24.7%,and the overall is more balanced. |