Behavior Recognition Method for Grazing Cattle Based on XGBoost
-
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.
-
-