NLP Brain
TF-IDF over hazard lexicon from unstructured alerts (ice, collision, closure) → text risk T.
Smart-Shield fuses Ontario 511-style alerts (NLP), road-surface vision, and environmental collision risk into one Safety Score S, with speed guidance for Ontario highways and 400-series corridors.
Live map on Render. On a phone, use /mobile. Free hosting may take about a minute to wake on first open.
Smart-Shield AI is a Sheridan College team project (Team 2B). Author: Afolabi Adesina.
My role: Team Lead.
Teammates sourced datasets and research papers alongside me and contributed design input.
Why this project: I took this project personally. Working in a manufacturing plant at Lafarge Africa taught me that safety means everyone goes home safe at the end of the day.
Each pillar outputs a 0–1 risk signal. Fusion weights produce the operational Safety Score.
TF-IDF over hazard lexicon from unstructured alerts (ice, collision, closure) → text risk T.
ResNet18 (+ optional autoencoder) on road imagery → surface hazard confidence V.
Weather / surface / lighting signals calibrated to literature → environmental index E.
Open the live map demo on Render. This is the map-in-action view with routes, the 403 exit demo, and settings. The Safety Score sliders below stay on this page.
Try this first: tap Play 403 exit demo.
Cold start: free hosting may take about a minute to wake on first open.
Drag the sliders to update S, the risk band and speed advice.
Formula:
S = (wT·T + wV·V + wE·E) × 100
Notebook defaults: wT=0.25, wV=0.35, wE=0.40
Moderate Risk
Recommended speed: ~80% of posted limit (e.g. 80 km/h).
| S | Category | Speed advice |
|---|---|---|
| 0–30 | Low | ~100% posted |
| 31–70 | Moderate | ~80% posted |
| 71–100 | High | ~60% posted (freeway advisory floor often shown as 80 km/h) |
Values below are synced to the latest notebook outputs and D3 evidence pack. The model was tuned to catch rare high-risk events (recall) at the cost of many false alarms (low precision), which is typical for rare-event safety screening.
| Check | Current value | Why it matters |
|---|---|---|
| Stage A Fatal recall | 1.000 @ threshold 0.5 (precision 0.0008) | KPI gate met for missed-Fatal risk, with false-alarm trade-off disclosed |
| Best baseline MCC | KNN = 0.3819 | Best raw ranking score among 3-class baselines |
| Deploy model | RF Tuned (MCC 0.1641) | Chosen for SHAP explainability and auditability, not MCC leadership |
| Geo fairness audit | Parity gap = 0.0387 (PASS ≤ 0.05) | Urban vs Suburban/Rural accuracy gap currently within threshold |
Prefer the split notebooks under notebooks/parts/. They are easier to run than one giant Run All.
| Part | Notebook | Focus |
|---|---|---|
| 01 | 01_charter_eda_features.ipynb | Charter → EDA → features |
| 02 | 02_vision_brain.ipynb | ResNet + AE (GPU recommended) |
| 03 | 03_tabular_ml.ipynb | SMOTE, GridSearch, ethics |
| 04 | 04_fusion_deploy.ipynb | Fusion, SHAP, deploy artifacts |
This hosted page is an interactive Safety Score explorer and documentation. The map demo also runs live on Render (phone layout at /mobile). You can still run the Flask demo on your machine if you want the full local stack.
cd demo pip install -r requirements-demo.txt python api_server.py # → http://127.0.0.1:5050 # Real Vision mode: nearest Ontario 511 CCTV → ResNet18 → V in Safety Score S
Prefer the live Render demo for a quick look. This GitHub Pages site does not run Flask, GPU inference, or the model weights. Local setup is for development with the trained models folder.