Research Article
BibTex RIS Cite

Explainable Machine Learning Framework for Milk Quality Grading

Year 2025, Volume: 18 Issue: 3, 227 - 235, 03.10.2025

Abstract

This study introduces an explainable machine learning framework for milk quality grading, combining high predictive performance with transparency and practicality. Utilizing Random Forest and HistGradientBoost models, alongside interpretability techniques like Permutation Feature Importance and LIME, the framework achieves robust classification while providing actionable insights. Global explanations identify pH and Temperature as critical factors, highlighting their significance in real-time monitoring and microbial control. Local explanations, based on the two presented examples, demonstrate the practical utility of individual predictions, offering targeted interventions such as optimizing storage conditions or addressing contamination risks. By bridging the gap between predictive accuracy and interpretability, this framework not only enhances trust and usability for stakeholders but also establishes a new perspective for integrating AI-driven quality control systems into the dairy industry.

References

  • Altmann, A., Toloşi, L., Sander, O., & Lengauer, T. (2010). Permutation importance: A corrected feature importance measure. Bioinformatics, 26(10), 1340-1347. https://doi.org/10.1093/bioinformatics/btq134
  • Bhavsar, D., Jobanputra, Y., & Swain, N. K. (2023). Milk quality prediction using machine learning. EAI Endorsed Transactions on Internet of Things. https://doi.org/10.4108/eetiot.4501
  • Bovo, M., Agrusti, M., Benni, S., Torreggiani, D., & Tassinari, P. (2021). Random forest modelling of milk yield of dairy cows under heat stress conditions. Animals, 11(5), 1305. https://doi.org/10.3390/ani11051305
  • Buyuktepe, O., Catal, C., Kar, G., Bouzembrak, Y., Marvin, H., & Gavai, A. (2023). Food fraud detection using explainable artificial intelligence. Expert Systems. https://doi.org/10.1111/exsy.13387
  • Dang, M., Wang, H. X., Li, Y. F., & Nguyen, T. N. (2022). Explainable artificial intelligence: A comprehensive review. Artificial Intelligence Review, 55, 3503–3568. https://doi.org/10.1007/s10462-021-10088-y
  • Ebrahimi, M., Mohammadi-Dehcheshmeh, M., Ebrahimie, E., & Petrovski, K. R. (2019). Comprehensive analysis of machine learning models for prediction of sub-clinical mastitis: Deep Learning and Gradient-Boosted Trees outperform other models. Computers in Biology and Medicine, 114, 103456. https://doi.org/10.1016/j.compbiomed.2019.103456
  • Frizzarin, M., Gormley, I. C., Berry, D. P., & Murphy, T. B. (2021). Predicting cow milk quality traits from routinely available milk spectra using statistical machine learning methods. Journal of Dairy Science, 104(7), 7438–7447. https://doi.org/10.3168/jds.2020-19576
  • GNV, P. (2020). Milk Grading (Classification) (Version 1) [Dataset; Kaggle]. Kaggle. https://www.kaggle.com/datasets/prudhvignv/milk-grading/data
  • Islam, M. R., Ahmed, M. U., Barua, S., & Begum, S. (2022). A systematic review of explainable artificial intelligence in terms of different application domains and tasks. Applied Sciences, 12(1353). https://doi.org/10.3390/app12031353
  • Mammadova, N., & Keskin, İ. (2013). Application of the support vector machine to predict subclinical mastitis in dairy cattle. The Scientific World Journal, 2013(1), 603897. https://doi.org/10.1155/2013/603897
  • Mota, L. F., Giannuzzi, D., Bisutti, V., Pegolo, S., Trevisi, E., Schiavon, S., ... & Cecchinato, A. (2022). Real-time milk analysis integrated with stacking ensemble learning as a tool for the daily prediction of cheese-making traits in Holstein cattle. Journal of Dairy Science, 105(5), 4237-4255. https://doi.org/10.3168/jds.2021-21426
  • Mu, F., Gu, Y., Zhang, J., & Zhang, L. (2020). Milk source identification and milk quality estimation using an electronic nose and machine learning techniques. Sensors, 20(15), 4238. https://doi.org/10.3390/s20154238
  • Neware, S. (2023). Cow Milk Quality Grading using Machine Learning Methods. International Journal of Next-Generation Computing, 14(1).
  • Polat, O., Akçok, S. G., & Akbay, M. A. (2021). Classification of raw cow milk using information fusion framework. Journal of Food Measurement and Characterization, 15, 5113–5130. https://doi.org/10.1007/s11694-021-01076-5
  • Przybył, K. (2024). Explainable AI: Machine learning interpretation in blackcurrant powders. Sensors, 24(3198). https://doi.org/10.3390/s24103198
  • Ribeiro, M. T., Singh, S., & Guestrin, C. (2016). "Why should I trust you?": Explaining the predictions of any classifier. Proceedings of the 22nd ACM SIGKDD International Conference on Knowledge Discovery and Data Mining, 1135–1144. https://doi.org/10.1145/2939672.2939778
  • Samad, A., Taze, S., & Ucar, M. (2024). Enhancing milk quality detection with machine learning: A comparative analysis of KNN and distance-weighted KNN algorithms. International Journal of Innovative Science and Research Technology, 9(3). https://doi.org/10.38124/ijisrt/IJISRT24MAR2123
  • Satoła, A., & Satoła, K. (2024). 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. Journal of Dairy Science, 107(6), 3959-3972. https://doi.org/10.3168/jds.2023-24243
  • Sheng, T., Shi, S., Zhu, Y., Chen, D., & Liu, S. (2022). Analysis of protein and fat in milk using multiwavelength gradient-boosted regression tree. IEEE Transactions on Instrumentation and Measurement, 71, 2507810. https://doi.org/10.1109/TIM.2022.3165298
  • Vishnu, K., & Kumar, S. P. (2024). Enhancing the quality of milk prediction using random forest algorithm and logistic regression algorithm. AIP Conference Proceedings, 3193(1). https://doi.org/10.1063/5.0238130

Süt Kalitesi Derecelendirmesi için Açıklanabilir Makine Öğrenimi Çerçevesi

Year 2025, Volume: 18 Issue: 3, 227 - 235, 03.10.2025

Abstract

Bu çalışma, süt kalitesinin değerlendirilmesinde yüksek tahmin doğruluğunu şeffaflık ve kullanışlılık ile birleştiren açıklanabilir bir makine öğrenimi yaklaşımı sunmaktadır. Random Forest ve HistGradientBoost modellerinin yanı sıra Permutasyon Feature Importanee ve LIME gibi yorumlanabilirlik tekniklerini kullanan bu yaklaşım, güçlü bir sınıflandırma performansı sağlarken uygulanabilir içgörüler de sunmaktadır. Global yorumlanabilirlik sonuçları, pH ve Sıcaklık gibi kritik faktörleri belirleyerek gerçek zamanlı izleme ve mikrobiyal kontroldeki önemlerini vurgulamaktadır. Yerel yorumlanabilirlik sonuçları ise, sunulan 2 örnek üzerinden, bireysel tahminlerin pratik faydasını göstererek depolama koşullarının optimize edilmesi veya kontaminasyon risklerinin ele alınması gibi hedefe yönelik müdahalelere olanak tanımaktadır. Tahmin doğruluğu ile yorumlanabilirlik arasındaki boşluğu kapatan bu yaklaşım, yalnızca paydaşlar için güven ve kullanılabilirliği artırmakla kalmayıp, aynı zamanda AI destekli kalite kontrol sistemlerinin süt endüstrisine entegrasyonu için yeni bir perspektif sunmaktadır.

References

  • Altmann, A., Toloşi, L., Sander, O., & Lengauer, T. (2010). Permutation importance: A corrected feature importance measure. Bioinformatics, 26(10), 1340-1347. https://doi.org/10.1093/bioinformatics/btq134
  • Bhavsar, D., Jobanputra, Y., & Swain, N. K. (2023). Milk quality prediction using machine learning. EAI Endorsed Transactions on Internet of Things. https://doi.org/10.4108/eetiot.4501
  • Bovo, M., Agrusti, M., Benni, S., Torreggiani, D., & Tassinari, P. (2021). Random forest modelling of milk yield of dairy cows under heat stress conditions. Animals, 11(5), 1305. https://doi.org/10.3390/ani11051305
  • Buyuktepe, O., Catal, C., Kar, G., Bouzembrak, Y., Marvin, H., & Gavai, A. (2023). Food fraud detection using explainable artificial intelligence. Expert Systems. https://doi.org/10.1111/exsy.13387
  • Dang, M., Wang, H. X., Li, Y. F., & Nguyen, T. N. (2022). Explainable artificial intelligence: A comprehensive review. Artificial Intelligence Review, 55, 3503–3568. https://doi.org/10.1007/s10462-021-10088-y
  • Ebrahimi, M., Mohammadi-Dehcheshmeh, M., Ebrahimie, E., & Petrovski, K. R. (2019). Comprehensive analysis of machine learning models for prediction of sub-clinical mastitis: Deep Learning and Gradient-Boosted Trees outperform other models. Computers in Biology and Medicine, 114, 103456. https://doi.org/10.1016/j.compbiomed.2019.103456
  • Frizzarin, M., Gormley, I. C., Berry, D. P., & Murphy, T. B. (2021). Predicting cow milk quality traits from routinely available milk spectra using statistical machine learning methods. Journal of Dairy Science, 104(7), 7438–7447. https://doi.org/10.3168/jds.2020-19576
  • GNV, P. (2020). Milk Grading (Classification) (Version 1) [Dataset; Kaggle]. Kaggle. https://www.kaggle.com/datasets/prudhvignv/milk-grading/data
  • Islam, M. R., Ahmed, M. U., Barua, S., & Begum, S. (2022). A systematic review of explainable artificial intelligence in terms of different application domains and tasks. Applied Sciences, 12(1353). https://doi.org/10.3390/app12031353
  • Mammadova, N., & Keskin, İ. (2013). Application of the support vector machine to predict subclinical mastitis in dairy cattle. The Scientific World Journal, 2013(1), 603897. https://doi.org/10.1155/2013/603897
  • Mota, L. F., Giannuzzi, D., Bisutti, V., Pegolo, S., Trevisi, E., Schiavon, S., ... & Cecchinato, A. (2022). Real-time milk analysis integrated with stacking ensemble learning as a tool for the daily prediction of cheese-making traits in Holstein cattle. Journal of Dairy Science, 105(5), 4237-4255. https://doi.org/10.3168/jds.2021-21426
  • Mu, F., Gu, Y., Zhang, J., & Zhang, L. (2020). Milk source identification and milk quality estimation using an electronic nose and machine learning techniques. Sensors, 20(15), 4238. https://doi.org/10.3390/s20154238
  • Neware, S. (2023). Cow Milk Quality Grading using Machine Learning Methods. International Journal of Next-Generation Computing, 14(1).
  • Polat, O., Akçok, S. G., & Akbay, M. A. (2021). Classification of raw cow milk using information fusion framework. Journal of Food Measurement and Characterization, 15, 5113–5130. https://doi.org/10.1007/s11694-021-01076-5
  • Przybył, K. (2024). Explainable AI: Machine learning interpretation in blackcurrant powders. Sensors, 24(3198). https://doi.org/10.3390/s24103198
  • Ribeiro, M. T., Singh, S., & Guestrin, C. (2016). "Why should I trust you?": Explaining the predictions of any classifier. Proceedings of the 22nd ACM SIGKDD International Conference on Knowledge Discovery and Data Mining, 1135–1144. https://doi.org/10.1145/2939672.2939778
  • Samad, A., Taze, S., & Ucar, M. (2024). Enhancing milk quality detection with machine learning: A comparative analysis of KNN and distance-weighted KNN algorithms. International Journal of Innovative Science and Research Technology, 9(3). https://doi.org/10.38124/ijisrt/IJISRT24MAR2123
  • Satoła, A., & Satoła, K. (2024). 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. Journal of Dairy Science, 107(6), 3959-3972. https://doi.org/10.3168/jds.2023-24243
  • Sheng, T., Shi, S., Zhu, Y., Chen, D., & Liu, S. (2022). Analysis of protein and fat in milk using multiwavelength gradient-boosted regression tree. IEEE Transactions on Instrumentation and Measurement, 71, 2507810. https://doi.org/10.1109/TIM.2022.3165298
  • Vishnu, K., & Kumar, S. P. (2024). Enhancing the quality of milk prediction using random forest algorithm and logistic regression algorithm. AIP Conference Proceedings, 3193(1). https://doi.org/10.1063/5.0238130
There are 20 citations in total.

Details

Primary Language English
Subjects Veterinary Food Hygiene and Technology, Animal Science, Genetics and Biostatistics
Journal Section RESEARCH ARTICLE
Authors

Bekir Çetintav 0000-0001-7251-1211

Ahmet Yalçın 0009-0001-6093-8282

Early Pub Date September 19, 2025
Publication Date October 3, 2025
Submission Date December 2, 2024
Acceptance Date August 4, 2025
Published in Issue Year 2025 Volume: 18 Issue: 3

Cite

APA Çetintav, B., & Yalçın, A. (2025). Explainable Machine Learning Framework for Milk Quality Grading. Kocatepe Veterinary Journal, 18(3), 227-235.
AMA Çetintav B, Yalçın A. Explainable Machine Learning Framework for Milk Quality Grading. kvj. October 2025;18(3):227-235.
Chicago Çetintav, Bekir, and Ahmet Yalçın. “Explainable Machine Learning Framework for Milk Quality Grading”. Kocatepe Veterinary Journal 18, no. 3 (October 2025): 227-35.
EndNote Çetintav B, Yalçın A (October 1, 2025) Explainable Machine Learning Framework for Milk Quality Grading. Kocatepe Veterinary Journal 18 3 227–235.
IEEE B. Çetintav and A. Yalçın, “Explainable Machine Learning Framework for Milk Quality Grading”, kvj, vol. 18, no. 3, pp. 227–235, 2025.
ISNAD Çetintav, Bekir - Yalçın, Ahmet. “Explainable Machine Learning Framework for Milk Quality Grading”. Kocatepe Veterinary Journal 18/3 (October2025), 227-235.
JAMA Çetintav B, Yalçın A. Explainable Machine Learning Framework for Milk Quality Grading. kvj. 2025;18:227–235.
MLA Çetintav, Bekir and Ahmet Yalçın. “Explainable Machine Learning Framework for Milk Quality Grading”. Kocatepe Veterinary Journal, vol. 18, no. 3, 2025, pp. 227-35.
Vancouver Çetintav B, Yalçın A. Explainable Machine Learning Framework for Milk Quality Grading. kvj. 2025;18(3):227-35.

13520    13521       13522   1352314104

14105         14106        14107       14108