| With the rapid development of pet economy and the change of people’s pet raising concept,a large number of stray dogs and unknown breeds of dogs appear in the city,bringing serious safety risks to residents.Uncivilized incidents related to dogs rise sharply,leading to complex and severe urban management situation.One of the key factors affecting the above problems is that people are not able to accurately identify the breed of dog and do not understand the dog’s personality.In this paper,a fine-grained dog classification method based on deep learning was proposed to solve the problems of lack of data preprocessing methods,and low model recognition accuracy and generalization ability.Based on the data set of Qinghua dogs with greater diversity,such as dog breed,picture background,pose and shooting Angle,and combined with related techniques of image classification and fine classification,the method constructed a fine-grained dog classification model sg-Res Net50 based on transfer learning and attention mechanism,and further optimized it.A fine-grained dog classification model based on feature grouping and feature enhancement was constructed,and finally a fine-grained dog image recognition system was realized.The development of the system has certain application value in improving people’s ability to identify dog breeds,reducing dog-related injuries and uncivilized events,and facilitating city management.The study of fine-grained dog classification algorithm can not only provide new ideas and methods for the development of animal image classification technology,but also contribute to the development of computer vision technology.The main work and research contents of this paper are as follows:(1)Data preprocessing and data enhancement.Firstly,the Tsinghua dog data set is described,secondly,the noise data is preprocessed for its category imbalance,then label smoothing is used to prevent model overfitting,and finally Mixup is used to enhance the data.(2)A fine-grained classification model for dogs based on transfer learning and attention mechanisms.Based on Res Net50 image recognition algorithm,sg-Res Net50,a fine-grained classification model for dogs,was built based on the analysis of its inadequate feature extraction ability and low recognition accuracy during feature extraction.Firstly,the convolution kernel size and step size are fine-tuned to improve the feature extraction ability of the model.Secondly,by embedding the attention mechanism,channel attention is applied to the feature graph groups,and the importance of different dimensions and different feature components of the data are concerned between different feature graph groups,so as to further improve the feature extraction ability of the model.Then the Ghost module is introduced to generate more feature graphs with fewer parameters,thus reducing the computational complexity of the model.Finally,the ablation experiments of each module were compared with other models.(3)A fine-grained dog classification model based on feature grouping and feature enhancement.Aiming at the lack of recognition accuracy of the fine-grained classification model sg-Res Net50,the model structure was further optimized without changing.Firstly,feature extraction is carried out in the sg-Res Net50 model,and the feature map of the last layer is divided into different groups according to the different feature attributes in the dimension of the channel.Then,the weighted combination regularization method is used to guide the semantic groups to activate in the easily recognized parts of the image to enhance the sub-features,and a dog fine-grained classification model based on feature grouping and feature enhancement is constructed.Finally,the ablation experiments of each module were compared with other models.(4)Performance analysis of Torch framework and Jittor framework.Under the same software and hardware conditions,Res Net50 is used to implement the deep learning framework of Tsinghua University Jittor and Torch.The experimental results show that there is still a certain gap between the recognition accuracy achieved by the new Jittor framework and the model implemented by the mature Torch framework in this experiment,and the time spent in the model training stage is short and the time spent in the test stage.(5)Design and implement fine-grained dog image recognition system.Based on the needs of urban management and pet market users,this paper uses the final dog fine-grained classification model based on Tsinghua dog data set,and designs and implements a fine-grained dog image recognition system based on software engineering theory.The system consists of four functional modules: system management module,system tool module,system monitoring module and dog identification module,which is conducive to improving people’s ability to distinguish different dogs and promoting the rapid and stable development of the pet market.The experimental results show that the recognition accuracy of the fine-grained dog classification model proposed in this paper reaches 83.73%,which is better than that of other mainstream fine-grained models,and proves the superiority of the proposed fine-grained dog classification algorithm. |