Enhanced camera-based individual pig detection and tracking for smart pig farms

Qinghua Guo, Yue Sun (Corresponding author), Clémence Orsini, J. Elizabeth Bolhuis, Jakob de Vlieg, Piter Bijma, Peter H.N. de With

Research output: Contribution to journalArticleAcademicpeer-review

10 Citations (Scopus)
19 Downloads (Pure)


Negative social interactions are harmful for animal health and welfare. It is increasingly important to employ a continuous and effective monitoring system for detecting and tracking individual animals in large-scale farms. Such a system can provide timely alarms for farmers to intervene when damaging behavior occurs. Deep learning combined with camera-based monitoring is currently arising in agriculture. In this work, deep neural networks are employed to assist individual pig detection and tracking, which enables further analyzing behavior at the individual pig level. First, three state-of-the-art deep learning-based Multi-Object Tracking (MOT) methods are investigated, namely Joint Detection and Embedding (JDE), FairMOT, and YOLOv5s with DeepSORT. All models facilitate automated and continuous individual detection and tracking. Second, weighted-association algorithms are proposed for each MOT method, in order to optimize the object re-identification (re-ID), and improve the individual animal-tracking performance, especially for reducing the number of identity switches. The proposed weighted-association methods are evaluated on a large manually annotated pig dataset, and compared with the state-of-the-art methods. FairMOT with the proposed weighted association achieves the highest IDF1, the least number of identity switches, and the fastest execution rate. YOLOv5s with DeepSORT results in the highest MOTA and MOTP tracking metrics. These methods show high accuracy and robustness for individual pig tracking, and are promising candidates for continuous multi-object tracking for real use in commercial farms.

Original languageEnglish
Article number108009
Number of pages14
JournalComputers and Electronics in Agriculture
Publication statusPublished - Aug 2023


This work is supported by the Dutch NWO project IMAGEN [P18-19 Project 1] of the research program Perspectief. The Volmer facility in Germany was offered by Topigs Norsvin in Helvoirt, the Netherlands. The authors would like to thank all researchers and student assistants from Wageningen University & Research and Eindhoven University of Technology for assistance with the tracking ground-truth annotations.

FundersFunder number
Topigs Norsvin in Helvoirt
Nederlandse Organisatie voor Wetenschappelijk Onderzoek


    • Animal detection
    • Animal tracking
    • Camera-based detection and tracking
    • Multi-object tracking models


    Dive into the research topics of 'Enhanced camera-based individual pig detection and tracking for smart pig farms'. Together they form a unique fingerprint.

    Cite this