At present,in the animal husbandry industry,most of the farms manage,record,and monitor the animals manually,and smart animal husbandry is the current development direction of the animal husbandry industry.Taking cattle breeding as an example,using the cow face recognition method to achieve identity determination,recording its health status,growth status and other information has the characteristics of convenient use,saving manpower,and no harm to cattle,and has certain practical application value.Therefore,the analogous face recognition method in this paper collects and marks and preprocesses cow face data,and divides the cow face recognition problem into detection and recognition,and proposes methods to solve them.In terms of cow face detection,because the representative method based on regression YOLOv3 has the characteristics of fast speed and excellent performance,this paper based on the overall idea of YOLOv3,implements the cow-yolo method suitable for cow face detection.First,adjust the three-scale output of YOLOv3 to two scales,so as to improve the detection speed of the algorithm.The K-means clustering algorithm is used to generate the a priori frame suitable for the cow face data set in this paper to ensure the detection performance.Secondly,a multi-scale feature fusion method is used to construct the network,and the deep features of the network are merged with the shallow features to obtain richer image information.According to the size of the data set,the network complexity is appropriately controlled to avoid overfitting,batch normalization and other methods are used to improve the stability of the network,and multi-scale image input and warmup strategies are combined during the training process.Through experimental comparison,the results show that the cowyolo method can achieve better results in multi-angle cattle face recognition,and the mAP value is improved by 14.5% and 2.6% respectively compared to YOLOv3 and tiny-yolo,and the Recall value and IoU value are also both There has been an increase in the average detection speed.In terms of cow face recognition,the cow face image after cow-yolo detection and cropping is used as the training set,and the face recognition idea is used to solve the problem of cow face recognition.Two basic block structures,conv_block and conv_block_res,are constructed using deep separable convolution and residual ideas.The stack structure of blocks constitutes a cow-net lightweight cow face recognition network,which realizes effective control of network parameters and calculations.Use the swish activation function with betterperformance to replace the traditional Relu activation function,and use ArcFace as a metric function to train the network to increase the distance between sample classes and reduce the distance between classes.In order to improve model performance and reduce the impact of sample imbalance,the idea of Focal loss is used to optimize the network.The experimental results tested under open set recognition conditions show that cow-net can achieve a better cow face recognition effect,and its accuracy rate is improved compared with ResNet50 and MobileNet in multi-angle cow face recognition,and the average accuracy rate is improved.5.2% and 0.3%. |