基于改进YOLOv8n-Pose的羊只围产期行为识别方法

    Sheep peripartum behavior recognition method based on improved YOLOv8n-pose

    • 摘要: 在现代畜牧业中,自动化识别羊只围产期行为能及时发现潜在的健康问题和生产异常,从而有效保障羊只健康、降低出生羊羔死亡率、提升繁殖效益。针对羊只围产期部分行为特征的高度相似以及羊只生产环境中存在复杂光照条件和背景干扰等问题,该研究提出了一种改进YOLOv8n-Pose关键点检测模型与BP神经网络相结合的羊只围产期行为识别方法。首先,为提升关键点检测的精度,新增P2检测层,显著增强模型对小尺度特征的捕获能力,为复杂行为的关键点定位提供更精细的支持。其次,针对复杂环境中的特征表达问题,引入多尺度注意力模块(multi-scale attention block, MAB),以动态权重机制强化模型对全局与局部特征的交互建模能力,提升在复杂光照环境下的稳健性和泛化性能。此外,考虑到模型参数量较大导致部署困难,采用基于L1范数的剪枝策略,对优化后的模型进行参数压缩与冗余移除,既有效降低了计算复杂度,又保证了高效性与模型性能的平衡。最后,基于改进模型精准提取12个关键点坐标信息后,结合5个关节角度、2对关键点相对位置以及关键点识别个数,构建包含32个行为特征向量的多维数据集,并将其作为输入传递至BP神经网络进行羊只围产期行为分类。试验结果表明,在自建羊只围产期数据集上,改进的YOLOv8n-Pose模型检测羊只关键点较原模型平均精度值mAP50提升4.6个百分点,mAP50:95提升6.7个百分点。BP神经网络对羊只围产期行为进行分类,其F1分数达到95.7%。研究结果验证基于关键点的识别方法在复杂的围产期行为识别中具有明显优势,为畜牧业智能化管理提供有效的技术支持。

       

      Abstract: An accurate and rapid identification of sheep periparturient behaviors can often be required to prevent the potential health risks and production abnormalities in modern animal husbandry. It is crucial to safeguard the ovine welfare for reproductive efficiency, thus reducing neonatal lamb mortality. However, some challenges still remain in the accurate recognition of the behavior during the periparturient period. Particularly, there is a high similarity between the behavioral traits and environmental interferences, such as the complex illumination and cluttered backgrounds in sheep farming. In this study, an advanced recognition was proposed to integrate an enhanced YOLOv8n-Pose key-point model with a backpropagation (BP) neural network. Specifically, an additional P2 detection layer was incorporated into the network architecture, in order to improve the precision of the key-point detection. The fine-grained and small-scale features were captured to accurately localize the anatomical key points in the complex behavioral scenarios. The detection layer was added for a higher degree of spatial resolution. Particularly, there were subtle movement variations in the periparturient sheep. Furthermore, a multi-scale attention block (MAB) module was introduced into the framework, in order to mitigate the feature representation in dynamic environments. A dynamic weighting module was employed to interactively learn the global and local spatial dependencies. Consequently, the robustness and generalization performance of the improved model was achieved under heterogeneous illumination. The MAB module effectively prioritized the most discriminative feature regions, thereby reducing the impact of the background noise and occlusions commonly observed in practical farming environments. The L1-norm channel pruning was systematically implemented to reduce the excessive parameters in the practical deployment constraints. The parameter compression was effectively optimized to eliminate the redundancy in the refined model. An optimal combination was achieved to balance computational efficiency and performance retention. The pruning was utilized to maintain the model integrity using structured sparsity, in order to significantly reduce the computational overhead. The real-time livestock monitoring was realized as suitable for edge computing. A multidimensional dataset of the behavioral feature was constructed to accurately extract the 12 key-point coordinates. Five joint angle parameters were integrated with two pairs of the key-point relative distance metrics, and the key-point detection confidence scores. The dataset was obtained with a 32-dimension feature vector. These feature representations were extracted to serve as the input into a BP neural network for the precise classification of the periparturient behaviors. The BP neural network was trained using adaptive learning. The complex spatiotemporal dependencies were effectively captured among the extracted features. The high classification accuracy was achieved after extraction. A series of experiments were conducted to evaluate the performance of the improved model on a self-developed dataset of periparturient sheep. The results demonstrated that the improved YOLOv8n-Pose model achieved a notable 4.6 percentage point increase in the mean average precision (mAP50) and a 6.7 percentage point improvement in mAP50:95 for the key-point detection, compared with the baseline architecture. Moreover, the BP neural network exhibited outstanding performance in the classification. An F1-score of 95.7% was obtained to distinguish the critical periparturient behaviors. The superior efficacy of the key-point recognition was obtained to identify the periparturient behavior. Ultimately, the robust technical framework greatly contributed to the intelligent livestock systems. Full automation and precision monitoring were enhanced in sheep farming.

       

    /

    返回文章
    返回