{"status":"ok","message-type":"work","message-version":"1.0.0","message":{"indexed":{"date-parts":[[2026,10,3]],"date-time":"2026-10-03T16:53:08Z","timestamp":1791046388025,"version":"4.1.0"},"reference-count":29,"publisher":"MDPI AG","issue":"2","license":[{"start":{"date-parts":[[2026,1,9]],"date-time":"2026-01-09T00:00:00Z","timestamp":1767916800000},"content-version":"vor","delay-in-days":0,"URL":"https:\/\/creativecommons.org\/licenses\/by\/4.0\/"}],"funder":[{"name":"Ecological and environmental protection scientific research project of Heilongjiang Province","award":["HST2024ST005"],"award-info":[{"award-number":["HST2024ST005"]}]},{"name":"\u201cOpen Recruitment for Key Scientific and Technological Projects\u201d program of Heilongjiang Province","award":["2023ZXJ02B03"],"award-info":[{"award-number":["2023ZXJ02B03"]}]}],"content-domain":{"domain":[],"crossmark-restriction":false},"short-container-title":["Animals"],"abstract":"<jats:p>SHapley Additive exPlanations (SHAP) analysis has been applied in disease diagnosis and treatment effect evaluation. However, its application in the prediction and diagnosis of dairy cow diseases remains limited. We investigated whether the variance and autocorrelation of deviations in daily activity, rumination time, and milk electrical conductivity, along with daily milk yield, could be used to predict clinical mastitis in dairy cows using popular machine learning (ML) algorithms and identifying key predictive features using SHAP analysis. Quantile regression (QR) with second- or third-order polynomial models with the median or upper quantiles was used to process raw data from mastitic and healthy cows. Nine variables from the 14-day period preceding mastitis onset were identified as significantly associated with mastitis through logistic regression. These variables were used to train and validate prediction models using eleven classical ML algorithms. Among them, the partial least squares model demonstrated superior performance, achieving an AUC of 0.789, sensitivity of 0.500, specificity of 0.947, accuracy of 0.793, precision of 0.833, and F1-score of 0.625. SHAP analysis results revealed positive contributions of three features to mastitis prediction, whereas two features had negative contributions. These findings provide a theoretical basis for developing clinical decision-support tools in commercial farming settings.<\/jats:p>","DOI":"10.3390\/ani16020204","type":"journal-article","created":{"date-parts":[[2026,1,9]],"date-time":"2026-01-09T16:03:16Z","timestamp":1767974596000},"page":"204","update-policy":"https:\/\/doi.org\/10.3390\/mdpi_crossmark_policy","source":"Crossref","is-referenced-by-count":5,"title":["Machine Learning and SHapley Additive exPlanation-Based Interpretation for Predicting Mastitis in Dairy Cows"],"prefix":"10.3390","volume":"16","author":[{"ORCID":"https:\/\/orcid.org\/0000-0003-1124-5831","authenticated-orcid":false,"given":"Xiaojing","family":"Zhou","sequence":"first","affiliation":[{"name":"Department of Information and Computing Science, Heilongjiang Bayi Agricultural University, No. 5 Xinyang Road, Daqing 163319, China"},{"name":"The Key Laboratory of Green and Low-Carbon Agriculture in the Northeast Plain, Ministry of Agriculture and Rural Affairs, Heilongjiang Bayi Agricultural University, No. 5 Xinyang Road, Daqing 163319, China"}],"role":[{"vocabulary":"crossref","role":"author"}]},{"ORCID":"https:\/\/orcid.org\/0000-0003-0927-5169","authenticated-orcid":false,"given":"Yongli","family":"Qu","sequence":"additional","affiliation":[{"name":"The Key Laboratory of Green and Low-Carbon Agriculture in the Northeast Plain, Ministry of Agriculture and Rural Affairs, Heilongjiang Bayi Agricultural University, No. 5 Xinyang Road, Daqing 163319, China"}],"role":[{"vocabulary":"crossref","role":"author"}]},{"ORCID":"https:\/\/orcid.org\/0000-0002-0377-1439","authenticated-orcid":false,"given":"Chuang","family":"Xu","sequence":"additional","affiliation":[{"name":"National Key Laboratory of Veterinary Public Health and Safety, College of Veterinary Medicine, China Agricultural University, 2 Yuanmingyuan West Road, Beijing 100193, China"}],"role":[{"vocabulary":"crossref","role":"author"}]},{"ORCID":"https:\/\/orcid.org\/0000-0002-4081-2463","authenticated-orcid":false,"given":"Hao","family":"Wang","sequence":"additional","affiliation":[{"name":"Animal Husbandry and Veterinary Branch of Heilongjiang Academy of Agricultural Science, Qiqihar 161005, China"}],"role":[{"vocabulary":"crossref","role":"author"}]},{"ORCID":"https:\/\/orcid.org\/0009-0009-8072-2567","authenticated-orcid":false,"given":"Di","family":"Lang","sequence":"additional","affiliation":[{"name":"Department of Information and Computing Science, Heilongjiang Bayi Agricultural University, No. 5 Xinyang Road, Daqing 163319, China"}],"role":[{"vocabulary":"crossref","role":"author"}]},{"ORCID":"https:\/\/orcid.org\/0000-0002-8982-4844","authenticated-orcid":false,"given":"Bin","family":"Jia","sequence":"additional","affiliation":[{"name":"Animal Husbandry and Veterinary Branch of Heilongjiang Academy of Agricultural Science, Qiqihar 161005, China"}],"role":[{"vocabulary":"crossref","role":"author"}]},{"ORCID":"https:\/\/orcid.org\/0009-0003-5591-0714","authenticated-orcid":false,"given":"Nan","family":"Jiang","sequence":"additional","affiliation":[{"name":"Department of Information and Computing Science, Heilongjiang Bayi Agricultural University, No. 5 Xinyang Road, Daqing 163319, China"}],"role":[{"vocabulary":"crossref","role":"author"}]}],"member":"1968","published-online":{"date-parts":[[2026,1,9]]},"reference":[{"key":"ref_1","doi-asserted-by":"crossref","first-page":"12887","DOI":"10.3168\/jds.2021-20262","article-title":"Integration of statistical inferences and machine learning algorithms for prediction of metritis cure in dairy cows","volume":"104","author":"Ferreira","year":"2021","journal-title":"J. Dairy Sci."},{"key":"ref_2","doi-asserted-by":"crossref","first-page":"9385","DOI":"10.3168\/jds.2017-14310","article-title":"Development of a new clinical mastitis detection method for automatic milking systems","volume":"101","author":"Khatun","year":"2018","journal-title":"J. Dairy Sci."},{"key":"ref_3","doi-asserted-by":"crossref","unstructured":"Zhou, X., Xu, C., Wang, H., Xu, W., Zhao, Z., Chen, M., Jia, B., and Huang, B. (2022). The Early prediction of common disorders in dairy cows monitored by automatic systems with machine learning algorithms. Animals, 12.","DOI":"10.3390\/ani12101251"},{"key":"ref_4","doi-asserted-by":"crossref","first-page":"1942","DOI":"10.3168\/jds.2022-22292","article-title":"Exploiting machine learning methods with monthly routine milk recording data and climatic information to predict subclinical mastitis in Italian Mediterranean buffaloes","volume":"106","author":"Bobbo","year":"2023","journal-title":"J. Dairy Sci."},{"key":"ref_5","doi-asserted-by":"crossref","first-page":"3448","DOI":"10.3168\/jds.2022-22355","article-title":"Multivariable time series classification for clinical mastitis detection and prediction in automated milking systems","volume":"106","author":"Fan","year":"2023","journal-title":"J. Dairy Sci."},{"key":"ref_6","doi-asserted-by":"crossref","unstructured":"D\u017eermeikait\u0117, K., Kri\u0161tolaityt\u0117, J., and Antanaitis, R. (2025). Application of machine learning models for the early detection of metritis in dairy cows based on physiological, behavioural and milk quality indicators. Animals, 15.","DOI":"10.3390\/ani15111674"},{"key":"ref_7","doi-asserted-by":"crossref","unstructured":"Li, D., Yan, G., Li, F., Lin, H., Jiao, H., Han, H., and Liu, W. (2024). Optimized machine learning models for predicting core body temperature in dairy cows: Enhancing accuracy and interpretability for practical livestock management. Animals, 14.","DOI":"10.3390\/ani14182724"},{"key":"ref_8","doi-asserted-by":"crossref","first-page":"100363","DOI":"10.1016\/j.animal.2021.100363","article-title":"Short communication: Variance and autocorrelation of deviations in daily milk yield are related with clinical mastitis in dairy cows","volume":"15","author":"Kok","year":"2021","journal-title":"Animal"},{"key":"ref_9","doi-asserted-by":"crossref","unstructured":"Oloo, R.D., Mrode, R., Bennewitz, J., Ekine-Dzivenu, C.C., Ojango, J.M.K., Gebreyohanes, G., Mwai, O.A., and Chagunda, M.G.G. (2023). Potential for quantifying general environmental resilience of dairy cattle in sub-Saharan Africa using deviations in milk yield. Front. Genet., 14.","DOI":"10.3389\/fgene.2023.1208158"},{"key":"ref_10","doi-asserted-by":"crossref","first-page":"6888","DOI":"10.3168\/jds.2023-24224","article-title":"Comparison of 3 mathematical models to estimate lactation performance in dairy cows","volume":"107","author":"Ranzato","year":"2024","journal-title":"J. Dairy Sci."},{"key":"ref_11","doi-asserted-by":"crossref","first-page":"11173","DOI":"10.3168\/jds.2025-26485","article-title":"Dairy cow resilience: Data-driven detection and quantification of perturbations using daily milk weights","volume":"108","author":"Guinan","year":"2025","journal-title":"J. Dairy Sci."},{"key":"ref_12","doi-asserted-by":"crossref","unstructured":"Guo, Y., Ma, F., Li, P., Guo, L., Liu, Z., Huo, C., Shi, C., Zhu, L., Gu, M., and Na, R. (2025). Comprehensive SHAP values and single-cell sequencing technology reveal key cell clusters in bovine skeletal muscle. Int. J. Mol. Sci., 26.","DOI":"10.3390\/ijms26052054"},{"key":"ref_13","doi-asserted-by":"crossref","first-page":"103470","DOI":"10.1016\/j.redox.2024.103470","article-title":"Machine learning and SHAP value interpretation for predicting comorbidity of cardiovascular disease and cancer with dietary antioxidants","volume":"79","author":"Qi","year":"2025","journal-title":"Redox Biol."},{"key":"ref_14","doi-asserted-by":"crossref","unstructured":"Rao, Y., Zhang, L., Gao, L., Wang, S., and Yang, L. (2025). ExAutoGP: Enhancing genomic prediction stability and interpretability with automated machine learning and SHAP. Animals, 15.","DOI":"10.3390\/ani15081172"},{"key":"ref_15","doi-asserted-by":"crossref","first-page":"1667","DOI":"10.3168\/jds.2019-17290","article-title":"Exploration of variance, autocorrelation, and skewness of deviations from lactation curves as resilience indicators for breeding","volume":"103","author":"Poppe","year":"2020","journal-title":"J. Dairy Sci."},{"key":"ref_16","doi-asserted-by":"crossref","first-page":"760","DOI":"10.3168\/jds.2024-25418","article-title":"Comparison of a machine learning model with a conventional rule-based selective dry cow therapy algorithm for detection of intramammary infections","volume":"108","author":"Rowe","year":"2025","journal-title":"J. Dairy Sci."},{"key":"ref_17","doi-asserted-by":"crossref","first-page":"3959","DOI":"10.3168\/jds.2023-24243","article-title":"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","volume":"107","year":"2024","journal-title":"J. Dairy Sci."},{"key":"ref_18","doi-asserted-by":"crossref","unstructured":"Thompson, J.S., Green, M.J., Hyde, R., Bradley, A.J., and O\u2019Grady, L. (2023). The use of machine learning to predict somatic cell count status in dairy cows post-calving. Front. Vet. Sci., 10.","DOI":"10.3389\/fvets.2023.1297750"},{"key":"ref_19","doi-asserted-by":"crossref","first-page":"106059","DOI":"10.1016\/j.prevetmed.2023.106059","article-title":"Risk prediction model of clinical mastitis in lactating dairy cows based on machine learning algorithms","volume":"221","author":"Luo","year":"2023","journal-title":"Prev. Vet. Med."},{"key":"ref_20","doi-asserted-by":"crossref","first-page":"105310","DOI":"10.1016\/j.rvsc.2024.105310","article-title":"The determination of mastitis severity at 4-level using Milk physical properties: A deep learning approach via MLP and evaluation at different SCC thresholds","volume":"174","author":"Yesil","year":"2024","journal-title":"Res. Vet. Sci."},{"key":"ref_21","doi-asserted-by":"crossref","unstructured":"Nagy, S.\u00c1., Csabai, I., Varga, T., P\u00f3th-Szebenyi, B., G\u00e1bor, G., and Solymosi, N. (2025). Neural network-aided milk somatic cell count increase prediction. Vet. Sci., 12.","DOI":"10.3390\/vetsci12050420"},{"key":"ref_22","doi-asserted-by":"crossref","unstructured":"Guo, R., Dai, Y., and Hu, J. (2025). Research on the prediction model of mastitis in dairy cows based on time series characteristics. Front. Vet. Sci., 12.","DOI":"10.3389\/fvets.2025.1575525"},{"key":"ref_23","doi-asserted-by":"crossref","first-page":"skaf041","DOI":"10.1093\/jas\/skaf041","article-title":"Predicting dry matter intake in cattle at scale using gradient boosting regression techniques and Gaussian process boosting regression with Shapley additive explanation explainable artificial intelligence, MLflow, and its containerization","volume":"103","author":"ArunKumar","year":"2025","journal-title":"J. Anim. Sci."},{"key":"ref_24","doi-asserted-by":"crossref","first-page":"11489","DOI":"10.3168\/jds.2023-24513","article-title":"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","volume":"107","author":"Taechachokevivat","year":"2024","journal-title":"J. Dairy Sci."},{"key":"ref_25","doi-asserted-by":"crossref","first-page":"106630","DOI":"10.1016\/j.prevetmed.2025.106630","article-title":"Evaluating machine learning classifiers and explainability for monitoring cow behaviour with wearable nose rings","volume":"244","author":"Essien","year":"2025","journal-title":"Prev. Vet. Med."},{"key":"ref_26","doi-asserted-by":"crossref","first-page":"550","DOI":"10.1093\/biolre\/ioaf009","article-title":"A deep learning tissue classifier based on differential co-expression genes predicts the pregnancy outcomes of cattle\u2020","volume":"112","author":"Huo","year":"2025","journal-title":"Biol. Reprod."},{"key":"ref_27","doi-asserted-by":"crossref","unstructured":"D\u017eermeikait\u0117, K., Kri\u0161tolaityt\u0117, J., Mala\u0161auskien\u0117, D., Arlauskait\u0117, S., Girdauskait\u0117, A., and Antanaitis, R. (2025). The impact of heat stress on dairy cattle: Effects on milk quality, rumination behaviour, and reticulorumen pH response using machine learning models. Biosensors, 15.","DOI":"10.3390\/bios15090608"},{"key":"ref_28","doi-asserted-by":"crossref","unstructured":"Kotlarz, K., Mielczarek, M., Biecek, P., Wojdak-Maksymiec, K., Suchocki, T., Topolski, P., Jagusiak, W., and Szyda, J. (2024). An explainable deep learning classifier of bovine mastitis based on whole-genome sequence data\u2014Circumventing the p >> n Problem. Int. J. Mol. Sci., 25.","DOI":"10.3390\/ijms25094715"},{"key":"ref_29","doi-asserted-by":"crossref","first-page":"1709","DOI":"10.14202\/vetworld.2020.1709-1713","article-title":"Relationship between somatic cell counts and subclinical mastitis in lactating dairy cows","volume":"13","author":"Sumon","year":"2020","journal-title":"Vet. World"}],"container-title":["Animals"],"original-title":[],"language":"en","link":[{"URL":"https:\/\/www.mdpi.com\/2076-2615\/16\/2\/204\/pdf","content-type":"unspecified","content-version":"vor","intended-application":"similarity-checking"}],"deposited":{"date-parts":[[2026,1,9]],"date-time":"2026-01-09T16:08:41Z","timestamp":1767974921000},"score":1,"resource":{"primary":{"URL":"https:\/\/www.mdpi.com\/2076-2615\/16\/2\/204"}},"subtitle":[],"short-title":[],"issued":{"date-parts":[[2026,1,9]]},"references-count":29,"journal-issue":{"issue":"2","published-online":{"date-parts":[[2026,1]]}},"alternative-id":["ani16020204"],"URL":"https:\/\/doi.org\/10.3390\/ani16020204","relation":{},"ISSN":["2076-2615"],"issn-type":[{"value":"2076-2615","type":"electronic"}],"subject":[],"published":{"date-parts":[[2026,1,9]]}}}