Abstract
Sheep identification is essential for establishing a modern, intelligent sheep farm. It is crucial to build a fast network that uses as little data as possible. In this study, we propose SheepNet, a novel rapid sheep face recognition method based on attention and knowledge distillation. Firstly, we obtain the attention weights of low-level features based on two-branch convolution structures. Then, we construct a skip connection structure to enhance the model’s feature extraction capability. Finally, we adopt knowledge distillation to address the high-precision training problem with limited data. One crucial advantage of SheepNet is that it does not suffer from degradation as other models do when knowledge distillation is performed with limited training set. We have constructed a publicly available sheep face dataset where facial images are captured at various distances and angles. Coupled with the knowledge distillation, the proposed model efficiently extracts sheep facial features, achieving high accuracy with limited training set. It achieves a remarkable accuracy of 97.61% (99.52%) when trained with merely 12 (72) photographs per sheep, with merely 0.72M parameters and an inference time of 7.14 ms per image.
Access this chapter
Tax calculation will be finalised at checkout
Purchases are for personal use only
Similar content being viewed by others
Notes
- 1.
The sheep face dataset we constructed is available at https://pan.baidu.com/s/1EOIO4C4c1VxF5UIEaOXkrQ?pwd=13no.
- 2.
This dataset is available together with our sheep dataset at https://pan.baidu.com/s/1EOIO4C4c1VxF5UIEaOXkrQ?pwd=13no.
References
Marinchenko, T.: Scientific support for the innovative development of sheep breeding in the Russian Federation. In: E3S Web of Conferences, vol. 254, p. 08013 (2021)
Akhter, R., Sofi, S.A. : Precision agriculture using IoT data analytics and machine learning, J. King Saud Univ.-Comput. Inf. Sci. 34(8), 5602–5618 (2022)
Gu, Z., Zhang, H., He, Z., et al.: A two-stage recognition method based on deep learning for sheep behavior. Comput. Electron. Agric. 212, 108143 (2023)
Bai, X., Wang, X., Liu, X., et al.: Explainable deep learning for efficient and robust pattern recognition: a survey of recent developments. Pattern Recogn. 120, 108102 (2021)
Fuentes, S., Viejo, C.G., Tongson, E., et al.: The livestock farming digital transformation: implementation of new and emerging technologies using artificial intelligence. Animal Health Res. Rev. 1–13 (2022)
Xue, H., Qin, J., Quan, C., et al.: Open set sheep face recognition based on Euclidean space metric. Math. Probl. Eng. 2021, 1–15 (2021)
Hansen, M.F., Smith, M.L., Smith, L.N., et al.: Towards on-farm pig face recognition using convolutional neural networks. Comput. Ind. 98, 145–152 (2018)
de Lima Weber, F., de Moraes Weber, V.A., Menezes, G.V., et al.: Recognition of Pantaneira cattle breed using computer vision and convolutional neural networks. Comput. Electron. Agric. 175, 105548 (2020)
Hitelman, A., Edan, Y., Godo, A., et al.: Biometric identification of sheep via a machine-vision system. Comput. Electron. Agric. 194, 106713 (2022)
Simonyan, K., Zisserman, A.: Very deep convolutional networks for large-scale image recognition. arXiv preprint arXiv:1409.1556 (2014)
He, K., Zhang, X., Ren, S., et al.: Deep residual learning for image recognition. In: Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pp. 770–778 (2016)
Howard, A., Sandler, M., Chu, G., et al.: Searching for mobilenetv3. In: Proceedings of the IEEE/CVF International Conference on Computer Vision, pp. 1314–1324 (2019)
Alzubaidi, L., Zhang, J., Humaidi, A.J., et al.: Review of deep learning: concepts, CNN architectures, challenges, applications, future directions. J. Big Data 8, 1–74 (2021)
Elngar, A.A., Arafa, M., Fathy, A., et al.: Image classification based on CNN: a survey. J. Cybersecurity Inf. Manage. 6(1), 18–50 (2021)
Maity, M., Banerjee, S., Chaudhuri, S.S.: Faster r-cnn and yolo based vehicle detection: a survey. In: 2021 5th International Conference on Computing Methodologies and Communication (ICCMC), pp. 1442–1447. IEEE (2021)
Hao, J., Zhang, H., Han, Y., et al.: Sheep face detection based on an improved retinaFace algorithm. Animals 13(15), 2458 (2023)
Hitelman, A., Edan, Y., Godo, A., et al.: Short communication: the effect of age on young sheep biometric identification. J. Animal 16(2), 100452 (2022)
Li, X., Xiang, Y., Li, S.: Combining convolutional and vision transformer structures for sheep face recognition. Comput. Electron. Agric. 205, 107651 (2023)
Meng, X., Tao, P., Han, L., et al.: Sheep identification with distance balance in two stages deep learning. In: 2022 IEEE 6th Information Technology and Mechatronics Engineering Conference (ITOEC), vol. 6, pp. 1308–1313. IEEE (2022)
Saradha, S., Asha, J., Sreemathy, J.: A deep learning-based framework for sheep identification system based on facial bio-metrics analysis. In: 2022 Sixth International Conference on I-SMAC (IoT in Social, Mobile, Analytics and Cloud)(I-SMAC), pp. 560–564. IEEE (2022)
Huang, G., Sun, Y., Liu, Z., et al.: Deep networks with stochastic depth. In: Computer Vision-ECCV 2016: 14th European Conference, Amsterdam, The Netherlands, October 11-14, 2016, Proceedings, Part IV 14. Springer International Publishing, pp. 646–661 (2016)
Hu, J., Shen, L., Sun, G.: Squeeze-and-excitation networks. In: Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pp. 7132–7141 (2018)
Roy, A.G., Navab, N., Wachinger, C.: Concurrent spatial and channel ‘squeeze and excitation’ in fully convolutional networks. In: Medical Image Computing and Computer Assisted Intervention-MICCAI 2018: 21st International Conference, Granada, Spain, September 16-20, 2018, Proceedings, Part I. Springer International Publishing, pp. 421–429 (2018)
Bang, D., Lee, J., Shim, H.: Distilling from professors: enhancing the knowledge distillation of teachers. Inf. Sci. 576, 743–755 (2021)
Hinton, G., Vinyals, O., Dean, J.: Distilling the knowledge in a neural network. arXiv preprint arXiv:1503.02531 (2015)
Griffin, G., Holub, A., Perona, P.: Caltech-256 object category dataset. Journal (2007)
Banerjee, S.: Animal image dataset(90 Different Animals). Kaggle. https://www.kaggle.com/datasets/iamsouravbanerjee/animal-image-dataset-90-different-animals. Last accessed 10 April 2024
Gupta, S.: Flowers dataset. Kaggle. https://www.kaggle.com/datasets/imsparsh/flowers-dataset. Last accessed 10 April 2024
Iandola, F.N., Han, S., Moskewicz, M.W., et al.: SqueezeNet: AlexNet-level accuracy with 50x fewer parameters and <0.5 MB model size. arXiv preprint arXiv:1602.07360 (2016)
Ma, N., Zhang, X., Zheng, H.T., et al.: Shufflenet v2: Practical guidelines for efficient CNN architecture design. In: Proceedings of the European Conference on Computer Vision (ECCV), pp. 116–131 (2018)
Author information
Authors and Affiliations
Corresponding authors
Editor information
Editors and Affiliations
Rights and permissions
Copyright information
© 2025 The Author(s), under exclusive license to Springer Nature Singapore Pte Ltd.
About this paper
Cite this paper
Shi, B., Wang, Y., Jia, L., Wang, Y., Qu, C. (2025). SheepNet: Rapid Sheep Face Recognition Based on Attention and Knowledge Distillation. In: Lin, Z., et al. Pattern Recognition and Computer Vision. PRCV 2024. Lecture Notes in Computer Science, vol 15033. Springer, Singapore. https://doi.org/10.1007/978-981-97-8502-5_18
Download citation
DOI: https://doi.org/10.1007/978-981-97-8502-5_18
Published:
Publisher Name: Springer, Singapore
Print ISBN: 978-981-97-8501-8
Online ISBN: 978-981-97-8502-5
eBook Packages: Computer ScienceComputer Science (R0)