高级检索+

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

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

  • 摘要: 精准预测母猪分娩开始时间,对及时助产、降低难产风险、提高仔猪成活率至关重要。针对现有接触式传感器易引发应激,而视觉方法多为行为层面的阶段性预警、难以连续定量预测等问题,该研究提出一种基于热红外成像的母猪分娩开始时间预测模型(sow onset of farrowing prediction model, SOFP)。该模型由实例分割与时间序列预测两个阶段组成。首先,以YOLOv8n-seg为基础,适配热红外图像原始分辨率,降低骨干网络下采样倍率,构建双尺度预测头2Head与精简颈部网络Lean-Neck,并引入加权特征融合(weighted feature fusion, WFF)模块,形成轻量化实例分割模型WFF-YOLOv8;通过分割掩膜提取母猪头部、乳房与臀部温度,构建体温时间序列。随后,结合卷积特征提取、长期依赖建模与时序模式注意力,构建时间序列预测模型(time series prediction model, TSP),连续输出距分娩开始的剩余时间。试验结果表明,WFF-YOLOv8的mAP@0.5达98.6%,较原始YOLOv8n-seg提高2.7个百分点,精确率和召回率分别为96.3%和98.4%,参数量为2.08 M,模型大小为4.5 MB。TSP模型在4头测试母猪分娩前24~18、18~12、12~6和6~0 h各时段的平均绝对误差均值分别为569.63、508.64、61.04和3.54 min,最后6 h的均方根误差均值为4.91 min,预测效果随分娩临近而改善。该模型可从低分辨率热红外图像中提取母猪关键部位温度,并基于体温时间序列连续预测距分娩开始的剩余时间,为母猪分娩的非接触式监测与预警提供方法参考。

     

    Abstract: Accurate prediction of farrowing onset helps schedule supervision and assistance in commercial pig production. Sensors attached to sows may interfere with normal activity, while existing vision methods primarily provide behavioral alerts rather than continuous estimates of time remaining until farrowing. Low spatial resolution further complicates the separation of adjacent body regions and the extraction of their temperatures from thermal images. This study developed a sow onset of farrowing prediction (SOFP) model combining instance segmentation with time series prediction for noncontact monitoring. Thermal images were collected once per minute from 20 primiparous Large White sows on a commercial farm in Guangdong, China. After image deduplication, 50 images per sow were randomly selected from each of five consecutive 24 h intervals during the 120 h before farrowing. The resulting 5000 images were annotated for the head, udder, and rump and divided into training, validation, and test sets at a ratio of 7:2:1. The first stage used a lightweight instance segmentation model, weighted feature fusion YOLOv8 (WFF-YOLOv8), developed from YOLOv8n-seg. Its input resolution matched the original thermal images of 160 × 120 pixels, and the backbone downsampling factor was reduced from 32 to 8. A prediction head operating at two scales (2Head) and a simplified neck (Lean-Neck) reduced redundant branches. A weighted feature fusion (WFF) module assigned attention weights at individual spatial locations to integrate features from different network levels. Predicted masks were mapped to the corresponding temperature matrices to extract regional body surface temperatures. Temperature series spanning the 120 h before farrowing were resampled at 5 min intervals, yielding 1441 sampling points per sow. Principal component analysis reduced the regional temperature measurements to a univariate representation. Sliding windows containing 73 points, spanning 6 h, advanced by one sampling point, generating 27380 samples across the 20 sows. Each window was labeled with the time remaining from its final sampling point to farrowing onset, identified from visible-light video as the birth of the first piglet. The second stage used a time series prediction (TSP) model combining convolutional feature extraction, long short-term memory, and temporal pattern attention. Data from 16 sows were used for TSP training and fourfold cross-validation, while the remaining four sows were reserved for testing. Temperature analysis and prediction evaluation covered the final 96 h, comprising four complete 24 h intervals with sufficient historical input for every prediction. WFF-YOLOv8 achieved a mean average precision of 98.6% at an intersection over union threshold of 0.5, exceeding YOLOv8n-seg under its default configuration by 2.7 percentage points. The corresponding precision and recall were 96.3% and 98.4%, respectively. The model contained 2.08 million parameters and had a file size of 4.5 MB. Mean absolute errors for TSP, averaged across the four test sows, were 569.63 and 508.64 min at 24 to 18 and 18 to 12 h before farrowing, respectively. These errors decreased to 61.04 min at 12 to 6 h and 3.54 min during the final 6 h. The corresponding average root mean square error during the final 6 h was 4.91 min. Temperature trends in the test sows showed gradual warming followed by a faster increase, with individual differences in transition timing. Prediction errors declined around this transition, indicating a temporal association between warming patterns and improved predictions. SOFP combined automated temperature extraction with continuous prediction of time remaining until farrowing, with the greatest accuracy observed during the final 6 h. The model provides a method for noncontact farrowing monitoring, although larger cohorts and validation across different farms are needed to assess its suitability for practical deployment.

     

/

返回文章
返回