# The algorithm is Hövding’s brain and spine

How does a Hövding airbag know when to inflate? What is it that reacts and triggers this to happen? The short answer is AI. The long answer is an infinite mass of programming hours, tests and analyses that have led to the creation of the algorithm that activates the process. So, how does it work?

The algorithm works, in many ways, like a brain. In the event of an accident, Hövding’s motion sensors send signals to the algorithm that interpret and analyse the change in position, all at lightning speed. If the algorithm indicates that an accident is happening, it reacts like a spinal cord reflex, inflating the airbag. The entire process takes no more than 0.1 seconds.

‘An algorithm is that it is like a recipe.’

What exactly is an algorithm?
The most common analogy to describe an algorithm is that it is like a recipe, i.e. a list of instructions that you (or in our case, Hövding) follow to achieve a desired result. When it comes to cookbooks, a professional baker might have an idea, think up a recipe, and test the recipe over and over again with different amounts of ingredients to finally create a delicious pastry. In the case of Hövding, it is our algorithm developers who have written the recipe and baked the cake.

Real accidents are the source
So where does all the accumulated data which defines the algorithm come from? Viktor Andersson and Daniel Pettersson are algorithm developers at Hövding. Viktor shares:
– When the algorithm was programmed for the first time, we started by using real data on accidents, as we always do. We simulated these bicycle accidents in a film studio, where different stunt people wear a prototype of Hövding and then fall, crash and get hit in front of the camera.

‘Different stunt people wear a prototype of Hövding and then fall, crash and get hit in front of the camera.’

These tests must be performed with exact conditions in order to test all the conditions and events that could occur during an accident. Hövding uses advanced motion sensors that send signals about any change in position. A simple example of this type of motion detection can be found in your phone when you turn the screen to a horizontal position.

Each accident was filmed, and data was analysed in detail in order to optimise the “recipe” that Hövding must follow when responding to an accident scenario. It is also important to be able to define in the algorithm the cases in which Hövding should NOT inflate. As such, we asked volunteers who cycled over thousands of hours to report their normal movement patterns to us. The algorithm has been tailored to define what constitutes an accident and what does not.

There are different sets of data, nonetheless
During a bike ride, data from motion sensors are used to control your Hövding. If you have Hövding connected to your mobile, GPS data is also generated as you ride. We share this data with traffic researchers and city planners to help them better understand the needs of cyclists. In this way, Hövding offers proactive protection that reduces accidents and makes cities more bike-friendly by identifying traffic problems and accident-prone places. Viktor states:
– In Denmark, researchers at the University of Copenhagen were able to identify a number of cycle paths where red lights were optimised for cars, meaning that cyclists had to stop at every red light. Based on our data, researchers were able to issue a request to the city council to change this.

‘A lot of time is spent testing and retesting.’

The majority of the algorithm that was developed for our very first Hövding is still in use for today’s Hövding 3. As we further develop the algorithm, it’s all about fine-tuning the way it works by testing a new thought or idea. Daniel explains:
– A lot of time is spent testing and retesting. If we turn this lever, what happens? If we DON’T turn it, what’s the result? Is nothing happening, or did it get better?

That is how the whole process of development works. It is based on an idea, and the data collected is used to test this idea. If it doesn’t work, the developers will go back and try other ways. Viktor concludes:
– The algorithm currently used in each Hövding has been developed and adapted for “regular” cycling. Ongoing development means that we are looking at the possibility of using the algorithm in other areas. As a result, new tests and additional data collection may be needed in order to tailor the algorithm to other types of accidents.

READ MORE: How we test Hövding