Inspiration
What it doesSafeRoute
Inspiration
Road accidents often increase during adverse weather conditions such as heavy rain, storms, fog, and snowfall. While existing navigation applications focus mainly on the fastest or shortest route, they rarely consider weather-related risks. We wanted to build a solution that prioritizes traveler safety by combining real-time weather data with Artificial Intelligence to recommend the safest route.
What it does
SafeRoute is an AI-powered weather-aware navigation system that generates up to three alternative routes between a source and destination. It collects real-time weather information at multiple points along each route and uses a trained Machine Learning model to predict the safety risk level.
The application provides:
- Multiple alternative routes
- Real-time weather conditions
- Route risk score (Safe, Low, Moderate, High)
- Confidence score
- Risk explanation
- Safety recommendations
This helps users make informed travel decisions instead of choosing only the fastest route.
How we built it
We developed the project using a full-stack architecture.
Frontend
- React 19
- Vite
- React Leaflet
- Axios
Backend
- FastAPI
- Uvicorn
- Pydantic
APIs
- OpenRouteService for route generation
- Open-Meteo for real-time weather
- Nominatim for geocoding
Machine Learning
We trained multiple classification models, including:
- LightGBM
- Random Forest
- XGBoost
- CatBoost
- ExtraTrees
- Gradient Boosting
The best-performing model was automatically selected based on the F1-Macro score and used for route risk prediction.
How it works
- The user enters the source and destination.
- Nominatim converts the locations into coordinates.
- OpenRouteService generates up to three alternative routes.
- Four evenly spaced points are selected on each route.
- Open-Meteo provides real-time weather for each point.
- Weather data is sent to the FastAPI backend.
- The Machine Learning model predicts the risk for every segment.
- The overall route risk is calculated.
- The safest route and driving recommendations are shown to the user.
Challenges we faced
- Integrating multiple APIs into one workflow.
- Collecting weather data efficiently for different route points.
- Training and comparing multiple Machine Learning models.
- Designing an effective route risk calculation.
- Synchronizing frontend map visualization with backend predictions.
- Handling API failures with a fallback risk scoring method.
What we learned
This project helped us gain practical experience in:
- Full-stack web development
- REST API integration
- Machine Learning model training and evaluation
- Real-time data processing
- Interactive map visualization
- Building AI-powered applications
What's next
We plan to improve SafeRoute by adding:
- Live traffic analysis
- Accident prediction
- Flood and road closure detection
- Driver-specific recommendations
- Mobile application support
- Emergency alert integration
- Personalized route preferences
Impact
SafeRoute transforms traditional navigation into a safety-first navigation system by combining AI, weather analysis, and real-time routing. Instead of simply guiding users to the fastest destination, it helps them choose the safest route for their journey.
How we built it
Challenges we ran into
Accomplishments that we're proud of
What we learned
What's next for SafeRoute AI
Built With
- axios
- catboost
- css
- fastapi
- forest
- git
- html
- javascript
- leaflet.js
- learning
- lightgbm
- machine
- nominatim
- open-meteo
- openrouteservice
- openstreetmap
- pydantic
- python
- random
- react
- rest
- scikit-learn
- uvicorn
- vite
Log in or sign up for Devpost to join the conversation.