Moving joint angle tracking into the browser without losing the measurement

Moving pose inference off a server GPU and into the patient's browser removes the video upload, the retention liability and most of the inference bill. It does not remove the obligation that a knee flexion angle on a clinician's screen traces back to a validated method. Every line of the migration budget buys one of three things: lower latency, less privacy exposure or preserved measurement validity. The budget survives review only when each line says which one it buys.

What the old pipeline did for free

The server stack had one model build, one GPU class and the full clip available before any angle was computed, so it could smooth across a whole repetition and reprocess everything when the model changed. In the browser you inherit integrated GPUs, thermal throttling on phones and browser updates that alter WebGL behaviour without notice. That variety is the real cost line. You need a device qualification matrix and a revalidation of angles against goniometer or marker-based reference captures, and by our estimate that work takes about a third of the total migration effort. The payback shows up in two places you can check: the invoice, because server inference and clip storage disappear, and the privacy review, because no frame leaves the device.

Degrade per joint, not per session

The working parameter is a 33 ms per-frame budget, which is what 30 fps tracking leaves for inference, angle computation and rendering combined. The backend chain tries WebGPU first, then WebGL, then WASM with SIMD, and each step down gives up frame rate in exchange for keeping the session alive. The failure that hurts most is self-occlusion in a side-on squat or lunge: the hidden knee's landmark collapses onto the visible one, the computed angle jumps or mirrors, and real-time code has no future frames to smooth it away the way the offline pipeline did. The fix is to gate every joint on its landmark visibility, mark it missing while the gate is closed and keep scoring the joints that are still visible. The same logic covers the browser dropping the GPU context when a tab goes to the background. Session state is written to IndexedDB at the end of each repetition, so a context rebuild resumes the set instead of resetting the count.

The rule for every component

If a component's failure can change a number the clinician will read, it fails closed and the value is shown as missing, but if it can only change latency or frame rate, it fails open and the patient keeps exercising.

The part that hurts

Once angles inform clinical decisions, the software falls under medical device software lifecycle standards such as IEC 62304, and moving inference to the client means the device now includes browsers and GPUs you never tested. The cheaper route is to limit claims to exercise guidance, which cuts regulatory cost but means the output cannot be presented as range of motion measurement. Decide that claim boundary before anyone writes fallback code, because it determines whether the WASM tier's lower frame rate is acceptable for measurement or only for coaching. Finance should also know that the qualification matrix has to be rerun whenever browsers ship releases, not when your roadmap says so, so it belongs in the operating budget and not in the one-off migration line.

Can the WASM fallback tier be used for range of motion reporting?

Only on devices where it was revalidated at the frame rate it actually sustains. Everywhere else, label its output as coaching and keep it out of the clinical record.

Back to RehabAnalysis · Domains

← Back to RehabAnalysis
Engineering & Architecture Brief

Moving joint angle tracking into the browser without losing the measurement

Moving pose inference off a server GPU and into the patient's browser removes the video upload, the retention liability and most of the inference bill. It does not remove the obligation that a knee flexion angle on a clinician's screen traces back to a validated method. Every line of the migration budget buys one of three things: lower latency, less privacy exposure or preserved measurement validity. The budget survives review only when each line says which one it buys.

What the old pipeline did for free

The server stack had one model build, one GPU class and the full clip available before any angle was computed, so it could smooth across a whole repetition and reprocess everything when the model changed. In the browser you inherit integrated GPUs, thermal throttling on phones and browser updates that alter WebGL behaviour without notice. That variety is the real cost line. You need a device qualification matrix and a revalidation of angles against goniometer or marker-based reference captures, and by our estimate that work takes about a third of the total migration effort. The payback shows up in two places you can check: the invoice, because server inference and clip storage disappear, and the privacy review, because no frame leaves the device.

Degrade per joint, not per session

The working parameter is a 33 ms per-frame budget, which is what 30 fps tracking leaves for inference, angle computation and rendering combined. The backend chain tries WebGPU first, then WebGL, then WASM with SIMD, and each step down gives up frame rate in exchange for keeping the session alive. The failure that hurts most is self-occlusion in a side-on squat or lunge: the hidden knee's landmark collapses onto the visible one, the computed angle jumps or mirrors, and real-time code has no future frames to smooth it away the way the offline pipeline did. The fix is to gate every joint on its landmark visibility, mark it missing while the gate is closed and keep scoring the joints that are still visible. The same logic covers the browser dropping the GPU context when a tab goes to the background. Session state is written to IndexedDB at the end of each repetition, so a context rebuild resumes the set instead of resetting the count.

The rule for every component

If a component's failure can change a number the clinician will read, it fails closed and the value is shown as missing, but if it can only change latency or frame rate, it fails open and the patient keeps exercising.

The part that hurts

Once angles inform clinical decisions, the software falls under medical device software lifecycle standards such as IEC 62304, and moving inference to the client means the device now includes browsers and GPUs you never tested. The cheaper route is to limit claims to exercise guidance, which cuts regulatory cost but means the output cannot be presented as range of motion measurement. Decide that claim boundary before anyone writes fallback code, because it determines whether the WASM tier's lower frame rate is acceptable for measurement or only for coaching. Finance should also know that the qualification matrix has to be rerun whenever browsers ship releases, not when your roadmap says so, so it belongs in the operating budget and not in the one-off migration line.

Technical FAQ: Can the WASM fallback tier be used for range of motion reporting?

Only on devices where it was revalidated at the frame rate it actually sustains. Everywhere else, label its output as coaching and keep it out of the clinical record.

Related Architecture Specifications (DANCEGOAL): workoutgoal.com · fitnessdetect.com · merenguesteps.com