高级检索+

基于热红外成像的母猪分娩开始时间预测模型

Prediction model for the onset time of sow farrowing based on thermal infrared imaging

  • 摘要: 精准预测母猪分娩开始时间,对及时助产、降低难产风险、提高仔猪成活率至关重要。针对现有接触式传感器易引发应激,而视觉方法多为行为层面的阶段性预警、难以连续定量预测等问题,该研究提出一种基于热红外成像的母猪分娩开始时间预测模型(sow onset of farrowing prediction model,SOFP)。SOFP由两个阶段级联构成:第一阶段为轻量化实例分割模型,即加权特征融合YOLOv8(weighted feature fusion-YOLOv8,WFF-YOLOv8),该模型在YOLOv8-seg架构基础上,适配输入图像分辨率、降低下采样倍率,构建2Head与Lean-Neck轻量化结构,并引入加权特征融合(weighted feature fusion,WFF)模块,在轻量化的同时提升分割性能,进而利用分割掩膜映射提取关键部位温度以构建体温序列;第二阶段为时间序列预测模型(time series prediction model,TSP),由卷积特征提取(convolution-based extraction,CBE)、长期依赖建模(long-term dependency extraction,LDE)与时序模式注意力(temporal pattern attention,TPA)等模块组成,输出分娩开始时间的连续预测。测试结果表明,WFF-YOLOv8的mAP@0.5达98.6%,较原始YOLOv8n-seg提高2.7个百分点,精确率与召回率分别为96.3%与98.4%,参数量为2.08 M、模型大小为4.5 MB,兼顾精度与轻量化;TSP的预测精度随分娩临近显著提升,在分娩前24~18、18~12、12~6和6~0 h 4个时段,测试母猪的平均绝对误差均值分别为569.63、508.64、61.04和3.54 min。综上,SOFP实现了低分辨率热红外场景下母猪关键部位体温的可靠提取与高精度时序建模,为母猪分娩的非接触、连续监测与智能化预警提供了兼顾动物福利与边缘端部署潜力的技术路径。

     

    Abstract: Farrowing onset time in sows is essential for piglet survival in commercial pig production. Its accurate prediction can contribute to timely parturition supervision and dystocia prevention. Existing methods rely largely on contact or invasive sensors that compromise animal welfare. Whereas non-contact vision can provide only stage-level behavioral alarms rather than continuous, quantitative prediction of the onset time. It is required for reliable temperature extraction from the low-resolution thermal infrared images commonly available on farms. In this study, a non-contact and welfare-friendly framework was developed to extract body-surface temperature from low-resolution thermal infrared images and then predict the farrowing onset time of late-gestation sows. Thermal infrared images were acquired at one frame per minute from 20 primiparous Large White sows during late gestation on a commercial farm in Guangdong, China. 5 000 images with 144 000 frames were annotated for the head, udder, and rump. A two-stage cascaded model was proposed for the sow onset of farrowing prediction model (SOFP). Firstly, a lightweight instance segmentation network was constructed on You Only Look Once version 8, termed weighted feature fusion-YOLOv8 (WFF-YOLOv8). The input was matched to the native image resolution, where the backbone downsampling ratio was reduced to prune redundant detections and neck branches. Feature concatenation was replaced with a weighted feature fusion module; Regional temperatures from the predicted masks were reduced into univariate series by principal component analysis (PCA). Secondly, a time-series prediction model was selected to output the continuous onset time from 6-hour windows. The model also incorporated convolutional extraction, long short-term memory (LSTM) networks, and a temporal pattern attention mechanism. Finally, 16 sows were used for four-fold cross-validation, where four were held out as an independent test set. The results showed that the WFF-YOLOv8 model achieved a mean Average Precision at an intersection-over-union threshold of 0.5 (mAP@0.5) of 98.6%, with a precision of 96.3% and a recall of 98.4%, thereby exceeding the YOLOv8n-seg baseline by 2.7 percentage points (95.9%). Only 2.08 million parameters were contained, occupying 4.5 MB. Moreover, 2.6 ms per frame was required to outperform mainstream segmentation models—including the larger YOLOv8s-seg and YOLOv8m-seg, YOLOv9c-seg, YOLO11n-seg and YOLO12n-seg—while having the fewest parameters. Ablation experiments confirmed that the input-and-downsampling adaptation, the pruned 2Head and Lean-Neck structures, and the weighted feature fusion module each contributed to the accuracy gain and acted complementarily. Cohort analysis of the 20 sows revealed that there was a coherent thermal pattern: although individual baseline temperatures varied considerably (33.91–36.51 ℃), all sows maintained a plateau from 96 to 24 h before farrowing, after which the mean temperature rose by about 0.40 ℃ above each sow’s baseline within the final 24 h (95% confidence interval 0.26–0.55 ℃), while the net within-interval rise accelerated to roughly 1.28 ℃ (95% confidence interval 0.98–1.59 ℃), about three to ten times the increased in earlier intervals; Trend decomposition revealed that a two-phase, gentle-then-accelerated rise was found with moderate individual variation in the time of acceleration. On the independent test set, the time-series prediction model was markedly more accurate, as farrowing approached: the mean absolute error (MAE) was 569.63 and 508.64 min, respectively, in the 24-18 h and 18-12 h windows, fell to 61.04 min in the 12-6 h window, and reached only 3.54 min in the final 6 h, where the root mean square error (RMSE) was 4.91 min and the coefficient of determination was 0.99. This sharp accuracy gain coincided with the accelerated temperature rise, indicating the farrowing thermal variations. The SOFP was used to reliably extract key-part body temperature from low-resolution thermal infrared images. The correlation between temperature dynamics and farrowing was captured to accurately predict the onset time within 6 h before parturition. Therefore, the findings can provide a non-contact, welfare-friendly and readily deployable pathway for continuous farrowing monitoring and early warning in commercial pig production. Environmental and behavioral cues can be integrated to reduce farrowing risk for piglet survival and efficiency over parities, breeds, and farms.

     

/

返回文章
返回