Abstract:With the industrialized application of livestock breeding digital intelligent monitoring technology, further enhancement of the classification of livestock and poultry breeding policy fine management has become a new demand for fine and efficient breeding management in modern livestock industry. Adopting fixed camera position and multi-angle video acquisition technology, the wandering behavior of sheep in the process of grazing in real time was recorded;a multi-target detection model of sheep was designed based on YOLO v5 model, and multi-target real-time tracking and identification of sheep in the process of wandering was realized in response to the complex situation that was prone to be blocked in the video of sheep wandering, and the identification rate of small and medium-sized sheep can reach 90.63%.Then the DeepSORT algorithm was adopted for sheep wandering multi-target trajectory tracking, through extracting the depth of sheep target epigenetic features, the sheep wandering trajectory graph and the sheep wandering variable tempo change data were obtained. The experimental results showed that the wandering behaviors of sheep were usually in three different combinations: slow walking, fast walking and sprinting, and the wandering behaviors of a single sheep were usually in random combinations that were not fixed. In medium to large-scale sheep flocks, due to the complexity of their kinship structure, the flocks often differentiated into multiple small groups, which made it exceptionally difficult to observe and analyze their behavior holistically. In order to overcome this difficulty, it was turned to a small-scale target flock, and the synchronization phenomenon was initially verified on the beat cycle of sheep wandering through the empirical analysis of the three wandering processes of sheep dispersal, aggregation and synchronization.