{"status":"ok","message-type":"work","message-version":"1.0.0","message":{"indexed":{"date-parts":[[2026,6,28]],"date-time":"2026-06-28T06:15:06Z","timestamp":1782627306810,"version":"3.54.5"},"reference-count":50,"publisher":"MDPI AG","issue":"14","license":[{"start":{"date-parts":[[2020,7,10]],"date-time":"2020-07-10T00:00:00Z","timestamp":1594339200000},"content-version":"vor","delay-in-days":0,"URL":"https:\/\/creativecommons.org\/licenses\/by\/4.0\/"}],"funder":[{"DOI":"10.13039\/501100005908","name":"Bundesministerium f\u00fcr Ern\u00e4hrung und Landwirtschaft","doi-asserted-by":"publisher","award":["2815710515"],"award-info":[{"award-number":["2815710515"]}],"id":[{"id":"10.13039\/501100005908","id-type":"DOI","asserted-by":"publisher"}]}],"content-domain":{"domain":[],"crossmark-restriction":false},"short-container-title":["Sensors"],"abstract":"<jats:p>The aim of this study was to develop classification models for mastitis and lameness treatments in Holstein dairy cows as the target variables based on continuous data from herd management software with modern machine learning methods. Data was collected over a period of 40 months from a total of 167 different cows with daily individual sensor information containing milking parameters, pedometer activity, feed and water intake, and body weight (in the form of differently aggregated data) as well as the entered treatment data. To identify the most important predictors for mastitis and lameness treatments, respectively, Random Forest feature importance, Pearson\u2019s correlation and sequential forward feature selection were applied. With the selected predictors, various machine learning models such as Logistic Regression (LR), Support Vector Machine (SVM), K-nearest neighbors (KNN), Gaussian Na\u00efve Bayes (GNB), Extra Trees Classifier (ET) and different ensemble methods such as Random Forest (RF) were trained. Their performance was compared using the receiver operator characteristic (ROC) area-under-curve (AUC), as well as sensitivity, block sensitivity and specificity. In addition, sampling methods were compared: Over- and undersampling as compensation for the expected unbalanced training data had a high impact on the ratio of sensitivity and specificity in the classification of the test data, but with regard to AUC, random oversampling and SMOTE (Synthetic Minority Over-sampling) even showed significantly lower values than with non-sampled data. The best model, ET, obtained a mean AUC of 0.79 for mastitis and 0.71 for lameness, respectively, based on testing data from practical conditions and is recommended by us for this type of data, but GNB, LR and RF were only marginally worse, and random oversampling and SMOTE even showed significantly lower values than without sampling. We recommend the use of these models as a benchmark for similar self-learning classification tasks. The classification models presented here retain their interpretability with the ability to present feature importances to the farmer in contrast to the \u201cblack box\u201d models of Deep Learning methods.<\/jats:p>","DOI":"10.3390\/s20143863","type":"journal-article","created":{"date-parts":[[2020,7,14]],"date-time":"2020-07-14T09:30:49Z","timestamp":1594719049000},"page":"3863","update-policy":"https:\/\/doi.org\/10.3390\/mdpi_crossmark_policy","source":"Crossref","is-referenced-by-count":35,"title":["Using Sensor Data to Detect Lameness and Mastitis Treatment Events in Dairy Cows: A Comparison of Classification Models"],"prefix":"10.3390","volume":"20","author":[{"ORCID":"https:\/\/orcid.org\/0000-0001-5746-7830","authenticated-orcid":false,"given":"Christian","family":"Post","sequence":"first","affiliation":[{"name":"Physiology Unit, Institute of Animal Science, University of Bonn, 53115 Bonn, Germany"}],"role":[{"vocabulary":"crossref","role":"author"}]},{"given":"Christian","family":"Rietz","sequence":"additional","affiliation":[{"name":"Department of Educational Science, Faculty of Educational and Social Sciences, University of Education Heidelberg, 69120 Heidelberg, Germany"}],"role":[{"vocabulary":"crossref","role":"author"}]},{"ORCID":"https:\/\/orcid.org\/0000-0002-7212-7639","authenticated-orcid":false,"given":"Wolfgang","family":"B\u00fcscher","sequence":"additional","affiliation":[{"name":"Livestock Technology Section, Institute for Agricultural Engineering, University of Bonn, 53115 Bonn, Germany"}],"role":[{"vocabulary":"crossref","role":"author"}]},{"given":"Ute","family":"M\u00fcller","sequence":"additional","affiliation":[{"name":"Physiology Unit, Institute of Animal Science, University of Bonn, 53115 Bonn, Germany"}],"role":[{"vocabulary":"crossref","role":"author"}]}],"member":"1968","published-online":{"date-parts":[[2020,7,10]]},"reference":[{"key":"ref_1","doi-asserted-by":"crossref","first-page":"7426","DOI":"10.3168\/jds.2015-9377","article-title":"Invited review: Changes in the dairy industry affecting dairy cattle health and welfare","volume":"98","author":"Barkema","year":"2015","journal-title":"J. Dairy Sci."},{"key":"ref_2","unstructured":"Pintado, D.C. (2006). Automated Mastitis Detection in Dairy Cows Using Different Statistical Methods. [Ph.D. Thesis, Christian-Albrechts-Universit\u00e4t zu Kiel]."},{"key":"ref_3","doi-asserted-by":"crossref","first-page":"2559","DOI":"10.3168\/jds.2009-3020","article-title":"Discriminating between true-positive and false-positive clinical mastitis alerts from automatic milking systems","volume":"93","author":"Steeneveld","year":"2010","journal-title":"J. Dairy Sci."},{"key":"ref_4","doi-asserted-by":"crossref","first-page":"7344","DOI":"10.3168\/jds.2015-10060","article-title":"Bayesian integration of sensor information and a multivariate dynamic linear model for prediction of dairy cow mastitis","volume":"99","author":"Jensen","year":"2016","journal-title":"J. Dairy Sci."},{"key":"ref_5","doi-asserted-by":"crossref","first-page":"7411","DOI":"10.3168\/jds.2016-10908","article-title":"Use of rumination and activity monitoring for the identification of dairy cows with health disorders: Part II. Mastitis","volume":"99","author":"Stangaferro","year":"2016","journal-title":"J. Dairy Sci."},{"key":"ref_6","doi-asserted-by":"crossref","first-page":"134","DOI":"10.1016\/j.applanim.2012.10.001","article-title":"Electronic detection of lameness in dairy cows through measuring pedometric activity and lying behavior","volume":"142","author":"Alsaaod","year":"2012","journal-title":"Appl. Anim. Behav. Sci."},{"key":"ref_7","doi-asserted-by":"crossref","first-page":"335","DOI":"10.1017\/S0022029913000290","article-title":"Principal component analysis for the early detection of mastitis and lameness in dairy cows","volume":"80","author":"Miekley","year":"2013","journal-title":"J. Dairy Res."},{"key":"ref_8","doi-asserted-by":"crossref","first-page":"4286","DOI":"10.3168\/jds.2012-6188","article-title":"Lameness detection based on multivariate continuous sensing of milk yield, rumination, and neck activity","volume":"96","author":"Maltz","year":"2013","journal-title":"J. Dairy Sci."},{"key":"ref_9","doi-asserted-by":"crossref","first-page":"838","DOI":"10.3390\/ani5030387","article-title":"Lameness Detection in Dairy Cows: Part 1. How to Distinguish between Non-Lame and Lame Cows Based on Differences in Locomotion or Behavior","volume":"5","author":"Zwertvaegher","year":"2015","journal-title":"Animals"},{"key":"ref_10","doi-asserted-by":"crossref","first-page":"7043","DOI":"10.3168\/jds.2013-6993","article-title":"Applying additive logistic regression to data derived from sensors monitoring behavioral and physiological characteristics of dairy cows to detect lameness","volume":"96","author":"Kamphuis","year":"2013","journal-title":"J. Dairy Sci."},{"key":"ref_11","doi-asserted-by":"crossref","first-page":"2283","DOI":"10.3168\/jds.2006-267","article-title":"A Probabilistic Neural Network Model for Lameness Detection","volume":"90","author":"Pastell","year":"2007","journal-title":"J. Dairy Sci."},{"key":"ref_12","doi-asserted-by":"crossref","first-page":"342","DOI":"10.1016\/j.jneumeth.2006.10.023","article-title":"Application and comparison of classification algorithms for recognition of Alzheimer\u2019s disease in electrical brain activity (EEG)","volume":"161","author":"Lehmann","year":"2007","journal-title":"J. Neurosci. Methods"},{"key":"ref_13","doi-asserted-by":"crossref","first-page":"2904","DOI":"10.3168\/jds.2015-10109","article-title":"Analysis of behavioral changes in dairy cows associated with claw horn lesions","volume":"99","author":"Nechanitzky","year":"2016","journal-title":"J. Dairy Sci."},{"key":"ref_14","doi-asserted-by":"crossref","first-page":"3358","DOI":"10.3168\/jds.2009-2842","article-title":"Somatic cell count assessment at the quarter or cow milking level","volume":"93","author":"Mollenhorst","year":"2010","journal-title":"J. Dairy Sci."},{"key":"ref_15","doi-asserted-by":"crossref","first-page":"46","DOI":"10.1016\/j.compag.2016.12.008","article-title":"Prioritizing alarms from sensor-based detection models in livestock production\u2014A review on model performance and alarm reducing methods","volume":"133","author":"Dominiak","year":"2017","journal-title":"Comput. Electron. Agric."},{"key":"ref_16","doi-asserted-by":"crossref","first-page":"7476","DOI":"10.3168\/jds.2014-7982","article-title":"Lameness detection challenges in automated milking systems addressed with partial least squares discriminant analysis","volume":"97","author":"Garcia","year":"2014","journal-title":"J. Dairy Sci."},{"key":"ref_17","doi-asserted-by":"crossref","first-page":"101","DOI":"10.1016\/j.livsci.2006.10.006","article-title":"Analysing serial data for mastitis detection by means of local regression","volume":"110","author":"Cavero","year":"2007","journal-title":"Livest. Sci."},{"key":"ref_18","doi-asserted-by":"crossref","unstructured":"Kuhn, M., and Johnson, K. (2013). Applied Predictive Modeling, Springer.","DOI":"10.1007\/978-1-4614-6849-3"},{"key":"ref_19","doi-asserted-by":"crossref","unstructured":"Schenk, J., Kaiser, M.S., and Rigoll, G. (2009, January 26\u201329). Selecting Features in On-Line Handwritten Whiteboard Note Recognition: SFS or SFFS?. Proceedings of the 2009 10th International Conference on Document Analysis and Recognition, Barcelona, Spain.","DOI":"10.1109\/ICDAR.2009.130"},{"key":"ref_20","doi-asserted-by":"crossref","unstructured":"Boughorbel, S., Jarray, F., and El-Anbari, M. (2017). Optimal classifier for imbalanced data using Matthews Correlation Coefficient metric. PLoS ONE, 12.","DOI":"10.1371\/journal.pone.0177678"},{"key":"ref_21","first-page":"559","article-title":"Imbalanced-learn: A python toolbox to tackle the curse of imbalanced datasets in machine learning","volume":"1","author":"Nogueira","year":"2017","journal-title":"J. Mach. Learn. Res."},{"key":"ref_22","unstructured":"Chawla, N.V. (2003). C4. 5 and imbalanced data sets: Investigating the effect of sampling method, probabilistic estimate, and decision tree structure. Proceedings of the ICML, CIBC."},{"key":"ref_23","doi-asserted-by":"crossref","first-page":"29","DOI":"10.1145\/2786984.2786995","article-title":"Scikit-learn","volume":"19","author":"Varoquaux","year":"2015","journal-title":"GetMob. Mob. Comput. Commun."},{"key":"ref_24","doi-asserted-by":"crossref","first-page":"273","DOI":"10.1007\/BF00994018","article-title":"Support-vector networks","volume":"3","author":"Cortes","year":"1995","journal-title":"Mach. Learn."},{"key":"ref_25","doi-asserted-by":"crossref","first-page":"21","DOI":"10.1109\/TIT.1967.1053964","article-title":"Nearest neighbor pattern classification","volume":"13","author":"Cover","year":"1967","journal-title":"IEEE Trans. Inf. Theory"},{"key":"ref_26","doi-asserted-by":"crossref","first-page":"103","DOI":"10.1023\/A:1007413511361","article-title":"On the Optimality of the Simple Bayesian Classifier under Zero-One Loss","volume":"29","author":"Domingos","year":"1997","journal-title":"Mach. Learn."},{"key":"ref_27","doi-asserted-by":"crossref","unstructured":"Breiman, L., Friedman, J.H., Olshen, R.A., and Stone, C.J. (2017). Classification and Regression Trees, CRC Press.","DOI":"10.1201\/9781315139470"},{"key":"ref_28","unstructured":"Kelleher, J.D., MacNamee, B., and D\u2019Arcy, A. (2015). Fundamentals of Machine Learning for Predictive Data Analytics, MIT Press."},{"key":"ref_29","doi-asserted-by":"crossref","first-page":"5","DOI":"10.1023\/A:1010933404324","article-title":"Random forests","volume":"1","author":"Breiman","year":"2001","journal-title":"Mach. Learn."},{"key":"ref_30","doi-asserted-by":"crossref","unstructured":"Strobl, C., Boulesteix, A.-L., Zeileis, A., and Hothorn, T. (2007). Bias in random forest variable importance measures: Illustrations, sources and a solution. BMC Bioinform., 8.","DOI":"10.1186\/1471-2105-8-25"},{"key":"ref_31","doi-asserted-by":"crossref","first-page":"2225","DOI":"10.1016\/j.patrec.2010.03.014","article-title":"Variable selection using random forests","volume":"31","author":"Genuer","year":"2010","journal-title":"Pattern Recognit. Lett."},{"key":"ref_32","doi-asserted-by":"crossref","first-page":"4560","DOI":"10.3168\/jds.2008-1160","article-title":"Automatic Detection of Clinical Mastitis Is Improved by In-Line Monitoring of Somatic Cell Count","volume":"91","author":"Kamphuis","year":"2008","journal-title":"J. Dairy Sci."},{"key":"ref_33","doi-asserted-by":"crossref","first-page":"659","DOI":"10.3168\/jds.S0022-0302(82)82245-5","article-title":"Electrical Conductivity of Milk for Detection of Mastitis","volume":"65","author":"Fernando","year":"1982","journal-title":"J. Dairy Sci."},{"key":"ref_34","first-page":"208","article-title":"Epidemiological study of clinical mastitis in dairy cattle","volume":"25","author":"Oltenacu","year":"1994","journal-title":"Veter Res."},{"key":"ref_35","doi-asserted-by":"crossref","first-page":"3703","DOI":"10.3168\/jds.2012-6305","article-title":"Applicability of day-to-day variation in behavior for the automated detection of lameness in dairy cows","volume":"96","author":"Andre","year":"2013","journal-title":"J. Dairy Sci."},{"key":"ref_36","doi-asserted-by":"crossref","first-page":"139","DOI":"10.3168\/jds.S0022-0302(06)72077-X","article-title":"Effect of Hoof Pathologies on Subjective Assessments of Dairy Cow Gait","volume":"89","author":"Flower","year":"2006","journal-title":"J. Dairy Sci."},{"key":"ref_37","doi-asserted-by":"crossref","first-page":"954","DOI":"10.3168\/jds.2009-2385","article-title":"Measures of weight distribution of dairy cows to detect lameness and the presence of hoof lesions","volume":"93","author":"Pastell","year":"2010","journal-title":"J. Dairy Sci."},{"key":"ref_38","doi-asserted-by":"crossref","first-page":"7458","DOI":"10.3168\/jds.2015-10843","article-title":"A validation of technologies monitoring dairy cow feeding, ruminating, and lying behaviors","volume":"99","author":"Borchers","year":"2016","journal-title":"J. Dairy Sci."},{"key":"ref_39","doi-asserted-by":"crossref","first-page":"3164","DOI":"10.2527\/jas.2014-8802","article-title":"Technical note: Accuracy of an ear tag-attached accelerometer to monitor rumination and feeding behavior in feedlot cattle1","volume":"93","author":"Wolfger","year":"2015","journal-title":"J. Anim. Sci."},{"key":"ref_40","unstructured":"Schindhelm, K., Haidn, B., Trembalay, M., and D\u00f6pfer, D. (2017, January 18). Automatisch erfasste Leistungs- und Verhaltensparameter als Risikofaktoren in einem Vorhersagemodell f\u00fcr Lahmheit bei Milchk\u00fchen der Rasse Fleckvieh. Proceedings of the 13. Tagung: Bau, Technik und Umwelt, Stuttgart-Hohenheim, Germany."},{"key":"ref_41","doi-asserted-by":"crossref","first-page":"3446","DOI":"10.1016\/j.eswa.2011.09.033","article-title":"An experimental comparison of classification algorithms for imbalanced credit scoring data sets","volume":"39","author":"Brown","year":"2012","journal-title":"Expert Syst. Appl."},{"key":"ref_42","doi-asserted-by":"crossref","first-page":"7991","DOI":"10.3390\/s100907991","article-title":"Sensors and Clinical Mastitis\u2014The Quest for the Perfect Alert","volume":"10","author":"Hogeveen","year":"2010","journal-title":"Sensors"},{"key":"ref_43","doi-asserted-by":"crossref","first-page":"1017","DOI":"10.3168\/jds.2007-0530","article-title":"Changes in Feeding Behavior as Possible Indicators for the Automatic Monitoring of Health Disorders in Dairy Cows","volume":"91","author":"Tolkamp","year":"2008","journal-title":"J. Dairy Sci."},{"key":"ref_44","doi-asserted-by":"crossref","first-page":"5964","DOI":"10.3168\/jds.2009-2066","article-title":"A novel method of analyzing daily milk production and electrical conductivity to predict disease onset","volume":"92","author":"Lukas","year":"2009","journal-title":"J. Dairy Sci."},{"key":"ref_45","doi-asserted-by":"crossref","first-page":"280","DOI":"10.1016\/j.livsci.2007.05.012","article-title":"Mastitis detection in dairy cows by application of neural networks","volume":"114","author":"Cavero","year":"2008","journal-title":"Livest. Sci."},{"key":"ref_46","doi-asserted-by":"crossref","first-page":"1928","DOI":"10.3168\/jds.2012-6107","article-title":"Invited review","volume":"4","author":"Rutten","year":"2013","journal-title":"J. Dairy Sci."},{"key":"ref_47","doi-asserted-by":"crossref","unstructured":"Mansbridge, N., Mitsch, J., Bollard, N., Ellis, K., Miguel-Pacheco, G.G., Dottorini, T., and Kaler, J. (2018). Feature Selection and Comparison of Machine Learning Algorithms in Classification of Grazing and Rumination Behaviour in Sheep. Sensors, 18.","DOI":"10.3390\/s18103532"},{"key":"ref_48","doi-asserted-by":"crossref","first-page":"731","DOI":"10.3168\/jds.2013-6693","article-title":"Prediction of insemination outcomes in Holstein dairy cattle using alternative machine learning algorithms","volume":"97","author":"Shahinfar","year":"2014","journal-title":"J. Dairy Sci."},{"key":"ref_49","doi-asserted-by":"crossref","first-page":"3220","DOI":"10.3168\/jds.2006-807","article-title":"Prepartum Behavior and Dry Matter Intake Identify Dairy Cows at Risk for Metritis","volume":"90","author":"Huzzey","year":"2007","journal-title":"J. Dairy Sci."},{"key":"ref_50","doi-asserted-by":"crossref","first-page":"62","DOI":"10.1016\/j.compag.2018.08.037","article-title":"Development and validation of a predictive model for calving time based on sensor measurements of ingestive behavior in dairy cows","volume":"161","author":"Zehner","year":"2019","journal-title":"Comput. Electron. Agric."}],"container-title":["Sensors"],"original-title":[],"language":"en","link":[{"URL":"https:\/\/www.mdpi.com\/1424-8220\/20\/14\/3863\/pdf","content-type":"unspecified","content-version":"vor","intended-application":"similarity-checking"}],"deposited":{"date-parts":[[2025,10,11]],"date-time":"2025-10-11T09:50:03Z","timestamp":1760176203000},"score":1,"resource":{"primary":{"URL":"https:\/\/www.mdpi.com\/1424-8220\/20\/14\/3863"}},"subtitle":[],"short-title":[],"issued":{"date-parts":[[2020,7,10]]},"references-count":50,"journal-issue":{"issue":"14","published-online":{"date-parts":[[2020,7]]}},"alternative-id":["s20143863"],"URL":"https:\/\/doi.org\/10.3390\/s20143863","relation":{},"ISSN":["1424-8220"],"issn-type":[{"value":"1424-8220","type":"electronic"}],"subject":[],"published":{"date-parts":[[2020,7,10]]}}}