Blog post

Arduin-Row, Row, Row Your Boat

Projects
By Nick Bild
Arduin-Row, Row, Row Your Boat

Competitive rowing for sport dates back thousands of years, at least to the ancient Greeks and Egyptians who would perfect their skills for races and festivals. Owing to the physical development and technical skill required to row well, the challenge of competitive rowing is still enjoyed by many to this day. Those who are serious about improving their skill often hire professional coaches to help them advance, because while just about anyone can row, few can actually row well. As you would probably expect, training sessions with professionals are quite expensive, and that means that many would-be rowers are, you might say, up the creek without a paddle.

Hardware hacker Justin Lutz enjoys rowing, and is familiar with this problem. As someone that has also worked with machine learning, and recognizes that such models can encode knowledge, he had the insight that machine learning may be able to serve as a sort of a rowing coach, but without the hefty price tag. This led him to grab some Arduino development boards out of his parts bin and try to prove that concept with the help of Edge Impulse.

Device attached to a rowing machine handle

Lutz’s theory is that by capturing a rower’s movements with an accelerometer, he should be able to train a machine learning model to recognize when they are, and are not, rowing with good form. And by detecting certain conditions, it should also be possible to provide feedback that can help the rower get on the right track… much like a real coach. He got started by assembling the hardware. An Arduino MKR WiFi 1010 board was chosen as the base of the build for the Wi-Fi connectivity that it offers. The Arduino Nicla Sense ME was then connected to that board to provide an accelerometer and gas sensor. The gas sensor was used to track CO2 levels, which is meant to give rowers additional information about their performance and activity level. After assembling the hardware, it was taped to the handle of a rowing machine.

Before machine learning could be incorporated into the project, sample data needed to be collected. The Arduino device was linked directly to Edge Impulse Studio, then Lutz got down to business on a rowing machine, and the accelerometer data was automatically transferred to Edge Impulse. He performed a number of different activities, including rowing with a low number of strokes per minute, and a high number of strokes per minute. After a quick breather, Lutz headed over to Edge Impulse to get the machine learning pipeline built.

The completed machine learning impulse

In designing the impulse, a preprocessing step was added that performs a spectral analysis of the accelerometer data. This serves to bring out the most important and relevant features in the input data. Doing this upfront will take a bit of the load off of the downstream algorithms, and will also help to improve model accuracy. These features were then sent to a pair of machine learning models — a neural network classifier and a K-means anomaly detector. The classifier is capable of recognizing when a rower is performing an action that it has been trained to recognize. The anomaly detector watches for anything out of the ordinary — in that way, it can tell a rower if their form is off, without having to have been trained to recognize all of the ways that someone can go astray.

The models were trained, and then evaluated by Lutz with Edge Impulse Studio.  The classifier achieved a very impressive average classification accuracy of 98%, and the anomaly detector was also performing as expected. With these great results, the model was ready to be deployed to the physical hardware so that there would be no latency associated with running inferences in the cloud.

No extra charge for this nagging!

Edge Impulse has the option to deploy the full machine learning analysis pipeline as an Arduino library, which was very simple for Lutz to integrate into his project since he was already using Arduino IDE. With a few clicks, the models were up and running on the device. But wait, there must be more because machine learning is hard, right? Nope, that was all Lutz needed to do to bring the power of machine learning into his project.

At this point, all that was left for Lutz was to add the logic to his Arduino sketch to provide coach-like advice based on the results of the machine learning algorithms. This advice was delivered wirelessly to an Arduino IoT Cloud Remote app. Thanks to this device, you can now have the pleasure of being yelled at about not pushing with your legs without getting a bill for the service.

On testing the completed device, Lutz was surprised to find how well it worked, considering that he built it so quickly and with minimal difficulty. Do you want to improve your own skill in rowing? Or perhaps you would like to adapt the idea to another sport or activity? Grab your workout gear and read up on the project documentation to learn how you can.


Want to see Edge Impulse in action? Schedule a demo today.

Comments

Subscribe

Are you interested in bringing machine learning intelligence to your devices? We're happy to help.

Subscribe to our newsletter