{"status":"ok","message-type":"work","message-version":"1.0.0","message":{"indexed":{"date-parts":[[2026,9,11]],"date-time":"2026-09-11T21:07:47Z","timestamp":1789160867095,"version":"build-2803163510"},"reference-count":52,"publisher":"MDPI AG","issue":"21","license":[{"start":{"date-parts":[[2025,10,24]],"date-time":"2025-10-24T00:00:00Z","timestamp":1761264000000},"content-version":"vor","delay-in-days":0,"URL":"https:\/\/creativecommons.org\/licenses\/by\/4.0\/"}],"funder":[{"name":"the Research Directorate of the State Polytechnic University of Carchi","award":["CSUP-021-2025"],"award-info":[{"award-number":["CSUP-021-2025"]}]}],"content-domain":{"domain":[],"crossmark-restriction":false},"short-container-title":["Sensors"],"abstract":"<jats:p>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.<\/jats:p>","DOI":"10.3390\/s25216544","type":"journal-article","created":{"date-parts":[[2025,10,24]],"date-time":"2025-10-24T01:35:11Z","timestamp":1761269711000},"page":"6544","update-policy":"https:\/\/doi.org\/10.3390\/mdpi_crossmark_policy","source":"Crossref","is-referenced-by-count":2,"title":["Artificial Intelligence and Circadian Thresholds for Stress Detection in Dairy Cattle"],"prefix":"10.3390","volume":"25","author":[{"ORCID":"https:\/\/orcid.org\/0000-0001-5967-6441","authenticated-orcid":false,"given":"Samuel Lascano","family":"Rivera","sequence":"first","affiliation":[{"name":"Research Department, State Polytechnic University of Carchi, Tulc\u00e1n 040101, Ecuador"},{"name":"Postgraduate Program, Faculty of Systems and Informatics Engineering, National University of San Marcos, Lima 15081, Peru"}],"role":[{"vocabulary":"crossref","role":"author"}]},{"ORCID":"https:\/\/orcid.org\/0000-0002-5029-2561","authenticated-orcid":false,"given":"Luis","family":"Rivera","sequence":"additional","affiliation":[{"name":"Postgraduate Program, Faculty of Systems and Informatics Engineering, National University of San Marcos, Lima 15081, Peru"},{"name":"Mathematical Sciences Laboratory, State University of Norte Fluminense, Rio de Janeiro 28013-602, Brazil"}],"role":[{"vocabulary":"crossref","role":"author"}]},{"ORCID":"https:\/\/orcid.org\/0000-0001-9236-3076","authenticated-orcid":false,"given":"Hern\u00e1n","family":"Benavides","sequence":"additional","affiliation":[{"name":"Research Department, State Polytechnic University of Carchi, Tulc\u00e1n 040101, Ecuador"}],"role":[{"vocabulary":"crossref","role":"author"}]},{"ORCID":"https:\/\/orcid.org\/0000-0002-9530-4028","authenticated-orcid":false,"given":"Yasmany","family":"Fern\u00e1ndez","sequence":"additional","affiliation":[{"name":"Research Department, State Polytechnic University of Carchi, Tulc\u00e1n 040101, Ecuador"}],"role":[{"vocabulary":"crossref","role":"author"}]}],"member":"1968","published-online":{"date-parts":[[2025,10,24]]},"reference":[{"key":"ref_1","unstructured":"CONtexto Ganadero (2025, March 25). Los Diferentes Tipos de Estr\u00e9s Que Pueden Presentar Los Bovinos. Available online: https:\/\/www.contextoganadero.com\/ganaderia-sostenible\/los-diferentes-tipos-de-estres-que-pueden-presentar-los-bovinos."},{"key":"ref_2","doi-asserted-by":"crossref","first-page":"107556","DOI":"10.1016\/j.compag.2022.107556","article-title":"Discriminating Pathological, Reproductive or Stress Conditions in Cows Using Machine Learning on Sensor-Based Activity Data","volume":"204","author":"Lardy","year":"2023","journal-title":"Comput. Electron. Agric."},{"key":"ref_3","doi-asserted-by":"crossref","first-page":"105124","DOI":"10.1016\/j.compag.2019.105124","article-title":"Ranking of Environmental Heat Stressors for Dairy Cows Using Machine Learning Algorithms","volume":"168","author":"Gorczyca","year":"2020","journal-title":"Comput. Electron. Agric."},{"key":"ref_4","doi-asserted-by":"crossref","unstructured":"Islam, M.A., Lomax, S., Doughty, A.K., Islam, M.R., and Clark, C.E.F. (2020). Automated Monitoring of Panting for Feedlot Cattle: Sensor System Accuracy and Individual Variability. Animals, 10.","DOI":"10.3390\/ani10091518"},{"key":"ref_5","unstructured":"Ariathna, N., Sarabia-Duran, J.J., Ramirez, J.D., Bayona-Sarmiento, J.S., Aro, J.J.G., and Serrano-Carrascal, M.K. (2025, March 25). Aplicaci\u00f3n de la ia en Ganader\u00eda: Sostenibilidad y Eficiencia. Available online: https:\/\/www.researchgate.net\/publication\/380904897_APLICACION_DE_LA_IA_EN_GANADERIA_SOSTENIBILIDAD_Y_EFICIENCIA?channel=doi&linkId=66551955479366623a1af0dc&showFulltext=true."},{"key":"ref_6","doi-asserted-by":"crossref","unstructured":"Hoffmann, G., Strutzke, S., Fiske, D., Heinicke, J., and Mylostyvyi, R. (2024). A New Approach to Recording Rumination Behavior in Dairy Cows. Sensors, 24.","DOI":"10.2139\/ssrn.4735750"},{"key":"ref_7","unstructured":"Gorczyca, M.T. (2019). Machine Learning Applications for Monitoring Heat Stress in Livestock. [Master\u2019s Thesis, Cornell University]."},{"key":"ref_8","doi-asserted-by":"crossref","unstructured":"Pichlbauer, B., Chapa Gonzalez, J.M., Bobal, M., Guse, C., Iwersen, M., and Drillich, M. (2024). Evaluation of Different Sensor Systems for Classifying the Behavior of Dairy Cows on Pasture. Sensors, 24.","DOI":"10.3390\/s24237739"},{"key":"ref_9","doi-asserted-by":"crossref","unstructured":"Tangorra, F.M., Buoio, E., Calcante, A., Bassi, A., and Costa, A. (2024). Internet of Things (IoT): Sensors Application in Dairy Cattle Farming. Animals, 14.","DOI":"10.3390\/ani14213071"},{"key":"ref_10","doi-asserted-by":"crossref","unstructured":"Hern\u00e1ndez, G., Gonz\u00e1lez-S\u00e1nchez, C., Gonz\u00e1lez-Arrieta, A., S\u00e1nchez-Brizuela, G., and Fraile, J.-C. (2024). Machine Learning-Based Prediction of Cattle Activity Using Sensor-Based Data. Sensors, 24.","DOI":"10.3390\/s24103157"},{"key":"ref_11","doi-asserted-by":"crossref","first-page":"297","DOI":"10.1090\/S0025-5718-1965-0178586-1","article-title":"An Algorithm for the Machine Calculation of Complex Fourier Series","volume":"19","author":"Cooley","year":"1965","journal-title":"Math. Comput."},{"key":"ref_12","doi-asserted-by":"crossref","first-page":"14","DOI":"10.1016\/j.ymeth.2020.09.003","article-title":"Detection of Changes in the Circadian Rhythm of Cattle in Relation to Disease, Stress, and Reproductive Events","volume":"186","author":"Wagner","year":"2021","journal-title":"Methods"},{"key":"ref_13","doi-asserted-by":"crossref","unstructured":"Neethirajan, S. (2020). The Role of Sensors, Big Data and Machine Learning in Modern Animal Farming. Sens. Bio-Sens. Res., 29.","DOI":"10.1016\/j.sbsr.2020.100367"},{"key":"ref_14","doi-asserted-by":"crossref","first-page":"100199","DOI":"10.1016\/j.atech.2023.100199","article-title":"Towards a Novel Method for Detecting Atypical Lying down and Standing up Behaviors in Dairy Cows Using Accelerometers and Machine Learning","volume":"4","author":"Brouwers","year":"2023","journal-title":"Smart Agric. Technol."},{"key":"ref_15","doi-asserted-by":"crossref","first-page":"107932","DOI":"10.1016\/j.compag.2023.107932","article-title":"A Deep Learning Model to Forecast Cattle Heat Stress","volume":"211","author":"Chapman","year":"2023","journal-title":"Comput. Electron. Agric."},{"key":"ref_16","doi-asserted-by":"crossref","first-page":"106241","DOI":"10.1016\/j.compag.2021.106241","article-title":"Deep Learning-Based Cattle Behaviour Classification Using Joint Time-Frequency Data Representation","volume":"187","author":"Hosseininoorbin","year":"2021","journal-title":"Comput. Electron. Agric."},{"key":"ref_17","doi-asserted-by":"crossref","first-page":"501","DOI":"10.3168\/jds.2020-18653","article-title":"Predicting Dairy Cattle Heat Stress Using Machine Learning Techniques","volume":"104","author":"Becker","year":"2021","journal-title":"J. Dairy Sci."},{"key":"ref_18","doi-asserted-by":"crossref","first-page":"187","DOI":"10.2307\/1942661","article-title":"Pseudoreplication and the Design of Ecological Field Experiments","volume":"54","author":"Hurlbert","year":"1984","journal-title":"Ecol. Monogr."},{"key":"ref_19","doi-asserted-by":"crossref","first-page":"8871","DOI":"10.3168\/jds.2016-11516","article-title":"Short Communication: On Recognizing the Proper Experimental Unit in Animal Studies in the Dairy Sciences","volume":"99","author":"Bello","year":"2016","journal-title":"J. Dairy Sci."},{"key":"ref_20","doi-asserted-by":"crossref","first-page":"3009","DOI":"10.1017\/S175173111900199X","article-title":"Review: Precision Livestock Farming: Building \u2018Digital Representations\u2019 to Bring the Animals Closer to the Farmer","volume":"13","author":"Norton","year":"2019","journal-title":"Animal"},{"key":"ref_21","doi-asserted-by":"crossref","unstructured":"Jiang, B., Tang, W., Cui, L., and Deng, X. (2023). Precision Livestock Farming Research: A Global Scientometric Review. Animals, 13.","DOI":"10.3390\/ani13132096"},{"key":"ref_22","doi-asserted-by":"crossref","first-page":"106313","DOI":"10.1016\/j.compag.2021.106313","article-title":"A Systematic Literature Review on Deep Learning Applications for Precision Cattle Farming","volume":"187","author":"Mahmud","year":"2021","journal-title":"Comput. Electron. Agric."},{"key":"ref_23","doi-asserted-by":"crossref","unstructured":"Gao, G., Wang, C., Wang, J., Lv, Y., Li, Q., Ma, Y., Zhang, X., Li, Z., and Chen, G. (2023). CNN-Bi-LSTM: A Complex Environment-Oriented Cattle Behavior Classification Network Based on the Fusion of CNN and Bi-LSTM. Sensors, 23.","DOI":"10.3390\/s23187714"},{"key":"ref_24","doi-asserted-by":"crossref","unstructured":"V\u00e1zquez Diosdado, J.A., Barker, Z.E., Hodges, H.R., Amory, J.R., Croft, D.P., Bell, N.J., and Codling, E.A. (2015). Classification of Behaviour in Housed Dairy Cows Using an Accelerometer-Based Activity Monitoring System. Anim. Biotelemetry, 3.","DOI":"10.1186\/s40317-015-0045-8"},{"key":"ref_25","doi-asserted-by":"crossref","unstructured":"Bus, J.D., Boumans, I.J.M.M., Engel, J., Te Beest, D.E., Webb, L.E., and Bokkers, E.A.M. (2023). Circadian Rhythms and Diurnal Patterns in the Feed Intake Behaviour of Growing-Finishing Pigs. Sci. Rep., 13.","DOI":"10.1038\/s41598-023-42612-1"},{"key":"ref_26","doi-asserted-by":"crossref","first-page":"275","DOI":"10.1080\/09291010600903692","article-title":"Procedures for Numerical Analysis of Circadian Rhythms","volume":"38","author":"Refinetti","year":"2007","journal-title":"Biol. Rhythm Res."},{"key":"ref_27","doi-asserted-by":"crossref","first-page":"472","DOI":"10.3109\/10253890.2012.710919","article-title":"The Legacy of Hans Selye and the Origins of Stress Research: A Retrospective 75 Years after His Landmark Brief \u201cLetter\u201d to the Editor# of Nature","volume":"15","author":"Szabo","year":"2012","journal-title":"Stress"},{"key":"ref_28","doi-asserted-by":"crossref","unstructured":"Moberg, G.P., and Mench, J.A. (2000). Biological Response to Stress: Implications for Animal Welfare. The Biology of Animal Stress Basic Principles and Implications for Animal Welfare, CABI Publishing.","DOI":"10.1079\/9780851993591.0000"},{"key":"ref_29","doi-asserted-by":"crossref","first-page":"479","DOI":"10.1051\/animres:2002036","article-title":"The Relationship of Temperature-Humidity Index with Milk Production of Dairy Cows in a Mediterranean Climate","volume":"51","author":"Bouraoui","year":"2002","journal-title":"Anim. Res."},{"key":"ref_30","doi-asserted-by":"crossref","first-page":"1167","DOI":"10.1017\/S175173111000090X","article-title":"Metabolic and Hormonal Acclimation to Heat Stress in Domesticated Ruminants","volume":"4","author":"Bernabucci","year":"2010","journal-title":"Animal"},{"key":"ref_31","doi-asserted-by":"crossref","unstructured":"Piccione, G., Caola, G., and Refinetti, R. (2003). Daily and Estrous Rhythmicity of Body Temperature in Domestic Cattle. BMC Physiol., 3.","DOI":"10.1186\/1472-6793-3-7"},{"key":"ref_32","doi-asserted-by":"crossref","first-page":"4762","DOI":"10.3168\/jds.2017-13706","article-title":"Invited Review: Current Perspectives on Eating and Rumination Activity in Dairy Cows","volume":"101","author":"Beauchemin","year":"2018","journal-title":"J. Dairy Sci."},{"key":"ref_33","doi-asserted-by":"crossref","first-page":"2312","DOI":"10.3168\/jds.2010-3639","article-title":"Short-Term Effects of Regrouping on Behavior of Prepartum Dairy Cows","volume":"94","author":"Schirmann","year":"2011","journal-title":"J. Dairy Sci."},{"key":"ref_34","doi-asserted-by":"crossref","first-page":"4079","DOI":"10.3168\/jds.S0022-0302(03)74020-X","article-title":"Short Communication: Diurnal Feeding Pattern of Lactating Dairy Cows","volume":"86","author":"DeVries","year":"2003","journal-title":"J. Dairy Sci."},{"key":"ref_35","doi-asserted-by":"crossref","first-page":"3","DOI":"10.1016\/j.applanim.2004.11.005","article-title":"Quantifying Behavioural Priorities\u2014Effects of Time Constraints on Behaviour of Dairy Cows, Bos Taurus","volume":"92","author":"Munksgaard","year":"2005","journal-title":"Appl. Anim. Behav. Sci."},{"key":"ref_36","doi-asserted-by":"crossref","first-page":"521","DOI":"10.3168\/jds.S0022-0302(03)73630-3","article-title":"Effects of Three Types of Free-Stall Surfaces on Preferences and Stall Usage by Dairy Cows","volume":"86","author":"Tucker","year":"2003","journal-title":"J. Dairy Sci."},{"key":"ref_37","doi-asserted-by":"crossref","first-page":"4412","DOI":"10.3168\/jds.2009-2235","article-title":"Lying Behavior: Assessing within- and between-Herd Variation in Free-Stall-Housed Dairy Cows","volume":"92","author":"Ito","year":"2009","journal-title":"J. Dairy Sci."},{"key":"ref_38","doi-asserted-by":"crossref","first-page":"317","DOI":"10.1016\/j.physbeh.2006.12.003","article-title":"Exploration of the Hypothalamic\u2013Pituitary\u2013Adrenal Function as a Tool to Evaluate Animal Welfare","volume":"92","author":"Andanson","year":"2007","journal-title":"Physiol. Behav."},{"key":"ref_39","doi-asserted-by":"crossref","first-page":"457","DOI":"10.2527\/jas.2015-9645","article-title":"INVITED REVIEW: The Usefulness of Measuring Glucocorticoids for Assessing Animal Welfare","volume":"94","author":"Ralph","year":"2016","journal-title":"J. Anim. Sci."},{"key":"ref_40","doi-asserted-by":"crossref","first-page":"293","DOI":"10.1016\/j.physbeh.2007.01.007","article-title":"Heart Rate Variability as a Measure of Autonomic Regulation of Cardiac Activity for Assessing Stress and Welfare in Farm Animals\u2014A Review","volume":"92","author":"Langbein","year":"2007","journal-title":"Physiol. Behav."},{"key":"ref_41","doi-asserted-by":"crossref","first-page":"195","DOI":"10.1016\/j.physbeh.2005.03.019","article-title":"Heart Rate Variability in Dairy Cows\u2014Influences of Breed and Milking System","volume":"85","author":"Hagen","year":"2005","journal-title":"Physiol. Behav."},{"key":"ref_42","unstructured":"ASG Veehouderij BV (2009). Welfare Quality\u00ae Assessment Protocol for Cattle, ASG Veehouderij BV."},{"key":"ref_43","unstructured":"Farm Animal Welfare Council (2009). FAWC Farm Animal Welfare in Great Britain: Ast, Present and Future."},{"key":"ref_44","doi-asserted-by":"crossref","first-page":"S1","DOI":"10.1186\/1751-0147-50-S1-S1","article-title":"Understanding Animal Welfare","volume":"50","author":"Fraser","year":"2008","journal-title":"Acta Vet. Scand."},{"key":"ref_45","doi-asserted-by":"crossref","unstructured":"Islam, M.A., Lomax, S., Doughty, A., Islam, M.R., Jay, O., Thomson, P., and Clark, C. (2021). Automated Monitoring of Cattle Heat Stress and Its Mitigation. Front. Anim. Sci., 2.","DOI":"10.3389\/fanim.2021.737213"},{"key":"ref_46","doi-asserted-by":"crossref","unstructured":"Rebez, E., Sejian, V., Silpa, M., Kalaignazhal, G., Thirunavukkarasu, D., Devaraj, C., Nikhil, K., Ninan, J., Sahoo, A., and Lacetera, N. (2024). Applications of Artificial Intelligence for Heat Stress Management in Ruminant Livestock. Sensors, 24.","DOI":"10.3390\/s24185890"},{"key":"ref_47","doi-asserted-by":"crossref","unstructured":"Poudel, S., Fike, J., and Pent, G. (2022). Hair Cortisol as a Measure of Chronic Stress in Ewes Grazing Either Hardwood Silvopastures or Open Pastures. Agronomy, 12.","DOI":"10.3390\/agronomy12071566"},{"key":"ref_48","doi-asserted-by":"crossref","unstructured":"Ataallahi, M., Cheon, S.N., Park, G.-W., Nugrahaeningtyas, E., Jeon, J.H., and Park, K.-H. (2023). Assessment of Stress Levels in Lactating Cattle: Analyzing Cortisol Residues in Commercial Milk Products in Relation to the Temperature-Humidity Index. Animals, 13.","DOI":"10.20944\/preprints202307.0872.v1"},{"key":"ref_49","doi-asserted-by":"crossref","first-page":"336","DOI":"10.63618\/omd\/isj\/v3\/n3\/64","article-title":"Sensores Inteligentes y T\u00e9cnicas de Machine Learning Para La Detecci\u00f3n Del Estr\u00e9s En Ganado Bovino","volume":"3","year":"2025","journal-title":"Innova. Sci. J."},{"key":"ref_50","unstructured":"Taramuel, A. (2024). T\u00e9cnicas de Aprendizaje Autom\u00e1tico para la Identificaci\u00f3n del Nivel de Estr\u00e9s en Bovinos. [Bachelor\u2019s Thesis, Universidad Polit\u00e9cnica Estatal del Carchi]."},{"key":"ref_51","unstructured":"Veissier, I., Lardy, R., Mialon, M.-M., Ruin, Q., Antoine, V., and Koko, J. (2022). Machine Learning Applied to Behaviour Monitoring to Detect Diseases, Reproductive Events and Disturbances in Dairy Cows, Institut de l\u2019Elevage."},{"key":"ref_52","doi-asserted-by":"crossref","unstructured":"Zhao, K., Duan, Y., Chen, J., Li, Q., Hong, X., Zhang, R., and Wang, M. (2023). Detection of Respiratory Rate of Dairy Cows Based on Infrared Thermography and Deep Learning. Agriculture, 13.","DOI":"10.3390\/agriculture13101939"}],"container-title":["Sensors"],"original-title":[],"language":"en","link":[{"URL":"https:\/\/www.mdpi.com\/1424-8220\/25\/21\/6544\/pdf","content-type":"unspecified","content-version":"vor","intended-application":"similarity-checking"}],"deposited":{"date-parts":[[2025,10,24]],"date-time":"2025-10-24T01:40:08Z","timestamp":1761270008000},"score":1,"resource":{"primary":{"URL":"https:\/\/www.mdpi.com\/1424-8220\/25\/21\/6544"}},"subtitle":[],"short-title":[],"issued":{"date-parts":[[2025,10,24]]},"references-count":52,"journal-issue":{"issue":"21","published-online":{"date-parts":[[2025,11]]}},"alternative-id":["s25216544"],"URL":"https:\/\/doi.org\/10.3390\/s25216544","relation":{},"ISSN":["1424-8220"],"issn-type":[{"value":"1424-8220","type":"electronic"}],"subject":[],"published":{"date-parts":[[2025,10,24]]}}}