NivaarExam PrepOfficial exam papers ↗

20-Bio-B4 Robotics · December 2016

Question 6 of 6: Application — Pulse Detection

Nivaar worked solution (AI-drafted; not reviewed by a licensed engineer)

Notes on this paper

Paper format: National Exams, December 2016 — 04-Bio-B4 Image Processing. Three hours, open book (any paper notes or textbooks permitted, but no calculator or computer). Six questions of equal value (20 marks each); five constitute a complete paper and only the first five appearing in the answer book are marked. All six are solved here, because this set is a study resource rather than an examination script. Every question is essay/descriptive (definitions, algorithm/system design) except the convolution-size arithmetic and FFT/3D-convolution items in Question 2, and the illustrative numeric design examples worked into Questions 5 and 6.

Reference texts (the books a candidate should have reviewed for this subject):

Question 6: Application — Pulse Detection (20 marks)

Question text not reproduced: the examination questions are © Engineers and Geoscientists BC. Open the official past paper (linked at the top of this page) to read the question, then follow the worked solution below.

Given. A colour RGB video $I_t$ at 10 frames/second, a mostly-static subject, and a pulse-induced colour change too small to see directly (a photoplethysmographic signal).

Find. A system that reports the average pulse rate (beats per minute) over the last 10 seconds of video.

Approach. Reduce each frame to a single number (the spatially-averaged colour intensity over a skin region of interest), track that number over time, and estimate its dominant periodicity in the frequency domain, since a pulse rate is fundamentally a frequency and the frequency domain concentrates a weak periodic signal into one identifiable peak while noise stays spread across the spectrum.

Localize ROI(face/skin patch)Extract mean coloursignal per frameDetrend(remove DC/slow drift)FFT over 10 s windowPeak-pick in40-200 BPM bandReport average BPM
Proposed pulse-detection pipeline: localize skin, extract a mean-colour time series, detrend, then estimate BPM from the dominant FFT peak inside the physiological pulse band.

(a) Localization

Automatic localization is strongly preferred over manual selection for a usable system: use a standard skin/face detector (colour-based skin segmentation in a perceptual space, e.g. thresholding in YCbCr or HSV, or a dedicated face detector when the subject is a face) to find a candidate region, then restrict the region of interest to a sub-patch expected to be well-perfused and easy to keep still relative to the frame (forehead or cheek for a face; a large flat skin area otherwise). Automatic detection also lets the system re-localize if the subject shifts slightly between frames, which a one-time manual selection cannot do.

(b) Calibration — Noise and Disturbances

The dominant disturbances are: (i) ambient illumination changes (a flickering light, or a slow drift as room lighting changes), which show up as a low-frequency or discrete-frequency component that can swamp or be confused with the much smaller pulse signal — handled by detrending (subtracting a local moving average / the segment mean) before spectral analysis, and by restricting the frequency search to the physiologically plausible pulse band (roughly 40–200 BPM, i.e. 0.67–3.3 Hz) so that illumination flicker at unrelated frequencies (e.g. 50/60 Hz mains-driven flicker, far outside this band at a 10 fps sample rate) cannot be mistaken for a pulse; (ii) subject motion, which the problem statement assumes is not significant, but any residual small motion shifts the ROI's sampled pixels and adds a motion-correlated artifact — a stated assumption to flag explicitly rather than silently ignore; (iii) sensor/quantization noise, reduced simply by averaging over many pixels within the ROI per frame (spatial averaging), which is a far larger noise-reduction win than any single-pixel signal could offer.

(c) Time Domain or Frequency Domain?

Work in the frequency domain. A pulse rate is intrinsically a frequency (beats per minute), and the raw time-domain colour signal is dominated by noise/illumination effects far larger than the sub-visible pulse-induced colour change — the FFT concentrates the periodic pulse component into a small number of frequency bins while noise energy stays spread across the whole spectrum, making the peak far easier to detect reliably than trying to count individual beats directly from the noisy time-domain trace (e.g. by peak-counting), which is much more sensitive to a single noisy sample.

  1. Extract the per-frame signal. For each frame $I_t$ in the localized ROI, compute the spatial average of a colour channel most sensitive to the capillary-dilation reddening (commonly the green channel is used in practice for its strong haemoglobin absorption contrast, though red is also viable); this collapses each frame to one scalar sample, giving a 1D signal sampled at 10 Hz.
  2. Detrend. Subtract the mean (or a slow moving average) of the 10-second window to remove the DC/slowly-varying illumination component, isolating the small periodic ripple.
  3. Transform and peak-pick. Compute the DFT/FFT of the 10-second (100-sample) detrended window, and search only the bins corresponding to 40–200 BPM (0.67–3.3 Hz) for the frequency bin of maximum magnitude — restricting the search window is what prevents an out-of-band artifact from being mistaken for the pulse.
  4. Convert and report. Convert the peak bin's frequency to beats per minute ($\text{BPM} = f_{\text{peak}}\times60$) and report it as the average pulse over the analysed window; slide the 10-second window forward each new frame (or each new second) to give a continuously updated estimate.
Design choiceValue / rationale
Signal sourceSpatial mean of a colour channel over a skin ROI, one scalar/frame
Sampling10 Hz (given), 100 samples per 10 s analysis window
DomainFrequency (FFT); pulse band restricted to 40–200 BPM (0.67–3.3 Hz)
Verified synthetic exampleTrue 72 BPM signal + noise → FFT peak recovers 72 BPM exactly

This pipeline, 10-second (100-sample) signal built as a constant baseline plus a small 1.2 Hz (72 BPM) cosine ripple plus additive pseudo-random noise. After detrending (subtracting the window mean) and computing the DFT, restricting the peak search to the 40–200 BPM band and picking the maximum-magnitude bin recovers exactly 72 BPM — the true rate lands exactly on bin 12 of 100 at this sample rate/duration, and the recovered estimate matches it to the precision of one FFT bin ($60/10=6$ BPM resolution at this window length).

Check: assumes the subject is genuinely still (stated in the question) and that the pulse rate does not change materially within the 10-second analysis window; a real system would also need to validate that the chosen ROI is not saturated/underexposed (both of which reduce the usable colour dynamic range) and might average several skin ROIs to further improve SNR.
Back to the paper →