高级检索+

基于改进YOLOv11n与融合DeepSORT多目标跟踪的鸡蛋计数方法

Egg counting method based on improved YOLOv11n and DeepSORT multi-object tracking

  • 摘要: 为解决蛋鸡养殖过程中人工计数成本高、效率低及误差大等问题,该研究提出一种基于改进YOLOv11n与DeepSORT多目标跟踪的鸡蛋计数方法。该方法涵盖3个主要模块:在检测部分,针对YOLOv11n在鸡蛋遮挡、粘连及异常蛋表型特征差异细微等复杂场景下检测性能不足的问题,提出改进模型YOLO-SR。该模型在骨干网络的通道并行空间注意力机制(cross-channel parallel spatial attention, C2PSA)中引入空间通道协同注意力机制(spatial and channel synergistic attention, SCSA)并在颈部网络引入与重参数化泛化特征金字塔网络(reparameterized generalized feature pyramid network, RepGFPN),以增强特征提取与多尺度融合能力,从而提升检测精度;在跟踪部分,为缓解鸡蛋因遮挡导致重识别过程中出现的ID跳变现象,采用DeepSORT跟踪算法,结合深度提取的表观特征与运动信息,有效维持目标ID的连续性;在计数部分,设计了撞线计数机制,以避免重复计数问题。结果表明,YOLO-SR检测器的平均精确度与F1分数分别达95.4%与89.0%,较原始YOLOv11n分别提升1.9与0.6个百分点;DeepSORT算法的高阶跟踪准确率、多目标跟踪准确率和ID调和平均数分别为93.6%、96.4%和98.2%,且DeepSORT算法的ID切换次数为0;整体系统对鸡蛋计数的平均计数精度为89.46%,较人工计数提升6.66个百分点,均方根误差为2.37。综上所述,该研究所提方法在鸡蛋实时跟踪与计数任务中表现出良好的应用潜力,可为正常/异常鸡蛋的自动化计数提供有效技术支撑,并为鸡蛋监测相关研究奠定基础。

     

    Abstract: To solve the problems of high labor costs, low efficiency, and large errors associated with manual egg counting in layer hen farming, this study proposes an innovative egg counting method based on an improved YOLOv11n model and the DeepSORT multi-object tracking algorithm. The proposed method is systematically organized into three main functional modules: detection, tracking, and counting.In the detection module, the original YOLOv11n model often suffers from insufficient detection performance under complex farming environments where eggs are frequently occluded, adhered to one another, or exhibit only subtle phenotypic differences between normal and abnormal eggs. To address these issues, an enhanced detection model named YOLO-SR is developed. Specifically, a spatial and channel synergistic attention (SCSA) mechanism is integrated into the C2PSA module of the backbone network. This attention mechanism adaptively recalibrates feature responses along both spatial and channel dimensions, allowing the network to focus on the most discriminative regions of eggs while suppressing irrelevant background information. Additionally, a reparameterized generalized feature pyramid network (RepGFPN) is introduced into the neck network of YOLOv11n. The RepGFPN improves multi-scale feature fusion by leveraging reparameterization techniques that enhance inference speed without sacrificing representation power. These two improvements collectively boost the model’s ability to extract fine-grained features and handle scale variations, leading to a significant increase in detection accuracy for both normal and abnormal eggs under challenging conditions.In the tracking module, to alleviate identity switching that frequently occur during re-identification when eggs are temporarily occluded, the DeepSORT tracking algorithm is employed. Unlike traditional tracking methods that rely solely on motion cues, DeepSORT integrates deep appearance features extracted from a pre-trained convolutional neural network with Kalman filter-based motion estimation. This combination enables robust association of egg detections across consecutive frames, effectively maintaining the continuity of target identities even under prolonged occlusions or rapid movements. The deep appearance feature extractor is fine-tuned on egg image data to ensure discriminative capability for individual eggs.In the counting module, a virtual line-crossing counting mechanism is designed to prevent duplicate counting. Specifically, a counting line is placed at a designated position in the video frame, and an egg is counted only once when its tracked centroid crosses this line from one side to the other. This mechanism works in conjunction with the tracking module to ensure that each egg is counted exactly once, eliminating both false positives and missed counts.Experimental results demonstrate the effectiveness of the proposed approach. The YOLO-SR detector achieves an average precision of 95.4% and an F1 score of 89.0%, which are 1.9 and 0.6 percentage points higher than those of the original YOLOv11n, respectively. The DeepSORT algorithm yields a higher-order tracking accuracy (HOTA) of 93.6%, a multi-object tracking accuracy (MOTA) of 96.4%, and an ID F1 score (IDF1) of 98.2%. Notably, the number of identity switches (IDS) is zero when using DeepSORT, highlighting its robustness in handling occlusions. The overall egg counting system achieves an average counting accuracy of 89.46%, which is 6.66 percentage points higher than that of manual counting, with a root mean square error (RMSE) of 2.37. In conclusion, the method proposed in this study exhibits excellent application potential for real-time egg tracking and counting tasks. It provides effective technical support for automated counting of both normal and abnormal eggs and lays a solid foundation for future research in egg health monitoring and smart poultry management.

     

/

返回文章
返回