This protocol benchmarks six YOLO models for real-time cattle behavior detection to support welfare and farm management optimization.
Method Article
This protocol benchmarks six YOLO models for real-time cattle behavior detection to support welfare and farm management optimization.
Real-time and accurate cattle behavior detection is crucial for improving animal welfare and optimizing livestock management. To address this, this study comprehensively evaluates six community-developed lightweight YOLO (You Only Look Once) models-YOLOv8n, YOLOv9t, YOLOv10n, YOLOv11n, YOLOv12n, and YOLOv13n-for recognizing five key cattle behaviors (standing, lying, foraging, drinking, and rumination) using the custom CBVD-5 dataset. The dataset includes diverse lighting conditions and natural barn environments to reflect real-world monitoring scenarios. All models were assessed using standard object detection metrics (precision, recall, mAP@50, and mAP@50-95) and deployment-oriented indicators including inference time, frames per second (FPS), model size, and training duration to provide a balanced evaluation of accuracy and efficiency. YOLOv13n achieved the highest mAP@50-95 (0.712), while YOLOv11n reached the highest mAP@50 (0.967) and exhibited stable convergence with a good trade-off between detection accuracy and inference speed. YOLOv10n demonstrated the fastest inference speed (1.2 ms/frame, ~833 FPS), making it well-suited for latency-sensitive applications such as continuous barn surveillance. All models maintained compact sizes below 6 MB and real-time throughput exceeding ~300 FPS, confirming their practicality for edge deployment. The results establish a reproducible benchmarking framework for evaluating modern YOLO variants, offering insights into model selection for efficient, scalable, and welfare-oriented livestock monitoring systems.
The efficient monitoring of cattle behavior is essential in precision livestock farming, supporting welfare management, disease detection, and operational optimization. Non-invasive vision-based approaches are particularly promising due to their scalability and versatility. Standardized datasets such as CBVD-5 (Cow Behavior Video Dataset with 5 classes) offer diverse behavior annotations across varied lighting conditions, making them valuable benchmarks in this domain1. In most practical farm settings, cameras are fixed at a moderate height with relatively stable lighting, though occasional occlusion among cattle may affect detection performanc....
Access restricted. Please log in or start a trial to view this content.
1. Dataset preparation
NOTE: This study did not involve new animal experiments. All data were obtained from the publicly available CBVD-5 dataset, which was collected and released in compliance with institutional animal-care guidelines by its original authors. Therefore, no additional ethical approval was required for this work.
Access restricted. Please log in or start a trial to view this content.
This section presents the evaluation results of YOLOv8 through YOLOv13 models on the CBVD-5 dataset for multi-behavior cattle recognition. The analysis focuses on detection accuracy, training convergence, behavioral distribution, and deployment suitability in resource-limited environments. Dataset quality and class balance follow the splits described in the protocol (70/20/10), ensuring consistent representation of all five behaviors across training, validation, and test sets. Figure 1 shows.......
Access restricted. Please log in or start a trial to view this content.
The overall success of the proposed comparative framework depends critically on several protocol steps, including high-quality behavior annotation, diverse data augmentation, and stable convergence monitoring during training. These factors ensure that model performance differences reflect true architectural variation rather than data or training noise. This study systematically evaluated six lightweight YOLO variants (v8n to v13n) for multi-class cattle behavior detection using the CBVD-5 dataset. Among the models, YOLOv.......
Access restricted. Please log in or start a trial to view this content.
The authors declare that they have no competing interests.
This work was funded by a Universiti Sains Malaysia Bridging Grant, Project No: R501-LR-RND003-0000001342-0000.
....Access restricted. Please log in or start a trial to view this content.
| Name | Company | Catalog Number | Comments |
|---|---|---|---|
| Dahua DH-NVR2216-HDS3 Recorder | Dahua Technology | https://www.dahuasecurity.com/ | |
| Dahua DH-S3000C-16GT Gigabit Switch | Dahua Technology | https://www.dahuasecurity.com/ | |
| Dahua M/K Surveillance Camera (2.8 mm / 3.6 mm lens) | Dahua Technology | https://www.dahuasecurity.com/ | |
| Google Colab Pro | https://colab.research.google.com/ | ||
| Matplotlib | Matplotlib Community | https://matplotlib.org/ | |
| NVIDIA A100 GPU | NVIDIA | https://www.nvidia.com/en-us/data-center/a100/ | |
| NumPy | NumPy Community | https://numpy.org/ | |
| OpenCV | OpenCV.org | https://opencv.org/ | |
| Optuna (Hyperparameter Optimization) | Optuna.org | https://optuna.org/ | |
| Pandas | Pandas Community | https://pandas.pydata.org/ | |
| PyTorch (v2.0+) | PyTorch Foundation | https://pytorch.org/ | |
| Python (v3.10) | Python Software Foundation | https://www.python.org/ | |
| Roboflow TSL Dataset | Roboflow | https://roboflow.com/ | |
| Ubuntu 20.04 LTS | Canonical | https://ubuntu.com/ | |
| Visual Studio Code | Microsoft | https://code.visualstudio.com/ | |
| YOLOv13 | Ultralytics | https://github.com/ultralytics/YOLOv13 | |
| YOLOv9 | Ultralytics | https://github.com/ultralytics/YOLOv9 |
Access restricted. Please log in or start a trial to view this content.
Request permission to reuse the text or figures of this JoVE article
Request Permission