ArchiveP-09Research prototype

FITNESS EKF — Core Temperature via Extended Kalman Filter

Fitness EKF2024

A research tool that estimates core body temperature in real-time by applying a custom Extended Kalman Filter (EKF) to heart rate data streamed from a Polar heart rate monitor — a non-invasive alternative to clinical thermometry, built in collaboration with Dr. Udayraj.

Role

Algorithm Engineer & Research Developer

Year

2024

Category

Health Tech / Research

Tech Stack

Python
MATLAB
Extended Kalman Filter
Google Fit API
Polar Heart Rate Monitor
Signal Processing
NumPy
Pandas

The problem

Note · 01

Measuring core body temperature accurately requires invasive probes or expensive infrared equipment. The challenge was to build a reliable, non-invasive estimation pipeline using only heart rate — a signal that has a known physiological relationship with thermoregulation but is highly noisy and context-dependent.

The approach

Note · 02

Designed a custom Extended Kalman Filter that models the nonlinear relationship between heart rate and core temperature, with separate exercise and recovery phase models. Heart rate data is streamed live from a Polar monitor via the Google Fit API, minute-averaged to reduce noise, and fed into the EKF pipeline. The filter dynamically switches between quadratic models based on delta-HR direction, producing smooth, calibrated core temperature estimates.

How it was built

Milestones from concept through delivery.

Reviewed literature on the physiological coupling between heart rate variability and thermoregulation

identified the quadratic HR — to — CT relationship as the modeling basis.

Prototyped the EKF model in MATLAB (Proposed_EKF_model.m) to validate the filter equations and coefficient fitting on collected exercise data.

Implemented the full pipeline in Python

Google Fit OAuth2 authentication, real — time HR data ingestion from the Polar monitor, and minute — averaged preprocessing.

Built the EKF core (ekf_model.py / heartrate_2.py) with dual

phase switching

exercise model (delta-HR ≥ 0) and recovery model (delta-HR < 0), each with tuned quadratic coefficients.

Validated estimated core temperatures against clinical thermometer readings across varied activity intensities with collaborator Sai Kamal Nannuri.

Impact

Collaboration with Dr. Udayraj, IIT Bhilai
Custom EKF with dual-phase exercise/recovery switching
Live heart rate ingestion from Polar monitor via Google Fit API
Non-invasive core temperature estimation (±0.3°C target accuracy)
MATLAB prototype + Python production pipeline
Applications in sports science, occupational health, and heat stress monitoring

Visuals

ECG Signal — Heart Rate Monitor

Live ECG trace captured from the Polar heart rate monitor — the raw input to the EKF core temperature estimation pipeline.

EKF Output Display

Real-time core temperature estimates rendered on screen — the Extended Kalman Filter output converging to clinically relevant values.