Open-Set Sheep Face Recognition in Multi-View Based on Li-SheepFaceNet
Abstract
:1. Introduction
- (1)
- We improved the baseline model MobileFaceNet by incorporating the Seesaw block, which utilizes uneven group convolutions with a channel shuffle operation and an SE block to achieve a lighter model with higher-accuracy performance.
- (2)
- We utilized the Li-ArcFace loss, which employs a linear function instead of the cosine function, to treat angle values as target logits during low-dimensional embedding feature learning in sheep face recognition. This approach enhances both inter-class discrepancy and intra-class compactness, leading to better convergence and performance.
- (3)
- To enhance the robustness of the model to the variations in facial features and lighting, we contactlessly collected multi-view facial images of 212 Ujumqin sheep in the wild, simulating the real-world application environment.
- (4)
- To promote the practical implementation of the proposed method, a rapid and precise open-set sheep face recognition system was developed. It is capable of identifying new individuals following registration without the necessity of retraining the model.
2. Materials and Methods
2.1. Labeled Sheep Faces in the Wild
2.2. SheepFaceNet
2.2.1. Channel Shuffle for Uneven Group Convolution
2.2.2. Seesaw Block
2.3. Li-ArcFace Loss
2.3.1. Margin-Based Softmax Loss
2.3.2. Li-ArcFace
2.4. Evaluation Indicators and Experimental Environment
2.4.1. Evaluation Indicators
2.4.2. Experimental Environment
3. Results
3.1. Comparison of Open-Set Recognition Results Using SheepFaceNet and Other Models
3.2. Open-Set Recognition Results with Different Margin-Based Losses
3.3. Evaluation Results of Li-SheepFaceNet on Public Sheep Face Dataset
3.4. Influence of Facial Feature Changes for Open-Set Recognition
3.5. Visualization of Open-Set Sheep Face Recognition Results
4. Discussion
5. Conclusions
Author Contributions
Funding
Institutional Review Board Statement
Data Availability Statement
Acknowledgments
Conflicts of Interest
References
- Ait-Saidi, A.; Caja, G.; Salama, A.A.K.; Carné, S. Implementing Electronic Identification for Performance Recording in Sheep: I. Manual versus Semiautomatic and Automatic Recording Systems in Dairy and Meat Farms. J. Dairy Sci. 2014, 97, 7505–7514. [Google Scholar] [CrossRef] [PubMed]
- Kumar, S.; Tiwari, S.; Singh, S.K. Face Recognition for Cattle. In Proceedings of the 2015 Third International Conference on Image Information Processing (ICIIP), Waknaghat, India, 21–24 December 2015; IEEE: Piscataway, NJ, USA, 2015; pp. 65–72. [Google Scholar]
- Yan, H.; Cui, Q.; Liu, Z. Pig Face Identification Based on Improved AlexNet Model. INMATEH Agric. Eng. 2020, 61, 97–104. [Google Scholar] [CrossRef]
- Huang, L.; Qian, B.; Guan, F.; Hou, Z.; Zhang, Q. Goat Face Recognition Model Based on Wavelet Transform and Convolutional Neural Networks. Trans. Chin. Soc. Agric. Mach. 2023, 54, 278–287. [Google Scholar]
- Hitelman, A.; Edan, Y.; Godo, A.; Berenstein, R.; Lepar, J.; Halachmi, I. Biometric Identification of Sheep via a Machine-Vision System. Comput. Electron. Agric. 2022, 194, 106713. [Google Scholar] [CrossRef]
- Billah, M.; Wang, X.; Yu, J.; Jiang, Y. Real-Time Goat Face Recognition Using Convolutional Neural Network. Comput. Electron. Agric. 2022, 194, 106730. [Google Scholar] [CrossRef]
- Meng, X.; Tao, P.; Han, L.; CaiRang, D. Sheep Identification with Distance Balance in Two Stages Deep Learning. In Proceedings of the 2022 IEEE 6th Information Technology and Mechatronics Engineering Conference (ITOEC), Chongqing, China, 4–6 March 2022; IEEE: Piscataway, NJ, USA, 2022; pp. 1308–1313. [Google Scholar]
- Li, X.; Du, J.; Yang, J.; Li, S. When Mobilenetv2 Meets Transformer: A Balanced Sheep Face Recognition Model. Agriculture 2022, 12, 1126. [Google Scholar] [CrossRef]
- Li, X.; Xiang, Y.; Li, S. Combining Convolutional and Vision Transformer Structures for Sheep Face Recognition. Comput. Electron. Agric. 2023, 205, 107651. [Google Scholar] [CrossRef]
- Zhang, X.; Xuan, C.; Ma, Y.; Su, H. A High-Precision Facial Recognition Method for Small-Tailed Han Sheep Based on an Optimised Vision Transformer. Animal 2023, 17, 100886. [Google Scholar] [CrossRef]
- Dosovitskiy, A.; Beyer, L.; Kolesnikov, A.; Weissenborn, D.; Zhai, X.; Unterthiner, T.; Dehghani, M.; Minderer, M.; Heigold, G.; Gelly, S.; et al. An Image Is Worth 16x16 Words: Transformers for Image Recognition at Scale. arXiv 2020, arXiv:2010.11929. [Google Scholar]
- Xue, H.; Qin, J.; Quan, C.; Ren, W.; Gao, T.; Zhao, J. Open Set Sheep Face Recognition Based on Euclidean Space Metric. Math. Probl. Eng. 2021, 2021, 1–15. [Google Scholar] [CrossRef]
- Zhang, H.; Zhou, L.; Li, Y.; Hao, J.; Sun, Y.; Li, S. Sheep Face Recognition Method Based on Improved MobileFaceNet. Trans. Chin. Soc. Agric. Mach. 2022, 53, 267–274. [Google Scholar]
- Wen, Y.; Zhang, K.; Li, Z.; Qiao, Y. A Discriminative Feature Learning Approach for Deep Face Recognition. In Proceedings of the Computer Vision–ECCV, Amsterdam, The Netherlands, 11–14 October 2016; Lecture Notes in Computer Science. Springer: Berlin/Heidelberg, Germany, 2016; pp. 499–515. [Google Scholar]
- Deng, J.; Guo, J.; Yang, J.; Xue, N.; Cotsia, I.; Zafeiriou, S.P. ArcFace: Additive Angular Margin Loss for Deep Face Recognition. IEEE Trans. Pattern Anal. Mach. Intell. 2021, 44, 5962–5979. [Google Scholar] [CrossRef] [PubMed]
- Salama, A.; Hassanien, A.E.; Fahmy, A. Sheep Identification Using a Hybrid Deep Learning and Bayesian Optimization Approach. IEEE Access 2019, 7, 31681–31687. [Google Scholar] [CrossRef]
- Ding, C.; Tao, D. A Comprehensive Survey on Pose-Invariant Face Recognition. ACM Trans. Intell. Syst. Technol. 2016, 7, 1–42. [Google Scholar] [CrossRef]
- Zhang, J. SeesawFaceNets: Sparse and Robust Face Verification Model for Mobile Platform. arXiv 2019, arXiv:1908.09124. [Google Scholar]
- Jocher, G. Ultralytics YOLOv5. 7.0. Zenodo 2020. [Google Scholar] [CrossRef]
- Huang, G.B.; Mattar, M.; Berg, T.; Learned-Miller, E.; Labeled Faces in the Wild: A Database for Studying Face Recognition in Unconstrained Environments. In Workshop on Faces in ‘Real-Life’ Images: Detection, Alignment, and Recognition. 2008. Available online: https://inria.hal.science/inria-00321923/ (accessed on 15 June 2024).
- Howard, A.; Zhu, M.; Chen, B.; Kalenichenko, D.; Wang, W.; Weyand, T.; Andreetto, M.; Adam, H. MobileNets: Efficient Convolutional Neural Networks for Mobile Vision Applications. arXiv 2017, arXiv:1704.04861. [Google Scholar]
- Sandler, M.; Howard, A.; Zhu, M.; Zhmoginov, A.; Chen, L.-C. MobileNetV2: Inverted Residuals and Linear Bottlenecks. In Proceedings of the 2018 IEEE/CVF Conference on Computer Vision and Pattern Recognition, Salt Lake City, UT, USA, 18–23 June 2018; IEEE: Piscataway, NJ, USA, 2018; pp. 4510–4520. [Google Scholar]
- Chen, S.; Liu, Y.; Gao, X.; Han, Z. MobileFaceNets: Efficient CNNs for Accurate Real-Time Face Verification on Mobile Devices. In Proceedings of the Biometric Recognition, Urumqi, China, 11–12 August 2018; Lecture Notes in Computer Science. Springer: Berlin/Heidelberg, Germany, 2018; pp. 428–438. [Google Scholar]
- Krizhevsky, A.; Sutskever, I.; Hinton, G.E. ImageNet Classification with Deep Convolutional Neural Networks. Commun. ACM 2017, 84–90. [Google Scholar] [CrossRef]
- Zhang, X.; Zhou, X.; Lin, M.; Sun, J. ShuffleNet: An Extremely Efficient Convolutional Neural Network for Mobile Devices. In Proceedings of the 2018 IEEE/CVF Conference on Computer Vision and Pattern Recognition, Salt Lake City, UT, USA, 18–23 June 2018; IEEE: Piscataway, NJ, USA, 2018; pp. 6848–6856. [Google Scholar]
- Ma, N.; Zhang, X.; Zheng, H.-T.; Sun, J. ShuffleNet V2: Practical Guidelines for Efficient CNN Architecture Design. In Proceedings of the Computer Vision–ECCV, Munich, Germany, 8–14 September 2018; Lecture Notes in Computer Science. Springer: Berlin/Heidelberg, Germany, 2018; pp. 122–138. [Google Scholar]
- Zhang, J. Seesaw-Net: Convolution Neural Network with Uneven Group Convolution. arXiv 2019, arXiv:1905.03672. [Google Scholar]
- Ramachandran, P.; Zoph, B.; Le, Q.V. Searching for Activation Functions. arXiv 2017, arXiv:1710.05941. [Google Scholar]
- Howard, A.; Sandler, M.; Chen, B.; Wang, W.; Chen, L.-C.; Tan, M.; Chu, G.; Vasudevan, V.; Zhu, Y.; Pang, R.; et al. Searching for MobileNetV3. In Proceedings of the 2019 IEEE/CVF International Conference on Computer Vision (ICCV), Seoul, Republic of Korea, 27 October–2 November 2019; pp. 1314–1324. [Google Scholar]
- Ioffe, S.; Szegedy, C. Batch Normalization: Accelerating Deep Network Training by Reducing Internal Covariate Shift. In Proceedings of the International Conference on Machine Learning, Lille, France, 6–11 July 2015; pp. 448–456. [Google Scholar]
- He, K.; Zhang, X.; Ren, S.; Sun, J. Deep Residual Learning for Image Recognition. In Proceedings of the 2016 IEEE Conference on Computer Vision and Pattern Recognition (CVPR), Las Vegas, NV, USA, 27–30 June 2016; pp. 770–778. [Google Scholar]
- Liu, W.; Wen, Y.; Yu, Z.; Li, M.; Raj, B.; Song, L. SphereFace: Deep Hypersphere Embedding for Face Recognition. In Proceedings of the 2017 IEEE Conference on Computer Vision and Pattern Recognition (CVPR), Honolulu, HI, USA, 21–26 July 2017; pp. 6738–6746. [Google Scholar]
- Wang, H.; Wang, Y.; Zhou, Z.; Ji, X.; Gong, D.; Zhou, J.; Li, Z.; Liu, W. CosFace: Large Margin Cosine Loss for Deep Face Recognition. In Proceedings of the 2018 IEEE/CVF Conference on Computer Vision and Pattern Recognition, Salt Lake City, UT, USA, 18–23 June 2018; pp. 5265–5274. [Google Scholar]
- Li, X.; Wang, F.; Hu, Q.; Leng, C. AirFace:Lightweight and Efficient Model for Face Recognition. In Proceedings of the 2019 IEEE/CVF International Conference on Computer Vision Workshop (ICCVW), Seoul, Republic of Korea, 27–28 October 2019; pp. 2678–2682. [Google Scholar]
- Duta, I.C.; Liu, L.; Zhu, F.; Shao, L. Improved Residual Networks for Image and Video Recognition. In Proceedings of the 2020 25th International Conference on Pattern Recognition (ICPR), Milan, Italy, 10–15 January 2021; IEEE: New York, NY, USA, 2021; pp. 9415–9422. [Google Scholar]
- Zhang, X.; Xuan, C.; Ma, Y.; Su, H.; Zhang, M. Biometric Facial Identification Using Attention Module Optimized YOLOv4 for Sheep. Comput. Electron. Agric. 2022, 203, 107452. [Google Scholar] [CrossRef]
Dataset | Sheep Number | Images Number | Pairs |
---|---|---|---|
Training Set-Open Set | 182 | 3547 | - |
Testing Set-Open Set | 30 | 254 | 600 |
Total | 212 | 3801 | - |
Input | Operator | |
---|---|---|
112 × 112 × 3 | Conv 3 × 3, /2, 64 | |
56 × 56 × 64 | DWConv 3 × 3, 64 | |
56 × 56 × 64 | 1 × Seesaw block | 1 × 1 UnevenGConv, 128 |
3 × 3 DWConv, /2, 128 | ||
1 × 1 UnevenGConv, 64 | ||
28 × 28 × 64 | 4 × RSeesaw block | 1 × 1 UnevenGConv, 128 |
3 × 3 DWConv, 128 | ||
1 × 1 UnevenGConv, 64 | ||
28 × 28 × 64 | 1 × Seesaw block | 1 × 1 UnevenGConv, 256 |
3 × 3 DWConv, /2, 256 | ||
1 × 1 UnevenGConv, 128 | ||
14 × 14 × 128 | 6 × RSeesaw block | 1 × 1 UnevenGConv, 256 |
3 × 3 DWConv, 256 | ||
1 × 1 UnevenGConv, 128 | ||
14 × 14 × 128 | 1 × Seesaw block | 1 × 1 UnevenGConv, 512 |
3 × 3 DWConv, /2, 512 | ||
1 × 1 UnevenGConv, 128 | ||
7 × 7 × 128 | 2 × Seesaw block | 1 × 1 UnevenGConv, 256 |
3 × 3 DWConv, 256 | ||
1 × 1 UnevenGConv, 128 | ||
7 ×7 × 128 | Conv 1 × 1, 512 | |
7 × 7 × 512 | LinearGDConv 7 × 7, 512 | |
1 × 1 × 512 | LinearConv 1 × 1 |
Loss | Target Logit | The Value of |
---|---|---|
SphereFace | ||
CosFace | ||
ArcFace |
Configure | Value |
---|---|
Optimizer | SGD |
Learning Rate | 0.01 |
Momentum | 0.9 |
Weight Decay | 1 × 10−4 |
Batch Size | 16 |
Training Epochs | 40 |
Model | LSFW (Testing Set–Open Set) (%) | Precision (%) | Recall (%) | F1-Score (%) | MCC (%) | FLOPs/G | Params/MB |
---|---|---|---|---|---|---|---|
iResnet 18 | 87.83 | 89.66 | 86.49 | 88.05 | 75.71 | 2.62 | 24.02 |
iResnet 34 | 88.33 | 90.33 | 86.85 | 88.56 | 76.72 | 4.48 | 34.13 |
iResnet 50 | 89.66 | 91.33 | 88.38 | 89.83 | 79.37 | 6.33 | 43.59 |
ViT-s | 90.50 | 92.33 | 89.06 | 90.67 | 81.05 | 5.75 | 76.02 |
MobileFaceNet | 94.33 | 95.00 | 93.75 | 94.37 | 88.67 | 0.45 | 2.06 |
MobileFaceNet-Large | 94.50 | 95.00 | 94.05 | 94.52 | 89.00 | 1.85 | 6.31 |
SheepFaceNet | 95.00 | 95.66 | 94.40 | 95.03 | 90.00 | 0.15 | 1.36 |
Loss | The Best Value of m | LSFW (Testing Set–Open Set) (%) | Precision (%) | Recall (%) | F1-Score (%) | MCC (%) |
---|---|---|---|---|---|---|
SphereFace | 1.35 | 92.16 | 92.66 | 91.74 | 92.20 | 84.33 |
CosFace | 0.40 | 93.16 | 94.00 | 92.45 | 93.22 | 86.34 |
ArcFace | 0.50 | 95.00 | 95.00 | 97.35 | 94.37 | 88.67 |
Li-ArcFace | 0.45 | 96.13 | 97.33 | 95.11 | 96.21 | 92.35 |
Methods | Datasets | |
---|---|---|
LSFW (Testing Set–Open Set) (%) | GoatFace (%) | |
MobileFaceNet + ArcFace | 94.33 | 86.66 |
MobileFaceNet + Li-ArcFace | 96.00 | 90.00 |
SheepFaceNet + ArcFace | 95.00 | 90.00 |
SheepFaceNet + Li-ArcFace (Li-SheepFaceNet) | 96.13 | 93.33 |
Methods | Positive Pairs | Negative Pairs |
---|---|---|
MobileFaceNet + ArcFace | 15 | 19 |
SheepFaceNet + Li-ArcFace (Li-SheepFaceNet) | 8 | 15 |
Disclaimer/Publisher’s Note: The statements, opinions and data contained in all publications are solely those of the individual author(s) and contributor(s) and not of MDPI and/or the editor(s). MDPI and/or the editor(s) disclaim responsibility for any injury to people or property resulting from any ideas, methods, instructions or products referred to in the content. |
© 2024 by the authors. Licensee MDPI, Basel, Switzerland. This article is an open access article distributed under the terms and conditions of the Creative Commons Attribution (CC BY) license (https://creativecommons.org/licenses/by/4.0/).
Share and Cite
Li, J.; Yang, Y.; Liu, G.; Ning, Y.; Song, P. Open-Set Sheep Face Recognition in Multi-View Based on Li-SheepFaceNet. Agriculture 2024, 14, 1112. https://doi.org/10.3390/agriculture14071112
Li J, Yang Y, Liu G, Ning Y, Song P. Open-Set Sheep Face Recognition in Multi-View Based on Li-SheepFaceNet. Agriculture. 2024; 14(7):1112. https://doi.org/10.3390/agriculture14071112
Chicago/Turabian StyleLi, Jianquan, Ying Yang, Gang Liu, Yuanlin Ning, and Ping Song. 2024. "Open-Set Sheep Face Recognition in Multi-View Based on Li-SheepFaceNet" Agriculture 14, no. 7: 1112. https://doi.org/10.3390/agriculture14071112
APA StyleLi, J., Yang, Y., Liu, G., Ning, Y., & Song, P. (2024). Open-Set Sheep Face Recognition in Multi-View Based on Li-SheepFaceNet. Agriculture, 14(7), 1112. https://doi.org/10.3390/agriculture14071112