Monitoring the lactation-related behaviors of sows and their piglets in farrowing crates using deep learning - Tsai, Yu-Jung; Huang, Yi-Che; Lin, En-Chung; Lai, Sheng-Chieh; Hong, Xu-Chu; Tsai, Jonas; Chiang, Cheng-En; Kuo, Yan-Fu (Frontiers in Animal Science, 2024)
Pig farming is a major sector of livestock production. The preweaning stage is a critical period in the pig farming process, where lactation-related behaviors between the sow and her piglets directly influence the preweaning survivability of piglets. Lactation-related behaviors are mutual interactions that require the combined monitoring of both the sow and her piglets. Conventional naked-eye observation is discontinuous and labor labor-intensive and may result in undetected abnormal behavior and economic losses. Thus, this study proposed to monitor the lactation-related behaviors of the sow and her piglets simultaneously using computer vision. Videos were recorded from farrowing crates using embedded systems equipped with regular RGB cameras. Sow posture recognition model (SPRM), comprising a EfficientNet and a long short-term memory network, was trained to identify seven postures of sows. Piglet localization and tracking model (PLTM), comprising a YOLOv7 and simple online and realtime tracking algorithm, was trained to localize and track piglets in the farrowing crate. The sow posture information was then combined with the piglet activity to detect unfed anomalous lactation-related behaviorspiglets. The trained SPRM and PLTM reached an accuracy of 91.36% and a multiple object tracking accuracy of 94.6%. The performance of the proposed unfed piglet detection achieved a precision of 98.4% and a recall of 90.7%. A long-term experiment was conducted to monitor lactation-related behaviors of sows and her piglets from the birth of the piglets to day 15. The overall mean daily percentages ± standard deviations (SDs) of sow postures were 6.8% ± 2.9% for feeding, 8.8% ± 6.6% for standing, 11.8% ± 4.5% for sitting, 20.6% ± 16.3% for recumbency, 14.1% ± 6.5% for lying, and 38.1% ± 7.5% for lactating. The overall mean daily percentages ± SDs of piglet activities were 38.1% ± 7.5% for suckling, 22.2% ± 5.4% for active, and 39.7% ± 10.5% for rest. The proposed approach provides a total solution for the automatic monitoring of sows and her piglets in the farrowing house. This automatic detection of abnormal lactation-related behaviors can help in preventing piglet preweaning mortality and therefore aid in pig farming efficiency.