CAMLLA-YOLOv8n: Cow Behavior Recognition Based on Improved YOLOv8n
- PMID: 39457963
- PMCID: PMC11505530
- DOI: 10.3390/ani14203033
CAMLLA-YOLOv8n: Cow Behavior Recognition Based on Improved YOLOv8n
Abstract
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.
Keywords: CAMLLA-YOLOv8n; Holstein cows; YOLOv8n; attention mechanism; cow behavior recognition.
Conflict of interest statement
The authors declare no conflicts of interest.
Figures






















Similar articles
-
SMEA-YOLOv8n: A Sheep Facial Expression Recognition Method Based on an Improved YOLOv8n Model.Animals (Basel). 2024 Nov 26;14(23):3415. doi: 10.3390/ani14233415. Animals (Basel). 2024. PMID: 39682380 Free PMC article.
-
Evaluating sowing uniformity in hybrid rice using image processing and the OEW-YOLOv8n network.Front Plant Sci. 2025 Feb 3;16:1473153. doi: 10.3389/fpls.2025.1473153. eCollection 2025. Front Plant Sci. 2025. PMID: 39963535 Free PMC article.
-
GFI-YOLOv8: Sika Deer Posture Recognition Target Detection Method Based on YOLOv8.Animals (Basel). 2024 Sep 11;14(18):2640. doi: 10.3390/ani14182640. Animals (Basel). 2024. PMID: 39335230 Free PMC article.
-
Dynamic Serpentine Convolution with Attention Mechanism Enhancement for Beef Cattle Behavior Recognition.Animals (Basel). 2024 Jan 31;14(3):466. doi: 10.3390/ani14030466. Animals (Basel). 2024. PMID: 38338110 Free PMC article.
-
Lightweight enhanced YOLOv8n underwater object detection network for low light environments.Sci Rep. 2024 Nov 13;14(1):27922. doi: 10.1038/s41598-024-79211-7. Sci Rep. 2024. PMID: 39537721 Free PMC article.
Cited by
-
Recognition of Foal Nursing Behavior Based on an Improved RT-DETR Model.Animals (Basel). 2025 Jan 24;15(3):340. doi: 10.3390/ani15030340. Animals (Basel). 2025. PMID: 39943111 Free PMC article.
References
-
- King M.T., De Vries T.J. Production Diseases in Farm Animals: Pathophysiology, Prophylaxis and Health Management. Springer; Berlin/Heidelberg, Germany: 2024. Associations of Behavior and Production Disease in Dairy Cattle; pp. 453–467.
-
- Schweinzer V., Gusterer E., Kanz P., Krieger S., Süss D., Lidauer L., Berger A., Kickinger F., Öhlschuster M., Auer W., et al. Comparison of behavioral patterns of dairy cows with natural estrus and induced ovulation detected by an ear-tag based accelerometer. Theriogenology. 2020;157:33–41. doi: 10.1016/j.theriogenology.2020.05.050. - DOI - PubMed
Grants and funding
LinkOut - more resources
Full Text Sources
Miscellaneous