Social density detection for suckling piglets based on convolutional neural network combined with local outlier factor algorithm - Ding, Qi-an; Liu, Longshen; Lu, Mingzhou; Liu, Kang; Chen, Jia; Shen, Mingxia (Computers and electronics in agriculture, 2022)
•A local outlier factor algorithm detects social density of suckling piglets.•This method could quantify the spatial relationship among different piglets.•This method could detect cluster in the piglet group.•The proposed method could detect outlier piglets. Pigs and their lactating piglets are herd animals, and breeders usually observe their social distance to determine their physiological status, such as when they form clusters during cold stress, or whether there are outlier piglets with abnormal growth conditions. Instead, papers on automated detection of piglet social distance are rare. This paper proposed a novel method, the convolutional neural network combined with modified local outlier factor (CNN-LOF), to quantify the piglet social density, and detect piglets far from the herd (outlier piglets). The convolutional neural network (CNN) model named YOLOv5 was used to construct the piglet detector, and auto-mark piglets by detection box, which adopted boxes' center points instead of the piglets. The optimized local outlier factor (LOF) algorithm was employed to calculate the social density of the piglets, and the outlier piglets were based on outlier factors greater than 2. Besides, the social density of different periods was calculated, compared, and analyzed. According to the results, the accuracy of CNN-LOF for detecting outlier piglets was 97.7% for the 6,113 test images measured. The larger social density of a piglet indicates more other piglets around and higher probability of being in the center of the herd. CNN-LOF and manual detection have a similarity of more than 80% in a continuous period of 1 h. In summary, this study quantifies the social density of suckling piglets, which also intuitively reveals the distribution of piglets in different environments, and provides technical support for precision livestock farming.