Skip to main page content
U.S. flag

An official website of the United States government

Dot gov

The .gov means it’s official.
Federal government websites often end in .gov or .mil. Before sharing sensitive information, make sure you’re on a federal government site.

Https

The site is secure.
The https:// ensures that you are connecting to the official website and that any information you provide is encrypted and transmitted securely.

Access keys NCBI Homepage MyNCBI Homepage Main Content Main Navigation
. 2023 May 15;23(10):4752.
doi: 10.3390/s23104752.

Grazing Sheep Behaviour Recognition Based on Improved YOLOV5

Affiliations

Grazing Sheep Behaviour Recognition Based on Improved YOLOV5

Tianci Hu et al. Sensors (Basel). .

Abstract

Fundamental sheep behaviours, for instance, walking, standing, and lying, can be closely associated with their physiological health. However, monitoring sheep in grazing land is complex as limited range, varied weather, and diverse outdoor lighting conditions, with the need to accurately recognise sheep behaviour in free range situations, are critical problems that must be addressed. This study proposes an enhanced sheep behaviour recognition algorithm based on the You Only Look Once Version 5 (YOLOV5) model. The algorithm investigates the effect of different shooting methodologies on sheep behaviour recognition and the model's generalisation ability under different environmental conditions and, at the same time, provides an overview of the design for the real-time recognition system. The initial stage of the research involves the construction of sheep behaviour datasets using two shooting methods. Subsequently, the YOLOV5 model was executed, resulting in better performance on the corresponding datasets, with an average accuracy of over 90% for the three classifications. Next, cross-validation was employed to verify the model's generalisation ability, and the results indicated the handheld camera-trained model had better generalisation ability. Furthermore, the enhanced YOLOV5 model with the addition of an attention mechanism module before feature extraction results displayed a mAP@0.5 of 91.8% which represented an increase of 1.7%. Lastly, a cloud-based structure was proposed with the Real-Time Messaging Protocol (RTMP) to push the video stream for real-time behaviour recognition to apply the model in a practical situation. Conclusively, this study proposes an improved YOLOV5 algorithm for sheep behaviour recognition in pasture scenarios. The model can effectively detect sheep's daily behaviour for precision livestock management, promoting modern husbandry development.

Keywords: behaviour recognition; grazing sheep; improved YOLOV5; pasture.

PubMed Disclaimer

Conflict of interest statement

The authors declare no conflict of interest.

Figures

Figure 1
Figure 1
(a) Fixed cameras on both sides of the area. (b) The manual use of a motion camera for follow-along shooting.
Figure 2
Figure 2
(a) Standing behaviour. (b) Feeding behaviour. (c) Lying behaviour.
Figure 3
Figure 3
(a) Fixed camera pictures. (b) Handheld camera pictures.
Figure 4
Figure 4
Images under different lighting conditions throughout the day.
Figure 5
Figure 5
(a) Original image. (b) Image after flipping. (c) Image after panning. (d) Image after rotation. (e) Image after gamut change. (f) Mosaic data enhancement.
Figure 6
Figure 6
YOLOV5s network model structure diagram.
Figure 7
Figure 7
CBAM network structure diagram.
Figure 8
Figure 8
(a) Structure diagram of BiFPN in YOLOV5, where two features are fused, shown in purple, and three features are fused, shown in red. (b) Structure diagram of the feature fusion process, where w1, w2, and w3 are weights.
Figure 9
Figure 9
The network structure of the SKNet-sc module.
Figure 10
Figure 10
The improved network structure of the YOLOV5 model.
Figure 11
Figure 11
Sheep identification scene map.
Figure 12
Figure 12
Real-time system application scenario diagram.
Figure 13
Figure 13
Optimal model prediction results.

References

    1. Nasirahmadi A., Edwards S.A., Sturm B. Implementation of machine vision for detecting behaviour of cattle and pigs. Livest. Sci. 2017;202:25–38. doi: 10.1016/j.livsci.2017.05.014. - DOI
    1. Pedersen L.J. Advances in Pig Welfare. Woodhead Publishing; Sawston, UK: 2018. Overview of commercial pig production systems and their main welfare challenges; pp. 3–25.
    1. Matthews S.G., Miller A.L., Clapp J., Plötz T., Kyriazakis I. Early detection of health and welfare compromises through automated detection of behavioural changes in pigs. Vet. J. 2016;217:43–51. doi: 10.1016/j.tvjl.2016.09.005. - DOI - PMC - PubMed
    1. Yang A., Huang H., Zheng B., Li S., Gan H., Chen C., Yang X., Xue Y. An automatic recognition framework for sow daily behaviours based on motion and image analyses. Biosyst. Eng. 2020;192:56–71. doi: 10.1016/j.biosystemseng.2020.01.016. - DOI
    1. Jiang M., Rao Y., Zhang J., Shen Y. Automatic behavior recognition of group-housed goats using deep learning. Comput. Electron. Agric. 2020;177:105706. doi: 10.1016/j.compag.2020.105706. - DOI

LinkOut - more resources