高级检索+

基于改进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: In modern animal husbandry, the automated identification of periparturient behaviors in sheep plays a pivotal role in promptly detecting potential health risks and production abnormalities. This capability is crucial for safeguarding ovine welfare, reducing neonatal lamb mortality, and improving reproductive efficiency. However, accurate behavior recognition during the periparturient period presents significant challenges due to the high similarity of certain behavioral traits and environmental interferences, such as complex illumination variations and cluttered backgrounds in sheep farming environments.To address these challenges, this study proposes an advanced recognition method that integrates an enhanced YOLOv8n-Pose keypoint detection model with a backpropagation (BP) neural network. Specifically, to improve the precision of keypoint detection, an additional P2 detection layer was incorporated into the network architecture. This modification significantly strengthens the model’s ability to capture fine-grained, small-scale features, thereby enhancing its capability to accurately localize anatomical keypoints even in complex behavioral scenarios. The addition of this detection layer ensures a higher degree of spatial resolution, which is particularly advantageous in recognizing subtle movement variations in periparturient sheep.Furthermore, to mitigate feature representation challenges in dynamic environments, a Multi-scale Attention Block (MAB) module was introduced into the framework. By employing a dynamic weighting mechanism, this module enables the model to interactively learn and model both global and local spatial dependencies. Consequently, the model’s robustness and generalization performance are substantially improved, particularly under heterogeneous illumination conditions. The MAB module effectively prioritizes the most discriminative feature regions, reducing the impact of background noise and occlusions commonly observed in practical farming environments.Considering the practical deployment constraints associated with excessive model parameters, an L1-norm-based channel pruning strategy was systematically implemented. This approach effectively optimizes parameter compression and eliminates redundancy in the refined model, striking an optimal balance between computational efficiency and performance retention. By leveraging structured sparsity techniques, the pruning process maintains model integrity while significantly reducing computational overhead, making the system suitable for edge computing applications in real-time livestock monitoring scenarios.Building upon the improved model’s ability to accurately extract 12 keypoint coordinates, a multidimensional behavioral feature dataset was meticulously constructed. This dataset integrates five joint angle parameters, two pairs of keypoint relative distance metrics, and keypoint detection confidence scores, culminating in a comprehensive 32 dimensional feature vector set. These extracted feature representations were then utilized as input to a BP neural network for precise classification of periparturient behaviors. The BP neural network, trained using an adaptive learning strategy, effectively captures complex spatiotemporal dependencies among the extracted features, ensuring high classification accuracy.Extensive experimental evaluations were conducted on a self-developed dataset of periparturient sheep to rigorously assess the performance of the proposed method. The results demonstrated that the enhanced YOLOv8n-Pose model achieved a notable 4.6 percentage point increase in mean average precision (mAP50) and a 6.7 percentage point improvement in mAP50:95 for keypoint detection compared to the baseline architecture. Moreover, the BP neural network exhibited outstanding classification performance, attaining an F1-score of 95.7% in distinguishing critical periparturient behaviors. These empirical findings strongly validate the superior efficacy of keypoint-driven recognition methodologies in addressing the intricate challenges of periparturient behavior identification. Ultimately, this study establishes a robust technical framework for intelligent livestock management systems, paving the way for enhanced automation and precision monitoring in sheep farming.

     

/

返回文章
返回