Sheep Face Detection Based on an Improved RetinaFace Algorithm
Abstract
:Simple Summary
Abstract
1. Introduction
2. Materials and Methods
2.1. Dataset
2.2. Sheep Face Detection Algorithm Based on the Improved RetinaFace
2.2.1. Overview
2.2.2. Improved MobileNetV3-Large Network
2.2.3. SSH-CBAM Module with an Attention Mechanism
2.2.4. Multi-Task Loss Function
2.3. Evaluation Indicators
2.4. Experimental Setup
3. Results and Discussion
3.1. Performance on Sheep Face Detection
3.2. Qualitative Evaluation
3.3. Sheep Face Detection under Different Light Conditions
3.4. Ablation Experiment
- (1)
- Effectiveness of the Different Key Components of the Proposed Methods
- (2)
- Effectiveness of the proposed detection method on the sheep face recognition task
- (3)
- Ablation study of adding the SAC module into MobileNetV3-large
4. Conclusions
Author Contributions
Funding
Institutional Review Board Statement
Informed Consent Statement
Data Availability Statement
Acknowledgments
Conflicts of Interest
References
- Feng, Z.; Zhong, W.; Zang, R. Environment Parameter Setting Control System for Sheep House Based on Wireless Network. In Proceedings of the 2021 International Conference on Applications and Techniques in Cyber Intelligence: Applications and Techniques in Cyber Intelligence (ATCI 2021), Fuyang, China, 9–21 June 2021; Volume 1, pp. 753–757. [Google Scholar]
- Yongqiang, C.; Shaofang, L.; Hongmei, L.; Pin, T.; Yilin, C. Application of intelligent technology in animal husbandry and aquaculture industry. In Proceedings of the 2019 14th International Conference on Computer Science & Education (ICCSE), Toronto, ON, Canada, 19–21 August 2019; pp. 335–339. [Google Scholar]
- Fosgate, G.T.; Adesiyun, A.A.; Hird, D.W. Ear-tag retention and identification methods for extensively managed water buffalo (Bubalus bubalis) in Trinidad. Prev. Vet. Med. 2006, 73, 287–296. [Google Scholar] [CrossRef] [PubMed]
- Hulbert, I.A.; Wyllie, J.T.; Waterhouse, A.; French, J.; McNulty, D. A note on the circadian rhythm and feeding behaviour of sheep fitted with a lightweight GPS collar. Appl. Anim. Behav. Sci. 1998, 60, 359–364. [Google Scholar] [CrossRef]
- Morris, J.E.; Cronin, G.M.; Bush, R.D. Improving sheep production and welfare in extensive systems through precision sheep management. Anim. Prod. Sci. 2012, 52, 665–670. [Google Scholar] [CrossRef]
- Voulodimos, A.S.; Patrikakis, C.Z.; Sideridis, A.B.; Ntafis, V.A.; Xylouri, E.M. A complete farm management system based on animal identification using RFID technology. Comput. Electron. Agric. 2010, 70, 380–388. [Google Scholar] [CrossRef]
- Kumar, S.; Tiwari, S.; Singh, S.K. Face recognition of cattle: Can it be done? Proc. Natl. Acad. Sci. India Sect. A Phys. Sci. 2016, 86, 137–148. [Google Scholar] [CrossRef]
- Shahinfar, S.; Khansefid, M.; Haile-Mariam, M.; Pryce, J.J.A. Machine learning approaches for the prediction of lameness in dairy cows. Animal 2021, 15, 100391. [Google Scholar] [CrossRef] [PubMed]
- 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]
- Li, Z.; Lei, X.; Liu, S. A lightweight deep learning model for cattle face recognition. Comput. Electron. Agric. 2022, 195, 106848. [Google Scholar] [CrossRef]
- Wang, Y.; Kang, X.; He, Z.; Feng, Y.; Liu, G. Accurate detection of dairy cow mastitis with deep learning technology: A new and comprehensive detection method based on infrared thermal images. Animal 2022, 16, 100646. [Google Scholar] [CrossRef] [PubMed]
- Girshick, R.; Donahue, J.; Darrell, T.; Malik, J. Rich feature hierarchies for accurate object detection and semantic segmentation. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, Columbus, OH, USA, 23–28 June 2014; pp. 580–587. [Google Scholar]
- Girshick, R. Fast r-cnn. In Proceedings of the IEEE International Conference on Computer Vision, Santiago, Chile, 7–13 December 2015; pp. 1440–1448. [Google Scholar]
- Liu, W.; Anguelov, D.; Erhan, D.; Szegedy, C.; Reed, S.; Fu, C.-Y.; Berg, A.C. Ssd: Single shot multibox detector. In Proceedings of the Computer Vision–ECCV 2016: 14th European Conference, Amsterdam, The Netherlands, 11–14 October 2016; Proceedings, Part I 14. pp. 21–37. [Google Scholar]
- Bochkovskiy, A.; Wang, C.Y.; Liao, H.Y.M. Yolov4: Optimal speed and accuracy of object detection. arXiv 2020, arXiv:2004.10934. [Google Scholar]
- Lin, T.-Y.; Goyal, P.; Girshick, R.; He, K.; Dollár, P. Focal loss for dense object detection. In Proceedings of the IEEE International Conference on Computer Vision, Venice, Italy, 22–29 October 2017; pp. 2980–2988. [Google Scholar]
- Sarwar, F.; Griffin, A.; Rehman, S.U.; Pasang, T. Detecting sheep in UAV images. Comput. Electron. Agric. 2021, 187, 106219. [Google Scholar] [CrossRef]
- Su, Q.; Tang, J.; Zhai, M.; He, D. An intelligent method for dairy goat tracking based on Siamese network. Comput. Electron. Agric. 2022, 193, 106636. [Google Scholar] [CrossRef]
- Wang, D.; Tang, J.; Zhu, W.; Li, H.; Xin, J.; He, D. Dairy goat detection based on Faster R-CNN from surveillance video. Comput. Electron. Agric. 2018, 154, 443–449. [Google Scholar] [CrossRef]
- 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, 3375394. [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; pp. 1308–1313. [Google Scholar]
- 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]
- Deng, J.; Guo, J.; Ververas, E.; Kotsia, I.; Zafeiriou, S. Retinaface: Single-shot multi-level face localisation in the wild. In Proceedings of the IEEE/CVF conference on computer vision and pattern recognition, Seattle, WA, USA, 13–19 June 2020; pp. 5203–5212. [Google Scholar]
- Lin, T.-Y.; Dollár, P.; Girshick, R.; He, K.; Hariharan, B.; Belongie, S. Feature pyramid networks for object detection. In Proceedings of the IEEE conference on computer vision and pattern recognition, Honolulu, HI, USA, 21–26 July 2017; pp. 2117–2125. [Google Scholar]
- Howard, A.; Sandler, M.; Chu, G.; Chen, L.-C.; Chen, B.; Tan, M.; Wang, W.; Zhu, Y.; Pang, R.; Vasudevan, V. Searching for mobilenetv3. In Proceedings of the IEEE/CVF International Conference on Computer Vision, Seoul, Republic of Korea, 27 October–2 November 2019; pp. 1314–1324. [Google Scholar]
- Qiao, S.; Chen, L.-C.; Yuille, A. Detectors: Detecting objects with recursive feature pyramid and switchable atrous convolution. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, Nashville, TN, USA, 20–25 June 2021; pp. 10213–10224. [Google Scholar]
- Cao, J.; Chen, Q.; Guo, J.; Shi, R. Attention-guided context feature pyramid network for object detection. arXiv 2020, arXiv:2005.11475. [Google Scholar]
- Woo, S.; Park, J.; Lee, J.-Y.; Kweon, I.S. Cbam: Convolutional block attention module. In Proceedings of the European Conference on Computer Vision (ECCV), Munich, Germany, 8–14 September 2018; pp. 3–19. [Google Scholar]
- Wang, C.-Y.; Bochkovskiy, A.; Liao, H.-Y.M. Scaled-yolov4: Scaling cross stage partial network. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, Nashville, TN, USA, 20–25 June 2021; pp. 13029–13038. [Google Scholar]
- Ultralytics. Yolov5. Available online: https://github.com/ultralytics/yolov5 (accessed on 15 June 2022).
- Tan, M.; Pang, R.; Le, Q.V. Efficientdet: Scalable and efficient object detection. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, Seattle, WA, USA, 13–19 June 2020; pp. 10781–10790. [Google Scholar]
- González-García, E.; Alhamada, M.; Pradel, J.; Douls, S.; Parisot, S.; Bocquier, F.; Menassol, J.B.; Llach, I.; González, L.A. A mobile and automated walk-over-weighing system for a close and remote monitoring of liveweight in sheep. Comput. Electron. Agric. 2018, 153, 226–238. [Google Scholar] [CrossRef]
- Deng, J.; Guo, J.; Xue, N.; Zafeiriou, S. Arcface: Additive angular margin loss for deep face recognition. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, Long Beach, CA, USA, 15–20 June 2019; pp. 4690–4699. [Google Scholar]
Layers | Exp Size | #out | SE | NL | s |
---|---|---|---|---|---|
conv2d (SAC), 3 3 | - | 16 | - | HS | 2 |
Bneck (SAC), 3 3 | 16 | 16 | - | RE | 1 |
C1 bneck (SAC), 3 3 | 64 | 24 | - | RE | 1 |
bneck (SAC), 3 3 | 72 | 24 | - | RE | 1 |
C2 bneck (SAC), 3 3 | 72 | 40 | ✓ | RE | 2 |
bneck, 5 5 | 120 | 40 | ✓ | RE | 1 |
bneck, 5 5 | 120 | 40 | ✓ | RE | 1 |
C3 bneck, 3 3 | 240 | 80 | - | HS | 2 |
bneck, 3 3 | 200 | 80 | - | HS | 1 |
bneck, 3 3 | 184 | 80 | - | HS | 1 |
bneck, 3 3 | 184 | 80 | - | HS | 1 |
bneck, 3 3 | 480 | 112 | ✓ | HS | 1 |
bneck, 3 3 | 672 | 112 | ✓ | HS | 1 |
C4 bneck, 5 5 | 672 | 160 | ✓ | HS | 2 |
bneck, 5 5 | 960 | 160 | ✓ | HS | 1 |
bneck, 5 5 | 960 | 160 | ✓ | HS | 2 |
C5 conv2d, 1 1 | - | 960 | - | HS | 1 |
Pool, 7 7 | - | - | - | HS | 1 |
conv2d, 1 1, NBN | - | 1280 | - | - | 1 |
conv2d, 1 1, NBN | - | k | - | HS | 1 |
Method | F1 Score | AP | Model Size | Average Processing Time | Param |
---|---|---|---|---|---|
YOLOv4-tiny [29] | 77.05% | 82.27% | 23.56 MB | 27.46 ms | 5.87 M |
YOLOv5s [30] | 77.16% | 95.19% | 28.50 MB | 27.22 ms | 7.07 M |
EfficentDet [31] | 67.90% | 73.40% | 15.78 MB | 42.63 ms | 3.83 M |
RetinaFace + ResNet50 [23] | 94.02% | 95.23% | 119.02 MB | 225.91 ms | 29.67 M |
RetinaFace + ResNet50 + SAC + CBAM | 97.87% | 96.44% | 125.51 MB | 266.62 ms | 29.86 M |
RetinaFace + MobileNetV3-large + SAC + CBAM | 95.25% | 96.00% | 13.20 MB | 26.83 ms | 3.20 M |
Recall | Precision | F1 Score | |
---|---|---|---|
0.5 | 88.36% | 95.65% | 91.86% |
1.5 | 91.95% | 97.34% | 94.57% |
2.0 | 88.49% | 96.41% | 92.28% |
3.0 | 76.33% | 95.32% | 84.77% |
4.0 | 57.45% | 94.21% | 71.37% |
Method | F1 Score | AP | Model Size | Average Processing Time |
---|---|---|---|---|
RetinaFace + ResNet50 [23] | 94.02% | 95.23% | 119.02 MB | 225.91 ms |
RetinaFace + MobileNetV3-large | 93.76% | 89.83% | 12.89 MB | 22.32 ms |
RetinaFace + MobileNetV3-large + SAC | 95.12% | 94.77% | 13.19 MB | 25.57 ms |
RetinaFace + MobileNetV3-large + SAC + CBAM | 95.25% | 96.00% | 13.20 MB | 26.83 ms |
Method | Recall | Precision | F1 Score |
---|---|---|---|
MobileNetV3-large | 90.31% | 97.49% | 93.76% |
MobileNetV3-large + SAC_C5 | 63.10% | 67.81% | 65.37% |
MobileNetV3-large + SAC_C4 | 72.86% | 77.65% | 75.18% |
MobileNetV3-large + SAC_C3 | 86.70% | 94.66% | 90.50% |
MobileNetV3-large + SAC_C2 (proposal) | 92.22% | 98.20% | 95.12% |
MobileNetV3-large + SAC_C1 | 91.33% | 97.43% | 94.28% |
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. |
© 2023 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
Hao, J.; Zhang, H.; Han, Y.; Wu, J.; Zhou, L.; Luo, Z.; Du, Y. Sheep Face Detection Based on an Improved RetinaFace Algorithm. Animals 2023, 13, 2458. https://doi.org/10.3390/ani13152458
Hao J, Zhang H, Han Y, Wu J, Zhou L, Luo Z, Du Y. Sheep Face Detection Based on an Improved RetinaFace Algorithm. Animals. 2023; 13(15):2458. https://doi.org/10.3390/ani13152458
Chicago/Turabian StyleHao, Jinye, Hongming Zhang, Yamin Han, Jie Wu, Lixiang Zhou, Zhibo Luo, and Yutong Du. 2023. "Sheep Face Detection Based on an Improved RetinaFace Algorithm" Animals 13, no. 15: 2458. https://doi.org/10.3390/ani13152458
APA StyleHao, J., Zhang, H., Han, Y., Wu, J., Zhou, L., Luo, Z., & Du, Y. (2023). Sheep Face Detection Based on an Improved RetinaFace Algorithm. Animals, 13(15), 2458. https://doi.org/10.3390/ani13152458