Precision livestock monitoring of lactating sows: YOLOv8-based behavioral analysis under varying feeding strategies
Abstract
Feeding frequency and thermal environment are key factors influencing the behavior and welfare of lactating sows, as well as piglet access to milk. This study employed a deep learning-based computer vision approach using the YOLOv8l (You Only Look Once version 8 – large) model to automate multi-class behavior detection in lactating sows. Eight distinct behaviors were classified: feeding, not feeding, suckling, not suckling, lateral lying, sternal lying, standing, and sitting. The model achieved high performance (precision = 0.943, recall = 0.950, F1-score = 0.946, mAP@50 = 0.965). Three treatment groups were evaluated: Group 1 (feeding five times/day, air-conditioned), Group 2 (hourly feeding, air-conditioned), and Group 3 (hourly feeding, non-air-conditioned). Group 2 exhibited the highest suckling frequency (38.75; <italic>p</italic> = 0.035), feeding frequency (32.97; <italic>p</italic> < 0.001), and the shortest feeding interval (30.21 min; <italic>p</italic> < 0.001), suggesting enhanced interaction under frequent feeding with thermal control. Group 3 showed significantly higher lateral lying frequency (27.26; <italic>p</italic> < 0.001), consistent with thermoregulatory behavior in warmer environments. Postural dynamics also varied: sternal lying was highest in Group 2 (45.56; <italic>p</italic> < 0.001), while standing was more frequent in Group 2 (29.25; <italic>p</italic> < 0.001) but of shorter duration. These findings demonstrate that hourly feeding under air-conditioned conditions promotes more frequent feeding and suckling behaviors, while heat stress influences lying patterns. The YOLOv8l model proved to be a robust tool for automated behavior detection, supporting its applicability in precision livestock monitoring systems.















