## 4 Mobile Bike Test
### Automated Data Analysis
#### 4.3.2 Dbscan  
Given a set of points in some space, DBSCAN groups together points that are closely packed together (points with many nearby neighbors), marking as outliers points that lie alone in low-density regions.  
Let \(D\) be the dataset of all points, \(Q\) be the query point, and \(N(Q)\) represent the neighborhood of \(Q\), which includes all points within distance \(\varepsilon\) of \(Q\).As illustrated in Figure 14 by the orange point, a point \(Q\) is a core point if at least \(min\)_Pts_ points are within distance \(\varepsilon\) of it.  
\[Q\]  
is a core point if \[|N(Q)|\geq min\)_Pts_ (1)  
A point \(P\) is directly reachable from \(Q\) if point \(P\) is within distance \(\varepsilon\) from core point \(Q\), shown by the blue points to the orange point.  
\[P\]  
is directly reachable from \[Q\]  
if  
\[P\in N(Q)\]  
and \[\mid N(Q)\mid\geq\ minPts\] (2)  
As illustrated by the green points, point \(P\) is reachable from \(Q\) if there exists a sequence of points:  
\[p_{1},\ p_{1},\ldots,p_{n}\]  
with  
\[p_{1}=Q\]  
and  
\[p_{n}=P\]  
, where  
\[p_{i+1}\]  
is directly reachable from  
\[p_{i}\]  
(3)  
Formally, a cluster in DBSCAN is a non-empty subset \(C\ \subseteq\ D\) satisfying the following:  
1. For any two points \(P\) and \(Q\) in \(C\), if \(Q\) is reachable from \(P\), then \(P\) and \(Q\) are part of the same cluster.
2. For any point \(Q\) in \(C\), if there is a point \(P\) in \(C\) such that \(Q\) is reachable from \(P\), and \(P\) is a core point.  
All other not reachable points are considered outliers or noise as indicated by the gray points and can be represented as follows:  
\[D\setminus\cup_{all\ clusters\ C}C \tag{4}\]  
Figure 14: DBSCAN illustration. Peach point represents a core point which forms the main part of a cluster. Blue points are border points which have fewer than minPts within radius \(\varepsilon\). Gray points refer to noise. Green points are border points belonging to different clusters.  
Therefore, the DBSCAN algorithm can be understood as a region query, where \(N\epsilon(p)\) is the \(\varepsilon\)-neighborhood of the point \(Q\) in dataset \(D\):  
\[N_{\epsilon}(Q)=\{P\ \in\ D\ \mid\ dist(Q,P)\ \leq\ \epsilon\} \tag{5}\]  
In our experiment, we calibrated \(\epsilon\) to 0.02 and \(minPts\) to 6. The results, as shown in Figure 15, depict the clusters identified by DBSCAN circled in blue, which represent vehicle passes. There were four false positives detected by the algorithm, as marked with green squares, with the remaining points being noise. However, when distinguishing close vehicle passes ranging from 1 m to 1.5 m, DBSCAN demonstrated 100% accuracy. Clusters indicating passes under 1 m are assumed to be anomalies, given the low likelihood of such close overtakes. Similarly, passes over 2 m likely belong to vehicles in different lanes, and these can also be filtered. Therefore, with our preliminary results, we show that it is possible to create an automated framework that easily collects and analyzes close vehicle passes with no reliance on manual techniques.  
Using DBSCAN, we isolated points between 1 m to 2 m and averaged each cluster to represent a vehicle pass with a single point on a scatter plot. We then extracted relevant screenshots from the GoPro video and integrated them into an interactive plot. Users can click on a point to view the corresponding overtaking vehicle screenshot and its passing distance. In Figure 16, the clicked point is highlighted with a black circle, showcasing an overtaking car at that specific distance.  
Figure 16: Interactive plot depicting a vehicle overtaking at 1.31 m.  
Figure 15: Clusters identified using DBSCAN. Green squares indicate false positives.