Driver Safety AI
Predictive Risk Management System
A predictive analytics system for driver safety using DriveCam/Lytx-style behavioral data — clustering and classification to profile risk, trigger alerts and drive preventive coaching.
95%
Prediction accuracy
-25%
Repeat violations
500K+
Events analyzed
-20%
Reporting latency
Business challenge
Fleet safety programs react after incidents happen. The goal was to predict which drivers are trending toward high risk so coaching can happen before an incident, not after.
What I built
I built K-Means clustering to segment drivers and a Random Forest classifier to label high / moderate / low risk from in-cabin, controllable and external behavior triggers. The system produces risk alerts, a driver comparison dashboard, performance scores and preventive coaching recommendations. Achieved 95% prediction accuracy and contributed to a 25% reduction in repeat safety violations.
Why it matters
Safety incidents are costly — in dollars, in insurance premiums and in lives. A predictive approach turns a reactive safety program into a proactive one, targeting coaching where it will prevent the most harm.
How it's designed
Interface
How the intelligence flows
- 01Ingest — DriveCam/Lytx-style behavioral event data (500,000+ events).
- 02Feature engineering — in-cabin, controllable driving and external factor triggers.
- 03Segment — K-Means clustering into risk cohorts.
- 04Classify — Random Forest for high / moderate / low risk (70/30 train-test split).
- 05Evaluate — confusion-matrix analysis of model performance.
- 06Act — risk alerts, performance scoring and coaching recommendations.
How data is modeled
- Snowflake and SQL Server as the analytics stores for event and driver data.
- Feature tables aggregating triggers per driver and time window.
- Model output tables: risk labels, scores and cluster assignments.
- Optimized queries for a 20% latency reduction on reporting.
Key endpoints
/drivers/{id}/riskRisk label, score and cluster for a driver./drivers/compareDriver comparison dashboard data./alertsActive high-risk alerts for intervention.Technologies
Key features
- High / moderate / low risk driver profiling.
- In-cabin, controllable and external behavior triggers.
- Risk alerts for proactive intervention.
- Driver comparison dashboard.
- Preventive coaching recommendations.
- Driver performance scoring.
- Route optimization and readiness assessment (roadmap).
Challenges & trade-offs
Signal in behavioral noise
Behavioral triggers are noisy; careful feature engineering across in-cabin, controllable and external factors was key to a usable model.
Actionable, not just accurate
A risk label is only useful if it drives coaching — so outputs were designed as alerts and recommendations, not just scores.
Code snippet
X = engineer_triggers(events) # in-cabin + controllable + external
X_train, X_test, y_train, y_test = train_test_split(X, y, test_size=0.30)
clf = RandomForestClassifier(n_estimators=300, class_weight="balanced")
clf.fit(X_train, y_train)
preds = clf.predict(X_test)
print(confusion_matrix(y_test, preds)) # evaluate high / moderate / low
drivers["risk"] = clf.predict(X) # -> alerts + coachingHow it ships
- Batch scoring pipeline feeding Tableau dashboards.
- Scheduled model runs over refreshed event data.
Security
- — Access-controlled driver data.
- — Aggregated reporting to protect individual privacy where appropriate.
Scalability
- — Set-based SQL and Snowflake for large event volumes.
- — Vectorized feature computation in Pandas.