Robust Real-Time Analysis of Cow Behaviors Using Accelerometer Sensors and Decision Trees with Short Data Windows and Misalignment Compensation
Duc-Nghia Tran1, Viet-Manh Do1,2, Manh-Tuyen Vi3,*, Duc-Tan Tran3,*
1 Institute of Information Technology, Vietnam Academy of Science and Technology, Hanoi City, 100000, Vietnam
2 Graduate University of Sciences and Technology, Vietnam Academy of Science and Technology, Hanoi City, 100000, Vietnam
3 Faculty of Electrical and Electronic Engineering, Phenikaa University, Hanoi City, 100000, Vietnam
* Corresponding Author: Manh-Tuyen Vi. Email:
; Duc-Tan Tran. Email:
Computers, Materials & Continua https://doi.org/10.32604/cmc.2025.062590
Received 22 December 2024; Accepted 05 March 2025; Published online 24 March 2025
Abstract
This study focuses on the design and validation of a behavior classification system for cattle using behavioral data collected through accelerometer sensors. Data collection and behavioral analysis are achieved using machine learning (ML) algorithms through accelerometer sensors. However, behavioral analysis poses challenges due to the complexity of cow activities. The task becomes more challenging in a real-time behavioral analysis system with the requirement for shorter data windows and energy constraints. Shorter windows may lack sufficient information, reducing algorithm performance. Additionally, the sensor’s position on the cows may shift during practical use, altering the collected accelerometer data. This study addresses these challenges by employing a 3-s data window to analyze cow behaviors, specifically Feeding, Lying, Standing, and Walking. Data synchronization between accelerometer sensors placed on the neck and leg compensates for the lack of information in short data windows. Features such as the Vector of Dynamic Body Acceleration (VeDBA), Mean, Variance, and Kurtosis are utilized alongside the Decision Tree (DT) algorithm to address energy efficiency and ensure computational effectiveness. This study also evaluates the impact of sensor misalignment on behavior classification. Simulated datasets with varying levels of sensor misalignment were created, and the system’s classification accuracy exceeded 0.95 for the four behaviors across all datasets (including original and simulated misalignment datasets). Sensitivity (Sen) and PPV for all datasets were above 0.9. The study provides farmers and the dairy industry with a practical, energy-efficient system for continuously monitoring cattle behavior to enhance herd productivity while reducing labor costs.
Keywords
Monitoring; behavior; classification; accelerometer; sensor; misalignment; leg-mounted; neck-mounted; cow