Shirani Shamsabadi Javad, Ansari Mahyari Saeid, Ghaderi-Zefrehei Mostafa
Department of Animal Science, College of Agriculture, Isfahan University of Technology, Isfahan, Iran.
Department of Animal Science, Agricultural Faculty, Yasouj University, Yasouj, Iran.
Sci Rep. 2025 Jul 1;15(1):20456. doi: 10.1038/s41598-025-03008-5.
For modeling dairy cattle data, fuzzy logic offers the capability to manage uncertainty, enhance accuracy, facilitate informed decision-making, and optimize resource allocation. A critical aspect of dairy cattle production is the modeling of mastitis, an udder infection that affects milk quality and yields significant economic consequences. The aim of this study was to compare the performance of three adaptive neuro-fuzzy inference systems (ANFIS) classification methodologies in classifying mastitis in Holstein dairy cattle: gradient descent (GD)-based ANFIS (GD-ANIFIS), particle swarm optimization (PSO)-based ANFIS (PSO-ANFIS) and genetic algorithm (GA)-based ANFIS (GA-ANFIS). Two feature reduction techniques were used to reduce data dimensions and improve model performance: Pearson correlation and principal component analysis. The dataset exhibited a problem of class imbalance, with the majority class (non-mastitis cases) being over-represented. To address this issue, an undersampling algorithm was applied to balance the class distribution by removing a portion of the majority class data. ANFIS models were evaluated using training and test datasets, and performance metrics derived from confusion matrix (accuracy, precision, recall, F1-score). The results showed that the GD-ANFIS model integrated with the Pearson method demonstrated superior performance compared to PSO-ANFIS and GA-ANFIS across key evaluation metrics such as accuracy and error rates. However, due to the interplay of multiple evaluation criteria and the closely clustered fitted values, determining a definitive best model almost remained challenging In addition to improving udder health, milk quality, and economic viability, this research can contribute to ongoing soft computing efforts to improve mastitis detection and management in dairy cattle. To ensure transparency and reproducibility, all MATLAB codes utilized in this study are included in the appendix. In precision dairy farm production, these codes may serve as a foundation for developing mobile applications.
对于奶牛数据建模,模糊逻辑具备处理不确定性、提高准确性、促进明智决策以及优化资源分配的能力。奶牛生产的一个关键方面是乳腺炎建模,乳腺炎是一种影响牛奶质量并造成重大经济后果的乳房感染疾病。本研究的目的是比较三种自适应神经模糊推理系统(ANFIS)分类方法在对荷斯坦奶牛乳腺炎进行分类时的性能:基于梯度下降(GD)的ANFIS(GD - ANIFIS)、基于粒子群优化(PSO)的ANFIS(PSO - ANFIS)和基于遗传算法(GA)的ANFIS(GA - ANFIS)。使用了两种特征约简技术来降低数据维度并提高模型性能:皮尔逊相关性和主成分分析。该数据集存在类别不平衡问题,多数类别(非乳腺炎病例)占比过高。为解决此问题,应用了欠采样算法,通过去除一部分多数类别数据来平衡类别分布。使用训练和测试数据集对ANFIS模型进行评估,并从混淆矩阵得出性能指标(准确率、精确率、召回率、F1分数)。结果表明,与PSO - ANFIS和GA - ANFIS相比,集成皮尔逊方法的GD - ANFIS模型在诸如准确率和错误率等关键评估指标上表现更优。然而,由于多个评估标准的相互作用以及拟合值紧密聚类,确定一个绝对最佳的模型几乎仍然具有挑战性。除了改善乳房健康、牛奶质量和经济可行性外,本研究还可为当前旨在改善奶牛乳腺炎检测和管理的软计算工作做出贡献。为确保透明度和可重复性,本研究中使用的所有MATLAB代码均包含在附录中。在精准奶牛场生产中,这些代码可作为开发移动应用程序的基础。