Mastitis diagnosis with machine learning algorithms - Kalkan, Adnan; Tepeli, Mehmet; Göde, Aslı (Neural computing & applications, 2025)
Artificial intelligence is technologically intelligent computer software that can derive mathematical conclusions from what it has learned and help us make decisions. Machine learning, a sub-branch of artificial intelligence, is widely used in the medical field today. Studies in the literature show that machine learning methods provide quite successful results in diagnosing diseases. Mastitis disease affects many components of milk obtained from cows. In this context, as well as the number of somatic cells used in the detection of mastitis, analyzing changes in other components of milk enables a more accurate diagnosis of the disease. In this study, milk samples were taken from 118 different cows in dairy farms operating in Bucak district of Burdur province of Türkiye. The protein, fat, pH, lactose, viscosity, and color values of the milk samples were analyzed in a laboratory environment. The analysis results were used in the training and testing of machine learning algorithms, and mastitis disease was tried to be diagnosed with the results obtained from these algorithms. Considering the inputs of the research and the results obtained, appropriate algorithms were selected among machine learning algorithms. These algorithms are GaussianNB, Decision Tree, Support Vector Machine, K-Nearest Neighbor, Random Forest, Logistic Regression, XGBoost and LightGBM algorithms. As a result of the study, the performances of the algorithms for the diagnosis of mastitis were compared and the highest accuracy rate was achieved with the Decision Tree algorithm (89%). Additionally, this study showed that mastitis disease can be diagnosed with a 89% accuracy rate if the protein, fat, pH, lactose, viscosity, and color values in cow’s milk are analyzed as a whole. Therefore, mastitis in cows can be diagnosed by considering the number of somatic cells; it can also be diagnosed by holistic examination of protein, fat, pH, lactose, viscosity, and color values in milk. This study provides original information for the diagnosis of mastitis by holistically evaluating the relationship between the components of milk affected by mastitis using machine learning algorithms.