Recognition of animal body parts via supervised learning

Betina Kreiman, Jaeson Jang, Lakshmi Narasimhan Govindarajan, T. SerreJournal of Emerging Investigators 2023

Abstract

The application of machine learning techniques has facilitated the automatic annotation of behavior in video sequences, offering a promising approach for ethological studies by reducing the manual effort required for annotating each video frame. Nevertheless, before solely relying on machine-generated annotations, it is essential to evaluate the accuracy of these annotations to ensure their reliability and applicability. The authors hypothesized that machine learning supervised with adequate human annotations would be able to accurately predict body parts from video sequences. A comparative analysis of the quality of annotations generated by humans and machines for the body parts of sheep during treadmill walking was conducted. Using the state-of-the-art pose-estimating library, DeepLabCut, the authors found that machine learning generated accurate predictions with errors comparable to those between human annotators. Furthermore, abnormal annotations caused by occlusions could be revised using Kalman Filtering to enhance robustness. These results suggest that conventional transfer learning methods can generate behavior annotations as accurate as those made by humans, presenting great potential for further research.

Introduction: The Bottleneck of Manual Annotation

In ethology and veterinary medicine, analyzing animal kinematics is vital for diagnosing injuries or evaluating recovery—particularly in spinal cord injury research where sheep serve as a primary model. However, the "gold standard" for this analysis has long been manual annotation: a researcher painstakingly clicking on body parts in every single video frame. This process is a massive bottleneck; annotating just one minute of video (at 20Hz) for six body parts takes a human roughly five hours. While machine learning (ML) tools like DeepLabCut offer a way to automate this, it is critical to determine if ML annotations are as reliable as those made by humans, especially during "occlusions" when a limb is hidden from view.

Methods and Experimental Design

The researchers employed DeepLabCut, a toolbox for markerless pose estimation that utilizes transfer learning with a ResNet-50 deep neural network. This allows the model to recognize body parts based on a relatively small set of human-labeled training images rather than requiring thousands of frames.

The experimental setup (a) shows the three camera angles used to capture the sheep on the treadmill. The workflow (b) illustrates the transition from human-labeled training data to the DeepLabCut model and subsequent computer annotation.

The study focused on a single female sheep (Ovis aries) walking on a treadmill, captured from three angles: left posterior, right posterior, and posterior. The workflow involved:

  1. Human Benchmarking: Two independent annotators labeled the same frames to establish an "inter-human error" baseline.
  2. Supervised Training: The model was trained on 150 frames (50 per camera angle) where six body parts were labeled: left/right foot, knee, and thigh.
  3. Temporal Smoothing: To combat errors during occlusions (e.g., when the treadmill frame blocks a leg), the team implemented Kalman Filtering. This mathematical approach predicts a body part's position based on its previous trajectory, effectively "filling in the blanks" when the model loses sight of a limb.

Key Results and Insights

Human-Level Accuracy

The study found that human annotators have an average discrepancy of approximately 21 pixels. On clear test frames, the distance between computer predictions and human labels was 15.3 ± 25.0 pixels. This indicates that the machine learning model achieved accuracy levels statistically comparable to the consistency between two human experts.

Overcoming Occlusions

The highest errors occurred in side-view recordings where the treadmill frame obstructed the sheep's legs. By using Kalman filtering to leverage time-series data, the researchers corrected "jumpy" or impossible annotations caused by these occlusions, reducing error by over 11% in difficult views.

Efficiency Gains

Once the model was trained (a process taking roughly 10 hours), it could annotate entire videos in seconds. This represents a massive leap in efficiency compared to the 5 hours of manual labor required for every minute of footage.

Conclusion and Future Directions

This research demonstrates that supervised machine learning can match human precision in behavioral tracking while drastically reducing the time required for data analysis. While the current study was limited to a single sheep, the success of the DeepLabCut and Kalman filter integration provides a robust framework for future ethological research. Future developments may include 3D pose estimation to provide a more complete kinematic profile and model ensembling to further reduce individual prediction errors.

Summary updated

BibTeX
@article{kreiman2023recognition,
  author = {Betina Kreiman and Jaeson Jang and Lakshmi Narasimhan Govindarajan and T. Serre},
  title = {{Recognition of animal body parts via supervised learning}},
  journal = {Journal of Emerging Investigators},
  year = {2023},
  doi = {10.59720/23-109},
}
Figure