Lightweight model-based sheep face recognition via face image recording channel

J Anim Sci. 2024 Jan 3:102:skae066. doi: 10.1093/jas/skae066.

Abstract

The accurate identification of individual sheep is a crucial prerequisite for establishing digital sheep farms and precision livestock farming. Currently, deep learning technology provides an efficient and non-contact method for sheep identity recognition. In particular, convolutional neural networks can be used to learn features of sheep faces to determine their corresponding identities. However, the existing sheep face recognition models face problems such as large model size, and high computational costs, making it difficult to meet the requirements of practical applications. In response to these issues, we introduce a lightweight sheep face recognition model called YOLOv7-Sheep Face Recognition (YOLOv7-SFR). Considering the labor-intensive nature associated with manually capturing sheep face images, we developed a face image recording channel to streamline the process and improve efficiency. This study collected facial images of 50 Small-tailed Han sheep through a recording channel. The experimental sheep ranged in age from 1 to 3 yr, with an average weight of 63.1 kg. Employing data augmentation methods further enhanced the original images, resulting in a total of 22,000 sheep face images. Ultimately, a sheep face dataset was established. To achieve lightweight improvement and improve the performance of the recognition model, a variety of improvement strategies were adopted. Specifically, we introduced the shuffle attention module into the backbone and fused the Dyhead module with the model's detection head. By combining multiple attention mechanisms, we improved the model's ability to learn target features. Additionally, the traditional convolutions in the backbone and neck were replaced with depthwise separable convolutions. Finally, leveraging knowledge distillation, we enhanced its performance further by employing You Only Look Once version 7 (YOLOv7) as the teacher model and YOLOv7-SFR as the student model. The training results indicate that our proposed approach achieved the best performance on the sheep face dataset, with a mean average precision@0.5 of 96.9%. The model size and average recognition time were 11.3 MB and 3.6 ms, respectively. Compared to YOLOv7-tiny, YOLOv7-SFR showed a 2.1% improvement in mean average precision@0.5, along with a 5.8% reduction in model size and a 42.9% reduction in average recognition time. The research results are expected to drive the practical applications of sheep face recognition technology.

Keywords: YOLOv7-tiny; deep learning; face image recording channel; lightweight recognition model; sheep face recognition.

Plain language summary

Accurate identification of individual sheep is a crucial prerequisite for establishing digital sheep farms and precision livestock farming. In this study, we developed a lightweight sheep face recognition model, YOLOv7-SFR. Utilizing a face image recording channel, we efficiently collected facial images from 50 experimental sheep, resulting in a comprehensive sheep face dataset. Training results demonstrated that YOLOv7-SFR surpassed state-of-the-art lightweight sheep face recognition models, achieving a mean average precision@0.5 of 96.9%. Notably, the model size and average recognition time of YOLOv7-SFR were merely 11.3 MB and 3.6 ms, respectively. In summary, YOLOv7-SFR strikes an optimal balance between performance, model size, and recognition speed, offering promising practical applications for sheep face recognition technology. This study employs deep learning for sheep face recognition tasks, ensuring the welfare of sheep in the realm of digital agriculture and automation practices.

MeSH terms

  • Agriculture
  • Animals
  • Facial Recognition*
  • Farms
  • Female
  • Labor, Obstetric*
  • Livestock
  • Pregnancy
  • Sheep