| Every year,problems such as insect bites caused by stored-grain pests cause a lot of losses to the country’s stored grain.Therefore,it is very important to accurately monitor the stored-grain pests in the granary for targeted control strategies.In actual scenarios,the characteristics of stored-grain pests images are more complex,and the traditional identification technology of stored grain insects requires manual setting of characteristics,which gradually cannot meet the actual needs.In recent years,the introduction of deep learning-based target detection technology into the detection and identification of grain insects has gradually become a research hotspot at home and abroad.The classic target detection algorithm YOLOv5 model has gradually emerged in the field of target detection due to its advantages of small scale and low deployment cost.However,there are many small targets in grain and insect images,and YOLOv5 will have false detections during processing,resulting in a decrease in accuracy.Therefore,this thesis takes five common stored-grain pests as the research objects and proposes a small target detection method for stored-grain pests based on the improved YOLOv5 model.The main work is as follows:First,build a simulated granary,collect images of five kinds of stored-grain pests and label them,and use YOLOv5 to conduct preliminary tests on the data.A combination of multiple data augmentation methods was used to expand the dataset,and finally a complex background small target dataset containing 11,338 images of grain worms was obtained,and a test set of 1,928 images was established to evaluate the performance of the model.Preliminary analysis through experiments shows that the recognition accuracy of YOLOv5 for complex small target pests needs to be improved.Next,based on the above background,this thesis combined the different stages of the YOLOv5 model and made four improvements to YOLOv5: improving the skeleton network to perform contextual feature fusion,thereby enhancing the ability to extract features for small target objects;To solve the problem of the low resolution of feature maps at the end of the network,the two Transformer blocks of Vi T and Swin Transformer were integrated into the detection head Head,and the effects of different schemes were compared;the original mosaic data enhancement was upgraded to mosaic-9 data enhancement,which enhances the data capacity of the small target object and the complexity of the image background,and reduces the amount of calculation required for batch normalization;Label Smoothing(label smoothing)is introduced in the classification to avoid excessive dependence on manual labels to a certain extent.The average accuracy m AP values of the four improvements have all achieved a certain degree of improvement.Finally,the four effective improvements are fused together,and the experimental results prove that the m AP of an improved YOLOv5 model provided in this thesis reaches96.1%,which is 2.9 percentage points higher than the 93.2% of Baseline,which shows the improvement made in this thesis.Effectively enhances the detection ability of YOLOv5 for small targets of grain insects. |