A Computer Vision Pipeline for Individual-Level Behavior Analysis: Benchmarking on the Edinburgh Pig Dataset
Abstract
Abstract Animal behavior analysis is central to understanding welfare, health, and productivity in livestock, yet manual observation is time-consuming, subjective, and difficult to scale. We present a modular pipeline that integrates open-source, state-of-the-art computer vision models to automate individual-level behavior analysis in group-housing environments. The pipeline combines zero-shot object detection, motion-aware segmentation and tracking, and vision-transformer feature extraction for robust behavior recognition, addressing challenges such as occlusion and crowding in indoor pig monitoring. We validated the system on the Edinburgh Pig Behavior Video Dataset across detection, tracking, and behavior-classification tasks. A temporal model achieved 94.2% overall accuracy on nine behaviors, a 21.2 percentage-point improvement over the previous benchmark, while tracking reached 93.3% identity preservation (IDF1) and detection reached 89.3% average precision. The modular design lets individual components be replaced as methods advance and suggests potential for adaptation to other species and settings, although cross-species use would require further validation. By releasing an open-source, end-to-end implementation, this work provides a reproducible and scalable tool for automated, objective, and continuous behavior monitoring in precision livestock farming and welfare assessment.
Fields of Study & Subjects
Animal Behavior and Welfare Studies
Publication details
- Journal / source
- Research Square
- Publisher
- Springer Science and Business Media LLC
- Publication date
- 15 June 2026
- Language
- EN
- Document type
- Preprint