Rice is an important food crop in China,but it is vulnerable to pests in the process of growth,and its yield and quality will be reduced to varying degrees.Accurate detection and diagnosis of pests is very important to improve the pertinence of pesticide application decision and accurately predict crop yield.There are many kinds of pests in paddy field,so it can’t guarantee that the number of samples of each kind of pests can make the detection model converge.This paper studies how to make the ab initio training model converge and improve the accuracy of the model when the number of samples is insufficient.This paper mainly carried out the following work:(1)The created rice pest data set contains 5 categories,a total of 1343.The original images were obtained by Internet download and mobile phone shooting in the experimental paddy field.The main backgrounds of rice pests are paddy field,sandy land,white gauze and laboratory potted plants;There are three perspectives: front view,side view and top view;The posture of the pest is inclined and overlapped.There is at least one pest in each rice pest image.In order to enrich the number of samples,random clipping,flipping and rotation are used to enhance the capacity of the data set,and the number of enhanced samples is nearly doubled.Finally,the number of images between each category is maintained between 1:1.5 to ensure the balance of samples.Randomly selected images are divided into training set and test set according to the scale of 4:1.In this paper,the backbone network of feature extraction from cascaded r-cnn is pre trained through the public datasets Imagenet and cifar100,which are similar to the appearance of rice pests,and then fine tuned on the rice pest datasets.(2)The cascade r-cnn can converge through data amplification and pre training,but the accuracy of the model is still very low because the pest target is small and difficult to detect.In order to solve the problem of small target detection,the cascade r-cnn is improved.Firstly,feature pyramid structure FPN is used to improve the ability of small target extraction,and the average accuracy of AP is improved by 2.32%;Secondly,soft NMS is used to replace the original NMS with non maximum suppression to reduce the detection targets lost due to overlapping;Then,ROI alignment is calibrated by region of interest to ensure that the features of small targets are not lost when extracting features,and the average accuracy is improved by1.74%.Experiments show that this method can effectively identify and detect rice pests in complex background,and its average accuracy is 94.15%.(3)When the number of samples is less,the model still can not converge in the way of data amplification and pre training.In order to solve the above problems,this paper cascades an optimized fsdetview model after the optimized cascaded r-cnn model.Based on the algorithm fsdetview,the attention mechanism is introduced into the regional recommendation network to improve the accuracy of the model.Due to the change of the structure of regional recommendation network,this paper gives the corresponding loss function.Pascal VOC was used to learn and compare the parameters of the network,and then fine-tuning and prediction were made on the rice pest data set.Experimental results show that adding attention mechanism to the regional recommendation network improves the accuracy of the original algorithm,and the accuracy reaches 57.4% under the condition of 10 samples in each class.In this study,two rice pest detection algorithms based on different number of samples were established.First,cascade r-cnn model is used for detection.When the number of samples is further reduced and the model can not converge,the detection algorithm is switched to a few samples detection algorithm by judging conditions.So as to provide theoretical support for the follow-up research of intelligent detection algorithm of agricultural pests. |