In experimental research, animal welfare should always be of the highest priority. Currently, physical in-person observations are the standard. This is time-consuming, and results are subjective. Video-based machine learning models for monitoring experimental pigs provide a continuous and objective observation method for animal misthriving detection. The aim of this study was to develop and validate a pig tracking technology, using video-based data in a machine learning model to analyze the posture and activity level of experimental pigs living in single-pig pens. A research prototype was created using a microcomputer and a ceiling-mounted camera for live recording based on the obtained images from the experimental facility, and a combined model was created based on the Ultralytics YOLOv8n for object detection trained on the obtained images. As a second step, the Lucas–Kanade sparse optical flow technique for movement detection was applied. The resulting model successfully classified whether individual pigs were lying, standing, or walking. The validation test showed an accuracy of 90.66%, precision of 90.91%, recall of 90.66%, and correlation coefficient of 84.53% compared with observed ground truth. In conclusion, the model demonstrates how machine learning can be used to monitor experimental animals to potentially improve animal welfare.
Monitoring experimental animals is essential for ethical, scientific, and financial reasons. Conventional observation methods are limited by subjectivity and time constraints. Camera-based monitoring combined with machine learning offers a promising solution for automating the monitoring process. This study aimed to validate and assess the performance of a machine learning model for analyzing drinking behavior in minipigs. A novel, vision-based monitoring system was developed and tested to detect drinking behavior in minipigs. The system, based on low-cost Raspberry Pi units, enabled on-site video analysis. A dataset of 5297 images was used to train a YOLOv11n object detection model to identify key features such as pig heads and water faucets. Drinking events were defined by the spatial proximity of these features within video frames. The multi-class object detection model achieved an accuracy of above 97%. Manual validation using human-annotated ground truth on 72 h of video yielded an overall accuracy of 99.7%, with a precision of 99.7%, recall of 99.2%, and F1-score of 99.5%. Drinking patterns for three pigs were analyzed using 216 h of video. The results revealed a bimodal drinking pattern and substantial inter-pig variability. A limitation to the study was chosen methods missing distinguishment between multiple pigs and the absence of quantification of water intake. This study demonstrates the feasibility of a low-cost, computer vision-based system for monitoring drinking behavior in individually housed experimental pigs, supporting earlier detection of illness.
In experimental research, animal welfare should always be of the highest priority. Currently, physical in-person observations are the standard. This is time consuming, and results are subjective. Video-based machine learning models to monitor experimental pigs provides a continuous and objective observation method for animal misthrive detection. The aim of this study was to develop and validate a pig tracking technology, using video-based data in a machine learning model to analyze posture and activity level of experimental pigs living in single-pig pens. A research prototype was created using a microcomputer and a ceiling mounted camera for live recording based on the obtained images from the experimental facility and a combined model was created based on the Ultralytics YOLOv8n for object detection trained on the obtained images. As a second step, the Lucas-Kanade sparse optical flow technique for movement detection was applied. The resulting model successfully classified whether individual pigs were laying, standing, or walking. The validation test showed an accuracy of 90.66%, precision of 90.91%, recall of 90.66%, and a correlation coefficient of 84.53% compared with observed ground truth. In conclusion, the model demonstrates how machine learning can be used to monitor experimental animals potentially to improve animal welfare.