| China is the largest producer of citrus fruit in the world,but citrus pest occur frequently,and 10%-20% of the total annual citrus production is lost due to pest infestation,which seriously limits the development of the industry.To achieve accurate and efficient control of the pests,pest identification is a prerequisite.At present,however,citrus pests are usually identified by farmers based on their experience,which is time-consuming,labor-intensive,and the identification accuracy rate cannot be guaranteed.Therefore,there is an urgent need to develop an automated identification tool for citrus pests,which can provide farmers with efficient and accurate pest identification services,conduct precise pest control and improve economic efficiency.In this study,we collected 10 types of common citrus pests as the dataset and used MobileNetV2 as the baseline network to develop an intelligent identification tool for citrus pests.Based on the confusion matrix and class activation map visualization analysis results,background segmentation was carried out for the citrus pest in the training dataset,and the performances of the model were compared when using multiple attention mechanisms.The details of the study are as follows:(1)For the 10 most common pests in citrus orchards,4191 images were collected in this paper and divided into training set,validation set and test set according to the ratio of 60%,20% and 20%.MobileNetV2 network was used for citrus pest classification,and data augmentation operations were applied during model training to enhance the robustness of this network.The test results showed that the model accuracy reached 91.95%.Loss curve and confusion matrix were generated based on the training and testing results,and the classification ability of the model for each class of pest was analyzed.In addition,class activation map visualization analysis was performed on the trained model,revealing that the complex background of the pest images had a certain weight in classification process,which affected the classification accuracy.(2)In order to reduce the impact of complex backgrounds,semantic segmentation and image masking were used to remove background of the training dataset images.The network was then validated and tested on the unsegmented validation and test sets,respectively.The test accuracy of new MobileNetV2 model after training on the segmented training set reached 92.60%,and the classification performance was better than that of the original dataset model.After analyzing the confusion matrix,it was found that the segmented dataset model still had weak classification abilities for some pests,indicating the feature extraction capabilities of the baseline network model needed to be improved.Comparing the heatmaps of the two types of dataset models,it was found that the attention regions of segmented dataset model were more focused on the pest regions,while there were still a few scattered attention regions in the background.(3)To enhance the feature extraction capability of the baseline model,three types of attention mechanisms,SE,CBAM,and ECA,were added to the bottleneck layer of the MobileNetV2 model.With the same parameter setting,the improved networks were trained,validated,and tested using the segmented dataset of citrus pests.The test results showed that ECA_MobileNetV2 model achieves a classification accuracy of 93.87%,which was better than other improved networks.The complexity of the model was relatively low,which could meet the computation requirements on edge devices.A comparison test of network parameters for the ECA_MobileNetV2 model showed that the model had the highest classification performance when the image input size was336×336 and the learning rate was 0.001.(4)To develop a real-time detection tool for citrus pests that could be applied in citrus-producing areas with poor network signal,this paper proposed an Android app based on edge computing.To build the edge computing app,the ECA_MobileNetV2 model was converted into Paddle Lite format for lightweight deployment and inference on the application side,achieving the pest classification inference function.The virtual machine and actual machine tests were performed on the citrus pest identification app,and both were able to achieve the classification and prediction function of citrus pests. |