Sheridan INFO53883 · Capstone Team 2B · Ontario highway safety

Highway risk you can read before you drive.

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.

About this project

Smart-Shield AI is a Sheridan College team project (Team 2B). Author: Afolabi Adesina.

My role: Team Lead.

  • Proposed the project topic.
  • Led the exploratory data analysis methods.
  • Developed the mathematical formula behind the Safety Score and shaped parts of the analysis to match it.
  • Recommended OpenStreetMap over Google Maps to avoid API fees.
  • Trained the model on a DGX server.

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.

Back to the portfolio home

Three model inputs

Each pillar outputs a 0–1 risk signal. Fusion weights produce the operational Safety Score.

Pillar T

NLP Brain

TF-IDF over hazard lexicon from unstructured alerts (ice, collision, closure) → text risk T.

Pillar V

Vision Brain

ResNet18 (+ optional autoencoder) on road imagery → surface hazard confidence V.

Pillar E

Environment

Weather / surface / lighting signals calibrated to literature → environmental index E.

See it in action

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.

What you will find
  • Find safest route: enter start and destination. Safety ratings: 0–30 low, 31–70 medium, 71–100 high. Turn-by-turn directions are included.
  • Play 403 exit demo: simulated drive with trip and driver safety scores. Export CSV when you are done.
  • Settings: road conditions (clear, wet, blizzard, ice storm), day or night, camera alerts, voice guidance, and how camera images are scored.
  • Data: OpenStreetMap and City of Toronto open data. Not official MTO or 511 guidance.

Interactive Safety Score

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

Live fused score 43
Decision table

Moderate Risk

Recommended speed: ~80% of posted limit (e.g. 80 km/h).

SCategorySpeed advice
0–30Low~100% posted
31–70Moderate~80% posted
71–100High~60% posted (freeway advisory floor often shown as 80 km/h)

Latest Validation Snapshot

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.

CheckCurrent valueWhy it matters
Stage A Fatal recall1.000 @ threshold 0.5 (precision 0.0008)KPI gate met for missed-Fatal risk, with false-alarm trade-off disclosed
Best baseline MCCKNN = 0.3819Best raw ranking score among 3-class baselines
Deploy modelRF Tuned (MCC 0.1641)Chosen for SHAP explainability and auditability, not MCC leadership
Geo fairness auditParity gap = 0.0387 (PASS ≤ 0.05)Urban vs Suburban/Rural accuracy gap currently within threshold

How to run the project

Prefer the split notebooks under notebooks/parts/. They are easier to run than one giant Run All.

PartNotebookFocus
0101_charter_eda_features.ipynbCharter → EDA → features
0202_vision_brain.ipynbResNet + AE (GPU recommended)
0303_tabular_ml.ipynbSMOTE, GridSearch, ethics
0404_fusion_deploy.ipynbFusion, SHAP, deploy artifacts

Links and local demo

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.

Optional local map demo (live CCTV + models)
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.