<p>Pig health and welfare are garnering increasing attention, and the accurate monitoring of pain indicators has become a crucial tool for effective management and disease prevention. The Pig Grimace Scale (PGS) assesses pain by analyzing facial expressions in three key regions: the ears, eyes, and snout. However, existing pain classification models typically focus on features from only one of these regions, limiting their ability to fully meet the comprehensive assessment requirements of the PGS. To address this limitation, this study introduces a YOLOv8-SlimNeck (YOLOv8-SN) cascade Residual Multi-Head Attentional Feature Fusion Network (ResMHANet) model for pain perception in pigs. First, a lightweight One-shot Aggregation Strategy to Design the Efficient Cross Stage Partial Network Module (VoV-GSCSP) is integrated into the YOLOv8 architecture to form its Neck layer, enabling precise localization of the pig’s facial regions while effectively reducing the impact of background noise and irrelevant information on classification performance. Next, the ResMHANet model is developed to extract deep, pain-related features using a residual structure. The Multi-Head Module directs attention to multiple key facial regions, enhancing the model’s ability to focus on pain-related features in each area. The Attentional Feature Fusion (AFF) combines the deep features extracted from the residual structure with the multi-region features from the Multi-Head Module, further improving the model’s capacity to perceive and extract pain-related information from the pig’s face. On the self-constructed pig facial image dataset, the YOLOv8-SN model achieves a facial region recognition precision of 96.5% mAP@0.5:0.95 on the test set, representing improvements of 2.3, 0.5, and 2.2 percentage points compared to YOLOv5, YOLOv8, and YOLOv12, respectively. Meanwhile, the model’s Parameters and Floating Point Operations (FLOPs) are significantly reduced. The ResMHANet model achieves an F1-Score of 95.1% in the pain classification task, representing improvements of 2.0, 7.0, 2.6, and 20.0 percentage points over ResNet34, MobileNetV3, ShuffleNetV2, and MobileViT, respectively. The experimental results demonstrate that the proposed model aligns better with the PGS evaluation criteria and offers a reliable solution for non-contact pig pain recognition, thereby advancing the development of intelligent pig farming.</p>

错误:搜索内容不能为空,请输入英文关键词
错误:关键词超出字数限制,请精简
高级检索

Research on a Pig Pain Perception Model Based on YOLOv8-SN Cascade ResMHANet

  • Dengfei Jie,
  • Tianle Li,
  • Yang Wang,
  • Penghui Jiang,
  • Jincheng He,
  • Hengwei Shen,
  • Jiajun Li

摘要

Pig health and welfare are garnering increasing attention, and the accurate monitoring of pain indicators has become a crucial tool for effective management and disease prevention. The Pig Grimace Scale (PGS) assesses pain by analyzing facial expressions in three key regions: the ears, eyes, and snout. However, existing pain classification models typically focus on features from only one of these regions, limiting their ability to fully meet the comprehensive assessment requirements of the PGS. To address this limitation, this study introduces a YOLOv8-SlimNeck (YOLOv8-SN) cascade Residual Multi-Head Attentional Feature Fusion Network (ResMHANet) model for pain perception in pigs. First, a lightweight One-shot Aggregation Strategy to Design the Efficient Cross Stage Partial Network Module (VoV-GSCSP) is integrated into the YOLOv8 architecture to form its Neck layer, enabling precise localization of the pig’s facial regions while effectively reducing the impact of background noise and irrelevant information on classification performance. Next, the ResMHANet model is developed to extract deep, pain-related features using a residual structure. The Multi-Head Module directs attention to multiple key facial regions, enhancing the model’s ability to focus on pain-related features in each area. The Attentional Feature Fusion (AFF) combines the deep features extracted from the residual structure with the multi-region features from the Multi-Head Module, further improving the model’s capacity to perceive and extract pain-related information from the pig’s face. On the self-constructed pig facial image dataset, the YOLOv8-SN model achieves a facial region recognition precision of 96.5% mAP@0.5:0.95 on the test set, representing improvements of 2.3, 0.5, and 2.2 percentage points compared to YOLOv5, YOLOv8, and YOLOv12, respectively. Meanwhile, the model’s Parameters and Floating Point Operations (FLOPs) are significantly reduced. The ResMHANet model achieves an F1-Score of 95.1% in the pain classification task, representing improvements of 2.0, 7.0, 2.6, and 20.0 percentage points over ResNet34, MobileNetV3, ShuffleNetV2, and MobileViT, respectively. The experimental results demonstrate that the proposed model aligns better with the PGS evaluation criteria and offers a reliable solution for non-contact pig pain recognition, thereby advancing the development of intelligent pig farming.