Table of Contents
Fetching ...

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.

Detection of anomalies in cow activity using wavelet transform based features

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.

Paper Structure

This paper contains 20 sections, 5 equations, 8 figures, 4 tables, 1 algorithm.

Figures (8)

  • Figure 1: Window labelling. If at least one data from an abnormal period is in the window, the window is labelled abnormal. If at least one data from a fuzzy period is in the window, without any abnormal data, the window is labelled fuzzy. Otherwise, the window is labelled normal.
  • Figure 2: Pipeline for the creation of wavelet-based features.
  • Figure 3: Activity Level (AL) of Cow n°7163 from Dataset 2 from March 5, 2013 to March 9, 2013. The green background corresponds to days with no recorded anomaly, and the red background corresponds to the day with an anomaly recorded by caretakers.
  • Figure 4: States of the time series of two cows from Dataset 2. The time series begin on 2 March 2015 and ends on 30 April 2015. The blue curves represent the states annotated by the caretakers. The green curves represent the predicted states. The red dotted line represents the threshold under which the hours are predicted as abnormal.
  • Figure 5: Histograms of the mean ratio of the average distance of detection normalized by the initial distribution of the data, for Dataset 1. The black bars represent the standard deviation.
  • ...and 3 more figures