Skip to main content

SheepNet: Rapid Sheep Face Recognition Based on Attention and Knowledge Distillation

  • Conference paper
  • First Online:
Pattern Recognition and Computer Vision (PRCV 2024)

Part of the book series: Lecture Notes in Computer Science ((LNCS,volume 15033))

Included in the following conference series:

  • 89 Accesses

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.

This is a preview of subscription content, log in via an institution to check access.

Access this chapter

Subscribe and save

Springer+ Basic
$34.99 /Month
  • Get 10 units per month
  • Download Article/Chapter or eBook
  • 1 Unit = 1 Article or 1 Chapter
  • Cancel anytime
Subscribe now

Buy Now

Chapter
USD 29.95
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever

Tax calculation will be finalised at checkout

Purchases are for personal use only

Institutional subscriptions

Similar content being viewed by others

Notes

  1. 1.

    The sheep face dataset we constructed is available at https://pan.baidu.com/s/1EOIO4C4c1VxF5UIEaOXkrQ?pwd=13no.

  2. 2.

    This dataset is available together with our sheep dataset at https://pan.baidu.com/s/1EOIO4C4c1VxF5UIEaOXkrQ?pwd=13no.

References

  1. 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)

    Google Scholar 

  2. 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)

    Google Scholar 

  3. 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)

    Article  Google Scholar 

  4. 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)

    Article  Google Scholar 

  5. 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)

    Google Scholar 

  6. 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)

    Google Scholar 

  7. 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)

    Article  Google Scholar 

  8. 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)

    Google Scholar 

  9. Hitelman, A., Edan, Y., Godo, A., et al.: Biometric identification of sheep via a machine-vision system. Comput. Electron. Agric. 194, 106713 (2022)

    Article  Google Scholar 

  10. Simonyan, K., Zisserman, A.: Very deep convolutional networks for large-scale image recognition. arXiv preprint arXiv:1409.1556 (2014)

  11. 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)

    Google Scholar 

  12. 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)

    Google Scholar 

  13. 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)

    Article  Google Scholar 

  14. 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)

    Article  Google Scholar 

  15. 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)

    Google Scholar 

  16. Hao, J., Zhang, H., Han, Y., et al.: Sheep face detection based on an improved retinaFace algorithm. Animals 13(15), 2458 (2023)

    Article  Google Scholar 

  17. 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)

    Google Scholar 

  18. Li, X., Xiang, Y., Li, S.: Combining convolutional and vision transformer structures for sheep face recognition. Comput. Electron. Agric. 205, 107651 (2023)

    Article  Google Scholar 

  19. 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)

    Google Scholar 

  20. 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)

    Google Scholar 

  21. 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)

    Google Scholar 

  22. 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)

    Google Scholar 

  23. 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)

    Google Scholar 

  24. Bang, D., Lee, J., Shim, H.: Distilling from professors: enhancing the knowledge distillation of teachers. Inf. Sci. 576, 743–755 (2021)

    Article  MathSciNet  Google Scholar 

  25. Hinton, G., Vinyals, O., Dean, J.: Distilling the knowledge in a neural network. arXiv preprint arXiv:1503.02531 (2015)

  26. Griffin, G., Holub, A., Perona, P.: Caltech-256 object category dataset. Journal (2007)

    Google Scholar 

  27. 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

  28. Gupta, S.: Flowers dataset. Kaggle. https://www.kaggle.com/datasets/imsparsh/flowers-dataset. Last accessed 10 April 2024

  29. 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)

  30. 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)

    Google Scholar 

Download references

Author information

Authors and Affiliations

Authors

Corresponding authors

Correspondence to Yaojun Wang or Lu Jia .

Editor information

Editors and Affiliations

Rights and permissions

Reprints and permissions

Copyright information

© 2025 The Author(s), under exclusive license to Springer Nature Singapore Pte Ltd.

About this paper

Check for updates. Verify currency and authenticity via CrossMark

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)

Publish with us

Policies and ethics