The presence of insect pests poses great challenges to the food industry,especially in food processing plants,which not only undermine food safety,but also pose great risks to consumers.These challenges are not only reflected in the safety of food,but also in maintaining the safety of food raw materials and how to give targeted prevention and treatment advice.With the development of computer vision technology,traditional neural networks and deep learning methods are used to achieve fast and accurate automatic recognition of various objects.For example,we make datasets of pictures of collected insects and use techniques in computer vision to achieve fast and accurate classification of insects.The main work of this article is as follows;(1)Carry out hardware selection and image acquisition system construction,by comparing the advantages and disadvantages of light sources,cameras,lenses,mosquito traps and other hardware,select the most suitable hardware facilities for this paper and build an image acquisition system.(2)In this paper,the dataset is acquired through the image acquisition system,which can collect pictures of insects in the food processing plant,which can not only reflect the real environment,but also provide practical information.Use labelImg to label these images to build a dataset that can be trained on a deep learning network.(3)The current deep learning networks yolov5s and yolov7 with better performance are used for training,and the two models of yolov5s and yolov7 are improved,and the better model is selected by analyzing the experimental results.Improvements to the Yolov5S model;By adding the CA attention mechanism module to the yolov5s model,the model aims to enhance the expression ability of the network learning features,use BoT3 as the backbone network to reduce parameters and improve the inference speed of the network,and change the CIOU loss function to SIOU to increase the attention of the model to small targets.Improvements to the Yolov7 model;The activation function of the model is changed to FReLU,which solves the problem of spatial insensitivity in the activation function,so that the regular(ordinary)convolution also has the ability to capture complex visual layout,and the model has the ability of pixel-level modeling.Replace the backbone network with CNeB modules to improve the inference speed and robustness of the model.(4)Through experimental comparison,it is proved that the improved network model can better identify insects,the accuracy and recognition speed are greatly improved and meet expectations,and the storage space is smaller,the generalization performance is good,and the performance,recognition speed and accuracy of the model are not only better than the original network,but also better than the traditional machine learning algorithms. |