Citation: Gupta, H.; Jindal, P.; Verma,
O.P.; Arya, R.K.; Ateya, A.A.;
Soliman, N.F.; Mohan, V. Computer
Vision-Based Approach for
Automatic Detection of Dairy Cow
Breed. Electronics 2022, 11, 3791.
https://doi.org/10.3390/
electronics11223791
Academic Editor: Silvia Liberata Ullo
Received: 27 October 2022
Accepted: 16 November 2022
Published: 18 November 2022
Publisher’s Note: MDPI stays neutral
with regard to jurisdictional claims in
published maps and institutional affil-
iations.
Copyright: © 2022 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/).
Article
Computer Vision-Based Approach for Automatic Detection of
Dairy Cow Breed
Himanshu Gupta
1
, Parul Jindal
1
, Om Prakash Verma
1
, Raj Kumar Arya
2
, Abdelhamied A. Ateya
3
,
Naglaa. F. Soliman
4,
* and Vijay Mohan
5,
*
1
Department of Instrumentation and Control Engineering, Dr. B. R. Ambedkar National Institute of
Technology Jalandhar, Jalandhar 144027, India
2
Department of Chemical Engineering, Dr. B. R. Ambedkar National Institute of Technology Jalandhar,
Jalandhar 144027, India
3
Department of Electronics and Communications Engineering, Zagazig University, Zagazig 44519, Egypt
4
Department of Information Technology, College of Computer and Information Sciences, Princess Nourah Bint
Abdulrahman University, P.O. Box 84428, Riyadh 11671, Saudi Arabia
5
Department of Mechatronics, Manipal Institute of Technology, Manipal Academy of Higher Education,
Manipal 576104, India
* Correspondence: nfsoliman@pnu.edu.sa (N.F.S.); vijay.mohan@manipal.edu (V.M.)
Abstract: Purpose
: Identification of individual cow breeds may offer various farming opportunities
for disease detection, disease prevention and treatment, fertility and feeding, and welfare monitoring.
However, due to the large population of cows with hundreds of breeds and almost identical visible
appearance, their exact identification and detection become a tedious task. Therefore, the automatic
detection of cow breeds would benefit the dairy industry. This study presents a computer-vision-
based approach for identifying the breed of individual cattle.
Methods
: In this study, eight breeds
of cows are considered to verify the classification process: Afrikaner, Brown Swiss, Gyr, Holstein
Friesian, Limousin, Marchigiana, White Park, and Simmental cattle. A custom dataset is developed
using web-mining techniques, comprising 1835 images grouped into 238, 223, 220, 212, 253, 185, 257,
and 247 images for individual breeds. YOLOv4, a deep learning approach, is employed for breed
classification and localization. The performance of the YOLOv4 algorithm is evaluated by training the
model on different sets of training parameters.
Results
: Comprehensive analysis of the experimental
results reveal that the proposed approach achieves an accuracy of 81.07%, with maximum kappa of
0.78 obtained at an image size of 608
×
608 and an intersection over union (IoU) threshold of 0.75 on
the test dataset.
Conclusions
: The model performed better with YOLOv4 relative to other compared
models. This places the proposed model among the top-ranked cow breed detection models. For
future recommendations, it would be beneficial to incorporate simple tracking techniques between
video frames to check the efficiency of this work.
Keywords:
automatic livestock farming; cow breed classification; deep learning; object
detection
; YOLOv4
1. Introduction
Animal husbandry is one of the most lucrative and demanding businesses worldwide
and contributes significantly to the nation’s gross domestic product (GDP). As per the
report published by the World Bank (2022), agriculture (and its allied sectors) accounts for
almost 4.01% of the world’s GDP, which in developing countries significantly increases
up to 25% [
1
]. Figure 1 represents India’s GDP distribution, showing that agriculture
contributes nearly 19% of the GDP [
2
]. In particular, dairy farming contributes majorly
(about 5.30%), with milk as the significant livestock product [
3
]. As per the report published
in 2020 by Indian National Accounts Statistics (NAS), the livestock sector contributes 4.19%
of the total gross value added (GVA) and 28.63% of the total agriculture and allied sector
GVA [
2
]. These businesses are majorly governed by small, peripheral farmers and landless
Electronics 2022, 11, 3791. https://doi.org/10.3390/electronics11223791 https://www.mdpi.com/journal/electronics