JOINT ESTIMATION OF ROAD ROUGHNESS FROM CROWD-SOURCED BICYCLE ACCELERATION MEASUREMENTS

In contrast to cars, route choices for cycling are barely influenced by the respective traffic situation, but to a large extent by the routes’ comfort. Especially in urban settings with several alternatives, segments with many or long stops at traffic lights and badly maintained roads are avoided due to a low comfort and cyclists vary from the shortest route. This fact is only indirectly considered in common navigation applications. This work aims to integrate surface roughness measurements collected from diverse bicycles to a joint scale via a least-squares adjustment. Data was collected using smartphones, which were mounted to bike hand bars and measured positions and vertical accelerations on user’s trips. As this way sensed roughness also depends on the bike setting and type, the resulting values would be different for different users. Thus, this paper presents a novel approach to harmonize observations from differing sensitive setups. The basic concept idea of bundle block adjustment is adapted to calibrate a basic scale model and in parallel adjust the observations of surface roughness to a common scale. This way a crowd-sourced roughness map can be generated. Such a map can be used to enrich bike focused routing services and thus encourage cycling in daily live. In addition, it can also be used to derive hints for infrastructure servicing.


INTRODUCTION AND RELATED WORK
Due to the wide availability on smartphones, navigation applications are no longer used only for driving in unknown surroundings, but also for everyday rides by bicycle. In contrast to the car where route choice is mainly influenced by estimated travel time, cyclists rather look also for comfortable routes. Especially to avoid situations with low comfort like gradients, many or long stops at traffic lights and badly maintained roads, cyclists vary from the shortest route ((McCarthy et al., 2016), (van Overdijk, R.P.J., 2016)). This fact is only indirectly considered in common navigation applications.
In addition to the ongoing revival and increasing popularity of the bicycle for everyday travel and leisure, this development is also interesting from a public policy perspective, as it can be seen as a way to address widespread urban traffic and related environmental problems. In parallel, new bicycle related businesses arise, such as sharing services for bikes and scooters, but also a significant spread of parcel and food deliveries by bicycle. In many regions, this development is intended to be further promoted by expanding the corresponding infrastructure, which requires extensive planning and, in some areas, prioritization. Options for optimizing the above mentioned services on the existing infrastructure also depend to a large extent on the available data. Detailed mapping and monitoring of the state of infrastructure is therefore crucial for informed decision making in a wide range of mobility domains.
In (Dane et al., 2019) a literature overview is given for different factors influencing cyclists' route choice in general, although the focus of the paper is on E-bikes. Although based only on hypothetical routes, (Bovy, Bradley, 1985) is one of the first stud- * Corresponding author ies on cycling route choice behavior also taking surface quality into account. In recent years authors like (Broach et al., 2012) analyze the influence of attributes derived from sensor measurements on cyclist route choice behavior. They are mostly based on GPS data and do not specifically take the comfort or surface quality into account. In the thesis by (van Overdijk, R.P.J., 2016) is claimed that good quality paths and low slopes can be worth more than 4 minutes of travel time reduction, and surface quality is placed in the group of most relevant factors for comfortable routes. In line with this, (McCarthy et al., 2016) also state that cyclists are quite sensitive to comfort and safety aspects and thus are not only interested in the most direct or fast route. In the stated preference survey of (Stinson, Bhat, 2003), after travel time and distance to motorized traffic, also the surface type is of highest interest for cyclists. Further, surface quality seems to be the most important aspect compared to other comfort measures like hilliness, continuity or delays from stops. This supports the relevance of smooth surface conditions for comfortable bicycle routes.
In order to incorporate these factors into a routing service, it is necessary to have a preferably complete and up-to-date database. Information on some of the comfort-relevant aspects can be obtained from public or free sources. Gradients, for example, can be derived from globally available surface models, and intersections and traffic signals can now usually be found in OpenStreetMap (OpenStreetMap contributors, 2020) (OSM). However, the surface condition of paths is only partially included in the latter. There is already a routing service, Komoot (komoot GmbH, 2021), based on OSM surface tags, but this requires a prior manual labeling of the paths by volunteers.
Automating the acquisition of surface type and roughness by means of the smartphones of volunteer cyclists would therefore be desirable, in the sense of crowd-sourcing and volunteered geographic information. Recently (Brauer et al., 2021) presented a processing pipeline for bicycle movement data to determine the flow of different routes, based on the riders speed. In recent years, applications with different approaches have been developed in this direction. For example, (Bike Citizens Mobile Solutions GmbH, 2021) from Austria offers a navigation app for cyclists similar to Komoot, but also promotes the recording and uploading of the trajectory traveled during use. This is then analyzed in comparison to the shortest routes to adapt future recommendations. In this way it can be inferred, at least implicitly, that short but bypassed route segments are not comfortable. The SimRa and RideVibrations projects go one step further, taking into account other sensors such as acceleration sensors in addition to the smartphone positioning service. In SimRa by (Karakaya et al., 2020) from Berlin, data is collected with the objective of detecting sudden maneuvers due to (near-) accidents. The aim is to identify dangerous spots. The app and first collected data are open-source. In (Wage et al., 2020) position and acceleration data is collected in a very similar way while riding. However, the focus of the development, data recording and analysis was placed on capturing the way surface conditions.
Published works such as (Bíl et al., 2015), (Dawkins et al., 2011) and (Wage et al., 2020) have shown that vertical acceleration measurements on bicycles (but also other vehicles) can provide information about the roughness (or smoothness) of the ground. However, scores of roughness were calculated from the measurements of single, particularly known bicycles. The wide availability and convenience of smartphones offers much more possibilities, if used in a crowd-source manner, to achieve much better coverage and actuality, than individual measurement systems could achieve. (Wage et al., 2020) reveals relevant influences of the ridden bike type and tire pressure on the measured roughness. An open point to bring measurements of a wide variety of bicycles and settings into a joint frame of roughness is to model and handle their different sensitivities. As a solution to this problem, we present an approach for adjusting data collected from diverse cyclists relatively to each other and thus into a joint roughness level.

APPROACH
This approach is based on the data and findings described in (Wage et al., 2020). The objective is not to classify discrete surface types, but to score their roughness (and thus ride quality) on a continuous scale. This way, the challenge of separating and ordering meaningful and generically applicable classes is omitted and a continuous roughness index can be integrated into a variety of applications more directly. For example, in the context of bicycles, they can be used for surface-sensitive routing in the form of graph weights.
The approach includes a preprocessing of trajectories (see 2.1) where they are matched to the underlying street network, a preparation of the raw roughness observations (see 2.2) and the actual adjustment step (see 2.3). Each step is presented in the following and is given in the overview chart of Figure 1. The mentioned analysis step is presented in the case study discussion in section 4.

Trajectory preprocessing
The collected trajectories are a sequences of geo-located points and need to be linked to the associated network segment (so called map matching) to enable segment based analysis. Matching each point naively just to the nearest network segment is quite error-prone, because especially in covered urban spaces the location inaccuracy can easily add up to several meters. A probabilistic and more reliable approach was introduced by (Newson, Krumm, 2009) and is used for this work. Instead of considering each point individually, a Hidden-Markov-Model is used to find the most probable sequence of segments traversed by the cyclist. The distance and angular differences are compared between the geographic and graph space to score the matching candidates. In this way each trajectory point is related to the most probably passed network segment for upcoming processing steps.

Roughness observation preparation
There is not a generic definition of roughness and many authors use different approaches and indices. In numerous studies, the RMS (Root Mean Square) is derived from measured accelerations to represent roughness, or own indices based on this are constructed (see (Bíl et al., 2015), (Dawkins et al., 2011)). Due to many possible disturbances (isolated bumps such as gullies or branches) on an individual road segment pass, which can also be bypassed, a comparable, but more robust measure was selected as a roughness index. The Median Absolute Deviation (MAD) in (1) is therefore used in this study, where the median of the absolute deviation between the individual measured values and their median is used (cf. (Leys et al., 2013)). It takes double advantage of the greater outlier robust median, compared to the commonly used mean based RMS.
whereã(p) = median(az i (p)) az i (p) : vertical accelerations of segment passage p As measure of dispersion the Median Absolute Deviation (1) is used to calculate an index of roughness. Each time a user is passing a segment, this observed vertical accelerations are used to calculate a MAD-value.
The sensed vertical acceleration, and thus the calculated roughness index, increases with increasing speed. (Dawkins et al., 2011) and own comparisons indicate a linear relation. Based on this all observations are normalized to a common speed of 5 m/s via Equation (2) with measured speeds vi in m/s.
whereṽ(p) = median(vi(p)) vi(p) : measured speeds [m/s] on segment passage p Giving an idea of scale, from our experience it can be said that index values of about 1 are associated with smooth asphalt tracks. Values from around 2 indicate some minor flaws, coarse asphalt or a smooth paving. Unpaved, graveled or damaged surfaces commonly result in values above 3. From 4 on bumps might occur more frequently and values of 8 and more indicate the presence of rough cobblestone, planks and similar surface types.

Adjustment
The underlying idea of the approach is that the roughness of a road segment is observed by different bicycles. Due to different influences such as type of bike and setup, the observations will not yield to the same roughness values. As there are many observations of the same road segment, the problem can be formulated as an optimization problem, where each measurement contributes to the unknown roughness value of a segment, under the constraint that all observations yield the same roughness value. The problem is solved by a least-squares adjustment, so in parallel to the segment roughness also parameters representing the main varying influencing factors are estimated.
Our design decisions are as follows: • street segment: surface types are assumed not to change during a road segment, so segments between two junctions are assumed to be homogeneous. Separate paths (e.g. street and bike path) are modeled as separate segments.
• possible external temporal effects on the surface roughness are left out; temporal changes of the bike like load or tire pressure are assumed to be constant for the related trip.
• speed: vertical acceleration is assumed to be related linearly to speed; speeds for each segment pass are handled constant as the median; observations with speed smaller 2.5 m/s are assumed to be unreliable and are ignored.
Based on this assumptions, corrected roughness-observations of the same street segments should lead to the same values after the adjustment. As an analogy to the well-known bundle block adjustment in photogrammetry (e.g. in (Luhmann et al., 2013)), where corresponding tie points in images of different perspectives are used to reconstruct their relative poses, our approach utilizes street segments as tie points to adjust differing observations of their roughness. Like estimating camera model parameters in parallel, the trip specific parameters including userbike setting are determined. This way different shock sensitivities of the measurement system are modeled implicitly.
In the absence of suitable preliminary work on the functional relationship between road roughness and resulting vertical acceleration for bikes, a basic linear scale model is used. The relation between observations and unknown parameters is introduced via the functional model (3).
where l MAD (p) : speed normalized MAD observation of segment passage p x trip (t) : unknown correction parameter of trip t x rough (s) : unknown roughness of segment s Due to no prior knowledge about stochastic relations, they are assumed to be equally accurate and uncorrelated. Thus the stochastic model is represented by an identity matrix.
The trip parameters x trip (t) to be estimated beside the segment roughness include all trip specific influences. The user-bike setting is assumed to be the largest included effect. They are assumed to be constant for each trip, thus for each trip one parameter value is estimated. Because most external effects' influence can not be differentiated from each other, the main objective is to model them implicitly. Included factors are the bicycle and tire type (e.g. tight racing bike or spring damped MTB), user's weight and common pose and phone holder setup. Deviations in an user-bike setup (and thus in the system's sensitivity) over time are this way also included in the related trip parameters, i.e. if the tires are pumped up between two trips or the bike is changed. In this way, an assignment to specific users is not strictly required.

CASE STUDY: HANOVER CITY
The previously introduced approach is applied to a real world data set from Hanover (Germany) in this section.

Used data sets
In the following subsections the cyclists data and way network used in this case study are explained.
3.1.1 Collected smartphone data: In (Wage et al., 2020) an Android smartphone application, called RideVibes, has been developed to comfortably collect cyclist trajectory and acceleration data. A sensor logging application for smartphones has been used to comfortably collect cyclist trajectory and acceleration data. To acquire data on their everyday rides, users just need to attach their smartphone via a holder to their bike and run the app. The participants must start and stop recording the sensor data individually for each trip. Further, for maximum control of the data, it is first logged locally and can be uploaded selectively in a pseudonymized way to a backend infrastructure including a database server.
The application records a smartphone's position and speed once per second via common GNSS-based location services. In contrast, accelerations affecting the smartphone are logged with about 100 Hz. The influence of gravitation is removed and the phone orientation in the holder is compensated by transforming the acceleration measurements in the way that the z-axis points to the sky. The rotation matrix is calculated using also the magnetometer and gyroscope of the smartphone.
The data was recorded over a period of about one and a half years by about 8 test persons in Hanover with about 13 different user-bike combinations. For this study trajectory and acceleration data of about 1454 trips with a total length of 7200 km is used. They include actual everyday trips, as well as sporadic additional trips on less explored streets in and around the city center for better coverage. About half of the trips were recorded by the authors alone (using different bikes). This way we were able to reach quite a good exploration rate of the center districts network (Figure 2), but also a basic coverage around. Due to the urban setting, a bias towards paved surfaces can be assumed. However, the authors do not see this as a problem for the test scenario, since it is a realistic application area for such an approach. In line with widespread behavior -but certainly reinforced by the desire to protect the smartphone from wetness -few trips in acute rain are included, but this should not have a significant impact on roughness given the predominantly paved paths in urban areas.
Only some very soft dirt paths in parks, etc., could be influenced in their roughness by greater wetness, but this is not the purpose of this study.

Way network:
To extract a georeferenced graph representation of the bikeable way network topology OSM (Open-StreetMap contributors, 2020) data was used. All segments are interpreted bidirectional, because in the case of cyclists, many paths are not restricted to a specific one. For this case study OSM data (from April 2020) of the region around Hanover was processed with the open-source tool osm2pgrouting (Kastl et al., 2017). Based on related tags, the tool filters the comprehensive OSM data set for bike paths. Further, the resulting way geometries are transformed into a topologically connected (thus routable) graph structure and stored into a database. In the resulting graph, nodes represent way intersections and connecting edges reproduce street and path segments in between. An example is given in Figure 3.

Realization
As introduced in the approach, in a preprocessing the collected bike trajectories are matched to the network graph. Next, as observation input for the least-squares adjustment, the vertical acceleration values of each time a network segment is passed are processed via (2) into a roughness measure.
The available 1454 bike trips include 95337 segment passes and thus result in a corresponding amount of observations as input for the adjustment. Those cover 17694 distinct segments, which result -in combination with the number of trips -in 19148 unknown parameters to estimate.
For an experimental evaluation, the adjustment approach of section 2.3 was realized using the least squares function of the Python library Scipy (Virtanen et al., 2020) including the following cost function: where ρ(z) : soft-l1 loss function fi(x) : residuals Since many outliers are to be expected, a more robust soft-l1 loss (smooth approximation of l1) is used instead of a standard linear one. In contrast to the even more robust Cauchy loss, experience has shown that this converges more reliably and was therefore chosen as a compromise.

RESULTS AND DISCUSSION
For this study scenario after 156 iterations the adjustment converged sufficiently. The change of the cost function (4) went below the threshold of 10 −8 , so no further significant changes of the overall cost are assumed. The initial cost of 28813 was reduced to 17612. As a result, each segment is assigned an estimated roughness value and each trip a correction factor.

Resulting Residuals
In Figure 4 the resulting residuals of all observations are plotted as scatter. Although it looks quite noisy, the absolute median of all values is 0.27. The lower 5-percentile is at a level of -1.22 and the upper 95-percentile at 0.94, indicating a small asymmetry. As an orientation, a difference of less than 1 is subjectively rated by the authors as little perceptible in practice.
In the case of very fine asphalt, this may already be caused by several cracks or by a coarser asphalt composition. Further, in Figure 5 the residuals can be visually checked to have no remaining systematic effects related to speed. The most common speed seems to be around 6 -7 m/s, so about 21 -25 km/h, coherent with a sporty bias of the users.

Estimated Parameters
The estimated roughness parameters of the way segments are mapped exemplary for the area of the university park and illustrated in Figure 6 (right map). On the left are given the ways' surface types as kind of reference. In general, segments of cobblestone or planks (with a roughness larger 6) are red, badly paved and gravel paths (between 2.7 and 6) are colored orange, smoothly paved ways are yellow (2 -2.7) and plain asphalt (roughness smaller 2) is green. Even a small wood planked bride over a small pond in the park (A) is represented (reasonably) as a quite coarse part. Most asphalted main ways and streets show similar values less than 2, but those in a bad condition (B) show similar roughness to paved parts. However, the values of gravel paths diverge more, but their actual quality also varies more.
Not only roughness is estimated, also trip (and thus implicitly user-bike setting) specific corrections. The resulting parameter values of a selection (all are too confusing in a plot) of users is plotted in combination with their trips over time in Figure  7. Although the curves vary a lot, their different levels attract attention: User 3, 24 and also 31 show up relatively high correction values most of the time, compared to others. Actually those users rode sporty (track/racing) bikes with high tire pressures of 6-8 bar. In contrast, users 10 and 32 went by classic city bikes, used between 2-3 bar and a more relaxed rider pose. Thus, even if they are noisy, the trip specific scale corrections show up to adapt varying shock sensitivities. Based on this, future research could reveal anomalous behavior like badly inflated tires. Figures 8 and 9 give a more detailed insight into specific way segments. Beyond the overview of adjusted roughness parameters in Figure 6, they show two exemplary segments with multiple observations over time. The values of corrected roughness observations give an impression of the measurement dispersion.

Multiply Observed Segments
The variance of observations varies between different segments and also coarse outliers can occur for different reasons. Due to the very simple functional model, influences of the user-bike system are assumed to be constant for a trip, so differing poses over time or sequences of one/no hand riding are not handled and can potentially distort the respective observations. A similar effect will also result from incorrect map matching or missing way segments, which leads to wrong assignments of observations and segments. However, those issues should have no major influence on the parameter estimation, because they only occur infrequently and thus for multiple observations the robust loss function downgrades them.
We refrain from presenting segment examples with perfectly small deviations here and focus on two challenging examples with rather scattered and inhomogeneous roughness. Based on them, two observed inhomogeneity phenomena are differentiated and discussed in more detail, spatial and temporal inhomogeneity: 4.3.1 Spatially inhomogeneous segments occur with very scattered or reoccurring outlier roughness samples over the full time period. Possible reasons are very inhomogeneous way profiles or inconsistencies at road intersections. But also unmodeled parallel tracks or incorrectly assigned segments can result in this. An example for this type of inhomogeneity is given in Figure 8. Most of the samples are located on a level around the actually estimated roughness (dashed green line). Beside those, some outliers from different users with higher values of about 3-5 are occurring infrequently over the time. The segment is one of the roadways of Schneiderberg street shown in Figure 3 with separated (but optional to use) bike paths on both sides. Thus those outliers can be assumed to result from wrong matches due to the small margin between both similar courses. Those samples indicating a substantial higher level of roughness were actually sensed on the poorly paved bike and foot path next to the smoothly asphalted roadway and are only linked to the roadway segment because of an inaccurate trajectory and thus wrong map matching. However, the estimation of the actual roughness adapts robustly to the majority of the observations, thus a relevant influence is not expected, but of course this finding could be used to correct the matching.
Similar patterns might occur when alternative/parallel paths are missing in the underlying road network. In those cases, occasionally reoccurring coarse outliers are a hint on actually exist- ing alternative ways to be added to the network model. This will be investigated in future work.
4.3.2 Temporally inhomogeneous way segments actually changed their roughness over time. This might happen in both directions, lower e.g. due to a reconstruction, or higher e.g. due to additional damages or seasonal effects like massive autumnal leaves and branches which can fall on the ground.
An example of this type is given in Figure 9. In the first half of the plot the observations scatter around the estimated roughness (dashed green line), but after a gap between April and June 2020 further observations are located on a significantly smoother (lower roughness) level. A plausible reason for this effect is a road reconstruction of this segment's asphalt, which took place around May 2020. The asphalt surface before was in a bad condition with several cracks and potholes. This way, affected segments can be split into two (or more) virtual ones, representing it before and after the break point. Alternatively, even more straight forward, all observations before the break point can be filtered out and ignored in a future adjustment to represent only the latest network state. This, however, presumes that such break points are identified automatically.
Based on the discussed example in Figure 9 a first test for an automatic change (or break point) detection for a temporally inhomogeneous segment was applied. Otsu's method (Otsu, 1979), originally suggested for basic fore-and background segmentation in image analysis, was adapted to segment the two major roughness level over time. The result plotted in Figure 10 nicely shows the roughness of about 2.8 before and 1.1 after the asphalt changes sometime between March and July 2020. The algorithm correctly identifies July 15th as change point (based on the minimum within class variance, depicted in Figure 10, lower part). As an advantage of this method, there is no need for assumptions about the change point. Further, no threshold parameters need to be given.

CONCLUSION
This paper addresses the problem of integrating measurements of roughness from diverse bikes and users into a jointly scaled representation by applying a least-squares adjustment. A case study is carried out to test the presented approach with realworld floating smartphone data.
The underling way network was extracted from OpenStreetMap and the sensor data was acquired with standard smartphones running a special logging app. Participant just needed to attach a phone to their bike and collected trajectory and acceleration data while riding their trips.
The collected trajectory data is automatically map matched to the way segments. Then, the vertical acceleration signal of each segment pass is transformed into a robust roughness index. Those are used as observation input for a least-squares adjustment, to estimate trip-wise scaling factors and a corrected roughness parameter for each segment. Alongside the robustly estimated roughness parameters for each segment, also a way's change over time can be analyzed across varying bike-user settings. In addition, a method for automatic detection of abrupt changes (e.g. due to reconstruction) in the surface quality is suggested and applied to an exemplary street.
Even if the functional and stochastic models are quite basic, the results and conclusions of the case study already show sufficient performance for the intended purposes. Thus, this is a promising approach to collectively evaluate crowd-sourced ride dynamics using commonly available smartphones. Despite the related inhomogeneities and without explicit knowledge of the respective settings, the information can be supplemented to form a unified view of the ways surface roughness. With sufficient dissemination, spatial and temporal coverage could be achieved in a way that would not be possible with individual specialized measurement systems.
Resulting outputs like a roughness map of the way and street graph can be used as weight factor in comfort sensitive bike routing services. Besides individual mobility, efficient bicycle navigation is also gaining importance in commercial traffic, especially in the area of increasingly bicycle-based urban logistics (e.g. food and parcel delivery services). Further, pain points in the network can not only be bypassed via such a routing, but also could be identified in quasi-real time for future infrastructure maintenance and planning. Further, a conceivable research option would be to use the knowledge gained about the surface conditions for an additional similarity measure in map matching. In this way, despite their spatial proximity, parallel roads and bike paths could be better differentiated based on their roughness.
Besides those findings, there are open issues, which should be addressed and included in future works into the modular and flexible process chain. One of those is to introduce reference values for several segments into the adjustment. Such reference values could be determined using a theoretical analysis of rough surfaces. An alternative is to use another data source, e.g.
LiDAR point clouds, to analyze the surface and derive a proxy for the roughness. In this way, there would be an absolute reference and also regions (e.g. different cities) which are not linked by joint trips, could be leveled in a common scale and thus be comparable. Also a more detailed accuracy investigation for observations and parameters and a more refined integration of stochastic information would be supported by absolute and superior reference observations. Gained insights would also facilitate a refinement (and extension) of the functional model.
In summary, the calibration approach presented here for surface roughness determination of bike paths is a relevant progression from recent bike specific approaches. The process chain enables to analyze crowd-sourced data without further explicit knowledge about the user and bike system. Only based on acceleration (and location) data, the differently scaled trips can be fit on each other via shared way segments.