Traveling by motorcycle is an exhilarating and unique experience. From the open roads to the stunning landscapes, there are many benefits to traveling by motorcycle that make it a top choice for those looking for a new and exciting way to explore the world, or just a way to cut down on costs at the gas pump. And with gas prices being what they are, the 40 to 80 miles per gallon that a typical motorcycle averages does sound more appealing than ever.
Riding a motorcycle is not all freedom and exploration, however. In fact, recent reports indicate that motorcycle accidents have been on the rise in recent years, leading to an increase in injuries and fatalities. In the United States alone, there were over 4,000 motorcycle deaths in 2020, a 10% increase from the previous year. Furthermore, motorcycle accident injuries have also seen a significant increase, with over 100,000 reported injuries in 2020.
With little between the rider and the road, it is unsurprising that motorcycle accidents can be especially severe. Unfortunately, that means that in some cases, those involved in a crash are physically incapable of making a call for help. And that results in a delay in the delivery of emergency medical treatment, which can make the difference between life and death.
A forward-looking duo of engineers, Sobhit Panda and Pratyush Mallick, took a look at the technology landscape of the modern world, with intelligent algorithms and wireless connectivity built into seemingly everything around us, and thought that there had to be a better way to send help when motorcycle accidents occur. Unsatisfied with any current solutions to the problem, they decided to build a proof of concept device of their own.
The team designed and built a smart helmet that can capture motion data while it is worn. That data is continually fed into a neural network classifier that was developed with Edge Impulse Studio. This machine learning algorithm is able to recognize normal riding behaviors, and distinguish them from crashes. If a crash is detected, a call for help will be automatically made using cellular networks.
This sounds like a very complex set of requirements to support, but it was all handled with a small amount of inexpensive, off-the-shelf hardware. A Blues Wireless Feather Starter Kit for Swan was selected to handle local execution of the machine learning analysis pipeline and wireless communication via LTE networks. This kit includes a Swan STM32L4-based development board with an Arm Cortex-M4 CPU running at 120 MHz and 640 KB of RAM. An Analog Devices EVAL-ADXL355Z accelerometer gave the device the ability to capture movement. All that remained was to hook it up to a 1,000 mAh Li-ion battery for power. The components were then fitted inside of a commercial helmet.
A neural network does not know much of anything until it is trained for a specific purpose, so Panda and Mallick needed to collect a dataset from their accelerometer before going any further. A nice feature of the Blues Wireless Notecard, that is a part of the starter kit, is that it can be used to wirelessly transmit sensor data directly to an Edge Impulse Studio project. After a quick setup process in the Blues Wireless Notehub.io web application, the link was created. Panda jumped on his bike and went for a ride, and by the time he got back home, the dataset was ready. Specifically, data was collected to help the model understand three states — being idle, normal riding, and a crash. As you might expect, Panda could not actually spend an afternoon riding around crashing his bike, so he had to act it out the best he could, which should suffice to prove the concept.
At this point, a simple impulse was created in Edge Impulse Studio. Preprocessing steps slice the accelerometer data into windows, then flatten it. This serves to minimize the computational resources that the pipeline requires, and is also known to perform well when dealing with slow-moving averages, such as those that are seen with motorcycle riding data. This data was then fed into a neural network classifier that would be trained to distinguish normal activities from crashes.
The model training process was initiated, and a short time later the results were presented. It was found that the model was classifying data correctly over 99% of the time. Not too bad for a first pass! It is important, however, to make sure that such a high level of accuracy is not the result of the model overfitting to the training data. To check for this possibility, the more stringent model testing tool was used. Using only data that was excluded from the training process, this tool revealed that the classification accuracy was better than 88%. That is more than sufficient for a proof of concept, so the pipeline was looking ready for deployment.
By deploying the model to the hardware, any dependencies on cloud computing resources (and the privacy concerns that come with using them) are eliminated. Edge Impulse Studio offers many options for deployment — in this case, the “Arduino library” option is very well suited to the task. This packages up the entire machine learning analysis pipeline into a library that can easily be flashed to any device (such as the Swan MCU) that is supported by Arduino IDE. This option also gives the flexibility to add one’s own logic — for example, to send a message to emergency services via cellular networks when a motorcycle crash has been detected.
Having finished construction and programming of the device, Panda tested it out to see how well it performed in the real-world — albeit with simulated crash scenarios. It was demonstrated that the device was accurately detecting each state, as would be expected given the validations that were previously conducted. It was also shown how an automated text message could be sent the moment a crash occurred.
The team is presently exploring ways to improve their invention. They would like to see if they can reduce the device’s power consumption by looking into some of the low power states of the STM32L4, for example. They are also considering the possibility of installing solar panels to recharge the smart helmet. If you would like to learn more about the construction of this smart helmet, plenty of details are available in the project's write-up.
Want to see Edge Impulse in action? Schedule a demo today.