Heart Rate and Respiration Rate Measurement Using Hemodynamic Waves

The major cause of death in both urban and rural area peoples is due to heart problems. Due to inacessibilty of testing facilities available at rural areas, most of the people from suffer from cardiovascular disease (CVD).The common method adopted is regular ECG check-ups for the detection of the risk factors of CVD. In this paper, a noninvasive based propagation of hemodynamic waves for measurement of heart rate and respiration rate is proposed. The blood volume pulse (BVP) from the forehead region by using independent component analysis (ICA) in the recorded video of RGB color channels is extracted. The patient forehead portion is observed by High Definition webcam. The study finds that the above proposed method allows for well-organized pulse rate detection by adopting lighting compensation technique and artifact reduction method in measurement of Heart Rate and Respiration rate.

Hemodynamic waveforms are maps of pressure changes that take place inside a vessel or chamber 1 .To understand the exact morphology of a normal waveform, a clear recognition of events in the cardiac cycle is needed.Understanding the cardiac cycle involve focus on the vessel or chamber by visualizing and measuring the pressure changes that occur throughout one full period of systole and diastole.The cardio respiratory system is an interconnected system of organs and tubes that co-ordinates the exchange of O 2 and CO 2 between an organism and its environment.The nose and the mouth is the interface of the respiratory system with the environment; through them, air (a gas mixture, containing oxygen) enters into the lungs.The Respiratory muscles controls the air movement in and out of the body allowing the lungs to alternatively reduce and expand their volume.The respiration activity is typically evaluated by measuring the time between two sequential thoracic expansions of the lungs (respiration rate, RR).The measurement unit is the breaths per minute (bpm) and the RR can largely vary, in normal health conditions typically they are included between 12 and 20 bpm 2 .The biomedical devices used in clinics for the measurement of the RR are: Spirometer (SP), respiration belt, temperature sensors 3 .For these devices the measuring equipment need to be in direct contact (mostly in an invasive manner) with the subject and consequently they are not well suited for prolonged monitoring.The heart activity is measured as the frequency of the heart contraction (heart rate, HR).The normal range of HR values in adults is included between 60 and 100 beat per minute (bpm) 2 .The reference instrumentation is the electrocardiogram (ECG) which, by means of at least 4 skin electrodes, is providing 3 electrical signals (leads) used to calculate the heart rate 3 .An alternative method is based on the use of pulseoxymeters 3,5 where the transducer is applied to the finger tip or the ear lobe by means of a clip.Spirometers, instrumented belts, temperature sensors and ECGs are all contact measurement methods which are not fully suited for self-use at home.Moreover such electronic devices cannot be used in special environments such as: Magnetic resonance imaging (RMI) and hyperbaric chambers due to safety reasons.In recent years many measurement techniques based on non contact methods have been proposed for the assessment of RR and HR 6 : Laser Doppler Vibrometry [7][8][9][10] , digital imaging 11 and electromagnetic waves 12,13 are among them.Their use is very promising because they allow the subject under investigation to be free to move and not physically linked to the instrumentation by electrodes, cables or tubes.For some of them (Laser Doppler Vibrometry) the subject need to be in a known position laying on bed or sitting on a chair, or even standing in front of the device, but in static conditions.For the methods based on imaging and electromagnetic waves instead this is not strictly required.

Study description and experimental setup
The various processes involved in the measurement of HR & RR is Video Acquisition, Lighting Compensation, Artifacts Reduction, Face Detection, Selection of ROI, RGB Channel Separation of selected ROI, Blind Source Separation and Extraction of ECG Signal.In video Acquisition process a basic HD webcam is used to record the video in color of 24 bits with 3 RGB channels of 8 bits per channels.The videos are captured at a speed of 30 fps with 1920 x 1080 resolution and AVI format is used to save the video file.The subject was said to be in normal resting condition and seated in front of the system at an approximate spacing of about 0.2 to 0.5 meters from the HD Webcam interfaced in the PC.The videos are recorded for 60 seconds duration and the experiments were carried out at indoors with a Stable amount of ordinary available light source.

Lighting Compensation and Artifact Reduction
Next to video acquisition, lighting compensation is used to overcome the light reflections and shadowing problem, where Ycbcr technique is used for lighting compensation.The lighting compensation (LC) algorithm is an efficient process in image processing where the enhancement and restoration of its natural colors is done in varying lighting conditions 14 .The Artifact Reduction is mainly used to remove the patient movement during the video acquisition for processing the video frames.The Artifact Reduction is done by using a Periodic Moving Average Filter and this filter is used in digital signal processing which is optimum for the common task in noise reduction 15 .Savitzky-Golay Filter is used as the Periodic Moving Average Filter for Artifact reduction in the subject Movement, which is a Smoothing Filter of Special FIR Filter.A Savitzky -Golay filter is mainly a digital filter applied to a group of digital data points for the reason of smoothing the applied data to increase the SNR ratio without affecting the signal 16 .This is achieved by convolution process, in which consecutive sets of data points are said to fit with the lower degree polynomials by linear least squares method.A polynomial is fit to the data in each window and the center value is replaced by the calculated value from the model.Savitsky and Golay developed a set of weighting factors (integers) that, when used in a convolution process to achieve the same effect as least squares fit to a polynomial equation.

Face detection and ROI Selection
Next the Face detection process is carried out, the main goal of the automatic face detection is to detect the subject face in the video frame at various circumstances.An intermediate system is developed by a boosting method to train the classifier which is adequate to process images in a rapid manner with high detection rates 17 .The idea of building the detector is based on a learning algorithm of boosting known as AdaBoost.By considering a single stage classifier and giving a group of features, it is possible to build an effective face detector by using various masks at each image location.There are many learning methods used with a complete set of 37520 features for detection.In building the face detector, the learning function is used in order to select small sets of these features where it classifies the positive and negative.The resultant classifier is quite simple linear combinations of these minimum sets of Haar like features.From the detected face the region of interest is a rectangular shaped box of the facial forehead region and it is defined based on eye coordinates and distance calculated above them.The Region of interest is chosen for the estimation and analysis of heart rate and respiration rate for each frame in recorded video.The below figure 1 & 2 shows the face region selection and ROI selection of cropped forehead region from the selected face coordinates.

RGB Channel Separation
After selecting the ROI area the RGB channels are separated and mean value is calculated for all the pixels in ROI.The three separated red, green and blue channel of each and every frame forms the raw traces of signal for further analysis.The separation of the RGB channel in the selected ROI region is mainly use to obtain the variation in the blood volume pulse due to changes in cardiac activity of the heart

Recovery of BVP from Webcam Recordings
The Blind source separation or Blind signal separation (BSS) is the method of separating an original source signal from a group of various mixed signals.The separation of source signal is done without any proper assistance of data or with a very small amount of data about the mixing process or source signals.In recent, BSS by Independent Component Analysis (ICA) is attained more importance due to its various signal processing applications [18].In BSS, ICA is a widely used for signal detection and feature extraction, where it translates a variable signal to statistically ...(3) x(t) and s(t) are vectors and A is a square matrix which consists of three source signals mixed with mixture coefficients.The purpose of ICA is to extract the sources signal s(t) by calculating the de-mixing matrix W, where W is an approximated to be the inverse A (original mixing matrix).
...( 4) y(t) is an approximation of the fundamental source signals s(t) and the below figure 4 explains the entire ICA process.
By considering finite conditions in central limit theorem as the source increases both mixture of independent distribution and random variables are identically distributed, converges to the Gaussian distribution, as shown in figure 5. Calculating the independent source signal represents in determining the de-mixing matrix W, therefore y = Wx is a non-gaussian for each entry as possible.This specifies that to retrieve independent components, W should maximize non-gaussianity for each and every source.The purpose of using ICA in pulse rate measurement is the point of interest to determine the periodic changes in blood volume pulse induced by the heart.JADE algorithm is used in the ICA process for the extraction of the essential changeable green component.

Heart Rate Detection
For the measurement of heart rate it mainly consists of the following process Butter worth filter, Fast Fourier Transform, Leakage Reduction, Peak Detection and Smoothing.After the acquisition of signal, the band pass filter is used to remove the unwanted frequencies which lie outside of interest band.This cause reduction of noise in further processing steps such as finite peak tuning and produces a smooth heart rate signal.For the estimation of Heart Rate the 2 nd order Butter worth filter is used and for the selection of interest band, the cut off frequencies is set to a range of 40-230 bpm.The time domain signal is translated to the frequency domain signal by using Discrete Fourier Transform.While the complexity in the DFT computational is O (N 2 ) for an N points, the results of FFT gives the same with O (N•log2 (N)), which has a high speed up when N is greater.The FFT computation is done by means of a special command in Matlab software and usually the real signal of FFT is a Complicated one where every complex samples constitute the magnitude and the phase of the corresponding frequency.
For an uninterrupted measurement of the heart rate, detection of peak and smoothing Process are said to occur again and again for each and every 0.5 sec.The window containing the sample signals of last six seconds is always performed for computation.Since there is a virtual movement in window throughout the signal and therefore it is named as sliding window or moving window.Usually the window length instantly affects the resolution of frequency and thereby also affects accurate estimation.At a sampling  the frequency variation between two Successive bins is Fs / N and it is known as the frequency resolution (Fr).Therefore, a good frequency resolution is obtained within the higher the window duration and also a better accuracy is attained, as in this case it is half the resolution.Moreover, the time accuracy decreases with increase in window duration and the entire length of the signal is selected as the window length.
In frequency, there is chance of leakage formation when the result convolutes with rectangular signal spectrum by infinite time signal Fig. 15.ECG Signal from subject spectrum.In order to avoid leakage reduction, before performing DFT function, the multiplication of input signal by a function with zero boundaries is performed.Therefore it forces the net result of boundary values to zero.The multiplication function is named as window and the Hann window is chosen particularly because it offers better resolution and high leakage rejection.After the computation of FFT for its corresponding sliding window function, the magnitude of peaks is found for the interest band by find peaks function and the largest peak is chosen from the neighboring samples.Next in the Smoothing process, a close location is found from the frequency band but the actual results lies in 10 bpm increments of discrete set.Usually the heart rate readings are continuous in 1 bpm frequency resolution and this is achieved by correlating the signal window with a series of tones in phase and quadrature around the FFT peak in 1 bpm increments.

Respiration Rate Detection
The respiration rate is measured by applying Wavelet transform to the ICA of Green component in the selected ROI.Since the high frequency component is associated within breathing cycle, the respiration rate can be measured from the FFT signal 19 .While the frequency related to respiration varies, the center frequency of the high frequency peak alters in according to respiration rate.

Extraction of ECG Signal
The kalman Filter is used to extract the ECG signal from the ICA component of the subject and the extended kalman Filter is used to reconstruct the ECG signal.The purpose of the kalman filter is to extend the resolution for estimating the linear time active system and the kalman filter mainly has two steps of process, first is prediction and the other is update 20 .In the system for the given previous measures, the next state and fore coming states is estimated in the prediction step, where at that time step the present state is approximated in the update step for the given measurement.In extended Kalman filter, difficulties of nonlinear optimum filtering is controlled by Taylor series measurement and forming a Gaussian approximation to the joint distribution of state.

RESULTS
The input image taken from the HD webcam is a video file that consists of set of many frames grouped together, out of which one of the frame image is shown in the below Figure 6.
After the video acquisition process the video is processed by extracting the video frames recorded in the PC and the frames are processed one by one.The processing and analysis of frames in the recorded video is done by using custom MATLAB software.All frames of the recorded video are subject to Lighting Compensation process by using Ycbcr technique and the output is shown in the above figure 7. Next to Lighting Compensation Process, the frames are processed for Artifact Reduction by using Periodic Moving Average Filter.The Savitzky-Golay filter is a smoothing filter mainly used for reduction in the subject Artifact Movement.
An Automatic face tracking is used for detection of faces among the frames in the video and the face detection Process is done by using an AdaBoost algorithm.We mainly use open source MATLAB compatible version of face detection algorithm developed Viola and Jones.For each frame the algorithm identifies the face and it forms the x & y co-ordinates by the height and width of the image which defines a rectangular box in the subject face.The output of the face detection process with features of eye, Nose and mouth marks is shown in the below Figure 8.
From the detected face, the forehead portion is chosen as the ROI in each and every frames and the calculation is based on the pixels of the extracted region of interest.The cropped forehead portion from the extracted face is obtained by selecting the region from the X & Y co-ordinates in the box of face detection around the face.The output of the cropped forehead is the region of interest for measurement of Heart rate and Respiration in the subject is shown in the below Figure 9.
After selecting the Region of interest area the RGB channels are separated and mean value is calculated for all the pixels in ROI.The three separated Red, Green and Blue channel of each and every frame forms the raw traces of signal for further analysis.The separation of the RGB channel in the selected ROI region is mainly use to obtain the variation in the Blood volume pulse because of the change in cardiac activity of the Heart.The output of the raw trace signal of RGB channel is shown in the figure 10.
Next to the separation of RGB channel, the raw trace signals are subject to form three different source signals by Independent component Analysis and the JADE algorithm is used for obtaining the three ICA components.The output of the three ICA component is shown in the below figure 11.ICA is a variable component; among these three components Green component is chosen as the source signal to measure the Heart rate and respiration rate from the subject.
The Heart rate is determined by applying FFT for its corresponding sliding window function and the magnitude of peaks is found for the interest band by find peaks function.Within the resultant peaks, the max function is used to find the final highest peak and at last, it is transformed to the matching frequency in the Fourier Transform vector.The output of the detected peak from the FFT signal is done by the peak detection function in MATLAB.In Smoothing process, the complex number represents a pair of phase and magnitude as the resultant of each and every signal tone correlation.The final smoothed heart rate is determined by selecting the frequency that matches the highest magnitude.The output of the smoothed peak from the FFT for Frequency Analysis and Time Evolution of Heart Rate Signal is shown in the figure 12.
The respiration rate is calculated from the frequency middle of the high frequency peaks in the FFT signal and the output of the estimated respiration rate is shown in the figure 13.
The extended kalman filters are based on linear and quadratic transformation and the output of the Kalman filter for the extraction of ECG signal is shown in the below Figure 14, which consists of three signals, Reconstructed ECG signal, smoothed signal and the signal from the subject.
The ECG signal from the subject is extracted by reconstructing the ICA signal from subject and the reconstructed ECG signal is said to smoothing process for noise reduction.The output of the ECG signal is shown in the Figure 15.

DISCUSSION
A novel non invasive method was proposed for measuring the heart rate as well as respiration rate on the subject forehead by using the video captured by a HD webcam.The Hardware set-up utilizes a HD webcam for video recording provided with ambient illumination of daylight.The Proposed method is cost-effective, efficient for non-invasive heart rate and respiration rate measurement that operates automatically with movement tolerated.By using simple image processing technique, the Independent component analysis algorithm is applied for calculating the variable component information of the heart rate and respiration rate in the recorded video.The proposed algorithm appears easy for usage of this system in the day-to-day monitoring of home care patients.Moreover, with the less cost and wide

Fig. 3 .
Fig. 3. ROI is decomposed into RGB channels for each Frame