# Autonomous Vehicles as a Sensor: Simulating Data Collection Process

Yunfei Zhang, Mario Ilic, Klaus Bogenberger
Chair of Traffic Engineering and Control
Technical University of Munich (TUM)
Munich, Germany
{yunfei.zhang, mario.ilic<EMAIL_ADDRESS>

###### Abstract

Urban traffic state estimation is pivotal in furnishing precise and reliable
insights into traffic flow characteristics, thereby enabling efficient traffic
management. Traditional traffic estimation methodologies have predominantly
hinged on labor-intensive and costly techniques such as loop detectors and
floating car data. Nevertheless, the relentless progression in autonomous
driving technology has catalyzed an increasing interest in capitalizing on the
extensive potential of on-board sensor data, giving rise to a novel concept
known as "Autonomous Vehicles as a Sensor" (AVaaS). This paper innovatively
refines the AVaaS concept by simulating the data collection process. We take
real-world sensor attributes into account and employ more accurate estimation
techniques based on the on-board sensor data. Such data can facilitate the
estimation of high-resolution, link-level traffic states and, more
extensively, online cluster- and network-level traffic states. We substantiate
the viability of the AVaaS concept through a case study conducted using a
real-world traffic simulation in Ingolstadt, Germany. The results attest to
the ability of AVaaS in estimating both microscopic (link-level) and
macroscopic (cluster- and network-level) traffic states, thereby highlighting
the immense potential of the AVaaS concept in effecting precise and reliable
traffic state estimation and also further applications.

_K_ eywords Autonomous Vehicles as a Sensor (AVaaS) $\cdot$ Autonomous
Vehicles $\cdot$ Data Collection $\cdot$ Traffic State Estimation $\cdot$ On-
board sensors $\cdot$ Extended Floating Car Data (xFCD)

##  1 Introduction

###  1.1 Background and Motivation

Traffic state estimation holds a critical role in the realm of traffic
engineering. The advent of a low-latency, precise estimation could prove to be
profoundly beneficial for consequent traffic control measures and even long-
term planning. In order to enhance the accuracy of traffic state estimation or
prediction, the research methodologies have broadened their horizons over
recent years to encompass both model-based and data-driven approaches. These
methodologies represent a significant shift towards comprehensive and accurate
traffic state prediction, underlining the significance of evolving research
paradigms in traffic engineering.

The collection of traffic data forms the foundation for effective traffic
management, planning, and control. The accuracy and reliability of this data
directly impact the effectiveness of traffic state estimation, a crucial
component in improving road safety, reducing congestion, and enhancing
transportation infrastructure. Traditionally, traffic data collection relied
on methods such as manual counting or loop detectors, which are both labor-
intensive and often cost-prohibitive. However, with the rise of automated
vehicles and smart transportation systems, novel methodologies are emerging,
leveraging sensor data from diverse sources such as autonomous vehicles,
traffic cameras, and even social media feeds. As we stand on the precipice of
a new era in traffic data collection, it is imperative to explore these novel
methods and understand their implications for traffic state estimation and
management.

Autonomous Vehicles (AVs), furnished with a wide range of sensor technologies
such as LiDARs, radars, and cameras, hold the capacity to drastically
transform traffic data collection. These AVs serve the dual purpose of being
mobile sensors, persistently acquiring real-time traffic data while traversing
through complex urban road networks. Given that these data are inherently
collected for AV functionality, we propose an innovative approach known as
Autonomous Vehicles as a Sensor (AVaaS). This model essentially capitalizes on
AVs in both motion and parked states to compile valuable data, which can
subsequently be applied to traffic state estimation. A distinguishing feature
of AVaaS is its expansion beyond the conventional Floating Car Data (FCD) that
solely rely on vehicles traversing the street network and only deliver
information about the ego-vehicle. AVaaS, on the other hand, benefits from
both active and parked vehicles within the network. Additionally, on-board
vehicle sensors provide additional information about other road users.
Furthermore, since AVs can be centrally regulated by an operator, they can be
strategically assigned to specific locations to gather data, particularly when
they are not privately owned such as MoD vehicles.

By harnessing data from AVs, we can broaden the range of traffic state
estimation to encompass both microscopic and macroscopic scales. On the
microscopic scale, AVs can estimate traffic states such as relative flow and
link travel time for individual road segments. Concurrently, AVs furnish
invaluable data that aids in calculating traffic parameters like average
speed, traffic volume, speed, and traffic density at the macroscopic network
level.

In this study, we aim to unravel the potential of leveraging AVs as sensors
for traffic state estimation. By simulating the data collection process using
real sensor attributes and applying the concept of AVaaS to a real-world
traffic network of the city of Ingolstadt, Germany, we seek to find its
potentials in networl-level traffic state estimation.

###  1.2 Related Work

The concept of using traffic data from moving vehicles for traffic engineering
and control dates back to 1954 when [1] proposed the moving observer (MO)
method. This method estimated speed and traffic flow based on manual
observations of surrounding traffic in both driving directions, including the
number of vehicles overtaking or being overtaken, and the count of oncoming
vehicles [1]. Some follow-up methods demonstrated its feasibility in
estimating traffic states [2] or practical implementation for traffic
management [3, 4], which are summarized in the following Table 1.

Table 1: Literature overview of simulation studies on the moving observer
method

Source |  Year | Observer Vehicle  | Direction  | Recorded Traffic Parameters  | Calculated Traffic Parameters
---|---|---|---|---|---
|  Passenger Car |  Public Transportation |  Same-Directional |  Oncoming Traffic |  Relative Flow (same-directional) |  Relative Flow (oncoming traffic) |  Link Travel Time |  Avg. Speed (of detected vehicles) |  Traffic Volume |  Speed |  Traffic Density |  Travel Time |  Queue Lengths at Intersections
|  |  |
|  |  |
|  |  |
|  |  |
|  |  |
|  |  |
|  |  |
|  |  |
|  |  |
|  |  |
|  |  |
|  |  |
4 [2] | 2002  | x |  |  | x  |  | x | x | x  | x |  |  |  |
[3] | 2007  |  | x  | x | x  | x | x |  | x  |  |  |  | x |
[4] | 2008  |  | x  |  | x  |  | x |  |  | x |  |  |  |
[5] | 2009  | x | x  |  | x  |  | x | x | x  | x |  |  |  |
[6] | 2016  | x |  | x |  | x |  | x |  | x | x | x |  |
[7] | 2017  | x |  | x | x  | x | x |  |  | x | x |  | x |
[8] | 2018  | x |  | x |  | x |  |  |  | x |  | x |  |
[9] | 2019  | x |  | x | x  | x | x | x |  | x | x | x |  |
[10] | 2019  | x |  | x |  | x |  |  |  | x |  | x |  |
[11] | 2020  | x |  |  | x  |  | x |  |  |  |  |  |  | x
[12] | 2020  | x |  | x | x  | x |  |  |  | x |  | x |  |
[13] | 2021  | x |  | x | x  | x | x | x |  | x | x | x |  |
[14] | 2023  | x |  | x | x  | x | x |  |  |  |  | x |  |

When it comes to the calculated traffic parameters, the calculation of
instantaneous link-based fundamental traffic flow variables, such as the
traffic volume, the speed or the traffic density is the primary goal of most
of the investigated literature. [3] as well as [7, 15] additionally
investigated the calculation of link-based travel times from the recorded
traffic parameters, while [11] obtained queue lengths at intersections from
relative flow data collected from oncoming traffic flows.

Based on these fundamental studies, the following studies extend the MO method
into different aspects. From the aspect of transportation modes, [3, 5]
investigated the impact of different types of moving observers on traffic flow
estimation, considering both passenger cars and public transportation. From
the aspect of estimation methods, [6] introduced a data-driven approach using
machine learning to predict traffic flow characteristics based on continuous
data streams from mobile sensors. [9] focused on data fusion techniques to
enhance traffic data accuracy and completeness through multiple moving
observers. [13] integrated machine learning techniques with moving observers
to improve prediction accuracy.

With the advancement in vehicle sensor technology of the last decades, the
data acquisition of surrounding traffic conditions can now be performed by on-
board sensors of connected vehicles, providing extended floating car data
(xFCD) for the use in Intelligent Transportation System applications. [7, 15]
emphasized the integration of moving observers in urban traffic management
systems, particularly in the context of connected and autonomous vehicles. [8]
compared traffic state estimation methods based on floating cars and moving
observers, providing insights into their performance.

Overall, the simulation studies have primarily focused on the investigation of
the feasibility of using the Moving Observer (MO) method to collect traffic
data. These studies have provided valuable insights into potential
applications and limitations of MO data but have also exposed gaps: 1) The
current literature emphasizes data collection during motion, with little
exploration of stationary scenarios, and 2) The studies have been more
concerned with collecting traffic data rather than its application in traffic
engineering and management.

To address these research gaps, we introduced our original concept, Autonomous
Vehicles as a Sensor (AVaaS) [16]. AVaaS expands on existing research in two
main ways: Firstly, it proposes the use of parked observers (PO) as stationary
detectors to gather traffic data at fixed locations. Secondly, it leverages
this collected data for link-based and network-based traffic state estimation,
represented by the (macroscopic) fundamental diagram. Current research on
network-level traffic state estimation primarily relies on loop detector data
or floating car data (FCD). AVaaS, however, opens new avenues by utilizing on-
board sensors like cameras, LiDAR, and radar in autonomous vehicles (AVs) to
provide extended FCD (xFCD), offering additional insights into the vehicle’s
surroundings. This enhancement over conventional methods enables a diverse
range of applications, including the monitoring of intersections for queue
lengths and pedestrian counts, the estimation of traffic flows, speeds, and
densities on road sections, and the detection and assessment of incidents in
opposite driving directions [17].

Considering Autonomous Mobility-on-Demand (AMoD) services, AVaaS can be
extended to a more general vehicle assignment strategy. Specifically, idle AVs
can be assigned to certain places of the network for traffic data collection,
either as MO or PO. This approach has been shown to effectively capture
traffic conditions, as demonstrated by [18] by using GPS trajectory data from
ride-hailing vehicles to model traffic flow using a two-fluid model. Figure 1
illustrates how the AVaaS idea is applied to AMoD services in a generalized
way. Each AMoD vehicle collects local information from various modes for both
road sections and intersections. The collected data is then sent to the AMoD
operator to estimate network-level traffic states. Finally, the operator can
decide to dispatch (indicated by the blue arrows in the figure) an idle
vehicle to a specific location (indicated by the grey box with blue outline)
to collect local traffic data. By utilizing AVaaS to collect traffic data from
areas where no traffic state information is available, the AMoD operator can
fill the gap of information and improve the network-wide traffic state
estimation.

Figure 1: The application of AVaaS on AMoD services

However, since fully autonomous vehicles have not yet been deployed on the
large-scale, we need to simulate the data collection process for AVs to study
its effects. There are several ways to achieve this: in the original AVaaS
paper, we proposed a simple lane- and distance-based method [16]; a more
complicated 3D vision-based method was studied by [19]. To evaluate the
simulation process, there also exists several indicators [20, 21].

###  1.3 Research Gap and Research Questions

The major limitation of the initial paper [16] is that only a grid network and
synthesized demand have been investigated in the case study and only
macroscopic fundamental diagrams (MFDs) [22] have been compared with ground
truth. Besides, the detection and estimation methods are simplified using
simple lane- and distance-based methods. To tackle these limitations, we
derive the following research questions for this paper:

  1. 1.

Is the AVaaS concept able to estimate the traffic states in a real road
network?

  2. 2.

How does the AVaaS concept perform in different levels of traffic state
estimation?

  3. 3.

Can detection and estimation methods be further improved?

###  1.4 Contribution

The key contributions of this research are as follows:

Simulating data collection process using real-world detection factors: In the
pursuit of a more realistic and understanding of traffic flow, we simulates
the data collection process using real-world detection factors. Unlike the
preceding conceptual paper [16] that have relied on simplified assumptions, we
incorporates actual range limitations and other intricate details such as
detection angles from real-world sensors. By meticulously replicating these
factors, we pursue to mimic the data collection process for fully autonomous
vehicles in the future.

Real network as a case study: Another limitation in the previous phase [16] is
that we used a grid network and synthesized demand profile. In this paper, we
validate our idea in a real network used as a case study. Different from
homogeneous grid network, we encounter the complexities and heterogeneity of
real-world traffic dynamics. The study brings insights of applying this method
in a real application and thus, encouraging the further study of methodology
to tackle the cluster- or even network-level challenges.

Different levels of traffic state estimation: Finally, our research breaks new
ground by introducing different levels of traffic state estimation: starting
from link-level traffic state estimation, we aggregate the traffic states to
the cluster and then network level. Recognizing that, further applications
such as routing [23] can be achieved for various granularities, we have
devised methods to analyze it at both the microscopic and macroscopic levels.
The microscopic analysis inspects individual lanes including density, speed,
and vehicles entered or left, while the macroscopic analysis firstly
characterizes the road geography and then overviews the network performances.
This multi-granularity analysis provides further research opportunities or
possibilities for further clustering or network-level traffic state
estimation.

Through these key contributions, our research aims to address the challenges
of traffic state estimation using AVaaS and shed lights on further data-driven
traffic management strategies. By simulating real-world data collection,
utilizing real network scenarios, and extending traffic state estimation to
different levels, this paper seeks to bring AVaaS from a concept to
applications in the future.

##  2 Methodology

Originated from the methodology we introduced in [16], we modify it based on
the new detection and estimation range.

###  2.1 Surrounding Vehicle Detection

Both the Moving Observer (MO) concept and the Autonomous Vehicle as a Service
(AVaaS) idea are rooted in the detection of surrounding vehicles, a
fundamental step in estimating traffic states. In real-world scenarios, an ego
vehicle employs a range of sensors to detect its surroundings, utilizing
technologies such as Vehicle-to-Vehicle (V2V) and Vehicle-to-Infrastructure
(V2I) communication. The proposed methodology hinges on simulation-based
detection methods, developed from simulation results where all vehicle
movements are fully observable. Figure 1 illustrates the two considered use
cases for the detection process: the Moving Observer and the Parking Observer.

In our conceptual paper [16], we explore two interrelated concepts: lane-based
detection and distance-based detection. Lane-based detection pinpoints
vehicles within the same, close, or opposite lanes as the ego vehicle,
including only these in subsequent calculations. Following this, distance-
based detection computes the Euclidean distance between the ego vehicle and
the previously identified nearby vehicles. A vehicle’s detection is confirmed
only if the distance lies within specific thresholds (detection ranges)
$d_{l}^{f/b}$ for lane $l$ in both forward $f$ and backward $b$ directions.
Importantly, these thresholds vary based on the vehicle’s position relative to
the ego vehicle, as visibility may be obstructed by other vehicles, median
strips, or additional obstacles.

It should be noted, however, that even within the detection range, objects
might be sensed with noise and their detection could be easily disrupted by
closer obstructions. Therefore, we define a more refined detection area in
Figure 2, where $w$ represents the horizontal detection width, and $l$ denotes
the vertical direction. According to current sensor specifications and real
driving conditions, the detection ranges are doubled for the front and left
directions compared to the back and right.

For simplification, we previously used a uniform distance of $50$ meters for
detection in both forward and backward directions [16]. In this paper, we
apply more realistic sensor parameters summarized in Table 2, focusing on
long-range sensors and aligned with the latest technologies [24]. We summarize
the fundamental parameters of environment sensors as provided by Continental
[25], reflecting the consideration of both accuracy and reliability in vehicle
detection.

Figure 2: Detection zone of an ego AV Table 2: Sensor specifications Sensor | Type | Range | Field of view
---|---|---|---
Camera | Mono |  | horizontal up to 125°; vertical up to 60°
Camera | Rear view | meters |
Camera | Surround View |  | 360° view
Radar | Surround | >180 m |  $\pm$ 90° detection / $\pm$ 75° measurement
Radar | Long range | 210 - 300 m |  $\pm$ 50 - 60°
Radar | Short range | 100 m |  $\pm$ 90° detection / $\pm$ 75° measurement
LiDAR | High resoluton 3D |  | 120° $\times$ 30°
LiDAR | Long range | 1000 m | 128° $\times$ 28°
LiDAR | Short range | 30 m |

After a vehicle is detected, the ego vehicle will compute the distance between
the vehicles, determine their current lanes, and measure their respective
speeds. These data are then utilized for traffic state estimation purposes.

###  2.2 Traffic State Estimation

We separate our traffic state estimation methods into two types: microscopic
and macroscopic. We first start with the microscopic level estimation and
calculate the link-level density and speed. Then, we aggregate these values
for cluster- or network-level estimation.

Our approach for network traffic state estimation leverages link-level traffic
estimations obtained from AVaaS vehicles. Specifically, we use the macroscopic
fundamental diagram (MFD), a widely-used model in traffic engineering
introduced by Daganzo [22], to capture the cluster- and network-level traffic
state. To estimate the MFD, we need to obtain average densities and flows over
a certain period of time. However, these two variables are estimated
differently for the simulation-based ground truth and the AVaaS-based
approach.

####  2.2.1 Ground Truth

For the simulation-based ground truth, all traffic states are readily
available. To aggregate the data, an aggregation level of $t_{agg}$ [s] is
defined. The average density $k_{i,ts}$ [veh/km] and the number of entering
vehicles $n_{veh}$ [veh] for each lane $i$ during each interval with start
time $ts$ are output from the simulation. Therefore, the flow $q_{i,ts}$
[veh/h] can be estimated by:

$q_{i,ts}=\frac{n_{veh}*3600}{t_{agg}}$ (1)

Subsequently, the mean density $k_{avg,ts}$ and mean flow $q_{avg,ts}$ for a
certain aggregation period starting at $ts$ can be averaged among all $n$
lanes:

$k_{avg,ts}=\frac{\sum_{i=1}^{n}k_{i,ts}}{n},\quad
q_{avg,ts}=\frac{\sum_{i=1}^{n}q_{i,ts}}{n}$ (2)

####  2.2.2 AVaaS Approach

In the context of the proposed AVaaS approach, the traffic state estimation
poses a unique challenge due to the lack of link-level traffic flow data.
Consequently, we estimate the traffic flow by the fundamental relationship
$q=k*v$. As previously described, we consider two distinct estimation
techniques, Moving Observers (MO) and Parking Observers (PO), which allows us
to vary the estimation based on the specific observer type.

Moving Observers: Same as for the calculation of the ground truth, an
aggregation level $t_{agg}$ [s] is defined with a start time $ts$. Considering
the number of total vehicles at this period $n_{total,ts}$ and a certain
penetration rate $p_{r}(\%)$, we randomly choose
$n_{mo}=\text{Round}(n_{total,ts}*p_{r}/100)$ vehicles as MO, which is at
least 1 vehicle per period.

Starting from link leve, for each observer $j$ and each time step
$t\in\\{ts,ts+1,\ldots,ts+t_{agg}-1\\}$, the number of detected vehicles
$n_{det,j,t}$ in a total of $m$ lanes, the detected speed $v_{k,j,t}$ of a
surrounding vehicle $k\in\\{1,2,\ldots,n_{det,j,t}\\}$ as well as the ego-
speed $v_{j,t}$ of the MO $j$ is returned. Subsequently, the traffic density
$k_{j,t}^{*}$, estimated by the MO $j$ at time step $t$ is calculated by:

$k_{j,t}^{*}=\frac{(1+n_{det,j,t})*1000}{\sum_{l=1}^{m}(d_{l}^{f}+d_{l}^{b})}$
(3)

where $d_{l}^{f/b}$ stands for the detection range for a lane $l$ for both
forward $f$ and backward $b$ directions. In our current settings of detection
zone, $d_{l}^{f}=2*d_{l}^{b}$.

The speed $v_{j,t}^{*}$ estimated by the MO $j$ at time step $t$ is then
calculated by:

$v_{j,t}^{*}=\frac{\sum_{k=1}^{n_{det,j,t}}v_{k,j,t}+v_{j,t}}{n_{det,j,t}+1}$
(4)

Subsequently, the traffic flow estimated by the MO $j$ at time step $t$ is
calculated by:

$q_{j,t}^{*}=k_{j,t}^{*}*v_{j,t}^{*}$ (5)

For the cluster- and network-level estimation, we average the estimated
densities, speeds, and flows among all MOs $j$ and time steps $t$ in the
respective aggregation level $t_{agg}$. Equation (6) shows the calculation of
the mean density for the aggregation period starting at $t_{s}$, while the
aggregation of speeds and flows follows the same procedure.

$k_{avg,ts}^{*}=\frac{\sum_{j=1}^{n_{mo}}((\sum_{t=t_{s}}^{ts+t_{agg}-1}k_{j,t}^{*})/t_{agg})}{n_{mo}}$
(6)

Parking Observers: Again, considering the number of total vehicles at this
period $n_{total,ts}$ and a certain penetration rate $p_{r}(\%)$, we randomly
choose $n_{po}=\text{Round}(n_{total,ts}*p_{r}/100)$ vehicles as PO, which is
at least 1 vehicle per period. For the estimation of traffic flow variables,
the only difference is that POs themselves are not counted in the density and
speed calculations, as they are not part of the traffic flow. Therefore,
originated from (3) and (4), we conclude for the calculation of densities and
speeds estimated by the MO $j$ at time step $t$:

$k_{j,t}^{**}=\frac{n_{det,j,t}*1000}{\sum_{l=1}^{m}(d_{l}^{f}+d_{l}^{b})}$
(7)

$v_{j,t}^{**}=\frac{\sum_{k=1}^{n_{det,j,t}}v_{k,j,t}}{n_{det,j,t}}$ (8)

The remaining averaging process to obtain mean densities, speeds and flows
follows the same procedure as described with (6). Note that in the case study
we will always use half vehicles as MOs and the other half as POs so that the
proposed AVaaS method is different from XFCD methods.

##  3 Case study

In this section, we present a case study in a city-size network with realistic
traffic demands. Firstly, we briefly describe the setup of SUMO simulation;
then, the results of SUMO simulation are presented with the analysis of
network characteristics; finally, we present the results from traffic state
estimation using AVaaS, from both microscopic and macroscopic levels.

###  3.1 Description

The case study under consideration utilizes the network from Ingolstadt,
Germany, a Bavarian city with an approximate population of 143,000 as of June
2023 [26]. The infrastructure data, including features such as traffic
signals, was extracted from an open-source GitHub repository [27]. The
Ingolstadt network encompasses approximately 12,000 nodes and 28,000 edges,
comprising an assortment of urban, rural, and highway roads as delineated in
Figure 3(a). Notably, prior calibrations have already been performed on this
network, including map association, traffic light program emulation, and
traffic flow calibration, thereby increasing its validity for our study [28].

(a) The SUMO road network used in the case study (Ingolstadt, Germany)

(b) Number of lanes with observations for 24-hour SUMO simulation

Figure 3: SUMO simulation in Ingolstadt, Germany for 24 hours

The demand is also calibrated based on a two-step procedure. Firstly, an
initial OD matrix was generated based on socio-demographic statistics.
Secondly, these data are calibrated given the traffic counts. Drivers’
behaviours are also calibrated based on vehicles trajectory data [29]. The
initial simulation lasts for a whole-day (24-hour), which we also run and
aggregate the results to draw the MFD. However, to evaluate the idea of AVaaS,
we only use the morning peak from 6 am to 11 am because the whole simulation
will be too huge at the city level.

###  3.2 SUMO Simulation and Network Characteristics

In the simulation, we use $5$ minutes as the aggregation level
($t_{agg}=300[s]$) to keep the balance between efficient results and fine
temporal resolution. Note that we also evaluate the traffic states for lanes
instead of edges because edges have different numbers of lanes, which is
normally dependent on their road class.

A common fact for a city-level simulation is that the demand is imbalanced
both temporarily and spatially: most of vehicles concentrate in the city
center during the peak hours. Figure 3(b) visualizes the number of lanes with
observations over the whole simulation. Considering in total 28,000 edges,
which contains at least one lane, there are just over 10,000 lanes with
observations with observations during the 5-minute interval. This brings some
challenges to our traffic state estimation as we randomly select vehicles as
moving observers and parking observers for the current stage.

The MFD for 24-hour simulation is shown in Figure 4. We conclude that it is
far away from the capacity because Ingolstadt is not a city with heavy
traffic. Therefore, it will be interesting to study the case with congestion
situations in the future.

Figure 4: MFD for the simulation

However, we also notice that the heterogeneity inside the city is quite high:
we plot the density and flow for all measurements in the city from 3 am to 9
am in Figure 5 as this period almost covers the period between the lowest and
highest demand as presented in Figure 3(b). Note these are not MFDs but point
measurements for each lane. However, we observe lanes are quite diverse and we
can clearly see different capacities shown as red dashed horizontal lines in
Figure 5.

Figure 5: Measurements for the whole Ingolstadt from 3 am to 9 am

To tackle the heterogeneity existing in the whole network, we apply the
K-means algorithm using scikit-learn in Python [30]. Firstly, we calculate the
average traffic states for each lane over the whole simulation process;
secondly, we determine the optimal number of clusters using Elbow Method [31],
which runs the K-means algorithm for different number of clusters, and plot
corresponding within-cluster sum of square (WCSS). The optimal point is where
the WCSS curve has the decreasing derivatives, which means the gain of
increasing cluster number drops down. In our case, we select 4 as shown in the
left of Figure 6. This also fits our observations from Figure 5 that there are
roughly 4 capacities. Finally, we plot the speed-density relations for these 4
clusters as shown in the right of Figure 6. Apparently, cluster 1 is the low-
class lanes with both low speeds and low densities and cluster 2 possesses the
higher density and speed; cluster 3 might be located in the city center with
high densities, while cluster 4 is with high speeds and low densities, which
might be express way in the outskirt.

Figure 6: K-means clustering: Selection of the optimal number of clusters
(left) and Speed-density measurements for different clusters (right)

These conclusions can be proven through the MFDs for these 4 clusters as shown
in Figure 7. Cluster 1 refers to all minor streets, while Cluster 2 and 3
shows a good fit of MFD, representing different capacities and road classes.
Cluster 4 is rather low in density and flow though with a higher speed.

Figure 7: MFDs for the simulation for 4 clusters

###  3.3 Results of Traffic State Estimation

In the traffic state estimation, we do not use the 24-hour simulation because
the dimension of data is too huge. We select the morning peak from 6 am to 11
am as the estimation period. Firstly, we compare the estimated and measured
densities and speeds based on 1,300 records. One record refers to one ego
vehicle staying in the same lane. The comparison are visualized in Figure 8.
From the figure we can conclude that estimated densities do deviate a lot
especially when the the densities are small, which again is due to the fact
that it is hard for a moving or parking vehicle to capture a rather small
density as already discussed in [16]. However, the estimated vehicle speeds
show a good fit.

Figure 8: Microscopic (link-level) estimation of densities and speeds

To further analyze how errors distribute at different scales, we plot the
relative error (defined in Equation 9) of density and speed estimations in
Figure 9. As already talked, density estimation is not precise when the
overall density is low, while the speeds’ estimation always have the similar
relative error regardless of the measured speed. However, the overall relative
errors of both estimations are not huge. Generally, densities are
overestimated because the moving observers will anyway count itself into the
density calculation, which can be biased. However, this will not be a problem
for parking observers.

$\text{Relative Error}=\frac{|\text{True Value}-\text{Estimated
Value}|}{|\text{True Value}|}$ (9)

Figure 9: Error distribution of densities and speeds

Starting from link level, we aggregate the traffic states firstly at the
cluster level in Figure 10. All 4 clusters shows the underestimation of
density, and thus flow. This could due to the fact that even within the
clusters, different lanes are diverse in density and speed profile. The same
phenomenon appears if we further aggregate the traffic state estimation to the
network level in Figure 11. Note that we present speed and density relation
here because the estimated flow is way smaller than the measurements. From the
Figure we can clearly observe that densities are even more underestimated.
This leads to further research on how to increase the homogeneity within the
cluster or even increase the penetration rate of AVaaS for further
improvements.

Figure 10: Estimation of MFDs for different clusters Figure 11: Comparison of
MFDs based on measured and estimated data

##  4 Conclusion

In this paper, we expand the dimension of Autonomous Vehicles as a Sensor
(AVaaS) from a concept to a real-world network study. Our contributions can be
summarized as three folds: firstly, we improve the data simulation process by
incorporating real-world detection factors including range and attributes of
sensors, resulting in more accurate and reliable traffic data collection;
secondly, we demonstrate the effectiveness of our proposed methods through a
real-world network case study, showcasing the practical applicability of our
approach in real-life scenarios; lastly, we present the traffic state
estimation for link level, cluster level, and network level.

However, we also have some limitations. For the perception, we still model it
through distance and detection zone-based methods, which do not include
occlusion in reality. The second limitation is that our method does not
perform well in the cluster and network level, indicating a more dynamic
clustering method based on real-time AVaaS concept is required. Lastly, we do
not include the error model because the complexity will increase dramatically
as stated in [32].

To tackle these limitations, we have planned some future works. Regarding the
perception, we plan to implement a perception method using Floating Car
Observers (FCOs) in the microscopic simulations [19]. In this paper, authors
convert two-dimensional simulation scenarios into three-dimension environment
and use neural network for computer vision (CV) to detect the surrounding
traffic participants. Based on that, we do not work on the CV algorithm but
use them as a more realistic way to detect traffic environment and estimate
the traffic states accordingly. For cluster- and network-level perception, we
plan to develop a more reliable clustering and network representation methods
based on AVaaS with a relatively low penetration rate, which is the focus of
further applications in this field.

## Acknowledgments

This work was funded by the German Federal Ministry for Economic Affairs and
Climate Action (BMWK) and by the European Union in the frame of
NextGenerationEU within the project STADT:up (FKZ 19A22006T). [The authors
would like to thank the consortium for the successful cooperation.]

## References

  * [1] John Glen Wardrop and George Charlesworth.  A method of estimating speed and flow of traffic from a moving vehicle.  Proceedings of the Institution of Civil Engineers, 3(1):158–171, 1954.
  * [2] Alison Mulligan and Alan Nicholson.  Uncertainty in traffic flow estimation using the moving-observer method.  2002\.
  * [3] Olaf Czogalla and Sebastian Naumann.  Travel time estimation using floating car observers.  10 2007.
  * [4] Franziska Wolf, Sebastian Naumann, Christoph Engel, and René Schönrock.  Floating car observer–approaches for traffic management strategies by analysing oncoming vehicles.  In The Second International Workshop on Intelligent Vehicle Control Systems, volume 2, pages 83–92. SCITEPRESS, 2008.
  * [5] Carsten Kühnel, Christian Leitzke, and Robert Hoyer.  Evaluation of floating car observer algorithms using microscopic traffic flow simulation.  In Proceedings of the 16th World Congress on Intelligent Transport Systems-Stockholm, Sweden, 2009.
  * [6] Ryan Florin and Stephan Olariu.  On a variant of the mobile observer method.  IEEE Transactions on Intelligent Transportation Systems, 18(2):441–449, 2016.
  * [7] Michael Schäfer and Robert Hoyer.  Bewegte beobachter zur mobilen erfassung netzweiter verkehrszustände.  Innovative Produkte und Dienstleistungen in der Mobilität: Technische und betriebswirtschaftliche Aspekte, pages 267–283, 2017.
  * [8] Paul BC van Erp, Victor L Knoop, and Serge P Hoogendoorn.  Macroscopic traffic state estimation using relative flows from stationary and moving observers.  Transportation Research Part B: Methodological, 114:281–299, 2018\.
  * [9] Marco Guerrieri, Giuseppe Parla, and Raffaele Mauro.  Traffic flow variables estimation: An automated procedure based on moving observer method. potential application for autonomous vehicles.  Transport and Telecommunication, 20(3):205–214, 2019.
  * [10] Paul B.C. van Erp, Victor L. Knoop, and Serge P. Hoogendoorn.  On the value of relative flow data.  Transportation Research Procedia, 38:180–200, 2019.  Journal of Transportation and Traffic Theory.
  * [11] Marcel Langer, Thomas Schien, Michael Harth, Ronald Kates, and Klaus Bogenberger.  An improved moving observer method for traffic flow estimation at signalized intersections.  In 2020 IEEE Intelligent Vehicles Symposium (IV), pages 1498–1503, 2020.
  * [12] P.B.C. van Erp, Infrastructure Netherlands Research School for Transport, and Logistics.  Relative Flow Data: New Opportunities for Traffic State Estimation.  TRAIL thesis series. Netherlands TRAIL Research School, 2020.
  * [13] Wei Ma and Sean Qian.  High-resolution traffic sensing with probe autonomous vehicles: A data-driven approach.  Sensors, 21(2), 2021.
  * [14] Ryan Florin and Stephan Olariu.  Real-time traffic density estimation: Putting on-coming traffic to work.  IEEE Transactions on Intelligent Transportation Systems, 24(1):1374–1383, 2023.
  * [15] Michael Schäfer.  Verkehrszustandsschätzung mittels vernetzter floating car observer.
  * [16] Yunfei Zhang, Mario Ilic, and Klaus Bogenberger.  A novel concept of traffic data collection and utilization: Autonomous vehicles as a sensor.  In 2023 IEEE 26th International Conference on Intelligent Transportation Systems (ITSC), 2023.
  * [17] Koyel Banerjee, Dominik Notz, Johannes Windelen, Sumanth Gavarraju, and Mingkang He.  Online camera lidar fusion and object detection on hybrid data for autonomous driving.  In 2018 IEEE Intelligent Vehicles Symposium (IV), pages 1632–1638. IEEE, 2018.
  * [18] Yunfei Zhang, Allister Loder, Felix Rempe, and Klaus Bogenberger.  Temporal aggregated analysis of gps trajectory data using two-fluid model.  Transportation Research Record, page 03611981221128279, 2022.
  * [19] Jeremias Gerner, Dominik Rößle, Daniel Cremers, Klaus Bogenberger, Torsten Schö, and Stefanie Schmidtner.  Enhancing realistic floating car observers in microscopic traffic simulation.  In 2023 IEEE 26th International Conference on Intelligent Transportation Systems (ITSC), 2023.
  * [20] Gerhard Huber, Klaus Bogenberger, and Robert L Bertini.  New methods for quality assessment of real time traffic information.  In Traansport Research Board 93rd. Annual Meeting, 2014.
  * [21] Susanne Breitenberger, Bernhard Grüber, and Martina Neuherz.  Extended floating car data-potenziale fuer die verkehrsinformation und notwendige durchdringungsraten/extended floating car data-potential for traffic information and required floating car penetration.  Straßenverkehrstechnik, 48(10), 2004.
  * [22] Carlos F Daganzo.  Urban gridlock: Macroscopic modeling and mitigation approaches.  Transportation Research Part B: Methodological, 41(1):49–62, 2007\.
  * [23] Yunfei Zhang, Felix Rempe, Florian Dandl, Gabriel Tilg, Matthias Kraus, and Klaus Bogenberger.  Network fundamental diagram based dynamic routing in a clustered network.  In 2023 8th International Conference on Models and Technologies for Intelligent Transportation Systems (MT-ITS), 2023.
  * [24] Continental.  Autonoumous Mobility - Enablers.  Online, 2023.  Technical Information.
  * [25] Continental.  Continental.  https://www.continental.com/, 2023.  Accessed: 2023-07-21.
  * [26] Stadt Ingolstadt.  Aktuelle statistiken.  Online, 07 2023.  Accessed: 20/07/2023.
  * [27] TUM-VT.  SUMO Ingolstadt.  Online, 2023.  GitHub repository.
  * [28] Michael Harth, Marcel Langer, and Klaus Bogenberger.  Automated calibration of traffic demand and traffic lights in sumo using real-world observations.  In SUMO Conference Proceedings, volume 2, pages 133–148, 2021.
  * [29] Marcel Langer, Michael Harth, Lena Preitschaft, Ronald Kates, and Klaus Bogenberger.  Calibration and assessment of urban microscopic traffic simulation as an environment for testing of automated driving.  In 2021 IEEE International Intelligent Transportation Systems Conference (ITSC), pages 3210–3216. IEEE, 2021.
  * [30] F. Pedregosa, G. Varoquaux, A. Gramfort, V. Michel, B. Thirion, O. Grisel, M. Blondel, P. Prettenhofer, R. Weiss, V. Dubourg, J. Vanderplas, A. Passos, D. Cournapeau, M. Brucher, M. Perrot, and E. Duchesnay.  Scikit-learn: Machine learning in Python.  Journal of Machine Learning Research, 12:2825–2830, 2011.
  * [31] Robert L Thorndike.  Who belongs in the family?  Psychometrika, 18(4):267–276, 1953.
  * [32] Mathias Pechinger, Guido Schröer, Klaus Bogenberger, and Carsten Markgraf.  Roadside infrastructure support for urban automated driving.  IEEE Transactions on Intelligent Transportation Systems, 2023.


A}}\underbrace{\int_{-\pi}^{\pi}\prod_{d}\Bigg{[}1+2\sum_{m=1}^{\infty}\frac{I_{m}(\frac{A^{2}_{d}}{4\sigma^{2}})}{I_{0}(\frac{A_{d}^{2}}{4\sigma^{2}})}\cos(\omega_{d}m\alpha)\Bigg{]}(L-\alpha)d\alpha}_{\text{Term
B}}$ (106)

Term A behaves the same as before, so we again study the series expension of
term B, the analogue of equation LABEL:eq:series_expansion. The
$\text{0}^{\text{th}}$ order term is a constant with respect to the code, but
the first order term provides the main frequency biasing effect, as in Section
E.4.

$\displaystyle\frac{1}{L^{2}}\int_{0}^{L}\cos(m\omega_{d}\alpha)(L-\alpha)d\alpha=\frac{1}{m^{2}L^{2}\omega_{d}^{2}}(1-\cos(m\omega_{d}L))$
(107)

Hence the 1-dimensional box coarsly creates a high frequency bias
($>\frac{1}{L}$), but also encourages frequencies that fit whole numbers of
wavelengths within the length of the box, Figure 13B.

Before we move on we will study the second order term. We won’t repeat this
for future finite rooms as it shows basically the same effect as in Section
E.4: coarsly frequencies repel each other up to a lengthscale $\frac{1}{L}$.
However, as for the first order term, there is additional structure, i.e.
subsidiary optimal zeros in the loss, that could be of interest:

$\displaystyle\begin{split}\frac{2}{L^{2}}\int_{0}^{L}\cos(m\omega_{d}\alpha)\cos(m^{\prime}\omega_{d^{\prime}}\alpha)(L-\alpha)d\alpha\\\
=\frac{1-\cos(L(m\omega_{d}+m^{\prime}\omega_{d^{\prime}}))}{(m\omega_{d}+m^{\prime}\omega_{d^{\prime}})^{2}L^{2}}&+\frac{1-\cos(L(m\omega_{d}-m^{\prime}\omega_{d^{\prime}}))}{(m\omega_{d}-m^{\prime}\omega_{d^{\prime}})^{2}L^{2}}\end{split}$
(108)

This is fundamentally a repulsion between frequencies closer than
$\frac{1}{L}$ from one another, fig 13C. Additionally, the repulsion is zero
when the difference between frequencies is exactly $\frac{2\pi}{L}$ times an
integer.

Figure 13: A: Changing Integration Variabels The logic behind the integration
change in 104. B: 1D Box Frequency Bias As in equation 107, shows both a high
frequency bias and a preference for integer numbers of wavelengths in the box.
C: 1D Box Frequency Interaction Plot of equation 108, shows both a high
frequency bias, a repulsion between frequencies, and non-trivial optimal
interaction differences.

###  L.2 2-Dimensional Box

A very similar analysis can be applied to the representation of a
2-dimensional box, and used to derive the frequency bias plotted in Figure 6X.
We reach an exactly analogous point to equation 105,

$\displaystyle\mathcal{L}=\frac{2}{L^{4}}\Bigg{[}\int_{0}^{L}\int_{0}^{L}e^{-\frac{\sum_{d}A_{d}^{2}\sin^{2}(\frac{k_{dx}x+k_{dy}y}{2})}{2\sigma^{2}}}(L-x)(L-y)dxdy+$
(109)
$\displaystyle\int_{0}^{L}\int_{-L}^{0}e^{-\frac{\sum_{d}A_{d}^{2}\sin^{2}(\frac{k_{dx}x+k_{dy}y}{2})}{2\sigma^{2}}}(L-x)(L+y)dxdy\Bigg{]}$
(110)

Again we’ll study the first order term of the series expansion,

$\Delta\mathcal{L}_{1}\propto\frac{1-\cos(m_{d}k_{dx}L)}{m^{2}k^{2}_{dx}}\frac{1-\cos(m_{d}k_{dy}L)}{m^{2}k^{2}_{dy}}$
(111)

This is exactly the bias plotted in Figure 5F. Changing to rectangles is easy,
it is just a rescaling of one axis, which just inversely scales the
corresponding frequency axis.

###  L.3 Circular Room

The final analysis we do of this type is the hardest. It follows the same
pattern, make the symmetry assumption, expand the series. Doing so we arrive
at the following first order term:

$\Delta\mathcal{L}_{1}=\frac{1}{\pi^{2}R^{4}}\iint_{0}^{R}\iint_{0}^{2\pi}\cos(m{\bm{k}}_{d}\cdot({\bm{x}}-{\bm{x}}^{\prime}))d\psi
d\psi^{\prime}rr^{\prime}drdr^{\prime}$ (112)

where $(r,\psi)$ is a radial co-ordinate system,
${\bm{x}}=\begin{pmatrix}r\cos\psi\\\ r\sin\psi\end{pmatrix}$. Using the
double angle formula to spread the cosine, and rotating the 0 of each $\psi$
variable to align with ${\bm{k}}_{d}$, we get:

$\Delta\mathcal{L}_{1}=\frac{1}{\pi^{2}R^{4}}\Bigg{[}\bigg{(}\int_{0}^{R}\int_{0}^{2\pi}\cos(mr\|{\bm{k}}_{d}\|\cos\psi)d\psi
rdr\bigg{)}^{2}+(\int_{0}^{R}\int_{0}^{2\pi}\sin(mr\|{\bm{k}}_{d}\|\cos\psi)d\psi
rdr\bigg{)}^{2}\Bigg{]}$ (113)

The second integral is 0, because sine is odd and periodic. We can perform the
first integral using the following Bessel function properties,

$\int_{0}^{2\pi}\cos(a\cos(\psi))d\psi=2\pi J_{0}(\|a\|)$ (114)

Hence,

$\Delta\mathcal{L}_{1}=\frac{4}{R^{4}}\bigg{(}\int_{0}^{R}J_{0}(mr\|{\bm{k}}_{d}\|)rdr\bigg{)}^{2}$
(115)

Which can be solved using another Bessel function property,

$\int_{0}^{R}rJ_{0}(ar)dr=\frac{RJ_{1}(aR)}{a}$ (116)

Therefore,

$\Delta\mathcal{L}_{1}=\frac{4J_{1}(m\|{\bm{k}}_{d}\|R)^{2}}{R^{2}m^{2}\|{\bm{k}}_{d}\|^{2}}$
(117)

This is exactly the circular bias plotted in Figure 5G. Placing the base
frequencies of grid module on the zeros of this bessel function would be
optimal, i.e. calling a zero $\xi$, then the wavelengths of the grid modules
should optimally align with,

$\nu=\frac{2\pi R}{\xi_{k}}$ (118)

This corresponds to grids with wavelengths that are the following multiples of
the circle diameter: $0.82,0.45,0.31,0.24,0.19,\dots$. Though, as with the
other predictions, the major effect is the polynomial decay with frequency, so
these effects will all be of larger importance for the larger grid modules. As
such, we might expect only the first two grid modules to fit this pattern, the
others should, in our framework, focus on choosing their lattice parameters to
be optimally non-harmonic.

##  Appendix M Representations of Circles, Spheres, and 3-dimensions

We believe our approach is relevant to the representation of many variables
beyond 2-dimensional space. Most simply we can directly apply the tools we’ve
developed to the representation of any variable whose transition structure is
a group, Section A.1. This is actually true for both numerical and analytic
approaches, but here we focus mainly on the numerical approach. We discuss the
representation of an angle on a ring, a point on a sphere, and 3 dimensional
space. Additional interesting variables might include a position in hyperbolic
space (since tree-like category structures, such as the taxonomic hierarchy of
species, are best described by hyperbolic spaces), or the full orientation of
an object in 3-dimensional space.

For starters, we have frequently referenced the representation of an angle,
${\bm{g}}(\theta)$. This is also something measured in brain, in the famous
head direction circuit, perhaps the most beautiful circuit in the brain (Kim
et al., 2017). There you measure neurons that have unimodal tuning to heading
direction. We match this finding, Figure 14A. This is understandable since, as
discussed, on a finite space you still want a lattice module, but $\chi$,
encourages you to be low frequency and there is no high frequency bias, since
the space is finite and $p(\theta)$ is uniform. Thus, place cells are optimal.
If we included more neurons it would likely form multiple modules of cells
with higher frequency response properties.

We can also apply our work to the representation of a point on a sphere.
Again, with the low frequency bias place cells are optimal, Figure 14B.
Without it, or conceivably with enough neurons that multiple modules form, you
can get many interesting patterns, Figure 14C-D. These could be relevant to
the representation of object orientations, or in virtual reality experiments
where animals must truly explore spherical spaces.

Finally, we can equally apply our framework to the representation of a point
in three dimensional space. Grid cells have been measured while an animal
explores in 3D and shown to have irregular firing fields in both bats (Ginosar
et al., 2021), and mice (Grieves et al., 2021). Analogously to the griddy
modules in one and two dimensions, our framework predicts griddy three
dimensional responses that are similarly densely packing, which is verified in
14E. However, in Appendix I we performed ablation studies and found that
removing the actionable constraint led to multimodal tuning curves without
structure, and we find the same for 3D, Figure 14F, perhaps matching the
multimodal but unstructured representation found in the brain (e.g. Figure 14G
from Ginosar et al. (2021)). As such, it seems that in three dimensions the
animals are building a non-negative and discriminative representation without
the constraint to path integrate. Therefore, we suggest that the animals have
sacrificed the ability to manipulate their internal representations in 3D and
instead focus on efficiently encoding the space.

Figure 14: A Representation of an angle on the ring. With a low frequency bias
the optimal one module response is a set of head-direction cells. B
Representation of position on a sphere. With a low frequency response place
cells are again optimal. C-D Allowing the optimiser to find other modules
produces funky looking responses on the sphere, like grids (C) and ‘pole &
orbit’ cells (D.) E A module of densely packing grids in 3D space. F The same
cells without the actionability constraint, as we did for 2D in Figure 10. G
Recordings of multimodal cells from bat entorhinal cortex from Ginosar et al.
(2021).