Predicting respiration rate in unrestrained dairy cows using image analysis and fast Fourier transform

{"title":"Predicting respiration rate in unrestrained dairy cows using image analysis and fast Fourier transform","authors":"","doi":"10.3168/jdsc.2023-0442","DOIUrl":null,"url":null,"abstract":"<div><p>Respiratory rate (RR) is commonly employed for identifying animals experiencing heat-stress conditions and respiratory diseases. Recent advancements in computer vision algorithms have enabled the estimation of the RR in dairy cows through image-based approaches, with a primary focus on standing positions, thermal imaging, and deep learning techniques. In this study, our objective was to develop a system capable of accurately predicting the RR of lying Holstein cows under unrestrained conditions using red, green, and blue (RGB) and infrared (IR) night vision images. Thirty lactating cows were continuously recorded for 12 h per day over a 3-d period, capturing at least one 30-s video segment of each cow during lying time. A total of 95 videos were manually annotated with rectangular bounding boxes encompassing the flank area (region of interest; ROI) of the lying cows. For future applications, we trained a model for ROI identification using YOLOv8 to avoid manual annotations. The observed RR was determined by visual counting of breaths in each video. To predict the RR, we devised an image processing pipeline involving (1) capturing the ROI for the entire video, (2) reshaping the pixel intensity of each image channel into a 2-dimensional object and calculating its per-frame mean, (3) applying fast Fourier transform (FFT) to the average pixel intensity vector, (4) filtering frequencies specifically associated with respiratory movements, and (5) executing inverse FFT on the denoized data and identifying peaks on the resulting plot, with the count of peaks serving as the predicted RR per minute. The evaluation metrics, root mean squared error of prediction (RMSEP) and R<sup>2</sup>, yielded values of 8.3 breaths/min (17.1% of the mean RR) and 0.77, respectively. To further validate the method, an additional dataset comprising preweaning dairy calves was used, consisting of 42 observations from 25 calves. The RMSEP and R<sup>2</sup> values for this dataset were 13.0 breaths/min and 0.73, respectively. The model trained to identify the ROI exhibited a precision of 100%, a recall of 71.8%, and an <em>F</em><sub>1</sub> score of 83.6% for bounding box detection. These are promising results for the implementation of this pipeline in future studies. The application of FFT to signals acquired from both RGB and IR images proved to be an effective and accurate method for computing the RR of cows in unrestrained conditions.</p></div>","PeriodicalId":94061,"journal":{"name":"JDS communications","volume":null,"pages":null},"PeriodicalIF":0.0000,"publicationDate":"2024-07-01","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"https://www.sciencedirect.com/science/article/pii/S2666910223001217/pdfft?md5=eb532e575ba419f4e774761448df1e6b&pid=1-s2.0-S2666910223001217-main.pdf","citationCount":"0","resultStr":null,"platform":"Semanticscholar","paperid":null,"PeriodicalName":"JDS communications","FirstCategoryId":"1085","ListUrlMain":"https://www.sciencedirect.com/science/article/pii/S2666910223001217","RegionNum":0,"RegionCategory":null,"ArticlePicture":[],"TitleCN":null,"AbstractTextCN":null,"PMCID":null,"EPubDate":"","PubModel":"","JCR":"","JCRName":"","Score":null,"Total":0}
引用次数: 0

Abstract

Respiratory rate (RR) is commonly employed for identifying animals experiencing heat-stress conditions and respiratory diseases. Recent advancements in computer vision algorithms have enabled the estimation of the RR in dairy cows through image-based approaches, with a primary focus on standing positions, thermal imaging, and deep learning techniques. In this study, our objective was to develop a system capable of accurately predicting the RR of lying Holstein cows under unrestrained conditions using red, green, and blue (RGB) and infrared (IR) night vision images. Thirty lactating cows were continuously recorded for 12 h per day over a 3-d period, capturing at least one 30-s video segment of each cow during lying time. A total of 95 videos were manually annotated with rectangular bounding boxes encompassing the flank area (region of interest; ROI) of the lying cows. For future applications, we trained a model for ROI identification using YOLOv8 to avoid manual annotations. The observed RR was determined by visual counting of breaths in each video. To predict the RR, we devised an image processing pipeline involving (1) capturing the ROI for the entire video, (2) reshaping the pixel intensity of each image channel into a 2-dimensional object and calculating its per-frame mean, (3) applying fast Fourier transform (FFT) to the average pixel intensity vector, (4) filtering frequencies specifically associated with respiratory movements, and (5) executing inverse FFT on the denoized data and identifying peaks on the resulting plot, with the count of peaks serving as the predicted RR per minute. The evaluation metrics, root mean squared error of prediction (RMSEP) and R2, yielded values of 8.3 breaths/min (17.1% of the mean RR) and 0.77, respectively. To further validate the method, an additional dataset comprising preweaning dairy calves was used, consisting of 42 observations from 25 calves. The RMSEP and R2 values for this dataset were 13.0 breaths/min and 0.73, respectively. The model trained to identify the ROI exhibited a precision of 100%, a recall of 71.8%, and an F1 score of 83.6% for bounding box detection. These are promising results for the implementation of this pipeline in future studies. The application of FFT to signals acquired from both RGB and IR images proved to be an effective and accurate method for computing the RR of cows in unrestrained conditions.

利用图像分析和快速傅立叶变换预测不受约束奶牛的呼吸速率
呼吸频率(RR)通常用于识别热应激条件下的动物和呼吸道疾病。计算机视觉算法的最新进展使得人们能够通过基于图像的方法估算奶牛的呼吸频率,主要侧重于站立姿势、热成像和深度学习技术。在本研究中,我们的目标是利用红绿蓝(RGB)和红外(IR)夜视图像,开发一种能够准确预测卧地荷斯坦奶牛在不受约束条件下的RR的系统。对 30 头泌乳奶牛进行了 3 天、每天 12 小时的连续记录,每头奶牛在躺卧期间至少有一段 30 秒的视频。我们对总共 95 段视频进行了人工标注,标注的矩形边框涵盖了躺卧奶牛的侧腹区域(感兴趣区域;ROI)。为了将来的应用,我们使用 YOLOv8 训练了一个 ROI 识别模型,以避免人工标注。观察到的 RR 是通过目测计数每个视频中的呼吸来确定的。为了预测RR,我们设计了一个图像处理流水线,其中包括:(1)捕捉整个视频的ROI;(2)将每个图像通道的像素强度重塑为一个二维对象,并计算其每帧平均值;(3)对平均像素强度向量应用快速傅立叶变换(FFT);(4)过滤与呼吸运动特别相关的频率;以及(5)在去噪数据上执行反FFT,并在得到的图上识别峰值,峰值计数作为预测的每分钟RR。预测的均方根误差(RMSEP)和 R2 的评估指标值分别为 8.3 次/分钟(平均 RR 的 17.1%)和 0.77。为了进一步验证该方法,还使用了另外一个数据集,该数据集由 25 头断奶前乳牛的 42 个观测值组成。该数据集的 RMSEP 和 R2 值分别为 13.0 次/分钟和 0.73。为识别 ROI 而训练的模型的精确度为 100%,召回率为 71.8%,边界框检测的 F1 得分为 83.6%。这些结果为在未来研究中实施该管道带来了希望。事实证明,对从 RGB 和红外图像中获取的信号应用 FFT 是计算无约束条件下奶牛 RR 的一种有效而准确的方法。
本文章由计算机程序翻译,如有差异,请以英文原文为准。
求助全文
约1分钟内获得全文 求助全文
来源期刊
JDS communications
JDS communications Animal Science and Zoology
CiteScore
2.00
自引率
0.00%
发文量
0
×
引用
GB/T 7714-2015
复制
MLA
复制
APA
复制
导出至
BibTeX EndNote RefMan NoteFirst NoteExpress
×
提示
您的信息不完整,为了账户安全,请先补充。
现在去补充
×
提示
您因"违规操作"
具体请查看互助需知
我知道了
×
提示
确定
请完成安全验证×
copy
已复制链接
快去分享给好友吧!
我知道了
右上角分享
点击右上角分享
0
联系我们:info@booksci.cn Book学术提供免费学术资源搜索服务,方便国内外学者检索中英文文献。致力于提供最便捷和优质的服务体验。 Copyright © 2023 布克学术 All rights reserved.
京ICP备2023020795号-1
ghs 京公网安备 11010802042870号
Book学术文献互助
Book学术文献互助群
群 号:481959085
Book学术官方微信