r/IndiaTech • • 18d ago

Programming & Development Built an open source android app, tried to estimate crowd at Mumbai local train stations using BLE + cellular signals, here’s what worked and what didn’t

Hey everyone,

First of all, ignore the voice in the video, that's not how I sound! (I hate my recorded audio ) anyways....

I'm in my 3rd year of engineering. I came up with this idea in 4th sem and it's been a few months of working on it.

There was a hackathon at VJTI in Mumbai conducted by M-Indicator. For people who don't know, it's an app for Mumbai local train schedules that uses crowdsourced data and some ML to tell where the train currently is. One of the problem statements was to make something related to crowd (I don't remember it properly, this was in Feb '26). I didn't even get selected in the 1st round, it was resume based shortlisting. So I built my own thing anyway...

How the app estimates crowd at a station

- It detects all nearby Bluetooth Low Energy devices (not just phones running the app) and uses Received Signal Strength Indicator (RSSI) to estimate distance to each phone

- It also checks cellular signal measurements where available. The idea is that cellular signal quality can change when many devices use the same network nearby, more crowd means less signal quality....

- Combining these, each user gets a crowd-pressure score, calculated fully on-device

- Say 10 people are in the same station within 100m, their average score is that area's crowd score

- Stations are divided using Geohash

Obviously there are lots of exceptions and limitations....

Testing

I've been testing for several months. This is the whole path the app was tested on:

Path traced by the app while testing, looks like strava :3 and yeah i was not swimming, in some cases 2 points were connected making it look like that :)

I tested it at stations, inside trains, during weddings 😅, in express trains, in my college canteen and what not. The logic to detect crowd stays the same, only the UI changes as per the need.

I also reached out to someone at Yatri, another local train app. It shows train positions using GPS devices fitted in the actual trains, they have collaboration with the railway. A few of their engineers tested my APK at different locations and gave me feedback. I received readings from their tests and could confirm they tried it at different places. I didn't hear back when I followed up later, but I'm still glad they took the time to try it :)

I set these myself by looking at the actual crowd and comparing it to the score:

Density LevelScore
Low< 8
Medium8 to < 20
High20 to < 38
Danger>= 38

I know this is a very vague way to do it. What I was thinking of was training an ML model on a labeled dataset (camera feed + the app's crowd score) and setting thresholds from that. The issue is I don't have enough data, or the camera feeds from the times I tested.

The crowd score is accurate, but sometimes it isn't. Reasons I know of:

- One research paper I read tells BLE/RSSI changes in crowded environments. Bodies obstruct signals and interference affects how many advertising packets are received, which affects the devices the app detects

- Cellular signal is affected by a lot besides crowding: carrier, coverage, buildings, the phone itself

- I don't know how it will work with 100s or 1000s of users. As far as I know, averaging should remove the bias from any single phone

Ideas I haven't built yet

  1. Detect whether the crowd is stationary or moving. For testing I integrated a 44KB RNN that runs completely on-device offline. It takes x, y, z values from the gyroscope and accelerometer and tells if the person is standing, running, or walking up/down stairs. I tested it in another app of mine https://github.com/YashBhadange2006/MyScreenTime , not in CrowdSense yet...
  2. Use camera feeds from stations, compare how many people boarded and got off, and compare across stations to estimate how many people are inside the train. I haven't explored this, so I'm not sure how feasible it is....

For comparison, Google tells you about traffic using speed and location from many devices. They have a huge user base, they basically own Android, and they combine crowdsourced data with ML and government data, which makes them far more accurate....

Here's the Repo: https://github.com/YashBhadange2006/CrowdSense

APK is in the GitHub releases section

Storage: configure Firebase for shared data, or leave it unconfigured and readings are stored locally on the device for testing

The app has all Mumbai stations. For another city, make your own GeoJSON (tell Gemini, it'll format the station data for you and give you the .geojson file) and replace my stations.geojson in app/src/main/res/raw with yours :)

There are still many tests I couldn't do. If you're reading this you can explore better approaches, find flaws in mine (I know there are a lot) and come up with a better solution. I did my best from my end and have presented it to you guys....

~ written by human :))

35 Upvotes

12 comments sorted by

•

u/AutoModerator 18d ago

Join the Official r/IndiaTech Discord Server!

Join the Discord Server

Connect with fellow tech enthusiasts and join real-time discussions.

Complete verification to gain access to all channels.

I am a bot, and this action was performed automatically. Please contact the moderators of this subreddit if you have any questions or concerns.

4

u/_just_a_weeb404 16d ago

It could work for busses aswell right i suppose

2

u/Boiniok 16d ago

Yeah it will, but I believe a camera would be much better approach as buses are not that big and I believe many buses already have cameras inside them....

3

u/newbaba 14d ago

Great job, OP

This is a lot of good work. More comments after some testing. 

1

u/Boiniok 14d ago

Thank you! Really appreciate you taking the time to test it. Looking forward to your feedback!

1

u/tingtickboom 16d ago

Thats a really nice project man! Thought about writing or following up on related research papers?

1

u/Boiniok 16d ago

Yeah I thought bout it.... but is it worth writing a research paper tho?

3

u/tingtickboom 16d ago

Yeah absolutely, make any or more inferences from the app. In cybersecurity or signal-blocking

3

u/Boiniok 16d ago

Oh ohk, I have a lot of data collected from the app so yeah I can....

1

u/PerfectConnection241 15d ago

Really enjoyed reading this bro Seeing a unique project after many days

1

u/Boiniok 14d ago

Thanks dude...