Research on improved YOLOv5 small target multi-class farmland pest detection algorithm
Aiming at the problem of low target detection accuracy caused by the lack of obvious features of the interested target and the majority of small targets in the farmland pest images,a small target multi-category farmland pest target detection algorithm based on YOLOv5 was proposed.Firstly,the Swin Transformer window attention network structure was introduced into the feature fusion part of the last two C3 convolution blocks of the trunk network to enhance the semantic information and global awareness of small targets.Secondly,the learnable adaptive weights of the channel attention mechanism and the spatial attention mechanism were added to the C3 convolution block of the neck network,so that the network could pay attention to the feature information of small targets in the image.Finally,since the intersection ratio function of YOLOv5 itself had the problem of slow convergence speed and low accuracy rate,SIOU function was introduced as a new boundary box regression loss function to improve the convergence speed and accuracy of detection.The proposed algorithm was tested on the open data set of 28 farmland pests.The results showed s that the accuracy rate,recall rate and average accuracy of the improved algorithm in the farmland pest image data set reached 85.9%、76.4%and 79.4%,respectively,which were 2.5%\11.3%and 4.7%higher than that of YOLOv5.
farmland pest detectionsmall goalYOLOv5attention mechanismloss function