Estimating Core Body Temperature Using Continuous HR Observations

For this post I will be discussing how you can obtain your core body temperature by using estimated minute by minute measurements of your heart rate. These heart rate measurements can be found in my first post: Obtaining Heart Rate from Smart Phone Camera

At the moment, there is not a clear way to measure deep body tissue temperature from the surface of the skin. This has been a project that is well documented by USARIEM and has inspired me to add this portion to my overall larger project. If you want to learn more in depth about this build I encourage you to visit their website and use their web app!

For this project, I used Matlab again as it was easier to build off my previous work. While the actually implementation of this was a bit complicated, the following below is meant to be a high level overview. As always, feel free to look at the code below.

Proposed Model

This model assumes that:

  1. Heart Rate contains information about both heat production (through the Fick (1855) equation and VO2) and heat transfer since HR is related to skin profusion. E.g.
  2. Heart rate can be used as a “noisy” observation of core body temperature.

Similar to the previous project model mentioned above,  the cellphone will act as the photodetector and LED Flash will serve as the LED’s of the oximeter probe:

  1. First, an iPhone will be used to record a video of short duration, with the finger placed over the lens of the mobile camera.
  2. During this recording, the flash will turned ON, so that adequate amount of light can reach the finger for proper measurement.
  3. At this point, this video will be transferred on to Matlab on my computer and I will run the developed script to obtain the heart rate measurement.
  4. The Heart Rate Measurements will be normalized and plugged into an equation that helps estimate Core Body Temperature based on scientific evidence.

Results

A video that was the length of 10 seconds gave the following vector results for heart rate:

  [59.669  59.669  59.669  59.669  58.669  58.669  57.669]

screen-shot-2018-04-20-at-12-37-06-am.png

Heart Rate Per Second

That was translated to the following when put through the Kalman Filter and subsequent algorithm:

Mean HR: 59.097 beats per minute

Temperature: 37.061 C


Technical Overview 

The script that was developed can be broken down into two components: Fick Equation and Kalman Filter.

Fick Equation:

It is important to understand how the Fick equation relates to heart rates and heat production. For starters, the Fick Equation is as follows: VO2 = Q x A-VO2 difference. By definition, the Fick equation is used to determine the rate at which a person uses oxygen in their body aka the volume of oxygen uptake (VO2). This volume of oxygen intake can be measured by looking at the amount of oxygen that gets delivered to the cells and the amount that is used by those cells. The amount of blood pumped per minute (cardiac output) will determine the the amount of oxygen delivered.

Cardiac Output is denoted as Q in the equation and is made up of how much blood is pumped per beat (aka stroke volume) and how many times the heart beats per minute (aka heart rate). So now we can put together that Cardiac output (Q) is equal to stroke volume (SV) times heart rate (HR). In mathematical notation: Q = SV x HR. Is it now starting to come together? This is where being a Biology Major in undergrad really helped me with this project.
Moving on, the amount of  oxygen that is used by the cells is called oxygen extraction. This measurement is the amount of oxygen taken from the blood to be used by the cells to produce ATP (fuel) which is used as energy. This can be measured by taking the difference between the oxygen saturation of the blood going to the tissues (in the arteries) from the blood returning to the heart (in the veins). This is widely known as the arterio-venous difference or mathematically noted as A-VO2 difference.

Now on a larger scale, the blood that pumps from the heart and carries fuel and oxygen to the muscles is found to create a heating effect. On the contrary, the blood that is directed toward the surface of the skin is found to create a cooling effect.

Kalman Filter

To this point we have an understanding that heart rate can play a role in both heat gain and heat loss, thus automatically tying it to core temperature fluctuations. As mentioned above, heart rate can be a noisy measurement of core body temperature. To better track the variance associated with this observation, research papers point to using a Kalman filter (Kalman 1960) which has been used extensively in engineering tracking problems. In these models an item or variable of interest must be tracked from a series of “noisy” observations, and knowledge of the temporal dynamics. The Kalman filter (KF) requires a transition and observation model defined by linear Gaussian probability density functions. Thus, the KF will give a better estimate of core temperature than just using the observations alone. What you must know before moving on is that the Kalman filter is an algorithm that uses a series of measurements observed over time, containing statistical noise and other inaccuracies, and produces estimates of unknown variables by estimating a joint probability distribution over the variables for each timeframe. I will not go into much more detail about the Kalman filter as you can read about it separately.

Script Notes

When setting up the script I had to account for the fact that we only had heart rate data that was calculated using 10 seconds of data. The reasoning for 10 seconds of data is because it is most appealing to the end user who generally would not want to to press their finger into the camera for long periods of time. Thus, all data had to be normalized/projected into minute readings. If you read the other post, you would know that the HR readings were obtained per second. This script is setup to obtain the size of the HR vector (seconds), and iterate each measurement through the Kalman filter as if each were a minute reading for an hour time frame. In other versions of this script, if the reading time does not hit 10 seconds projections will be made and added to vector to accommodate. The starting temperature has to be given and for this project was assumed to be 37.1 C (98.8 F). The rest of the script references the Kalman filter set up for this. While I had to make many more assumptions then I would have liked, it does works for a small personal project like this.

Conclusion

While I made much more assumptions then I would have liked, I must say that this was very fun to build.I have been able to adapt this functionality for many other ideas I have. If you want to see those, please check out my GitHub!  This concludes this three part healthcare series.

About This Script

Please click the link below to see this script.