EconPapers    
Economics at your fingertips  
 

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

Rong Wang, Ronghua Gao (), Qifeng Li and Jiabin Dong
Additional contact information
Rong Wang: Research Center of Information Technology, Beijing Academy of Agriculture and Forestry Sciences, Beijing 100097, China
Ronghua Gao: Research Center of Information Technology, Beijing Academy of Agriculture and Forestry Sciences, Beijing 100097, China
Qifeng Li: Research Center of Information Technology, Beijing Academy of Agriculture and Forestry Sciences, Beijing 100097, China
Jiabin Dong: Research Center of Information Technology, Beijing Academy of Agriculture and Forestry Sciences, Beijing 100097, China

Agriculture, 2023, vol. 13, issue 1, 1-17

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.

Keywords: pig face recognition; open-set recognition; ResNet; attention mechanism; metric learning (search for similar items in EconPapers)
JEL-codes: Q1 Q10 Q11 Q12 Q13 Q14 Q15 Q16 Q17 Q18 (search for similar items in EconPapers)
Date: 2023
References: View complete reference list from CitEc
Citations: View citations in EconPapers (2)

Downloads: (external link)
https://www.mdpi.com/2077-0472/13/1/144/pdf (application/pdf)
https://www.mdpi.com/2077-0472/13/1/144/ (text/html)

Related works:
This item may be available elsewhere in EconPapers: Search for items with the same title.

Export reference: BibTeX RIS (EndNote, ProCite, RefMan) HTML/Text

Persistent link: https://EconPapers.repec.org/RePEc:gam:jagris:v:13:y:2023:i:1:p:144-:d:1026625

Access Statistics for this article

Agriculture is currently edited by Ms. Leda Xuan

More articles in Agriculture from MDPI
Bibliographic data for series maintained by MDPI Indexing Manager ().

 
Page updated 2025-03-19
Handle: RePEc:gam:jagris:v:13:y:2023:i:1:p:144-:d:1026625