Developments in deep learning and AI to combat mastitis

15-09-2023 | |
Led by Professor Andrew Dowsey, from Bristol Veterinary School, the study plans to use AI to monitor social interactions of cattle around early detection of mastitis and lameness. Photo: Canva
Led by Professor Andrew Dowsey, from Bristol Veterinary School, the study plans to use AI to monitor social interactions of cattle around early detection of mastitis and lameness. Photo: Canva

Enhancements in deep learning and artificial intelligence are increasingly being trialled for automatic diagnosis in the early stages of dairy cow mastitis.

Mastitis seriously reduces the welfare and milk yields of dairy cows and affects the economic value of farms, costing in the UK, for example, around £170 million annually.

Most dairy cow mastitis detection algorithms based on computer vision have used the threshold classification method to detect mastitis, relying on the temperature feature of cows’ udders, and the results are easily affected by the farm environment and individual cow characteristics.

Automatic detection method for dairy cow mastitis

Researchers at the Key Lab of Smart Agriculture Systems, China Agricultural University, have used an automatic detection method for dairy cow mastitis, using the fusion of udder temperature and size features based on deep learning. Using the ‘you only look once’ version 7 (YOLOv7) network to automatically detect the eye and udder regions of dairy cows, they extracted the corresponding temperatures and constructed an udder temperature feature vector.

They then used the CenterNet network to automatically detect the key points of udder region, calculate the corresponding size and construct an udder size feature vector. Finally, both the temperature and the size features of udders were fused, and the support vector machine algorithm based on the wrapper was used to automatically detect the degree of mastitis.

The study involved thermal infrared videos of 196 dairy cows as the dataset for evaluating the performance of the proposed method, according to a report published this month in the journal, Computers and Electronics in Agriculture, Fusion of udder temperature and size features for the automatic detection of dairy cow mastitis using deep learning – ScienceDirect

The results showed:

  • Accuracy of the proposed method was 88.61%.
  • The sensitivity and specificity values of the model for clinical mastitis were 87.50% and 94.03%, respectively.
  • The sensitivity and specificity values of the model for subclinical mastitis were 81.25% and 91.94%, respectively.

The report authors say the proposed method constitutes a promising approach for automatic diagnosis in the early stages of dairy cow mastitis, suggesting the method could be used for objective monitoring and optimal management on commercial farms.

Funding for artificial intelligence (AI)

Meanwhile, researchers the University of Bristol have been awarded funding to see whether artificial intelligence could be used to detect disease in dairy animals at an earlier stage.

Led by Professor Andrew Dowsey from Bristol Veterinary School, the study plans to use artificial intelligence to monitor social interactions of cattle around early detection of mastitis and lameness. Sick cows have also been found to contribute a higher proportion of methane emissions, impacting the environmental sustainability of the sector.

Most of the current research which considers the automation of the detection of diseases in dairy cows tend to focus on observable symptoms linked with later stages of the disease. The Bristol team are keen to build on previous research using AI to detect the 2 diseases at an earlier stage.

“We think social behaviour changes could be early predictors of disease…”

Early stage mastitis

The earlier study, which was conducted 2 years ago by Caplan at Bristol Veterinary School – Changes in social and feeding behaviors, activity, and salivary serum amyloid A in cows with subclinical mastitis – PubMed (nih.gov) – found that social exploration, the grooming of others and receiving head-butts were all lower in cows with early-stage mastitis.

“A cow’s response to infection or trauma is to reduce behaviours which are not immediately essential to survival, such as social interactions… So we think social behaviour changes could be early predictors of disease,” he added.

Dowsey and the team have developed AI that can track the motion of cows, recognising each one by its distinctive coat pattern: “From collecting 2 years of video from 64 cameras covering our main barn at the John Oldacre dairy farm, we will train a model that learns what types of behaviours change over time that are indicative of early-stage mastitis and lameness.”

The system will then be redeployed at a network of recruited farms for testing.

Other research in this area has tended to use electronic 3D motion detectors to detect early symptoms. Data from motion detectors were defined as time spent by animals on feed intake, ruminating, physical activity and rest, and were expanded by adding information about feeding group, breed type and lactation number – Early detection of mastitis in cows using the system based on 3D motions detectors – PMC (nih.gov)

Join 13,000+ subscribers

Subscribe to our newsletter to stay updated about all the need-to-know content in the dairy sector, two times a week.

McDougal
Tony McDougal Freelance journalist
More about