高级检索+

基于背部特征的挤奶场景下奶牛识别方法

Cow recognition method in milking scene based on back features

  • 摘要: 针对奶牛养殖场挤奶场景下奶牛实时无接触身份识别需求,该研究提出一种基于背部特征的奶牛实时身份识别方法。首先在挤奶场景下采集奶牛背部视频数据,建立包含793张图片的目标检测数据集和包含3145头奶牛、52834张图片的身份识别数据集,构建YOLOv8-DW目标检测模型,检测奶牛背部。然后,训练对比HRNet、EfficientNet、ConvNeXt、Swin Transformer和Swin Transformer V2这5种骨干网络,选择最优网络提取奶牛背部特征,通过计算其与数据库中身份的相似度并与入库验证阈值对比,得到单帧识别结果。最后,设计多帧识别方法,通过对单帧识别结果进行融合得到奶牛身份。YOLOv8-DW目标检测模型平均精度均值达99.3%,处理速度达169.49帧/s;最优网络HRNet在测试集中实现了99.76%的排序结果平均精度均值和120.12帧/s的处理速度;在对不同挤奶日期奶牛的识别中,多帧识别下已入库奶牛的识别率达97.7%,未入库奶牛识别率达94.0%。该研究结果可为挤奶场景下奶牛的识别提供参考。

     

    Abstract: Accurate recognition of dairy cow identity serves as the cornerstone for intelligent farming systems, particularly in milking scenarios where precise and rapid identification significantly enhances management efficiency while ensuring animal welfare. Traditional recognition techniques, such as branding and ear tagging, have been shown to potentially cause harm to the animals and negatively impact their well-being, and have consequently been gradually phased out with the advancement of technological developments. Although Radio Frequency Identification (RFID) technology remains widely adopted, limitations persist regarding device fragility and animal discomfort. In contrast, contactless recognition technology based on computer vision proved to have advantages such as low cost and high efficiency, making them more suitable for application in milking scene. To improve management efficiency and reduce operational costs, a real-time recognition method based on back features of dairy cows was proposed. This method involved capturing images of cows in milking scene using cameras to identify them, thereby reducing the probability of missed and false detections and avoiding harm to animal welfare. Videos of milking operations were collected, which were then decomposed into images, resulting in an object detection dataset containing 793 annotated images. Lightweight architectural improvements to YOLOv8 resulted in the YOLOv8-DW network. Comparative performance evaluations against multiple YOLOv8 variants confirmed the superiority of YOLOv8-DW in target detection and image extraction. The YOLOv8-DW model achieved remarkable results, with a precision of 98.9%, a recall of 96.4%, and a mean average precision of 99.3%, outperforming the different versions of the YOLOv8 network. The implementation of the YOLOv8-DW model in the NVIDIA GeForce RTX 3090 24 GB GPU environment demonstrated its exceptional efficiency, reaching a detection rate of 169.49 frames per second. This significant improvement in inference speed can be attributed to the lightweight nature of the YOLOv8-DW network, which maintains high accuracy while substantially reducing the computational complexity compared to the original YOLOv8 model. Milking video analysis using YOLOv8-DW facilitated the creation of an identity recognition dataset containing 3145 unique cow identities across 52834 images. This dataset was used to train and compare five backbone networks: HRNet, EfficientNet, ConvNeXt, Swin Transformer, and Swin Transformer V2. Five backbone networks underwent comprehensive evaluation through three testing protocols: standard test sets, temporally varied milking videos, and a specialized dataset of 79 solid black back cows. After careful analysis, HRNet network was selected as the most suitable model for the application. The HRNet network demonstrated exceptional performance in extracting the distinctive back features of the target cows and calculating the cosine similarity between the target cows and the cows in the database. On the test set, the HRNet model achieved a mean average precision of 99.76% and Rank@1 accuracy of 100%, while maintaining an impressive image processing speed of 120.12 frames per second. Kernel density estimation established recognition thresholds through analysis of similarity score distributions between correct and incorrect identifications. Multi-frame detection combined with weighted voting based on this threshold achieved final recognition rates of 97.7% for registered cows and 94.0% for unregistered cows. This method achieved real-time identity recognition of dairy cows in milking scenarios, significantly improving management efficiency and reducing farming costs, while maximizing the protection of animal welfare. This provides important technical support for the intelligent farming of dairy cows.

     

/

返回文章
返回