A multi-target cow face detection model in complex scenes | The Visual Computer Skip to main content
Log in

A multi-target cow face detection model in complex scenes

  • Original article
  • Published:
The Visual Computer Aims and scope Submit manuscript

Abstract

The development of intelligent agriculture has accelerated the automation and scale of cattle farming. Recognizing cattle faces as a significant biological characteristic is crucial for accurate reproduction and health tracking. We propose a multi-target cow face detection model (MT-CF-DM) in complex scenes based on the YOLOv7 framework. The backbone of our proposal model consists of the GhostNet and the CBAM (convolutional block attention module) attention mechanism to improve the model’s perception of various scales and features. Additionally, we propose three novel modules of the neck network: SPPFCSPC (Spatial Pyramid Pooling-Fast Cross-Stage Partial Connection), a novel BiFPN, and C2f (CSP Bottleneck with 2 convolutions). SPPFCSPC is to reduce the number of model parameters. New BiFPN is to utilize feature information and improve the model’s detection capability. C2f is to maintain the network’s lightweight nature and obtain more comprehensive gradient flow data. Moreover, a method for establishing cow face datasets is proposed based on the MT-CF-DM. During the testing phase, our model combines with a cropping module to simultaneously acquire a dataset for cow faces. The experimental results show the parameter of the proposal model is 15.8 M, the model size is 22.3 M, GFLOPs are 25.8, FPS is 97.6, mAP is 98.5%, precision is 98.8%, recall is 97.3%. Compared to YOLOv7, our proposed model reduces parameters by 56.8% and has a 48.3 increase in FPS. The model demonstrates high accuracy and small number of parameters for detecting cow faces in complex environments, suitable for edge computing system applications.

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

Access this article

Subscribe and save

Springer+ Basic
¥17,985 /Month
  • Get 10 units per month
  • Download Article/Chapter or eBook
  • 1 Unit = 1 Article or 1 Chapter
  • Cancel anytime
Subscribe now

Buy Now

Price includes VAT (Japan)

Instant access to the full article PDF.

Fig. 1
Fig. 2
Fig. 3
Fig. 4
Fig. 5
Fig. 6
Fig. 7
Fig. 8
Fig. 9
Fig. 10
Fig. 11
Fig. 12
Fig. 13
Fig. 14
Fig. 15
Fig. 16
Fig. 17
Fig. 18

Similar content being viewed by others

Explore related subjects

Discover the latest articles, news and stories from top researchers in related subjects.

References

  1. Parikoglou, I., Emvalomatis, G., Thorne, F.: Precision livestock agriculture and productive efficiency: the case of milk recording in Ireland. Agric. Econ. 53, 109–120 (2022). https://doi.org/10.1111/agec.12729

    Article  Google Scholar 

  2. Piña, R., Lange, K., Machado, V., Bratcher, C.: Big data technology adoption in beef production. Smart Agric. Technol. 5, 100235 (2023). https://doi.org/10.1016/j.atech.2023.100235

    Article  Google Scholar 

  3. Daum, T., Ravichandran, T., Kariuki, J., Chagunda, M., Birner, R.: Connected cows and cyber chickens? Stocktaking and case studies of digital livestock tools in Kenya and India. Agric. Syst. 196, 103353 (2022). https://doi.org/10.1016/j.agsy.2021.103353

    Article  Google Scholar 

  4. Ayoub Shaikh, T., Rasool, T., Rasheed Lone, F.: Towards leveraging the role of machine learning and artificial intelligence in precision agriculture and smart farming. Comput. Electron. Agri. (2022). https://doi.org/10.1016/j.compag.2022.107119

    Article  Google Scholar 

  5. Liu, Z., Xiang, X., Qin, J., YunTan, Q., Zhang, N.N., Xiong: Image recognition of citrus diseases based on deep learning. Comput. Mater. Contin. 66, 457–466 (2020). https://doi.org/10.32604/cmc.2020.012165

    Article  Google Scholar 

  6. Hwang, J.-W., Park, J., Park, R.-H., Park, H.-M.: Audio-visual speech recognition based on joint training with audio-visual speech enhancement for robust speech recognition. Appl. Acoust. (2023). https://doi.org/10.1016/j.apacoust.2023.109478

    Article  Google Scholar 

  7. Yokoi, K., Iribe, Y., Kitaoka, N., Tsuboi, T., Hiraga, K., Satake, Y., Hattori, M., Tanaka, Y., Sato, M., Hori, A., Katsuno, M.: Analysis of spontaneous speech in Parkinson’s disease by natural language processing. Parkinsonism Relat. Disord. (2023). https://doi.org/10.1016/j.parkreldis.2023.105411

    Article  Google Scholar 

  8. Chen, X., Yang, K., Liu, X., Xu, Y., Luo, J., Zhang, S.: Efficient and accurate identification of missing tags for large-scale dynamic RFID systems. J. Syst. Archit. (2022). https://doi.org/10.1016/j.sysarc.2022.102394

    Article  Google Scholar 

  9. Wang, H., Qin, J., Hou, Q., Gong, S.: Cattle face recognition method based on parameter transfer and deep learning. J. Phys. Conf. Ser. (2020). https://doi.org/10.1088/1742-6596/1453/1/012054

    Article  Google Scholar 

  10. Yan, H., Cui, Q., Liu, Z.: pig face identification based on improved alexnet model. INMATEH Agric. Eng. 61, 97–104 (2020). https://doi.org/10.35633/inmateh-61-11

    Article  Google Scholar 

  11. Li, X., Xiang, Y., Li, S.: Combining convolutional and vision transformer structures for sheep face recognition. Comput. Electron. Agric. (2023). https://doi.org/10.1016/j.compag.2023.107651

    Article  Google Scholar 

  12. Noor, A., Zhao, Y., Koubaa, A., Wu, L., Khan, R., Abdalla, F.Y.O.: Automated sheep facial expression classification using deep transfer learning. Comput. Electron. Agric. (2020). https://doi.org/10.1016/j.compag.2020.105528

    Article  Google Scholar 

  13. Xu, B., Wang, W., Guo, L., Chen, G., Li, Y., Cao, Z., Wu, S.: CattleFaceNet: a cattle face identification approach based on RetinaFace and ArcFace loss. Comput. Electron. Agric. (2022). https://doi.org/10.1016/j.compag.2021.106675

    Article  Google Scholar 

  14. Sun, S., Yang, S., Zhao, L.: Noncooperative bovine iris recognition via SIFT. Neurocomputer 120, 310–317 (2013). https://doi.org/10.1016/j.neucom.2012.08.068

    Article  Google Scholar 

  15. O’Neill, C.J., Roberts, J.J., Cozzolino, D.: Identification of beef cattle categories (cows and calves) and sex based on the near infrared reflectance spectroscopy of their tail hair. Biosys. Eng. 162, 140–146 (2017). https://doi.org/10.1016/j.biosystemseng.2017.07.007

    Article  Google Scholar 

  16. Li, Z., Lei, X., Liu, S.: A lightweight deep learning model for cattle face recognition. Comput. Electron. Agric. (2022). https://doi.org/10.1016/j.compag.2022.106848

    Article  Google Scholar 

  17. Hao, W., Zhang, K., Han, M., Hao, W., Wang, J., Li, F., Liu, Z.: A novel Jinnan individual cattle recognition approach based on mutual attention learning scheme. Expert Syst. Appl. (2023). https://doi.org/10.1016/j.eswa.2023.120551

    Article  Google Scholar 

  18. Mahmud, M.S., Zahid, A., Das, A.K., Muzammil, M., Khan, M.U.: A systematic literature review on deep learning applications for precision cattle farming. Comput. Electron. Agric. (2021). https://doi.org/10.1016/j.compag.2021.106313

    Article  Google Scholar 

  19. Ren, S., He, K., Girshick, R., Sun, J.: Faster R-CNN: towards real-time object detection with region proposal networks. IEEE Trans. Pattern Anal. Mach. Intell. 39, 1137–1149 (2017). https://doi.org/10.1109/TPAMI.2016.2577031

    Article  Google Scholar 

  20. Li, R., Zhang, J., Zhao, X., Wang, D., Hann, M., Greaves, D.: Phase-resolved real-time forecasting of three-dimensional ocean waves via machine learning and wave tank experiments. Appl. Energy (2023). https://doi.org/10.1016/j.apenergy.2023.121529

    Article  Google Scholar 

  21. Liu, W., Anguelov, D., Erhan, D., Szegedy, C., Reed, S., Fu, C.-Y., Berg, A. C: In Computer Vision–ECCV 2016: 14th European Conference, Amsterdam, The Netherlands, October 11–14, 2016, Proceedings, Part I 14, Springer, pp. 21–37 (2016)

  22. Tan, M., Pang, R., Le, Q. V.: Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, 2020, pp. 10781–10790

  23. Redmon, J., Divvala, S., Girshick, R., Farhadi, A.: Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pp. 779–788 (2016)

  24. Cheng, M., Yuan, H., Wang, Q., Cai, Z., Liu, Y., Zhang, Y.: Application of deep learning in sheep behaviors recognition and influence analysis of training data characteristics on the recognition effect. Comput. Electron. Agric. (2022). https://doi.org/10.1016/j.compag.2022.107010

    Article  Google Scholar 

  25. Ma, C., Deng, M., Yin, Y.: Pig face recognition based on improved YOLOv4 lightweight neural network. Inf. Proc. Agric. (2023). https://doi.org/10.1016/j.inpa.2023.03.004

    Article  Google Scholar 

  26. Jiang, M., Rao, Y., Zhang, J., Shen, Y.: Automatic behavior recognition of group-housed goats using deep learning. Comput. Electron. Agric. (2020). https://doi.org/10.1016/j.compag.2020.105706

    Article  Google Scholar 

  27. Qiao, Y., Guo, Y., He, D.: Cattle body detection based on YOLOv5-ASFF for precision livestock farming. Comput. Electron. Agric. (2023). https://doi.org/10.1016/j.compag.2022.107579

    Article  Google Scholar 

  28. Li, C., Li, L., Jiang, H., Weng, K., Geng, Y., Li, L., Ke, Z., Li, Q., Cheng, M., Nie, W.: YOLOv6: a single-stage object detection framework for industrial applications. Comput. Vision Pattern Recognit. (2022). https://doi.org/10.48550/arXiv.2209.02976

    Article  Google Scholar 

  29. Wang, C.-Y., Bochkovskiy, A., Liao, H.-Y. M.: Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pp. 7464–7475. (2023)

  30. Ge, Z., Liu, S., Wang, F., Li, Z., Sun, J.: Yolox: exceeding yolo series in 2021. Comput. Vision Pattern Recognit. (2021). https://doi.org/10.48550/arXiv.2107.08430

    Article  Google Scholar 

  31. Han, K., Wang, Y., Tian, Q., Guo, J., Xu, C., Xu, C.: Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pp. 1580–1589 (2020)

  32. Woo, S., Park, J., Lee, J.-Y., Kweon, I. S.: Proceedings of the European Conference on Computer Vision (ECCV), pp. 3–19 (2018)

  33. Wang, Z., Bovik, A.C., Sheikh, H.R., Simoncelli, E.P.: Image quality assessment: from error visibility to structural similarity. IEEE Trans. Image Proc. 13, 600–612 (2004). https://doi.org/10.1109/tip.2003.819861

    Article  Google Scholar 

  34. He, K., Zhang, X., Ren, S., Sun, J.: Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pp. 770–778 (2016)

  35. Howard, A.G., Zhu, M., Chen, B., Kalenichenko, D., Wang, W., Weyand, T., Andreetto, M., Adam, H.: Mobilenets: efficient convolutional neural networks for mobile vision applications. Comput. Vis. Pattern Recognit. (2017). https://doi.org/10.48550/arXiv.1704.04861

    Article  Google Scholar 

  36. Sandler, M., Howard, A., Zhu, M., Zhmoginov, A., Chen, L.-C.: Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pp. 4510–4520 (2018)

  37. Howard, A., Sandler, M., Chu, G., Chen, L.-C., Chen, B., Tan, M., Wang, W., Zhu, Y., Pang, R., Vasudevan, V.: Proceedings of the IEEE/CVF International Conference on Computer Vision, pp. 1314–1324 (2019)

  38. Ma, N., Zhang, X., Zheng, H.-T., Sun, J.: Proceedings of the European Conference on Computer Vision (ECCV), pp. 116–131 (2018)

  39. Zhang, X., Zhou, X., Lin, M., Sun, J.: Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pp. 6848–6856 (2018)

  40. Zhang, P., Li, D.: CBA+ASFF-YOLOXs: an improved YOLOXs for guiding agronomic operation based on the identification of key growth stages of lettuce. Comput. Electron. Agric. (2022). https://doi.org/10.1016/j.compag.2022.107491

    Article  Google Scholar 

  41. Chen, L., Yao, H., Fu, J., Tai Ng, C.: The classification and localization of crack using lightweight convolutional neural network with CBAM. Eng. Struct. (2023). https://doi.org/10.1016/j.engstruct.2022.115291

    Article  Google Scholar 

  42. Yuan, C., Liu, T., Gao, F., Zhang, R., Seng, X.: YOLOv5s-CBAM-DMLHead: a lightweight identification algorithm for weedy rice (Oryza sativa f. spontanea) based on improved YOLOv5. Crop Prot. (2023). https://doi.org/10.1016/j.cropro.2023.106342

    Article  Google Scholar 

  43. He, K., Zhang, X., Ren, S., Sun, J.: Spatial pyramid pooling in deep convolutional networks for visual recognition. IEEE Trans. Pattern Anal. Mach. Intell. 37, 1904–1916 (2015). https://doi.org/10.1109/TPAMI.2015.2389824

    Article  Google Scholar 

  44. He, K., Gkioxari, G., Dollár, P., Girshick, R.: Proceedings of the IEEE International Conference on Computer Vision, pp. 2961–2969 (2017)

  45. Liu, S., Qi, L., Qin, H., Shi, J., Jia, J.: Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pp. 8759–8768 (2018)

  46. Lin, T.-Y., Dollár, P., Girshick, R., He, K., Hariharan, B., Belongie, S.: Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pp. 2117–2125 (2017)

  47. Liu, Z., Lin, Y., Cao, Y., Hu, H., Wei, Y., Zhang, Z., Lin, S., Guo B.: Proceedings of the IEEE/CVF International Conference on Computer Vision, pp. 10012–10022 (2021)

  48. Li, H., Li, J., Wei, H., Liu, Z., Zhan, Z., Ren, Q. J.:Slim-neck by GSConv: as better design paradigm of detector architectures for autonomous vehicles (2022)

  49. Zheng, Z., Li, J., Qin, L.: YOLO-BYTE: an efficient multi-object tracking algorithm for automatic monitoring of dairy cows. Comput. Electron. Agric. (2023). https://doi.org/10.1016/j.compag.2023.107857

    Article  Google Scholar 

  50. Li, J., Li, J., Zhao, X., Su, X., Wu, W.: Lightweight detection networks for tea bud on complex agricultural environment via improved YOLO v4. Comput. Electron. Agric. (2023). https://doi.org/10.1016/j.compag.2023.107955

    Article  Google Scholar 

  51. Zhang, Q., Yang, Q., Zhang, X., Wei, W., Bao, Q., Su, J., Liu, X.: A multi-label waste detection model based on transfer learning. Resour. Conserv. Recycl. (2022). https://doi.org/10.1016/j.resconrec.2022.106235

    Article  Google Scholar 

  52. Wang, S.-Y., Qu, Z., Li, C.-J., Gao, L.-Y.: BANet: Small and multi-object detection with a bidirectional attention network for traffic scenes. Eng. Appl. Artif. Intell. (2023). https://doi.org/10.1016/j.engappai.2022.105504

    Article  Google Scholar 

  53. Zhang, F., Wang, S., Cui, X., Wang, X., Cao, W., Yu, H., Fu, S., Pan, X.: Goat-face recognition in natural environments using the improved YOLOv4 algorithm. Agriculture (2022). https://doi.org/10.3390/agriculture12101668

    Article  Google Scholar 

  54. Wang, Z., Ling, Y., Wang, X., Meng, D., Nie, L., An, G., Wang, X.: An improved faster R-CNN model for multi-object tomato maturity detection in complex scenarios. Ecol. Inf. 72, 101886 (2022)

    Article  Google Scholar 

  55. Wu, L., Ma, J., Zhao, Y., Liu, H.: Apple detection in complex scene using the improved YOLOv4 model. Agronomy (2021). https://doi.org/10.3390/agronomy11030476

    Article  Google Scholar 

  56. Xu, L., Wang, Y., Shi, X., Tang, Z., Chen, X., Wang, Y., Zou, Z., Huang, P., Liu, B., Yang, N., Lu, Z., He, Y., Zhao, Y.: Real-time and accurate detection of citrus in complex scenes based on HPL-YOLOv4. Comput. Electron. Agric. (2023). https://doi.org/10.1016/j.compag.2022.107590

    Article  Google Scholar 

  57. Xiao, J., Liu, G., Wang, K., Si, Y.: Cow identification in free-stall barns based on an improved Mask R-CNN and an SVM. Comput. Electron. Agric. (2022). https://doi.org/10.1016/j.compag.2022.106738

    Article  Google Scholar 

  58. Gu, Z., Zhang, H., He, Z., Niu, K.: A two-stage recognition method based on deep learning for sheep behavior. Comput. Electron. Agric. (2023). https://doi.org/10.1016/j.compag.2023.108143

    Article  Google Scholar 

  59. Yang, W., Wu, J., Zhang, J., Gao, K., Du, R., Wu, Z., Firkat, E., Li, D.: Deformable convolution and coordinate attention for fast cattle detection. Comput. Electron. Agric. (2023). https://doi.org/10.1016/j.compag.2023.108006

    Article  Google Scholar 

Download references

Author information

Authors and Affiliations

Authors

Corresponding author

Correspondence to Xuemei Lei.

Ethics declarations

Conflict of interest

The authors have no relevant financial or non-financial interests to disclose.

Data availability

The datasets generated during the current study are available from the corresponding author on reasonable request.

Additional information

Publisher's Note

Springer Nature remains neutral with regard to jurisdictional claims in published maps and institutional affiliations.

Rights and permissions

Springer Nature or its licensor (e.g. a society or other partner) holds exclusive rights to this article under a publishing agreement with the author(s) or other rightsholder(s); author self-archiving of the accepted manuscript version of this article is solely governed by the terms of such publishing agreement and applicable law.

Reprints and permissions

About this article

Check for updates. Verify currency and authenticity via CrossMark

Cite this article

Lei, X., Wen, X. & Li, Z. A multi-target cow face detection model in complex scenes. Vis Comput 40, 9155–9176 (2024). https://doi.org/10.1007/s00371-024-03301-w

Download citation

  • Accepted:

  • Published:

  • Issue Date:

  • DOI: https://doi.org/10.1007/s00371-024-03301-w

Keywords