With the practical promotion of the 14th Five-Year Plan,the animal husbandry industry has been moving toward intelligence.Therefore,the identification of abnormal behavior of cattle is an important research area of animal husbandry intelligence,which can help detect dangerous behavior and abnormal psychological problems of cattle in time,so as to effectively prevent losses caused by excessive behavior and improve production efficiency.There are many kinds of abnormal behaviors that cattle are prone to,and this paper focuses on two of them:frightened running and stillness.At present,the identification of abnormal behavior of cattle usually adopts the method of manual observation or wearing sensors,which requires high labor cost,time cost and economic cost,and the accuracy and efficiency are low.Therefore,the intelligent recognition method of cattle abnormal behavior has important application value.In this paper,we design and implement a machine vision-based cattle abnormal behavior recognition algorithm based on YOLOv5 target detection and ByteTrack target tracking algorithm using a self-established dataset for improvement.The main research contents of this paper are as follows:1.A bull class target detection algorithm based on improved YOLOv5 and integrated learning idea.In this paper,the network as a dedicated detection network for cattle class is constructed mainly based on the improved YOLOv5 and integrated learning idea.By building the dataset by itself and considering the diverse morphological characteristics of cattle in the picture,deformable convolution is introduced into the original network structure to improve the detection ability of the model for cattle targets.At the same time,an attention mechanism is introduced in the network to reduce the information overload problem,weaken the influence of irrelevant information on the model and assign higher weights to the cattle targets,which improves the computational efficiency and robustness of the model.Two attention mechanisms,ECA and SimAM,which are more suitable for bovine targets,are compared,and the more effective ECA module is selected for introduction into the network.Finally,better performance than the original network is obtained on the target detection algorithm based on YOLOv5 network.Secondly,based on the idea of integrated learning,the bovine targets in the dataset are cropped to obtain the training data of the classification model,and further train the lightweight ResNet-18 target classification network,and cascade the two models during detection to further improve the accuracy of the detection module for bovine targets.2.Abnormal behavior determination based on ByteTrack target tracking algorithm.This part mainly uses the accurate detection results of the first part to track the detected bovine targets using the more efficient ByteTrack algorithm.Firstly,the displacement of each bovine target in the pixel coordinate system within each second is normalized with respect to the average size of the bounding box,and secondly,the judgment of the two abnormal behaviors is achieved by the set time threshold and displacement threshold.Through the verification of the video in the Internet,better results of abnormal behavior recognition were obtained. |