Motion Recognition for Fitness on Android Wear
Article Summary
Edward Dale from Freeletics shows how a simple peak detection algorithm can count pushup reps on Android Wear with surprising accuracy. The secret? Freeletics-style pushups include a hand lift that creates a perfect acceleration spike.
This deep dive from the Freeletics engineering team tackles the challenge of automatically counting exercise repetitions on wearables. Rather than solving the broader problem of recognizing any exercise, they focus on a constrained use case: counting reps of a known exercise in real-time using accelerometer data.
Key Takeaways
- Peakdet algorithm counts pushups with zero transcendental functions for battery efficiency
- Hand lift in Freeletics pushups creates measurable 40+ m/s² acceleration spikes
- Delta parameter tuning is critical: wrong value doubles false positives
- Sensor sampling at 15Hz balances accuracy with wearable battery constraints
- Online algorithms process data as it arrives, no post-processing needed
A lightweight peak detection algorithm running at 15Hz can accurately count pushup reps on Android Wear by detecting hand-lift acceleration spikes, proving that constrained motion recognition problems don't need complex ML solutions.
About This Article
Edward Dale's team had to figure out the right delta parameter for the peakdet algorithm. When they used delta=20 instead of delta=40, false positives doubled for the same user, which caused real detection problems.
They built a Java version of the peakdet online peak detection algorithm that doesn't need transcendental functions. This kept the computational load low while handling accelerometer magnitude data coming in at 15Hz sampling intervals.
The calibration problem isn't fully solved yet, but the team showed that tuning delta for each user could fit into workout flows without interrupting the experience. This approach kept rep counting accurate on devices with limited battery.