B-841Dystocia (difficult calving) belongs to one of the most expensive conditions in dairy cattle. Its incidence (including heavy traction, veterinary intervention or cesarean section) in the Polish population of dairy cows (various breeds) was 3.9% between 2007 and 2008 (Pogorzelska and Nogalski, 2010). Dystocia results in many adverse consequences such as: reduced milk, protein and fat yield, impaired reproduction (delayed estrus, longer days to first service and services per conception), higher mortality rates of cows and calves (Mane and Bhangre, 2015), more frequent occurrence of pulmonary and digestive diseases in calves as well as retained placenta, uterine conditions, mastitis and hypocalcemia in cows
(Balasundaram et al., 2011a,b; Ercan et al., 2017; McHugh et al., 2011; Mee, 2008;
Zaborski et al., 2014).
Expert systems, belonging to the methods of artificial intelligence, are quite widely used in animal breeding. They are intended for on-farm decision support by suggesting solutions resulting from the inference based on the set of facts and rules as well as data on a specific case (situation). An example may be a Lait-Xpert Vaches system
(Pellerin et al., 1994) for dairy herd management in terms of milk, protein and fat yield, feeding costs, reproduction, health and housing, or a system designed by
Domecq et al., (1991) for the evaluation of reproductive efficiency in a herd and the formulation of a strategy for its improvement. A simpler version of the expert system is a rule-based module (RBM), consisting of an inference engine, a knowledge base and a database, which can also be used as a decision support tool. Taking into consideration the numerous negative consequences of dystocia and the previous quite successful applications of expert systems to different agricultural domains, the aim of the present study was to construct the RBM for dystocia detection in a herd and to verify its effectiveness in predicting the occurrence of difficult calvings.
A total of 3041 calving records of Polish Holstein-Friesian Black-and-White heifers (1342 records) and cows (1699 records) obtained from four commercial dairy farms located in the West Pomeranian Province were analyzed. The data were collected in 2002 - 2013. The following predictors of dystocia (factors affecting dystocia) in cows were investigated: SIRE – the rank of the cow’s sire based on the mean calving difficulty of its daughters, AGE – calving age (months), HERD – herd category based on its mean milk production (two categories – lower and higher), SEX – calf sex, CLVS – calving season (autumn-winter and spring-summer), DMY – daily milk yield in the preceding lactation (kg), CLVIN – previous calving interval (days), LN – lactation number, PCLV – previous calving difficulty (three categories), MAST – mastitis occurrence during pregnancy (yes or no). The output variable was a calving difficulty category (easy, moderate, difficult). Only five of the above predictors (SIRE, AGE, HERD, SEX, CLVS) were used for heifers. A detailed description of the dataset is given in
Zaborski et al., (2016, 2017).
The RBM constructed in the present study consisted of three main components (Fig 1): (1) the knowledge base comprising the set of facts and rules from the domain of difficult calvings, (2) the database containing information on the cases (calvings) for which decisions were made and (3) the inference engine, which applied the rules from the knowledge base to the data for individual cases (calvings) from the database and made a final prediction. Moreover, the RBM system was equipped with a user-friendly text interface to ensure easy communication with the farmer.
For the RBM construction, the CLIPS (C Language Integrated Production System, Giarratano and Riley, 2005) programming language was used. Knowledge representation was based on the system of “if-then” rules, each of which consisted of a premise and a conclusion. The “if-then” rules used in the present study were extracted from the three types of decision trees (classification and regression trees - CART, chi-square automatic interaction detector trees - CHAID and quick, unbiased, efficient statistical trees - QUEST). Details about the development of these models are presented in
Zaborski et al., (2016, 2017). The total number of rules utilized by the RBM system was 46 (15 for heifers and 31 for cows). To determine them, a training set of 1006 and 1275 records (for heifers and cows, respectively) was applied. It was a randomly selected part of the whole dataset used for model building. After construction, the RBM was tested on an independent, randomly selected test set of 336 and 424 records (for heifers and cows, respectively). This set was used for the verification of the system predictive performance.
The last part of the RBM was the inference engine, whose role was to detect cows with potential problems at parturition (Rutkowski, 2012). The rule-based inference process was based on conclusions inferred from the set of facts and rules for a specific case (calving) in a heifer or a cow. The forward reasoning algorithm implemented in the CLIPS language was used for this type of inference. An example user interface of the RBM system is shown in Fig. 2. The program asks a set of questions based on the values of the predictor variables and returns a predicted calving category.
The proportion of correctly identified calvings from each class (easy, moderate and difficult) and the overall accuracy for the heifer test dataset (the subset of calving records separated from the whole dataset and used for the final evaluation of the system predictive abilities) were: 26.13%, 76.52%, 77.27% and 60.12%, respectively, whereas the respective values for the cow dataset were: 59.18%, 69.01%, 0% and 62.03%.
The RBM system developed in the present study has a user-friendly interface that is intended to help farmers diagnose dystocia in the herd. The “if-then” rules extracted from the three types of decision trees (CART, CHAID and QUEST) were implemented in the form of a single, integrated decision support system that facilitates the application of such rules under field conditions by asking several questions about an individual animal. The analysis of the RBM predictive performance on the independent test set in heifers showed that it yielded similar results to those obtained by each decision tree separately. The total accuracy of the RBM system was even slightly higher than that for CHAID and QUEST. The proportion of correctly indicated difficult calvings in heifers by RBM was also higher than that diagnosed by QUEST. In the case of heifers
(Zaborski et al., 2017), the proportions of correctly identified easy, moderate and difficult calvings on the independent test set by CART were 35.14%, 68.70% and 77.27%. The total accuracy was 60.41%. The respective values for CHAID were 18.92%, 73.91%, 85.45% and 59.52%, whereas those for QUEST were 19.82%, 81.74%, 73.64% and 58.63%.
The analysis of the RBM system performance in cows carried out on the independent test set showed that its overall accuracy was better than that for CART but worse than that for CHAID and QUEST. None of the decision trees and, consequently, the RBM system could recognize difficult calvings in cows (the proportion of correctly indicated dystocic cases was null). The percentages of correctly identified easy, moderate and difficult calvings in cows on the independent test set by CART were 60.20%, 71.36% and 0%
(Zaborski et al., 2016). The total accuracy was 60.41%. The respective values for CHAID were 65.31%, 69.01%, 0% and 64.86%, whereas those for QUEST were: 68.88%, 64.79%, 0% and 64.39%.
The RBM system presented in the current study does not provide any graphical interface and the communication between the user (farmer) and the system has a textual form. However, further development of the system and incorporation of plots presenting the incidence of dystocia in the herd are possible in the future. Moreover, the aforementioned Mast system described by Allore and Jones (1995) included a total of 168 rules, whereas the RBM system developed in the present study had much fewer rules (approximately 46). In addition, these rules were extracted only from decision trees (CART, CHAID and QUEST), while those included in the Mast system were also created with the help of experts in the field. The rest of them were formulated based on the reference values for the different indicators of mastitis occurrence.