Automated pig counting using deep learning

Mengxiao Tian, Hao Guo, Hong Chen, Qing Wang, Chengjiang Long, Yuhao Ma

Research output: Contribution to journalArticlepeer-review

125 Scopus citations

Abstract

Pig counting is one of the most critical topics in farming management and asset estimation. Due to its complexity, traditional agriculture method relies on manual counting, which is obviously inefficient and a waste of manpower. The challenging aspects like partial occlusion, overlapping and different perspectives even limit the usage of traditional computer vision techniques. In recent years, deep learning has become more and more popular for computer vision applications, because of its superior performance comparing to traditional methods. In this paper, we propose a deep learning solution to address the pig counting problem. We present a modified Counting Convolutional Neural Network (Counting CNN) model according to the structure of ResNeXt, and tune a series of experimental parameters. Our CNN model learns the mapping from the image feature to the density map, and obtains the total number of pigs in the entire image by integrating the density map. In order to validate the efficacy of our proposed method, we conduct experiments on a real-world dataset collected from actual piggery farming with 15 pigs in an image averagely. We achieve 1.67 Mean Absolute Error (MAE) per image and outperforms the competing algorithms, which strongly demonstrates that our proposed method can accurately estimate the number of pigs even if they are partially occluded in different perspectives. The detection speed, 42 ms per image, meets the requirements of agricultural application. We share our code and the first pig dataset we collected for pig counting at https://github.com/xixiareone/counting-pigs for livestock husbandry and science research community.

Original languageEnglish
Article number104840
JournalComputers and Electronics in Agriculture
Volume163
DOIs
StatePublished - Aug 2019
Externally publishedYes

Keywords

  • Automatic
  • Deep learning
  • Pigs counting

Fingerprint

Dive into the research topics of 'Automated pig counting using deep learning'. Together they form a unique fingerprint.

Cite this