Center clustering network improves piglet counting under occlusion

Research output: Journal Publications and Reviews (RGC: 21, 22, 62)21_Publication in refereed journalpeer-review

16 Scopus Citations
View graph of relations


  • Haiming Gan
  • Maria Camila Ceballos
  • Thomas D. Parsons
  • Yueju Xue


Original languageEnglish
Article number106417
Journal / PublicationComputers and Electronics in Agriculture
Online published3 Sept 2021
Publication statusPublished - Oct 2021


Counting nursing piglets is an essential task on commercial sow farms and provides a core parameter for evaluating sow reproductive performance. As a current management practice, piglets in farrowing pens are usually manually counted by caretakers several times during and after parturition and at weaning, which is time-consuming, labor-intensive, and often subject to careless errors. In recent years, automated counting tools based on computer vision have drawn increasing attention from the pig industry. However, piglets frequently can be occluded by farrowing stalls or sows, either fully or partially, which results in substantial counting errors by existing automated methods. To address problems caused by the partial occlusion, a two-stage center clustering network (CClusnet) was developed to improve automated piglet counting performance. We constructed a dataset consisting of 2,600 images from three farrowing pens to test and validate the CClusnet. The images were under heavy occlusions with one sow (DNA Genetics Line 241) and 7–13 piglets per image, and 97.7% of images having one or more piglets partially occluded. In the first stage, the CClusnet predicted a semantic segmentation map and a center offset vector map for each image. In the second stage, scattered center points were produced by combining the two maps, and the mean-shift algorithm was applied to determine the piglet count. The results showed that CClusnet achieved 0.43 mean absolute error per image for piglet counting, had a better performance than previous network architectures, and outperformed existing counting methods. Furthermore, our technique is a nonocclusion-specific method and can be applied in other similar settings with different types of occlusions, and with potential to achieve high accuracy in animal position detection and monitoring.

Research Area(s)

  • Precision livestock farming, Deep learning, Computer vision, Pig industry, Object counting

Citation Format(s)

Center clustering network improves piglet counting under occlusion. / Huang, Endai; Mao, Axiu; Gan, Haiming et al.
In: Computers and Electronics in Agriculture, Vol. 189, 106417, 10.2021.

Research output: Journal Publications and Reviews (RGC: 21, 22, 62)21_Publication in refereed journalpeer-review