It just happens that strong accelerations of a vehicle in a closed tunnel creates something called the Venturi effect, that explains how variations in speed can induce variations in pressure. By looking at the pressure measured by your phone, you see that it systematically drops when the metro accelerates, and comes back to its original level when the metro slows down.

Counting stations

After we realised the signal was clean, we decided to take the experiment a step further. We decided to explore the possibility of using pressure to count the stations, in order to warn the user who is dozing off during his daily commute that it is time to get off the train. By using a peak detection library, we managed to get over 90% accuracy in counting stations over time. See the black dots on the previous figure, for reference.

Probabilistic location tracking: your underground GPS

Counting stations is a helpful feature for your daily commute, or when you know where your user is going. This is probably the method that Citymapper uses to tell you when to get off the metro. But we wanted to go a step further, and use the barometer to detect which metro line the user has taken, and which direction he’s heading to. In other words, once we’ve been able to detect when the metro starts and stops, we wanted to know if it was possible to use the duration of each trip to identify the stations through which a user is going. We went to the closest metro station, Bourse, and tried it out. We made a series of round trips to Opéra, and back to Réaumur Sébastopol. Again and again, collecting data along the way.

When the user takes the metro at Bourse, can you tell which way he’s going by just measuring the duration of each trip segment? By using a simple Bayesian approach, it turns out that you can, after only two stops, with over 90% accuracy.

With that data, we reconstructed the distribution of trips’ durations, for each of the trip segments. Based on that, we built a Bayesian model that determines the probability that the user went into one direction or the other, based on the observed trip durations. By following this simple model, you get the answer right in over 90% of the cases, after only two stations.

Of course, you can bring this figure higher, or support more uncertainty in the data measurement process, if you accept to wait a few more stations to take a decision. In addition, this model is able to tell you when it doesn’t know. For example, here, the first trip segments in both directions typically last the same amount of time (43 to 52 seconds versus 45 to 53 seconds). In that case the probabilities will be very close, suggesting to the AI to wait another station to make up its mind.

There is more value in our data than you might think

To sum things up, your phone’s barometer will probably be key to bringing context awareness underground. You can now start expecting from your favorite apps to help you relax during metro rides, letting you know when to get off. You can expect your phone to identify your favorite routes, and keep you informed of potential perturbations. You can even expect navigation systems to guide you through an unknown metro network. Kind of an underground GPS, in a way. That’s yet another step towards the vision of ubiquitous computing!

What this story also tells us is that there is more value in your data than you might think. Two things to think about when a mobile application asks you for the right to access a new source of data:

What type of information does my data contain?

Can I trust the app with the information found in my data?

The example of your phone’s barometer shows that it can be very hard to perceive what information is contained in a given source of data. Thus, the best solution is to be very careful with the applications you entrust your data to. On that note, we are going to leave you with this last one thought: there is no reason to compromise on your privacy to get intelligence from your phone. At Snips, we are working on building advanced artificial intelligence systems while fully respecting privacy. For example, your barometer data would be processed directly on device, so that no one ever has access to it. Not even us.

That’s all, folks. Enjoy the wonders of context awareness, and remember: privacy-aware artificial intelligence is the future. Do not compromise, and enjoy the ride!