Skip to main page content
U.S. flag

An official website of the United States government

Dot gov

The .gov means it’s official.
Federal government websites often end in .gov or .mil. Before sharing sensitive information, make sure you’re on a federal government site.

Https

The site is secure.
The https:// ensures that you are connecting to the official website and that any information you provide is encrypted and transmitted securely.

Access keys NCBI Homepage MyNCBI Homepage Main Content Main Navigation
. 2021 Nov 29;16(11):e0260510.
doi: 10.1371/journal.pone.0260510. eCollection 2021.

Individual dairy cow identification based on lightweight convolutional neural network

Affiliations

Individual dairy cow identification based on lightweight convolutional neural network

Shijun Li et al. PLoS One. .

Erratum in

Abstract

In actual farms, individual livestock identification technology relies on large models with slow recognition speeds, which seriously restricts its practical application. In this study, we use deep learning to recognize the features of individual cows. Alexnet is used as a skeleton network for a lightweight convolutional neural network that can recognise individual cows in images with complex backgrounds. The model is improved for multiple multiscale convolutions of Alexnet using the short-circuit connected BasicBlock to fit the desired values and avoid gradient disappearance or explosion. An improved inception module and attention mechanism are added to extract features at multiple scales to enhance the detection of feature points. In experiments, side-view images of 13 cows were collected. The proposed method achieved 97.95% accuracy in cow identification with a single training time of only 6 s, which is one-sixth that of the original Alexnet. To verify the validity of the model, the dataset and experimental parameters were kept constant and compared with the results of Vgg16, Resnet50, Mobilnet V2 and GoogLenet. The proposed model ensured high accuracy while having the smallest parameter size of 6.51 MB, which is 1.3 times less than that of the Mobilnet V2 network, which is famous for its light weight. This method overcomes the defects of traditional methods, which require artificial extraction of features, are often not robust enough, have slow recognition speeds, and require large numbers of parameters in the recognition model. The proposed method works with images with complex backgrounds, making it suitable for actual farming environments. It also provides a reference for the identification of individual cows in images with complex backgrounds.

PubMed Disclaimer

Conflict of interest statement

The authors have declared that no competing interests exist.

Figures

Fig 1
Fig 1. Examples of individual cow images.
Fig 2
Fig 2. Alexnet model structure.
Fig 3
Fig 3. SE block.
Fig 4
Fig 4. Flowchart of the dairy cow identification process.
Fig 5
Fig 5. Structure of the model used in this research.
Fig 6
Fig 6. Multi-scale module.
Fig 7
Fig 7. BasicBlock + SE module.
Fig 8
Fig 8. Accuracy of the model trained on the system with the GPU.
Fig 9
Fig 9. Comparison of the results of different network models.
Fig 10
Fig 10. (a) Images of cows with a simple background, (b) accuracy and loss rate curves of the training model with the dataset with simple backgrounds.
Fig 11
Fig 11. Example cow heat maps.

References

    1. Oliveira D A B, Pereira L G R, Bresolin T, Ferreira R. E. P., & Drea J. R. R. A Review of Deep Learning Algorithms for Computer Vision Systems in Livestock. Livestock Science, 2021;104700.
    1. Beibei Xu, Wensheng Wang, Leifeng Guo, & Guipeng Chen. Research progress and Prospect of cattle identification based on Contactless. China Agricultural Science and technology Herald, 2020;22 (7): 11
    1. Dongjian He, Dong Liu, & Kaixuan Zhao. Research progress on intelligent perception and behaviour detection of animal information in precision animal husbandry. Journal of agricultural machinery, 2016;47 (5), 231–244
    1. Yukun Sun, Yujie Wang, Pengju Huo, Ziqi Cui, & Yonggen Zhang. Research progress on cow individual recognition methods and their applications. Journal of China Agricultural University, 2019;24 (12), 62–70
    1. Fosgate G. T, Adesiyun A. A, & Hird D. W. Ear-tag retention and identification methods for extensively managed water buffalo (Bubalus bubalis) in Trinidad. Preventive veterinary medicine, 2006;73(4), 287–296. doi: 10.1016/j.prevetmed.2005.09.006 - DOI - PubMed

Publication types