Mammal posture recognition method based on body contour and leg joint skeleton

By combining the recognition method of animal outline and leg joint angle changes, using Outline Mask R-CNN and Tiny VGG, LEAP model, the existing technology solves the problem of insufficient accuracy and universality of animal posture recognition in complex scenes. , achieving high accuracy and versatility in gesture recognition of wild mammals.

CN112395977BActive Publication Date: 2024-08-23NANJING FORESTRY UNIV
View PDF 7 Cites 0 Cited by

Patent Information

Application Number
CN202011285583.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2020-11-17
Publication Date
2024-08-23
Estimated Expiration
2040-11-17

AI Technical Summary

Technical Problem

Existing animal posture recognition methods are difficult to handle illumination, occlusion and perspective changes in complex scenes, and are not universal and accurate enough for wild mammals, especially in wild environments.

Method used

Using a recognition method based on body contours and leg joint skeletons, the Outline Mask R-CNN model is used to extract animal contour features, and combined with the Tiny VGG lightweight convolutional neural network for classification. At the same time, LEAP is used to track the position of the animal's leg joint points and calculate the clip. The angle change uses the LSTM model to identify the posture, and the results of the two are jointly decided.

Benefits of technology

It improves the accuracy of animal posture recognition in complex environments, reduces computational complexity and false detection rate, is suitable for wild mammals, and has a recognition accuracy of 96%, with high versatility and generalization capabilities.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN112395977B
    Figure CN112395977B
Patent Text Reader

Abstract

A method for mammal posture recognition based on body contour and leg joint skeleton, the steps include two parts: the first part, for wild mammal images in complex wild environments, edge extraction is performed using Outline Mask R-CNN to obtain the outer contour of the animal; based on the contour map, a Tiny VGG lightweight convolutional neural network is constructed for posture classification of wild mammals. The second part, for wild mammal video sequences in complex wild environments, LEAP is used to quickly track the position of the animal's leg joints to form a skeleton map; the change of the leg joint angle in the animal skeleton map is used as a feature, and LSTM is used as a classifier for posture classification of wild mammals. Finally, the results obtained from the two models are fused to further identify the different postures of wild mammals, so as to achieve the purpose of distinguishing simple daily behaviors of animals, which has certain application prospects.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The invention relates to a posture recognition method, in particular to an animal posture recognition method combining animal body contours and leg joint angle changes. Background Art

[0002] In the prior art, posture recognition refers to automatically identifying the posture information of the research object through static images or video information, using key technologies such as motion target detection, feature information extraction and behavior analysis.

[0003] Animal posture recognition can predict their life dynamics and physical conditions, and is widely used in animal welfare, disease prevention and bionics research. Animal posture classification refers to designing specific feature descriptors (such as color, texture, shape, edge, space, etc.), which then form feature vectors as input, train a classifier through machine learning methods, input the feature vectors to be recognized into this classifier for training, and obtain classification results of different animal posture categories. Posture feature descriptors are the key part of posture recognition and directly affect the final recognition effect.

[0004] Some researchers have tried to use background subtraction, silhouette, frame difference, etc. to detect the target posture area, and then extract the contour features of the entire area as a posture representation. This method has strong descriptive ability, contains a lot of information, and is easy to extract the area of ​​interest under a simple background. However, it is particularly sensitive to noise, perspective, and mutual occlusion. It is difficult to obtain information about the animal's movement area under a complex background, and it is difficult to extract accurate contour features, which has great limitations. Summary of the invention

[0005] A good feature descriptor is a key factor in achieving classification. Skeleton sequence descriptors are translation-invariant and scale-invariant, and are often used in human posture recognition with great success. Deep learning model algorithms have strong generalization capabilities and automatically learn behavioral features for classification, so they are often used in posture estimation, image classification and other fields.

[0006] The problem to be solved by the present invention is that the existing research objects of animal posture recognition are mostly docile domestic animals or laboratory animals, and the methods adopted cannot solve the problems of lighting, occlusion, perspective changes and so on in different complex scenes well, require a large number of data sets and are not universal.

[0007] The technical solution of this scheme is: a method for mammal posture recognition based on body contour and leg joint skeleton, the steps include: 1) first collecting mammal videos in the wild environment; 2) recognizing the posture of the mammal based on the animal's peripheral contour; 3) recognizing the posture of the mammal based on the change of the animal's leg joint; 4) making a joint decision based on the results of steps 2) and 3) to recognize the different postures of the animal;

[0008] In the step 2):

[0009] 2.1) For the animal videos collected in step 1), select representative animal posture images;

[0010] 2.2) For the image selected in step 2.1), construct an Outline Mask R-CNN model to extract the outer contour of the animal. The steps include:

[0011] 2.2.1) Use transfer learning to train model weights on the COCO dataset;

[0012] 2.2.2) Use the residual network ResNet98 to build the Outline Mask R-CNN convolutional network to extract the basic features of wild mammal images and realize object detection in animal images;

[0013] 2.2.3) When generating instance segmentation, use the ploy function in Python's matplotlib image library to extract edge information from the mask to extract the animal outline;

[0014] 2.3) Using the animal outline image obtained in step 2.2) as input, a Tiny VGG lightweight convolutional neural network is constructed to classify the outline features to identify the posture of wild mammals. The steps include:

[0015] 2.3.1) Based on the characteristics of the dataset, a single-structure straight-tube network structure similar to the VGG network is used to construct a network with multiple convolutional layers;

[0016] 2.3.2) The network uses the same 3×3 small convolution kernel as the VGG network, and each convolutional network layer adopts maximum pooling;

[0017] 2.3.3) Use two fully connected layers plus Softmax to construct the classifier:

[0018]

[0019] Among them, x is the input, y is the predicted value, the probability of predicting category n is p, M is the category, and w is the score;

[0020] In the step 3):

[0021] 3.1) For the animal video collected in step 1), track the position of the animal's leg joints and construct the animal skeleton diagram, the steps include:

[0022] 3.1.1) Manually mark the leg joint locations of a few frames of animal images;

[0023] 3.1.2) Use deep neural network iterative training to predict the position of animal leg joints in all video frames;

[0024] 3.1.3) Calculate the mean square error between the manually marked joint point positions in step 3.1.1) and the network prediction results in step 3.1.2) to measure the effectiveness of the network;

[0025] 3.2) First, the angle formed by the positions of the leg joints is calculated; then, the change sequence of the minimum leg angle is used as the feature vector and sent to the LSTM classifier for training to identify the posture of wild mammals;

[0026] In the step 4), the contour-based Tiny VGG lightweight convolutional neural network model constructed in step 2) and the LSTM neural network model based on the animal leg skeleton movement in step 3) are fused, and the prediction scores of the two independent models are jointly decided to obtain the final classification result.

[0027] In step 2.2.1), the model weights trained on the COCO dataset are used to learn the posture features of wild mammals through transfer learning for segmentation;

[0028] In step 2.2.2), the animal image is trained with ResNet98 to generate a feature image. The most suitable candidate frame is extracted from several recommended frames by the non-maximum suppression method. The network generates a non-interfering mask and mammal target detection frame for each fixed-size feature.

[0029] In step 2.2.3), after the mask is generated, the ploy function in the python matplotlib image library is used to extract the edge information of the mask; when generating the image, only the edge information shown by the animal outline is retained, and no specific mask area and target detection frame are generated.

[0030] further:

[0031] In the step 3.1), the animal posture estimation LEAP algorithm is used to track the position changes of the marked joint points in the animal video;

[0032] 3.1.1) Manually mark the leg joint locations of a few representative key-frame animal images in the animal posture video;

[0033] 3.1.2) Taking a single image of an animal as input, a 15-layer deep convolutional neural network consisting of 3×3 convolutional blocks, 2×2 maximum pooling layers, and transposed convolutional layers is iteratively trained to produce a set of confidence maps (two-dimensional probability distributions) describing the position of each leg joint in the input as output;

[0034] The global maximum value in each confidence map represents the network's prediction of the position of the joint point, thereby predicting the position of the animal's leg joint points in all video frames;

[0035] 3.1.3) Calculate the joint point position y manually marked in step 3.1.1) and the convolutional neural network prediction result in step 3.1.2) The mean square error The loss function is constructed by the mean square error (MSE) for comparison, and the loss function is minimized after iterative training.

[0036] In step 3.2), the method for calculating the angle formed by the positions of the leg joint points is:

[0037] Assume the position coordinates of the tracked upper limb joint point A are (x 1 ,y 1 ), the position coordinates of the lower limb joint point C are (x 3 ,y 3 ), the position coordinates of the knee joint point B connecting the upper and lower limbs are (x 2 ,y 2 ), then the angle ∠ABC formed by them is

[0038]

[0039]

[0040]

[0041]

[0042] In the step 4), the final score p of the Tiny VGG network model based on contour features in step 1) is 1 , and the final score p of the LSTM model based on skeleton features in step 2) 2 Perform score fusion to jointly vote on the probability of the posture prediction value y shown in the animal video x: p(y=n|x)=0.5×p 1 +0.5×p 2 .

[0043] In this solution: In order to solve the defects of model training being difficult to converge and generalization being weak due to insufficient data, the Outline Mask R-CNN network uses transfer learning to train the model weights on the COCO dataset;

[0044] In order to construct a motion skeleton graph based on animal legs, LEAP is used to quickly track the joint positions of animal legs, which greatly reduces the amount of calculation and improves the calculation speed;

[0045] The integration of the contour-based Tiny VGG lightweight convolutional neural network and the LSTM model based on the animal leg skeleton makes joint decisions and judges the animal posture, which not only reduces the complexity of calculation, but also greatly improves the calculation speed and accuracy.

[0046] In this scheme, in step 2.3), the wild mammal outline image is used as the input image, and the three classic convolution ideas of single structure convolution, depthwise separable convolution and multi-scale convolution are used to reconstruct the lightweight convolutional neural network Tiny VGG with fewer convolution layers suitable for wild mammal posture recognition, so as to recognize different postures of wild mammals.

[0047] The network used by LEAP to track the positions of the marked animal joints in step 3.1.2) is a 15-layer convolutional neural network. This network is compact and powerful, avoiding fully connected layers and redundant convolution and pooling operations, greatly improving the network training and prediction capabilities, and is the key link for LEAP to quickly track the positions of marked joints in animal images.

[0048] In step 3.2), for the sequence of changes in leg joint angles during animal movement, LSTM is used as a classifier to better handle sequence problems.

[0049] The beneficial effects of the present invention are:

[0050] (1) Construct the Outline Mask R-CNN model to extract animal outlines in complex wild environments. The deep learning model algorithm has strong generalization ability and can effectively avoid false detection and missed detection caused by lighting, occlusion, and angle problems;

[0051] (2) Construct a lightweight convolutional neural network Tiny VGG suitable for wild mammal posture recognition to automatically learn animal posture features and thus distinguish the different postures of wild mammals.

[0052] (3) LEAP is used to quickly track the changing positions of the marked animal leg joints. Based on the changing patterns of the angles formed by the joints, the LSTM classifier, which is good at processing sequence problems, is used to distinguish the animal postures. This not only reduces the complexity of the calculation, but also greatly improves the calculation speed.

[0053] (4) A dual-stream model consisting of a Tiny VGG model based on contour information and an LSTM model based on leg skeleton information jointly decides the final posture classification, effectively improving the recognition accuracy. BRIEF DESCRIPTION OF THE DRAWINGS

[0054] Figure 1 is a flow chart of the method of the present invention;

[0055] Figure 2 The network structure diagram of Tiny VGG constructed by the present invention;

[0056] Figure 3 This is a diagram of the LEAP training process used in the present invention. DETAILED DESCRIPTION

[0057] At present, posture recognition based on wild mammals is mostly done by giving animals sensors to obtain animal vital signs information for indirect detection. This method not only destroys the natural growth of animals, but is also not suitable for aggressive animals; posture recognition based on images is mostly for laboratory animals and poultry, and specific animals are identified using specific feature descriptors, which is not universal and the accuracy rate can only reach about 80%. In contrast, the wild mammal posture recognition method based on animal contours and leg joint angle changes of the present invention is applicable to limbed animals and is universal; and the accuracy rate can reach 96%, which has certain feasibility.

[0058] The method is further described below with reference to the accompanying drawings:

[0059] like Figure 1 As shown, a wild mammal posture recognition method based on animal contour and leg joint angle changes of the present invention uses a dual-stream model consisting of a Tiny VGG model characterized by contour information and an LSTM model characterized by leg skeleton information to jointly make decisions to recognize different postures of animals. Specifically, the wild mammal posture recognition method of this example includes the following steps:

[0060] Step 1: For animal videos in complex wild environments, use the K-means algorithm to cluster, remove a large number of redundant similar animal images, and extract representative key frames that can characterize the animal's posture characteristics; Step 2: For animal images in complex wild environments, build an Outline Mask R-CNN model to extract the outer contour of the animal. The specific steps are as follows:

[0061] Step 2.1, in order to reduce the requirements for large-scale data sets and optimize the required model information, the model weights trained on the COCO data set are used to learn the posture features of wild mammals through transfer learning for segmentation;

[0062] Step 2.2, the training image is passed through the trained ResNet98 to generate a feature image. The most suitable candidate frame is extracted from several recommended frames by the non-maximum suppression method. The network generates a non-interfering mask and mammal target detection frame for each fixed-size feature.

[0063] Step 2.3, after the mask is generated, use the ploy function in the Python matplotlib image library to extract edge information from the mask. When generating the image, only the edge information is retained as shown by the animal outline, and no specific mask area and target detection box are generated;

[0064] Step 3, build a lightweight network Tiny VGG, such as Figure 2 As shown in the figure, it is used for posture classification. First, based on the characteristics of the data set, a single-structure straight-tube network structure similar to the VGG network is used to construct a network with multiple convolutional layers; then, a small 3×3 convolution kernel like the VGG network is used in the network, and each convolutional network layer uses maximum pooling; finally, two fully connected layers plus Softmax are used to construct the classifier:

[0065]

[0066] Among them, x is the input, y is the predicted value, the probability of predicting category n is p, M is the category, and w is the score.

[0067] Step 4: For animal videos in complex wild environments, use LEAP to track the positions of the animal's leg joints to form an animal skeleton diagram. The specific steps are as follows:

[0068] Step 4.1, manually mark the positions of leg joints of a few frames of animal images;

[0069] Step 4.2, taking a single image of the animal as input, iteratively trains a 15-layer deep convolutional neural network consisting of a 3×3 convolutional block, a 2×2 maximum pooling layer, and a transposed convolutional layer, and generates a set of confidence maps (two-dimensional probability distributions) describing the position of each leg joint in the input as output. The global maximum value in each confidence map represents the network's prediction of the position of the joint, thereby predicting the position of the animal's leg joints in all video frames;

[0070] Step 4.3, calculate the joint point position y manually marked in step 4.1 and the network prediction result in step 4.2 The mean square error To measure the effectiveness of the network, Figure 3 As shown;

[0071] Step 5: Calculate the angle formed by the marked animal leg joint positions, and let the position coordinates of the upper limb joint point A tracked by LEAP be (x 1 ,y 1 ), the position coordinates of the lower limb joint point C are (x 3 ,y 3 ), the position coordinates of the knee joint point B connecting the upper and lower limbs are (x 2 ,y 2 ), then the angle ∠ABC formed by them is

[0072]

[0073] The change sequence of the minimum leg angle is used as the feature vector and sent to the posture classifier LSTM for training to effectively identify gait information.

[0074] Step 6: The contour-based Tiny VGG lightweight convolutional neural network model constructed in step 3 and the LSTM model based on the animal leg skeleton movement in step 5 are fused. The final score p of the two independent models is 1 and p 2 Make a joint decision to obtain the final classification result of the posture prediction value y of the input x, p(y=n|x)=0.5×p 1 +0.5×p 2 (3).

Claims

1. A mammal posture recognition method based on body contour and leg joint skeleton, comprising: 1) Firstly, collect mammal videos in the wild environment; characterized in that, it also includes the steps of: 2) Recognize the posture of mammals based on their outer contours; 3) Recognize the posture of mammals based on changes in the joints of their legs; 4) Based on the results of steps 2) and 3), make joint decisions to identify different postures of animals; In the step 2): 2.1) For the animal videos collected in step 1), select representative animal posture images; 2.2) For the image selected in step 2.1), construct an Outline Mask R-CNN model to extract the outer contour of the animal. The steps include: 2.2.1) Use transfer learning to train model weights on the COCO dataset; 2.2.2) Use the residual network ResNet98 to build the Outline Mask R-CNN convolutional network to extract the basic features of wild mammal images and realize object detection in animal images; 2.2.3) When generating instance segmentation, use the ploy function in Python's matplotlib image library to extract edge information from the mask to extract the animal outline; 2.3) Using the animal outline image obtained in step 2.2) as input, a Tiny VGG lightweight convolutional neural network is constructed to classify the outline features to identify the posture of wild mammals. The steps include: 2.3.1) Based on the characteristics of the dataset, a single-structure straight-tube network structure similar to the VGG network is used to construct a network with multiple convolutional layers; 2.3.2) The network uses the same 3×3 small convolution kernel as the VGG network, and each convolutional network layer adopts maximum pooling; 2.3.3) Use two fully connected layers plus Softmax to construct the classifier: Among them, x is the input, y is the predicted value, the probability of predicting category n is p1, M is the category, and w is the score; In the step 3): 3.1) For the animal video collected in step 1), track the position of the animal's leg joints and construct the animal skeleton diagram, the steps include: 3.1.1) Manually mark the locations of leg joints in a few frames of animal images; 3.1.2) Use deep neural network iterative training to predict the position of animal leg joints in all video frames: Taking a single image of an animal as input, a 15-layer deep convolutional neural network consisting of 3×3 convolutional blocks, 2×2 maximum pooling layers, and transposed convolutional layers is iteratively trained to produce a set of confidence maps describing the position of each leg joint in the input, i.e., a two-dimensional probability distribution as output; 3.1.3) Calculate the mean square error between the manually marked joint point positions in step 3.1.1) and the network prediction results in step 3.1.2) to measure the effectiveness of the network; 3.2) First, the angle formed by the position of the leg joints is calculated; then, the change sequence of the minimum leg angle is used as the feature vector and sent to the LSTM classifier for training to identify the posture of wild mammals; In the step 4), the contour-based Tiny VGG lightweight convolutional neural network model constructed in step 2) and the LSTM neural network model based on the animal leg skeleton movement in step 3) are fused, and the prediction scores of the two independent models are jointly decided to obtain the final classification result.

2. The method for mammal posture recognition based on body contour and leg joint skeleton according to claim 1, characterized in that In step 2.2.1), the model weights trained on the COCO dataset are used to learn the posture features of wild mammals through transfer learning for segmentation; In step 2.2.2), the animal image is trained with ResNet98 to generate a feature image. The most suitable candidate frame is extracted from several recommended frames by the non-maximum suppression method. The network generates a non-interfering mask and mammal target detection frame for each fixed-size feature. In step 2.2.3), after the mask is generated, the ploy function in the python matplotlib image library is used to extract the edge information of the mask; when generating the image, only the edge information shown by the animal outline is retained, and no specific mask area and target detection frame are generated.

3. The method for mammal posture recognition based on body contour and leg joint skeleton according to claim 1, characterized in that in the step 3.1), the position changes of the marked joint points in the animal video are tracked using the animal posture estimation LEAP algorithm; 3.1.1), manually mark the leg joint positions of a few representative key-frame animal images in the animal posture video; 3.1.2), the global maximum value in each confidence map represents the network's prediction of the position of the joint point, thereby predicting the position of the animal's leg joint points in all video frames; 3.1.3) Calculate the joint point position y manually marked in step 3.1.1) and the convolutional neural network prediction result in step 3.1.2) The mean square error The loss function is constructed by the mean square error (MSE) for comparison, and the loss function is minimized after iterative training.

4. The method for mammal posture recognition based on body contour and leg joint skeleton according to claim 1, characterized in that In step 3.2), the method for calculating the angle formed by the positions of the leg joint points is: Assume that the position coordinates of the tracked upper limb joint point A are (x1, y1), the position coordinates of the lower limb joint point C are (x3, y3), and the position coordinates of the knee joint point B connecting the upper and lower limbs are (x2, y2), then the angle ∠ABC formed by them is:

5. The method for mammal posture recognition based on body contour and leg joint skeleton according to claim 1, characterized in that In the step 4), the final score p1 of the Tiny VGG network model based on contour features in step 2) and the final score p2 of the LSTM model based on skeleton features in step 3) are score fused to jointly vote on the possibility of the posture prediction value y shown in the animal video x: p(y=n|x)=0.5×p1+0.5×p2.

Citation Information

Patent Citations

  • Pig walking posture identification system and method based on outline invariant moment features

    CN102509085A

  • Human body posture behavior intelligent analysis and recognition method

    CN110188599A

  • Animal posture behavior estimation and mood recognition method based on deep learning and SVM

    CN110457999A

  • Method for recognizing human body behaviors by utilizing posture mask

    CN111274921A

  • Animal behavior automatic identification method and device

    CN111476118A