Shen Peng, Mei Keyu, Xue Haori, Li Tenglong, Zhang Guoqing, Zhao Yongxiang, Luo Wei, Mao Liang
North China Institute of Aerospace Engineering, School of Aeronautics and Astronautics, Langfang 065000, China.
North China Institute of Aerospace Engineering, School of Remote Sensing and Information Engineering, Langfang 065000, China.
Sensors (Basel). 2025 Apr 24;25(9):2680. doi: 10.3390/s25092680.
Pig counting is an essential activity in the administration of pig farming. Currently, manual counting is inefficient, costly, and unsuitable for systematic analysis. However, research on dynamic pig counting encounters challenges, including inadequate detection accuracy stemming from crowding, occlusion, deformation, and low-light conditions. Target tracking issues characterized by poor accuracy, frequent identity confusion, and false positive trajectories ultimately lead to diminished accuracy in the final counting outcomes. Given these existing limitations, this paper proposes an enhanced algorithm based on the YOLOv8n+Deep SORT model. The ELA attention mechanism, GSConv, and VoVGSCSP lightweight convolution modules are introduced in YOLOv8n, which improve detection accuracy and speed for pig target recognition. Additionally, Deep SORT is enhanced by integrating the DenseNet feature extraction network and CIoU matching algorithm, improving the accuracy and stability of target tracking. Experimental results indicate that the improved Deep SORT-P pig tracking algorithm attains MOTA and MOTP values of 89.2% and 90.4%, respectively, reflecting improvements of 4.2% and 1.7%, while IDSW is diminished by 25.5%. Finally, counting experiments were performed on videos of pigs traversing the farm passage using both the original and improved algorithms. The improved YOLOv8n-EGV+Deep SORT-P algorithm achieved a counting accuracy of 92.1%, reflecting a 17.5% improvement over the original algorithm. Meanwhile, the improved algorithm presented in this study successfully attained stable dynamic pig counting in practical environments, offering valuable data and references for research on dynamic pig counting.
猪只计数是养猪管理中的一项重要活动。目前,人工计数效率低下、成本高昂,且不适用于系统分析。然而,动态猪只计数的研究面临挑战,包括由于拥挤、遮挡、变形和低光照条件导致的检测精度不足。以精度差、频繁的身份混淆和误报轨迹为特征的目标跟踪问题最终导致最终计数结果的准确性降低。鉴于这些现有局限性,本文提出了一种基于YOLOv8n+Deep SORT模型的改进算法。在YOLOv8n中引入了ELA注意力机制、GSConv和VoVGSCSP轻量级卷积模块,提高了猪只目标识别的检测精度和速度。此外,通过集成DenseNet特征提取网络和CIoU匹配算法对Deep SORT进行了改进,提高了目标跟踪的准确性和稳定性。实验结果表明,改进后的Deep SORT-P猪只跟踪算法的MOTA和MOTP值分别达到了89.2%和90.4%,分别提高了4.2%和1.7%,而IDSW降低了25.5%。最后,使用原始算法和改进算法对猪只穿过农场通道的视频进行了计数实验。改进后的YOLOv8n-EGV+Deep SORT-P算法的计数准确率达到了92.1%,比原始算法提高了17.5%。同时,本研究提出的改进算法在实际环境中成功实现了稳定的动态猪只计数,为动态猪只计数研究提供了有价值的数据和参考。