No GPS required: our app can now locate underground trains

(blog.transitapp.com)

1015 points | by dotcoma 2 days ago

58 comments

  • rossant 2 days ago
    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...

    • panick21_ 1 minute ago
      The Berlin Airport was ventilated by the train. But because the building was finished but not operational, for almost a decade the local train company had to drive trains in and out of the building.
    • coumbaya 2 days ago
      Another tidbit: on high speed trains (maybe on regular trains too idk) the 'door flange' which is actually a hollow pneumatic tube (it can detect spike in pressure that's how the train know it's trying to close the door on somebody's hand) get's pressurized higher before entering the tunnel, to mitigate the "slam" effect due to the difference in pressure.
    • 30blay 1 day ago
      Hi! Having worked on this project, I can provide some details on why we didn't end up using the pressure sensor.

      As others have stated, not all phones have pressure sensors, and the quality of the readings also varies a lot between different models. For example, we had one device where the readings would spike when squeezing the phone.

      Transit also doesn't have permission to read the pressure sensor, and our use case wouldn't justify asking for it.

      • WhyNotHugo 1 day ago
        Have you considered publishing the data gathered and/or the generated models?

        For others wanting to implement similar functionality, it would be great if they didn't need to re-do the entire work from scratch.

    • the-rc 2 days ago
      Even before that, there was a Google Maps experiment using the compass (magnetometer) to infer train movement, but IIRC the accuracy of that depended on the network's current (DC vs AC) and even the vintage of the cars.
      • mapt 1 day ago
        Thing about training sensor fusion algorithms - more sensors, more better. Often adding a terribly inaccurate sensor whose failures are uncorrelated with the ones you're currently using, because it operates on an unrelated principle, is the thing that makes the solution highly accurate.
    • LukaszWiktor 2 days ago
      Very few Android phones have a pressure sensor.
      • plantain 2 days ago
        • LukaszWiktor 2 days ago
          > Your search returned 653 results.

          When you remove the filter, it returns 12177 results. So only ~5% of phone models include a barometer.

          • yccs27 2 days ago
            That's all phones ever, not current/popular models. When you restrict it to the last 10 years, you get about 12%, and of the 70 most popular models almost a quarter are equipped with a barometer.
            • lolinder 2 days ago
              For an app as popular as Transit this is a purely academic exercise—25% of the most popular models is way too low to be worth building their detection around, even if they could assume that all of their customers use the most popular models (which they obviously can't).
              • stavros 1 day ago
                25% of popular models doesn't mean 25% of phones currently in circulation. If the iPhone has a barometer (which it does), that's already a huge share of phones out there.
                • lolinder 1 day ago
                  I'm in favor of Transit trying to reach more than 25% of the most popular phone models even if doing so would get them 75% of the population.
                • hluska 1 day ago
                  The conversation was about Android.
                  • azinman2 1 day ago
                    But the point stands, it’s about the distribution of phones not how many models support it.
              • michaelmior 1 day ago
                It may be too low, but I'd imagine the app could also look for other Transit users nearby and as long as one of them has the appropriate sensor, this might be sufficient. Probably still not something you want to rely on since it would be pretty annoying to have a feature not work when you're alone on a train.
                • cbhl 1 day ago
                  > the app could also look for other Transit users nearby

                  That seems unlikely in an environment with no cellular / wifi signal. Theoretically possible, but expensive for battery and probably disallowed by the OS.

              • thruway516 1 day ago
                Does the current version of their app run on 25% of the most popular models? This update runs a classifier on your phone. I imagine that would be no less restrictive than the barometer requirement.
                • lolinder 1 day ago
                  Most classifiers are nowhere near as heavy as the LLMs that are trending right now. The article doesn't specify, but I would be surprised if the resource requirements are especially onerous.
            • antonkochubey 2 days ago
              Huh? I restricted it to 2023-now, and got 146 results. 80 for 2024 only.
              • jrvieira 2 days ago
                146 in how many? 80 in how many?
                • nielsole 2 days ago
                  80/557

                  146/1109

                  • jrvieira 2 days ago
                    that's above 12% on both.

                    now correct it for number of sold phones each (estimated by looking at the 70 most popular models) and we'll get why they said 1/4.

        • douglaskayama 7 hours ago
          This GSM Arena search brought a Galaxy S25 Ultra in the results, an unannounced phone.
      • oniony 2 days ago
        I believe many do because it's used to fix GPS data when at different elevations, if I remember correctly.

        https://nextnav.com/why-phones-have-barometers/

        • rightbyte 2 days ago
          I did an IMU once. You get way better and faster Z position with barometer than with only GPS.
          • bigiain 1 day ago
            Inexpensive barometric sensors are _remarkably_ sensitive too. Like enough precision to detect less than 10cm or 4" changes in height/altitude.

            Note that's "sensitive", not "precise". The atmosphere changes pressure with the weather, so you don't get accurate absolute altitude - at least not without knowing the local "pressure altitude". Barometric pressure can vary in a way that represents plus or minus 300 or 400m of altitude, and can swing between high and low fairly rapidly in extreme weather events.

            But over short timeframe the change in barometric altitude can be very useful. Glider pilots (including paragliders and even RC gliders) often use very sensitive barometric pressure sensors to detect when they're in rising to sinking air, down at the few meters per minute range of sensitivity.

        • telgareith 2 days ago
          Maybe it'll help achieve a lock faster- but theres nothing else needed for GPS besides GPS. The military really doesn't like dependencies.
          • traverseda 2 days ago
            Not a faster lock, air pressure is actually more accurate on the z axis for the most part. GPS is not great at height, and including an extremely accurate barometer is a big help.
            • umeshunni 1 day ago
              Why is GPS not great at height? If you know your location is x,y and you have an elevation map, you can map x,y to an altitude z, right?
              • bobmcnamara 1 day ago
                > Why is GPS not great at height?

                Because the SATs only give you a pseudorange distance between you and the sat, so each say is most accurate solving for distance to/from that sat, and much less helpful resolving angle to the sat.

                With a clear SkyView, around just under half of the sats are hidden by the earth.

                This means that you get a full 360 degrees of data that can be near the horizon helping resolve lat/long.

                But only about half of that sky is helpful for altitude. The birds you can't hear directly below the earth would be the most helpful for improving the altitude fix if you could hear them.

                Baro is handy because you can take the absolute altitude from GPS as a low frequency baseline and use the baro for high frequency changes. Then when GPS says we teleported +200 feet when a new sat comes into view, we can temper that that with baro information.

              • Wowfunhappy 1 day ago
                I know nothing about this, but I imagine two people at the same latitude and longitude could be at different altitudes.

                A trivial example would be people on different floors of a skyscraper—although I suppose gps works poorly indoors anyway. Still, even outdoors there are peaks and crevices, and on a steep slope a very trivial change in lat/lon could lead to a major change in altitude.

              • ScottEvtuch 1 day ago
                I would imagine it's because your distance to the satellites changes more when you move along the ground than when you move up and down the same amount.
              • sliken 1 day ago
                Sure, assuming you are not in a building, balloon, helicopter, plane, drone, etc. Not to mention interesting topology like a cliff where an error in long/last of even a single foot could mean your altitude would vary by 1000 feet.
              • ianburrell 1 day ago
                One problem is that using position to get altitude would require a detailed elevation map and that would use a lot of storage space or require internet.

                But elevation maps are not detailed enough and position is not accurate enough to get accurate elevation. Think about standing on trail along steep slope. The position not being that accurate is fine since you know you are on trail. But altitude could vary wildly going up or down slope, or even up or down trail. It is probably similar to GPS vertical accuracy, but were going for more accuracy that barometer provides.

                • bobmcnamara 23 hours ago
                  The maps are only used when resolving a 3 bird fix. As soon as you lock a fourth bird you can solve 3D directly rather than leveraging an onboard spheroid. Many receivers refer to a three bird fix as a 2D fix for that reason.
              • sgarman 1 day ago
            • dorfsmay 1 day ago
              Do you then use the internet to find the local pressure, or only use it to calculate changes in altitude?
              • traverseda 1 day ago
                It's one factor in estimating altitude you feed into an extended kalman filter. If the GPS altitude is holding steady but there's a sudden jump in pressure that's probably a storm front not indicative of motion.

                You also probably want an accelerometer.

          • CamperBob2 1 day ago
            GPS itself is one hell of a dependency. What the military (and pretty much everyone else) wants right now is redundancy.
        • BurningFrog 1 day ago
          GPS already gives you altitude in addition to longitude and latitude, so I don't understand what the air pressure adds.
      • rossant 2 days ago
        Maybe premium Android smartphones do? My Galaxy S24+ seems to have one.

        Edit: at least the excellent Physics Toolbox Sensor Suite gives me a barometer signal indicating 102570 Pa right now.

        • LukaszWiktor 2 days ago
          True. Flagship smartphones, and some rugged models do have a pressure sensor.
        • sliken 1 day ago
          I was pleasantly surprised to note my pixel 9 has a barometer, 81,500 or so right now, I'm at 6,000 feet of elevation.
      • fragmede 2 days ago
        you wouldn't need all of them to have it, just enough so that wifi beacons in-between train stations could get added to the bssid - gps coordinate map. Though if the vendors wanted work with you, you could just tell them wifi bssid and the gps coordinates of them and the rest of it would just work.
        • Normal_gaussian 2 days ago
          There are unlikely to be wifi basestations detectable in between stations, because these are underground trains.
          • _kb 2 days ago
            You don’t need fixed base stations. Just infra on the train that rolls bassid based on location data the train already has. This would silently hook into native location services already on devices without additional sensing or models trained on other sensor data.
            • ssl-3 1 day ago
              That's... actually pretty brilliant.

              I wonder if it'll Just Work [eventually, given enough repetitions], or if the crowd-sourced network location algorithms will filter it because it is dynamic.

          • bluGill 2 days ago
            There should be - everyone on the train wants connectivity. Even if there is wifi on the train, that wifi needs something to connect to.
          • fragmede 2 days ago
            unless installed by the system operator, which is why they'd know the gps coordinates for them

            I'd have to have missed the title of the post, not read the post itself, not read GP's comment, not thought about why there'd be a pressure change, to have missed that particular detail. I appreciate you trying to be helpful though. :)

      • adastra22 1 day ago
        I’m pretty sure every Android phone does. It’s called a microphone. It doesn’t give absolute pressure values, but that is not needed for this use case.
      • maven29 2 days ago
        Just like the heart rate monitor, this was also moved into smartwatches for optimizing revenue from those who truly need it.
        • resoluteteeth 2 days ago
          Are you saying that smartphones used to have heart rate monitors but they were removed to force people to buy smart watches?
          • astrange 2 days ago
            Any phone that can record 120fps video has a heart rate monitor, if you can calibrate it.
          • connicpu 2 days ago
            I forget which generation it was now, but many years ago I had a Samsung Galaxy phone that had a sensor that could measure your heart rate if you put your finger over it
            • superhuzza 2 days ago
              The Galaxy S7 definitely had this feature.

              The problem is, it was basically useless. The main use case for heart rate monitoring is continuously throughout the day/night, or during exercise. A watch is very good at this. An optical sensor on the back of your phone is not.

              Periodically checking your heart rate by holding your phone in a specific way is not a useful feature for that many people.

              • chucksmash 1 day ago
                +1. If a phone has a stopwatch, you can get your bpm at a given moment with a finger and a multiplication (or patience). Given the limited real estate on a mobile phone it's crazy to devote any space for something so trivial.
              • 6510 2 days ago
                For me, just having something that you can check 1 time per year is much better than nothing. The anecdote: I was working two heavy manual labor jobs 7 days per week and felt absolutely fantastic, glowing with power. Turned out the heart rate at rest was 180 lmao. Like a rabbit. Took a few days off, it dropped below 70.
                • idiot900 2 days ago
                  If your heart rate at rest is truly 180, you have an arrhythmia and need to see a doctor.
                  • 6510 1 day ago
                    It should decline some 60 sec after physical activity. I think I measured after 10-15 minutes. Fatigue, dehydration, lack of sleep, a diet with lots of coffee. I just added those to the todo list. I went home to sleep (and confiscated the heart rate meter), the next morning it was around 100 bpm which is still terrible shape. Over the day it sunk to 80, over the 2nd day to 70, 3rd a bit lower. Back at work it would barely elevate. The moral of the story: Don't work out 11 hours per day for 6 months straight.
            • telgareith 2 days ago
              It's not a separate sensor- 30fps on an iPhone was more than enough.

              Turns out, when you have a known luminance, white balance, and frame-rate... the DSP to grab heart rate from a finger is trivial.

              • ssl-3 1 day ago
                Cameras can do it, yes.

                But on the Galaxy S7 that I think is being alluded to here, it was definitely a separate sensor -- a MAX86902, IIRC.

        • varelse 2 days ago
          The heart rate monitors in Google and Fitbit devices are insanely inaccurate during exercise. I had suspected as much already. Whenever a brisk walk indicated my pulse was 150 or so. But first, I could not reproduce this wearing a halter device and later I could not reproduce this wearing a polar heart rate monitor or a Frontier X2 ECG.

          Conclusion, Fitbit and Google heart rate monitors on those wearables are hot garbage. Cue some snooty googler insisting I'm doing it wrong somehow.

  • dmazin 2 days ago
    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.

    • dmos62 2 days ago
      That's awesome. What sensors have you considered?

      I'm interested in extremely weak, high-frequency vibrations of everyday things while in resting state (which is sort of the opposite of what you're after, as I understand), but have not gotten far in acquiring the sensors. I'd love to get a laser doppler vibrometer, but they're pricey.

      • dmazin 2 days ago
        Well, I was just going to put a contact mic in my cellar. My understanding is that this is the best way to pick up low-frequency vibrations.

        I know very little about audio engineering. I wonder what else I might be able to use to pick up the vibration signature?

        I completely understand your drive to pick up those high-frequency vibrations! There's a whole secret world of vibrations out there, and we can analyze it!

        • myself248 1 day ago
          "Geophone" is the device you seek.

          Amplifying and digitizing the signal is straightforward for an experienced EE, but you might look into acquiring some Raspberry Shake hardware which has it all already done.

          • dmazin 1 day ago
            Oh, snap. Thank you. Guess I’m about to be $350 poorer!
        • jbl0ndie 2 days ago
          You might struggle using microphones if it's very low frequency because most human audio microphones intentionally filter frequencies that are below (and above) human hearing range. Perhaps fixing to he contact mic to the right resonant object might serve to translate the low frequency to a higher frequency?

          Could you use the accelerometer on a smart phone to 'hear' the vibrations?

          • dmazin 2 days ago
            I don't know if a contact mic really has any filtering though; it's just a piezo element that I plug into a pre-amp.

            However, what you're saying is completely legit. I read that I might want to lay a large, sturdy thing on the floor and put the mic on that, for the same reason that you gave. I used a large old pane of glass that I found in the cellar.

            • cruffle_duffle 1 day ago
              All that came to my mind is making sure to physically bond it to the floor. But then you still need to have something that moves relative to the magnet and then I got confused again.

              What do seismographs do? People also use acoustic pings to measure soil and rock density underground. What are those devices using for their “microphone”?

              And yeah, would an accelerometer work? I don’t know what the temporal resolution is on your standard Amazon / AliExpress accelerometer is but it’s probably pretty decent?

      • pavel_lishin 1 day ago
        Stupid question, but how far can you get with a laser, a mirror, and a light sensor?
        • richjdsmith 1 day ago
          That's actually a really cool idea. I am not sure what variance there would be on a light sensor though.
          • pavel_lishin 1 day ago
            I remember building a toy interferometer in high school - a laser, splitter and a mirror. You could definitely see the interference patterns when you'd press on a wall with a finger.

            Maybe something like that could be turned into a reasonable microphone?

      • sliken 1 day ago
        I have pondered adding 4 microphones to the corners of my house. I suspect with some processing and filtering you could likely tell quite a bit about the house. When the front door or garage opens, what rooms are occupied, when it's raining or windy, what appliances are on, when someone parks in the driveway, when the mail comes, duty cycle of the fridge and furnace, when it's sunny out (expansion noises on the sunny side), when someone is showering (and which shower), when toilets are used, etc. Certainly should be able to detect when a window is broken or a door forced.
    • frenchman_in_ny 1 day ago
      I was at an Open House at the Lamont-Doherty Earth Observatory [0] a few weeks ago, and one of the researchers was doing something adjacent to this -- recording the sound of earthquakes for analysis. Will try to find who it was.

      [0] https://lamont.columbia.edu/

    • IIAOPSW 1 day ago
      I am sure that your work in discriminating what's happening deep underground with nothing more than passively recording surreptitiously available signals at the surface level on non-specialist hardware is of interest to a few governmental offices.
    • comboy 2 days ago
      My kind of people. Good luck!
    • meitham 2 days ago
      Ha! If you happen to live in the battle area of South Wimbledon then the noise from the northern line in the early hours of the morning can wake you up! It’s roughly 30 meters under too!
      • dmazin 2 days ago
        What I learned is that the Northern Line has the most noise complaints (from people who live near it) of any TfL line!
    • immibis 2 days ago
      These are electric trains. I'd be interested to know if a big coil of wire picks up a signature as well.
      • Symbiote 1 day ago
        The oldest deep London Underground lines have iron tunnel segments, which might make this method particularly difficult.

        https://www.ltmuseum.co.uk/collections/collections-online/in...

      • dmazin 2 days ago
        Woah. A bit of reading shows that the signal would be incredibly weak, especially because of shielding.

        I wonder what other ways there might be to detect it.

        Someone else mentioned literal vibration, but I figure a contact mic would already pick that up – I mean, sound is already vibration...

    • yzydserd 1 day ago
      Have you looked into whether a Raspberry Shake might be adequate?
      • dmazin 1 day ago
        Good shout — I may have to look into this.
    • toomuchtodo 1 day ago
      Could you use a ground mount seismic sensor?
    • kjkjadksj 1 day ago
      I used to live about 300 yards from where the subway went and I felt like I could hear it. I’m not sure if it was residual sounds from the sidewalk emergency exits or from the earth ringing like a bell.
  • ripe 2 days ago
    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.

    • justinko 2 days ago
      Yes, the lovely tone of a human being (not AI).
      • lallysingh 1 day ago
        I donno which humans you read, but most people I know defecate their thoughts onto a page. Actually good writing takes a lot of effort most people don't do. AI's got a decent baseline.
    • vaughnegut 1 day ago
      Their product release posts and their engineering posts are usually really well written. Transit App is a gem
      • yonatan8070 1 day ago
        This is the first time I'm hearing about it I downloaded it pretty much as soon as I finished reading the blog post, only to discover it's not available in my region :-(
  • wffurr 2 days ago
    "Classifier" how quaint. I am impressed that they wrote the whole article without mentioning "AI" one time.
    • worewood 2 days ago
      Good. Shows that engineering is on the driver seat, not marketing.
  • mdergosits 2 days ago
    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!
    • IshKebab 2 days ago
      Some trains even have modern technology called "screens" that display their current location, next stop, route and so on!

      (Although in fairness they so often get this laughably wrong, and cycle through useless "remember your luggage" style messages so you have to wait like 20s to see the information you want - critically bad on a train.)

      • the_mitsuhiko 2 days ago
        I really don’t understand why not every subway shows the next station on the screen instead of warning messages and other stuff. (And a marker for side the doors will open)
        • dietr1ch 2 days ago
          I don't get why ads are prioritised over travel information.
          • eythian 2 days ago
            For at least months in my city, the screens in buses have been showing a "broken image" icon as part of their ad cycle. I'd much rather know about the next stop.
          • kdmccormick 2 days ago
            It's very simple: Transit in many places is underfunded. Travel info screens cost money to install and maintain. Ads, on the other hand, make money.
            • bluGill 2 days ago
              Ads make money, but not that much. I'm not convinced they are enough to be worth the bother. To have ads you need to pay people in sales to sell them, people to install them (now that this is electronic it is easier than the old paper days, but you need a more expensive tech person to keep them working). At best they are 5% of your gross budget, so not very significant and they often hard harmful to your riders.
              • rtkwe 2 days ago
                Transit in the US seems to be constantly on a starvation diet budgetarily speaking so I'm not shocked small sums of money get chosen over options that would be better for their users.
                • rangestransform 1 day ago
                  Starvation diet? You should see how much NYC MTA spends, it’s a feast compared to even the rest of the anglosphere
                  • rtkwe 1 day ago
                    The MTA is a huge outlier but still gets less money for upgrades and upkeep than they need. They limped along for years on extremely outdated train tracking infrastructure and are just getting around to doing updates that needed to be started two decades ago.
                    • rangestransform 1 day ago
                      They get way more than they need, it’s just burnt on unions, pensions, and consultants

                      I will literally volunteer my time to canvass for anyone who runs on busting NYC public sector unions

              • bigfatkitten 1 day ago
                What often happen is a a company comes into install and maintain the displays for "free", on the proviso that they can display ads and keep most/all of the ad money.
              • akadruid1 1 day ago
                5% of a transit authority's budget would be a lot of money! Advertising made £158 million for Transport for London in 2019, much less than 5% of their budget.
            • dietr1ch 1 day ago
              Ads just make money out of people, why not cut off the middleman?
          • faggotbreath 2 days ago
            [dead]
        • IshKebab 2 days ago
          I assume it's because the person deciding what goes on the screens is some manager somewhere. They probably just don't really thing about it.
      • IncreasePosts 1 day ago
        Also doesn't help travelers who aren't too familiar with English - I always wonder how many NY-bound tourists have stepped off the train at "Newark Penn Station".
      • spaceywilly 1 day ago
        I take the train every day in NYC. Around half the time the train is brand new and has nice displays that even show you where the stairs are located in each station as you pull up. The other half the train is from the 1960s and has no information whatsoever. So yeah this app will definitely be an upgrade over peering out the window to read the station names. Even the trains with displays are occasionally wrong/not working.
      • SoftTalker 1 day ago
        Even better, they have a thing called a "window" which is transparent and you can look out on the platform and see the sign posting the station name.
        • brewdad 1 day ago
          This assumes you aren’t riding a packed train with people standing wall to wall in front of seated passengers. Being a shorter than average person also can make this a challenge.
  • modeless 2 days ago
    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.
    • dariosalvi78 2 days ago
      I believe that their intention is to have something that works on any track, without signatures. Collecting signatures would be cool, but a massive work if you want to have good coverage of cities AND phones. Maybe companies like Google or Apple have the data and the capacity to do so, smaller companies less likely.
      • bornfreddy 1 day ago
        I was surprised to read they don't collect any data. That would be a great way to gather samples to train the new generations of detection NNs on. If it is properly anonymized it shouldn't be a problem, imho (and I'm pretty paranoid wrt. privacy).
    • nuccy 2 days ago
      Acceleration signature depends on:

      - human driver

      - train capacity and current load

      - train model (or any powertrain variations)

      More reliable might be to check rail track features from accelerometer: tilt, turns, bumps, or a combinations of everything. Even sounds on turns, changes of backround during merging tunnels, etc. Integrated acceleration gives train speed, which is also useful along with other inputs.

      • modeless 2 days ago
        Yes, tilt, turns, and bumps are what I meant by accelerations, not just the train's forward acceleration.
        • sakjur 2 days ago
          If you’re not putting the phone on the floor, wouldn’t the person holding it introduce a randomness factor that would make it much harder to reliably measure those? And then there’s sun curves, packed leaves, ice and the cars’ suspension.

          I think I’d struggle with finding a signal through all that noise.

          • Normal_gaussian 2 days ago
            Ive seen two seperate demos of doing this for the london underground based purely on the accelerometer.

            Accuracy is poor when blind, but if you have any info about where the user last had a location fix it became very good.

            Neither company found sufficient interest to deploy the sensor.

          • TeMPOraL 2 days ago
            Contribution from the phone being held should be easy to cancel out for the most part, as high frequency noise. It of course gets much easier if you have acceleration data from two or more devices held by different people.
      • sofixa 2 days ago
        > human driver

        Not in any even remotely modern system that will have a high degree of automation and if there's a driver, they're only closing and opening doors, and telling the train to get going.

        • AndrewSwift 2 days ago
          I just took a one day initiation with the SNCF for driving trains in France.

          I assumed that everything would be automated but in fact nothing is.

          They explained that they regularly face situations that require human intervention (several times a day), and that even a little automation would reduce the level of attention on the part of the conductor.

          The conductor is required to interact with the controls at least every 30 seconds to avoid setting off alarms.

          • maeln 2 days ago
            The SNCF is for regional and national train (with the exception of the RER) where the possibility of having a cow coming on the rail is non-negligible ... or a hot air ballon landing on the rail and stopping the Nantes-Paris lines for a whole morning :D .

            So I think it is a much, much harder environment to automate. Paris do have some metro line that are fully automatic (line 1 at least) and both Rennes metro lines are fully automatic. It is much easier to control the environment around a metro and ensure that nothing can go on the rails, and have surveillance system to check if, if it does happen, it is detected ASAP.

            • sofixa 2 days ago
              > The SNCF is for regional and national train (with the exception of the RER) where the possibility of having a cow coming on the rail is non-negligible ... or a hot air ballon landing on the rail and stopping the Nantes-Paris lines for a whole morning :D .

              Or camels: https://www.francetvinfo.fr/animaux/un-dromadaire-apercu-aux...

              > So I think it is a much, much harder environment to automate. Paris do have some metro line that are fully automatic (line 1 at least) and both Rennes metro lines are fully automatic. It is much easier to control the environment around a metro and ensure that nothing can go on the rails, and have surveillance system to check if, if it does happen, it is detected ASAP.

              Even the non-fully automatic lines use heavy automation (e.g. lines such as 2, 3, 5, 7, 8, 9, 11, 12, 13).

            • Lance_ET_Compte 1 day ago
            • rossant 2 days ago
              Paris metro lines 1, 4, and 14 are automatic at the moment.
        • lpribis 2 days ago
          Not true for a lot of (widely used) systems. Both the NY subway and London Underground are manually driven for the majority of lines.
          • sofixa 2 days ago
            London Undeground has high degree of automation (driver presses a button, train drives itself optimally to the next station).

            Paris has the same, and also a number of lines (1, 4, 14, and soon 15) which have no driver at all.

            NYC Subway is an outlier in how obsolete everything is.

            • rangestransform 1 day ago
              The NYC train drivers union continue to fight against one person train operation and automation, to them the subway is more of a jobs program than transportation
              • porphyra 1 day ago
                We should automate the trains and repurpose the train staff to be conductors patrolling the trains to assist individuals in need and help in an emergency. That way, the jobs are saved, and the trains get more pleasant to ride!
              • sofixa 1 day ago
                I saw that, I saw trains with more than one MTA person onboard, and saw some construction work which had 30 workers sitting on their phones and 2 working (passed by multiple times that day, the ration never changed).

                Grand Paris Express' president also talked about this, and compared the 2nd avenue subway to the Grand Paris Express (well, one cost $4.45 billion for 1.8 mi / 2.9 km and 4 stations; the first line of GPE, 15 south is 33km, 16 stations, and costs ~8 billion euros so it's a really bad comparison), and has said that if he had to do things the way the MTA do it, GPE would have gone nowhere.

                • rangestransform 1 day ago
                  I will literally volunteer to canvass for anyone who runs on busting NYC public sector unions
          • ThePowerOfFuet 2 days ago
            The comment to which you replied specifically said "Not in any even remotely modern system"; neither of those are remotely modern, _especially_ not NYC. Only two or three lines of the famed Paris system would qualify.

            Barcelona, on the other hand, would qualify for everything except line 4.

          • lmm 2 days ago
            Every London Underground line built after 1906 is automatically driven - the human driver just pushes a button and the train drives itself to the next station.
            • iggldiggl 2 days ago
              That makes it sound as if they'd been automated right from 1907, which most definitely isn't the case – on most line automation only happened very recently. (The Victoria Line was automated right from its opening in 1968, then the Central line was automated in the 90s, the Jubilee and Northern lines in the 2010s and the subsurface network is currently under way.)

              Also if we want to quibble, at least a few sections of the Bakerloo and Piccadilly lines (which are still completely manually driven) were opened after 1906.

              • lmm 1 day ago
                > That makes it sound as if they'd been automated right from 1907, which most definitely isn't the case

                From 1907 onwards every newly built line was automated from opening (though indeed extensions or "new" lines made by splitting an existing line were sometimes manually driven).

                • iggldiggl 1 day ago
                  Even that is a bit disingenuous when you consider the very minimal number of completely new lines that have been built since 1906 – basically only the Victoria line in 1968 and (depending on whether you only count real tube lines or not) the DLR in 1987.

                  (The Jubilee line in 1979 – which started out being manually driven – wouldn't count according to your criteria, because part of it was "made by splitting an existing line", and apart from being heavy rail, arguably Crossrail could be argued to be an extension, too, even though it does operate automatically on the new-built bits, i.e. the central section plus the Abbey Wood branch.)

        • bluGill 2 days ago
          Most train systems around the world are not automated. Even though electronics can do better than a human driver, most trains have a human driver. (in subway systems you should be able to keep all dangers off the track so the safety problem is much easier than roads where kids might be playing in the street. But this requires platform screen doors which is also rare)

          The real advantage of automation though is without a human driver it becomes cheap to run a lot of trains that are not very full and that makes your system nearly as convenient as driving in the suburbs.

          • sofixa 2 days ago
            > Most train systems around the world are not automated

            All modern ones (in an urban/suburban context, which is what the post and thread are about; interurban is a bit more mixed, but every high speed line is highly automated too, because at those speeds there simply isn't the time for a human to react) are.

            > The real advantage of automation though is without a human driver it becomes cheap to run a lot of trains that are not very full

            And you can also have a very high frequency (60-90s intervals), which is impossible with manual operations. This increases capacity, on top of the convenience.

    • fire_lake 2 days ago
      Shazam for train tracks
      • modeless 2 days ago
        Now accepting funding offers at $10m post-money valuation cap
        • blitzar 2 days ago
          Ai Powered Shazam for train tracks.

          Now accepting funding offers at $500m post-money valuation cap.

          • rvnx 2 days ago
            Then in 5 years: "Turns out this was marketing for investors and that our classifier was using 99% of the time last location and itinerary as primary factor to determine location"

            The magic formula: "if is_train_moving, countdown to next station"

    • KeplerBoy 2 days ago
      On my local tram network you could even do that just by listening to the noises made by the inverters, which drive the motors.

      They have a very distinct hum that matches the rpm of the wheels. I once built a crude speedometer using SFTs, peak detection and kalman filtering.

  • zephyreon 2 days ago
    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 2 days ago
    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.
    • ant6n 1 day ago
      Using the microphone as a sensor is a bit of a no-go a transit app. You could just record the noise of the train rolling to find out the movement, but your users will suspect you are listening to them.
    • sitkack 2 days ago
      Tune the screeches so they make a different chord for each stop.
      • Lance_ET_Compte 1 day ago
        I have no hearing in any of the frequencies BART trains emit. Burned away...

        I do love this "Transit" app though.

        • sitkack 1 day ago
          I am sorry for your loss, but does this explain dubstep?
  • devit 2 days ago
    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?

    • pbmonster 2 days ago
      > Wouldn't dead reckoning with the accelerometer and gyroscope in addition to their machine learning improve this significantly?

      The thing that should help the most would probably be the hall sensor/magnetometer/compass. That should output decent dead reckoning.

      Doing this just with the gyroscope will work very well for short movements, but it will be close to useless on long, gentle curves. Unfortunately, those MEMS gyroscopes drift quite a lot over tens of seconds. Not a problem if you can do sensor fusion with the magnetometer (reckoning) and the accelerometer (where is "down"), but the latter can't be used on a fast train, acceleration/deceleration of the vehicle and forces in curves make finding gravity challenging. No idea how well a compass works inside a subway tunnel.

      But maybe I'm wrong, I just have experience trying an "artificial horizon" app on an aircraft - and here, the accelerometer is completely useless for "down". A single maneuver with some Gs and the horizon has no idea what the pitch angle is. Noisy magnetic environment, GPS off? It also doesn't know where it's going.

      • porphyra 1 day ago
        I wonder how well magnetometers would work inside metal trains full of electric motors.
    • bluGill 2 days ago
      That is what they are doing. Dead reckoning is generally very inaccurate though, so by recognizing when they are on a train they can greatly increase accuracy because they know exactly where the train is.
      • crazygringo 2 days ago
        Is it? The article doesn't say so.

        It says they use the accelerometer for detecting the user's current mode of transportation, not the distance.

        It says they use the train schedules to figure out the current location of the train, based on when it started moving and how long it's been moving.

        They don't mention anything like dead reckoning anywhere, unless I missed it?

    • sliken 1 day ago
      If you just did a FFT on microphone and acceleration for every link in a subway system and recorded the past travel times. Seems pretty straight forward to estimate your speed vs the historical records and then predict your arrival time.

      So focus on speed not acceleration.

    • porphyra 1 day ago
      Using the IMU seems hard as true signal of the train's gradual acceleration is likely drowned out by the noise of vibrations and the person's natural movements. I guess every time the train is stopped, you can calibrate the bias of the IMU if the user is standing/sitting sufficiently still, but even then the dead reckoning would drift a lot.
    • KTibow 1 day ago
      Yeah while the solution they implemented is very interesting it doesn't actually "predict your location in a subway tunnel using your phone’s vibration signature"
  • 333c 2 days ago
    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.
  • mjamesaustin 2 days ago
    This is one of the best apps I've ever used, and I'm excited to see it's only getting better!
  • dietr1ch 2 days ago
    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.

    • klausa 2 days ago
      My understanding of CarPlay is that it does offload GPS to the car (when available, not all units/manufacturers might support it).
      • longtimelistnr 2 days ago
        This is actually a problem for my Volkswagen Tiguan, the car GPS data is wildly inaccurate probably ~30% of the time. The only fix is force it to use wired CarPlay or turn of CarPlay and let my map grab my phone's data before reconnecting.
      • fragmede 2 days ago
        It does! Unfortunately for me, I rented this one Ford Explorer where the car's GPS was off by a mile, so that was the opposite of helpful, and I didn't find a way to turn that off in the short time I had it.
    • MaxikCZ 2 days ago
      Thats still surprisingly unsolved problem. I was daydreaming about pulling my laptop out somewhere without known wifi and it automatically using my phone as a hotspot, without going trough manual process of enabling said hotspot. Somehow we connected the world but forgot to connect out devices..
      • vineyardmike 2 days ago
        This has almost been a feature for Macs+iPhones for like a decade. You need to manually "pick a wifi network" but it'll turn on your phone's hotspot if you pick it from the list.
        • pjerem 2 days ago
          Never tried on my Mac, but on iPad, it’s totally automatic : the iPad automatically tells the iPhone to enable the hotspot (over Bluetooth I presume) then connects to it.
        • wisenull 2 days ago
          Is the hotspot truly off? I am asking because it was really common to see Whoever's iPhone whenever you were picking a wifi network.
          • astrange 2 days ago
            The hotspot uses a lot of power, so it really is off when it's not being used.
    • porphyra 1 day ago
      This is one thing that is nice about using the Tesla in-car navigation. It always knows which way the car is pointed.
  • daghamm 2 days ago
    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.

    • araes 2 days ago
      Similar thought, and Google acquire does seem like a plausible route. However, checking over on Play [1] they've apparently got In-App purchasing at $3-50 and 300+ cities and 1000+ transits that let you buy fare and passes. Seems like they're already making money anyway. Teams pretty extensive though, so it does look like a lot of annual money's probably necessary to float. [2]

      [1] https://play.google.com/store/apps/details?id=com.thetransit...

      [2] https://transitapp.com/team

      • xav0989 2 days ago
        They also partner with transit agencies where the transit agencies pays them to upgrade everyone in the region/system to the premium offering, and the transit app becomes the official app for that transit agency.
      • RobotToaster 2 days ago
        Yeah, I downloaded the app out of curiosity, but uninstalled it once I saw it had the usual freemium subscription nonsense.
        • kccqzy 2 days ago
          I never paid a single cent in this app and yet the app is perfectly enjoyable. I've used it since 2019. What's wrong with freemium? I don't need extra features and the free features are good enough for me.
          • procflora 1 day ago
            The thing I specifically paid for (that Google Maps doesn't seem to offer) is answering the question "what transit lines/stops are nearby and how soon will a service arrive at the stop?" Last I looked they limit the number of lines shown in this way for freemium users.

            If you're just putting in a destination and getting a fastest route (much like you'd do in Google Maps), then I didn't see much benefit to the premium version.

    • froddd 2 days ago
      It’s a strong business case for the founders
  • __MatrixMan__ 2 days ago
    Oh thank goodness. I knew I buried a train somewhere around here but I just can't find it.
    • aziaziazi 2 days ago
      • blitzar 2 days ago
        Be kind. Don't be snarky.

        Please respond to the strongest plausible interpretation of what someone says, not a weaker one that's easier to criticize. Assume good faith.

        Please don't post shallow dismissals, especially of other people's work. A good critical comment teaches us something.

        Please don't complain about tangential annoyances—e.g. article or website formats, name collisions, or back-button breakage. They're too common to be interesting.

        https://news.ycombinator.com/newsguidelines.html

        • aziaziazi 2 days ago
          Thanks for sharing those other guidelines.

          Some could feel my comment escape them from it’s tone and it will be wonderful if you or someone else share a better way to say what I said. I’m doing my best to not hurt others, which sometimes is seen as coldness. Which I admit is not kind.

          • blitzar 2 days ago
            I can offer no better words for you, however can offer advice which I myself shall no heed.

            Vote accordingly and proceed onward. If collectively a negligible fraction also do the same then the results might just surprise. Ostracism is a powerful tool, while not always used for good, it does serve a purpose in society.

            • aziaziazi 2 days ago
              Thanks, that is an idea I didn’t have and worth considering. Exclusion traumatized me in the past and that still haunts everyday. I didn’t thought it can be used for good.
      • mbs159 7 hours ago
        It's likely that in this community actually substanceless comments will be down-voted. That on the other hand is very upvoted comment by the community, so I think it shouldn't be met with such criticism.
      • ThePowerOfFuet 2 days ago
        That says "Please don't post substanceless one-liners here."

        The joke was _two_ sentences, and I, for one, appreciated it.

        If you're going to quote regulations, make sure to bring a gun to a gun fight!

        • aziaziazi 2 days ago
          Well I think "one-liner" here adds more weight to "substanceless" and was not indented to be taken literally:

          - it has no useful meaning in a media you can resize.

          - adding dots (.) does not noticeably change the meaning, you could replace with a comma : "Oh thanks goodness, I new…", allowing cheating on the fight rules. I don’t think that’s desirable way we want to interact as a HN-user-community (personal opinion)

          - taking the literal read anyway, I see one line and two sentences right now. It’s a one liner. (not English native, may I missed a secondary meaning?)

          Dang clarify it bellow the post in linked and cite scott_s, none of which talking about the length of the joke but both referring to noise.

          I personally also found it funny BUT I also saw like 10 substanceless not-so-funny jokes today on HN. INHM problem is not the joke itself but the emptiness of the post if you take the joke aside.

          • maronato 1 day ago
            Well, seeing as GP is still visible 20h later, I’d say not enough people share this view.

            Which is good, IMO, since one important property of a social system is flexibility.

  • sailfast 1 day ago
    I appreciate that this is not a mass surveillance play and all of the data stays on your phone. Well done!
    • ipython 1 day ago
      So true. This is the sort of thing that is so exciting from a usability and engineering standpoint. Until some marketer gets their hands on it and decide that they can increase the ROI on microtargeting advertisements by 0.1% if they use this data. Suddenly, we continue to slide into the advertising and propaganda driven attention economy dystopia.

      Here's to the future!

  • barbegal 2 days ago
    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.
    • sitkack 2 days ago
      Once enough people have the app, there will be a whole time varying point cloud of data both on and off the train.
      • datameta 2 days ago
        Is that their stated goal? Are they not saying they will not use user virbation data?
        • sitkack 1 day ago
          I'd assume they would have some opt in, or allowance for either federated learning or sharing of anonymized sensor data.

          Google is a huge advantage here, they have both the spatio-temporal intent of the user as well as the physical flow feed. There is so much position data flowing off android phones, that they are able to see the whole topology.

  • clarkmoody 2 days ago
    Alternative title idea: "Instead of Reaching for AI, we used Good Old-Fashioned Engineering to Solve a Tough Problem"
    • alanbernstein 1 day ago
      Is machine learning old-fashioned already?
      • ant6n 1 day ago
        Machine learning is part of AI.
  • aeternum 2 days ago
    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.
    • kaonwarb 2 days ago
      They're using Fourier transforms to focus on frequencies of acceleration associated with subway travel; gravity should mostly fall out as an independent factor.
    • nickmooney 2 days ago
      Is there always a great reference for which way down is, given that the phone can be in various orientations? You might have to do some other heuristics / build some other model for that to figure out which axis to subtract your 9.8 m/s^2 from - maybe it's easier not to worry about it.
      • zokier 2 days ago
        Isn't merging gyro data with accelerometer data pretty standard approach?
        • nickmooney 1 day ago
          I forgot phones have gyroscopes :)
  • brirec 1 day ago
    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!

    • brewdad 1 day ago
      I’ve given Transit App a few tries on various visits to New York. I always end up back at Citymapper. For me, it works so much better.
  • grav 2 days ago
    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?

    • O-stevns 1 day ago
      While I understand your question is about the Transit app in general, I'd just like to mention in correlation to the article that my team and I worked with one of the public transport operators in Denmark, to utilize the motion predictability feature found in Android and iOS SDK's, so I can enlighten you with some details regarding that.

      Our conclusion was that the feature didn't work in the danish metros for reasons we never got to deep dive into. It's most likely related to the fact that many of the metro stations are built in concrete, as such there's no GPS data in most of them unless you're very close to or on the surface and no motion data.

      I'd be surprised if they got this particular feature working but who knows... maybe if we had looked into the raw sensor output we might have been able to work something out.

      In the end we made a solution to help determine when you're moving or not by utilizing beacons.

      • grav 1 day ago
        > no motion data

        How come there's no motion data?

    • dotcoma 2 days ago
      Let them know you’d like CPH !

      Especially if you know someone at the transit agency or can help them even in a very small way.

  • IIAOPSW 1 day ago
    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.

    • 30blay 1 day ago
      I'm one of the developers behind this project, so I want to jump in because we did explore some of these solutions.

      You are correct in saying the low frequency acceleration from starts, stops and turns can be distinguished from the higher frequency noise.

      One big challenge was with orientation. Acceleration can look the same as deceleration and turns from the sensor's perspective, if you turn the phone around. Taking the integral of the gyro reading, the error would grow quadratically, and we found magnetometer readings unreliable depending on the vehicles.

      Your point about the hunting oscillation is interesting and I agree, estimating the speed would be a great improvement.

      • niutech 1 day ago
        Well done! Have you considered spoofing Wi-Fi/BLE signals in addition to accelerometer data? This way you could verify that you are on the right station.
    • ezfe 1 day ago
      You still need to know when they are on a train, because you need to know what time they got on the train and started moving.

      You also have to assume that GPS has already been lost at this point, so you have to do it from the departure location of the train at the right time.

    • cenamus 1 day ago
      That's just an inertial nav systems, quite useful for missiles before/without usable GNSS, but also probably quite inaccurate with the MEMS accelerometers in phones.

      https://en.m.wikipedia.org/wiki/Inertial_navigation_system

      Semi-related but just as fascinating: https://en.m.wikipedia.org/wiki/Terrain-following_radar

    • simsla 1 day ago
      I was thinking in a different direction. Maybe we can fingerprint the turns or other jerks/shakes along a route. Accelerometer Shazam.
  • MagicMoonlight 1 day 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.
    • barnabee 1 day ago
      Trains often stop between Stops, at signals
  • tgtweak 2 days ago
    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.

    • Aurornis 2 days ago
      > I think you can "spoof" gps satellite timestamp transmissions with single transmitter inside the train.

      Spoofing GPS as a commercial operation is a quick way to get your company crushed by regulatory agencies.

      • bluGill 2 days ago
        I think there should be regulations that allow sending real GPS from low power ground based system. Sending incorrect GPS is a major problem, but a lot of location issues would become much easier if the owners of buildings would just install cheap GPS transmitters.
      • cruffle_duffle 1 day ago
        I mean obviously you’d set it up through the proper channels. I’m sure there is a regulatory framework for doing exactly this sort of thing already.
    • acc_297 2 days ago
      I wonder if you could just create a map of the cellular antennas along the metro/subway tunnels. Maybe I misunderstand how connectivity is delivered in underground systems it may pretend to be a "single cohesive base station" from a phones perspective but if there are thousands of antennas throughout the system and the phone switches from one to the next regularly you can decently estimate the location.
  • isaacfrond 2 days ago
    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.

    • iAkashPaul 2 days ago
      Could be that or an RNN/LSTM as well
  • fullofstack 2 days ago
    Is GPS spoofing an option, underground? Would instantly work on all phones.
    • qwertox 2 days ago
      Having the train use Bluetooth Low Energy advertising to broadcast its location and some other data, like time-to-next station, next station name, would be a nice feature.

      GPS spoofing should not be done in my opinion until the negative side-effects are well understood.

      • h1fra 2 days ago
        This is the case in some stations in Paris. To retrofit ancient trains with station announcements, they have installed Bluetooth broadcasters on each station so the train can detect when it enters/leaves and announce the next station for visually impaired people. Smart and simple imo.

        https://www.leparisien.fr/info-paris-ile-de-france-oise/tran...

      • gield 2 days ago
        Waze Beacons [1] do this for car tunnels. Some underground systems, e.g. in Barcelona IIRC, also use BLE beacons to help phones position themselves.

        [1] https://support.google.com/waze/partners/answer/9416071

      • flemhans 2 days ago
        Ona similar note I always thought it would be cool if there was a standard allowing (trusted) WiFi access points to relay location data, so that in-flight WiFi could pass on the plane's GPS feed.
    • jillesvangurp 2 days ago
      No need; phones use sensor fusion these days. Wifi, ble, 4G/5G base stations, signals, etc. it's all taken into account. Which is why you can get accurate position in a lot of places where you definitely don't have any line of sight to any GPS satellites. Some of the more recent wifi standards also have some positioning features.
      • cryptoz 2 days ago
        Early Android dev had a guide on how devs could pick the best location from various sources individually, and it was massive pain with dubious results.
    • dietr1ch 2 days ago
      Is it spoofing if you are telling the truth? Just pretend to be a GPS satellite during its morning commute.
      • _flux 2 days ago
        You'd need to spoof at least three satellites to get a fix, right? And then you'd need to spoof different signals for different regions of the subway, because your signal sources aren't really in the orbit.

        Sounds to me this could be very complicated and expensive. I wonder if it would even be possible because you'd need to have the same signal spoof the correct positions to everyone who hears that signal.

        • dietr1ch 2 days ago
          No, you need 3 satellites because they are far enough that their position and time gives you too much uncertainty.

          If the entire sphere where I could be fits within 5m I guess I don't need other satellites and their time to start intersecting spheres.

          • _flux 2 days ago
            I don't understand this. As far as I know, the satellite basically sends its identifier and precise time, and from this information (combined with the information in GPS calendar that tells the locations of the satellites) the recipient can determines its own location.

            How could it be possible to determine the location from a single timestamp and information about which satellite it belongs to? I suppose if the recipient already has a fix, then it could perhaps survive with less than 3 satellites by making some assumptions, but I imagine this will result in lower quality location information.

            Were you proposing to assume the location of a 5m sphere the recipient is in?

            • dietr1ch 1 day ago
              > I don't understand this. As far as I know, the satellite basically sends its identifier and precise time, and from this information (combined with the information in GPS calendar that tells the locations of the satellites) the recipient can determines its own location.

              I'd assumed the GPS calendar was somehow broadcasted by the GPS network too, which kind of means that they also share their location.

              > Were you proposing to assume the location of a 5m sphere the recipient is in?

              I guess the proposal was to change the problem from pinpoint a single point in space, to figure out roughly where I am, in which case being anywhere in a tiny sphere is pretty much the same as being in a point after you account for errors.

            • bluGill 2 days ago
              The satellite also sends information about all the other satellites that a receiver should be able to see. This is what makes adding other transmitters hard/impossible I guess - no way to tell the overhead satellites that your ground station also exists (there would presumably be thousands of them - most not in range of your receiver which would be even more problems.)
      • szszrk 2 days ago
        Well, you are not a GPS satellite, so you are indeed spoofing military equipment.

        On a serious note, I recall that smartphone location in metro in my city started to "just work" as soon as all stations and tunnels had indoor cell towers. Suddenly all apps worked fine and I forgot that problem ever existed.

        Modern location detection is as scary as it is amazing.

        • bluGill 2 days ago
          Cell towers also transmit location data
    • RobotToaster 2 days ago
      Would it be necessary? I thought there was a standard for ground based augmentation of GPS?
  • alkonaut 2 days ago
    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!

    • vinay427 2 days ago
      The usual answer that will be thrown around to justify this is that London has the oldest underground metro system, whether that’s relevant or not. It doesn’t seem very relevant when even the deepest stations in Prague (which are newer but much deeper than most of London) have later added 5G throughout tunnels with download speeds of ~200 Mbps between stations.

      I suspect the UK just doesn’t have modern standards for mobile internet service, as it isn’t limited to TfL services in London.

      There isn’t even reliable mobile coverage on stretches of the West Coast Main Line rail corridor in England, which is outdoors and connects the UK’s most populous cities.

      Much of London isn’t particularly reliable either on most mobile networks, in my experience. Meanwhile, in cities like Prague or Washington I can often get mobile download speeds outdoors of 400 Mbps - 1-2 Gbps.

    • DrBazza 2 days ago
      Half the LU tunnels are barely larger than the train, the other half are cut'n'cover. And they're rarely straight. And most lines run from 5am to midnight. Some now run almost 24 hrs.

      That probably influences the decisions on roll-out and cost.

      TFL has been ahead-of-the-curve with the rollout of some tech (Oyster cards, tap'n'go), but not so much with others when they get hacked.

      https://www.bbc.co.uk/news/articles/c4gqg2elkj4o

      https://en.wikipedia.org/wiki/Oyster_card#Precursor

    • beejiu 2 days ago
      Almost all tunnel sections now have 4G/5G and everything should be done by the end of this year according to Tfl.
      • lol768 1 day ago
        They've given "targets" and deadlines before and failed to meet them. I would take whatever they say with a large portion of salt.
  • ekzy 1 day ago
    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.
  • aitchnyu 2 days ago
    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.
    • sorenjan 1 day ago
      To get position from accelerometer data you have to integrate it twice. Accelerometer data is noisy, and integrating noise quickly leads to large deviations. That's why you need some kind of absolute position reference, like GPS, to not get bigger and bigger errors.

      Here, they seem to estimate which stations they are at or between, and use that as absolute references.

      Your running app is using accelerometer data to recognize when you're taking a step, and combining that with GPS data to measure how far you're running. So if it measures 100 meter using GPS and counts 100 steps during that time, your step length is 1 m. Garmin watches uses this to measure your running distance on treadmills, but they want you to calibrate it by running with GPS on a flat surface outdoor first. I don't know if any watches or apps use this in combination with GPS to make better position estimates when the GPS reception is poor, my guess is no because it's really only useful for distance, not position, and generally when running outdoors you're not running in completely straight lines. But it should be possible to estimate distance and combining it with their routing software to guess which way you took for short parts of the course.

    • killingtime74 2 days ago
      (guessing) Stride length is a scalar, path is a vector? Inertial navigation systems suffer from a build up of the error. Perhaps it's not practical even if it's possible to calculate position based on those sensors alone
  • bsimpson 2 days ago
    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 2 days ago
    > 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?

    • 30blay 1 day ago
      Great question! I'm one of the developers behind this project and your guesses are good.

      Other difficult cases include trains stopping between two stations (doesn't happen everywhere, but it's frequent in NYC), or a user walking fast onboard a moving train, which can be mistaken for the user having gotten off the train.

      Taking a train in the opposite directions will break the assumptions we make and we won't know until the next GPS location

    • Lance_ET_Compte 1 day ago
      For the express vs. local, sometimes it will ASK me what train I am on. When there are delays that cause trains to be closer together, it does this. I presume they are crowd-sourcing some data instead of trying to only use an algorithm.

      I do love this "Transit" app though.

  • admax88qqq 1 day ago
    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.

    • 43920 1 day ago
      They do support payment in some cities (mine included), and it works pretty well.

      A bunch of the larger / better-funded systems are also moving to just accepting credit cards directly on the readers, which is even easier.

    • jer0me 1 day ago
      Some cities let you pay with contactless credit cards (at least London and New York have it; Boston and San Francisco are working on it) which seems like the most elegant solution to this, at least from a commuter’s point of view.
    • ladams 1 day ago
      You can pay in the app on the Denver RTD system!
  • svag 2 days ago
    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...

    • michaelt 2 days ago
      15 years ago, sat nav systems built into cars would sometimes be fitted with a rate gyro and get a wheel speed signal from the car - to make them work better in tunnels and other areas with poor GPS signals.

      (Of course, that one area of superior performance couldn't make up for the awful GUIs, the awful resistive touchscreens, the $100 map updates, and suchlike)

    • Cthulhu_ 2 days ago
      I can't see inside Maps, but it does look like they use accellerometer data or just assumptions to continue animating your position on the map. Assumption being for example that you will follow the route through the tunnel at your current average speed. Close and good enough for most tunnels I suppose.
    • sitkack 2 days ago
      Apple maps does this.
  • armada651 1 day ago
    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.

    • patrickmcnamara 1 day ago
      Trains at my U-Bahn station are as frequent as every two/three mins sometimes. There is no "the train they should be on".
      • armada651 1 day ago
        Right, but the vibration detection isn't used to detect which train they're on according to the article.
  • mattlondon 2 days ago
    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.

    • wtk 2 days ago
      Their website doesn't include London in the UK section (https://TRANSITAPP.COM/REGION).
      • andylynch 2 days ago
        Pretty sure that’s a mistake, they do elsewhere (https://transitapp.com/en/region/london/tfl ), and I’m using it ,right now.

        Not doing so would be astonishing given how many people use public transport here, and that TFL’s data is really, really open + easy to use.

        • wtk 2 days ago
          I checked twice in disbelief, but amongst many many places - London (UK) not being listed was surprising to me. I thought it's maybe some extra challenge of the oldest subway system.
    • wffurr 2 days ago
      You could write to them and ask them to support London. Maybe they'll fly Etienne over and have him ride the whole system!
    • itsgrimetime 2 days ago
      That’s a bummer, I use it daily in SF and the tracker it has for upcoming buses/trains has always been super accurate, and the stop countdown is always dead on. It even tells me when I need to speed up my walking to make it to the next bus in case it’s running a little early.
    • beejiu 2 days ago
      CityMapper is probably the best app for London, although I can't recall how it behaves in deep tunnels. I think it may just use a timer to alert you when to get off.
  • CarVac 1 day ago
    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.

  • tdiff 2 days ago
    I believe Yandex does smth. similar in their navigation in Moscow, because GPS is heavily jammed in some areas.
  • voidUpdate 2 days ago
    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?
    • rdsubhas 2 days ago
      I'd assume it's the length (in time) of the vibration since the last stop. There may be edge cases where if the train is moving slowly, but overall it's a smart technique.
      • voidUpdate 2 days ago
        If there's a delay that will really confuse it though, either if your train isn't going at the speed the app expects or it stops at a point outside of a station
        • bluGill 2 days ago
          It probably would, but if someone has the app running, then the app knows what train they are trying to get on, and so if the data is all consistent with being on a train they are probably on that train. The app also knows where the train is, so it knows where you are as well. It won't know which train car you are on, but that normally doesn't matter.

          This probably is wrong if trains for both directions stop at the same time from opposite sides of the same platform and you get on the wrong train. However this is a rare enough case that we can ignore it - but very annoying if you are that person (this case happens to most transit riders once or twice in their life). Even when this happens there often is other location data scattered around so you would likely only ride a stop or two before the app realizes you are on the wrong train and can reroute you.

  • eps 2 days ago
    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... ?

    • wffurr 2 days ago
      I was just wondering how well this would do on a system in poor repair with mixed generation trains that stop mid tunnel, i.e. Boston.
  • DrNosferatu 2 days ago
    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?

  • snodnipper 2 days ago
    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".
  • nycerrrrrrrrrr 1 day ago
    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.

  • elromulous 2 days ago
    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?
    • f1shy 2 days ago
      No idea, but think about fingerprinting through available Wi-Fi ssid and/or BT devices?
    • agos 2 days ago
      not in Milan though, even though we have full cellular coverage underground. I wonder why the difference
  • maxehmookau 2 days ago
    This is so freaking cool. What a fantastic idea and a great write-up.
  • ingen0s 2 days ago
    This is why I open this site everyday several times a day
  • 0xFEE1DEAD 2 days ago
    @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 2 days ago
    Is this the same sort of technique that Shazam uses?
  • exabyte 2 days ago
    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 1 day ago
    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

    • showerst 1 day ago
      This is called inertial navigation, and it works over short distances but then breaks down due to cumulative error.

      This is a pretty cool use case though since as you said it would be much easier over a fixed route.

  • h1fra 2 days ago
    Oh they so going to get bought by Google
  • Woeps 2 days ago
    Uhm, Don't most underground trains already show you where you are? Or at worst, the sign of the station shows you your location?
    • yaky 2 days ago
      I think it's one of the "pointless but cool" projects, but yes, I don't get it either. Any decent underground system would already have audio and visual announcements; I don't think I have ever cared to know where between stations the train is.
    • makeworld 2 days ago
      Supporting it in the app allows connection info (bus, other train, etc) to be updated and to warn the user if they'll be late.
  • jacooper 1 day ago
    Google maps(wuth google location service) is alao crazy accurate underground somehow.
  • starlite-5008 2 days ago
    Innovative
  • Avlin67 14 hours ago
    this is dope. my chinese GF loves it so much. so impressive.
  • riffic 1 day ago
    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 2 days ago
    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.

    • sourcepluck 2 days ago
      Any good links for reading more about Play Services access to the phone's accelerometer?
  • bambax 2 days ago
    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-...

    • zokier 2 days ago
      General dead reckoning is hard.

      But dead reckoning for train travel should be massively easier. Train movement is constrained to tracks so you only need to resolve how far along track train has moved + possible junctions, which should already make the problem much simpler than e.g. airplane ins where you are resolving full 3d position. To make things even more easier, you only need to reckon between individual stops which prevents error accumulation over the whole trip. Lastly you have schedule information, so you know roughly where the train should be at any given moment.

    • jackdh 2 days ago
      There is a very good set of podcasts[0] by Cautionary Tales about the German V2 rockets in WW2 which tried to use this. It was so hard the Allies allowed them to continue wasting money on it during the war. Well worth a listen to if you're into that.

      [0] https://timharford.com/2023/07/cautionary-tales-the-v2-trilo...

  • mateobelanger 2 days ago
    Test
  • gregoriol 2 days ago
    This is way too heavy computing, battery consumption, ... while fun engineering, it's very much inefficient to perform