| With the gradual increase in the number of pet dogs,many organizations and institutions have launched the research on dogs,among which dog detection and recognition are widely used in various scenes,such as pet dog information records,dog management in kennels and stray dog governance,etc.Therefore,the detection and recognition of pet dogs has very important research significance and practical application value.The traditional method of dog detection and recognition using artificial design features has many disadvantages,such as difficult feature extraction,poor versatility,time-consuming and so on.Because deep learning has the ability of self-learning,high accuracy and strong robustness of detection and recognition,it has achieved great success in the field of image classification.Among them,YOLOv3 algorithm has a good performance in the field of target detection,which has attracted the attention of academia and industry for a long time.It is widely used in pedestrian detection,face recognition,vehicle detection,traffic sign recognition and so on.The existing research on pet dog is mainly to detect whether there is a pet dog in the image,and does not classify and recognize the pet dog.Therefore,in order to better implement the detection of different categories of pet dogs,this thesis applies the YOLOv3 algorithm to the detection and classification of pet dogs.In this thesis,based on the YOLOv3 algorithm,two models are proposed.The first is the face detection and recognition model of pet dog based on YOLOv3,which solves the problems of low detection accuracy and inaccurate prediction frame of other algorithms for pet dog classification.The second is to improve the detection and recognition model of dog classification based on YOLOv3-tiny,which makes the improved model keep fast detection speed and solve the problems of limited detection accuracy and inaccurate classification.The main contents and improvements of this thesis are as follows:1.Establishment of data set and face detection and recognition model of pet dog based on YOLOv3.In view of the problem that there is no pet dog classification data set in China,this thesis collects 8kinds of domestic common pet dog pictures,and manually establishes the domestic common pet dog data set.The pet dog data set fills the blank of domestic pet dog data set.Based on the idea of residual network and multi-scale fusion,this thesis designs a YOLOv3 network for pet dog detection.For the training of data set,we introduce the method of data enhancement.In order to improve the training method of the network model,we first freeze a part of the model for training,and then thaw it for overall training.Finally,a dog face detection and recognition model based on YOLOv3 is completed,and the average detection accuracy can reach 94.91%.Compared with other methods,the detection accuracy of this thesis is higher,which can accurately identify the dog’s face position in the image,and give the dog’s type.Using this method can meet the basic requirements of dog face image detection engineering.2.Pet dog detection and recognition algorithm based on improved YOLOv3-tiny.In order to better classify dogs with fine-grained image,we adopt Stanford dog data set.For the problem of low pixel and poor resolution of the data set,if it is not appropriate to detect dog face again,we will detect the dog as a whole,which will obtain more features to improve the detection effect.In order to apply in embedded devices,edge devices and mobile devices with insufficient computing power,we choose the faster YOLOv3-tiny model,but find that its detection accuracy is low.Therefore,we improve the YOLOv3-tniy algorithm,including the following points.(1)According to the characteristics of dog data sets,K-means algorithm is used to re cluster the width and height of dog data sets,and two different scale prior frames(anchor)are obtained,which are in line with the dog data sets.The prior frame after clustering is replaced by the default prior frame,so as to improve the detection accuracy.(2)In view of the fact that the IOU loss function can not accurately reflect the correlation between the real box and the prediction box,we redesign the loss function and use the modified loss function to replace the original IOU loss function,so as to improve the detection effect.(3)Aiming at the problem of poor detection accuracy caused by complex background and fuzzy edge,this thesis deepens the backbone feature extraction network of YOLOv3-tiny,and combines the improved network with attention mechanism to obtain the importance between different channel feature layers,enhance the useful features and suppress some unimportant features,so as to effectively improve the performance of the network.Through the comparative experiment,the improved model can maintain the fast detection speed and improve the detection accuracy.The precision is increased by 9.2%,Recall is increased by 2.5%,and the m AP increased by 5.4%.The target detection algorithm model designed in this thesis can be applied to the detection of other animal classification.In the future,it can be applied to the real-time monitoring of wild animals to detect and classify wild animals,prevent the loss of animal species diversity and protect endangered wild animals. |