Pest infestation is the most important factor and the biggest threat to food loss during storage.Every year,millions of tons of food are lost due to the ravages of food pests,bringing huge losses to the national economy.Due to the inability to discover the erosion of grain by insect pests in granaries in time,most domestic granaries adopt multiple fumigation to reduce the damage of insect pests,but it also causes problems such as environmental pollution of granaries and the enhancement of insect resistance.In recent years,due to the increase in the species and density of stored grain pests,the loss of stored grain is more serious.Therefore,rapid and accurate monitoring of grain warehouse pests for targeted control measures is very important.With the rapid development of deep learning technology in the field of computer vision,it provides sufficient theoretical and technical support for stored grain pest detection based on deep learning.The target detection method of stored grain pests based on deep learning can predict the density and type of pests in grain silos in time,which is conducive to taking targeted measures to reduce grain loss.In this paper,the deep learning target detection technology was used to detect 5 kinds of crustacean pests with greater harm in grain warehouses.The Faster RCNN algorithm based on Two-stage target detection and YOLOv5 algorithm based on One-stage target detection were optimized and a large number of experiments were designed.By improving the two algorithm models,the high precision and real-time detection of grain insects was realized.(1)Firstly,the common detection methods of stored grain pests are analyzed,and the literature data of stored grain pest detection at home and abroad are studied.Then,based on the analysis of the structure,algorithm and evolution history of convolutional neural network,The advantages,disadvantages and innovations of Two-stage Faster RCNN algorithm and One-stage YOLO series algorithm were discussed,which provided theoretical basis and technical support for the detection and identification of stored grain pests based on deep learning.(2)Build data set.In this paper,live food worm videos were shot under the background of whiteboard and complex background,and the image data of food worm was obtained by means of video screenshots.Then Label IMG software was used to mark the worm target in the image,and the data enhancement code was used to expand the original data sample and enrich the worm training data.Then,the training set,verification set and test set are divided according to the ratio of 7:2:1 through the segmentation code,and the construction of the BEJP data set is completed.(3)Optimization based on Faster RCNN algorithm.Through analyzing the problems of Faster RCNN in the detection of food insect targets,an optimization and improvement scheme was proposed.Firstly,an improved FPN network was added behind the backbone network Res Net50 to generate multi-scale features with rich contextual information,and at the same time to inhibit the conflict in the fusion of multi-scale features.Secondly,the K-means++ algorithm was introduced to obtain the proportion of Anchor suitable for grain insect detection,so as to solve the incompatibility problem of RPN standard anchor frame for small grain insect targets.Then ROIAlign Pooling is used to replace ROI Pooling to reduce quantization operation errors and improve the accuracy of the algorithm in the ROI layer.Finally,the improved -EIoU function is used as regression loss to solve the training data shock phenomenon caused by the original regression function without Io U.Through the analysis and comparison of multiple model schemes set,it can be seen that the improved Faster RCNN algorithm has stronger robustness and generalization performance,and can significantly improve the localization and identification accuracy of grain insects.The detection accuracy m AP of Faster RCNN algorithm is improved by 4.62% compared with the original model.(4)Optimization based on YOLOv5 algorithm.In order to further realize the accuracy and real-time performance of food insect detection,a lightweight and efficient food insect detection algorithm was designed to solve the problems existing in the detection of food insect by YOLOv5.Firstly,the clustering anchor frame was optimized to improve the detection accuracy and reduce the probability of missing detection.Secondly,lightweight network Mobile Net V3-NAM was designed as a feature extractor to achieve model compression and enhance the feature extraction ability of small targets of grain insects.Secondly,BIFPN is used to replace FPN+PAN structure in neck,which is efficient bidirectional cross-scale connection and weighted feature fusion.Finally,SIo U Loss function is used as the frame regression loss to improve the robustness and generalization ability of the model and speed up the convergence of the network.Comparison experiments show that m AP of detection accuracy of the improved YOLOv5 s model reaches 94.73% and FPS reaches 61.78.Meanwhile,compared with the improved Faster RCNN algorithm in this paper,95% model weight compression is successfully achieved under the premise of keeping the detection accuracy balance.It can better adapt to the real-time application detection requirements of stored grain pests. |