Thermal Imaging-Based Detection of Sow and Piglet Behaviors Under Imbalanced Conditions in Commercial Farrowing Pens
Chia-Ying ChangMonitoring sow and piglet behaviors during farrowing is important for reducing piglet mortality and improving animal welfare in commercial swine production systems. However, accurate behavioral monitoring remains challenging because neonatal piglets are small, frequently occluded by the sow, and difficult to detect under low-light conditions, particularly for black-coated piglets during nighttime observation. In this study, thermal imaging combined with RGB imaging from a conventional visible-light video camera and deep learning-based object detection was applied for automated livestock monitoring under practical farrowing conditions. The dataset contained diverse sow postures and piglet-related activities acquired in a commercial farrowing-house environment. In addition, the dataset exhibited substantial class imbalance, with piglet-related behaviors representing only a small proportion of the total annotations. Three lightweight YOLO-based detection models were evaluated for livestock monitoring performance under commercial farm conditions. Results showed that lightweight detectors provided stable overall detection performance for general sow behavior monitoring, while anchor-free detection models demonstrated improved sensitivity for small piglet detection under highly imbalanced conditions. The findings demonstrate the feasibility of thermal imaging for continuous farrowing monitoring under variable lighting and occlusion conditions and highlight the importance of evaluating detection systems based on their ability to identify small neonatal targets relevant to practical farm management. This study provides useful insights for the development of automated precision livestock monitoring systems for commercial farrowing operations.