Traditional methods to monitor free-range cattle, such as breeding beef bulls, are time-consuming. However, most current remote monitoring technologies operate at high sampling rates, making their use on bulls impractical due to their high battery consumption. Therefore, this study aims to describe and evaluate a machine-learning framework to predict the behaviors of beef bulls from raw accelerometer data at low sampling rates. Collars with 3D-accelerometers were deployed on 33 bulls, recording accelerometer data at 0.5 Hz (22 bulls in 2020 and 2021) or 1.0 Hz (11 bulls in 2023). Videos of bulls in pens, synched with the accelerometer by time, were recorded and analyzed. The behaviors investigated were grazing (GR), resting (RE), ruminating (RU), walking (WA), and in 2023, fighting (FI). Primary labels of activity (AC), corresponding to GR, WA, and FI, and non-activity (NA), corresponding to RE and RU, were assigned. Two datasets were created from data sampled at 1.0 Hz and 0.5 Hz. Then, behavioral events with duration within the inferior 0.05 quantile of the distribution for each behavior were removed, integrated measures of motion were calculated, and segmentation into consecutive 20s time-windows was performed. Afterward, 132 frequency and time-domain features were extracted, and bulls’ ages were added as a physical feature. Two bulls from each year and dataset were segregated to form independent test sets. A leave-one-animal-out cross-validation (LOAO) was applied to Extratree classifiers to select relevant features. The final classifier was built in a hierarchical structure using XGBoost classifiers to make predictions on two levels: (1) distinguishing between AC and NA, and (2) categorizing AC into GR, WA, FI, and NA into RE or RU. This model was evaluated using LOAO and test sets for each dataset, and precision and sensitivity were calculated for each behavior. Matthews Correlation (MCC) and Cohen's Kappa (CK) coefficients were calculated for the overall assessment of the models’ levels. Comparisons of metrics obtained on LOAO and test sets were performed using the Wilcoxon Sum Rank and the Wilcoxon Signed Rank test. The LOAO MCC for 1.0 Hz (1st level=0.98±0.01, 2nd level=0.92±0.02) was higher than 0.5 Hz (1st level=0.83±0.20, 2nd level=0.71±0.20). In 1.0 Hz, all behaviors presented mean precision and sensitivity above 0.7, except the sensitivity of FI (LOAO = 0.47±0.06, test set = 0.63±0.18). In 0.5 Hz, the exception was the sensitivity of WA (LOAO = 0.58±0.28, test set = 0.68±0.06) and the sensitivity of RU in the test set (0.54 ± 0.26). Therefore, the proposed framework can be used to predict the behaviors of beef bulls from accelerometers sampling at 0.5 Hz or 1.0 Hz, although better results are observed at 1.0 Hz. Caution should be exercised for predicting FI at 1.0 Hz and WA at 0.5 Hz.
Read full abstract