A Cascaded Individual Cow Identification Method Based on DeepOtsu and EfficientNet
Abstract
:1. Introduction
- A new method of individual cow identification was proposed. The method comprises the following steps. First, the cow trunk region was detected to obtain a body pattern image. Then, the pattern image was binarized to highlight the distribution characteristics of the black and white patterns. Finally, the binary pattern image was classified to identify the individual cow.
- The body pattern images of cows were classed by utilizing a cascaded classification method. The method can reduce the number of output ends of the classification model and improve the efficiency of the training. The identification accuracy, speed, and training time of the proposed method were compared with those of the end-to-end identification method, and the results showed that the proposed method is superior to the end-to-end method.
- The body pattern image was binarized by the deep learning method. The experimental results showed that the deep learning method can better describe the features of RGB body pattern images, remove the interference factors in the images, and achieve better binarization accuracy.
2. Materials and Methods
2.1. Dataset Construction
2.1.1. Video Acquisition
2.1.2. Video Decomposition and Processing
- (1)
- Decomposing the video into image frames. Video decomposition technology was used to decompose the cow side-looking walking videos into frame-by-frame images. The resolution of the cow side-looking image was 1280 pixels (horizontal) × 720 pixels (vertical).
- (2)
- Selecting the image frames randomly and quantitatively. For each walking video, 100 side-looking walking images were randomly selected, and it was ensured that each image contained the complete trunk of the cow.
- (3)
- Classifying the images. The side-view walking images belonging to the same cow were classified and placed into a folder.
- (4)
- Normalizing the number of images. For a folder containing more than 100 images, 100 images were randomly selected as the image dataset corresponding to the cow. The final constructed dataset contained 11,800 images of 118 cows.
- (5)
- Constructing and dividing the subdataset. Due to the large number of samples in the dataset, it is labor-intensive and unnecessary to annotate all the images to train and test the model. Therefore, 10 images of each cow in the dataset were randomly selected to construct a subdataset to train and test the trunk detection and body pattern binarization model. The subdataset contained 1180 images of 118 cows, and the subdataset was divided into a training set, validation set, and test set at a ratio of 5:3:2.
2.1.3. Image Annotation
2.1.4. Training and Test Platform
2.2. Detection of the Trunk Area
2.3. Binarization of Body Pattern Images
2.3.1. Traditional Binarization Method
2.3.2. DeepOtsu
2.4. Cascaded Classification of Body Pattern Images
2.4.1. Primary Classification
2.4.2. Secondary Classification
2.4.3. Training and Testing Process
3. Results
3.1. Analysis of Trunk Area Detection Results
3.2. Analysis of the Binarization Results of Body Pattern Images
- The reflection of the black hair area is caused by strong light, which makes the area very bright, as shown in the red rectangle in Figure 9.
- The white electric fence used to limit the walking range of cows leaves a linear white mark on the image of cow body patterns, as shown in the green rectangle in Figure 9.
- The stain in the trunk area makes the area dark, as shown in the yellow rectangle in Figure 9.
- Bright and dark areas are formed by the shadow on the cow, as shown in the blue rectangle in Figure 9.
- Slight overexposure causes the overall image to be brighter, as shown in the last column of Figure 9.
3.3. Analysis of Individual Identification Results of Dairy Cows
3.3.1. Training Results
3.3.2. Test Results
4. Discussion
4.1. Comparison between the Cascaded Method and End-to-End Method
4.2. Error Analysis
4.3. Comparison of the Proposed Method with Similar Studies
4.4. Future Research
5. Conclusions
Author Contributions
Funding
Institutional Review Board Statement
Data Availability Statement
Acknowledgments
Conflicts of Interest
References
- Rowe, E.; Dawkins, M.S.; Gebhardt-Henrich, S.G. A systematic review of precision livestock farming in the poultry sector: Is technology focussed on improving bird welfare? Animals 2019, 9, 614. [Google Scholar] [CrossRef] [PubMed] [Green Version]
- Tullo, E.; Finzi, A.; Guarino, M. Review: Environmental impact of livestock farming and precision livestock farming as a mitigation strategy. Sci. Total Environ. 2018, 650, 2751–2760. [Google Scholar] [CrossRef] [PubMed]
- Sébastien, F.; Rousseau, A.N.; Laberge, B. Rethinking environment control strategy of confined animal housing systems through precision livestock farming-sciencedirect. Biosyst. Eng. 2017, 155, 96–123. [Google Scholar] [CrossRef]
- Sun, Y.; Wang, Y.; Huo, P.; Cui, Z.; Zhang, Y. Research progress on methods and application of dairy cow identification. J. China Agric. Univ. 2019, 24, 62–70. [Google Scholar] [CrossRef]
- Porto, S.M.C.; Arcidiacono, C.; Giummarra, A.; Anguzza, U.; Cascone, G. Localisation and identification performances of a real-time location system based on ultra wide band technology for monitoring and tracking dairy cow behaviour in a semi-open free-stall barn. Comput. Electron. Agric. 2014, 108, 221–229. [Google Scholar] [CrossRef]
- Gygax, L.; Neisen, G.; Bollhalder, H. Accuracy and validation of a radar-based automatic local position measurement system for tracking dairy cows in free-stall barns. Comput. Electron. Agric. 2007, 56, 23–33. [Google Scholar] [CrossRef]
- Huhtala, A.; Suhonen, K.; Mäkelä, P.; Hakojärvi, M.; Ahokas, J. Evaluation of instrumentation for cow positioning and tracking indoors. Biosyst. Eng. 2007, 96, 399–405. [Google Scholar] [CrossRef]
- Hu, H.; Dai, B.; Shen, W.; Wei, X.; Sun, J.; Li, R.; Zhang, Y. Cow identification based on fusion of deep parts features. Biosyst. Eng. 2020, 192, 245–256. [Google Scholar] [CrossRef]
- Qiao, Y.; Guo, Y.; Yu, K.; He, D. C3D-ConvLSTM based cow behaviour classification using video data for precision livestock farming. Comput. Electron. Agric. 2022, 193, 106650. [Google Scholar] [CrossRef]
- Zhao, K.; Liu, X.; Ji, J. Automatic Body Condition Scoring Method for Dairy Cows Based on EfficientNet and Convex Hull Feature of Point Cloud. Trans. Chin. Soc. Agric. Mach. 2021, 52, 192–201+73. [Google Scholar] [CrossRef]
- Ji, J.; Liu, X.; Zhao, K. Automatic rumen filling scoring method for dairy cows based on SOLOv2 and cavity feature of point cloud. Trans. CSAE 2022, 38, 186–197. [Google Scholar] [CrossRef]
- Zhao, K.; He, D.; Wang, E. Detection of Breathing Rate and Abnormity of Dairy Cattle Based on Video Analysis. Trans. Chin. Soc. Agric. Mach. 2014, 45, 258–263. [Google Scholar] [CrossRef]
- 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, 187, 106313. [Google Scholar] [CrossRef]
- Zhao, K.; He, D. Recognition of individual dairy cattle based on convolutional neural networks. Trans. CSAE 2015, 31, 181–187. [Google Scholar]
- Zhao, K.; Jin, X.; Ji, J. Individual identification of Holstein dairy cows based on detecting and matching feature points in body images. Biosyst. Eng. 2019, 181, 128–139. [Google Scholar] [CrossRef]
- Cong, S.; Wang, J.; Zhang, R.; Zhao, L. Cattle identification using muzzle print images based on feature fusion. IOP Conf. Ser. Mater. Sci. Eng. 2020, 853, 012051. [Google Scholar] [CrossRef]
- Lu, Y.; He, X.; Wen, Y.; Wang, P.S.P. A new cow identification system based on iris analysis and recognition. Int. J. Biom. 2014, 6, 18–32. [Google Scholar] [CrossRef]
- Yang, S.; Liu, Y.; Wang, Z.; Han, Y.; Wang, Y.; Wang, Y.; Lan, X. Improved YOLO V4 model for face recognition of diary cow by fusing coordinate information. Trans. CSAE 2021, 37, 129–135. [Google Scholar] [CrossRef]
- Achour, B.; Belkadi, M.; Filali, I.; Laghrouche, M.; Lahdir, M. Image analysis for individual identification and feeding behaviour monitoring of dairy cows based on Convolutional Neural Networks (CNN). Biosyst. Eng. 2020, 198, 31–49. [Google Scholar] [CrossRef]
- Li, W.; Ji, Z.; Wang, L.; Sun, C.; Yan, X. Automatic individual identification of Holstein dairy cows using tailhead images. Comput. Electron. Agric. 2017, 142, 622–631. [Google Scholar] [CrossRef]
- Okura, F.; Ikuma, S.; Makihara, Y.; Muramatsu, D.; Nakada, K.; Yagi, Y. RGB-D video-based individual identification of dairy cows using gait and texture analyses. Comput. Electron. Agric. 2019, 165, 104944. [Google Scholar] [CrossRef]
- Zin, T.T.; Pwint, M.Z.; Seint, P.T.; Thant, S.; Misawa, S.; Sumi, K.; Yoshida, K. Automatic Cow Location Tracking System Using Ear Tag Visual Analysis. Sensors 2020, 20, 3564. [Google Scholar] [CrossRef] [PubMed]
- Zhang, R.; Zhao, K.; Ji, J.; Zhu, X. Automatic location and recognition of cow’s collar ID based on machine learning. J. Nanjing Agric. Univ. 2021, 44, 586–595. [Google Scholar] [CrossRef]
- Zhao, K.; Zhang, R.; Ji, J. A Cascaded Model Based on EfficientDet and YOLACT++ for Instance Segmentation of Cow Collar ID Tag in an Image. Sensors 2021, 21, 6734. [Google Scholar] [CrossRef]
- He, D.; Liu, J.; Xiong, H.; Lu, Z. Individual Identification of Dairy Cows Based on Improved YOLO v3. Trans. Chin. Soc. Agric. Mach. 2020, 51, 250–260. [Google Scholar] [CrossRef]
- Shen, W.Z.; Hu, H.Q.; Dai, B.S.; Wei, X.L.; Sun, J.; Jiang, L.; Sun, Y.K. Individual identification of dairy cows based on convolutional neural networks. Multimed. Tools Appl. 2020, 79, 14711–14724. [Google Scholar] [CrossRef]
- Tan, M.; Le, Q.V. Efficientnet: Rethinking Model Scaling for Convolutional Neural Networks. arXiv 2019, arXiv:11946. [Google Scholar]
- He, S.; Schomaker, L. DeepOtsu: Document enhancement and binarization using iterative deep learning. Pattern Recognit. 2019, 91, 379–390. [Google Scholar] [CrossRef] [Green Version]
- Liu, J.; Jiang, B.; He, D.; Song, H. Individual recognition of dairy cattle based on Gaussian mixture model and CNN. Comput. Appl. Softw. 2018. 35, 159–164. [CrossRef]
- Redmon, J.; Farhadi, A. YOLO9000: Better, Faster, Stronger. In Proceedings of the 2017 IEEE Conference on Computer Vision and Pattern Recognition(CVPR), Honolulu, HI, USA, 21–26 July 2017; pp. 6517–6525. [Google Scholar]
- Ge, Z.; Liu, S.; Wang, F.; Sun, J. YOLOX: Exceeding YOLO series in 2021. arXiv 2021, arXiv:2107.08430. [Google Scholar]
- Ronneberger, O.; Fischer, P.; Brox, T. U-net: Convolutional networks for biomedical image segmentation. In Proceedings of the International Conference on Medical Image Computing and Computer-Assisted Intervention, Munich, Germany, 5–9 October 2015; Springer: Cham, Switzerland, 2015; pp. 234–241. [Google Scholar]
- De Lima Weber, F.; de Moraes Weber, V.A.; Menezes, G.V.; Junior, A.d.S.O.; Alves, D.A.; de Oliveira, M.V.M.; Matsubara, E.T.; Pistori, H.; de Abreu, U.G.P. Recognition of Pantaneira cattle breed using computer vision and convolutional neural networks. Comput. Electron. Agric. 2020, 175, 105548. [Google Scholar] [CrossRef]
- Andrew, W.; Gao, J.; Mullan, S.; Campbell, N.; Dowsey, A.W.; Burghardt, T. Visual identification of individual Holstein-Friesian cattle via deep metric learning. Comput. Electron. Agric. 2021, 185, 106133. [Google Scholar] [CrossRef]
Index | I | II | III | IV |
---|---|---|---|---|
The number of cows | 23 | 29 | 49 | 47 |
Model | I | II | III | IV |
---|---|---|---|---|
EfficientNet-B0 | 1 | 1 | 0.985 | 0.963 |
EfficientNet-B1 | 1 | 1 | 0.997 | 0.971 |
EfficientNet-B2 | 0.372 | 0.274 | 0.125 | 0.128 |
Index | I | II | III | IV | Average |
---|---|---|---|---|---|
Acccls | 1 | 1 | 0.991 | 0.949 | 0.985 |
Classification time for a single image/s | 0.389 | 0.408 | 0.412 | 0.412 | 0.405 |
Index | Cascaded Method | End-to-End Method |
---|---|---|
Acccls | 0.985 | 0.987 |
Identification time of a single image/s | 0.405 | 0.432 |
Index | Cascaded Method | End-to-End Method | |||
---|---|---|---|---|---|
I | II | III | IV | EfficientNet-B1 | |
Training time/min | 32 | 39 | 70 | 66 | 132 |
Reference | Image Source | Identification Accuracy | Number of Cows |
---|---|---|---|
[8] | Side view images of cow | 98.36% | 93 |
[20] | Tailhead images | 99.7% | 10 |
[25] | Back images of cow | 95.91% | 89 |
[33] | Back image, left side profile image, right side profile image, facial image | 99% | 51 |
[26] | Side view images of cow | 96.65 | 105 |
[34] | Body pattern images (top view) | 93.8 | 46 |
Our method | Body pattern images (side view) | 98.5 | 118 |
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
Zhang, R.; Ji, J.; Zhao, K.; Wang, J.; Zhang, M.; Wang, M. A Cascaded Individual Cow Identification Method Based on DeepOtsu and EfficientNet. Agriculture 2023, 13, 279. https://doi.org/10.3390/agriculture13020279
Zhang R, Ji J, Zhao K, Wang J, Zhang M, Wang M. A Cascaded Individual Cow Identification Method Based on DeepOtsu and EfficientNet. Agriculture. 2023; 13(2):279. https://doi.org/10.3390/agriculture13020279
Chicago/Turabian StyleZhang, Ruihong, Jiangtao Ji, Kaixuan Zhao, Jinjin Wang, Meng Zhang, and Meijia Wang. 2023. "A Cascaded Individual Cow Identification Method Based on DeepOtsu and EfficientNet" Agriculture 13, no. 2: 279. https://doi.org/10.3390/agriculture13020279
APA StyleZhang, R., Ji, J., Zhao, K., Wang, J., Zhang, M., & Wang, M. (2023). A Cascaded Individual Cow Identification Method Based on DeepOtsu and EfficientNet. Agriculture, 13(2), 279. https://doi.org/10.3390/agriculture13020279