Scientia Agricultura Sinica ›› 2025, Vol. 58 ›› Issue (18): 3783-3798.doi: 10.3864/j.issn.0578-1752.2025.18.014

• ANIMAL SCIENCE·VETERINARY SCIENCE • Previous Articles    

Research on Sheep Mounting Behavior Recognition in Complex Scenes Based on an Improved YOLOv11

YAN ChuanBo1,6(), GONG Ping3, ZHENG WenXin1(), CHEN XinWen3,4, GUO LeiFeng2,5()   

  1. 1 College of Computer and Information Engineering, Xinjiang Agricultural University, Urumqi 830052
    2 Agricultural Information Institute, Chinese Academy of Agricultural Sciences, Beijing 100081
    3 Xinjiang Academy of Animal Husbandry Science, Xinjiang Uygur Autonomous Region, Urumqi 830052
    4 Xinjiang Key Laboratory of Intelligent Animal Husbandry, Urumqi, 830052
    5 Xinjiang Agricultural Informatization Engineering Technology Research Center, Urumqi 830052
    6 Engineering Research Center of Intelligent Agriculture, Ministry of Education, Urumqi 830052
  • Received:2025-03-18 Accepted:2025-06-22 Online:2025-09-18 Published:2025-09-18
  • Contact: ZHENG WenXin, GUO LeiFeng

Abstract:

【Objective】 Mounting behavior in sheep is a critical ethological indicator for identifying the estrus status of ewes, and plays an essential role in breeding management and estrus monitoring. Traditional manual observation methods suffer from subjectivity, low efficiency, and high omission rates, which limit their applicability in large-scale intelligent farming. To address the challenges of accurately recognizing mounting behavior in complex farm environments, such as dramatic illumination changes, severe occlusions, and dense sheep clusters, this study aimed to develop a high-precision and robust automatic recognition model to enable rapid detection and precise localization of mounting behavior, thereby supporting intelligent sheep reproduction management. 【Method】 Daily activity videos of 24 ewes were collected from the Jiaxiang Breeding Sheep Farm in Shandong Province between April 15 and May 15, 2024. A balanced dataset consisting of 4 700 annotated images (including both mounting and non-mounting samples) was constructed. Based on the YOLOv11 architecture, an improved detection model was proposed, named SIDS-YOLOv11, which incorporated four key modules: SCINet for low-light image enhancement, improving visual quality in dim conditions; iAFF for optimizing multi-scale semantic feature fusion; DySample for enhancing edge detail recovery via dynamic upsampling; and SEAM for improving target perception under occlusions using spatial attention. The training process employed the CIoU (Complete Intersection over Union) loss function for bounding box regression, combined with various data augmentation techniques to enhance model robustness and generalization. 【Result】 On the validation set, compared with the original YOLOv11 model, SIDS-YOLOv11 achieved a mAP@0.5 of 0.942, a Precision of 0.956, a Recall of 0.854, and a mAP@0.5-0.95 of 0.703—representing improvements of 3.5%, 4.7%, 1.7%, and 1.5%, respectively. Heatmap visualizations demonstrated that the improved model maintained accurate focus on target regions even in low-light and occluded scenarios. The attention regions of the enhanced model were more concentrated, background noise was reduced, and feature extraction capabilities were significantly improved, leading to enhanced recognition accuracy and localization stability. Compared with mainstream detection models, such as YOLOv8n, YOLOv6, Faster R-CNN, and SSD, SIDS-YOLOv11 achieved a better balance between detection accuracy and inference speed. Evaluation on low-light and heavily occluded videos further verified the model's superior performance, maintaining over 63% detection accuracy in complex scenarios, indicating strong applicability and adaptability. 【Conclusion】 The proposed SIDS-YOLOv11 model effectively integrated image enhancement, feature representation, and attention mechanisms, significantly improving the recognition accuracy of sheep mounting behavior in complex environments. The model maintained stable performance under challenging conditions, such as occlusion and low illumination, offering a high-performance visual recognition solution for estrus monitoring, behavior analysis, and breeding management in smart farming. The model held strong potential for practical deployment and large-scale application.

Key words: sheep mounting behavior, SIDS-YOLOv11, behavior detection, estrus monitoring, complex scenarios

Table 1

Description of Complex Scenes"

复杂场景Complex scenes 定义 Definition
遮挡 Occlusion 爬跨时羊只被其他羊只、围栏等部分覆盖,导致目标的部分关键特征无法被清晰观测或检测
When mounting, the sheep is partially covered by other sheep, fences, etc., resulting in some key features of the target being unable to be clearly observed or detected
重叠 Overlap 爬跨时母羊被公羊完全挡住,在画面中母羊不可见或只露出极小部分。从摄像头的角度来看,画面仅呈现出公羊的背部
When mounting, the ewe is completely blocked by the ram, and the ewe is either invisible or only a very small part is exposed in the image. From the camera's perspective, only the back of the ram is shown in the image
低光照 Low-light 爬跨时尽管摄像头具备夜间红外功能,夜间拍摄的图像为灰度图像,但由于红外光照射范围有限,爬跨发生的区域可能仍处于阴影或光照盲区,表现为黑色、低对比度或高噪声区域,导致局部亮度不足,从而影响行为识别的准确性
Although the camera has night - vision infrared function, the images taken at night are grayscale images. However, due to the limited range of infrared illumination, the area where mounting occurs may still be in shadow or a low - light area, appearing as black, low - contrast, or high - noise regions, resulting in insufficient local brightness, thus affecting the accuracy of behavior recognition

Fig. 1

Complex scene example image"

Fig. 2

Schematic diagram of camera deployment(a) and Surveillance footage(b)"

Fig. 3

Dataset construction flowchart"

Table 2

The impact of lighting conditions on YOLOv11 model performance"

精度 P 总检测帧数 Total detected frame 真正例帧数 True positive frame 时间 Time
YOLOv11 0.6100 12413 7572 12:00-14:00
0.4678 14606 6832 18:00-20:00

Fig. 4

SCINet architecture diagram"

Fig. 5

iAFF structure diagram"

Fig. 6

DySample architecture diagram"

Fig. 7

SEAM architecture diagram"

Fig. 8

SIDS-YOLOv11 network architecture diagram"

Table 3

Ablation study"

序号
Number
SCINet iAFF DySample SEAM 精度
P
召回率
R
平均精度MAP50 平均精度MAP50-95 帧率
FPS
计算量GFLOPs 参数量Parameter
0 0.909 0.837 0.907 0.688 950.26 6.3 2582347
1 + 0.917 0.862 0.935 0.699 909.09 7.4 2582605
2 + 0.915 0.871 0.938 0.701 999.36 6.3 2594699
3 + 0.925 0.878 0.942 0.702 927.09 6.5 2685835
4 + 0.907 0.860 0.924 0.704 714.29 6.5 2631251
5 + + 0.923 0.847 0.920 0.686 500.00 7.4 2594957
6 + + 0.933 0.847 0.920 0.681 500.00 7.5 2686093
7 + + 0.931 0.841 0.928 0.698 526.32 7.6 2631509
8 + + 0.911 0.875 0.933 0.691 769.23 6.5 2698187
9 + + 0.917 0.831 0.917 0.681 714.29 6.9 2687354
10 + + 0.944 0.861 0.941 0.690 833.33 6.7 2734739
11 + + + 0.947 0.854 0.937 0.703 526.32 7.6 2698445
12 + + + 0.922 0.827 0.910 0.676 454.55 7.6 2643861
13 + + + 0.931 0.841 0.928 0.698 454.55 7.3 2736851
14 + + + 0.947 0.843 0.939 0.699 625.00 6.7 2747091
15 + + + + 0.956 0.854 0.942 0.703 550.13 7.8 2747349

Fig. 9

SCINet low-light image processing results demonstration"

Fig. 10

SEAM occluded image processing results demonstration"

Fig. 11

Performance comparison curves of incrementally improved modules"

Fig. 12

Heatmap effect analysis: gradual optimization of model improvement modules"

Table 4

Comparative Experiment"

精度
P
召回率
R
平均精度
mAP50
平均精度mAP50-95 帧率
FPS
计算量
GFLOPs
参数量
Parameter
YOLOv11 0.909 0.837 0.907 0.688 950.26 6.3 2582347
YOLOv8n 0.900 0.863 0.937 0.697 833.33 9.2 3005843
YOLOv6 0.903 0.860 0.925 0.691 588.23 11.8 4233843
SSD 0.834 0.555 0.671 0.642 114.06 30.45 23745908
Faster R-CNN 0.447 0.716 0.621 0.607 16.12 472.42 28275328
SIDS-YOLOv11 0.956 0.854 0.942 0.703 550.13 7.8 2747349

Fig. 13

Recognition performance of different models"

Fig. 14

Variation curve of map@50 with training epochs for different models"

Fig. 15

Comparison of different object detection models for sheep behavior detection in complex scenarios"

Table 5

Performance evaluation of different models in mounting behavior detection task"

精度
P
总检测帧数
Total detected frame
真正例帧数
True positive frame
YOLOv11 0.4831 14721 7112
YOLOv8n 0.4697 13469 6327
YOLOv6 0.4580 11621 5323
SSD 0.0099 102644 1018
Faster R-CNN 0.0059 160250 949
SIDS-YOLOv11 0.6315 12271 7749
[1]
何东健, 刘冬, 赵凯旋. 精准畜牧业中动物信息智能感知与行为检测研究进展. 农业机械学报, 2016, 47(5): 231-244.
HE D J, LIU D, ZHAO K X. Review of perceiving animal information and behavior in precision livestock farming. Transactions of the Chinese Society for Agricultural Machinery, 2016, 47(5): 231-244. (in Chinese)
[2]
李富宽, 魏万红, 吕慎金, 杨燕. 关于羊发情行为影响因素的探析. 2015 年全国养羊生产与学术研讨会论文集, 2015.
LI F K, WEI W H, S J, YANG Y. An analysis of the factors influencing sheep estrus behavior. Proceedings of the 2015 National Sheep Production and Academic Seminar, 2015. (in Chinese)
[3]
王淑霞, 冯晓毅. 羊的发情鉴定技术. 黑龙江动物繁殖, 2010, 18(1): 31-32.
WANG S X, FENG X Y. Estrus identification technology of sheep. Heilongjiang Journal of Animal Reproduction, 2010, 18(1): 31-32. (in Chinese)
[4]
王晓东. 母羊的发情特征鉴定. 现代农业研究, 2016, 22(10): 37.
WANG X D. Identification of estrus characteristics of ewes. Modern Agriculture Research, 2016, 22(10): 37. (in Chinese)
[5]
朱芷芫, 王海峰, 李斌, 赵文文, 朱君, 贾楠, 赵宇亮. 深度学习在畜禽典型行为识别中的研究进展. 中国农业科技导报, 2024, 26(10): 110-124.
ZHU Z Y, WANG H F, LI B, ZHAO W W, ZHU J, JIA N, ZHAO Y L. Research progress of deep learning in typical behavior recognition of livestock and poultry. Journal of Agricultural Science and Technology, 2024, 26(10): 110-124. (in Chinese)
[6]
CHEN G P, LI C, GUO Y, SHU H, CAO Z, XU B B. Recognition of Cattle’s Feeding Behaviors Using Noseband Pressure Sensor With Machine Learning. 2022, 9: 822621.
[7]
张曦宇, 武佩, 宣传忠, 杨建宁, 刘艳秋, 郝敏. 基于加速度传感器的种公羊运动行为识别. 中国农业大学学报, 2018, 23(11): 104-114.
ZHANG X Y, WU P, XUAN C Z, YANG J N, LIU Y Q, HAO M. Recognition of the movement behavior of stud rams based on acceleration sensor. Journal of China Agricultural University, 2018, 23(11): 104-114. (in Chinese)
[8]
曹丽桃, 程曼, 袁洪波, 刘月琴, 随海燕, 赵晓霞. 可穿戴设备部署位置对羊只行为识别的影响与分析. 中国农机化学报, 2022, 43(12): 133-141.
CAO L T, CHENG M, YUAN H B, LIU Y Q, SUI H Y, ZHAO X X. Influence and analysis of deployment location of wearable devices on sheep behavior recognition. Journal of Chinese Agricultural Mechanization, 2022, 43(12): 133-141. (in Chinese)

doi: 10.13733/j.jcam.issn.20955553.2022.12.020
[9]
尹令, 刘财兴, 洪添胜, 周皓恩, Kae Hsiang Kwong. 基于无线传感器网络的奶牛行为特征监测系统设计. 农业工程学报, 2010, 26(3): 203-208, 388.
YIN L, LIU C X, HONG T S, ZHOU H E, KWONG K H. Design of system for monitoring dairy cattle’s behavioral features based on wireless sensor networks. Transactions of the Chinese Society of Agricultural Engineering, 2010, 26(3): 203-208, 388. (in Chinese)
[10]
王凯, 刘春红, 段青玲. 基于MFO-LSTM的母猪发情行为识别. 农业工程学报, 2020, 36(14): 211-219.
WANG K, LIU C H, DUAN Q L. Identification of sow Oestrus behavior based on MFO-LSTM. Transactions of the Chinese Society of Agricultural Engineering, 2020, 36(14): 211-219. (in Chinese)
[11]
何炜婷, 曾碧. 一种基于深度学习和SVM的动物姿态行为估计与心情识别方法. CN201910569930.1[2024-11-08].
HE W T, ZENG B. A Method for Animal Posture Behavior Estimation and Mood Recognition Based on Deep Learning and SVM. CN201910569930.1[2024-11-08]. (in Chinese)
[12]
GU J X, WANG Z H, KUEN J, MA L Y, SHAHROUDY A, SHUAI B, LIU T, WANG X X, WANG G, CAI J F, CHEN T. Recent advances in convolutional neural networks. Pattern Recognition, 2018, 77: 354-377.
[13]
李丹, 张凯锋, 李行健, 陈一飞, 李振波, 蒲东. 基于Mask R-CNN的猪只爬跨行为识别. 农业机械学报, 2019, 50(S1): 261-266, 275.
LI D, ZHANG K F, LI X J, CHEN Y F, LI Z B, PU D. Mounting behavior recognition for pigs based on mask R-CNN. Transactions of the Chinese Society for Agricultural Machinery, 2019, 50(S1): 261-266, 275. (in Chinese)
[14]
ROHAN A, RAFAQ M S, HASAN M J, ASGHAR F, BASHIR A K, DOTTORINI T. Application of deep learning for livestock behaviour recognition: A systematic literature review. Computers and Electronics in Agriculture, 2024, 224: 109115.
[15]
REN S. Faster r-cnn: Towards real-time object detection with region proposal networks. arXiv preprint arXiv:1506.01497, 2015.
[16]
BOCHKOVSKIY A, WANG C Y, LIAO H Y M. Yolov4: Optimal speed and accuracy of object detection. arXiv preprint arXiv: 2004.10934, 2020.
[17]
韩佳臻. 基于卷积神经网络的奶山羊行为识别方法研究[D]. 杨凌: 西北农林科技大学, 2019.
HAN J Z. Research on action recognition of dairy goat based on CNN[D]. Yangling: Northwest A & F University, 2019. (in Chinese)
[18]
HUANG G, LIU Z, VAN DER MAATEN L, WEINBERGER K Q. Densely connected convolutional networks. // 2017 IEEE Conference on Computer Vision and Pattern Recognition (CVPR). July 21-26, 2017. Honolulu, HI. IEEE, 2017: 2261-2269.[LinkOut]
[19]
谢忠红, 刘悦怡, 宋子阳, 徐焕良. 基于时序运动特征的奶牛爬跨行为识别研究. 南京农业大学学报, 2021, 44(1): 194-200.
XIE Z H, LIU Y Y, SONG Z Y, XU H L. Research on recognition of crawling behavior of cows based on temporal motion features. Journal of Nanjing Agricultural University, 2021, 44(1): 194-200. (in Chinese)
[20]
郝玉胜, 林强, 王维兰, 郭敏, 逯玉兰. 基于Wi-Fi无线感知技术的奶牛爬跨行为识别. 农业工程学报, 2020, 36(19): 168-176.
HAO Y S, LIN Q, WANG W L, GUO M, LU Y L. Recognition of crawling behavior of dairy cows using Wi-Fi wireless sensing technology. Transactions of the Chinese Society of Agricultural Engineering, 2020, 36(19): 168-176. (in Chinese)
[21]
WANG Z W, LIU J J, ARABLOUEI R, BISHOP-HURLEY G, MATTHEWS M, BORGES P. Multi-modal sensing for behaviour recognition. // Proceedings of the 28th Annual International Conference on Mobile Computing and Networking. Sydney NSW Australia. ACM, 2022: 900-902.
[22]
翟亚红, 王杰, 徐龙艳, 祝岚, 原红光, 赵逸凡. 基于改进YOLO v5n的舍养绵羊行为识别方法. 农业机械学报, 2024, 55(4): 231-240.
ZHAI Y H, WANG J, XU L Y, ZHU L, YUAN H G, ZHAO Y F. Behavior recognition of domesticated sheep based on improved YOLO v5n. Transactions of the Chinese Society for Agricultural Machinery, 2024, 55(4): 231-240. (in Chinese)
[23]
王少华. 基于视频分析和深度学习的奶牛爬跨行为检测方法研究[D]. 杨凌: 西北农林科技大学, 2021.
WANG S H. Research on cow mounting behavior detection method based on video analysis and deep learning[D]. Yangling: Northwest A & F University, 2021. (in Chinese)
[24]
王旺, 王福顺, 张伟进, 刘红达, 王晨, 王超, 何振学. 基于改进YOLO v8s的羊只行为识别方法. 农业机械学报, 2024, 55(7): 325-335, 344.
WANG W, WANG F S, ZHANG W J, LIU H D, WANG C, WANG C, HE Z X. Sheep behavior recognition method based on improved YOLO v8s. Transactions of the Chinese Society for Agricultural Machinery, 2024, 55(7): 325-335, 344. (in Chinese)
[25]
蒋畅江, 何旭颖, 向杰. LOL-YOLO: 融合多注意力机制的低照度目标检测. 计算机工程与应用, 2024, 60(24): 177-187.

doi: 10.3778/j.issn.1002-8331.2406-0424
JIANG C J, HE X Y, XIANG J. LOL-YOLO: low-light object detection incorporating multiple attention mechanisms. Computer Engineering and Applications, 2024, 60(24): 177-187. (in Chinese)
[26]
薛鸿翔, 沈明霞, 刘龙申, 陈金鑫, 单武鹏, 孙玉文. 基于改进YOLO v5s的经产母猪发情检测方法研究. 农业机械学报, 2023, 54(1): 263-270.
XUE H X, SHEN M X, LIU L S, CHEN J X, SHAN W P, SUN Y W. Estrus detection method of parturient sows based on improved YOLO v5s. Transactions of the Chinese Society for Agricultural Machinery, 2023, 54(1): 263-270. (in Chinese)
[27]
王政, 许兴时, 华志新, 尚钰莹, 段援朝, 宋怀波. 融合YOLO v5n与通道剪枝算法的轻量化奶牛发情行为识别. 农业工程学报, 2022, 38(23): 130-140.
WANG Z, XU X S, HUA Z X, SHANG Y Y, DUAN Y C, SONG H B. Lightweight recognition for the Oestrus behavior of dairy cows combining YOLO v5n and channel pruning. Transactions of the Chinese Society of Agricultural Engineering, 2022, 38(23): 130-140. (in Chinese)
[28]
秦箐, 刘志红, 赵存, 张崇妍, 代东亮, 孙炯清, 王志新, 李金泉. 机器视觉技术在畜牧业中的应用. 农业工程, 2021, 11(7): 27-33.
QIN Q, LIU Z H, ZHAO C, ZHANG C Y, DAI D L, SUN J Q, WANG Z X, LI J Q. Application of machine vision technology in livestock and poultry. Agricultural Engineering, 2021, 11(7): 27-33. (in Chinese)
[29]
KHANAM R, HUSSAIN M. YOLOv11: An Overview of the Key Architectural Enhancements. arXiv preprint arXiv:2410.17725, 2024.
[30]
MA L, MA T Y, LIU R S, FAN X, LUO Z X. Toward fast, flexible, and robust low-light image enhancement. // 2022 IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR). June 18-24, 2022. New Orleans, LA, USA. IEEE, 2022: 5627-5636.
[31]
LAND E H. The retinex theory of color vision. Scientific American, 1977, 237(6): 108-128.

pmid: 929159
[32]
DAI Y M, GIESEKE F, OEHMCKE S, WU Y Q, BARNARD K. Attentional feature fusion // 2021 IEEE Winter Conference on Applications of Computer Vision (WACV). January 3-8, 2021. Waikoloa, HI, USA. IEEE, 2021: 3559-3568.
[33]
LIU W Z, LU H, FU H T, CAO Z G. Learning to upsample by learning to sample. // 2023 IEEE/CVF International Conference on Computer Vision (ICCV). October 1-6, 2023. Paris, France. IEEE, 2023: 6004-6014.
[34]
YU Z P, HUANG H B, CHEN W J, SU Y X, LIU Y H, WANG X Y. YOLO-FaceV2: A scale and occlusion aware face detector. Pattern Recognition, 2024, 155: 110714.
No related articles found!
Viewed
Full text


Abstract

Cited

  Shared   
  Discussed   
No Suggested Reading articles found!