metrics.md 4.42 KB
Newer Older
Chengyu Wang's avatar
Chengyu Wang committed
1
2
3
# Metrics

## OpenLane-V2 Score
zhe chen's avatar
zhe chen committed
4

Chengyu Wang's avatar
Chengyu Wang committed
5
To evaluate performances on different aspects of the task, several metrics are adopted:
zhe chen's avatar
zhe chen committed
6
7
8
9
10

- $\\text{DET}\_{l}$ for mAP on directed lane centerlines,
- $\\text{DET}\_{t}$ for mAP on traffic elements,
- $\\text{TOP}\_{ll}$ for mAP on topology among lane centerlines,
- $\\text{TOP}\_{lt}$ for mAP on topology between lane centerlines and traffic elements.
Chengyu Wang's avatar
Chengyu Wang committed
11
12
13
14

We consolidate the above metrics by computing an average of them, resulting in the **OpenLane-V2 Score (OLS)**.

### Lane Centerline
zhe chen's avatar
zhe chen committed
15
16
17
18

We adopt the average precision (AP) but define a match of lane centerlines by considering the discrete Frechet distance
in the 3D space. The mAP for lane centerlines is averaged over match thresholds of $\\{1.0, 2.0, 3.0\\}$ on the
similarity measure.
Chengyu Wang's avatar
Chengyu Wang committed
19
20

### Traffic Element
zhe chen's avatar
zhe chen committed
21
22
23
24

Similarly, we use AP to evaluate the task of traffic element detection. We consider IoU distance as the affinity measure
with a match threshold of $0.75$. Besides, traffic elements have their own attribute. For instance, a traffic light can
be red or green, which indicates the drivable state of the lane. Therefore, the mAP is then averaged over attributes.
Chengyu Wang's avatar
Chengyu Wang committed
25
26
27

### Topology

zhe chen's avatar
zhe chen committed
28
29
30
31
32
The topology metrics estimate the goodness of the relationship among lane centerlines and the relationship between lane
centerlines and traffic elements. To formulate the task of topology prediction as a link prediction problem, we first
determine a match of ground truth and predicted vertices (lane centerlines and traffic elements) in the relationship
graph. We choose Frechet and IoU distance for the lane centerline and traffic element respectively. Also, the metric is
average over different recalls.
Chengyu Wang's avatar
Chengyu Wang committed
33

zhe chen's avatar
zhe chen committed
34
35
36
37
38
39
We adopt mAP from link prediction, which is defined as a mean of APs over all vertices. Two vertices are regarded as
connected if the predicted confidence of the edge is greater than $0.5$. The AP of a vertex is obtained by ranking all
predicted edges and calculating the accumulative mean of the precisions:

$$ mAP = \\frac{1}{|V|} \\sum\_{v \\in V} \\frac{\\sum\_{\\hat{n} \\in \\hat{N}(v)} P(\\hat{n}) \\mathbb{1}(\\hat{n}
\\in N(v))}{|N(v)|}, $$
Chengyu Wang's avatar
Chengyu Wang committed
40

zhe chen's avatar
zhe chen committed
41
42
where $N(v)$ denotes ordered list of neighbors of vertex $v$ ranked by confidence and $P(v)$ is the precision of the
$i$-th vertex $v$ in the ordered list.
Chengyu Wang's avatar
Chengyu Wang committed
43

zhe chen's avatar
zhe chen committed
44
45
46
47
Given ground truth and predicted connectivity of lane centerlines, the mAP is calculated on $G^{l} = (V^{l}, E^{l})$ and
$\\hat{G}^{l} = (\\hat{V}^{l}, \\hat{E}^{l})$. As the given graphs are directed, e.g., the ending point of a lane
centerline is connected to the starting point of the next lane centerline, we take the mean of mAP over graphs with only
in-going or out-going edges.
Chengyu Wang's avatar
Chengyu Wang committed
48

zhe chen's avatar
zhe chen committed
49
50
51
52
To evaluate the predicted topology between lane centerlines and traffic elements, we ignore the relationship among lane
centerlines. The relationship among traffic elements is also not taken into consideration. Thus this can be seen as a
link prediction problem on a bipartite undirected graph that $G = (V^{l} \\cup V^{t}, E)$ and $\\hat{G} = (\\hat{V}^{l}
\\cup \\hat{V}^{t}, \\hat{E})$.
Chengyu Wang's avatar
Chengyu Wang committed
53
54

## Distances
zhe chen's avatar
zhe chen committed
55
56
57

To measure the similarity between ground truth and predicted instances, we adopt Frechet and IoU distances for directed
curves and 2D bounding boxes respectively.
Chengyu Wang's avatar
Chengyu Wang committed
58
59

### Frechet Distance
zhe chen's avatar
zhe chen committed
60
61
62
63

Discrete Frechet distance measures the geometric similarity of two ordered lists of points. Given a pair of curves,
namely a ground truth $v = (p_1, ..., p_n)$ and a prediction $\\hat{v} = (\\hat{p}\_1, ..., \\hat{p}\_k)$, a coupling
$L$ is a sequence of distinct pairs between $v$ and $\\hat{v}$:
Chengyu Wang's avatar
Chengyu Wang committed
64
65

$$
zhe chen's avatar
zhe chen committed
66
(p\_{a_1} \\ , \\ \\hat{p}_{b_1} \\ ), ..., (p_{a_m} \\ , \\ \\hat{p}\_{b_m} \\ ), $$
Chengyu Wang's avatar
Chengyu Wang committed
67

zhe chen's avatar
zhe chen committed
68
69
70
where $a_1, ..., a_m$ and $b_1, ..., b_m$ are nondecreasing surjection such that $1 = a_1 \\leq a_i \\leq a_j \\leq a_m
= n$ and $1 = b_1 \\leq b_i \\leq b_j \\leq b_m = k$ for all $i \< j$. Then the norm $||L||$ of a coupling $L$ is the
distance of the most dissimilar pair in $L$ that:
Chengyu Wang's avatar
Chengyu Wang committed
71

zhe chen's avatar
zhe chen committed
72
$$ ||L|| = \\mathop{max}_{i=1, ..., m} D(p_{a_i} \\ , \\ \\hat{p}\_{b_i} \\ ). $$
Chengyu Wang's avatar
Chengyu Wang committed
73
74
75

The Frechet distance of a pair of curves is the minimum norm of all possible coupling that:

zhe chen's avatar
zhe chen committed
76
$$ D\_{Frechet}(v, \\hat{v}) = min\\{||L|| \\ | \\ for \\ all \\ possible \\ coupling \\ L\\}. $$
Chengyu Wang's avatar
Chengyu Wang committed
77
78
79

### IoU Distance

zhe chen's avatar
zhe chen committed
80
81
82
83
To preserve consistency to the distance mentioned above, we modify the common IoU (Intersection over Union) measure
that:

$$ D\_{IoU}(X, \\hat{X}) = 1 - \\frac{|X \\cap \\hat{X}|}{|X \\cup \\hat{X}|}, $$
Chengyu Wang's avatar
Chengyu Wang committed
84

zhe chen's avatar
zhe chen committed
85
where $X$ and $\\hat{X}$ is the ground truth and predicted bounding box respectively.