Cross temporal scale pig face recognition based on deep learning
Pig face recognition is a promising, non-invasive, and cost-effective method for monitoring pigs. However, rapid growth alters their appearance, challenging facial recognition. To address this, we build a cross-time-scale dataset with 33,434 images of 137 Bamaxiang pigs (26–76 days old). To validate the effectiveness of this dataset, we train and evaluat five CNN models on it. Specifically, ConvNeXt, ResNet, GoogLeNet, VGG, and MobileNet achieve accuracies of 98.6%, 97.2%, 96.6%, 93.9%, and 65%, respectively. Temporal scalability analysis show accuracy dropping from 97% to 69% as the training-test gap increased from 0 to 24 days. Besides, ResNet18 with a triplet loss function reaches 88.5% accuracy. While pig face recognition performs well, it remains highly sensitive to short-term facial changes, requiring future models to capture temporal features. • Our dataset uniquely tracks daily changes in indigenous pig faces over 49 days. • The temporal range shows a strong correlation with pig face recognition accuracy. • The ConvNeXt model achieves the highest accuracy of 98.6% in pig face recognition. Besides, temporal scalability analysis shows the accuracy dropping from 98.6% to 69% as the training-test gap increased from 0 to 24 days. • Random erasing data augmentation significantly enhances model performance. • Grad-CAM algorithm effectively demystifies model decision processes.
Authors
- Xinggang Wang (ORCID: https://orcid.org/0000-0001-6732-7823)
- Zihao Zhao (ORCID: https://orcid.org/0000-0001-7984-5564)
- Shuhong Zhao (ORCID: https://orcid.org/0000-0002-3997-2320)
- Dong Wang (ORCID: https://orcid.org/0000-0003-3627-2051)
- Cheng Wang (ORCID: https://orcid.org/0000-0001-8155-5064)
- T. Luo (ORCID: https://orcid.org/0000-0001-5188-8407)
- Hao Huang (ORCID: https://orcid.org/0000-0002-6729-1987)
- Xuewen Xu (ORCID: https://orcid.org/0000-0001-6925-3346)
Institutions
- Huazhong Agricultural University (CN)
- Ministry of Agriculture (CA)
- Huazhong University of Science and Technology (CN)
Publication Details
- Journal
- Journal of Agriculture and Food Research
- Published
- 2025-05-07
- DOI
- https://doi.org/10.1016/j.jafr.2025.102002
- Citations
- 1
- Primary Topic
- Industrial Vision Systems and Defect Detection
- Type
- article
- Field-Weighted Citation Impact
- 1.24