摘要
针对传统人工巡检猪只行为存在的效率低、漏检率高等问题,该研究提出改进的CSW-YOLOv8模型.首先,通过引入卷积与注意力融合模块CAFM,融合卷积的局部特征提取能力和注意力机制的全局信息聚焦能力,提升模型的特征表达和处理能力,有效提取不同猪只行为信息;其次,改进SPPFCSPC金字塔池化模块,利用多尺度池化层提升猪只行为与群体动态的检测效率;最后,采用动态WIOU损失函数,抑制了冗余特征对检测网络的影响,强化网络对猪只行为多尺度特征的获取能力.改进后模型的平均精度(mAP50)达94%,对站立、躺卧、进食行为的识别准确率均值分别为92.4%、97.5%、92.3%,较YOLOv8分别提升8.2%、0.7%、1.4%,该模型为养殖场智能监测与疾病预警提供技术支撑.
To address the inefficiencies and high omission rate associated with traditional manual in-spection of pig behaviors,this study proposes an improved CSW-YOLOv8 model.First,a Convolution and Attention Fusion Module(CAFM)is introduced to integrate the local feature extraction capabilities of con-volution layers with the global context modeling strength of attention mechanisms,thereby improving the model's feature representation and processing capacity for diverse pig behaviors.Second,the SPPFCSPC pyramid pooling module is optimized by incorporating multi-scale pooling layers,which enhances the de-tection efficiency of both individual behaviors and population dynamics.Finally,a dynamic WIOU loss function is employed to suppress the influence of redundant features on the detection network and enhance the network's ability to capture multi-scale features of pig behaviors.The improved model achieves an aver-age accuracy(mAP50)of 94%,with average recognition accuracies of 92.4%,97.5%and 92.3%for standing,lying,and feeding behaviors,respectively,representing improvements of 8.2%,0.7%and 1.4%over the baseline YOLOv8.These advancements provide technical support for intelligent monitoring and early disease warning in pig farming operations.