Animal Pose Estimation Based on Contrastive Learning with Dynamic Conditional Prompts (2024)

1. Introduction

Animal pose estimation involves identifying and tracking animal body parts and joint positions from images or videos to obtain pose information [1]. Numerous studies have adapted human pose estimation methods for animals. However, animal pose estimation encounters challenges such as limited training data, extensive annotation requirements, and non-rigid deformations. These factors complicate the application of existing image-based methods to estimations of animal poses.

Current research on animal pose estimation predominantly utilizes real and synthetic animal datasets for training. Cao et al. [2] proposed a cross-domain adaptive method that translates knowledge of labeled animal categories into unlabeled categories through a shared space. Mu et al. [3] leveraged synthetic and real images derived from animal model CAD to address the scarcity of labeled data. Furthermore, Li et al. [4] developed a multiscale domain adaptation module to learn from synthetic animal data. Despite these advances, these studies focus primarily on image information [5] and continue to face challenges due to data constraints and considerable variations in animal appearance, texture, and pose.

As the contrastive language–image pre-training (CLIP) [6] model continues to evolve and profoundly impact the visual field, language models integrated with visual information have become increasingly significant in the task of animal pose estimation. This collaborative training significantly improves the accuracy of the positioning of key points and is garnering increasing attention. CLIP allows the model to comprehend language and images by jointly training on both modalities. The architecture includes a text encoder and an image encoder. For a given image–text pair, the image and text are input into their respective encoders to produce the corresponding feature vectors. These vectors are then used to construct a relationship matrix that defines the symmetrical similarity between the image feature vector and the text feature vector. The text encoder can utilize the continuous bag-of-words (CBOW) model [7] or a transformer [8] model, processing a sequence of word tokens to generate vectorized representations. For the image encoder, the options include the Vision Transformer (ViT) [9] or ResNet [10], each converting images into vectors of features. In applications of animal pose estimation, CLIP leverages rich textual prior knowledge to describe key points, learning deep semantic connections between images and text. This approach enables the model to determine the location of key points precisely using text information and to effectively identify these points in animal images, thereby advancing the technology of animal pose estimation.

In the field of animal pose estimation, natural language tends to consistently describe various animals and their poses, enabling language-based pre-training models to effectively compensate for deficiencies in animal image data. Despite significant advancements in language–image pre-training models, their application to downstream tasks like animal pose estimation still presents challenges. To address this, Zhou et al. introduced the CoOp [11] and CoCoOp [12] methods, which enhance image classification effects through learnable text embedding. In a related approach, Gao et al. developed the CLIP-Adaptor [13], designed to improve the performance of the model in classification tasks through lightweight adapters. These studies mainly focus on the use of CLIP models to optimize image classification tasks. However, CLIP models generally use broad language prompts to describe entire images, whereas animal pose estimation tasks require precise descriptions of specific poses to differentiate various key points in an image. This necessitates designing suitable prompt templates to boost task performance. Zhang et al. proposed the CLAMP [14] method, using the learnable context vector from CoOp as a prompt template for the estimation of animal poses. This approach highlights the potential and importance of prompt templates for specific applications.

Addressing the limitations of image-based animal pose estimation, we integrated a prior knowledge of animal poses in a language modality with dynamic conditional prompts. We propose a multimodal contrastive learning method for animal pose estimation, utilizing dynamic conditional prompts for the comprehensive collaborative training of image and text information. This approach introduces a dynamic conditional prompt that incorporates image features, ensuring that the context vector within the text prompt aligns closely with the image characteristics. This approach focuses more precisely on the features of the sample, enabling each input sample to contain conditional prompts based on dynamic image features. Furthermore, we designed a key-point text prompt template that includes key points and sentences related to animal poses, with a random selection of a template for each key point to form a comprehensive key-point text prompt template. Experimental results on the AP-10K dataset [15] and the Animal Pose dataset [2] demonstrate that our method outperforms traditional image-based animal pose estimation methods in terms of average accuracy [16]. Additionally, compared to CLIP-based methods, our approach shows significant improvements in average accuracy, particularly for medium-scale objects.

2. Materials and Methods

We leveraged prior knowledge of animal poses in a language modality to propose a collaborative training approach for language–image and contrastive learning models for animal pose estimation. Recognizing that the key points of different animal images are often described similarly in language, we designed a set of text prompts. These prompts consist of two parts: first, a key-point text prompt template comprised of sentences related to key points and animal poses to enhance the representation of these key points; second, an image feature that is transformed into a vector through a non-linear, fully connected network. This methodology facilitates the effective association and robust training of image and text features. By comparing this with a contrastive language–image pre-training model, we can establish a relationship between the pre-trained language model and visual representations of animal poses, thereby improving the accuracy of pose estimation. Figure 1 illustrates the network structure diagram of this method.

2.1. Dynamic Conditional Prompts for Prior Knowledge of Animal Poses in Language Modality

In the animal pose estimation task, the difference from the classification task is that it is impossible to know in advance which category the animal in the image belongs to, and pose estimation requires accurately finding the key-point location of each animal instance. Therefore, we cannot use “A photo of a/an {object}” as a template to define text prompts, as mentioned in the CLIP model. To solve this problem, we designed a more flexible text prompt that can describe more specifically. The characteristics of the animal and the location of key points in the image are focused on, thereby helping the model to more accurately locate and identify the key points of the animal in the image.

(1)

Text prompt templates

The idea of a text prompt template [17] is proposed for key points of the animal pose, using richer language information to enhance the representation ability of key points of the animal to obtain more text information of key points. We designed a template to generate a text prompt template for key points. The template consists of key points and sentences related to animal poses, which is important for extending key-point label text. Specifically, given the key-point labels, and a defined set of acceptable templates, through the filling function, the key-point label will be randomly selected into a template to generate sentences with key points; that is, key-point text prompt templates. Among them, there are three forms of prompts: prefix prompts, intermediate prompts, and suffix prompts. Figure 2 shows text prompt templates of key points.

(2)

Conditional tokens for image features

For conditional tokens with image features, a continuous template based on conditional prompts is used to fuse the context vector with the image feature conditional tokens to achieve dynamic conditional prompts for each input sample. Specifically, the image features, Ip, generate conditional tokens, α, with image features through a non-linear, fully connected neural network, g·; α are expressed as gIp. The conditional tokens, α, are added to the learnable context vector to obtain the conditional tokens of the dynamic image feature, which adapts the text prompt template to the animal pose estimation task. As shown in Figure 3, the dynamic image feature conditional token is defined as

Pq=V1IpV2IpVqIp,

where ViIp=Vi+α,i1,2,,q represents the conditional token for the i-th dynamic image feature, Vi represents the learnable context vector, and q refers to the number of learnable context vector prefix tokens, that is, the context length.

(3)

Dynamic conditional prompts

The dynamic conditional prompts constitute prior knowledge of the animal pose language modality, which is made up of text prompt templates and dynamic image feature conditional tokens, expressed as

Pm=V1IpV2IpVqIpTextm,m=1,,M,

where ViIp,i1,2,,q refers to the conditional token for dynamic image features and Textm refers to the template of the text prompt of the m-th key point.

2.2. Contrastive Learning for Animal Pose Estimation

The contrastive learning model is utilized to enhance the connection between text and images, facilitating effective association and collaborative training of text and image features. By implementing cosine similarity matching, this approach significantly improves the accuracy of animal pose estimation.

For text feature extraction, input text prompts consist of dynamic conditional prompts with image features and key-point text prompt templates. The tokenizer is used to convert the text prompt into data that the model can process, thus providing the text prompt vector. This vector is then fed into the text encoder of the CLIP model to extract the semantic information from the key-point text prompt. In the context of pose estimation, there are specific relationships between key points; for example, the nose and eyes are related, whereas the nose and shoulders are not necessarily connected. To account for these intrinsic relationships between key points, a residual attention mechanism is used to enhance the semantic information of the text prompts, PpromptR17×D. Notably, 17 represents the number of animal key points and D refers to the number of image channels. The residual attention mechanism is depicted in Figure 4.

For the extraction of image features, the input image is processed through the ViT image encoder of the CLIP model, producing the image feature IRH×W×DI, as illustrated in Figure 5. Here, H, W, and DI denote the height, width, and number of channels of the image, respectively. The image features are then passed through a linear projection layer where dimensionality reduction is performed to align the image feature dimensions, IpRH×W×D, with those of the text features. To accurately capture the real position of key points, the image feature information is utilized with the key point as the center. The surrounding image area is sampled at fixed intervals to extract the local key-point feature, IkeypointR17×D.

To establish connections between text and images, it is essential to evaluate the model’s understanding of the relationship between text descriptions and images. The semantic information from the enhanced text prompts, PpromptR17×D, and the features of the local key points, IkeypointR17×D, are compared using cosine similarity. This measure is expressed as

Q=Pprompt·IkeypointTPprompt2·Ikeypoint2,

where IkeypointT represents the transpose operation on the local key-point feature Ikeypoint, and ·2 represents the L2 norm. The closer Q is to 1, the higher the similarity of semantic information and key features of text prompts, and the model can more accurately understand the relationship between text descriptions and images.

The purpose of animal pose estimation is to obtain two-dimensional coordinate information of key points from the image to construct the skeleton graph of animal poses. To obtain the location information of the key points, the spatial association between text and image is established and the semantic information in the text prompt is used to judge the location of key points in the image accurately. By using matrix multiplication to calculate the probability distribution of the key-point probability of the enhanced semantic information of the text prompt, PpromptR17×D, and the image features, IpRH×W×D, the formula can be expressed as

S=Pprompt·IpPprompt2·Ip2.

2.3. Loss Function of the Animal Pose Estimation Model

The loss function in this study mainly consists of three parts; the first part is the mean square error loss function between the predicted heatmap output by the model and the real heatmap, the second part is the cross-entropy loss function for text–image feature matching, and the third part is the mean square error loss function for spatial location information. The loss function is expressed as

L=1Mi=1Mhpredht2+β·12CEQ,Q+CEQT,Q+β·1Mi=1MSSt2,

where M refers to the number of key points, 17 in this study. hpred represents the fusion of the image feature IRH×W×DI and the key-point probability distribution S, and the fusion features are input into the key-point predictor to generate the prediction of the pose heatmap. ht represents the true heatmap. CE represents the cross-entropy loss function. Q refers to the diagonal matrix that acts as the text–image feature-matching target matrix. St represents the true probability distribution of the location of the key points. Parameter β was set to 2.

3. Results and Discussion

3.1. Animal Pose Estimation Datasets

To evaluate the performance of the proposed method, the model was evaluated and analyzed on the AP-10K dataset and the Animal Pose dataset. The AP-10K dataset covers 23 animal families, 54 species of mammals, and 10,015 images with labels. The labeling format adopts the pose estimation label format of the COCO dataset [18], which is one of the largest and most diverse datasets in the field of animal pose estimation. The diversity of the AP-10K dataset allowed us to test the generalization ability of our proposed method across different species and families. In addition, the AP-10K dataset provides rich key-point annotations, which help improve the accuracy and reliability of our proposed method. There are 17 key points annotated in the dataset, which are defined in Table 1.

The Animal Pose dataset consists of five species: dogs, cats, cows, horses, and sheep. To better integrate pose knowledge from the human dataset and the animal dataset, the pose annotation format of the dataset is aligned with that of the popular human pose dataset. The Animal Pose dataset, a smaller subset created from the publicly available VOC2011 [16], contains 4608 images and more than 6000 animal instances, each containing 20 animal key-point labels, as well as animal instance bounding box information. The novel cross-domain adaptation method [2] in the Animal Pose dataset allowed us to evaluate the adaptability of our method across different domains and species of animal pose estimation. The Animal Pose dataset contains a large number of real and synthetic animal images, helping to solve the problem of the scarcity of training data. The key points for representation are detailed in Table 2.

3.2. Evaluation Index

In animal pose estimation, average accuracy is usually used as an index to evaluate the performance of the pose estimation model. Average accuracy is calculated based on Object Keypoint Similarity (OKS) [16]. OKS is used to measure the similarity between predicted key points and real key points. OKS is calculated as follows:

OKS=i=1nexpdi2/2s2ki2δvi>0i=1nδvi>0,

where Euclidean distance, di, is used to measure the difference between the position of the i-th key point predicted by the model and the position of the corresponding real key point. The target scale, s, is the standardized factor. ki is the weight of the key point, which is used to control the attenuation effect of the distance error on the overall similarity score, and v is the visibility of the key point (0 means unmarked, 1 means marked but invisible, 1 means marked but invisible, and 2 means marked and visible). The value of OKS is in the range of 0,1. The closer the value is to 1, the higher the degree of matching between the predicted key point and the actual key point. The calculation formula of the average accuracy, AP, based on OKS is

AP=i=1nδOKSi>Tn,

where n represents the number of instances contained in a series of images to be detected and T is the manually set OKS threshold. Generally, the meaning of AP is different according to different settings of T. In the evaluation criteria based on OKS, AP means that OKS is 0.5, 0.55,…,0.9, 0.95, the average accuracy of all predicted key points. AP50 represents the prediction accuracy rate when OKS is 0.5. AP75 represents the accuracy rate when OKS is 0.75. APM represents the accuracy rate of the target key point of the medium-scale object. The scale of the target object is divided according to its area. When the area of the target object is within 322area962, it is a medium-scale object. APL represents the average accuracy rate of the target key point of the large-scale object. When the area of the target object is greater than 962, it is a large-scale object. AR indicates OKS at 0.5, 0.55,…,0.9, 0.95, at the average recall rate of these 10 locations. The higher the result of the evaluation index, the more accurate the pose estimation algorithm.

3.3. Experimental Parameter Settings

The PyTorch1.11 deep learning framework was used as the experimental framework. The model was trained on a computer running the Ubuntu 20.04 operating system, and the entire training process was deployed on a NVIDIA RTX 3090 with 24 GB of memory. The image feature extraction backbone network of the model adopts ViT, and the weights pre-trained by CLIP are used when initializing. During training, the optimizer selected AdamW [19], and set the weight decay to 0.0001, the batch size to 32, and the initial learning rate to 0.0001. Training was carried out for a total of 210 epochs with a stepwise learning rate adjustment strategy. At the 170th and 200th epochs, the learning rate decayed by a multiple of 10.

3.4. Experimental Results on the AP-10K Dataset

Table 3 shows the experimental results of various methods in the AP-10K dataset. The method in this study is compared with the image-based methods of SimpleBaseline [20], ShufflenetV1 [21], ShufflenetV2 [22], Lite-HRNet [23], CPM [24], MobileNetV2 [25], ViTPose-S [26], SHN [27], CSPNeXt [28], HRNet [29], and the CLAMP [14] method based on CLIP. These methods are considered more classic methods in animal pose estimation. Additionally, these methods are re-trained and tested. The larger the index value, the more accurate the animal pose estimation.

As shown in Table 3, compared to the SimpleBaseline method pre-trained with ImageNet [30], the average accuracy, AP, of the proposed method pre-trained with CLIP improved by 3.7%, and other indicators also improved to some extent. Compared to the HRNet-w32 method pre-trained with ImageNet, AP improved by 1.5%. In comparison, compared to the ShufflenetV1 method, the AP improvement was 16.1%, and the values at AP50, AP75, APM, APL, and AR increased by 7.2%, 19.3%, 12.5%, 15.7%, and 14.9%, respectively. Compared to the Lite-HRNet-18 and Lite-HRNet-30 methods without a pre-training model, the evaluation index results of this method improved significantly and AP increased by 14.3% and 13%, respectively. The experimental results showed that the proposed method combined with the CLIP model achieves better results, which highlights the effectiveness of the visual language pre-training model in processing animal pose estimation tasks, and indicates that language knowledge can assist in the judgment of key-point location. In addition, compared to the CLAMP method using CLIP, the proposed method also showed stable improvement, especially for medium-scale objects; the average accuracy was 4.7% higher than CLAMP. The comprehensive experimental results show that, compared to the image-based method, the proposed method using CLIP underwent a certain improvement. This shows that language information related to animal pose estimation can help improve the accuracy of key-point location judgment to a certain extent. Compared to the CLAMP method, the proposed method also had a certain degree of improvement, especially for the average accuracy of medium-scale objects, APM, because medium-scale animals occupy a moderate amount of space in the image, neither being too small for features to be captured nor too large for details to be processed. At the same time, medium-scale animal pose diversity enables the model to better utilize language–image information, thereby improving pose estimation accuracy. This shows that using rich prior knowledge of language modality can help improve the accuracy of animal pose estimation.

3.5. Experimental Results from the Animal Pose Dataset

Table 4 shows the results of the experiments on the Animal Pose dataset compared to the image-based methods in ShufflenetV1, ShufflenetV2, Lite-HRNet, SHN, SimpleBaseline, HRNet, and the CLAMP method based on CLIP. Compared to the methods pre-trained with Resnet-101 and HRNet-w32 using ImageNet, the proposed method using CLIP improved the AP by 5.8% and 1.7%, respectively, while other indicators also improved to some extent. Compared to the ShufflenetV1 method, AP increased by 17.5%, and the values at AP50, AP75, APM, and APL increased by 6.4%, 22.4%, 14.2%, and 18.2%, respectively. Compared to the Lite-HRNet method, all indicators improved, and AP by 11.8%. In addition, compared to CLAMP pre-trained with CLIP, the results also showed some improvement, especially in the average accuracy of medium-scale objects, which was 1.4% higher than CLAMP. The experimental results showed that the proposed method has certain improvements in indicators compared with image-based methods. This shows that language–image information based on CLIP can improve the accuracy of animal pose estimation to a certain extent. Comparing the proposed method with CLAMP, our method also has certain improvements, especially in the APM index, which shows that using rich prior modal knowledge of language can help improve the accuracy of animal pose estimation.

3.6. Ablation Experiments

This group of experiments verified the influence of the loss function of spatial position information (LS), the loss function of text–image feature matching (LQ), and the residual attention mechanism (A) on the performance of the model. ViT was used as the backbone network for pose estimation. To verify the effectiveness of the key module design for pose estimation, ablation experiments were carried out on the AP-10K dataset.

The experimental results are shown in Table 5. The baseline model is expressed as the loss function of spatial position information, the loss function of text–image feature matching, and the residual attention mechanism without introducing it. We added the spatial location information loss function to the baseline model, and the results show certain improvements; in particular, the average accuracy of medium-scale objects increased by 4.5%, which helps to establish the spatial connection between text prompts and image features and provides spatial location information. Considering the enhanced semantic information of text prompts and the alignment between local key-point features, the loss function of text–image feature matching was introduced on the basis of the baseline model and the loss function of spatial location information, and the APM improved by 2.7%. The residual attention mechanism was introduced into the baseline model, the spatial position information loss function and the text–image feature-matching loss function, and each index had a certain improvement, proving the effectiveness of modeling the semantic relationship between different key points to generate enhanced cue embedding for animal pose estimation. This group of experiments verified the effectiveness of the spatial position information loss function, the text–image feature-matching loss function, and the residual attention mechanism for improving the performance of the animal pose estimation model.

The text prompt consists of dynamic conditional tokens with image features and key-point text prompt templates. To consider the influence of these two parts on the accuracy of animal key-point prediction, ablation experiments were performed on the AP-10K dataset to verify the influence of the text prompt design on model performance. Based on the CLAMP method, the key-point text prompt template (Tp) and dynamic image feature conditional tokens (Pq) were used to optimize the model performance. The experimental results are shown in Table 6. Baseline + Tp indicates that AP increased by 0.3% after a key-point text prompt template was added to the baseline model. Adding the conditional token for the dynamic image feature (Pq) to the baseline model improved AP by 0.5%, and APM increased by 2.9%. Compared to the baseline model, AP improved to some extent, and, in particular, APM increased by 4.7%. This shows that the design of text prompts has a great influence on the average accuracy of medium-scale objects, and also has a certain influence on the performance of animal pose models.

In the AP-10K dataset, q in Formula (2) refers to the context length. By adjusting the value of q, the amount of context information contained in the text prompt can be controlled, thus affecting the text encoder’s understanding of the text semantics and context, and further influencing the prediction results of animal gesture estimation, as shown in Table 7. It can be seen that smaller or larger values of q do not lead to better results. When q is 8, AP has the highest value of 74.2%. This shows that the appropriate context length information can affect the performance of the animal pose estimation model.

3.7. Visual Results

We randomly selected images from the AP-10K dataset for visualization, including single animals, multiple animals, ones with complex backgrounds, and images with blocked animals. The prediction results are shown in Figure 6. The results of ResNet-50, HRNet-w32, CLAMP, OUR, and ground truth are shown from top to bottom, respectively. It can be seen from the first column that, compared with the image-based methods ResNet-50 and HRNet-w32, and the CLAMP method based on CLIP, the pose estimation results of our method for the image of the right front leg of the sheep are closer to the ground truth. It can be seen from the second column that for the first bear on the left, the image-based methods ResNet-50 and HRNet-w32 ignore the key points of the bear’s chest. In contrast, our method successfully utilizes linguistic knowledge to obtain chest key points, and overall obtains more key-point information compared with the ground truth. It can be seen in the third column that, for complex scenes, the key points on the animal’s belly may be mislabeled by other methods. In contrast, our proposed method can locate and identify these key points, indicating that the proposed method is useful for positioning animal pose estimation.

4. Conclusions

We addressed the challenges inherent in traditional animal pose estimation methods that rely on image modality. These challenges include the scarcity of training data, the extensive annotation workload, and the non-rigid deformation of animal bodies. We propose a multidimensional approach using dynamic conditional prompts in a language–image contrastive learning model. This model effectively constructs dynamic conditional prompts by incorporating prior knowledge from language modalities, supplemented by text prompt templates and image feature conditional tokens. This enriches the model learning content and enhances the representation capability of key points. The model integrates the contextual feature vector of the text prompt with the image feature conditional tokens to provide customized dynamic conditional prompts for each input sample. The CLIP model was used to foster effective associations between image and text features, thus improving the accuracy of key-point positioning and animal pose estimation via collaborative training. The experimental results for the AP-10K and Animal Pose datasets demonstrate that this method surpasses traditional image-based methods in terms of average accuracy. Additionally, compared to the CLIP method, this approach shows improvements in all metrics, particularly in the average accuracy for medium-scale objects. The results of the ablation study illustrate the impact of each module on the accuracy of the estimation of the pose of the animals. Future work will include testing on more diverse datasets to further validate the general applicability of the model and further optimizing the model to obtain more precise prediction results.

Author Contributions

Conceptualization, X.H. and C.L.; methodology, X.H. and C.L.; software, X.H.; investigation, X.H. and C.L.; writing—original draft preparation, X.H.; writing—review and editing, X.H.; supervision, C.L. All authors have read and agreed to the published version of the manuscript.

Funding

This research was funded by the National Natural Science Foundation of China (nos. 61931003, 62171044) and the Natural Science Foundation of Beijing (no. 4222004).

Institutional Review Board Statement

Ethical review and approval were waived for this study due to the non-invasive and observational nature of the research methods used. Specifically, the study involved only the use of publicly available animal datasets without any physical contact or interference with their natural behaviors or environment. This approach does not impact the welfare or health of the animals, thereby making traditional ethical review and approval unnecessary.

Informed Consent Statement

Not applicable.

Data Availability Statement

The datasets used in this paper are all publicly available datasets, composed of two datasets in total. Here are the links to the two publicly available datasets: https://drive.google.com/file/d/1-FNNGcdtAQRehYYkGY1y4wzFNg4iWNad/view (accessed on 18 August 2023) and http://host.robots.ox.ac.uk/pascal/VOC/voc2012/#data (accessed on 18 August 2023). The data presented in this study are available on request from the corresponding author.

Acknowledgments

The authors are grateful to the editors and the anonymous reviewers for their insightful comments and suggestions.

Conflicts of Interest

The authors declare no conflicts of interest.

References

  1. Vaintrub, M.O.; Levit, H.; Chincarini, M.; Fusaro, I.; Giammarco, M.; Vignola, G. Precision livestock farming, automats and new technologies: Possible applications in extensive dairy sheep farming. Animal 2021, 15, 100143. [Google Scholar] [CrossRef] [PubMed]
  2. Cao, J.; Tang, H.; Fang, H.S.; Shen, X.; Lu, C.; Tai, Y.W. Cross-Domain Adaptation for Animal Pose Estimation. In Proceedings of the IEEE/CVF International Conference on Computer Vision (ICCV), Seoul, Republic of Korea, 27 October–2 November 2019; pp. 9497–9506. [Google Scholar]
  3. Mu, J.; Qiu, W.; Hager, G.D.; Yuille, A. Learning from Synthetic Animals. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR), Seattle, WA, USA, 14–19 June 2020; pp. 12386–12395. [Google Scholar]
  4. Li, C.; Lee, G.H. From Synthetic to Real: Unsupervised Domain Adaptation for Animal Pose Estimation. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR), Nashville, TN, USA, 19–25 June 2021; pp. 1482–1491. [Google Scholar]
  5. Ye, Y.; Park, H. FusionNet: An End-to-End Hybrid Model for 6D Object Pose Estimation. Electronics 2023, 12, 4162. [Google Scholar] [CrossRef]
  6. Radford, A.; Kim, J.W.; Hallacy, C.; Ramesh, A.; Goh, G.; Agarwal, S.; Sastry, G.; Askell, A.; Mishkin, P.; Clark, J.; et al. Learning Transferable Visual Models from Natural Language Supervision. In Proceedings of the International Conference on Machine Learning (ICML), Online, 18–24 July 2021; pp. 8748–8763. [Google Scholar]
  7. Rong, X. word2vec Parameter Learning Explained. arXiv 2016, arXiv:1411.2738. [Google Scholar]
  8. Vaswani, A.; Shazeer, N.; Parmar, N.; Uszkoreit, J.; Jones, L.; Gomez, A.N.; Kaiser, L.; Polosukhin, I. Attention is All you Need. In Proceedings of the Advances in Neural Information Processing Systems, Long Beach, CA, USA, 4–9 December 2017; p. 30. [Google Scholar]
  9. Dosovitskiy, A.; Beyer, L.; Kolesnikov, A.; Weissenborn, D.; Zhai, X.; Unterthiner, T.; Dehghani, M.; Minderder, M.; Heigold, G.; Gelly, S.; et al. An Image is Worth 16x16 Words: Transformers for Image Recognition at Scale. arXiv 2020, arXiv:2010.11929. [Google Scholar]
  10. He, K.; Zhang, X.; Ren, S.; Sun, J. Deep Residual Learning for Image Recognition. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition (CVPR), Las Vegas, NV, USA, 27–30 June 2016; pp. 770–778. [Google Scholar]
  11. Zhou, K.; Yang, J.; Loy, C.C.; Liu, Z. Learning to Prompt for Vision-Language Models. Int. J. Comput. Vis. 2022, 130, 2337–2348. [Google Scholar] [CrossRef]
  12. Zhou, K.; Yang, J.; Loy, C.C.; Liu, Z. Conditional Prompt Learning for Vision-Language Models. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR), New Orleans, LA, USA, 19–24 June 2022; pp. 16795–16804. [Google Scholar]
  13. Gao, P.; Geng, S.; Zhang, R.; Ma, T.; Fang, R.; Zhang, Y.; Li, H.; Qiao, Y. CLIP-Adapter: Better Vision-Language Models with Feature Adapters. Int. J. Comput. Vis. 2024, 132, 581–595. [Google Scholar] [CrossRef]
  14. Zhang, X.; Wang, W.; Chen, Z.; Xu, Y.; Zhang, J.; Tao, D. CLAMP: Prompt-based Contrastive Learning for Connecting Language and Animal Pose. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR), Vancouver, BC, Canada, 20–22 June 2023; pp. 23272–23281. [Google Scholar]
  15. Yu, H.; Xu, Y.; Zhang, J.; Zhao, W.; Guan, Z.; Tao, D. AP-10K: A Benchmark for Animal Pose Estimation in the Wild. arXiv 2021, arXiv:2108.12617. [Google Scholar]
  16. Everingham, M.; Van, G.L.; Williams, C.K.I.; Winn, J.; Zisserman, A. The Pascal Visual Object Classes (VOC) Challenge. Int. J. Comput. Vis. 2010, 88, 303–338. [Google Scholar] [CrossRef]
  17. Wang, M.; Xing, J.; Liu, Y. ActionCLIP: A New Paradigm for Video Action Recognition. arXiv 2021, arXiv:2109.08472. [Google Scholar]
  18. Lin, T.Y.; Maire, M.; Belongie, S.; Bourdev, L.; Girshick, R.; Hays, J.; Perona, P.; Ramanan, D.; Zitnick, C.L.; Dollar, P. Microsoft COCO: Common Objects in Context. arXiv 2015, arXiv:1405.0312. [Google Scholar]
  19. Loshchilov, I.; Hutter, F. Decoupled Weight Decay Regularization. arXiv 2019, arXiv:1711.05101. [Google Scholar]
  20. Xiao, B.; Wu, H.; Wei, Y. Simple Baselines for Human Pose Estimation and Tracking. In Proceedings of the Computer Vision–ECCV 2018, Munich, Germany, 8–14 September 2018; pp. 472–487. [Google Scholar]
  21. Zhang, X.; Zhou, X.; Lin, M.; Sun, J. ShuffleNet: An Extremely Efficient Convolutional Neural Network for Mobile Devices. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR), Salt Lake City, UT, USA, 18–23 June 2018; pp. 6848–6856. [Google Scholar]
  22. Ma, N.; Zhang, X.; Zheng, H.T.; Sun, J. ShuffleNet V2: Practical Guidelines for Efficient CNN Architecture Design. In Proceedings of the Computer Vision–ECCV 2018, Munich, Germany, 8–14 September 2018; pp. 122–138. [Google Scholar]
  23. Yu, C.; Xiao, B.; Gao, C.; Yuan, L.; Zhang, L.; Sang, N.; Wang, J. Lite-HRNet: A Lightweight High-Resolution Network. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR), Nashville, TN, USA, 19–25 June 2021; pp. 10435–10445. [Google Scholar]
  24. Wei, S.E.; Ramakrishna, V.; Kanade, T.; Sheikh, Y. Convolutional Pose Machines. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition (CVPR), Las Vegas, NV, USA, 27–30 June 2016; pp. 4724–4732. [Google Scholar]
  25. Sandler, M.; Howard, A.; Zhu, M.; Zhmoginov, A.; Chen, L.C. MobileNetV2: Inverted Residuals and Linear Bottlenecks. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR), Salt Lake City, UT, USA, 18–22 June 2018; pp. 4510–4520. [Google Scholar]
  26. Xu, Y.; Zhang, J.; Zhang, Q.; Tao, D. ViTPose: Simple Vision Transformer Baselines for Human Pose Estimation. arXiv 2022, arXiv:2204.12484. [Google Scholar]
  27. Newell, A.; Yang, K.; Deng, J. Stacked Hourglass Networks for Human Pose Estimation. In Proceedings of the Computer Vision–ECCV 2016, Amsterdam, The Netherlands, 10–16 October 2016; pp. 483–499. [Google Scholar]
  28. Lyu, C.; Zhang, W.; Huang, H.; Zhou, Y.; Wang, Y.; Liu, Y.; Zhang, S.; Chen, K. RTMDet: An Empirical Study of Designing Real-Time Object Detectors. arXiv 2022, arXiv:2212.07784. [Google Scholar]
  29. Sun, K.; Xiao, B.; Liu, D.; Wang, J. Deep High-Resolution Representation Learning for Human Pose Estimation. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR), Long Beach, CA, USA, 15–20 June 2019; pp. 5686–5696. [Google Scholar]
  30. Deng, J.; Dong, W.; Socher, R.; Li, L.J.; Li, K.; Li, F.F. ImageNet: A Large-Scale Hierarchical Image Database. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition (CVPR), Miami, FL, USA, 20–25 June 2009; pp. 248–255. [Google Scholar]

Animal Pose Estimation Based on Contrastive Learning with Dynamic Conditional Prompts (1)

Figure 1.The network structure of the contrastive learning model for estimating animal poses based on a dynamic conditional prompt.

Figure 1.The network structure of the contrastive learning model for estimating animal poses based on a dynamic conditional prompt.

Animal Pose Estimation Based on Contrastive Learning with Dynamic Conditional Prompts (2)

Animal Pose Estimation Based on Contrastive Learning with Dynamic Conditional Prompts (3)

Figure 2.Text prompt templates of key points.

Figure 2.Text prompt templates of key points.

Animal Pose Estimation Based on Contrastive Learning with Dynamic Conditional Prompts (4)

Animal Pose Estimation Based on Contrastive Learning with Dynamic Conditional Prompts (5)

Figure 3.Conditional tokens for dynamic image features.

Figure 3.Conditional tokens for dynamic image features.

Animal Pose Estimation Based on Contrastive Learning with Dynamic Conditional Prompts (6)

Animal Pose Estimation Based on Contrastive Learning with Dynamic Conditional Prompts (7)

Figure 4.The residual attention mechanism.

Figure 4.The residual attention mechanism.

Animal Pose Estimation Based on Contrastive Learning with Dynamic Conditional Prompts (8)

Animal Pose Estimation Based on Contrastive Learning with Dynamic Conditional Prompts (9)

Figure 5.Flow chart of image encoder.

Figure 5.Flow chart of image encoder.

Animal Pose Estimation Based on Contrastive Learning with Dynamic Conditional Prompts (10)

Animal Pose Estimation Based on Contrastive Learning with Dynamic Conditional Prompts (11)

Figure 6.Partial visualization results of ResNet-50 (first row), HRNet-w32 (second row), CLAMP (third row), OUR (fourth row), and ground truth (fifth row).

Figure 6.Partial visualization results of ResNet-50 (first row), HRNet-w32 (second row), CLAMP (third row), OUR (fourth row), and ground truth (fifth row).

Animal Pose Estimation Based on Contrastive Learning with Dynamic Conditional Prompts (12)

Animal Pose Estimation Based on Contrastive Learning with Dynamic Conditional Prompts (13)

Table 1.Animal key-point annotations in the AP-10K dataset.

Table 1.Animal key-point annotations in the AP-10K dataset.

Label NumberNameLabel NumberName
0left eye9right elbow
1right eye10right front paw
2nose11left hip
3neck12left knee
4root of tail13left back paw
5left shoulder14right hip
6left elbow15right knee
7left front paw16right back paw
8right shoulder

Animal Pose Estimation Based on Contrastive Learning with Dynamic Conditional Prompts (14)

Table 2.Animal key-point annotations in the Animal Pose dataset.

Table 2.Animal key-point annotations in the Animal Pose dataset.

Label NumberNameLabel NumberName
0left eye10left back elbow
1right eye11right back elbow
2left ear base12left front knee
3right ear base13right front knee
4nose14left back knee
5throat15right back knee
6tail base16left front paw
7withers17right front paw
8left front elbow18left back paw
9right front elbow19right back paw

Animal Pose Estimation Based on Contrastive Learning with Dynamic Conditional Prompts (15)

Table 3.Performance comparison in the AP-10K dataset.

Table 3.Performance comparison in the AP-10K dataset.

MethodBackbonePre-TrainingAP
/%
AP50
/%
AP75
/%
APM
/%
APL
/%
AR
%
SimpleBaselineResNet-50ImageNet70.594.276.652.271.074.0
SimpleBaselineResNet-101ImageNet70.594.377.250.971.074.0
Lite-HRNetLite-HRNet-1859.988.662.750.760.164.8
Lite-HRNetLite-HRNet-3061.289.965.448.561.565.9
CPMCPM60.289.763.145.660.564.3
MobileNetMobileNetV2mobilenet_v264.791.471.249.164.968.6
ViTPose-SViT-SMAE68.093.673.458.168.271.5
SHNHourglass69.493.676.453.969.872.8
ShufflenetShufflenetV1shufflenet_v158.188.161.041.358.862.5
ShufflenetShufflenetV2shufflenet_v260.589.666.945.760.864.7
CSPNeXtCSPNeXtcspnext-m72.994.979.958.273.276.3
HRNetHRNet-w32ImageNet72.795.578.855.673.175.9
HRNetHRNet-w48ImageNet73.295.379.657.473.576.3
CLAMPViT-BaseCLIP73.694.580.449.174.176.9
OURViT-BaseCLIP74.295.380.353.874.577.4

Animal Pose Estimation Based on Contrastive Learning with Dynamic Conditional Prompts (16)

Table 4.Performance comparison in the Animal Pose dataset.

Table 4.Performance comparison in the Animal Pose dataset.

MethodBackbonePre-TrainingAP/%AP50/%AP75/%APM/%APL/%AR%
SimpleBaselineResNet-50ImageNet69.693.777.064.670.973.9
SimpleBaselineResNet-101ImageNet68.793.776.667.169.772.7
Lite-HRNetLite-HRNet-1862.789.668.363.162.967.3
Lite-HRNetLite-HRNet-3062.789.569.565.962.367.3
SHNHourglass68.992.777.465.969.973.0
ShufflenetShufflenetV1shufflenet_v157.089.461.657.057.262.0
ShufflenetShufflenetV2shufflenet_v259.589.464.557.560.364.3
HRNetHRNet-w32ImageNet72.895.781.769.673.976.8
HRNetHRNet-w48ImageNet73.295.781.971.174.277.2
CLAMPViT-BaseCLIP74.095.783.069.875.178.0
OURViT-BaseCLIP74.595.884.071.275.478.7

Animal Pose Estimation Based on Contrastive Learning with Dynamic Conditional Prompts (17)

Table 5.Ablation experiments on the AP-10K dataset.

Table 5.Ablation experiments on the AP-10K dataset.

MethodAP/%AP50/%AP75/%APM/%APL/%AR%
Baseline73.694.979.945.574.176.6
Baseline+LS73.695.280.250.074.076.7
Baseline+LS+LQ73.795.080.152.774.277.0
OUR74.295.380.353.874.577.4

Animal Pose Estimation Based on Contrastive Learning with Dynamic Conditional Prompts (18)

Table 6.Text prompt ablation experiments in the AP-10K dataset.

Table 6.Text prompt ablation experiments in the AP-10K dataset.

MethodAP/%AP50/%AP75/%APM/%APL/%AR%
CLAMP (Baseline)73.694.580.449.174.176.9
Baseline+Tp73.995.281.948.674.477.0
Baseline+Pq74.194.781.052.074.577.0
OUR74.295.380.353.874.577.4

Animal Pose Estimation Based on Contrastive Learning with Dynamic Conditional Prompts (19)

Table 7.Impact of different q values on AP under the AP-10K dataset.

Table 7.Impact of different q values on AP under the AP-10K dataset.

q4681012
AP/%73.573.974.274.073.8

Disclaimer/Publisher’s Note: The statements, opinions and data contained in all publications are solely those of the individual author(s) and contributor(s) and not of MDPI and/or the editor(s). MDPI and/or the editor(s) disclaim responsibility for any injury to people or property resulting from any ideas, methods, instructions or products referred to in the content.


© 2024 by the authors. Licensee MDPI, Basel, Switzerland. This article is an open access article distributed under the terms and conditions of the Creative Commons Attribution (CC BY) license (https://creativecommons.org/licenses/by/4.0/).
Animal Pose Estimation Based on Contrastive Learning with Dynamic Conditional Prompts (2024)

References

Top Articles
Latest Posts
Article information

Author: Lidia Grady

Last Updated:

Views: 6079

Rating: 4.4 / 5 (65 voted)

Reviews: 88% of readers found this page helpful

Author information

Name: Lidia Grady

Birthday: 1992-01-22

Address: Suite 493 356 Dale Fall, New Wanda, RI 52485

Phone: +29914464387516

Job: Customer Engineer

Hobby: Cryptography, Writing, Dowsing, Stand-up comedy, Calligraphy, Web surfing, Ghost hunting

Introduction: My name is Lidia Grady, I am a thankful, fine, glamorous, lucky, lively, pleasant, shiny person who loves writing and wants to share my knowledge and understanding with you.