Next Article in Journal
Supplementation Effect of Oleuropein Extract Combined with Betaine, Magnesium, and Vitamin E on Pigs’ Performance and Meat Quality Characteristics
Next Article in Special Issue
Smart Products in Livestock Farming—An Empirical Study on the Attitudes of German Farmers
Previous Article in Journal
Comparative Anatomy of the Nasal Cavity in the Common Dolphin Delphinus delphis L., Striped Dolphin Stenella coeruleoalba M. and Pilot Whale Globicephala melas T.: A Developmental Study
 
 
Font Type:
Arial Georgia Verdana
Font Size:
Aa Aa Aa
Line Spacing:
Column Width:
Background:
Article

Contactless Video-Based Heart Rate Monitoring of a Resting and an Anesthetized Pig

1
Faculty of Bioscience Engineering, Katholieke Universiteit Leuven (KU LEUVEN), 3001 Leuven, Belgium
2
Institute of Animal Welfare Science (ITT), University of Veterinary Medicine (Vetmeduni) Vienna, A-1210 Vienna, Austria
3
USDA-ARS, Livestock Behaviour Research Unit, West Lafayette, IN 47907, USA
4
Institute of Animal Hygiene, Animal Welfare and Farm Animal Behaviour, University of Veterinary Medicine Hannover, 30625 Hannover, Germany
5
Institute for Laboratory Animal Science and Central Animal Facility, Hannover Medical School, 30625 Hannover, Germany
6
College of Engineering/Jiangsu Province Engineering Lab for Modern Facility Agriculture Technology & Equipment, Nanjing Agricultural University, Nanjing 210031, China
*
Author to whom correspondence should be addressed.
Animals 2021, 11(2), 442; https://doi.org/10.3390/ani11020442
Submission received: 21 January 2021 / Revised: 29 January 2021 / Accepted: 3 February 2021 / Published: 8 February 2021
(This article belongs to the Special Issue Measuring the Sustainability of Precision Livestock Farming)

Abstract

:

Simple Summary

Contactless physiological monitoring can be important for animal health and well-being. The current study investigated whether heart rate in pigs can be extracted automatically from videos without disturbing the pig and showed that this was possible with 4.69 beats per minute in mean absolute error. The study also tested different body regions and found that the abdomen was a better region to measure heart rate from videos compared to the front leg or the neck. However, future studies are needed that include videos with different light conditions, different housing systems and multiple pigs to enable real-time on-farm monitoring of heart rate from videos.

Abstract

Heart rate (HR) is a vital bio-signal that is relatively easy to monitor with contact sensors and is related to a living organism’s state of health, stress and well-being. The objective of this study was to develop an algorithm to extract HR (in beats per minute) of an anesthetized and a resting pig from raw video data as a first step towards continuous monitoring of health and welfare of pigs. Data were obtained from two experiments, wherein the pigs were video recorded whilst wearing an electrocardiography (ECG) monitoring system as gold standard (GS). In order to develop the algorithm, this study used a bandpass filter to remove noise. Then, a short-time Fourier transform (STFT) method was tested by evaluating different window sizes and window functions to accurately identify the HR. The resulting algorithm was first tested on videos of an anesthetized pig that maintained a relatively constant HR. The GS HR measurements for the anesthetized pig had a mean value of 71.76 bpm and standard deviation (SD) of 3.57 bpm. The developed algorithm had 2.33 bpm in mean absolute error (MAE), 3.09 bpm in root mean square error (RMSE) and 67% in HR estimation error below 3.5 bpm (PE3.5). The sensitivity of the algorithm was then tested on the video of a non-anaesthetized resting pig, as an animal in this state has more fluctuations in HR than an anaesthetized pig, while motion artefacts are still minimized due to resting. The GS HR measurements for the resting pig had a mean value of 161.43 bpm and SD of 10.11 bpm. The video-extracted HR showed a performance of 4.69 bpm in MAE, 6.43 bpm in RMSE and 57% in PE3.5. The results showed that HR monitoring using only the green channel of the video signal was better than using three color channels, which reduces computing complexity. By comparing different regions of interest (ROI), the region around the abdomen was found physiologically better than the face and front leg parts. In summary, the developed algorithm based on video data has potential to be used for contactless HR measurement and may be applied on resting pigs for real-time monitoring of their health and welfare status, which is of significant interest for veterinarians and farmers.

1. Introduction

Cardiac activity variables have been widely used in animal health and animal welfare research. For instance, heart rate (HR) brings valuable information in relation to an animal’s disease status, physiological functioning, psychological stress and in assessing their individual characteristics, e.g., temperament and coping strategies [1]. Farm animals such as pigs may encounter many stressors during their lifetime, and HR monitoring has proven to be a useful technology to assess their response in many cases. For example, monitoring the HR of sows showed that their reproductive performance was impaired when they experienced stress [2]. Other research has shown that HR can potentially be a valuable measure for stress resilience, e.g., a decrease in HR was linked with a counteraction of the sympathetic overreaction caused by the chronic stress of tethering in sows [3]. Therefore, monitoring HR of pigs can provide information on how to maintain optimal conditions for production performance and animal welfare.
In previous studies, HR of animals was monitored using two types of technologies, namely implantable transmitters and external body-mounted sensors [1]. Although implantable transmitters provide accurate data, their use is associated with several critical drawbacks, e.g., initial implantation surgery [4], influence on normal circadian rhythms [5], potential distress and discomfort caused by the implanted device itself and the limited battery life of the transmitter [6]. For body-mounted sensors, electrocardiography (ECG) has been used to monitor the HR of dogs [7] and bats [8], and photoplethysmography (PPG) [9] has previously been used for HR monitoring in pigs. However, ECG and PPG signals may be disrupted by the poor contact between the electrodes and the skin and the movement/removal of the device/belt caused by the pig itself or by its conspecifics [1]. Moreover, devices such as a belt are not applicable in field situations where pigs are typically housed together with conspecifics. Compared to these two technologies, a contactless method based on video analysis could have significant potential in research and farm applications involving HR monitoring, as it obviates the need to fit/implant sensors on/in animals or any other manipulation of the animal, avoiding potential disruptions for sample collection. Therefore, a contactless HR monitoring system based on video analysis is a non-invasive and non-intrusive method that could help assessing pig health and welfare.
Presently, HR extraction based on different video analysis techniques extract the subtle changes (color or motion) caused by the pulsatile activity of the beating heart. Some of the recently developed algorithms are based on blind source separation (BSS), i.e., separation of the source signals from a set of mixed signals without prior information about the source signals [10,11], such as independent component analysis (ICA) [10] or principle component analysis (PCA) [11]. Using the BSS approach, the red, green and blue(RGB) traces are decomposed into the three independent sources of signals. After that, the highest power of the spectrum of the component containing the heart signal [10] or the frequency of the principal component that most closely resembles the heart signal [11] is considered as the HR frequency/signal. Other algorithms able to extract HR-related information from video signals include techniques such as combining three channels under different proportions [12,13] or processing each pixel independently by Eulerian video magnification (EVM) [14,15]. It should be noticed that both kinds of methods use three channels to extract HR, and because of that, they need three filters to remove noise and three times the computer memory to store the signal during the process of computing. However, to achieve accurate continuous monitoring of HR in practical environments, the implemented algorithm must be accurate while having a computational footprint as low as possible to run on embedded systems. To reduce the computing complexity, this study attempts to use a single color channel to monitor a pig’s HR.
Recently, the video-based HR monitoring approach has been explored in animal research including cattle [16], primates [17] and rodents [18]. Video-based monitoring of pigs has become popular on farms, mainly for behavior recording [19,20,21,22,23]. There is an opportunity to monitor other bio-signals, extracting greater value for the users of video technology. Although some studies have already analyzed HR of pigs from video data, a limited number achieved it continuously [24,25,26]. To our knowledge, only the study by Addison et al. [27] could continuously monitor the HR using video technology of anesthetized pigs during acute hypoxia. However, the algorithm used in that research was developed based on three channels, which could be improved in terms of computing complexity.
Another vital aspect of accurate monitoring of HR is the identification of a region of interest (ROI). The subtle blood flow changes caused by the heart beats have to be detected from continuous frames and, thus, an adequate body part of the animal has to be assessed. Regions with large capillaries near the skin surface and low hair covering can be chosen as an ROI. In this sense, domestic pigs present a large area of exposed skin with low hair coverage, and commercially housed pigs spend about 60–80% of the daily life resting [28,29], facilitating the monitoring of their HR. On the other hand, pigs are known for their high level of backfat and thickness of epidermis [30], which make changes in blood flow less visible at skin level. Previous studies have used the area around the neck as the ROI [25,26]; however, no studies have explored the suitability of other body regions. Therefore, selecting the ROI was a key aspect explored in this study, as different body parts may offer different sensitivities for HR monitoring.
The main goal of the present work was to develop a video-based HR monitoring algorithm for pigs with minimum computational burden for real-time applications. The specific objectives were to:
  • Investigate the combination of bandpass filtering and short-time Fourier transform (STFT) with sliding windows for extracting HR from noisy input data in a continuous fashion;
  • Explore different regions of interests (ROI) from different anatomical parts of the pig’s body to find the most suitable ROI for signal extraction of cardiac activity;
  • Optimize the different heart rate extraction processing steps to minimize the computational complexity of the algorithm for implementation of real-time monitoring applications.

2. Materials and Methods

2.1. Experimental Setup

The datasets used in the analysis were obtained from two different experimental set-ups. In the first experiment, video recordings of one anaesthetized pig was made and its data used to develop the algorithm, as the pig had very limited movement (breathing) with no motion artefacts. In the second experiment, a non-anaesthetized resting pig was video recorded. The pig from the second experiment presented larger variations in HR, and its data were used to test the developed algorithm. All the raw videos were stored on an exchangeable, external 4 TB hard drive (Seagate, Cupertino, CA, USA). The authors are aware of the limited number of animals and variation included in the data and what limitations this has for the interpretation of the developed algorithms. However, this was evaluated as acceptable, as the study presents the initial work on a new method for HR monitoring.

2.1.1. Experiment on the Anesthetized Pig

The first dataset included one anaesthetized two-year-old Göttinger Minipig (Figure 1a), weighing 30.2 kg. Zoletil (Tiletamin and Zolazepam) and isoflurane were used to anesthetize the pig. The experiment was conducted under ambient light. The webcam (C920 HD PRO, Logitech, Taiwan, China) was positioned above the pig towards the neck and the side face of the pig at a distance of 0.84 m with about 45 degrees angle. The resolution of the video was 640 × 480 pixels and the frame rate was 30 fps. The video chosen for the algorithm development was 180 seconds long. As a gold standard (GS), the reference HR was collected using an electrocardiogram (BEAM EKG-/Loop- Eventrekorder; I.E.M. GmbH, Stolberg, Deutschland), and it measured the HR (200 Hz, 0,1–75 Hz) directly from the skin region above the heart.

2.1.2. Experiment on the Resting Pig

The second dataset included one resting, individually housed Large White × York pig weighing 20 kg (Figure 1b). The experiment was conducted at Purdue University, West Lafayette, IN, USA. The pig was placed in a PigTurnTM (West Lafayette, IN, USA) experimental pen with enough space for an individual animal (1.12 m2) under ambient light. The animal wore a wearable sensor (Zephyr BioHarness-3) in order to measure its movement with a 3D accelerometer (100 Hz, ± 16 G) and its HR (1 Hz, 25–240 bpm ±1 bpm accuracy), which was used as the GS. Video recordings of the pig were made during the whole experiment using a Sony HandyCam HDR-SR5 camcorder. The camera was positioned on a Manfrotto Autopole at a height of 2.5 and 2 m from the center of the pen. The resolution of the video was 1440 × 1080 pixels, and the frame rate was 30 fps. One period of the video of about 450 s was chosen and used to test the algorithm, as the pig during this period was constantly resting with minimal movements.

2.2. Algorithm

The different steps taken in the HR extraction algorithm are represented in Figure 2. The algorithm was developed and tested on the raw videos. All analyses and calculations were performed in the MATLAB (MathWorks, US) environment. All the analysis were conducted on Windows 10 software with a Inter(R) i7-8650U CPU and 16GB RAM.

2.2.1. Region of Interest Selection

The first challenge in developing the algorithm was to identify the ROI for pigs. Subtle changes in the video signal are used to extract heart rate. Thus, in human applications, places with large capillaries near the skin surface and low hair covering are frequently chosen as the ROI [31]. The skin around the neck was, thus, chosen from the anaesthetized pig for developing the algorithm (red rectangle in Figure 1a). Further, pigs have large subscapular artery and median sacral artery that provide extensive flow to their front legs and abdomen [32]. In order to see which part was most sensitive to fluctuating HR extraction, body areas around the neck, front legs and abdomen were chosen as potential ROIs (red rectangles in Figure 1b) from the video of the resting pig. To develop the algorithm, the color variations through all video frames for all pixels of the ROI are needed. The pre-processing step first extracted RGB values for all pixels of the ROI from every frame of the video and stored them in a multidimensional matrix. Then, the average values were individually computed in red, green and blue channels of each frame. As a result, the colors in the ROI for each frame were represented by the corresponding average RGB values, and three time series based on three channels were derived.

2.2.2. Noise Removal

The finite impulse response (FIR) bandpass filter has been widely used in suppressing frequency components outside the HR bandwidth [17,25]. Compared to an infinite impulse response (IIR) filter, it is less susceptible to finite bit precision effects [33]. In this study, an FIR bandpass filter was introduced to obtain HR-related ranges. The cut-off frequencies are chosen based on the expected physiological HR range [34]. Frequency components outside of the HR bandwidth 30–360 bpm are supposed to be suppressed. In our case, the frequency range of the bandpass filter was set to 0.5–3 Hz.

2.2.3. Heart Rate Extraction

The short-time Fourier transform (STFT) is a variant of the classic Fourier transform, where a window function is convolved with the original signal to only transform a short part of the signal into the frequency domain. Hence, a simultaneous representation in time and frequency can be achieved. The length and shape of the window function can control the time and frequency resolution. Due to the uncertainty principle, there is always a trade-off between time and frequency resolution. If the window size is too large, almost all the frequency information will be captured, which is similar with using fast Fourier transform (FFT) over a long window. In this case, the time resolution would be lost and vice versa for small windows. In order to find the optimum setting, we tested different window sizes and window functions. Specifically, the signal was first split into pieces by the windows. Then, a window function was adopted to time the data points in every piece. After that, Fourier transformation was performed in each piece, and the amplitude of each frequency was computed. Finally, the HR was computed based on the amplitude and the predefined frequency range (based on the range of the GS HR). The frequency that holds the highest amplitude is considered as the HR frequency. Note that the overlap between two continuous windows was set to three quarters of the window, and f1 and f2 were 0.6 and 6 Hz, respectively. The computing details were as follows:
Algorithms 1 Computation details of HR extraction
Input: single colour signal S = s i ( i = 1 , 2 , N ) ; sampling rate r; window size w; window function wf; overlap window size wn (here wn=3*w/4); minimum frequency f1 and maximum frequency f2.
Output: Estimated heart rate hr
1: min _ hr _ freq = 1 + f 1 * w / r
2: max _ hr _ freq = 1 + f 2 * w / r
3:For i in [1, 2, …, K, K= ⌊N/(w-wn) ⌋ ] do
4: win i = ( i - 1 ) * ( w - wn ) + 1
5:end for
6:For k in [1,2,…K] do
7: fwin k = ( s p : s q ) * wf ,   where   p = win i   and   q = win i + ( w - wn ) - 1
8: A k = abs ( fft ( fwin k ) / w )
9: A k = A k ( min _ hr _ freq : max _ hr _ freq )
10: HRFreqIndex k = max ( A k ) ;
11: hr k = ( 60 * r w ) * ( HRFreqIndex k + min _ hr _ freq - 2 )
12:end for

2.2.4. Validation

To investigate the quality of HR estimation, mean absolute error (MAE), root-mean-square error (RMSE) and percentage of HR error below 3.5 (PE3.5) beats per minute (bpm) were used to make the comparison with the GS HR. Assume that the estimated and reference HR are p 1 and p 2 , respectively, then MAE, RMSE and PE3.5 are given by:
MAE =   1 N i | p 1 p 2 |
RMSE =   1 N i ( p 1 p 2 ) 2
P E 3.5 =   1 N { i : | p 1 p 2 | < 3.5   B P M }
where N is the total number of windows, and i is the i-th window.

2.2.5. Channel Selection

The core of extracting HR from the video is to extract effective information from RGB channels. As different color channels contain different levels of information regarding HR [17], first, three single channels (R, G and B) were tested individually by using STFT to extract HR. Then, the extracted HR was compared with the GS HR by computing MAE, RMSE and PE3.5. Finally, the channel that performed best in validation was selected as the one used in monitoring.

2.2.6. Algorithm Comparison

After channel selection, only one channel was used in the developed algorithm for extracting the HR. Less computation is needed in this way. However, the accuracy of this study was also compared to the algorithms using three channels that included combining three channels in different proportions [12,13,35,36] and blind source separation method based on ICA [10].
In previous studies [12,13,35,36] of extracting HR from video signal, three-channel signals were combined in four different proportions: green-red difference (GRD), adaptive green-red difference (aGRD), chrominance-based method (CHROM), plane-orthogonal-to-skin (POS), and they were defined as follows. Assume r, g, b are the color signal of the three channels, then:
GRD = g − r
POS   = g b + σ x L σ y L   ( g b 2 r )
where σ x L and σ y L are L-point running standard deviations of x = g − b and y = g + b − 2r, respectively;
CHROM = 0.77 r 0.51 g σ x L σ y L ( 0.77 r + 0.51 g 0.77 b )
where σ x L and σ y L are L-point running standard deviations of x = 0.77r − 0.51g and y = 0.77r + 0.51g − 0.77b, respectively;
a GRD = | | c 0 | | ( g g 0 r r 0 )
where g 0 and r 0 are the average of g and r channel of all pixels in ROI,
c 0 = r 0 2 + g 0 2 + b 0 2
Besides the above channel combination methods, blind source separation based on ICA [10] were also used for comparison. To select the best component when doing ICA, fast Fourier transform (FFT) was applied on the output sources and chose the one with the highest peak. Their workflow is showed in Figure 3.

3. Results and Discussion

The video of the anaesthetized pig was used for choosing the channel and comparing with other algorithms; the results are shown in Figure 4 and Figure 5 and Table 1 and Table 2. The video from the resting pig was used to further test different ROI, and the related results can be found in Table 3 and Table 4 and Figure 6.
Figure 4 shows the noise removal and spectral information of the anaesthetized pig. Specifically, Figure 4a–c illustrates the original color signal (green channel), the filtered signal and a zoom-in view of the filtered signal plotted in the time domain, respectively. The filtered signal is clearer than the original one and has regular patterns related to HR. Figure 4d is the spectrogram generated from the filtered signal, showing that the noise was removed effectively. Figure 4e shows the Welch power spectrum density (PSD) estimate where the cut-off frequency was set to 3 Hz. We can see that in Figure 4f, the energy is mostly around 1.5 to 2.5 Hz with a center frequency around 1.8 Hz, which falls in the expected HR range of the anaesthetized pig.
Table 1 shows the validation results of MAE, RMSE and PE3.5 from R, G and B channels of the anaesthetized pig. Based on a lower MAE, RMSE and a higher PE3.5, the G channel is better than the other two channels. Hence, the G channel is, in the current study, considered the best for HR extraction in pigs and is the channel used in further analysis. In order to find the best HR estimation of the anaesthetized pig, different window sizes and window functions were tested on the three RGB channels. Note that the overlap between two continuous windows was set to three quarters of the window and the GS HR used the same window and overlap sizes as the video data. Four window sizes were tested on the video of the anesthetized pig: 8.53, 17.07, 34.13 and 68.27 s, representing the number of data points 256, 512, 1024 and 2048, respectively, used in the windows. Different window functions (rect, hamming, hanning and blackman) were also tested. By comparing the MAE, RMSE and PE3.5 from different window sizes in Table 1, we can see that the lowest MAE and RMSE were obtained with window size 68.27 s, but the PE3.5 of this window was not the highest. This might result from some extreme large or small HR estimations when using window size 68.27 s. Thus, considering the highest PE3.5 and relatively low MAE and RMSE, the best window size for the anesthetized pig’s HR extraction was 34.13 s. Further, by comparing the MAE, RMSE and PE3.5 from different window functions of window size of 34.13 and 68.27 s in the G channel, hamming and hanning worked better than rect and blackman, and there was not much difference between hamming and hanning. If we compare the MAE, RMSE and PE3.5 from window size 8.53 and 17.07 s, we can see that rect performed better than hamming and hanning; this may be caused by the small data sample size. More experiments should be conducted in future to further investigate this matter. For further analysis, only window function hamming will be used.
Regarding the extraction accuracy and computing complexity of using the single G channel, the current study made a comparison with three-channel-based methods that includes combining three channels in different proportions of GRD, aGRD, CHROM and POS [12,13,35,36]. The video used for comparison was the one extracted from the anaesthetized pig. The pre-processing of all the methods were the same including bandpass filter range (shown in Figure 3), window size (34.13 s), overlapping style (3/4 of the window size) and window function (hamming). Table 2 shows the MAE, RMSE and PE3.5 as well as computation time regarding the comparison of the different methods. Note that the computation time included the reading of the video and all the processing time. It can be concluded that in the current study, the result obtained by the single G channel is better than for the other methods. Figure 5 shows the correlation between the test results from GS HR and the different methods. Note that R and p in Figure 5 indicate the correlation and p value respectively. The dark dotes represent HR numbers. Besides Figure 5 also gives the 95% confidence interval. We can observe that using the single G channel had the highest correlation with the GS HR. It is interesting that the second best result was from aGRD, which uses the signal of G and R channels, whereas other methods using three channels performed worse. This suggests that using more channels would not yield the best result, while the G channel seems the most effective for extracting HR from videos of pigs. This might result from the fact that the G channel has a higher absorption of hemoglobin.
The resting pig has larger variations in HR than the anaesthetized pig, which was used to test the sensitivity of the algorithm, using only the G channel, the 34.13 and 68.27 s window sizes and hamming window based on the results described above.
Table 3 shows the estimated results from different ROIs of the resting pig, which includes the face, front leg and abdomen. In order to find out which ROI is physiologically best, the effect of pixel number was excluded with the size of the three ROI all set to 46 × 49 pixels. The lengths of the windows were set to 34.13 and 68.27 s, representing 1024 and 2048 data points used in the windows, respectively. Note that the overlap between two continuous windows was set to three quarters of the window, and the GS HR used the same window and overlap sizes as the video data. Comparing the MAE, RMSE and PE3.5 of face, front leg and abdomen in Table 3, we can see that the results obtained from the front leg were the worst, and results from the abdomen were better than from the face, especially using window size 68.27 s. Thus, according to the current study, the region of the abdomen is considered physiologically better than the other two parts for HR extraction from RGB videos. This might result from the fact that the backfat of the pig decreases from the shoulder, where it is the thickest, to the last rib, and the ROI of the abdomen is right at the fat-decreasing part [37]. Additionally, Figure 6a,b illustrates the comparison between the GS HR and the monitoring results from the abdomen by using window size 68.27 and 34.14 s, respectively. It can be seen that the developed algorithm can monitor pig’s HR effectively when the pig is in resting status.
This study continuously monitored the HR of a pig by using the single green channel of a video signal. In order to evaluate the monitoring effectiveness on pigs, the current study made a comparison with other species, and the results can be found in Table 4. We can see that the MAE and PE3.5 of pigs are more or less the same as for primates, but worse than for humans. We know that animals have more uncontrollable factors than humans, and in this case, the monitoring of HR in pigs on a non-moving subject can be considered acceptable.
In the current study, the videos of an anaesthetized and a resting pig were used to develop and to test an algorithm to monitor the HR of pigs. From the evaluation parameters of MAE, RMSE and PE3.5 (2.33, 3.09 and 67% on the anesthetized pig and 4.69, 6.43 and 57% on the resting pig, respectively), it can be seen that the proposed algorithm was reliable in the currently used setting. Compared to previous studies using three channels, this work decreased the computing complexity by using a single channel. Additionally, from the comparison with other methods, we can conclude that using a single channel also presents the advantage of enhancing accuracy to extract HR from the video of pigs. These advantages may also have the potential to help in the monitoring of other physiological parameters, e.g., respiration rate [26,38]. The demonstrated technique can be an important forward towards continuous monitoring of health and welfare of animals, not only under experimental conditions, but also on farms in the future. However, the experiments were pilot experiments to test the feasibility of using a single G channel to monitor pig’s HR. The data were limited, and the cut-off frequency was designed to only suit the data. In order to improve the robustness of the presented method, it is still necessary to test different lighting conditions, different environmental conditions, different animal and animal sizes as well as animals in movement and in different postures. Thus, much work still needs to be conducted in the future to have a reliable system to monitor HR in pigs without disturbing the animal. Future work should focus on monitoring the physiological parameters of moving pigs with physical movements included. Although this is a serious challenge, it might be achieved by combining an efficient tracking method with the designed monitoring algorithm. In spite of these challenges, we are convinced that digitalization and artificial intelligence will increasingly play an important role in veterinary medicine and animal farming in the future. Applying the presented novel sensor technology for measuring animal-based indicators in real-time, such as heart rate on pigs, is one of the first steps but can mark a paradigm shift in monitoring health and welfare of farm animals.

4. Conclusions

A FIR band pass filter combined with short-time Fourier transform (STFT) based on a single green channel signal allowed us to successfully monitor the HR of pigs in a contactless way from video. Analyzing MAE, RMSE and PE3.5, values of 2.33, 3.09 and 67% were obtained from the video of an anesthetized pig and values of 4.69, 6.43 and 57% from a resting pig. The skin area of the abdomen proved to be the most sensitive body region of the three tested for monitoring the HR of the resting pig. The monitoring results obtained from the single green channel presented higher accuracy and needed less computation time than other methods, including combing three color channels in different proportions (DRG, aGRD, CHROM, POS) and ICA. The experimental results indicate that the developed algorithm based on RGB video analysis was capable of monitoring the HR of pigs under the used conditions. It has the potential to be used for contactless heart rate measurement and may be applied on resting pigs for real-time monitoring of their health and welfare status, which is of significant interest for veterinarians and farmers.

Author Contributions

Conceptualization, M.W., A.Y. and T.N.; methodology, M.W. and A.Y.; validation, M.W.; formal analysis, M.W. and A.Y.; investigation, M.W.; data curation, M.W., A.Y. and T.N.; writing—original draft preparation, M.W.; writing—review and editing, M.W., A.Y., M.L. (Mona Larsen), J.-L.R., D.B., J.N.M.-F., J.H., A.B., M.L. (Mingzhou Lu) and T.N.; visualization, M.W.; supervision, A.Y. and T.N. All authors have read and agreed to the published version of the manuscript.

Funding

Mona Larsen would like to acknowledge funding under the Marie Skłodowska-Curie grant agreement (grant number: 842555) for her participation in the project.

Institutional Review Board Statement

The experiment of the anesthetized pig was conducted in the Institute for Laboratory Animal Science, Hannover Medical School, Hannover, Germany. All measurements were ethically approved by “Niedersächsisches Landesamt für Verbraucherschutz und Lebensmittelsicherheit” (LAVES) (Germany; 33.12-42502-04-16/2374). The experiment and all measurements of the resting pig were ethically approved by the Purdue University Animal Care and Use Committee (protocol number: 1112000407).

Data Availability Statement

Not applicable.

Acknowledgments

The authors thank Lenn Carpentier for his help in the trial experiment and Chen Chen for his writing help as well as the Hannover team (Svenja Biernot, Christine Häger, Felix Oldhafer, Florian Vondran, Laura Wassermann and Eva Maria Wittauer) and Robyn McCain from Purdue University’s Translational Pharmacology Facility for collecting the data.

Conflicts of Interest

The authors declare no conflict of interest.

References

  1. von Borell, E.; Langbein, J.; Després, G.; Hansen, S.; Leterrier, C.; Marchant-Forde, J.; Marchant-Forde, R.; Minero, M.; Mohr, E.; Prunier, A.; et al. Heart rate variability as a measure of autonomic regulation of cardiac activity for assessing stress and welfare in farm animals—A review. Physiol. Behav. 2007, 92, 293–316. [Google Scholar] [CrossRef] [PubMed]
  2. Von Borell, E.; Dobson, H.; Prunier, A. Stress, behaviour and reproductive performance in female cattle and pigs. Horm. Behav. 2007, 52, 130–138. [Google Scholar] [CrossRef]
  3. Schouten, W.G.; Wiegant, V.M. Individual responses to acute and chronic stress in pigs. Acta Physiol. Scand. Suppl. 1997, 640, 88–91. [Google Scholar]
  4. Joosen, P.; Norton, T.; Marchant-Forde, J.; Berckmans, D. Animal welfare monitoring by real-time physiological signals. In Proceedings of the 9th European Conference on Precision Livestock Farming, Cork, Ireland, 26–29 August 2019; pp. 337–344. [Google Scholar]
  5. Braga, V.A.; Burmeister, M.A. Applications of Telemetry in Small Laboratory Animals for Studying Cardiovascular Diseases; INTECH Open Access Publisher: London, UK, 2011; ISBN 9533074159. [Google Scholar]
  6. Pereira, C.B.; Kunczik, J.; Bleich, A.; Haeger, C.; Kiessling, F.; Thum, T.; Tolba, R.; Lindauer, U.; Treue, S.; Czaplik, M. Perspective review of optical imaging in welfare assessment in animal-based research. J. Biomed. Opt. 2019, 24, 070601. [Google Scholar] [CrossRef] [PubMed]
  7. Foster, M.; Brugarolas, R.; Walker, K.; Mealin, S.; Cleghern, Z.; Yuschak, S.; Condit, J.; Adin, D.; Russenberger, J.; Gruen, M. Preliminary Evaluation of a Wearable Sensor System for Heart Rate Assessment in Guide Dog Puppies. IEEE Sens. J. 2020, 20, 9449–9459. [Google Scholar] [CrossRef]
  8. Duda, N.; Barthule, A.; Ripperger, S.; Mayer, F.; Weigel, R.; Koelpin, A. Non-Invasive Low Power ECG for Heart Beat Detection of Bats. In Proceedings of the 2019 IEEE Topical Conference on Wireless Sensors and Sensor Networks (WiSNet), Orlando, FL, USA, 20–23 January 2019; pp. 1–4. [Google Scholar]
  9. Youssef, A.; Peña Fernández, A.; Wassermann, L.; Biernot, S.; Wittauer, E.-M.; Bleich, A.; Hartung, J.; Berckmans, D.; Norton, T. An Approach towards Motion-Tolerant PPG-Based Algorithm for Real-Time Heart Rate Monitoring of Moving Pigs. Sensors 2020, 20, 4251. [Google Scholar] [CrossRef]
  10. Poh, M.-Z.; McDuff, D.J.; Picard, R.W. Non-contact, automated cardiac pulse measurements using video imaging and blind source separation. Opt. Express 2010, 18, 10762. [Google Scholar] [CrossRef]
  11. Li, M.H.; Yadollahi, A.; Taati, B. Noncontact Vision-Based Cardiopulmonary Monitoring in Different Sleeping Positions. IEEE J. Biomed. Health Inform. 2017, 21, 1367–1375. [Google Scholar] [CrossRef] [PubMed]
  12. De Haan, G.; Jeanne, V. Robust pulse rate from chrominance-based rPPG. IEEE Trans. Biomed. Eng. 2013, 60, 2878–2886. [Google Scholar] [CrossRef]
  13. Wang, W.; den Brinker, A.C.; Stuijk, S.; de Haan, G. Algorithmic principles of remote PPG. IEEE Trans. Biomed. Eng. 2016, 64, 1479–1491. [Google Scholar] [CrossRef] [PubMed] [Green Version]
  14. Rubinstein, M.; Wu, H.-Y.; Durand, F.; Shih, E.; Freeman, W.; Guttag, J. Eulerian video magnification for revealing subtle changes in the world. ACM Trans. Graph. 2012, 31, 1–8. [Google Scholar]
  15. Alghoul, K.; Alharthi, S.; Al Osman, H.; El Saddik, A. Heart rate variability extraction from videos signals: ICA vs. EVM comparison. IEEE Access 2017, 5, 4711–4719. [Google Scholar] [CrossRef]
  16. Jorquera-Chavez, M.; Fuentes, S.; Dunshea, F.R.; Warner, R.D.; Poblete, T.; Jongman, E.C. Modelling and validation of computer vision techniques to assess heart rate, eye temperature, ear-base temperature and respiration rate in cattle. Animals 2019, 9, 1089. [Google Scholar] [CrossRef] [Green Version]
  17. Unakafov, A.M.; Möller, S.; Kagan, I.; Gail, A.; Treue, S.; Wolf, F. Using imaging photoplethysmography for heart rate estimation in non-human primates. PLoS ONE 2018, 13, e0202581. [Google Scholar] [CrossRef] [Green Version]
  18. Kunczik, J.; Pereira, C.B.; Zieglowski, L.; Tolba, R.; Wassermann, L.; Häger, C.; Bleich, A.; Janssen, H.; Thum, T.; Czaplik, M. Remote vitals monitoring in rodents using video recordings. Biomed. Opt. Express 2019, 10, 4422–4436. [Google Scholar] [CrossRef]
  19. Costa, A.; Borgonovo, F.; Leroy, T.; Berckmans, D.; Guarino, M. Dust concentration variation in relation to animal activity in a pig barn. Biosyst. Eng. 2009, 104, 118–124. [Google Scholar] [CrossRef]
  20. Oczak, M.; Ismayilova, G.; Costa, A.; Viazzi, S.; Sonoda, L.T.; Fels, M.; Bahr, C.; Hartung, J.; Guarino, M.; Berckmans, D. Analysis of aggressive behaviours of pigs by automatic video recordings. Comput. Electron. Agric. 2013, 99, 209–217. [Google Scholar] [CrossRef]
  21. Kashiha, M.; Bahr, C.; Haredasht, S.A.; Ott, S.; Moons, C.P.H.; Niewold, T.A.; Ödberg, F.O.; Berckmans, D. The automatic monitoring of pigs water use by cameras. Comput. Electron. Agric. 2013, 90, 164–169. [Google Scholar] [CrossRef]
  22. Chen, C.; Zhu, W.; Liu, D.; Steibel, J.; Siegford, J.; Wurtz, K.; Han, J.; Norton, T. Detection of aggressive behaviours in pigs using a RealSence depth sensor. Comput. Electron. Agric. 2019, 166, 105003. [Google Scholar] [CrossRef]
  23. Yang, A.; Huang, H.; Zhu, X.; Yang, X.; Chen, P.; Li, S.; Xue, Y. Automatic recognition of sow nursing behaviour using deep learning-based segmentation and spatial and temporal features. Biosyst. Eng. 2018, 175, 133–145. [Google Scholar] [CrossRef]
  24. Zhao, F.; Li, M.; Qian, Y.; Tsien, J.Z. Remote Measurements of Heart and Respiration Rates for Telemedicine. PLoS ONE 2013, 8. [Google Scholar] [CrossRef] [PubMed] [Green Version]
  25. Pereira, C.B.; Dohmeier, H.; Kunczik, J.; Hochhausen, N.; Tolba, R.; Czaplik, M. Contactless monitoring of heart and respiratory rate in anesthetized pigs using infrared thermography. PLoS ONE 2019, 14, e0224747. [Google Scholar]
  26. Blanik, N.; Pereira, C.; Czaplik, M.; Blazek, V.; Leonhardt, S. Remote Photopletysmographic Imaging of Dermal Perfusion in a porcine animal model. In Proceedings of the 15th International Conference on Biomedical Engineering, Singapore, 4–7 December 2013; Springer: Berlin/Heidelberg, Germany, 2014; pp. 92–95. [Google Scholar]
  27. Addison, P.S.; Jacquel, D.; Foo, D.M.H.; Antunes, A.; Borg, U.R. Video-Based Physiologic Monitoring during an Acute Hypoxic Challenge: Heart Rate, Respiratory Rate, and Oxygen Saturation. Anesth. Analg. 2017, 125, 860–873. [Google Scholar] [CrossRef] [PubMed]
  28. Haugse, C.N.; Dinusson, W.E.; Erickson, D.O.; Johnson, J.N.; Buchanan, M.L. A day in the life of a pig. North Dakota Farm Res. 1965, 23, 18–23. [Google Scholar]
  29. Teng, G.; Yu, Q. Pig behavior research and its application in breeding-landrace pigs as an example. Biomed. Res. 2017, 28, 111–117. [Google Scholar]
  30. Warriss, P.D.; Brown, S.N.; Franklin, J.G.; Kestin, S.C. The thickness and quality of backfat in various pig breeds and their relationship to intramuscular fat and the setting of joints from the carcasses. Meat Sci. 1990, 28, 21–29. [Google Scholar] [CrossRef]
  31. Unakafov, A.M. Pulse rate estimation using imaging photoplethysmography: Generic framework and comparison of methods on a publicly available dataset. Biomed. Phys. Eng. Express 2018, 4, 45001. [Google Scholar] [CrossRef]
  32. Strauch, J.T.; Lauten, A.; Zhang, N.; Wahlers, T.; Griepp, R.B. Anatomy of Spinal Cord Blood Supply in the Pig. Ann. Thorac. Surg. 2007, 83, 2130–2134. [Google Scholar] [CrossRef]
  33. Litwin, L. FIR and IIR digital filters. IEEE Potentials 2000, 19, 28–31. [Google Scholar] [CrossRef]
  34. Youssef, A.; Pena Fernandez, A.; Wasserman, L.; Biernot, S.; Bleich, A.; Hartung, J.; Norton, T. Heart rate monitoring in pigs using photo pethysmography (PPG) technology. In Proceedings of the 9th European Conference on Precision Livestock Farming, Cork, Ireland, 26–29 August 2019; pp. 842–850. [Google Scholar]
  35. Hülsbusch, M. An Image-Based Functional Method for Opto-Electronic Detection of Skin-Perfusion; RWTH Aachen: Aachen, Germany, 2008. [Google Scholar]
  36. Feng, L.; Po, L.-M.; Xu, X.; Li, Y.; Ma, R. Motion-resistant remote imaging photoplethysmography based on the optical properties of skin. IEEE Trans. Circuits Syst. Video Technol. 2014, 25, 879–891. [Google Scholar] [CrossRef]
  37. Fortin, A. Development of backfat and individual fat layers in the pig and its relationship with carcass lean. Meat Sci. 1986, 18, 255–270. [Google Scholar] [CrossRef]
  38. Antink, C.H.; Pirhonen, M.; Väätäjä, H.; Somppi, S.; Törnqvist, H.; Cardó, A.V.; Teichmann, D.; Vainio, O.; Surakka, V.; Vehkaoja, A. Sensor Fusion for Unobtrusive Respiratory Rate Estimation in Dogs. IEEE Sens. J. 2019, 19, 7072–7081. [Google Scholar] [CrossRef]
Figure 1. (a) Experiment set-up of the anesthetized pig; (b) experiment set-up of the resting pig. The red rectangles represent regions of interest chosen to investigate for heart rate monitoring.
Figure 1. (a) Experiment set-up of the anesthetized pig; (b) experiment set-up of the resting pig. The red rectangles represent regions of interest chosen to investigate for heart rate monitoring.
Animals 11 00442 g001
Figure 2. Flow chart representation of the different processing steps for heart rate extraction based on video data.
Figure 2. Flow chart representation of the different processing steps for heart rate extraction based on video data.
Animals 11 00442 g002
Figure 3. The workflow of combining three channels and independent component analysis (ICA).
Figure 3. The workflow of combining three channels and independent component analysis (ICA).
Animals 11 00442 g003
Figure 4. (a) The original G channel signal of the anaesthetized pig plotted in time-domain; (b) the filtered G channel signal; (c) a zoom-in view of the filtered signal; (d) time-frequency spectrogram; (e) the Welch power spectrum density (PSD) estimate.
Figure 4. (a) The original G channel signal of the anaesthetized pig plotted in time-domain; (b) the filtered G channel signal; (c) a zoom-in view of the filtered signal; (d) time-frequency spectrogram; (e) the Welch power spectrum density (PSD) estimate.
Animals 11 00442 g004
Figure 5. Correlation between monitoring of HR on the anaesthetized pig using the gold standard (GS) vs. using a single channel, combination of the three channels and ICA.
Figure 5. Correlation between monitoring of HR on the anaesthetized pig using the gold standard (GS) vs. using a single channel, combination of the three channels and ICA.
Animals 11 00442 g005
Figure 6. The comparison between gold standard and monitoring results from the skin surface of the abdomen of the resting pig: (a) window size 68.27 s; (b) window size 34.14 s.
Figure 6. The comparison between gold standard and monitoring results from the skin surface of the abdomen of the resting pig: (a) window size 68.27 s; (b) window size 34.14 s.
Animals 11 00442 g006
Table 1. Validation results of different window sizes (anaesthetized pig) and the three RGB channels presented as mean absolute error (MAE), root mean square error (RMSE) and percentage of heart rate (HR) error below 3.5 beats per minute when compared to the gold standard.
Table 1. Validation results of different window sizes (anaesthetized pig) and the three RGB channels presented as mean absolute error (MAE), root mean square error (RMSE) and percentage of heart rate (HR) error below 3.5 beats per minute when compared to the gold standard.
R ChannelG ChannelB Channel
Window Size (s)Window FunctionMAERMSEPE3.5MAERMSEPE3.5MAERMSEPE3.5
8.53rect5.416.4137%4.665.2522%6.116.9431%
8.53hamming5.676.6231%4.745.3722%6.457.3130%
8.53hanning5.856.8030%4.815.4622%6.727.5527%
8.53blackman6.177.1126%5.175.9020%6.637.4928%
17.07rect3.865.4454%3.114.6154%6.597.6623%
17.07hamming4.395.9449%3.264.8054%7.558.6923%
17.07hanning4.756.4046%3.264.8054%7.558.6923%
17.07blackman4.836.4246%3.434.9651%7.558.5218%
34.13rect3.364.6167%2.623.4067%6.597.8422%
34.13hamming3.664.7661%2.333.0967%6.357.5428%
34.13hanning3.664.7661%2.333.0967%6.487.6022%
34.13blackman3.684.7761%2.333.0967%6.777.8822%
68.27rect2.963.9657%2.032.7659%7.218.1914%
68.27hamming3.344.3057%2.032.7659%8.219.5714%
68.27hanning3.344.3057%2.032.7659%8.219.5714%
68.27blackman3.464.3557%2.032.7659%6.588.4529%
Table 2. Accuracy and computing complexity comparison of different methods performed on the anaesthetized pig and presented as mean absolute error (MAE), root mean square error (RMSE) and percentage of HR error below 3.5 beats per minute when compared to the gold standard.
Table 2. Accuracy and computing complexity comparison of different methods performed on the anaesthetized pig and presented as mean absolute error (MAE), root mean square error (RMSE) and percentage of HR error below 3.5 beats per minute when compared to the gold standard.
GGRDaGRDCHROMPOSICA
MAE2.332.792.764.664.323.04
RMSE3.093.743.646.075.794.12
PE3.567%53%49%33%41%54%
Table 3. Evaluation results of different regions of interest (ROIs) of the same size on the resting pig presented as mean absolute error (MAE), root mean square error (RMSE) and percentage of HR error below 3.5 beats per minute when compared to the gold standard.
Table 3. Evaluation results of different regions of interest (ROIs) of the same size on the resting pig presented as mean absolute error (MAE), root mean square error (RMSE) and percentage of HR error below 3.5 beats per minute when compared to the gold standard.
FaceFront LegAbdomen
Window Size (s)MAERMSEPE3.5MAERMSEPE3.5MAERMSEPE3.5
34.145.486.9845%7.048.4734%5.247.0753%
68.275.646.5229%6.277.5232%4.696.4357%
Table 4. Accuracy comparison of different species presented as mean absolute error (MAE), root mean square error (RMSE) and percentage of HR error below 3.5 beats per minute (bpm) when compared to the gold standard.
Table 4. Accuracy comparison of different species presented as mean absolute error (MAE), root mean square error (RMSE) and percentage of HR error below 3.5 beats per minute (bpm) when compared to the gold standard.
MAE RMSE PE3.5
Pig (current study)4.696.4357%
Primate [17]4.4/56%
Human [31]1.993.2587%
Publisher’s Note: MDPI stays neutral with regard to jurisdictional claims in published maps and institutional affiliations.

Share and Cite

MDPI and ACS Style

Wang, M.; Youssef, A.; Larsen, M.; Rault, J.-L.; Berckmans, D.; Marchant-Forde, J.N.; Hartung, J.; Bleich, A.; Lu, M.; Norton, T. Contactless Video-Based Heart Rate Monitoring of a Resting and an Anesthetized Pig. Animals 2021, 11, 442. https://doi.org/10.3390/ani11020442

AMA Style

Wang M, Youssef A, Larsen M, Rault J-L, Berckmans D, Marchant-Forde JN, Hartung J, Bleich A, Lu M, Norton T. Contactless Video-Based Heart Rate Monitoring of a Resting and an Anesthetized Pig. Animals. 2021; 11(2):442. https://doi.org/10.3390/ani11020442

Chicago/Turabian Style

Wang, Meiqing, Ali Youssef, Mona Larsen, Jean-Loup Rault, Daniel Berckmans, Jeremy N. Marchant-Forde, Joerg Hartung, André Bleich, Mingzhou Lu, and Tomas Norton. 2021. "Contactless Video-Based Heart Rate Monitoring of a Resting and an Anesthetized Pig" Animals 11, no. 2: 442. https://doi.org/10.3390/ani11020442

APA Style

Wang, M., Youssef, A., Larsen, M., Rault, J. -L., Berckmans, D., Marchant-Forde, J. N., Hartung, J., Bleich, A., Lu, M., & Norton, T. (2021). Contactless Video-Based Heart Rate Monitoring of a Resting and an Anesthetized Pig. Animals, 11(2), 442. https://doi.org/10.3390/ani11020442

Note that from the first issue of 2016, this journal uses article numbers instead of page numbers. See further details here.

Article Metrics

Back to TopTop