The Impact of Video Compression on Remote Cardiac Pulse Measurement Using Imaging Photoplethysmography
Total Page:16
File Type:pdf, Size:1020Kb
The Impact of Video Compression on Remote Cardiac Pulse Measurement Using Imaging Photoplethysmography Daniel J. McDuff1, Ethan B. Blackford2, and Justin R. Estepp3 1 Microsoft Research, Redmond, WA, USA. ([email protected]) 2 Ball Aerospace, Fairborn, OH, USA. ([email protected]) 3 711th Human Performance Wing, US Air Force Research Laboratory, Wright-Patterson AFB, OH, USA. ([email protected]) Abstract— Remote physiological measurement has great po- tential in healthcare and affective computing applications. Imag- ing photoplethysmography (iPPG) leverages digital cameras to recover the blood volume pulse from the human body. While the impact of video parameters such as resolution and frame rate on iPPG accuracy have been studied, there has not been a systematic analysis of video compression algorithms. We compared a set of commonly used video compression algorithms (x264 and x265) and varied the Constant Rate Factor (CRF) to measure pulse rate recovery for a range of bit rates (file sizes) and video qualities. We found that compression, even at a low CRF, degrades the blood volume pulse (BVP) signal-to- noise ratio considerably. However, the bit rate of a video can be substantially decreased (by a factor of over 1000) without destroying the BVP signal entirely. We found an approximately linear relationship between bit rate and BVP signal-to-noise ratio up to a CRF of 36. A faster decrease in SNR was observed for videos of the task involving larger head motions and the x265 algorithm appeared to work more effectively in these cases. I. INTRODUCTION Remote measurement of physiological signals has a number of advantages over traditional contact methods. It allows the measurement of vital signals unobtrusively and concomitantly. In recent years, a number of approaches for imaging-based measurement of physiology using digital cameras have been Fig. 1. We present a systematic analysis of the impact of video compression proposed. Imaging photoplethysmography (iPPG) captures on physiological measurements via image photoplethysmography. We variations in light reflected from the body due to blood compare compression types and levels on over four hours of video from volume changes in microvascular tissue [1]. Verkruysse et twenty-five participants performing stationary and random head motion tasks. al. [2] demonstrated that sub-pixel variations in color channel such as telemedicine. Blackford and Estepp [9] found that measurements from a digital single lens reflex (DSLR) reducing frame rate from 120Hz to 30Hz and/or reducing camera, when aggregated, could be used to recover the blood image resolution from 658x492 pixels to 329x246 pixels had volume pulse. Subsequently, researchers have shown that little impact on the accuracy of pulse rate measurements. iPPG methods can allow accurate measurement of heart Video compression is an important parameter that has not rate [3], heart rate variability [4], breathing rate [4], blood been systematically studied with regard to iPPG. oxygenation [5] and pulse transit time [6]. McDuff et al. [7] There are a number of methods for video compression provide a comprehensive survey of approaches to iPPG. that aim to reduce the bit rate whilst retaining the important A number of parameters influence the accuracy of iPPG information within a video. However, video compression measurements. These include the imager quality [8], and the algorithms are not designed with the intention of preserving frame rate and resolution of the images [9]. Sun et al. [8] photoplethysmographic data. On the contrary often compres- compared remote physiological measurement using a low cost sion algorithms make assumptions that small changes in pixel webcam and a high-speed color CMOS and showed similar values between frames are not of high visual importance and signals were captured from both cameras, further supporting discard them, influencing the underlying variations on which that iPPG is a practical method for scalable applications iPPG methods rely. We present a comparison of iPPG blood This work was supported by the Air Force Office of Scientific Research volume pulse (BVP) signal-to-noise ratios and pulse rate (PR) task# 14RH07COR, ’Non-Contact Cardiovascular Sensing and Assessment’. measurements from videos compressed using popular current and next-generation codecs (x264 and x265). resulting image may then be interpolated to derive a full In real-life applications motion tolerance of iPPG mea- color image with RGB values for each location, increasing surement is likely to be important. Previous work has the amount of data by a factor of three. Alternatively, proposed methods for reducing motion artifacts in iPPG images may be stored using alternate colorspaces, such measurements [10], [11], [12], [13], [14], [15], [16]. Due to as YUV. The YUV colorspace represents data as a single the nature of inter-frame compression, compression is likely luma (Y), or achromatic brightness, component and two to have different impacts on physiological signal recovery chrominance components, U/Cb and V/Cr representing blue- depending on the level of head motion. Therefore, we evaluate luma and red-luma differences, respectively. A popular use results on videos for stationary and motion tasks. of the YUV colorspace, YUV420p, capitalizes on the visual Finding compression configurations that preserve valuable system’s greater perception of luminance differences over physiological data would allow new applications for iPPG color or chrominance differences. Each image pixel location measurement. For example, methods used for video record- is represented by a luminance value while the chrominance ing/streaming through a web browser in video conferencing values are subsampled every other row and column. As a could be adapted to preserve iPPG data for analysis as part result, a given block of 4 pixels requires 6 bytes of data of a telehealth system. Additionally, alleviating the burden (12bits/pixel) in the YUV420p colorspace rather than 12 of storing raw video could enable sharing research datasets. bytes (24bits/pixel) in the RGB colorspace. We analyzed a large dataset of uncompressed, raw videos Intra-frame or image compression methods reduce spatial with both stationary subjects and random head motions [13] redundancy/correlation within the image. To do so, the image in order to test the impact of video compression on the is subdivided into groups of pixels, sometimes referred to as accuracy of remote physiological measurements. Participants macroblocks or coding units. Larger and more complicated (n=25) engaged in two, 5-minute tasks and were recorded block compositions can provide better visual appearance and using an array of cameras. Gold-standard electrocardiogram greater coding efficiency at the expense of additional compu- (ECG) measurements were captured alongside contact PPG tational complexity. The blocks are then transformed from measurements from the finger-tip. Figure 1 shows a summary the spatial domain, often using the discrete cosine transform of our study and examples of frames from the two tasks. (DCT). The DCT is then divided by a quantization matrix and rounded. This process eliminates smaller coefficients and II. BACKGROUND greatly reduces the number of values required to express the A. Video Compression image. This process is also used in JPEG image coding. Raw video requires enormous amounts of storage; for Similarly, inter-frame compression reduces temporal redun- example, each raw, uncompressed 5.5-minute video file dancy/correlation between successive images in a group of collected in this study was 11.9 GiB in size. Collecting data pictures (GOP). A reference, I-frame (intra-) is encoded inde- from multiple cameras (9), numerous trials (12), and subjects pendently using intra-frame compression, as described above, (n=25) resulted in a total size of 31.50 TiB for the 247.5 and requires the most data to express. Between I-frames are P- hours of standard definition video. The inherently large size frames (predicted), and B-frames (bi-directionally predicted). of raw video make its use infeasible outside of research and P-Frames require less data to express and consist of motion archival video storage. Herein we seek to better understand vectors describing changes from previous I- or P-frames. B- the trade offs related to iPPG derived measurements made frames require the least amount of data and describe motion from videos with varying levels of compression. The results of vectors using both past and future frames. The difference, this evaluation will inform the final dataset which is planned or residual, between predicted frames and original frames to be made available to researchers working in this area. are then transformed and quantized. This process reduces the Owing to the large file sizes imposed by raw video, coding for regions of little to no change between frames. compression is an essential element of almost every video More advanced encoding schemes rely on more sophisti- system. Video encoding schemes typically employ similar cated techniques for determining I-, P-, and B-frames, their methods in order to reduce the amount of data required order and frequency for more efficient encoding via greater to store or transmit video. Increasing the complexity of complexity. Similarly, adaptive quantizers, such as a constant such methods improves coding efficiency and relies on rate factor (CRF) may be used to maintain video quality advances in computational resources to allow the video to be across