1
|
Bauer EA, Jagusiak W. Prediction of ketosis using radial basis function neural network in dairy cattle farming. Prev Vet Med 2024; 235:106410. [PMID: 39721179 DOI: 10.1016/j.prevetmed.2024.106410] [Citation(s) in RCA: 0] [Impact Index Per Article: 0] [Reference Citation Analysis] [Abstract] [Key Words] [Track Full Text] [Journal Information] [Subscribe] [Scholar Register] [Received: 04/12/2024] [Revised: 11/04/2024] [Accepted: 12/15/2024] [Indexed: 12/28/2024]
Abstract
The purpose of the paper was to apply an Artificial Neural Networks with Radial Basis Function to develop an application model for diagnosing a subclinical ketosis type I and II in dairy cattle. While building the neural network model, applied methodology was compatible to the procedures used in Data Mining processes. The data set was created based on the composition of milk samples of 1520 Polish Holstein-Friesian cows. The milk samples were collected during test-day milkings and made available by Polish Federation of Cattle Breeders and Milk Producers. The milk composition parameters were used as the input variables for RBF network models. The value of the output variable was determined based on the content of β-hydroxybutyric acid in blood of cows. In the next stage of the work, the qualities of the pre-selected models were compared and the best ones were chosen. The sensitivity and specificity as well as the size of the AUC (Area Under the Curve) under the ROC (Receiver Operating Characteristic) were taken as the main criteria for network models evaluation. The model characterized by sensitivity of 0.86, specificity of 0.71 and AUC of 0.89 was selected for ketosis type I. The optimal for ketosis type II showed the sensitivity and specificity 0.81 and 0.75, respectively, and the size of AUC above 0.85. Chosen models were recorded using the predictive modelling markup language (PMML) for data mining models to be shared and used between the different applications.
Collapse
Affiliation(s)
- Edyta A Bauer
- Department of Animal Reproduction, Anatomy and Genomics, Faculty of Animal Science, University of Agriculture in Krakow, al. Mickiewicza 24/28, Krakow 30-059, Poland.
| | - Wojciech Jagusiak
- Department of Genetics, Animal Breeding and Ethology, Faculty of Animal Science, University of Agriculture in Krakow, al. Mickiewicza 24/28, Krakow 30-059, Poland.
| |
Collapse
|
2
|
Taechachokevivat N, Kou B, Zhang T, Montes ME, Boerman JP, Doucette JS, Neves RC. Evaluating the performance of herd-specific Long Short-Term Memory models to identify automated health alerts associated with a ketosis diagnosis in early lactation cows. J Dairy Sci 2024:S0022-0302(24)01108-1. [PMID: 39245172 DOI: 10.3168/jds.2023-24513] [Citation(s) in RCA: 0] [Impact Index Per Article: 0] [Reference Citation Analysis] [Abstract] [Key Words] [Track Full Text] [Journal Information] [Subscribe] [Scholar Register] [Received: 12/07/2023] [Accepted: 08/07/2024] [Indexed: 09/10/2024]
Abstract
The growing use of automated systems in the dairy industry generates a vast amount of cow-level data daily, creating opportunities for using these data to support real-time decision-making. Currently, various commercial systems offer built-in alert algorithms to identify cows requiring attention. To our knowledge, no work has been done to compare the use of models accounting for herd-level variability on their predictive ability against automated systems. Long Short-Term Memory (LSTM) models are machine learning models capable of learning temporal patterns and making predictions based on time series data. The objective of our study was to evaluate the ability of LSTM models to identify a health alert associated with a ketosis diagnosis (HAK) using deviations of daily milk yield, milk FPR, number of successful milkings, rumination time, and activity index from the herd median by parity and DIM, considering various time series lengths and numbers of d before HAK. Additionally, we aimed to use Explainable Artificial Intelligence method to understand the relationships between input variables and model outputs. Data on daily milk yield, milk fat-to-protein ratio (FPR), number of successful milkings, rumination time, activity, and health events during 0 to 21 d in milk (DIM) were retrospectively obtained from a commercial Holstein dairy farm in northern Indiana from February 2020 to January 2023. A total of 1,743 cows were included in the analysis (non-HAK = 1,550; HAK = 193). Variables were transformed based on deviations from the herd median by parity and DIM. Six LSTM models were developed to identify HAK 1, 2, and 3 d before farm diagnosis using historic cow-level data with varying time series lengths. Model performance was assessed using repeated stratified 10-fold cross-validation for 20 repeats. The Shapley additive explanations framework (SHAP) was used for model explanation. Model accuracy was 83, 74, and 70%, balanced error rate was 17 to 18, 26 to 28, and 34%, sensitivity was 81 to 83, 71 to 74, and 62%, specificity was 83, 74, and 71%, positive predictive value was 38, 25 to 27, and 21%, negative predictive value was 97 to 98, 95 to 96, and 94%, and area under the curve was 0.89 to 0.90, 0.80 to 0.81, and 0.72 for models identifying HAK 1, 2, and 3 d before diagnosis, respectively. Performance declined as the time interval between identification and farm diagnosis increased, and extending the time series length did not improve model performance. Model explanation revealed that cows with lower milk yield, number of successful milkings, rumination time, and activity, and higher milk FPR compared with herdmates of the same parity and DIM were more likely to be classified as HAK. Our results demonstrate the potential of LSTM models in identifying HAK using deviations of daily milk production variables, rumination time, and activity index from the herd median by parity and DIM. Future studies are needed to evaluate the performance of health alerts using LSTM models controlling for herd-specific metrics against commercial built-in algorithms in multiple farms and for other disorders.
Collapse
Affiliation(s)
- N Taechachokevivat
- Department of Veterinary Clinical Sciences, Purdue University, West Lafayette, IN 47907
| | - B Kou
- Department of Computer Science, Purdue University, West Lafayette, IN 47907
| | - T Zhang
- Department of Computer Science, Purdue University, West Lafayette, IN 47907
| | - M E Montes
- Department of Animal Sciences, Purdue University, West Lafayette, IN 47907
| | - J P Boerman
- Department of Animal Sciences, Purdue University, West Lafayette, IN 47907
| | - J S Doucette
- College of Agriculture Data Services, Purdue University, West Lafayette, IN 47907
| | - R C Neves
- Department of Veterinary Clinical Sciences, Purdue University, West Lafayette, IN 47907.
| |
Collapse
|
3
|
Satoła A, Satoła K. Performance comparison of machine learning models used for predicting subclinical mastitis in dairy cows: Bagging, boosting, stacking, and super-learner ensembles versus single machine learning models. J Dairy Sci 2024; 107:3959-3972. [PMID: 38310958 DOI: 10.3168/jds.2023-24243] [Citation(s) in RCA: 0] [Impact Index Per Article: 0] [Reference Citation Analysis] [Abstract] [Key Words] [MESH Headings] [Track Full Text] [Journal Information] [Subscribe] [Scholar Register] [Received: 09/25/2023] [Accepted: 12/23/2023] [Indexed: 02/06/2024]
Abstract
Mastitis has a substantial impact on the dairy industry across the world, causing dairy producers to suffer losses due to the reduced quality and quantity of produced milk. A further problem, related to this issue, is the excessive use of antibiotics that leads to the development of resistance in different bacterial strains. The growing consumer awareness oriented toward food safety and rational use of antibiotics has promoted the search for new methods of early identification of cows that may be at risk of developing the disease. Subclinical mastitis does not cause any visible changes to the udder or milk, and therefore it is more difficult to detect than clinical mastitis. The collection of large amounts of data related to milk performance of cows allows using machine learning (ML) methods to build models that could be used for classifying cows into healthy and at risk of subclinical mastitis. The data used for the purpose of this study included information from routine milk recording procedures. The dataset consisted of 19,856 records of 2,227 Polish Holstein-Friesian cows from 3 herds. The authors decided to use the approach of building ensemble ML models, in particular bagging, boosting, stacking, and super-learner models, and comparing them for accuracy of identification of disease-affected cows against single ML models based on the support vector machines, logistic regression, Gaussian Naive Bayes, k-nearest neighbors, and decision tree algorithms. The models were trained and evaluated based on the information recorded for herd 1 and using an 80:20 train-test split ratio according to animal ID (to avoid data leakage). The information recorded for herds 2 and 3 was only used to evaluate on unseen data models developed using the herd 1 dataset. Among the single ML models, the support vector machines model was found to be the most accurate in predicting subclinical mastitis at subsequent test day when used both for the training set (mean F1-score of 0.760) and the testing sets containing data for herds 1, 2, and 3 (F1-score of 0.778, 0.790, and 0.741 respectively). The gradient boosting model was found to be the best performing model among the ensemble ML models (F1-score of 0.762, 0.779, 0.791, and 0.723 for the training set and the testing sets, respectively). The super-learner model, featuring the most advanced design and logistic regression in the meta layer, achieved the highest mean F1-score of 0.775 during the cross validation; however, it was characterized by a slightly worse prediction accuracy of the testing sets (mean F1-score of 0.768, 0.790, and 0.693 for herds 1, 2 and 3 respectively). The study findings confirm the promising role of ensemble ML methods, which were found to be slightly superior with respect to most of the single ML models.
Collapse
Affiliation(s)
- A Satoła
- Department of Genetics, Animal Breeding and Ethology, Faculty of Animal Science, University of Agriculture in Krakow, 30-059 Krakow, Poland.
| | - K Satoła
- Independent researcher, 31-416 Krakow, Poland
| |
Collapse
|
4
|
Bauer EA, Kułaj D, Sawicki S, Pokorska J. Gene association analysis of an osteopontin polymorphism and ketosis resistance in dairy cattle. Sci Rep 2023; 13:21539. [PMID: 38057392 PMCID: PMC10700331 DOI: 10.1038/s41598-023-48771-5] [Citation(s) in RCA: 0] [Impact Index Per Article: 0] [Reference Citation Analysis] [Abstract] [Key Words] [MESH Headings] [Grants] [Track Full Text] [Journal Information] [Subscribe] [Scholar Register] [Received: 05/17/2023] [Accepted: 11/30/2023] [Indexed: 12/08/2023] Open
Abstract
The aim of this study was to identify the c.495C > T polymorphism within exon 1 of the osteopontin gene (OPN), and to analyze its association with susceptibility to ketosis in Polish Holstein-Friesian (HF) cows. The study utilized blood samples from 977 HF cows, for the determination of β-hydroxybutyric acid (BHB) and for DNA isolation. The c.495C > T polymorphism of the bovine osteopontin gene was determined by PCR-RFLP. The CT genotype (0.50) was deemed the most common, while TT (0.08) was the rarest genotype. Cows with ketosis most often had the CC genotype, while cows with the TT genotype had the lowest incidence of ketosis. To confirm the relationship between the genotype and ketosis in cows, a weight of evidence (WoE) was generated. A very strong effect of the TT genotype on resistance to ketosis was demonstrated. The distribution of the ROC curve shows that the probability of resistance to ketosis is > 75% if cows have the TT genotype of the OPN gene (cutoff value is 0.758). Results suggest that TT genotype at the c.495C > T locus of the OPN gene might be effective way to detect the cows with risk of ketosis.
Collapse
Affiliation(s)
- Edyta A Bauer
- Department of Animal Reproduction, Anatomy and Genomics, Faculty of Animal Science, University of Agriculture in Krakow, Al. Mickiewicza 24/28, 30-059, Krakow, Poland.
| | - Dominika Kułaj
- Department of Animal Reproduction, Anatomy and Genomics, Faculty of Animal Science, University of Agriculture in Krakow, Al. Mickiewicza 24/28, 30-059, Krakow, Poland
| | - Sebastian Sawicki
- Department of Animal Reproduction, Anatomy and Genomics, Faculty of Animal Science, University of Agriculture in Krakow, Al. Mickiewicza 24/28, 30-059, Krakow, Poland
| | - Joanna Pokorska
- Department of Animal Reproduction, Anatomy and Genomics, Faculty of Animal Science, University of Agriculture in Krakow, Al. Mickiewicza 24/28, 30-059, Krakow, Poland
| |
Collapse
|
5
|
Pakrashi A, Wallace D, Mac Namee B, Greene D, Guéret C. CowMesh: a data-mesh architecture to unify dairy industry data for prediction and monitoring. Front Artif Intell 2023; 6:1209507. [PMID: 37868080 PMCID: PMC10586498 DOI: 10.3389/frai.2023.1209507] [Citation(s) in RCA: 0] [Impact Index Per Article: 0] [Reference Citation Analysis] [Abstract] [Key Words] [Grants] [Track Full Text] [Figures] [Journal Information] [Subscribe] [Scholar Register] [Received: 04/20/2023] [Accepted: 09/08/2023] [Indexed: 10/24/2023] Open
Abstract
Dairy is an economically significant industry that caters to the huge demand for food products in people's lives. To remain profitable, farmers need to manage their farms and the health of the dairy cows in their herds. There are, however, many risks to cow health that can lead to significant challenges to dairy farm management and have the potential to lead to significant losses. Such risks include cow udder infections (i.e., mastitis) and cow lameness. As automation and data recording become more common in the agricultural sector, dairy farms are generating increasing amounts of data. Recently, these data are being used to generate insights into farm and cow health, where the objective is to help farmers manage the health and welfare of dairy cows and reduce losses from cow health issues. Despite the level of data generation on dairy farms, this information is often difficult to access due to a lack of a single, central organization to collect data from individual farms. The prospect of such an organization, however, raises questions about data ownership, with some farmers reluctant to share their farm data for privacy reasons. In this study, we describe a new data mesh architecture designed for the dairy industry that focuses on facilitating access to data from farms in a decentralized fashion. This has the benefit of keeping the ownership of data with dairy farmers while bringing data together by providing a common and uniform set of protocols. Furthermore, this architecture will allow secure access to the data by research groups and product development groups, who can plug in new projects and applications built across the data. No similar framework currently exists in the dairy industry, and such a data mesh can help industry stakeholders by bringing the dairy farms of a country together in a decentralized fashion. This not only helps farmers, dairy researchers, and product builders but also facilitates an overview of all dairy farms which can help governments to decide on regulations to improve the dairy industry at a national level.
Collapse
Affiliation(s)
- Arjun Pakrashi
- School of Computer Science, University College Dublin, Dublin, Ireland
- Insight Centre for Data Analytics, Dublin, Ireland
- VistaMilk SFI Research Centre, Teagasc Moorepark, Fermoy, Ireland
| | - Duncan Wallace
- School of Computer Science, University College Dublin, Dublin, Ireland
- Insight Centre for Data Analytics, Dublin, Ireland
- VistaMilk SFI Research Centre, Teagasc Moorepark, Fermoy, Ireland
| | - Brian Mac Namee
- School of Computer Science, University College Dublin, Dublin, Ireland
- Insight Centre for Data Analytics, Dublin, Ireland
- VistaMilk SFI Research Centre, Teagasc Moorepark, Fermoy, Ireland
| | - Derek Greene
- School of Computer Science, University College Dublin, Dublin, Ireland
- Insight Centre for Data Analytics, Dublin, Ireland
- VistaMilk SFI Research Centre, Teagasc Moorepark, Fermoy, Ireland
| | | |
Collapse
|