No GPS required: our app can now locate underground trains

(blog.transitapp.com)

Comments

rossant 13 November 2024
Maybe ten years ago, I read a blog post by, I think, a French company called snips, that explained how their app used the pressure sensor to detect when the train entered or leaved a station. It turned out there was a very clear signal due to the sudden pressure increase or decrease when the train entered or left the tunnel between the stations.

Edit: found it. https://medium.com/snips-ai/underground-location-tracking-3e...

dmazin 13 November 2024
This is SO cool.

I am actually currently working on a project to record the sound of the London Underground passing under me.

We can very clearly hear the Northern Line under us. It's < 30 meters below us.

I have become obsessed with getting high-quality, low frequency recordings of it passing under us.

Why? I don't know. I just can't take my mind off it.

For example, there are two tunnels (north and south bound). By correlating it with actual TfL data, can I figure out the sound signature of each?

More intriguingly, I know that there are maintenance vehicles that operate under us in off hours. Can I "catch" them?

I'm not sure what else I might do with this project, but the idea of capturing the sound of this semi-ephemeral creature that operates below me has captivated me.

ripe 13 November 2024
Can we take a moment to appreciate the engaging, conversational tone of the writing? The article was a pleasure to read, even when it gets into some weeds explaining the frequency charts, etc. (I read the English-language version).

Whoever wrote this did a fantastic job.

wffurr 13 November 2024
"Classifier" how quaint. I am impressed that they wrote the whole article without mentioning "AI" one time.
mdergosits 13 November 2024
Some cities will put BLE beacons in tunnels that transmit the location and then you can find your location via the strongest beacon signal. This seems like a nice way to figure that out without installing hardware!
modeless 13 November 2024
Seems like you could do a better job of tracking progress between stations by detecting the specific acceleration signature of each segment of track. At least for tracks that are not completely straight and level. Somewhat similar to the first primitive in-car navigation systems before GPS, that worked on dead reckoning with drift correction by matching the shape of the measured path to map data.
zephyreon 13 November 2024
As a user of Transit (thank you for such a great app!) this was always one of my biggest annoyances. Not just transit though — with any app that supports navigation on public transit (looking at you Apple Maps).

I figured someone was working on this but it’s so refreshing to read about the thought and level of detail that went into your design. What an effort too! Congratulations transit team, you all should be so proud for solving what I’d imagine is one of transit’s largest small gripes.

scottbez1 13 November 2024
This is super cool! As a regular BART commuter I always thought it'd be fun to try and build a location classifier based on the screeches in different tunnel locations, but using accelerometer data is probably much more practical.
333c 13 November 2024
I used this feature in the New York subway last week. I didn't know it was new. It's a cool idea, but it didn't work for me. The app said that the train was several stops behind its actual location.
devit 13 November 2024
Wouldn't dead reckoning with the accelerometer and gyroscope in addition to their machine learning improve this significantly? (constraining motion along the known tunnel path when in a moving train, constraining the user to be within the train stopping rectangle when detecting a train starting to move)

Or is the hardware in smartphones too inaccurate even with the extra information?

mjamesaustin 13 November 2024
This is one of the best apps I've ever used, and I'm excited to see it's only getting better!
dietr1ch 13 November 2024
This is really cool.

Sort of related, what I find kind of silly, is that my car probably knows really well where I am, but can't help my phone figure out where my car is pointing to despite being connected to it.

daghamm 13 November 2024
Correct me if I am wrong, but this looks like something that Google would buy for 3.14B and quietly roll out to anything including your smart toaster.

My point is, I see only one real business case for this.

__MatrixMan__ 13 November 2024
Oh thank goodness. I knew I buried a train somewhere around here but I just can't find it.
sailfast 13 November 2024
I appreciate that this is not a mass surveillance play and all of the data stays on your phone. Well done!
barbegal 13 November 2024
With this sort of tech it only achieves good usability if it is accurate a high percentage of the time. Anything less than 90% accuracy on a whole trip and I likely won't trust it. So that means getting to >99% accurate on each underground train stop. I'm still not sure if this tech reaches that sort of threshold or if this is one of those things that looks like a good idea on paper but falls apart in real world use cases.
clarkmoody 13 November 2024
Alternative title idea: "Instead of Reaching for AI, we used Good Old-Fashioned Engineering to Solve a Tough Problem"
brirec 13 November 2024
This was really exciting to read, but after trying it on four NYC MTA commutes (with one transfer on each commute, so a total of 8 different train rides) over the past couple of days I’ve given up on Transit App for now…

Yesterday night and this morning it kept telling me to get off the train either two early or too late, and this evening it didn’t even think I got on the L in the first place. The app even lightly scolded me for “missing” my train!

aeternum 13 November 2024
Why does the acceleration graph not take direction into account? Seems like you could get much cleaner data if you looked only at the directions orthogonal to gravity.
IIAOPSW 13 November 2024
A few thoughts come to mind. Some said others not.

1. Seems a bit weird to be looking at the accelerometer data yet miss the obvious approach of summing up the acceleration to get the velocity and then summing that up to get position. Yes I know about drift but even then I'd assume the fairly constant several-second g force of pulling in or out of a station or taking a curve would be a strong signal easy to distinguish from short lived jostling.

2. The "train moving" frequency you discovered via fourier analysis was most likely the hunting oscillation. This has to do with how the wheels of the train are designed to force it to turn opposite to any deviation from the direction of the track. Thus there is a back and forth "hunting" for the center that is completely determined by the geometry of the track and the wheels, and therefore the length of track per complete back-and-forth cycle (aka the wavelength) is constant. The frequency of the oscillation (aka back-and-forth cycles per second) is just this constant length divided by the velocity of the train. This fact could be leveraged to estimate the actual train speed rather than just moving/not moving.

3. Combining 1 and 2, a combination of integrating acceleration and confirming / correcting estimated velocity with the expected hunting oscillation would likely be the most powerful / reliable model.

4. Using a classifier seems overkill here. But I'm sure at some point it was easier to just raw-data it than work out a theory driven model which accounted for all the practical confounding factors.

grav 13 November 2024
Very impressive. Also interesting that the motion type prediction ("is this a moving train?") generalizes to underground trains in other cities.

I see they support the the largest cities in Sweden and Norway, wonder if there are any plans for Copenhagen, Denmark?

tgtweak 13 November 2024
I think you can "spoof" gps satellite timestamp transmissions with single transmitter inside the train. This would require on-train equipment but typically the trains know where they are and could translate that into the required gps satellites and timestamp signatures to allow any devices onboard to acquire a "gps" signal and decode the location using timestamp variation.

I don't believe any of those are encrypted and transmit ~1000-10000 time per second on 1500-1600mhz spectrum which is fairly simple to reproduce using even a cheap SDR kit.

It could also work with 0 input from the train's telemetry - in much the same way as the app - the device would get a reference gps signal (or wifi/BLE when it knows it's in the station), then with a built-in accelerometer (which it has the luxury of direction + stability if it's mounted in the train car) it can determine with greater accuracy where the train is and how far it's moved.

isaacfrond 13 November 2024
Anybody know what model architectures they used?

The motion detection might be a convolutional network or an svm. The mixer model perhaps a classic neural network.

fullofstack 13 November 2024
Is GPS spoofing an option, underground? Would instantly work on all phones.
ekzy 13 November 2024
Could you also pick up the audio announcements? Could be weird for the app to request microphone permission though, but I think lots of lines have them and should be doable to transcribe them locally on the phone. I think your approach is better and simpler, but as I was reading the edge cases (like someone changing train and going back in the other direction), the audio could maybe help getting from 90% accuracy to 98%. Sounds a bit more involved to implement though.
alkonaut 13 November 2024
I visited London this weekend and found even many underground _stations_ were without mobile service, 15 years after I got used to having spotless end-to-end mobile coverage even in deepest tunnels. I don't know why the London Underground lags that of other cities?

Knowing the next station is usually a solved problem that doesn't need a smartphone, because that's displayed in the train itself and called out on speakers. But once you are on the platform and you need to ask the route planner what the fastest route is to a specific station (It could be walking to the surface and taking a bus, so it's not as simple as looking at the subway map) - then you are out of luck if platforms don't have 4/5G coverage!

aitchnyu 13 November 2024
Tangential, why dont phones use accelerometer+gravity to figure out the path travelled and the "plane" its on when gps is out? Somehow my running app knows my stride length but may refuse to count the distance travelled when gps was out.
MagicMoonlight 18 hours ago
I thought it was just going to count the stops to figure out where you are. If it has stopped 12 times then you would assume the next stop will be the 13th stop. Then you’re not reliant on schedules.
bsimpson 13 November 2024
I live between stations. One is a nicer walk; the other is a shorter walk. I check the next train when I leave to see which station to walk to.

Would be useful if I could teach this to your app.

yonran 13 November 2024
> It now makes the right location prediction 90% of the time.

I’m curious about the failure cases. Are they caused by exceptional circumstances, such as the train moving more slowly than normal or skipping a station? Or when you unexpectedly catch an express train or go the opposite direction? Does the algorithm know that it doesn’t know where you are, or does it confidently tell you the wrong station until the GPS is acquired?

admax88qqq 13 November 2024
I find the bus tracking of this app in my city is pretty poor unfortunately. Probably not the apps fault probably an issue of the municipality but still annoying.

That being said, if this app could convince cities to also be used for payment that would be a game changer. Uber for public transit would really remove so much friction from using transit.

armada651 13 November 2024
Why all the complicated detection? The user already knows whether or not they are on a train, you don't need to tell them.

Just show the predicted location of the train they should be on separately from their last known GPS position. Of course it would be difficult to market that alone as a novel innovative AI feature.

svag 13 November 2024
This is a very interesting article. I suppose something similar can be made for vehicles entering a tunnel, where eventually will lose the GNSS signal.

I have noticed that a year ago or so, Google Maps app would lose the GNSS signal and stop updating the position while there was no signal. But now I have noticed that the position is updated, although is not accurate. I wonder if something similar has been implemented...

CarVac 13 November 2024
I'm trying this out literally right now and it got fooled by an unscheduled stop due to train traffic. It thought we were already at the next stop and took a bit to get its bearings again.

At least in NYC it should listen for door beeps.

mattlondon 13 November 2024
Just tried installing it on my commute in London. Didn't work - in fact it thought I was at the stop before the one I got on at (when I did have GPS) even when I was 5 or 6 stations further along on my journey. Then it spent the whole rest of the journey spamming me with notifications about the next departure time at the station I didn't get on at.

Wildly inaccurate even with GPS it seems.

Instant uninstall. Sorry.

tdiff 13 November 2024
I believe Yandex does smth. similar in their navigation in Moscow, because GPS is heavily jammed in some areas.
voidUpdate 13 November 2024
I'm still a little confused as to how this shows where a train actually is, it seems like this is only a solution to know when you're on a train or not. Does it just guess based on what trains should be moving at that time?
eps 13 November 2024
There are metro systems where trains sometimes stop in the tunnels or go at slower speeds.

I'm guessing this app won't work that well there. In fact it would probably generate false positives when labeling stations... ?

DrNosferatu 13 November 2024
Nice! dead reckoning to another level (Y)

ML level - for some reason, made me think of ITER / fusion research trying to predict plasma behavior with ML also. Any specific connections people in the know care to point out?

nycerrrrrrrrrr 13 November 2024
Great article, I'll have to try it out next time I'm on the subway.

One correction though - there is no subway line that goes across the Queensboro.

snodnipper 13 November 2024
I worked for signalbox.io and they had this for the London Underground ~8 years ago. There was some impressive maths / approaches behind all of the "magic".
elromulous 13 November 2024
Citymapper has been able to tell you what stop you're at for many years (at least on the NYC subway). How does their solution work?
Avlin67 2 hours ago
this is dope. my chinese GF loves it so much. so impressive.
0xFEE1DEAD 13 November 2024
@OP how can I get my city added to the app?

I was excited to try it out but bummed to see my city isn't listed. It's even more disappointing considering Ulm Germany (with around 100k people) is there, but Cologne Germany (with a population of about 1.1mil) isn't.

There are lots of potential users here, especially since the official apps are aweful.

DrBazza 13 November 2024
Is this the same sort of technique that Shazam uses?
exabyte 13 November 2024
https://youtu.be/bFM9HHB9JXI

I found this to be a really well-done video on using quantum physics to track location integrating upon acceleration

lacoolj 13 November 2024
The timing of this post is nuts. I was thinking about a post-apocalyptic future last night (as one does) and wondered if using the gyro on your phone would suffice if the initial location and full map was already available.

I think the answer is still unclear since they are using pre-determined routes (easier to track east -> west or east -> southwest than it is east -> north -> south -> north -> east again). But this is very cool that they have so much of the work done already. Maybe even all of it? I don't have the code to look at so ¯\_(ツ)_/¯

Either way, still freaked out they read my mind lol

h1fra 13 November 2024
Oh they so going to get bought by Google
Woeps 13 November 2024
Uhm, Don't most underground trains already show you where you are? Or at worst, the sign of the station shows you your location?
jacooper 13 November 2024
Google maps(wuth google location service) is alao crazy accurate underground somehow.
ingen0s 13 November 2024
This is why I open this site everyday several times a day
starlite-5008 13 November 2024
Innovative
maxehmookau 13 November 2024
This is so freaking cool. What a fantastic idea and a great write-up.
riffic 13 November 2024
would love to use collective sensor data to shame operators who accelerate or brake too harshly. that's kind of my transit annoyance these days.
aucisson_masque 13 November 2024
Side note, that's why I don't like that the Google plays services in Android have a permanent access to Physical Activity that can't be disabled.

Even without gps data, just having access to your phone accelerometer is enough to give a lot of data about your life. Cumulated with Google insanely big amount of data about wifi access point location, it means that they know where you are even without gps activated and how you got there.

bambax 13 November 2024
Dead reckoning is... hard.

https://en.wikipedia.org/wiki/Dead_reckoning

The first car navigator, the Etak, came out in 1985 and used dead reckoning and quantization to tell where the car was on the map; see this excellent article from 2017:

https://www.fastcompany.com/3047828/who-needs-gps-the-forgot...

Today dead reckoning is used in aerial navigation, and commercial planes (and others) are equipped with Inertial Navigation systems to supplement GPS information; they are getting more and more precise but can still go wrong and need frequent re-calibration.

The next step is "Quantum Positioning System" that promises to detect infinitely small movements and produce perfect dead reckoning at all times, with a precision of the order of one centimeter. It has already been tested successfully. For now the machines are heavy and extremely expensive, but it's imaginable that in some not-so-distant future the technology will be much more available.

https://newatlas.com/aircraft/quantum-navigation-infleqtion-...

mateobelanger 13 November 2024
Test
gregoriol 13 November 2024
This is way too heavy computing, battery consumption, ... while fun engineering, it's very much inefficient to perform