In recent years,machine learning and deep learning technologies have penetrated into all areas of people’s lives,affecting people’s production and life to varying degrees,and are constantly transforming traditional industries,including animal husbandry.In the cattle breeding industry,cattle disease prevention and control,product traceability and insurance claims put forward higher requirements for individual cattle identification.The traditional contact-type cattle individual identification method has the disadvantages of high cost,easy loss and tampering,which will lead to a series of security problems such as untimely disease prevention and control,incorrect traceability of cattle products,and fraudulent claims.As the biological characteristic of cattles,cattle face has individual uniqueness and immutability.Aiming at the problems of the traditional contact-type cattle individual identification method,based on the image containing the cattle face,the method of cattle face detection and individual identification based on deep learning is studied.The cattle face in the image is detected by the constructed cattle face detection model,and then the detected cattle face image is used as the input of the cattle individual identification model to realize the cattle individual identification.The specific work content of the paper is as follows:(1)Make a data set of cattle face detection and identity recognition.Based on cattle image data collected from the cattle farm,the production of the cattle face detection data set and the cattle face image data set is completed,and the data of each part of the data set is enhanced.(2)Construction and optimization of cattle face detection model.Building a cattle face detection model based on the target detection algorithm of deep learning.Three target detection algorithms based on deep learning such as Faster R-CNN,SSD,and YOLO are used to complete the training and performance comparison of the cattle face detection model.Finally,the Faster R-CNN target detection algorithm with the best cattle face detection performance is selected to construct the cattle face detection model.On this basis,Res Net-50 enhance the feature extraction capability of the model replacing the original VGG16 as the feature extraction network of the model.In response to the problem caused by this situation that the size of the original anchor boxes in the algorithm is quite different from the size of the labeled cattle face rectangular boxes,the K-means++ clustering algorithm is used to optimize the size of the generated anchor box of the model,which improves the detection effect of the model on small-size cattle faces,thereby improving the detection performance of the model.(3)Construction and optimization of cattle individual identification model.A cattle face feature extraction model was constructed based on VGG16,and the similarity between cattle face features was calculated using Euclidean distance.The above two parts together constitute the cattle individual identification model,in addition to completing the training and testing of the model.Aiming at the misrecognition problem caused by that cattle face feature extraction model trained with softmax loss supervision only pays attention to inter-class difference and ignores intra-class compactness,It’s used that conbining the softmax loss with the center loss to joinly supervise the training of the cattle face feature extraction model.This method increases the inter-class distance of features extracted by the model,and at the same time it reduces the intra-class distance,which effectively improves the performance of the cattle individual identification model.(4)Complete system testing and analysis.Define the functional requirements and performance requirements of the system.Design the graphical user interface for system testing,and complete system testing and analysis to verify the effectiveness of the system. |