高级检索

    基于机器学习的奶牛发情识别方法研究

    Machine Learning-Based for Detecting Estrus in Dairy Cows

    • 摘要: 针对奶牛发情监测中人工观察获取标签成本高、主观性强,以及模型特征维度高导致的计算功耗大的问题,本文提出一种基于无监督聚类与可解释性特征选择的发情识别方法。该方法通过K-means对奶牛颈部佩戴的加速度计采集的数据进行聚类,生成发情标签。通过对比K近邻(K-Nearest Neighbors, KNN)、支持向量机(Support Vector Machine, SVM)与随机森林(Random Forest, RF)3种模型在10 、30 s和50 s窗口下的性能,结合Friedman检验和Nemenyi检验确定最佳模型。进一步结合沙普利加性解释(Shapely Additive Explanations, SHAP)量化模型特征贡献度,筛选出最优特征子集。研究结果表明,基于10 s时间窗口的随机森林模型性能最优,经SHAP方法筛选后,特征从25维降至3维,且降维后的模型性能未出现显著性差异,其准确率、精确率、召回率和F1-score分别达0.9911、0.9370、0.9955、0.9654。在基于奶牛三轴加速度数据的独立泛化试验中,降维后10 s窗口的RF模型的发情检出准确率达0.9090。本文提出的方法实现了发情标签的生成与特征的降维,且模型具有可解释性,为研发低功耗、长续航的奶牛发情监测设备提供了技术支撑。

       

      Abstract: To address the issues of high cost and strong subjectivity associated with manual observation in dairy cow estrus detection, as well as the high computational power consumption caused by high-dimensional model features, this study proposes a dairy cow estrus detection method based on unsupervised clustering and interpretable feature selection. The method utilizes the K-means algorithm to cluster raw activity time series data collected by neck-mounted accelerometers on dairy cows to automatically generate estrus behavior labels. Three models are compared: K-Nearest Neighbors (KNN), Support Vector Machine (SVM), and Random Forest (RF). These models are evaluated under time windows of 10 , 30 s, and 50 s. Finally, the optimal model is determined by the Friedman test and the Nemenyi post-hoc test. The Shapley Additive Explanations (SHAP) method is introduced to quantify feature contributions and screen for the key feature. The results indicate that the RF model based on a 10 s time window achieves the best performance. Through SHAP selection, the feature is reduced from 25 to 3. The performance of the dimension-reduced model shows no significant deviation, with accuracy, precision, recall, and F1 score reaching 0.9911, 0.9370, 0.9955, and 0.9654, respectively. In independent trials based on three-axis acceleration data from dairy cows, the RF model achieves an estrus detection accuracy of 0.9090 using a 10 s window following dimensionality reduction. The proposed method enables both estrus label generation and feature dimensionality reduction, while maintaining model interpretability. This provides technical support for developing low-power, long-endurance estrus monitoring devices for dairy cows.

       

    /

    返回文章
    返回