The pig pose recognition method based on pig body semantic segmentation
Pose recognition in pigs faces several challenges in practical applications, primarily due to high annotation costs, the labor-intensive nature of annotation processes, and the difficulty of achieving accurate target detection in complex environments. To address these challenges, this paper proposes a novel pig pose recognition method based on the semantic segmentation of pig body parts. First, we introduce PR-SegFormer, a pig body semantic segmentation model designed for individual pigs in indoor environments. Building on the SegFormer network, we incorporate a Polarized Self-Attention (PSA) module to enhance pixel-level attention and improve the extraction of fine-grained features. Additionally, the model integrates an improved Reduced SE Atrous Spatial Pyramid Pooling (RSASPP) module, which aggregates multi-scale contextual information, further boosting segmentation performance. Training on a self-constructed dataset, PR-SegFormer achieves a mean intersection over union (mIoU) of 81.93 % and a mean F1 score (mF1) of 88.82 %, outperforming the original SegFormer model by 3.75 and 2.59 percentage points, respectively. For pose recognition, we propose an enhanced YOLOv8-cls-MCM model. By replacing the baseline YOLOv8-cls with the more parameter-efficient MobileNetV3 backbone and incorporating a Coordinate Attention (CA) mechanism, the model enhances its ability to extract key local features while reducing the parameter count. Furthermore, the Mish activation function is introduced to improve training stability and accelerate convergence. Experimental results show that the proposed method achieves 93.16 % accuracy in pose recognition, even in complex backgrounds and close pig proximity, with an average precision of 93.7 % and recall of 92.95 %. Notably, the number of parameters is reduced by 40 % compared to the original YOLOv8-cls model. In conclusion, the proposed method, based on semantic segmentation of pig bodies and the improved YOLOv8-cls-MCM model, significantly advances the precision and efficiency of pig pose recognition. The experimental findings highlight that this method offers a promising solution for enhancing livestock management and animal health monitoring in intelligent farming applications.
Authors
- Yi Li (ORCID: https://orcid.org/0000-0002-7840-2611)
- Liang He (ORCID: https://orcid.org/0000-0002-0867-7185)
- Nien-Tsu Huang (ORCID: https://orcid.org/0009-0004-1676-968X)
- Deli Zhu (ORCID: https://orcid.org/0000-0003-2386-4533)
Institutions
- Chongqing Normal University (CN)
- Chongqing Academy of Animal Science (CN)
- Chongqing Academy of Agricultural Sciences (CN)
Publication Details
- Journal
- Smart Agricultural Technology
- Published
- 2025-08-10
- DOI
- https://doi.org/10.1016/j.atech.2025.101309
- Primary Topic
- Industrial Vision Systems and Defect Detection
- Type
- article
- Field-Weighted Citation Impact
- 0.00
Funders
- Chongqing Normal University
- Key Project of Application Development Plan of Chongqing City