Research on the Vision-Based Dairy Cow Ear Tag Recognition Method

Tianhong Gao, Daoerji Fan, Huijuan Wu, Xiangzhong Chen, Shihao Song, Yuxin Sun, Jia Tian2024 · DOI

TL;DR

This paper introduces a novel vision-based system for automatically recognizing dairy cow ear tags, crucial for modern precision farming. By developing a lightweight object detection model (Small-YOLOV5s) and a robust text recognition pipeline (DBNet+CRNN), the authors achieve a high recognition accuracy of 92.1% while significantly reducing computational costs and model size.

What Problem Does This Paper Address?

Modern dairy farming is scaling up, necessitating more sophisticated management techniques. Individual cow identification is the cornerstone of precision farming, enabling tasks like health monitoring, loss tracking, and behavioral analysis. Traditional manual identification is labor-intensive and error-prone. Existing automatic methods often struggle with the challenges of real-world dairy farm environments: ear tags are small objects, often partially obscured by cow hair, railings, or other cows, and can have varied colors, handwritten or printed numbers, and distortions. This paper aims to provide a low-cost, accurate, and non-invasive solution for this critical identification problem.

Methods

The proposed method is a two-stage pipeline:

  1. Ear Tag Detection: The authors introduce Small-YOLOV5s, a modified version of the YOLOV5s object detection model. This lightweight architecture is specifically designed for detecting small objects like ear tags. Key modifications include reducing convolutional layers and incorporating Coordinate Attention (CA) to improve the model's focus on small targets and spatial information. This approach aims to enhance detection speed and accuracy while reducing model parameters compared to standard YOLOV5s.
  2. Ear Tag Number Recognition:
    • Number Region Localization: DBNet is employed for robust text detection. It uses a segmentation-based approach with learnable thresholds to accurately locate the regions containing the ear tag numbers, even with complex backgrounds and distortions.
  3. Number Recognition: A Convolutional Recurrent Neural Network (CRNN) is used for the final recognition of the numbers. This architecture combines convolutional layers for feature extraction, bidirectional Long Short-Term Memory (LSTM) layers for sequence modeling, and transcription layers with Connectionist Temporal Classification (CTC) for end-to-end recognition without explicit character-level segmentation. This allows it to handle multi-line text and variations in font styles.

Datasets

The study introduces two newly constructed, standardized experimental datasets:

  • CEID-D (Cow Ear Tag Detection Dataset): This dataset contains 2675 images specifically for training and evaluating the ear tag detection model. It captures diverse scenarios, including varying lighting, weather, angles, and cow poses.
  • CEGD-R (Cow Ear Tag Recognition Dataset): This dataset consists of 3238 cropped ear tag images, preprocessed and filtered for quality, used for training and evaluating the ear tag number recognition model.

Both datasets have been made freely available to the research community.

Key Insights and Ideas

  • Lightweight Detection for Small Objects: The success of Small-YOLOV5s highlights the effectiveness of tailoring object detection architectures for specific challenges like small object detection, leading to significant improvements in efficiency and performance.
  • End-to-End Recognition Pipeline: Combining DBNet for precise text localization with CRNN for robust sequence recognition offers a powerful pipeline that bypasses the need for complex pre-processing steps like character-level segmentation, simplifying the overall process and improving speed.
  • Importance of Coordinate Attention: The integration of Coordinate Attention in the detection model proved crucial for enhancing the model's ability to focus on and detect small ear tag objects, demonstrating its value in challenging detection scenarios.
  • Dataset Contribution: The creation and public release of standardized datasets are vital for advancing research in this domain, providing a common benchmark for future development.

Key Results

  • Ear Tag Detection: Small-YOLOV5s achieved a precision of 88.8%, recall of 90.0%, and [email protected] of 92.5%. It significantly reduced model parameters by 5,447,802 and improved prediction speed by 0.5 ms compared to YOLOV5s.
  • Ear Tag Number Recognition: The DBNet+CRNN pipeline achieved a final recognition accuracy of 92.1% with an average inference time of 0.62 ms per image.
  • Dataset Performance: The CEGD-R dataset, when processed with DBNet, showed better performance with grayscale images (Precision: 94.0%, Recall: 96.1%, F1_Score: 95.0%) compared to RGB images.

Limitations and Future Work

  • Dataset Limitations: The current datasets were collected using cell phones and high-resolution cameras at varying heights. Real-world barn cameras often have fixed angles and heights, which might affect model performance.
  • Small and Blurry Tags: Ear tags can appear small and blurry when cows are distant, posing a recognition challenge.
  • Occlusion and Overlap: Obstructed ear tags and overlapping tags from closely positioned cows are difficult to differentiate.
  • Two-Stage Approach: The current two-stage detection-then-recognition approach, while effective, can lead to a decrease in overall recognition speed.

Future work will focus on optimizing and refining the model for enhanced speed and generalization. The authors also plan to incorporate individual tracking mechanisms, video-based ear identification, and methods for identifying individual movements and behaviors to create a comprehensive system for real-time monitoring and health analysis of cows.

Summary updated

BibTeX
@misc{gao2024research,
  author = {Tianhong Gao and Daoerji Fan and Huijuan Wu and Xiangzhong Chen and Shihao Song and Yuxin Sun and Jia Tian},
  title = {{Research on the Vision-Based Dairy Cow Ear Tag Recognition Method}},
  year = {2024},
  doi = {10.3390/s24072194},
}
Figure