In order to achieve fast facial identity recognition of sheep,this paper proposes a lightweight detection algorithm based on SSD with a self-built dataset.First,the algorithm replaces the SSD backbone network VGG16 with the lightweight neural network Mobilenet v2,and constructs a lightweight hybrid neural network model.Second,CA,SE,CBAM,and ECA attention mechanisms were introduced in the front end of the bottomleneck layer with 1122×32 parameter counts and the back end of the bottomleneck layer with 72×160,the results show that the introduction of the ECA attention mechanism at the back end of the bottleneck layer with 72×160 parameters of the feature extraction network is the most effective,and finally the smoothL1 loss function is replaced by the BalancedL1 loss function.The optimal model(SSD-v2-ECA2-B)size is reduced from 132MB of the original SSD to 56.4MB,the average accuracy mean value is 81.16%,and the average frame rate is 64.21 frames/s,which is 0.94 percentage points higher than the average accuracy mean value of the base SSD model,the model size is reduced by 75.6MB,and the detection speed is improved by 5.23 frames/s.Compared with SSD model,Faster R-CNN model and RETINANET model,the average accuracy of the two models was increased by 0.36%and 2.40.07%,respectively,compared with the improved model,it has better comprehensive performance.So the improved model can keep the model performance at a high level with the reduced model size and computational effort,and provide reference method for digitization and intelligence of animal husbandry and breeding with high application value.
关键词
羊脸识别/SSD目标检测算法/MobileNetv2轻量级神经网络
Key words
Sheep face recognition/SSD target detection algorithm/MobileNetv2 lightweight neural network