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

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% [email protected]: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.

Authors

Institutions

Publication Details

Journal
Acta Universitatis Sapientiae Informatica
Published
2025-10-21
DOI
https://doi.org/10.1007/s44427-025-00010-7
Primary Topic
Healthcare and Venom Research
Type
article
Field-Weighted Citation Impact
0.00
Controls
|||
ALL TIME
JAN
FEB
MAR
APR
MAY
JUN
JUL
AUG
SEP
OCT
article

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

Tianle Li, H. F. Shen, Jian He, Ping Jiang et al.
Acta Universitatis Sapientiae Informatica
Healthcare and Venom Research
article

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

Tianle Li, H. F. Shen, Jian He, Ping Jiang, Yang Wang, Jiajun Li
article en

Abstract

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% [email protected]: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.

Acta Universitatis Sapientiae InformaticaVol. 17(1)
Fujian Agriculture and Forestry University (CN)
Openalex Percentile: Top 66%
Healthcare and Venom Research
AI Navigator

Ask Laika to Summarize, Analyze, and Connect papers live on the map.

Summarize Papers & Methodologies

Extract key findings, datasets, and comparative methods across publications.

Benchmark Rankings & Visual Analytics

Rank top research institutions, authors, funders, topics, and journals by Field-Weighted Citation Impact (FWCI) and paper volume with instant charts.

Connect Distant Disciplines

Bridge topological clusters on the map to find hidden collaborative intersections.