Agriculture (Jul 2023)

IO-YOLOv5: Improved Pig Detection under Various Illuminations and Heavy Occlusion

  • Jiajun Lai,
  • Yun Liang,
  • Yingjie Kuang,
  • Zhannan Xie,
  • Hongyuan He,
  • Yuxin Zhuo,
  • Zekai Huang,
  • Shijie Zhu,
  • Zenghang Huang

DOI
https://doi.org/10.3390/agriculture13071349
Journal volume & issue
Vol. 13, no. 7
p. 1349

Abstract

Read online

Accurate detection and counting of live pigs are integral to scientific breeding and production in intelligent agriculture. However, existing pig counting methods are challenged by heavy occlusion and varying illumination conditions. To overcome these challenges, we proposed IO-YOLOv5 (Illumination-Occlusion YOLOv5), an improved network that expands on the YOLOv5 framework with three key contributions. Firstly, we introduced the Simple Attention Receptive Field Block (SARFB) module to expand the receptive field and give greater weight to important features at different levels. The Ghost Spatial Pyramid Pooling Fast Cross Stage Partial Connections (GSPPFC) module was also introduced to enhance model feature reuse and information flow. Secondly, we optimized the loss function by using Varifocal Loss to improve the model’s learning ability on high-quality and challenging samples. Thirdly, we proposed a public dataset consisting of 1270 images and 15,672 pig labels. Experiments demonstrated that IO-YOLOv5 achieved a mean average precision (mAP) of 90.8% and a precision of 86.4%, surpassing the baseline model by 2.2% and 3.7% respectively. By using a model ensemble and test time augmentation, we further improved the mAP to 92.6%, which is a 4% improvement over the baseline model. Extensive experiments showed that IO-YOLOv5 exhibits excellent performance in pig recognition, particularly under heavy occlusion and various illuminations. These results provide a strong foundation for pig recognition in complex breeding environments.

Keywords