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

Pig Face Recognition Based on Metric Learning by Combining a Residual Network and Attention Mechanism

Author

Listed:
  • Rong Wang

    (Research Center of Information Technology, Beijing Academy of Agriculture and Forestry Sciences, Beijing 100097, China
    College of Information Engineering, Northwest A&F University, Yangling, Xianyang 712100, China)

  • Ronghua Gao

    (Research Center of Information Technology, Beijing Academy of Agriculture and Forestry Sciences, Beijing 100097, China
    National Engineering Research Center for Information Technology in Agriculture, Beijing 100097, China)

  • Qifeng Li

    (Research Center of Information Technology, Beijing Academy of Agriculture and Forestry Sciences, Beijing 100097, China
    National Engineering Research Center for Information Technology in Agriculture, Beijing 100097, China)

  • Jiabin Dong

    (Research Center of Information Technology, Beijing Academy of Agriculture and Forestry Sciences, Beijing 100097, China
    National Engineering Research Center for Information Technology in Agriculture, Beijing 100097, China)

Abstract

As machine vision technology has advanced, pig face recognition has gained wide attention as an individual pig identification method. This study establishes an improved ResNAM network as a backbone network for pig face image feature extraction by combining an NAM (normalization-based attention module) attention mechanism and a ResNet model to probe non-contact open-set pig face recognition. Then, an open-set pig face recognition framework is designed by integrating three loss functions and two metrics to finish the task with no crossover of individuals in the training and test sets. The SphereFace loss function with the cosine distance as a metric and ResNAM are combined in the framework to obtain the optimal open-set pig face recognition model. To train our model, 37 pigs with a total of 12,993 images were randomly selected from the collected pig face images, and 9 pigs with a total of 3431 images were set as a test set. 900 pairs of positive sample pairs and 900 pairs of negative pairs were obtained from the images in the test set. A series of experimental results show that our accuracy reached 95.28%, which was 2.61% higher than that of a human face recognition model. NAM was more effective in improving the performance of the pig face recognition model than the mainstream BAM (bottleneck attention module) and CBAM (convolutional block attention module). The research results can provide technological support for non-contact open-set individual recognition for intelligent farming processes.

Suggested Citation

  • Rong Wang & Ronghua Gao & Qifeng Li & Jiabin Dong, 2023. "Pig Face Recognition Based on Metric Learning by Combining a Residual Network and Attention Mechanism," Agriculture, MDPI, vol. 13(1), pages 1-17, January.
  • Handle: RePEc:gam:jagris:v:13:y:2023:i:1:p:144-:d:1026625
    as

    Download full text from publisher

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

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

    Citations

    Citations are extracted by the CitEc Project, subscribe to its RSS feed for this item.
    as


    Cited by:

    1. Gang Liu & Hao Guo & Alexey Ruchay & Andrea Pezzuolo, 2023. "Recent Advancements in Precision Livestock Farming," Agriculture, MDPI, vol. 13(9), pages 1-3, August.
    2. Fang Wang & Xueliang Fu & Weijun Duan & Buyu Wang & Honghui Li, 2023. "Visual Detection of Lost Ear Tags in Breeding Pigs in a Production Environment Using the Enhanced Cascade Mask R-CNN," Agriculture, MDPI, vol. 13(10), pages 1-15, October.

    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:13:y:2023:i:1:p:144-:d:1026625. 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.