Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

12Lemon123456/animal-pose-estimation

Open more actions menu

Repository files navigation

Animal Pose Estimation from Video

Overview

This project builds an end-to-end computer vision pipeline for animal pose estimation from video frames. Using the DigiDogs dataset, the workflow covers frame preprocessing, keypoint annotation parsing, deep learning model training, quantitative evaluation, and pose visualization.

The full training pipeline was developed and executed on Kaggle GPU notebooks. This repository is a portfolio version designed for recruiters and technical interviewers: it highlights methodology, experiment design, measurable results, and reproducibility without shipping large datasets or model weights.

Demo

33-keypoint pose visualization on a DigiDogs frame (numbered skeleton overlay):

33-keypoint pose visualization on a dog frame

Key Features

  • Video frame processing: TIFF/PNG ingestion, frame indexing, and annotation alignment
  • Animal keypoint detection: 33-keypoint regression from dog images
  • Dataset preprocessing: parsing 2DCoordinates.log, invalid-point filtering, train/val split
  • Deep learning training: PyTorch-based CNN baseline with GPU acceleration
  • Evaluation: PCK, MAE, RMSE, loss curves, per-keypoint error analysis
  • Visualization: keypoint overlays, prediction-vs-ground-truth plots, demo video frames
  • Multi-scenario experiments: motion augmentation, background change, scene diversity

Tech Stack

Category Tools
Language Python 3.10+
Deep Learning PyTorch
Computer Vision OpenCV
Data NumPy, Pandas
Visualization Matplotlib
Runtime Kaggle Notebook (GPU)

Dataset

DigiDogs Dataset — dog video sequences with per-frame 2D keypoint annotations (2DCoordinates.log).

Subset Batch Sequences Samples Purpose
Main training 08_30_2022 00003–00006 1,600 Primary model training
Motion augmentation 08_31_2022 00007–00009 600 Fast-motion robustness
Background change 09_01_2022 00011–00013 600 Complex-background stress test
Scene diversity 09_21–09_26 5 sequences 745 Cross-date generalization

Keypoint setup:

  • 33 valid keypoints used for training and evaluation
  • Raw log contains 41 fields (including invalid placeholders / auxiliary points)

The dataset is not included in this repository due to size and licensing constraints. See KAGGLE_NOTEBOOK.md for how to reproduce on Kaggle.

Methodology

  1. Frame extraction & conversion — TIFF images converted to PNG for stable GPU training
  2. Annotation parsing2DCoordinates.log parsed into structured JSON per frame
  3. Coordinate normalization — images resized to 128×128; keypoints mapped to model input space
  4. ModelSimplePoseCNN, a lightweight convolutional baseline for coordinate regression
  5. Loss — MSE between predicted and ground-truth keypoint coordinates
  6. Metrics — PCK@τ (percentage of correct keypoints), MAE, RMSE
  7. Post-processing — EMA temporal smoothing for trajectory stability (optional)

Training Pipeline

DigiDogs frames + annotations
    → Parse & filter keypoints (33 valid)
    → Train/val split (80/20)
    → SimplePoseCNN training (30 epochs, Adam, MSE)
    → Evaluate (PCK, MAE, RMSE)
    → Visualize predictions & export metrics

See docs/workflow.md for a detailed workflow diagram.

Results

Main training set (08_30_2022, 1,600 samples, 30 epochs):

Metric Value
Val Loss 0.000186
MAE 14.84 px
RMSE 19.84 px
PCK@20 0.758
PCK@50 0.972

Multi-scenario comparison (same model architecture):

Subset Samples Val Loss MAE (px) PCK@20
Main (08_30) 1,600 0.000186 14.84 0.758
Motion (08_31) 600 0.000276 17.04 0.754
Background (09_01) 600 0.000510 24.56 0.603
Scene diversity 745 0.000281 17.97 0.716

Exported metric files are in results/.

Model weights are not included due to file size limits.

Screenshots

File Description
screenshots/dataset-sample.png Dataset sequence statistics
screenshots/training-loss.png Train/validation loss curve
screenshots/validation-metrics.png PCK over training epochs
screenshots/pose-visualization.png Keypoint overlay on dog frame
screenshots/prediction-demo.png Prediction vs ground truth
screenshots/kaggle-notebook-output.png Kaggle notebook output summary

Kaggle notebook output — metrics and exported figures from the main training run:

Kaggle notebook output summary

See screenshots/README.md for the full list.

How to Reproduce on Kaggle

  1. Upload a DigiDogs subset as a Kaggle Dataset (TIFF/PNG frames + 2DCoordinates.log)
  2. Open one of the training notebooks (links in KAGGLE_NOTEBOOK.md)
  3. Enable GPU accelerator (Settings → Accelerator → GPU)
  4. Run all cells — outputs are saved under /kaggle/working/paper_results/
  5. Download figures and metrics from the notebook output panel

For local development, install dependencies from requirements.txt and adapt paths in scripts/.

My Contributions

  • Curated and organized DigiDogs subsets for four experimental scenarios
  • Built the data preprocessing pipeline (TIFF→PNG, log parsing, JSON export)
  • Implemented the PyTorch training and evaluation pipeline on Kaggle GPU
  • Designed experiments: main training, motion, background, and scene diversity
  • Produced quantitative metrics (PCK, MAE, RMSE) and visualization assets
  • Documented the end-to-end workflow for reproducibility

Future Improvements

  • Replace the CNN baseline with stronger architectures (HRNet, RTMPose, Transformer)
  • Add heatmap-based pose estimation for finer spatial localization
  • Integrate temporal models (TCN, Kalman filter, temporal Transformer) for video consistency
  • Expand evaluation with real-world dog videos beyond synthetic DigiDogs frames
  • Package inference as a lightweight API for demo deployment

License

This project is released under the MIT License.

About

Deep learning-based animal pose estimation from video using DigiDogs dataset (PyTorch, OpenCV, Kaggle GPU)

Topics

Resources

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages

Morty Proxy This is a proxified and sanitized view of the page, visit original site.