A pet type identification method and identification system

By acquiring and processing the location information and key points of pet pictures, expanding and augmenting the data set, and using the convolutional neural network model for training, the problem of low pet type recognition accuracy in the existing technology is solved, and higher recognition is achieved. Accuracy and applicability.

CN113673422BActive Publication Date: 2024-09-24SUZHOU ZHONGKE ADVANCED TECH RES INST CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202110954948.0
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-08-19
Publication Date
2024-09-24
Estimated Expiration
2041-08-19

AI Technical Summary

Technical Problem

The existing technology has low accuracy in pet type recognition, especially the deep learning network trained on pet full-body pictures that uses a general weak supervision method, which is difficult to meet the needs of practical applications, and the data set expansion is not targeted enough.

Method used

By obtaining the location information of pet pictures, cutting and storing the pictures of each part, constructing a key point collection of the pet's head, expanding and augmenting the data set, and using the convolutional neural network model for training, the pet type recognition is realized.

Benefits of technology

The accuracy of pet type identification is improved, and the data set is more in line with the actual shooting method, avoiding local feature changes caused by mixed blood, and improving the stability and accuracy of identification.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN113673422B
    Figure CN113673422B
Patent Text Reader

Abstract

The pet species identification method and system provided in the present application can, based on the actual situation in pet species identification, make the data set used for training more in line with the shooting method in the usage scenario (shooting the whole body at a slightly long distance, shooting at a close distance slightly to the side, and shooting at a close distance from the front) through reasonable augmentation methods, thereby improving the recognition accuracy; at the same time, in view of the common characteristics of mixed-race pets, the data set is augmented by replacing the images of key parts between species, thereby avoiding the possible changes in color and shape of local parts caused by mixed-race pets, thereby further improving the recognition accuracy.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the technical field of image recognition, and in particular relates to a pet type recognition method and recognition system. Background Art

[0002] With the rapid development of deep learning technology, it has been widely used in many aspects, including image classification. Traditional deep learning-based image multi-classification technology is a coarse-grained classification, that is, the differences between each class are large, such as: people, flowers, bicycles, cats, dogs, etc. When it is necessary to identify various subclasses within a class, a fine-grained classification method is required.

[0003] The existing approximate technology is a fine-grained classification of plant images through discriminant key domains and deep learning (CN201811556747.X). Its main steps are: obtain image sample data; use Deeplab to semantically segment the original image, and use the segmented external rectangular frame of the target to be tested as the discriminant key domain; mix the discriminant key domain image with the original image to form a classification training data set; use the GoogLeNet CNN classification model to train the classification model.

[0004] Existing technologies pay little attention to the characteristics of pet species recognition, and the expansion of data sets is relatively random and not very targeted. At the same time, deep learning networks are mostly trained using full-body pictures of pets. Even if attention mechanisms are used, most of them are optimized through general weak supervision methods. Such methods are highly random and difficult to meet the needs of practical applications. Summary of the invention

[0005] In view of this, it is necessary to provide a pet species identification method that can improve the accuracy and applicability of pet species identification results in view of the defects of the prior art.

[0006] In order to solve the above problems, the present invention adopts the following technical solutions:

[0007] The present application provides a pet species identification method, comprising the following steps:

[0008] Obtaining location information of the pet picture to be identified, and storing the pictures of various parts of the pet to be identified according to the location information, wherein the various parts of the pet to be identified include the body or the head or the left eye or the right eye or the nose or the mouth or the left ear or the right ear;

[0009] Obtaining key point coordinates according to the position information, and forming a key point set of the pet's head according to the key point coordinates;

[0010] According to the key point coordinates, an alignment operation is performed with a preset pet standard face coordinate system so that the pet's head portrait is transformed to a frontal direction;

[0011] According to the pictures of various parts of the pet to be identified, the pictures are stored separately according to the types of pets, and an expansion and augmentation operation is performed to obtain a data set;

[0012] According to the data set, a convolutional neural network model is constructed and trained;

[0013] The deep learning model trained by the convolutional neural network model is used to identify the species of the entire pet picture.

[0014] In some embodiments, the step of obtaining the position information of the pet picture to be identified and storing the pictures of various parts of the pet to be identified according to the position information specifically includes the following steps:

[0015] Use pre-labeled location information to train the object detection model;

[0016] Use the target detection model to perform target detection on all the pictures of the pet to be identified, and perform conventional threshold screening and non-maximum suppression operations on the detection results, and finally obtain the position information bounding boxes of the above-mentioned parts;

[0017] According to all bounding boxes, the original image is cut into parts and stored separately.

[0018] In some of the embodiments, the target detection model includes Yolo V4 model, Faster R-CNN, SSD, and YOLO.

[0019] In some embodiments, the step of obtaining key point coordinates for the position information of each picture of each part of the pet to be identified, and forming a key point set of the pet's head according to the key point coordinates specifically includes the following steps:

[0020] For each bounding box, the coordinates of the center point (x, y) and the width w and height h of the target box are obtained, and the coordinates of the midpoint of the left line of the target box are ((xw / 2), y), the coordinates of the midpoint of the right line are ((x+w / 2), y), the coordinates of the midpoint of the top line are (x, (yh / 2)), and the coordinates of the midpoint of the bottom line are (x, (y+h / 2));

[0021] According to the position information of each bounding box, the coordinate set of the key points of each part is obtained.

[0022] In some of the embodiments, in the step of performing an alignment operation with a preset pet standard facial coordinate system according to the key point coordinates so as to transform the pet's head portrait to a frontal direction, the alignment method is affine transformation.

[0023] In some embodiments, the step of storing the pictures of the various parts of the pet to be identified according to the pet types and performing expansion and augmentation operations to obtain the data set specifically includes:

[0024] Randomly select a number of image sequences, and randomly select one or more part images from them in turn to replace them;

[0025] The data set is further augmented using data augmentation methods, including random shading, random cropping, random rotation, and adding features extracted by HOG, LBP, and Gabor algorithms.

[0026] In some embodiments, the step of randomly selecting a plurality of image sequences and sequentially randomly selecting one or more part images thereof for replacement specifically includes:

[0027] Randomly select a sequence of images of the same type, select the image of the same part, perform operations such as scaling and cropping, and then overlay the image on the corresponding part of the main image in a randomly selected picture, and replace the image of the part in the randomly selected picture.

[0028] In some embodiments, in the step of constructing and training a convolutional neural network model based on the data set,

[0029] The backbone network of the convolutional neural network model selects inception V3, and the network input is each image sequence of uniform size. The backbone network performs convolution, pooling, and Dropout operations on the main image and the eye, nose, mouth, and ear images in the image sequence through multiple channels, and finally obtains the features of N×M vectors, where N represents the number of images and M represents the feature dimension.

[0030] In addition, the present application also provides an identification system for the pet species identification method, comprising:

[0031] A to-be-identified pet picture detection module is used to obtain the position information of the to-be-identified pet picture, and store the pictures of various parts of the to-be-identified pet according to the position information, wherein the various parts of the to-be-identified pet include the body or the head or the left eye or the right eye or the nose or the mouth or the left ear or the right ear;

[0032] A key point set construction module, used to obtain key point coordinates according to the position information, and construct a key point set of the pet's head according to the key point coordinates;

[0033] A pet front face image acquisition module is used to align the key point coordinates with a preset pet standard face coordinate system so that the pet's head portrait is transformed to the front direction;

[0034] A data set construction module is used to store the pictures of various parts of the pet to be identified according to the pet types, and perform expansion and augmentation operations to obtain a data set;

[0035] A deep learning neural network model training module is used to construct and train a convolutional neural network model based on the data set;

[0036] The pet picture category recognition module is used to identify the category of the entire pet picture according to the deep learning model trained by the convolutional neural network model.

[0037] This application adopts the above technical solution to achieve the following effects:

[0038] The pet species identification method and system provided in the present application can, based on the actual situation in pet species identification, make the data set used for training more in line with the shooting method in the usage scenario (shooting the whole body at a slightly long distance, shooting at a close distance slightly to the side, and shooting at a close distance from the front) through reasonable augmentation methods, thereby improving the recognition accuracy; at the same time, in view of the common characteristics of mixed-race pets, the data set is augmented by replacing the images of key parts between species, thereby avoiding the possible changes in color and shape of local parts caused by mixed-race pets, thereby further improving the recognition accuracy. BRIEF DESCRIPTION OF THE DRAWINGS

[0039] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings required for use in the embodiments of the present invention or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.

[0040] Figure 1 This is a flowchart of the steps of the pet type identification method provided in Example 1 of the present invention.

[0041] Figure 2 Schematic diagram of a set of key point coordinates of various parts of a pet provided in Example 1 of the present invention

[0042] Figure 3 This is a schematic diagram of identification provided in Example 1 of the present invention.

[0043] Figure 4 This is a schematic diagram of the structure of the pet species identification system provided in Example 2 of the present application. DETAILED DESCRIPTION

[0044] Embodiments of the present invention are described in detail below, examples of which are shown in the accompanying drawings, wherein the same or similar reference numerals throughout represent the same or similar elements or elements having the same or similar functions. The embodiments described below with reference to the accompanying drawings are exemplary and are intended to be used to explain the present invention, and should not be construed as limiting the present invention.

[0045] In the description of the present invention, it is necessary to understand that the terms "upper", "lower", "horizontal", "inside", "outside", etc. indicate orientations or positional relationships based on the orientations or positional relationships shown in the accompanying drawings, and are only for the convenience of describing the present invention and simplifying the description, rather than indicating or implying that the device or element referred to must have a specific orientation, be constructed and operated in a specific orientation, and therefore cannot be understood as a limitation on the present invention.

[0046] In addition, the terms "first" and "second" are used for descriptive purposes only and should not be understood as indicating or implying relative importance or implicitly indicating the number of the indicated technical features. Therefore, the features defined as "first" and "second" may explicitly or implicitly include one or more of the features. In the description of the present invention, the meaning of "plurality" is two or more, unless otherwise clearly and specifically defined.

[0047] In order to make the purpose, technical solutions and advantages of the present invention more clearly understood, the present invention is further described in detail below in conjunction with the accompanying drawings and embodiments.

[0048] Example 1

[0049] See also Figure 1 , which is a flowchart of the steps of the pet type identification method provided in this application, including the following steps:

[0050] Step S110: obtaining the position information of the pet picture to be identified, and storing the pictures of various parts of the pet to be identified according to the position information, wherein the various parts of the pet to be identified include the body or the head or the left eye or the right eye or the nose or the mouth or the left ear or the right ear.

[0051] It can be understood that the collection of the pet pictures to be identified can be completed through Internet collection, public data sets, camera collection, video frame-by-frame extraction, etc.

[0052] In some embodiments, the step of obtaining the position information of the pet picture to be identified and storing the pictures of various parts of the pet to be identified according to the position information specifically includes the following steps:

[0053] Step S111: Use the pre-labeled location information to train the target detection model.

[0054] Specifically, the target detection model can be any algorithm model, including Yolo V4 model, Faster R-CNN, SSD, YOLO, etc.

[0055] Step S112: Use the target detection model to perform target detection on all the pet images to be identified, and perform conventional threshold screening and non-maximum suppression operations on the detection results, and finally obtain the position information bounding boxes of the above-mentioned parts.

[0056] Step S113: Cut the original image into various parts according to all bounding boxes, and store them separately.

[0057] Step S120: obtaining key point coordinates according to the position information, and constructing a key point set of the pet's head according to the key point coordinates.

[0058] In some embodiments, the step of obtaining the key point coordinates according to the position information and forming a key point set of the pet's head according to the key point coordinates specifically includes the following steps:

[0059] Step S121: for each bounding box, i.e., the center point coordinates (x, y) and the width w and height h of the target box, the midpoint coordinates of the left line of the target box are obtained as ((xw / 2), y), the midpoint coordinates of the right line are obtained as ((x+w / 2), y), the midpoint coordinates of the top line are obtained as (x, (yh / 2)), and the midpoint coordinates of the bottom line are obtained as (x, (y+h / 2));

[0060] Step S122: Obtain a set of key point coordinates of each part according to the position information of each bounding box.

[0061] See also Figure 2 , which is a schematic diagram of the coordinate set of key points of each part obtained in this embodiment. In practice, the number and position of key points can be increased or decreased according to the required accuracy effect.

[0062] Step S130: performing an alignment operation with a preset pet standard facial coordinate system according to the key point coordinates, so that the pet's head portrait is transformed to a frontal direction.

[0063] In some of the embodiments, in the step of performing an alignment operation with a preset pet standard facial coordinate system according to the key point coordinates so as to transform the pet's head portrait to a frontal direction, the alignment method is affine transformation.

[0064] It can be understood that in this embodiment, the alignment method used is affine transformation, which is a linear transformation from a two-dimensional coordinate (x1, y1) to a two-dimensional coordinate (x2, y2):

[0065]

[0066] The corresponding homogeneous coordinate matrix is:

[0067]

[0068] By analogy, multiple sets of key point coordinates can also be listed in similar expressions and matrices. After solving the corresponding matrix values, the original image can be affine transformed to finally obtain a frontal face image.

[0069] It can be understood that the above images are organized into groups of image sequences, each group of sequences consists of a main image and a key part image group, the main image can be: the original image or the pet body or the head image or the front face portrait, the key part image group is composed of images of the left eye, right eye, nose, mouth, left ear and right ear captured from the main image.

[0070] Step S140: based on the pictures of the various parts of the pet to be identified, the pictures are stored by pet type, and an expansion and augmentation operation is performed to obtain a data set. In some embodiments, the step of storing the pictures of the various parts of the pet to be identified by pet type, and an expansion and augmentation operation is performed to obtain a data set specifically includes:

[0071] Step S141: randomly select a number of image sequences, and randomly select one or more part images from them in turn to replace.

[0072] Specifically, the replacement method is: randomly select an image sequence of the same type, select the image of the same part, perform operations such as scaling and cropping, and then overlay the image on the corresponding part of the main image in a randomly selected picture, and replace the image of the part in the randomly selected picture.

[0073] Step S142: further augment the data set using a data augmentation method.

[0074] Specifically, the data augmentation method includes random brightness, random cropping, random rotation, and adding features extracted by HOG, LBP, and Gabor algorithms.

[0075] Step S150: constructing a convolutional neural network model based on the data set and training it.

[0076] Specifically, the skeleton network of the convolutional neural network model selects inception V3, and the network input is each image sequence of uniform size. The skeleton network performs convolution, pooling, and Dropout operations on the main image and the eye, nose, mouth, and ear images in the image sequence through multiple channels, and finally obtains the features of N×M vectors, where N represents the number of images and M represents the feature dimension.

[0077] Furthermore, the skeleton network can be any deep learning skeleton network, such as ResNet, Inception, VGG, MobileNet, etc.

[0078] It is understandable that a large feature dimension is not conducive to subsequent practical applications. Feature dimensionality reduction methods can be used to reduce unimportant features, such as PCA or LDA.

[0079] In this embodiment, a more flexible dynamic method is used to reduce the dimension: that is, a convolution layer is added to dynamically generate a dynamic kernel, which is similar to a convolution with a hole. For different pictures, features of different lengths are cut out to ensure that the total number of the final concatenation remains unchanged. This can ensure the model effect as much as possible while reducing the number of features.

[0080] Furthermore, other required modules can be added as needed, such as loss function, fully connected layer, attention mechanism module, etc., to complete the final construction of the model.

[0081] Step S160: performing species recognition on the entire pet picture according to the deep learning model trained by the convolutional neural network model.

[0082] It should be noted that in practice, various hyperparameters are selected to complete the model training. From multiple models, the best one is found by testing on the test set as the deep learning model for subsequent use.

[0083] It can be understood that due to the improvement of the deep learning model, the original images of different scales are integrated, so that the model can focus on various useful information of the image. At the same time, the final dynamic dimensionality reduction step ensures that the final feature complexity will not increase significantly, thus ensuring the efficiency of the deep learning model.

[0084] In the above-mentioned pet species recognition method, when actually performing pet species recognition, the target model is first used to detect the original image. If the pet subject is not detected in the image, the recognition is stopped. If one or more pet subjects appear, one or more pet sequences are generated. The sequence is as described in step S130, and it can be determined as needed whether the main image in the image sequence is one or more. The image sequence is input into the deep learning model, and the final result is obtained by reasoning. If there are multiple main images in the image sequence previously determined, it is necessary to run multiple model reasonings, and select the one with the highest probability as the recognition result.

[0085] See also Figure 3 , which is an identification schematic diagram provided in the above embodiment of the present invention.

[0086] Through experimental simulation, it is found that the recognition effect is good for dogs of different ages in different environments, shooting angles and distances, and it is not easily affected by incomplete pictures. Although the recognition result diagram shows dogs, the method proposed by the present invention can be used for all kinds of pets, such as cats, dogs, birds, fish, etc.

[0087] The pet species identification method provided in the present application can improve the recognition accuracy by reasonable augmentation methods according to the actual situation in pet species identification, so that the data set used for training is more in line with the shooting method in the usage scenario (shooting the whole body at a slightly long distance, shooting at a close distance slightly to the side, and shooting at a close distance from the front). At the same time, in view of the common characteristics of mixed-blood pets, the data set is augmented by replacing the images of key parts between species, avoiding the possible changes in color and shape of local parts caused by mixed-blood pets, thereby further improving the recognition accuracy.

[0088] Example 2

[0089] See also Figure 4The present application also provides an identification system of the pet species identification method, including: a pet picture detection module 110 to be identified, which obtains the position information of the pet picture to be identified, and stores the pictures of various parts of the pet to be identified according to the position information, wherein the various parts of the pet to be identified include the body or the head or the left eye or the right eye or the nose or the mouth or the left ear or the right ear; a key point set construction module 120, which is used to obtain the key point coordinates according to the position information, and to form a key point set of the pet's head according to the key point coordinates; a pet front face image acquisition module 130, which is used to align the key point coordinates with the preset pet standard face coordinate system according to the key point coordinates, so that the pet's head portrait is transformed to the front direction; a data set construction module 140, which is used to store the pictures of various parts of the pet to be identified according to the pet type, and perform expansion and augmentation operations to obtain a data set; a deep learning neural network model training module 150, which is used to construct and train a convolutional neural network model according to the data set; a pet picture type identification module 160, which is used to identify the type of the entire pet picture according to the deep learning model trained by the convolutional neural network model.

[0090] The detailed working mode of each module of the pet type identification system provided in this embodiment has been described in detail in Embodiment 1 and will not be repeated here.

[0091] The pet species identification system provided in the present application can, based on the actual situation in pet species identification, make the data set used for training more in line with the shooting method in the usage scenario (shooting the whole body at a slightly long distance, shooting at a close distance slightly to the side, and shooting at a close distance from the front) through reasonable augmentation methods, thereby improving the recognition accuracy; at the same time, in view of the common characteristics of mixed-race pets, the data set is augmented by replacing the images of key parts between species, thereby avoiding the possible changes in color and shape of local parts caused by mixed-race pets, thereby further improving the recognition accuracy.

[0092] The above are only embodiments of the present application and are not intended to limit the present application. For those skilled in the art, the present application may have various changes and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application should be included within the scope of the claims of the present application.

Claims

1. A method for identifying pet species, characterized in that: The steps include: Obtaining location information of the pet picture to be identified, and storing the pictures of various parts of the pet to be identified according to the location information, wherein the various parts of the pet to be identified include the body or the head or the left eye or the right eye or the nose or the mouth or the left ear or the right ear; Obtaining key point coordinates according to the position information, and forming a key point set of the pet's head according to the key point coordinates; According to the key point coordinates, an alignment operation is performed with a preset pet standard face coordinate system so that the pet's head portrait is transformed to a frontal direction; According to the pictures of various parts of the pet to be identified, the pictures are stored separately according to the types of pets, and an expansion and augmentation operation is performed to obtain a data set; According to the data set, a convolutional neural network model is constructed and trained; According to the deep learning model trained by the convolutional neural network model, the image sequence obtained from the entire pet picture is subjected to category recognition; The step of obtaining the position information of the pet picture to be identified and storing the pictures of various parts of the pet to be identified according to the position information specifically includes the following steps: Using pre-labeled location information to train a target detection model, the target detection model includes a YoloV4 model, Faster R-CNN, SSD, and YOLO; Use the target detection model to perform target detection on all the pictures of the pet to be identified, and perform conventional threshold screening and non-maximum suppression operations on the detection results, and finally obtain the position information bounding boxes of the above-mentioned parts; Cut the original image into parts according to all bounding boxes and store them separately; The step of obtaining the key point coordinates according to the position information and forming a key point set of the pet's head according to the key point coordinates specifically includes the following steps: For each bounding box, the coordinates of the center point (x, y) and the width w and height h of the target box are obtained, and the coordinates of the midpoint of the left line of the target box are ((xw / 2), y), the coordinates of the midpoint of the right line are ((x+w / 2), y), the coordinates of the midpoint of the top line are (x, (yh / 2)), and the coordinates of the midpoint of the bottom line are (x, (y+h / 2)); According to the position information of each bounding box, the coordinate set of key points of each part is obtained; In the step of performing an alignment operation with a preset pet standard facial coordinate system according to the key point coordinates so as to transform the pet's head portrait to a frontal direction, the alignment operation is an affine transformation; The step of storing the pictures of the various parts of the pet to be identified according to the types of pets and performing expansion and augmentation operations to obtain a data set specifically includes: Randomly select a number of image sequences, and randomly select one or more part images for replacement, each sequence consists of a main image and a key part image group, the main image includes the original image or the pet body or the head image or the front face portrait, and the key part image group consists of images of the left eye, right eye, nose, mouth, left ear and right ear captured from the main image; The data set is further augmented using a data augmentation method, wherein the data augmentation method includes random brightness, random cropping, random rotation, and adding features extracted by HOG, LBP, and Gabor algorithms; in the step of randomly selecting a plurality of image sequences and replacing one or more part images thereof in turn, specifically including: Randomly select a sequence of images of the same type, select an image of the same part, perform scaling and cropping operations, and then overlay the image on the corresponding part of the main image in a randomly selected image, and replace the image of the part in the randomly selected image; In the step of constructing and training a convolutional neural network model according to the data set, the skeleton network of the convolutional neural network model selects inception V3, and the network input is each image sequence of uniform size. The skeleton network performs convolution, pooling, and Dropout operations on the main image and the eye, nose, mouth, and ear images in the image sequence through multiple channels, and finally obtains N×M vector features, where N represents the number of images and M represents the feature dimension.

2. A pet type identification system according to claim 1, characterized in that: include: A to-be-identified pet picture detection module is used to obtain the position information of the to-be-identified pet picture, and store the pictures of various parts of the to-be-identified pet according to the position information, wherein the various parts of the to-be-identified pet include the body or the head or the left eye or the right eye or the nose or the mouth or the left ear or the right ear; A key point set construction module, used to obtain key point coordinates according to the position information, and construct a key point set of the pet's head according to the key point coordinates; A pet front face image acquisition module is used to align the key point coordinates with a preset pet standard face coordinate system so that the pet's head portrait is transformed to the front direction; A data set construction module is used to store the pictures of various parts of the pet to be identified according to the pet types, and perform expansion and augmentation operations to obtain a data set; A deep learning neural network model training module is used to construct and train a convolutional neural network model based on the data set; A pet picture category recognition module, used to perform category recognition on an image sequence obtained from the entire pet picture according to a deep learning model trained by the convolutional neural network model; The to-be-recognized pet picture detection module is further used to train a target detection model using pre-labeled position information, wherein the target detection model includes a Yolo V4 model, Faster R-CNN, SSD, and YOLO; Use the target detection model to perform target detection on all the pictures of the pet to be identified, and perform conventional threshold screening and non-maximum suppression operations on the detection results, and finally obtain the position information bounding boxes of the above-mentioned parts; Cut the original image into parts according to all bounding boxes and store them separately; The key point set construction module is also used to obtain the coordinates of the center point (x, y) and width w and height h of each bounding box, that is, the midpoint of the left line of the target box is ((xw / 2), y), the midpoint of the right line is ((x+w / 2), y), the midpoint of the upper line is (x, (yh / 2)), and the midpoint of the lower line is (x, (y+h / 2)); According to the position information of each bounding box, the coordinate set of key points of each part is obtained; In the step of performing an alignment operation with a preset pet standard facial coordinate system according to the key point coordinates so as to transform the pet's head portrait to a frontal direction, the alignment operation is an affine transformation; The data set construction module is also used to randomly select a number of image sequences, and randomly select one or more part images to replace them in turn, each group of sequences consists of a main image and a key part image group, the main image includes the original image or the pet body or the head image or the front face portrait, and the key part image group consists of images of the left eye, right eye, nose, mouth, left ear and right ear captured from the main image; Further augmenting the data set using a data augmentation method, wherein the data augmentation method includes random shading, random cropping, random rotation, and adding features extracted by HOG, LBP, and Gabor algorithms; The data set construction module is also used to randomly select image sequences of the same type, select images of the same part, perform scaling and cropping operations, and then overlay the image on the corresponding part of the main image in a randomly selected image, and replace the image of the part in the randomly selected image.