Jia Qingxiang, Yang Jucheng, Han Shujie, Du Zihan, Liu Jianzheng
College of Artificial Intelligence, Tianjin University of Science and Technology, Tianjin 300453, China.
Department of Electronics Engineering, Jeonbuk National University, Jeonju 54907, Republic of Korea.
Animals (Basel). 2024 Oct 19;14(20):3033. doi: 10.3390/ani14203033.
Cow behavior carries important health information. The timely and accurate detection of standing, grazing, lying, estrus, licking, fighting, and other behaviors is crucial for individual cow monitoring and understanding of their health status. In this study, a model called CAMLLA-YOLOv8n is proposed for Holstein cow behavior recognition. We use a hybrid data augmentation method to provide the model with rich Holstein cow behavior features and improve the YOLOV8n model to optimize the Holstein cow behavior detection results under challenging conditions. Specifically, we integrate the Coordinate Attention mechanism into the C2f module to form the C2f-CA module, which strengthens the expression of inter-channel feature information, enabling the model to more accurately identify and understand the spatial relationship between different Holstein cows' positions, thereby improving the sensitivity to key areas and the ability to filter background interference. Secondly, the MLLAttention mechanism is introduced in the P3, P4, and P5 layers of the Neck part of the model to better cope with the challenges of Holstein cow behavior recognition caused by large-scale changes. In addition, we also innovatively improve the SPPF module to form the SPPF-GPE module, which optimizes small target recognition by combining global average pooling and global maximum pooling processing and enhances the model's ability to capture the key parts of Holstein cow behavior in the environment. Given the limitations of traditional IoU loss in cow behavior detection, we replace CIoU loss with Shape-IoU loss, focusing on the shape and scale features of the Bounding Box, thereby improving the matching degree between the Prediction Box and the Ground Truth Box. In order to verify the effectiveness of the proposed CAMLLA-YOLOv8n algorithm, we conducted experiments on a self-constructed dataset containing 23,073 Holstein cow behavior instances. The experimental results show that, compared with models such as YOLOv3-tiny, YOLOv5n, YOLOv5s, YOLOv7-tiny, YOLOv8n, and YOLOv8s, the improved CAMLLA-YOLOv8n model achieved increases in Precision of 8.79%, 7.16%, 6.06%, 2.86%, 2.18%, and 2.69%, respectively, when detecting the states of Holstein cows grazing, standing, lying, licking, estrus, fighting, and empty bedding. Finally, although the Params and FLOPs of the CAMLLA-YOLOv8n model increased slightly compared with the YOLOv8n model, it achieved significant improvements of 2.18%, 1.62%, 1.84%, and 1.77% in the four key performance indicators of Precision, Recall, mAP@0.5, and mAP@0.5:0.95, respectively. This model, named CAMLLA-YOLOv8n, effectively meets the need for the accurate and rapid identification of Holstein cow behavior in actual agricultural environments. This research is significant for improving the economic benefits of farms and promoting the transformation of animal husbandry towards digitalization and intelligence.
奶牛行为携带重要的健康信息。及时、准确地检测站立、采食、躺卧、发情、舔舐、争斗等行为对于个体奶牛监测及其健康状况的了解至关重要。在本研究中,提出了一种名为CAMLLA-YOLOv8n的模型用于荷斯坦奶牛行为识别。我们使用一种混合数据增强方法为模型提供丰富的荷斯坦奶牛行为特征,并改进YOLOV8n模型以在具有挑战性的条件下优化荷斯坦奶牛行为检测结果。具体而言,我们将坐标注意力机制集成到C2f模块中形成C2f-CA模块,这增强了通道间特征信息的表达,使模型能够更准确地识别和理解不同荷斯坦奶牛位置之间的空间关系,从而提高对关键区域的敏感度以及过滤背景干扰的能力。其次,在模型颈部的P3、P4和P5层引入MLLAttention机制,以更好地应对由大规模变化引起的荷斯坦奶牛行为识别挑战。此外,我们还创新性地改进了SPPF模块形成SPPF-GPE模块,通过结合全局平均池化和全局最大池化处理来优化小目标识别,并增强模型在环境中捕捉荷斯坦奶牛行为关键部分的能力。鉴于传统IoU损失在奶牛行为检测中的局限性,我们用Shape-IoU损失取代CIoU损失,关注边界框的形状和尺度特征,从而提高预测框与真实框之间的匹配度。为了验证所提出的CAMLLA-YOLOv8n算法的有效性,我们在一个自建的包含23,073个荷斯坦奶牛行为实例的数据集上进行了实验。实验结果表明,与YOLOv3-tiny、YOLOv5n、YOLOv5s、YOLOv7-tiny、YOLOv8n和YOLOv8s等模型相比,改进后的CAMLLA-YOLOv8n模型在检测荷斯坦奶牛采食、站立、躺卧、舔舐、发情、争斗和空床位状态时,精度分别提高了8.79%、7.1%、6.06%、2.86%、2.18%和2.69%。最后,尽管CAMLLA-YOLOv8n模型的参数和浮点运算量与YOLOv8n模型相比略有增加,但在精度、召回率、mAP@0.5和mAP@0.5: 的四个关键性能指标上分别实现了2.18%、1.62%、1.84%和1.77%的显著提升。这个名为CAMLLA-YOLOv8n的模型有效地满足了实际农业环境中对荷斯坦奶牛行为进行准确快速识别的需求。本研究对于提高农场经济效益以及推动畜牧业向数字化和智能化转型具有重要意义。