AI-System for Accident Prediction and Hazard Detection
Predicting accident locations and timing enables proactive patrol reinforcement, implementing temporary speed restrictions, and planning repairs on accident-prone sections. ML systems like PredPol-Traffic achieve 70-80% accuracy in identifying high-risk zones with 15-minute horizon.
Data for Accident Prediction
Historical Accident Data:
- Traffic police database: accidents with geolocation, time, type, severity
- Accident map (gibdd.ru): public data
- European CARE: European Road Accident Research and Education
Road Infrastructure:
- Road design (curvature, lane count, surface type)
- Signs and markings (rules, restrictions)
- Lighting, intersection type
- Technical condition (history of pothole repairs)
Situational Factors:
- Weather: rain, snow, fog, ice
- Visibility: dusk, night, bright sun
- Traffic: intensity, flow speed
- Time of day and day of week
Feature Engineering
Spatial Features:
def spatial_accident_features(segment_id, historical_accidents):
"""
For each road segment — spatial characteristics
"""
return {
'accident_count_1year': count(accidents_last_year),
'accident_severity_mean': mean(injury_severity_scores),
'accident_rate_per_mvkt': accidents / (aadt * segment_length_km / 1000),
'nearby_accidents_500m': count(accidents_within_500m),
'ped_crossings_per_km': pedestrian_crossings / segment_length,
'intersection_density': intersections / segment_length,
'curvature_index': mean_curvature,
'speed_limit': posted_speed_limit
}
Temporal Features:
- Cyclic time encoding (sin/cos of hour and day)
- Peak periods: morning, evening, night hours
- Weekends and holidays
Environmental Features:
- Weather forecast: hour ahead of prediction
- Darkness: astronomical calculations of sunrise/sunset
- Road conditions: wet road, ice (NWP data)
Prediction Models
Task 1: Hotspot Prediction (Spatial) Predict probability of accident on each segment in next X hours.
# XGBoost classifier
model = XGBClassifier(
max_depth=6,
n_estimators=300,
learning_rate=0.05,
scale_pos_weight=neg_count/pos_count # imbalance: accidents are rare
)
Task 2: Severity Prediction Classification: property damage only / minor injuries / serious injury / fatality. For proper resource allocation: high severity → faster response.
Task 3: Near-Miss Detection Dangerous situations (near miss) — precursors to accidents. Detection from road camera video: sudden braking, emergency lane change. CV model: YOLOv8 for vehicle detection + tracking + TTC (Time To Collision) calculation.
Real-Time Alert System
Dynamic Signs: On predicted high risk for specific segment:
- Dynamic VMS signs: speed limit -20 km/h
- Traffic signal control: increase red phase to reduce flow speed
Emergency Services:
- Traffic police: automatic notification → additional patrol to risk zone
- ECTS: alert for city transport dispatchers
Drivers:
- Yandex Maps / 2GIS: display high-risk zones
- Push notifications when entering high-risk zone (with consent)
Cause Analysis and Safety Measures
Black Spot Analysis:
def identify_black_spots(accidents_gdf, grid_size=100, threshold_accidents=3):
"""
EU standard: segment = black spot if ≥3 accidents with injuries
in 3 years on 300m of road
"""
grid = create_grid(city_boundary, grid_size)
for cell in grid:
cell.accident_count = count(accidents_in_cell)
if cell.accident_count >= threshold_accidents:
cell.is_black_spot = True
return grid
Counterfactual Analysis: SHAP for explanation: why did specific segment become hotspot. If main factor is poor visibility → recommendation: add lighting.
ROI-Driven Prioritization: Ranking safety improvement interventions:
Benefit = expected_accidents_prevented × avg_accident_cost
Cost = engineering_intervention_cost
ROI = Benefit / Cost
Timeline: basic hotspot model on historical traffic police data — 3-4 weeks. Real-time system with dynamic signs and traffic police integration — 3-4 months.







