KDE hotspot analysis and ML severity prediction to support FRSC road safety interventions across Nigeria.
# Road Accident Hotspot Analysis & Traffic Safety
GIS + spatial statistics system mapping road accident hotspots on Nigerian highways, supporting the Federal Road Safety Corps (FRSC) and state governments in targeting high-risk corridors for intervention.
---
## Problem Statement
Nigeria records over 10,000 road fatalities annually. Without data-driven hotspot maps, FRSC resources are deployed reactively. This system identifies where accidents cluster, why they happen, and which corridors need urgent safety interventions.
---
## Features
| Feature | Description |
|---------|-------------|
| KDE Hotspot Mapping | Kernel Density Estimation for accident concentration |
| DBSCAN Clustering | Spatial clusters of high-frequency accident zones |
| Severity Prediction | Random Forest model, Minor / Serious / Fatal |
| Risk Factor Analysis | Hour-of-day, weather, road-type breakdown |
| Interactive Heatmap | Folium map with annotated hotspot clusters |
---
## Tech Stack
| Layer | Technology |
|-------|-----------|
| Geospatial | GeoPandas, Folium, Shapely |
| Machine Learning | scikit-learn (Random Forest, KDE) |
| Data | pandas, NumPy |
| Visualisation | Matplotlib, Seaborn, Plotly |
---
## Project Structure
```
road-accident-hotspot/
├── src/
│ ├── data_loader.py # Accident record ingestion & preprocessing
│ ├── analysis.py # KDE hotspot detection, clustering, severity model
│ └── visualize.py # Hotspot maps and risk factor charts
├── data/raw/ # FRSC accident logs, road network, weather data
├── models/ # Saved severity classifier
├── config.yaml # Parameters: bandwidth, thresholds, model config
├── main.py # Pipeline entry point
└── requirements.txt
```
---
## Quick Start
```bash
git clone
github.com
cd road-accident-hotspot
pip install -r requirements.txt
python main.py
```
---
## Data Sources
- FRSC accident reports (GPS coordinates, …