A Study on Multi-Scale Behavior Recognition of Dairy Cows in Complex Background Based on Improved YOLOv5
Zheying Zong,
Zeyu Ban,
Chunguang Wang,
Shuai Wang,
Wenbo Yuan,
Chunhui Zhang (),
Lide Su and
Ze Yuan
Additional contact information
Zheying Zong: College of Electromechanical Engineering, Inner Mongolia Agricultural University, Hohhot 010018, China
Zeyu Ban: College of Electromechanical Engineering, Inner Mongolia Agricultural University, Hohhot 010018, China
Chunguang Wang: College of Electromechanical Engineering, Inner Mongolia Agricultural University, Hohhot 010018, China
Shuai Wang: College of Electromechanical Engineering, Inner Mongolia Agricultural University, Hohhot 010018, China
Wenbo Yuan: College of Electromechanical Engineering, Inner Mongolia Agricultural University, Hohhot 010018, China
Chunhui Zhang: College of Electromechanical Engineering, Inner Mongolia Agricultural University, Hohhot 010018, China
Lide Su: College of Electromechanical Engineering, Inner Mongolia Agricultural University, Hohhot 010018, China
Ze Yuan: College of Electromechanical Engineering, Inner Mongolia Agricultural University, Hohhot 010018, China
Agriculture, 2025, vol. 15, issue 2, 1-20
Abstract:
The daily behaviors of dairy cows, including standing, drinking, eating, and lying down, are closely associated with their physical health. Efficient and accurate recognition of dairy cow behaviors is crucial for timely monitoring of their health status and enhancing the economic efficiency of farms. To address the challenges posed by complex scenarios and significant variations in target scales in dairy cow behavior recognition within group farming environments, this study proposes an enhanced recognition method based on YOLOv5. Four Shuffle Attention (SA) modules are integrated into the upsampling and downsampling processes of the YOLOv5 model’s neck network to enhance deep feature extraction of small-scale cow targets and focus on feature information, while maintaining network complexity and real-time performance. The C3 module of the model was enhanced by incorporating Deformable convolution (DCNv3), which improves the accuracy of cow behavior characteristic identification. Finally, the original detection head was replaced with a Dynamic Detection Head (DyHead) to improve the efficiency and accuracy of cow behavior detection across different scales in complex environments. An experimental dataset comprising complex backgrounds, multiple behavior categories, and multi-scale targets was constructed for comprehensive validation. The experimental results demonstrate that the improved YOLOv5 model achieved a mean Average Precision (mAP) of 97.7%, representing a 3.7% improvement over the original YOLOv5 model. Moreover, it outperformed comparison models, including YOLOv4, YOLOv3, and Faster R-CNN, in complex background scenarios, multi-scale behavior detection, and behavior type discrimination. Ablation experiments further validate the effectiveness of the SA, DCNv3, and DyHead modules. The research findings offer a valuable reference for real-time monitoring of cow behavior in complex environments throughout the day.
Keywords: dairy cow; behavior recognition; improved YOLOv5; Shuffle Attention; deformable convolution; Dynamic Detection Head (search for similar items in EconPapers)
JEL-codes: Q1 Q10 Q11 Q12 Q13 Q14 Q15 Q16 Q17 Q18 (search for similar items in EconPapers)
Date: 2025
References: View complete reference list from CitEc
Citations:
Downloads: (external link)
https://www.mdpi.com/2077-0472/15/2/213/pdf (application/pdf)
https://www.mdpi.com/2077-0472/15/2/213/ (text/html)
Related works:
This item may be available elsewhere in EconPapers: Search for items with the same title.
Export reference: BibTeX
RIS (EndNote, ProCite, RefMan)
HTML/Text
Persistent link: https://EconPapers.repec.org/RePEc:gam:jagris:v:15:y:2025:i:2:p:213-:d:1570602
Access Statistics for this article
Agriculture is currently edited by Ms. Leda Xuan
More articles in Agriculture from MDPI
Bibliographic data for series maintained by MDPI Indexing Manager ().