Research on Social Relationship of Piglets Based on YOLOv5
Accurately recognized the social relationship among piglets was important to understand the internal socialization of piglets and early warning signs of abnormal piglets.In response to the issues of high dependence on human intervention,high labor intensity and low observation efficiency in traditional piglet social relationship studied,this study proposed a research method of piglet social re-lationship based on the YOLOv5 model,utilized machine vision and deep learning technology.The study was conducted with nine Long White binary crossbred piglets reared in groups of 30 to 35 days of age,continuously collecting video data from a top-down perspec-tive.By conducting image capture and data augmentation,a dataset of 13 389 images was obtained.Firstly,four typical target detection algorithms,namely Faster R-CNN,SSD,YOLOv4 and YOLOv5,were selected to train the dataset,and the optimal model for individual piglet identification was determined through comparative analysis.Then,based on the K-means clustering algorithm to determine the social center of piglets,quantify the social value of piglets by calculating the Euclidean distance between the piglets and the social cen-ter,construct the social network of piglets by using the location information,drew the movement trajectory of piglets and obtained the i-dentification thresholds of socially normal and socially abnormal piglets.Finally,piglets were classified to identify piglets with abnormal social relationships using the threshold and enable early warning.The experimental results showed that YOLOv5 achieved an average precision-recall of 99.29%for individual piglet identification in group housing.The model size was 13.71 MB which could satisfy the re-quirements for piglet identification.Compared with YOLOv5,YOLOv4,SSD,and Faster R-CNN models,the improved YOLOv5 in-creased average precision-recall by 0.26%,1.97%,12.74%and 4.31%,respectively.It was found that there was a significant difference between the mean social values of abnormal and normal piglets.The mean social value range for abnormal piglets was[0.402-0.441],while the mean social value range for normal piglets was[0.259-0.351].Experimentally determined 0.4 as the optimal social discrimina-tion threshold.This study could provide methodological references for intelligent recognition of social behavior and early warning of ab-normalities in piglets.