| The movement state of sheep can reflect its health status and physiological stages.Automatic tracking of the sheep in the farm environment is a prerequisite for statistics and analysis of its movement state.With the development of deep learning,multiple object tracking has made great progress.However,there are still many problems in practical applications,such as the easy loss of tracking information when the objects are occluded by other objects,the multiple objects are blocked by each other,and the objects reappear out of the monitoring range.In order to solve these problems,this paper designed an improved YOLOv5-CBAM+StrongSORT multiple object tracking algorithm.The improved YOLOv5-CBAM algorithm was used to detect objects for sheep in video images in real time in the detector part of the multiple object tracking algorithm,and then the detection results were sent to the StrongSORT network to achieve the trajectory of multiple objects for sheep through data matching.In addition,corresponding software systems were developed.The main work of this article is as follows:Firstly,a sheep detection network that integrated attention mechanism and YOLOv5 was proposed.The CBAM attention mechanism was added to the original network structure of YOLOv5 to capture important features and their spatiotemporal correlations,so as to further improve the feature extraction ability of the network.CIOU Loss was used instead of GIOU Loss as the regression loss function of the object bounding box to accelerate the regression speed of the bounding box and improve the positioning accuracy.In addition,replacing the non-maximum suppression function from NMS to DIOU-NMS to reduce the chance of missed detection between occlusions.The experimental results showed that,in the detection of few objects,the detection precision,recall and mean average precision values of YOLOv5-CBAM reached 99.1%,99.4%and 92.7%,respectively.And in the detection of multiple objects,the values of these three evaluation indicators reached 93.0%,99.1%and 90.3%,respectively.Secondly,a deep learning method for multiple object tracking of sheep’s trajectory was designed.YOLOv5-CBAM was used as the front-end detector,and StrongSORT was used as the back-end tracker to realize the trajectory tracking of multiple objects for sheep.The experimental results showed that,in the short-duration video tracking,the multiple object tracking accuracy,multiple object tracking precision,the total number of identity switches,IDF1 score and the processing speed of 10 sheep reached 91.6%,0.269,52,70.7%and 26FPS,respectively.And in the long video tracking,the above evaluation indicators reached 57.3%,0.244,21,47.9%and 29FPS,respectively,and the tracking results were better than the commonly used algorithms such as YOLOv5+DeepSORT,YOLOv5+OCSORT and Y OLOv5+ByteTrack.Finally,based on YOLOv5-CBAM+StrongSORT,developed a software program for tracking the trajectory of sheep with Python. |