How Apple Watch uses deep learning to estimate Vo2Max


When you get your VO2Max measured in the lab, you have to wear an oxygen mask. How do devices like Apple Watch, Pixel Watch, and Samsung estimate cardio fitness using just heart rate and GPS?

The answer involves combining physiological ODEs (ordinary differential equations) with deep neural networks. The result is that VO2Max can be estimated to accuracy of about 4%, without requiring a mask.

This is a technical deep dive into a published 2023 paper from Apple about estimating VO2Max. If you just want to get a VO2Max measurement on your watch, understand the accuracy of Apple Watch’s cardio fitness algorithm, or improve your VO2Max, start with these posts:

Background: how VO2Max is measured with an oxygen mask

First, if you’re not familiar with the science behind VO2Max testing, read our primer on how VO2Max is measured in a lab. The rest of this post will assume knowledge of how VO2Max testing with a mask works.

How Apple Watch calculates VO2Max using heart rate and GPS

The next section explains the science behind Apple Watch’s VO2Max estimation algorithm. We’ll start by describing some simple calculators in the medical literature, which will lay the intuition for the more sophisticated physiological ODE and deep neural network published in 2023 by researchers from Apple and Columbia University.

Let’s start with some intuition. If you wanted to estimate VO2Max without actually measuring O₂ and CO₂, how would you do it? You can make use of two facts:

  1. Heart rate and O₂ are proportionate: as your heart rate increases, you’re consuming more oxygen.
  2. You can estimate work (in watts) if you know the person’s pace and body weight.

The medical literature includes some simple calculators based on these two principles. Let’s start with a common one, the Rockport fitness test.

A simple VO2Max calculator: the Rockport test

The Rockport fitness walking test was proposed in 1987 to estimate VO2Max. Subjects performed multiple 1-mile walk tests as fast as possible. The heart rate and completion time were placed into a linear regression, which yielded this formula to calculate VO2Max based on each subject’s weight, age, sex, fastest time, and heart rate:

VO2max = 6.9652 + (0.0091weight) - (0.0257age) + (0.5955sex) - (0.2240time) - (0.0115*heart_rate)

The accuracy was good (r=0.92 in the initial study). As we’ll see in the next section, Apple appears to be build on the scientific basis of the Rockport cardio fitness test—heart rate response to exercisee—but with a vastly more sophisticated algorithm.

Physiological ODEs and neural networks for VO2Max estimation

Note: this next section dives into the math, and some background in neural networks is helpful.

In 2023, researchers from Apple published a paper on using biophysical ODEs for fitness estimation using wearables, alongside an open source repo with some Torch neural networks. This gives a climpse into how modern deep learning algorithms can be used to improve upon the basic science of the Rockport test.

Biophysical ODEs for cardio fitness

The paper defines heart rate and oxygen response to exercise using a set of ordinary differential equations (ODEs):

Biophysical ODEs to describe Apple Watch heart rate and VO2 Max

Here, I(t) is exercise intensity at time t, f(I(t)) is the instantaneous demand for oxygen, D(t) is oxygen demand at time t, and HR(t) is heart rate at time t. A, B, alpha, beta are learned parameters.

The first equation tells us how the oxygen demand changes over time to match the instantaneous demand from the intensity of the workout. The second equation tells us how to drive heart rate toward the pace required to meet that oxygen demand. The parameters A, B, alpha, beta, and so on are different for each person. Together, these parameters describe how fast the heart can adapt (A), how fast oxygen demand adapts to the current exercise intensity, how difficult it is to reach the maximum heart rate (beta), and how much time it takes to rest down to the resting heart rate (alpha).

The seven physiological parameters in the ODE—A, B, alpha, beta, f, HRmin, and HRmax—represent a particular person’s overall fitness. If you can estimate those parameters, then you what you have is a snapshot of their cardiovascular health.

Neural networks to estimate physiological parameters

Rather than estimate these parameters directly, the researchers trained a neural network that predicts a person’s entire heart rate response to exercise given a latent vector z. The paper doesn’t specify z’s dimension, but in the open source code z is a 32-dimensional vector.

Neural encoder for physiological parameters Then, they trained an additional set of neural networks to predict each physiological parameter as a function of that latent vector: A(z), B(z), alpha(z), beta(z), and so on. By combining ODE with a neural network, we end up we a model that’s both interpretable yet robust to real-world noise.

These physiological parameters were then fed into a linear regression to predict VO2 Max. The error was about 5% (not bad). What’s interesting is that the model is interpretable as a result of going through the physiological ODE. For example, you can see an obvious correlation between the predicted A, B, alpha, and beta and VO2 Max in the plots below:

Apple Watch ODE vs VO2Max

Accuracy of Apple Watch cardio fitness (VO2Max)

So is it accurate? Yes. We covered the accuracy of Apple Watch’s cardio fitness algorithm and how it was tested on a separate page.

Join 2k+ people already on their way to better health.

Download for iOS