Enterprise AI Analysis
Beyond Proximity: A Keypoint-Trajectory Framework for Classifying Affiliative and Agonistic Social Networks in Dairy Cattle
Precision livestock farming requires objective assessment of social behavior to support herd welfare monitoring, yet most existing approaches infer interactions using static proximity thresholds that cannot distinguish affiliative from agonistic behaviors in complex barn environments. This limitation constrains the interpretability and usefulness of automated social network analysis in commercial settings. In this study, we present a pose-based computational framework for interaction classification that moves beyond proximity heuristics by modeling the spatiotemporal geometry of anatomical keypoints. Rather than relying on pixel-level appearance or simple distance measures, the proposed method encodes interaction-specific motion signatures from keypoint trajectories, enabling differentiation of social interaction valence. The framework is implemented as an end-to-end computer vision pipeline integrating YOLOv11 for object detection (mAP@0.50: 96.24%), supervised individual identification (98.24% accuracy), ByteTrack for multi-object tracking (81.96% accuracy), ZebraPose for 27-point anatomical keypoint estimation, and a support vector machine classifier trained on pose-derived distance dynamics. On annotated interaction clips collected from a commercial dairy barn, the interaction classifier achieved 77.51% accuracy in distinguishing affiliative and agonistic behaviors using pose information alone. Comparative evaluation against a proximity-only baseline demonstrates that keypoint-trajectory features substantially improve behavioral discrimination, particularly for affiliative interactions. The results establish a proof-of-concept for automated, vision-based inference of social interactions suitable for constructing interaction-aware social networks. The modular architecture and low computational overhead support near-real-time processing on commodity hardware, providing a scalable methodological foundation for future precision livestock welfare monitoring systems.
Key Performance Metrics
This research delivers significant advancements in automated livestock monitoring, providing actionable insights for enhanced herd welfare and productivity.
Deep Analysis & Enterprise Applications
Select a topic to dive deeper, then explore the specific findings from the research, rebuilt as interactive, enterprise-focused modules.
Introduction
Understanding animal behavior is crucial for herd management and welfare. Traditional contact sensors are limited by cost, discomfort, and scalability. Computer vision, especially with advancements in machine learning and deep learning, offers a non-invasive solution. While individual animal behavior classification has seen significant progress, analyzing social interactions to construct behavioral social networks remains a critical gap. Current methods often rely on simple proximity thresholds, which cannot differentiate between affiliative (e.g., grooming) and agonistic (e.g., headbutting) interactions, limiting the understanding of herd dynamics and welfare.
Methodology
This study introduces an end-to-end computer vision pipeline for automated social network analysis in dairy cattle. It integrates five key components: (i) cow detection (YOLOv11), (ii) individual cow identification (YOLOv11-cls), (iii) continuous tracking (ByteTrack), (iv) anatomical keypoint detection (ZebraPose), and (v) interaction classification using temporal keypoint analysis via a Support Vector Machine (SVM). The system was trained on a custom dataset of video clips from a commercial dairy barn, annotated for three interaction categories: licking/grooming (affiliative), headbutting, and displacement (agonistic). The core innovation is to move beyond proximity heuristics by modeling interaction-specific motion signatures from keypoint trajectories.
Results
The interaction classifier achieved 77.51% overall accuracy in distinguishing affiliative and agonistic behaviors using pose information alone. Compared to a proximity-only baseline (61.23% accuracy), the keypoint-trajectory method showed a 16.28% improvement, significantly enhancing discrimination for affiliative interactions. Object detection (YOLOv11) achieved 96.24% mAP@0.50, individual identification 98.24% accuracy, and multi-object tracking (ByteTrack) 81.96% accuracy. The pipeline's total processing latency was 73 ms per frame on commodity hardware, making asynchronous monitoring feasible. Ablation studies confirmed the importance of temporal dynamics and rapid distance transitions for classification.
Discussions
This framework represents a significant methodological advance by inferring interaction valence directly from skeletal motion geometry, overcoming limitations of sensor-based and proximity-only systems. While the F1-score of 0.70 for interaction classification is promising, it reflects the inherent imbalance of natural behavioral datasets (agonistic events are rarer). Future work will explore Graph Neural Networks or Transformer-based models for improved F1-scores and reduced feature engineering. Addressing computational constraints for real-time edge deployment and improving keypoint robustness under occlusion are also priorities. The system’s modularity allows for domain adaptation and retraining for new herds and environments.
Conclusions
This study demonstrates a novel, vision-based framework that accurately classifies affiliative and agonistic social interactions in dairy cattle by analyzing keypoint trajectories, moving beyond traditional proximity heuristics. Achieving 77.51% accuracy (16% improvement over baseline) on commodity hardware, the end-to-end pipeline integrates robust detection, identification, tracking, and pose estimation. This scalable and objective platform for social network analysis bridges animal welfare science with computational innovation, enabling data-driven herd management and contributing to precision livestock farming.
Enterprise Process Flow
| Metric | Keypoint-Trajectory Method | Proximity-Only Baseline | Improvement |
|---|---|---|---|
| Overall Accuracy | 77.51% | 61.23% | +16.28% |
| Affiliative Precision | 0.78 | 0.32 | +146% |
| Agonistic Precision | 0.68 | 0.89 | * |
| Affiliative Recall | 0.82 | 0.95 | — |
| Agonistic Recall | 0.65 | 0.58 | +12% |
| F1-Score (Macro) | 0.71 | 0.54 | +32% |
*High proximity precision for agonistic due to clustering during conflict; poor precision for affiliative (many false positives from passive proximity).
Edge Computing Performance for Continuous Monitoring
The entire pipeline achieved an end-to-end processing latency of approximately 73 ms per frame on commodity hardware (Intel i7-9700 CPU, NVIDIA RTX 2060 GPU). This enables asynchronous monitoring at 13.7 frames per second, suitable for continuous footage analysis with a 4-5 minute delay. Crucially, the novel interaction classifier contributes only 4% of the total computational load, demonstrating its efficiency. This makes the system viable for deployment on existing farm infrastructure, overcoming the limitations of resource-intensive pixel-level deep learning methods.
Quantify Your AI Impact: ROI Calculator
Estimate the potential annual cost savings and efficiency gains your enterprise could achieve by integrating advanced AI solutions.
Your AI Implementation Roadmap
Our structured approach ensures a seamless integration of AI, maximizing your returns with minimal disruption.
Phase 1: Discovery & Strategy
In-depth analysis of your current operations, identification of AI opportunities, and development of a tailored strategy with clear objectives and success metrics. This includes initial data assessment and technology stack evaluation.
Phase 2: Pilot & Proof-of-Concept
Rapid prototyping and deployment of a small-scale AI solution to validate technical feasibility and demonstrate initial ROI. This phase focuses on a specific high-impact area with measurable outcomes.
Phase 3: Development & Integration
Full-scale development of the AI solution, including custom model training, system integration with existing infrastructure, and robust testing. Iterative refinement based on feedback ensures optimal performance.
Phase 4: Deployment & Optimization
Seamless rollout of the AI system across your enterprise, comprehensive training for your team, and continuous monitoring and optimization to ensure sustained performance and adaptation to evolving business needs.
Ready to Transform Your Enterprise with AI?
Book a complimentary strategy session with our AI experts to discuss how these insights can be applied to your unique business challenges.