高级检索

基于XGBoost模型的放养牛行为识别方法研究

Behavior Recognition Method for Grazing Cattle Based on XGBoost

  • 摘要: 放养牛行为识别与监测是现代智慧养殖的重要环节。针对当前放养牛行为监测依赖人工、易受环境干扰的问题,提出了一种基于XGBoost模型的放养牛行为(休息、进食、反刍、活动)识别方法。首先,通过穿戴式智能电子项圈,同步采集试验牛的三轴加速度数据和视频画面。然后,从时域、频域、小波域及轴间交互等方面,提取特征共162维,通过递归特征消除,筛选保留86维特征。最后,利用随机搜索优化XGBoost模型关键参数,并引入SHAP可解释性分析。在20 s时间窗口下,XGBoost+RFE模型在测试集上的Accuracy和F1得分分别达90.91%和90.94%,与KNN、随机森林和LightGBM相比,F1得分分别提高了9.45、2.63、1.21个百分点;经RFE特征筛选后,模型识别Accuracy提高了0.89个百分点。对于不同行为类别,进食行为的识别效果最高,其F1得分达到93.98%,反刍、休息和活动的F1得分依次为91.14%、90.10%和88.58%。由此可知,该方法能有效地识别放养牛日常行为,可为放养牛的行为监测和疾病预警提供技术支撑。

     

    Abstract: Behavior recognition and monitoring of grazing cattle constitute an essential part of modern smart livestock farming. To address the problems of labor-intensive monitoring and susceptibility to environmental interference, this paper proposes an XGBoostbased method for recognizing four grazing cattle behaviors(resting, eating, ruminating and moving). First, a wearable smart electronic collar is used to synchronously collect triaxial acceleration data and video footage from experimental cattle. Then, a total of 162 dimensional features are extracted from the time domain, frequency domain, wavelet domain and interaxis interactions, which are reduced to 86 dimensions via recursive feature elimination. Finally, random search is employed to optimize the key hyperparameters of XGBoost, and SHAP interpretability analysis is introduced. Under a time window of 20 s, the model achieves an accuracy of 90.91% and an F1 score of 90.94% on the test set. Compared with KNN, random forest and LightGBM, the proposed model outperforms them by 9.45, 2.63, and 1.21 percentage points in F1 score, respectively. After RFEbased feature selection, the recognition accuracy increases by 0.89%. Among the four behavior categories, eating achieves the best recognition performance, with an F1 score of 93.98%, followed by ruminating(91.14%), resting(90.10%), and moving(88.58%). Experimental results demonstrate that the proposed method can effectively recognize the daily behaviors of grazing cattle, providing technical support for behavior monitoring and disease early warning in grazing cattle management.