Running speed on the Bangle.js 2, inferred by tf #8037
Replies: 2 comments 2 replies
|
Just in case others missed it, the link to this is: https://github.com/baldursigurds/prec This looks really cool. The Run/Run+ apps are configurable and use a library called Let me know if there's interest and I could add that. ... then the OSM map + stats app could be a general purpose running app using exstats and could run with/without
Sadly not really - there's 64mb, but given the relatively slow upload speed (and lack of headphones + Bluetooth Audio) it doesn't seem very worthwhile.
Not initially but there may be an off the shelf one we can make work - or you could just use your old Bangle.js 2! |
Can this work with basically any device that would export accelerometer values over BLE? I don't have Polar H10 but other chest HRM which only has HR data and not accelerometer but I could wear other device with accelerometer - either exporting it over BLE to Bangle or even directly running Espruino and possibly the tensor lite model on the same device with accelerometer. Sadly I don't have anything that measures the speed accurately for training data except maybe the phone? Can android phone with some app produce accurate speed data when running? But then the whole training could run on the phone either with builtin accelerometer or the real device that one would wear when running connected over BLE. |
Uh oh!
There was an error while loading. Please reload this page.
I have mentioned running speed here at some point, and decied a while ago to start working on inferring it from accelerometer data. I have a Polar H10, which works perfectly with the Bangle.js 2 running app. Unfortunatly, the gps speed in the watch in not super reliable. However, I have a garmin device which gives a better value for speed. The only thing needed is to gather data from the accelerometer on the H10, label it with speed from the garmin, and you'll have a trained neural network telling you your speed. Using code I put together, we can do this in the following steps (I had started writing this code by hand, but there were enough time consuming obstacles to make this seem like it would take forever. The code in this repository was written this weekend using claude). There is a ton of documentation in the repository by design, but feel free to ask any questions.
Step one, go for a run and gather data (I have several datasets already). Option one is to connect the Bangle.js 2 to the Polar while running using the prec app (make sure that the recording box in settings is ticked). This takes care of the acc data, labelled with time from the watch. Record your speed in some way. I take my garming with me, it produces a .fit file with speeds, labelled with time. It is good to use gps time on both watches so that they sync up, more or less.
Another way to get the acc data is using an adafruit feather with an adalogger with an sd card, useful for longer runs (>1.5h). The firmware is available in the repository, it opens a control channel for the bangle app, which also displays inferred speed using a model, if you have one installed on the adafruit (look forward to the 64mb on the Bangle.js 3, making the sd card unneccessary).
Sync the data over to the computer. For this, copy the .fit file into the prec gps folder (~/prec/gps) and use the prec-tui to sync the acc data over to ~/prec/data. It connects directly to the bangle or feather.
Then, there is the laborious part, labelling the data. First, make sure that the two timelines (acc and gps) are aligned. Second, the models are a classifier, to tell if you're running, walking, still or stretching, as well as running and walking speed models (the latter two classes assume speed to be zero). From prec-tui you can open a gui making the marking intervals of running, walking, etc easy.
Now you have labelled data, so train models on them. In the repo there are two designs for speed, a dense one (including an fft step) and a conv one, but other designs can be specified. All this (minus designing new models) can be done by pressing buttons in prec-tui, where hyperparameters can also be specified.
Finally, install the new models. They are exported and uploaded to both the bangle and adafruit from prec-tui. Goto step one :D
There are then two further projects which spring from this one:
Firstly, are there any runners running with their Bangle.js 2 and a Polar H10 willing to share some acc data? I am training with my own data, and the results seem pretty good, even if there are still some refinements I would like to make. Having a more diverse dataset, however, would just possibly make this work for anyone out there without them having to record their data with just a Bangle and a Polar H10. That would be fantastic.
Secondly, the prec bangle app was designed to be a shell around a prec module. I imagine having a running app with many modules and switching between the screens (look forward to the Bangle.js 3 with more buttons). These would include
All reactions