IDEAS home Printed from https://ideas.repec.org/a/gam/jagris/v14y2024i1p156-d1323354.html
   My bibliography  Save this article

Lightweight Pig Face Feature Learning Evaluation and Application Based on Attention Mechanism and Two-Stage Transfer Learning

Author

Listed:
  • Zhe Yin

    (College of Softwares, Shanxi Agricultural University, Jinzhong 030801, China)

  • Mingkang Peng

    (College of Softwares, Shanxi Agricultural University, Jinzhong 030801, China)

  • Zhaodong Guo

    (College of Softwares, Shanxi Agricultural University, Jinzhong 030801, China)

  • Yue Zhao

    (College of Softwares, Shanxi Agricultural University, Jinzhong 030801, China)

  • Yaoyu Li

    (College of Agricultural Engineering, Shanxi Agricultural University, Jinzhong 030801, China)

  • Wuping Zhang

    (College of Softwares, Shanxi Agricultural University, Jinzhong 030801, China)

  • Fuzhong Li

    (College of Softwares, Shanxi Agricultural University, Jinzhong 030801, China)

  • Xiaohong Guo

    (College of Animal Science, Shanxi Agricultural University, Jinzhong 030801, China)

Abstract

With the advancement of machine vision technology, pig face recognition has garnered significant attention as a key component in the establishment of precision breeding models. In order to explore non-contact individual pig recognition, this study proposes a lightweight pig face feature learning method based on attention mechanism and two-stage transfer learning. Using a combined approach of online and offline data augmentation, both the self-collected dataset from Shanxi Agricultural University's grazing station and public datasets underwent enhancements in terms of quantity and quality. YOLOv8 was employed for feature extraction and fusion of pig face images. The Coordinate Attention (CA) module was integrated into the YOLOv8 model to enhance the extraction of critical pig face features. Fine-tuning of the feature network was conducted to establish a pig face feature learning model based on two-stage transfer learning. The YOLOv8 model achieved a mean average precision ( mAP ) of 97.73% for pig face feature learning, surpassing lightweight models such as EfficientDet, SDD, YOLOv5, YOLOv7-tiny, and swin_transformer by 0.32, 1.23, 1.56, 0.43 and 0.14 percentage points, respectively. The YOLOv8-CA model’s mAP reached 98.03%, a 0.3 percentage point improvement from before its addition. Furthermore, the mAP of the two-stage transfer learning-based pig face feature learning model was 95.73%, exceeding the backbone network and pre-trained weight models by 10.92 and 3.13 percentage points, respectively. The lightweight pig face feature learning method, based on attention mechanism and two-stage transfer learning, effectively captures unique pig features. This approach serves as a valuable reference for achieving non-contact individual pig recognition in precision breeding.

Suggested Citation

  • Zhe Yin & Mingkang Peng & Zhaodong Guo & Yue Zhao & Yaoyu Li & Wuping Zhang & Fuzhong Li & Xiaohong Guo, 2024. "Lightweight Pig Face Feature Learning Evaluation and Application Based on Attention Mechanism and Two-Stage Transfer Learning," Agriculture, MDPI, vol. 14(1), pages 1-17, January.
  • Handle: RePEc:gam:jagris:v:14:y:2024:i:1:p:156-:d:1323354
    as

    Download full text from publisher

    File URL: https://www.mdpi.com/2077-0472/14/1/156/pdf
    Download Restriction: no

    File URL: https://www.mdpi.com/2077-0472/14/1/156/
    Download Restriction: no
    ---><---

    Corrections

    All material on this site has been provided by the respective publishers and authors. You can help correct errors and omissions. When requesting a correction, please mention this item's handle: RePEc:gam:jagris:v:14:y:2024:i:1:p:156-:d:1323354. See general information about how to correct material in RePEc.

    If you have authored this item and are not yet registered with RePEc, we encourage you to do it here. This allows to link your profile to this item. It also allows you to accept potential citations to this item that we are uncertain about.

    We have no bibliographic references for this item. You can help adding them by using this form .

    If you know of missing items citing this one, you can help us creating those links by adding the relevant references in the same way as above, for each refering item. If you are a registered author of this item, you may also want to check the "citations" tab in your RePEc Author Service profile, as there may be some citations waiting for confirmation.

    For technical questions regarding this item, or to correct its authors, title, abstract, bibliographic or download information, contact: MDPI Indexing Manager (email available below). General contact details of provider: https://www.mdpi.com .

    Please note that corrections may take a couple of weeks to filter through the various RePEc services.

    IDEAS is a RePEc service. RePEc uses bibliographic data supplied by the respective publishers.