VictorMutinda/Intelligent_Route_Risk_Analyzer
Intelligent Route Risk Analyzer
This is an intelligent predictive geospatial Route Risk analyzer dashboard built for long-haul operations across major commercial transit corridors across the continent. This application interfaces with the live Weather-AI Engine, models highway waypoints using the Open Source Routing Machine (OSRM), and runs a localized weighted hazard assessment matrix to compute continuous point-to-point risk profiles for people(Drivers) in Transit.
Live Hosted Application on Hugging Face Spaces: [https://huggingface.co/spaces/VictorMutinda/IntelligentRouteRisk_Analyzer]
System Architecture & Methodology
The application follows a decoupled three-tier software design pattern: 1.Geospatial Processing Layer (src/data_loader.py) This Translates physical logistics sectors (e.g., Nairobi to Mombasa) into absolute geographic waypoint polylines.
2.Predictive Analytics Layer (src/risk_model.py) It Normalizes distinct weather factors. The factors have used are windspeed, precipitation and visibility index. It computes continuous risk indices via a weighted combination matrix, and simulates contextual intelligence layers.
3.Presentation & Dashboard Layer (app.py) An interactive web application presenting real-time maps, visual progress tracking scales, and clear fleet status alerts. The status alerts are:
- 'CLEAR FOR DEPARTURE'
- 'PROCEED WITH CAUTION'
- 'HOLD / REROUTE'
ARCHITECHTURE / Data Flow
[---User Input ---] // These are the Start and Destination Location. For this demo. We have Mombasa, Nairobi, Nakuru AND Kisumu | [---GeoCoding & Route Engine ---] // Fetches path co-ordinates(Latitude & Longitude). | [---Weather Data Ingestion ---] // Queries Weather-AI API per waypoint and fetches weather info for that waypoint | [---ML Risk Scoring Engine---] // Evaluates anomalies & hazardous alerts on the weather extracted from each waypoint. And provides meaningful info | [---Interactive Frontend UI---] // Displays a dynamic route map with 6 marked waypoints along the route. Each waypoint has a safety rating.
How To Run And Test Locally
- Clone the Code Base Run the following: . git clone https://huggingface.co/spaces/VictorMutinda/IntelligentRouteRiskAnalyzer . cd IntelligentRouteRiskAnalyzer
- Configure Your Virtual Environment Run the following: .pip install -r requirements.txt
- Setup Your API key
- At the root of the project create a folder called ".streamlit"
- In the folder create a file called "secrets.toml"
- In side the file add your api key as this WEATHERAIKEY = "paste your weather-ai.co API Key here"
- Execute the Local Automated Test Pipeline Run the following: .streamlit run test_pipeline.py
- Launch the Dashboard Interface Run the following: .streamlit run app.py
