RailRelax is an AI-powered, real-time crowd density detection system for Mumbai local trains. Using low-cost hardware like ESP32-CAM and deep learning models like YOLOv3, RailRelax helps commuters choose less crowded compartments for a safer and more comfortable journey.
Mumbai's local trains handle 7.5 million daily commuters over a network spanning 390 km. Peak hours often cram up to 4500 passengers into coaches built for 1750, leading to:
- Delays and discomfort
- Accidents and fatalities (7–8 deaths daily on average)
- Unsafe passenger distribution
- 📷 Use ESP32-CAM modules and YOLOv3 for real-time people detection.
- ☁️ Store compartment-wise passenger data in Firebase Realtime Database.
- 📱 Provide crowd status via a mobile app as "Empty", "Partially Filled", or "Crowded".
- ⚙️ Optimize detection performance for embedded systems and low-power devices.
- Capture: ESP32-CAM captures images at regular intervals (approx. 5 min).
- Detection: YOLOv3 identifies people in images.
- Aggregation: Count from two cameras per compartment → maximum used as final count.
- Upload: Data is pushed to Firebase RTDB.
- Fetch: The mobile app polls the database and visualizes the data.
- ESP32-CAM modules (2 per compartment)
- Raspberry Pi 4 (optional)
- MicroSD, power supplies, and ESP cables
- Firebase cloud (storage + API)
- Python, OpenCV, NumPy, TensorFlow/Keras
- YOLOv3 for object detection
- Firebase for real-time data
- Flutter/Dart for app frontend
- Flask for API endpoint setup (optional)
| Model | Precision | Recall | mAP@0.50 |
|---|---|---|---|
| YOLOv3 | 54.0 | 99.6 | 35.0 |
| YOLOv4-Tiny | 84.0 | 51.0 | 62.2 |
| YOLOv8 | 83.8 | 68.1 | 78.2 |
🔍 YOLOv3 was chosen for its high recall and low resource usage, making it ideal for real-time embedded use despite its moderate mAP.
RailRelax/
└── trains/
└── trainID_12345/
└── compartments/
└── C4/
├── cam1_count: 10
├── cam2_count: 15
├── final_count: 15
└── status: "Partially Filled"
| Feature | Existing Local System | 🚆 RailRelax |
|---|---|---|
| Language Support | Only English & Marathi | Multilingual |
| Real-Time Updates | ❌ | ✅ |
| Compartment Crowding | ❌ | ✅ |
| User Interface | Text-heavy | App-based, intuitive |
- 🔌 Flash ESP32-CAM with image capture code and Wi-Fi credentials.
- 🧠 Set up YOLOv3 detection on a local or cloud-based Python server.
- ☁️ Send crowd count to Firebase using REST API calls.
- 📱 The mobile app fetches count every 5 minutes and displays compartment crowd status.
- 🚻 Integrate gender classification for safety and analytics.
- 📍 Add GPS tracking to link crowd data with live station location.
- 🏙️ Extend to metros and railways in other major Indian cities.
- 📖 Publish results in transportation and AI research journals.
- IEEE - Passenger Detection & Counting (2019)
- An Improved Deep Learning Architecture for Transport (2023)
- EfficientDet on Transport Datasets (IEEE 2023)
- Tracking People Boarding Trains (MDPI 2020)
- YOLO Object Detection - Comprehensive Review (2022)
📁 Datasets Used:
| Name | Roll No. | Branch |
|---|---|---|
| Anisha Shankar | D12B / 06 | CMPN |
| Himaja Pannati | D12B / 40 | CMPN |
| Wafiya Shaikh | D12B / 48 | CMPN |
| Anjali Thakrani | D12B / 57 | CMPN |
🎓 Mentor: Mrs. Lifna C.S.
RailRelax leverages deep learning and edge computing to address Mumbai’s commuter crisis. By providing real-time, compartment-specific crowd data, it empowers passengers to make safer, smarter travel choices.
This innovation lays the groundwork for smarter urban mobility and scalable crowd management systems in public transport across India and beyond.


