top of page
  • Twitter Social Icon
  • LinkedIn Social Icon
  • Facebook Social Icon
Search

Week 10 Journal

  • Writer: Meena
    Meena
  • May 21, 2020
  • 2 min read

The major focus of this week was to finish debugging the ICA algorithm and move on to different ways of improving heart rate detection. While Jennifer worked on switching over to the ulab functions, I took a closer look at the ICA algorithm from the website we were following. Once I ran all of the python code on Google Colab, I realized that the ICA algorithm was being computed row-wise. That is, each row of the input was considered to be a signal. This caused us to go back through each and every function, and trace through the shapes of the variables to make sure it was being calculated correctly. In addition, the computational complexity was reduced since the input was of a smaller dimension.


While changing all of our functions to use the ulab library, we realized that there was a mistake in the covariance function, because the dot product was always calculated incorrectly. Fortunately, the matrix multiplication function we made earlier in the quarter was commented out, so I tweaked it do work for ndarrays, and replaced all of the ulab's dot product function with the matrix multiplication function.


Finally, we finished debugging the ICA algorithm (hopefully for the last time!). Before testing our algorithm again, we decided to narrow down the region of interest from the face to the forehead. From our readings, we found that this area had a better heart rate reading since there are very few distracting features like eyes. For this, we took the bounding box that was detected by the Haar cascades and set the top fourth of the box as our region of interest. To exclude hair from this new region of interest, we decreased the width of the box. We took the power spectra of the green channel, instead of looking at the magnitude. The range for plotting the power spectra was 0.5 Hz to 4.5 Hz, because these roughly translate to heart rates that are physiologically possible - 30 beats per minute (bpm) to 270 bpm.


Figure 1: The image on the left returned a heart rate of about 72 bpm. The image on the right returned a heart rate of about 80 bpm.


Figure 1 shows the power spectra of the green channel (which should be the most accurate in depicting heart rate) for two separate runs of the entire algorithm. The heart rate was calculated by zooming in on the first half of the signal - since the graph is symmetric, the second half is unnecessary - and ignoring the first few entries - because these reflect the DC components, hence the huge spike near 0.5. From the remaining signal, the frequency of the maximum value is found and multiplied by 60 to get a heart rate in bpm. Jennifer's heart rate was around 66 bpm when the videos for those rates were taken, so they were not completely accurate. However, it is a lot closer to the real heart rate.

 
 
 

Recent Posts

See All
Week 12 Journal

This week, Jennifer and I focused on collected data. First, we tested the accuracy between different amounts of face detection (using...

 
 
 
Week 11 Journal

The main focus of this week was to add improvements to the heart rate detection algorithm, and work on a couple stretch goals. During our...

 
 
 
Week 9 Journal

This week, our main focus was to debug the ICA algorithm to get a more accurate heart rate reading. While looking through the algorithm...

 
 
 

Commentaires


© 2023 by Talking Business.  Proudly created with Wix.com

bottom of page