The world's first Urban Safety & Health Intelligence Platform that prioritizes your life over your clock.
Current navigation apps are obsessed with time but blind to humanity. They route us through toxic pollution, dark isolated streets, and over hazardous roads β just to save sixty seconds. SafeMap changes that.
π Run Backend Server Instructions (MUST)
APP DATA FLOW
Each route is evaluated using street light density, crowding levels, safety conditions, and environmental factors to produce a real-time Safety Score.
- Search a destination and see multiple route options with a safety score beside each.
- Instead of just the fastest route, SafeMap suggests the safest optimal route.
- Routes are dynamically re-ranked as live conditions change.
Not every risk affects safety equally β our model prioritizes direct threats to life first.
| Factor | Impact | Normal Weight | Women Mode Weight |
|---|---|---|---|
| Crime history | Direct physical danger | 0.40 | 0.50 β |
| Street lighting | Crime deterrent | 0.25 | 0.30 β |
| Crowd density | Social protection | 0.15 | 0.15 β |
| Potholes | Accident risk | 0.20 | 0.05 β |
Formulas:
Using the accelerometer and gyroscope already built into every smartphone, SafeMap automatically fingerprints road hazards.
- Potholes are detected in real time while driving β no manual input needed.
- Detected hazards are instantly shared with every user navigating the same route, creating a live, crowdsourced safety map.
- Every driver in the network is warned before they hit a single bump.
Users can report live incidents by uploading photos and descriptions.
- AI summarizes, analyzes, and classifies the incident automatically.
- Alerts are broadcast in real time β dynamically recalculating nearby users' routes.
- Built-in SOS system allows users to instantly call emergency numbers with one tap.
SafeMap uses edge-AI (a trained Random Forest ML model) to detect emergency sirens through the device microphone.
- Nearby devices automatically form a Sensor Mesh Network β a decentralized, real-time communication layer between all SafeMap users on the road.
- To eliminate false alarms, the system requires multi-device confirmation β all drivers within a 400m range must corroborate the detection through the mesh.
- Once confirmed, a route-wide "Give Way" alert propagates across the mesh to nearby drivers.
- This significantly cuts down emergency response times β and saves lives.
A specialized Women's Mode analyzes street lighting density, foot traffic data, and identifies narrow or isolated roads.
- Isolated and poorly lit routes are intentionally penalized in routing.
- Navigation after dark always prioritizes visibility and public safety over speed.
- Unsafe roads are highlighted in red; safer, well-lit roads in green.
Before the engine even starts, SafeMap uses high-precision MediaPipe AI to scan for fatigue and eye irritation via the front camera.
- Real-time eye-blink and facial landmark detection.
- If fatigue is detected, the system warns: "Driver Fatigue Detected β Please Rest".
- Ensures you are mentally and physically fit to drive before you enter the flow of traffic.
| Area | How SafeMap Helps |
|---|---|
| Road Accidents | Real-time pothole & hazard warnings reduce collision risk |
| Emergency Response | Multi-device siren detection clears roads for ambulances & fire trucks |
| Women's Safety | Night-safe routing through well-lit, high-traffic corridors |
| Breath Easy Mode | Optimizes routes for minimal pollution exposure (AQI, PM2.5, NOβ) and uses AI to summarize air quality differences. |
| Drowsy Driving | Pre-ride fatigue checks prevent impaired driving |
| Community Safety | Crowdsourced incident reporting creates a live urban intelligence layer |
| Layer | Technology |
|---|---|
| Mobile Frontend | React Native |
| Database | Firestore |
| Maps & Navigation | Mapbox API |
| LLM / AI Assistant | Ollama 3.1 |
| Sound Classification | Random Forest ML Model |
| LLM Orchestration | LangChain |
| Image Processing | OpenCV |
| Backend API | FastAPI |
- Install apk files from GitHub releases and start using the application.
- To connect backend, open the app, go to Settings, scroll to the bottom, and enter the IP address of the computer where the backend is running.
- Node.js: v18 or higher recommended
- Python: v3.9 or higher recommended
- Expo CLI:
npm install -g expo-cli - Android Studio / Android SDK: Required if you want to run the native Android build locally.
- Physical Android Device: Recommended for testing hardware features (Camera, Microphone).
EXPO_PUBLIC_MAPBOX_TOKEN=your_mapbox_token_here
Navigate to safe_map_git β it contains the whole codebase for the mobile app, as well as the fully integrated backend.
-
Install Node dependencies:
npm install
-
Rebuild and run the native Android app. Connect your physical Android device via USB (with USB Debugging enabled), then run:
npx expo run:android
This command will:
- Generate the missing
android/directory (Prebuild phase). - Compile the native Android APK.
- Install the app on your connected device.
- Start the Metro Bundler terminal.
- Generate the missing
For subsequent runs: If you haven't added any new native packages, you don't need to rebuild the APK. Just run npx expo start and open the app on your phone.
The backend powers the AI routing, Siren Detection, and Drowsiness checks.
- Navigate to the backend folder:
cd safe_map_git/backend - Create a virtual environment (optional but recommended):
python -m venv venv source venv/bin/activate # On Windows: venv\Scripts\activate
- Install dependencies:
pip install -r requirements.txt
- Start the FastAPI server:
(Using
uvicorn app.main:app --host 0.0.0.0 --port 8000 --reload
0.0.0.0is crucial so your phone can access the server over your local Wi-Fi).
> Note your computer's local IP address (e.g., 192.168.1.5 or 10.1.7.47). You will need this to connect the app later.
For eg:
Open App -> Go to Settings -> Scroll Down -> Click on Backend API URL -> change the Backend API URL to http://<YOUR_LOCAL_IP_ADDRESS>
This is needed as backend will run on your Local Machine (laptop)