# Artificial Intelligence and Circadian Thresholds for Stress Detection in Dairy Cattle

**Authors:** Samuel Lascano Rivera, Luis Rivera, Hernán Benavides, Yasmany Fernández

PMC · DOI: 10.3390/s25216544 · 2025-10-24

## TL;DR

This study uses AI and circadian rhythms to detect stress in dairy cows, enabling early intervention for better animal welfare.

## Contribution

A novel LSTM model integrating circadian features for stress classification in dairy cattle with a one-hour prediction lead time.

## Key findings

- The LSTM model achieved 82.3% accuracy and 0.847 AUC in stress classification.
- Circadian features extracted via FFT and STFT improved stress detection compared to logistic regression.
- A one-hour lead time was achieved for anticipating stress from management and environmental factors.

## Abstract

This study investigates stress detection in dairy cattle by integrating circadian rhythm analysis and deep learning. Behavioral biomarkers, including feeding, resting, and rumination, were continuously monitored using Nedap CowControl sensors over a 12-month period to capture seasonal variability. Circadian features were extracted using the Fast Fourier Transform (FFT), and deviations from expected 24 h patterns were quantified using Euclidean distance. These features were used to train a Long Short-Term Memory (LSTM) neural network to classify stress into three levels: normal, mild, and high. Expert veterinary observations of anomalous behaviors and environmental records were used to validate stress labeling. We continuously monitored 10 lactating Holstein cows for 365 days, yielding 87,600 raw hours and 3650 cow-days (one day per cow as the analytical unit). The Short-Time Fourier Transform (STFT, 36 h window, 1 h step) was used solely to derive daily circadian characteristics (amplitude, phase, coherence); STFT windows are not statistical samples. A 60 min window prior to stress onset was incorporated to anticipate stress conditions triggered by management practices and environmental stressors, such as vaccination, animal handling, and cold stress. The proposed LSTM model achieved an accuracy of 82.3% and an AUC of 0.847, outperforming a benchmark logistic regression model (65% accuracy). This predictive capability, with a one-hour lead time, provides a critical window for preventive interventions and represents a practical tool for precision livestock farming and animal welfare monitoring.

## Full-text entities

- **Species:** Bos taurus (bovine, species) [taxon 9913]

## Figures

9 figures with captions in the complete paper: https://tomesphere.com/paper/PMC12610535/full.md

---
Source: https://tomesphere.com/paper/PMC12610535