Skip to main content

Early detection of infectious bovine keratoconjunctivitis with artificial intelligence


Artificial intelligence (AI) was developed to distinguish cattle by their muzzle patterns and identify early cases of disease, including infectious bovine keratoconjunctivitis (IBK). It was tested on 870 cattle in four locations, with 170 developing IBK. The AI identified 169 of the 170 cases prior to their identification by veterinarians, and another 17 cases that remained free of IBK signs (sensitivity = 99.4%, specificity = 97.6%). These results indicate the AI can detect emerging IBK cases by muzzle images very early in the disease process and be used as an intervention tool in the prevention of IBK outbreaks.

Introduction, methods, and results

Infectious bovine keratoconjunctivitis (IBK), also known as pinkeye, is the most important ocular disease of cattle in the United States and throughout much of the world [1, 2]. The disease is both a cattle welfare and economic problem [1, 3]. IBK is painful, with clinical signs that include lacrimation, blepharospasm, photophobia, epiphora, and serous or mucopurulent conjunctivitis [3, 4]. Corneas can become scarred and severe IBK cases can lead to permanent blindness [2, 3]. Cattle with IBK can have reduced weaning weights, incurring a substantial economic loss [1].

IBK is a disease complex that often involves bacterial species of Moraxella, including Moraxella bovis, which is a causative agent of IBK, and a specific genotype of Moraxella bovoculi (genotype 1) which associates with the disease but has not been shown to directly cause it [2, 5, 6]. Additional bacteria have been associated with IBK, or IBK-like disease in what appear to be more minor roles, including Mycoplasma bovis, Mycoplasma bovoculi, Ureplasma species, Listeria monocytogenes, and Chlamydia species, although the exact roles and strength of IBK associations for many of them is unclear [7]. Also, some viruses can cause ocular lesions in cattle including herpesvirus BoHV-1 and a γ-herpesvirus [7].

In the US, approved antibiotic treatments for IBK are oxytetracycline and the macrolide tulathromycin [8]. The treatments can be effective, however, they come at an economic cost, and their application in cattle raises concerns of a spike of antimicrobial resistance that could potentially spill over from cattle to humans or components of the environment [9, 10]. Given that, a primary goal for IBK is prevention [11]. There currently are no highly efficacious vaccines that protect cattle from IBK in the field, thus, there is a need for novel solutions to preventing IBK outbreaks in cattle [11, 12].

Like fingerprints of humans, muzzle dermatoglyphic patterns of cattle can identify the animals at the individual level [13, 14]. Features can be extracted from digital camera images with algorithms such as scale-invariant feature transform (SIFT) or maximally stable extremal regions (MSER), that can be used with machine learning, deep learning or convolutional neural networks for individual identification [15, 16]. The possibilities of muzzle dermatoglyphics with artificial intelligence applications in the early detection of diseases are only now beginning to be explored. In the case of IBK, early muzzle changes that proceed visible signs of disease have not been reported in the literature, but seemed possible prior to this study as the bovine cornea epithelium is densely but only superficially innervated [3], indicating that very early stages of IBK are likely painful to the animal, which in turn could affect the muzzle appearance. Early detection of animals about to break with IBK would be critically important for the development of interventions that prevent IBK outbreaks. Therefore, the goals of this study were to create a database of muzzle images of cattle with and without signs of IBK, to create a pipeline for image feature extraction, to train machine learning to differentiate between muzzle images of cattle with and without signs of IBK, and to test the ability of the artificial intelligence system to detect cattle with early, breaking cases of IBK before veterinarians could detect signs of the disease.

Creation of a pipeline to identify sick cattle by images of their muzzles

The AI pipeline was made of two different models. The first model was designed to extract critical information about cattle muzzles using pictures. The second was designed to predict whether or not cattle were sick by comparing their pictures to those in MyAnIML’s large database of healthy and sick muzzles (Figures 1 and 2). For this study, we developed preliminary AI algorithms using Regional Convolutional Neural Networks (RCNNs and Pytorch). We developed our own RCNNs for object detection as well as image classification tasks across datasets. We used Sagemaker from AWS to do analyses on the cloud. We also compared Yolo3 with RCNN, Tensorflow, and Pytorch.

Figure 1
figure 1

Pictures of cattle taken with GoPro camera mounted on feeder truck. The AI grabs individual images for analyses.

Figure 2
figure 2

Pipeline overview of the technology. Every pixel of the image is classified as either pertaining to the individual cattle or not. Machine learning extracts facial features so the computer would know what is background and what is cattle. The system ends up knowing exactly which pixels belong to a particular animal. A bounding box is drawn around the pertinent part of the image and cropped out. This both improves model accuracy and reduces storage and processing costs.

To identify and crop the muzzle from the pictures, the AI measured an animal’s face by measuring the distance from the left-to-right ear and forehead-to-lower chin (Figure 2). The AI would then create a “virtual box” of the individual’s face so that it could be analyzed (Figure 2). Once the system obtained facial feature extractions, it created a muzzle extraction net (Figure 2).

Since there were no cattle facial and muzzle libraries publicly available prior to this study, we developed one with the help of our partners. We captured 3000 healthy beef cattle pictures to train the AI. We also captured 1500 sick beef cattle pictures. Most of the cattle were crossbreeds. Out of 1500 sick cattle pictures, we had 800 IBK cases and 600 bovine respiratory disease (BRD) cases, and the rest were of different diseases such as foot rot, uterus infection, ect. The pictures were used to show the system the difference between healthy and sick muzzles.

IBK study

An IBK study was conducted in the summers of 2021 (June–Aug) and 2022 (July and Aug). The cattle were Angus 40%, Hereford 35%, and Charolais 25%, with 55% mature animals, 25% calves, and 20% heifers. Muzzle pictures were taken in three different cattle backgrounder operations in the Kansas City area: Paola, Harrisonville, Garnett, and Kansas City, KS. Paola and Kansas City, KS were from one backgrounder with two different locations. The first set of pictures was taken in 2021 with either cell phones or digital cameras, and was of animals contained within a squeeze chute. The second set was taken in 2022 using a GoPro camera on a Feeder Truck (Figure 1). In 2021, 150 cattle were photographed in Paola and 220 were photographed in Kansas City (see Table 1 for cattle numbers and IBK results). In 2022, 200 cattle were photographed in Harrisonville and 300 cattle were photographed in Garnett. All 870 muzzle pictures were analyzed by our AI for the early detection of IBK. Additionally, all 870 animals in the study were examined for IBK by veterinarians the same day their pictures were taken, and 1–2 days after they were taken. Disease diagnoses were made by the veterinarians and none of the animals were diagnosed with IBK on the day their pictures were taken. The veterinarians were notified to check on cattle flagged by our AI system as having IBK in the interest of animal welfare. Of the 870 animals, 170 were diagnosed with IBK based on early signs including lacrimation with epiphora. The veterinarians also checked for signs of mechanical injury to the eyes which would have excluded an IBK diagnosis. Prior to their diagnosis, 169 of the 170 cases were identified as developing IBK by the AI (sensitivity = 99.4%). The AI identified another 17 animals that would develop IBK but remained negative during the study (specificity = 97.6%).

Table 1 IBK study information.


Surveillance and early detection of infectious disease is a key component to disease management and outbreak control [17]. This is particularly true for diseases in which efficacious vaccines are lacking, like IBK. IBK can emerge quickly in cattle herds and is considered highly contagious, although the exact mechanisms by which M. bovis, M. bovoculi, and other IBK-associated bacteria spread from animal to animal are unclear [3]. Thus, the AI system developed in this study could be used as an intervention tool to prevent IBK outbreaks, given that it accurately predicted the emergence of IBK cases very early in the disease progression. Environmental practices used to control the spread or severity of IBK could be implemented earlier through AI, such as enhanced fly control protocols, greater shading for protection from ultraviolet light, and disinfection between the processing or handling of cases [18, 19]. Infected animals could also be separated from their uninfected herd mates when possible. Additionally, the early identification of cases could lead to judicious administration of antibiotics before a large outbreak had the chance to emerge.

There are limitations to the system in its current stage of development. The AI was trained exclusively on beef cattle, thus additional training with dairy cattle muzzles would be necessary prior to its use for IBK detection in dairy cattle. Additional data on beef cattle could be used to train the system further, and potentially detect any specific breed effects regarding muzzle profiles with or without IBK. Visual inspection of the muzzles of cattle predicted to develop IBK in this study did not reveal a clear phenotype that correlated exclusively with the disease, thus the biological differences between the muzzles of healthy beef cattle versus those of emerging IBK cases are not fully understood. Notably, M. bovis and M. bovoculi strain types that associate with IBK can all carry the repeats-in-toxin hemolysin [6, 20], which is considered one of their main virulence factors [21]. It is possible these different organisms may elicit a similar effect on the cornea or the muzzle through hemolysin, or other biological determinants, that is not fully apparent to human eyes. Additional research could address this possibility, and facilitate calibration of the AI system to specific IBK pathogens and/or virulence factors.

How far can we push AI for disease detection in cattle? Many cattle diseases, like IBK, are polymicrobial, which gives the possibility of different muzzle phenotypes for the same disease. One of the most important diseases of cattle worldwide is BRD, which is both multifactorial and polymicrobial. The AI system is currently being trained to predict BRD by muzzle profiles, and early results indicate that it can distinguish emerging cases, although more training of the system with larger numbers of animals will be required to match the sensitivity and specificity of detection for IBK. Ultimately, AI may be incorporated as a vital tool for precision management of cattle, ensuring maximal health and well-being as part of the production process.

Availability of data and materials

Cattle muzzle pictures in the MyAnIML database that were used to train MyAnIML’s proprietary AI system are not publicly available. Data from the IBK study are available from corresponding author Shekhar Gupta upon reasonable request.


  1. Dennis EJ, Kneipp M (2021) A review of global prevalence and economic impacts of infectious bovine keratoconjunctivitis. Vet Clin North Am Food Anim Pract 37:355–369.

    Article  PubMed  Google Scholar 

  2. Irby NL, Angelos JA (2018) 14 - Ocular Diseases, from Rebhun’s Diseases of Dairy Cattle. 3rd edn

  3. Kneipp M (2021) Defining and diagnosing infectious bovine keratoconjunctivitis. Vet Clin North Am Food Anim Pract 37:237–252.

    Article  PubMed  Google Scholar 

  4. Dewell RD, Millman ST, Gould SA, Tofflemire KL, Whitley RD, Parsons RL, Rowe EW, Liu F, Wang C, O’Connor AM (2014) Evaluating approaches to measuring ocular pain in bovine calves with corneal scarification and infectious bovine keratoconjunctivitis-associated corneal ulcerations. J Anim Sci 92:1161–1172.

    Article  CAS  PubMed  Google Scholar 

  5. Dickey AM, Loy JD, Bono JL, Smith TP, Apley MD, Lubbers BV, DeDonder KD, Capik SF, Larson RL, White BJ, Blom J, Chitko-McKown CG, Clawson ML (2016) Large genomic differences between Moraxella bovoculi isolates acquired from the eyes of cattle with infectious bovine keratoconjunctivitis versus the deep nasopharynx of asymptomatic cattle. Vet Res 47:31.

    Article  CAS  PubMed  PubMed Central  Google Scholar 

  6. Dickey AM, Schuller G, Loy JD, Clawson ML (2018) Whole genome sequencing of Moraxella bovoculi reveals high genetic diversity and evidence for interspecies recombination at multiple loci. PLoS One 13:e0209113.

    Article  CAS  PubMed  PubMed Central  Google Scholar 

  7. Loy JD, Clothier KA, Maier G (2021) Component causes of infectious bovine keratoconjunctivitis-non-Moraxella organisms in the epidemiology of infectious bovine keratoconjunctivitis. Vet Clin North Am Food Anim Pract 37:295–308.

    Article  PubMed  Google Scholar 

  8. O’Connor AM, Kneipp M (2021) Evidence base for treatment of infectious bovine keratoconjunctivitis. Vet Clin North Am Food Anim Pract 37:329–339.

    Article  PubMed  Google Scholar 

  9. Velazquez-Meza ME, Galarde-Lopez M, Carrillo-Quiroz B, Alpuche-Aranda CM (2022) Antimicrobial resistance: one health approach. Vet World 15:743–749.

    Article  CAS  PubMed  PubMed Central  Google Scholar 

  10. Sagar P, Aseem A, Banjara SK, Veleri S (2023) The role of food chain in antimicrobial resistance spread and one health approach to reduce risks. Int J Food Microbiol 391–393:110148.

    Article  CAS  PubMed  Google Scholar 

  11. Maier G, O’Connor AM, Sheedy D (2021) The evidence base for prevention of infectious bovine keratoconjunctivitis through vaccination. Vet Clin North Am Food Anim Pract 37:341–353.

    Article  PubMed  Google Scholar 

  12. Hille MM, Spangler ML, Clawson ML, Heath KD, Vu HLX, Rogers RES, Loy JD (2022) A five year randomized controlled trial to assess the efficacy and antibody responses to a commercial and autogenous vaccine for the prevention of infectious bovine keratoconjunctivitis. Vaccines 10:916.

    Article  CAS  PubMed  PubMed Central  Google Scholar 

  13. Petersen WE (1922) The identification of the bovine by means of nose-prints. J Dairy Sci 5:249–258

    Article  Google Scholar 

  14. Tharwat A, Gaber T, Hassanien AE, Hassanien HA (2014) Cattle identification using muzzle print images based on texture features approach. In: Proceedings of the Fifth International Conference on Innovations in Bio-Inspired Computing and Applications IBICA. Advances in Intelligent Systems and Computing vol. 303. Czech Republic

  15. Awad AI, Hassaballah M (2019) Bag-of-visual-words for cattle identification from muzzle print images. Appl Sci 9:4914.

    Article  Google Scholar 

  16. Hossain ME, Kabir MA, Zheng L, Swain DL, McGrath S, Medway J (2022) A systematic review of machine learning techniques for cattle identification: datasets, methods and future directions. Artif Intell Agric 6:138–155

    Google Scholar 

  17. Steele L, Orefuwa E, Bino S, Singer SR, Lutwama J, Dickmann P (2020) Earlier outbreak detection-A generic model and novel methodology to guide earlier detection supported by data from low- and mid-income countries. Front Public Health 8:452.

    Article  PubMed  PubMed Central  Google Scholar 

  18. Maier G, Doan B, O’Connor AM (2021) The role of environmental factors in the epidemiology of infectious bovine keratoconjunctivitis. Vet Clin North Am Food Anim Pract 37:309–320.

    Article  PubMed  Google Scholar 

  19. Angelos JA (2015) Infectious bovine keratoconjunctivitis (pinkeye). Vet Clin North Am Food Anim Pract 31(61–79):v–vi.

    Article  Google Scholar 

  20. Wynn EL, Hille MM, Loy JD, Schuller G, Kuhn KL, Dickey AM, Bono JL, Clawson ML (2022) Whole genome sequencing of Moraxella bovis strains from North America reveals two genotypes with different genetic determinants. BMC Microbiol 22:258.

    Article  CAS  PubMed  PubMed Central  Google Scholar 

  21. Loy JD, Hille M, Maier G, Clawson ML (2021) Component causes of infectious bovine keratoconjunctivitis—the role of Moraxella species in the epidemiology of infectious bovine keratoconjunctivitis. Vet Clin North Am Food Anim Pract 37:279–293.

    Article  PubMed  Google Scholar 

Download references


We thank the ranchers and veterinarians who participated in this study. The use of product and company names is necessary to accurately report the methods and results; however, the USDA neither guarantees nor warrants the standard of the products, and the use of names by the USDA implies no approval of the product to the exclusion of others that may also be suitable. The USDA is an equal opportunity provider and employer.


Funding was provided by MyAnIML. AK and MLC were supported by the USDA/ARS project numbers 3040-31000-104-000-D and 3040-32000-036-000-D.

Author information

Authors and Affiliations



SG created the AI system, designed the experiment, interpreted and analyzed the results, and revised the manuscript. LAK analyzed the results and revised the manuscript. MLC interpreted the results and drafted the manuscript. All authors read and approved the final manuscript.

Corresponding authors

Correspondence to Shekhar Gupta or Michael L. Clawson.

Ethics declarations

Ethics approval and consent to participate

Cattle owners gave informed consent for the use their animals in this study.

Competing interests

SG is founder and CEO of the company myAnIML. LAK and MLC declare that they have no competing interests.

Additional information

Handling editor: Freddy Haesebrouck.

Publisher's Note

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

Rights and permissions

Open Access This article is licensed under a Creative Commons Attribution 4.0 International License, which permits use, sharing, adaptation, distribution and reproduction in any medium or format, as long as you give appropriate credit to the original author(s) and the source, provide a link to the Creative Commons licence, and indicate if changes were made. The images or other third party material in this article are included in the article's Creative Commons licence, unless indicated otherwise in a credit line to the material. If material is not included in the article's Creative Commons licence and your intended use is not permitted by statutory regulation or exceeds the permitted use, you will need to obtain permission directly from the copyright holder. To view a copy of this licence, visit The Creative Commons Public Domain Dedication waiver ( applies to the data made available in this article, unless otherwise stated in a credit line to the data.

Reprints and permissions

About this article

Check for updates. Verify currency and authenticity via CrossMark

Cite this article

Gupta, S., Kuehn, L.A. & Clawson, M.L. Early detection of infectious bovine keratoconjunctivitis with artificial intelligence. Vet Res 54, 122 (2023).

Download citation

  • Received:

  • Accepted:

  • Published:

  • DOI: