8 Dangerousness Metric - incluit/OpenVino-For-SmartCity GitHub Wiki
As a starting point for this PoC we wanted to be able to classify intersections by its dangerousness. In order to do that, after identifying those situations (collisions and near misses), we created a metric to weight those events. Each event is registered and scored. In the calculation of this metric we wanted to take into account different factors: * Each event has a different severity, a pedestrian not crossing on a crosswalk is not the same as a car crash. * The activity on a street throughout the day varies. * The number of detections (cars/pedestrians) should be reflected in the final value. A street where only 2 cars where detected and crashed should be more dangerous than one where 100 cars were detected and only 1 crash happened.
First, we defined a "value of severity" for each Near-miss/collision event:
ID |
Evento |
Clase 1 |
Clase 2 |
Weight |
Description |
0 |
Collision |
Car |
Car |
45 |
Car Crash |
1 |
Collision |
Car |
Pedestrian |
55 |
Car vs Pedestrian |
2 |
Near Miss |
Car |
NaN |
5 |
Strong speed change |
3 |
Near Miss |
Pedestrian |
Nan |
2 |
Off crosswalk |
4 |
Near Miss |
Car |
Pedestrian |
12 |
Car on crosswalk |
5 |
Near Miss |
Car |
Nan |
17 |
Car on sidewalk |
6 |
Near Miss |
Car |
Nan |
20 |
Car in wrong direction |
After that, we calculate a "weighted average" considering the sum of every event detected and the total amount of detected objects.
metric = sum(w[id]*n_id) / n_total_objects
being n_id the total number of events of a determined class and w[id] the weight corresponding to that kind of event according to the previous table.