Feature engineering, parameter optimization, and interpretable modeling for accelerometer-based behavior recognition
Xiao Yang1, Luwei Nie2, Qunpeng Niu3
1College of Water Resources and Intelligence Engineering, China Agricultural University, Beijing, 100083, China; Key Laboratory of Agricultural Engineering in Structure and Environment, Ministry of Agriculture and Rural Affairs, Beijing, 100083, China.
Abstract:
Behavior monitoring is essential for assessing the health and welfare of laying hens. As the dominant trend in global egg production, aviary systems introduce considerable challenges for behavior recognition. Existing studies remain fragmented and lack standardized analytical guidelines for sliding window configuration, feature selection, and model choice, making it difficult to compare results across studies and to develop robust, generalizable systems. Therefore, this study proposes a comprehensive framework for accelerometer-based behavior recognition. A total of 25 Hy-Line laying hens were reared in an aviary system at the age of 65 weeks. Ten light-weight accelerometers were attached to the wings of selected birds to collect behavioral data at a sampling frequency of 15 Hz. Resting, drinking, feeding, walking, and flying behaviors were investigated in this study. Hundreds of features were automatically extracted using scalable hypothesis testing, and the effects of feature quantity on model performance was evaluated. Five machine learning (ML) models and four deep learning (DL) models were compared under four sliding window sizes (1 s, 2 s, 3 s, and 5 s) and five overlap ratios (0%, 25%, 50%, 70%, and 90%), to determine the optimal configuration. Additionally, interpretability analysis was conducted for the best-performing ML model. The results indicated that Extreme Gradient Boosting (XGB) and one-dimensional Convolutional Neural Network (1D-CNN) achieved the best performance among ML and DL models, respectively. XGB achieved an overall accuracy of 0.985 and an F1 score of 0.987, while 1D-CNN achieved an accuracy of 0.985 and an F1 score of 0.985. The optimal configuration was a 3-s sliding window with 50% overlap. Model interpretation revealed that acceleration variability, amplitude, and energy-related features were the most influential for behavior discrimination, with significant interactions among features. This study provides practical insights for developing acceleration-based behavior classification technologies and supports precision poultry management.
