Detection of anomalies in cow activity using wavelet transform based features
Valentin Guien, Violaine Antoine, Romain Lardy, Isabelle Veissier, Luis E C Rocha
TL;DR
The paper addresses the challenge of detecting anomalies in 24h cow activity time series amid substantial biological noise, with the aim of early disease or oestrus detection in Precision Livestock Farming. It introduces a wavelet-based feature extraction framework that compares the DWT of each window to the transformed average normal period, integrated into an Isolation Forest classifier on sliding windows. Across two farm datasets, the wavelet-based features emerge as strong contributors to anomaly detection and can yield earlier detections than caretaker annotations, especially in one dataset where precision improves notably. The findings demonstrate that wavelet denoising and feature extraction provide a practical, interpretable approach for early warning in livestock management, while highlighting directions for future work with CNN-based methods and improved handling of fuzzy labels.
Abstract
In Precision Livestock Farming, detecting deviations from optimal or baseline values - i.e. anomalies in time series - is essential to allow undertaking corrective actions rapidly. Here we aim at detecting anomalies in 24h time series of cow activity, with a view to detect cases of disease or oestrus. Deviations must be distinguished from noise which can be very high in case of biological data. It is also important to detect the anomaly early, e.g. before a farmer would notice it visually. Here, we investigate the benefit of using wavelet transforms to denoise data and we assess the performance of an anomaly detection algorithm considering the timing of the detection. We developed features based on the comparisons between the wavelet transforms of the mean of the time series and the wavelet transforms of individual time series instances. We hypothesized that these features contribute to the detection of anomalies in periodic time series using a feature-based algorithm. We tested this hypothesis with two datasets representing cow activity, which typically follows a daily pattern but can deviate due to specific physiological or pathological conditions. We applied features derived from wavelet transform as well as statistical features in an Isolation Forest algorithm. We measured the distance of detection between the days annotated abnormal by animal caretakers days and the days predicted abnormal by the algorithm. The results show that wavelet-based features are among the features most contributing to anomaly detection. They also show that detections are close to the annotated days, and often precede it. In conclusion, using wavelet transforms on time series of cow activity data helps to detect anomalies related to specific cow states. The detection is often obtained on days that precede the day annotated by caretakers, which offer possibility to take corrective actions at an early stage.
