New road anomaly detection and characterization algorithm for autonomous vehicles

This paper presents a new algorithm for detecting and characterizing potholes and bumps directly from noisy signals acquired using an Accelerometer. A wavelet transformation based filter was used to decompose the signals into multiple scales. These coefficients were correlated across adjacent scales and filtered using a spatialfilter.Roadanomalieswerethendetectedbasedonafixedthresholdsystem,whilecharacterizationwas achievedusinguniquefeaturesextractedfromthefilteredwaveletcoefficients.Ouranalysesshowthattheproposedalgorithmdetectsandcharacterizesroadanomalieswithhighlevelsofaccuracy,precisionandlow falsealarmrates.


Introduction
Autonomous vehicles are vehicles capable of sensing their environment and navigating without human input under different terrains, particularly over asphalt roads. The capacity to autonavigate greatly depends on the vehicle's ability to monitor and accurately interpret road surface conditions [1]. Thus, developing effective road surface monitoring mechanisms will greatly improve the viability of autonomous vehicles, while contributing to the reduction of related road accidents around the world [2][3][4][5][6][7].
In monitoring road surfaces, accelerometers are frequently proposed for use in autonomous vehicles [8,2,[9][10][11]]. An accelerometer is a device that measures the acceleration of a body (for example, a vehicle, an aircraft or a rocket) relative to g-force [12]. The output of an accelerometer can be viewed as a series of time sampled measurements influenced by the movement of an observed body (a vehicle in this case) in three dimensional space. However, a familiar and widespread problem with processing measurements from an accelerometer lies in the noisy nature of the measurements [2]. The randomness in acceleration signals often makes road anomaly detection a difficult process, while rendering characterization an even more difficult and sometimes impossible task [3][4][5][6]. In this case, we refer to detection as the identification of an anomaly, while characterization is defined as the recognition of the type of sensed anomaly (in this case if it is either a pothole or a bump). Thus, providing new methods for improving road anomaly detection and characterization motivated the work reported in this paper.
In this regard, we propose a Road Anomaly Characterization Algorithm (RACA) based on the Wavelet Transformation Scale Space Filtering (SSF) algorithm. The SSF algorithm processes the acceleration signals by decomposing them into multiple scales. It proceeds by correlating the decomposed wavelet coefficients of the signal across adjacent scales and then filtering the noisy samples via a well-designed spatial filter. The SSF algorithm feeds a Road Anomaly Detection Algorithm (RADA) to detect road anomalies via a fixed threshold technique, while feeding RACA to characterize road anomalies. RACA achieves characterization using two unique features to differentiate potholes from bumps. Following our new approach, it is noted that the following contributions have been made: (1) A new approach for road anomaly detection and characterization has been developed based on the application of Wavelet Transformation theory. To the best of the author's knowledge, this investigation involving the use of the WT based filter for characterizing accelerometer based dataset marks the first attempt in this regard. The results obtained also indicate positive strides in the effort towards addressing the characterization problem for future deployment in autonomous vehicles.
(2) Based on the adopted WT approach, new features were arrived at that can be used to characterize the presence of bumps and potholes on asphalt roads. One important note is that these features were only made extractable following the use of the approach proposed in our work.
The rest of this paper is structured as follows: related works are presented in Section 2, Section 3 presents the proposed methodology, while results, analysis and discussions are presented in Section 4, while conclusion is drawn in Section 5.

Related works
We briefly discuss related works on road anomaly detection while highlighting the limited consideration for solving the road anomaly characterization problem in the literature, particularly within the scope of the author's knowledge. In [13], an accelerometer was used to acquire acceleration signals across different roads. A Support Vector Machine (SVM) learning technique was used to analyze the acceleration signals to detect road anomalies and ACI 16,1/2 to determine their location. Similarly, the authors in [14] used a machine learning approach to classify road surfaces into either smooth or rough roads using signals obtained from a mobile phone based accelerometer and a gyroscope framework. While they were able to detect road anomalies with a relatively high precision rate, the anomaly characterization problem was not considered. Furthermore, the learning approaches in [14,13] both require a training process leading to an increase in the complexity of these approaches, and great dependence on the specific type of input data being considered.
In [15], data was acquired using a gyroscope, an inertial sensor and a mobile phone to detect road anomalies. Authors analyzed signals using the wavelet transformation technique alongside the SVM. Specific statistics such as the absolute mean, standard deviation, variance and the energy of the signal were used to train the SVM to classify road anomalies into either severe, mild or span levels. Gonzalez et al. [16], in a similar approach used the Multilayer Perceptron (MLP) algorithm to analyze road anomalies. They demonstrated a high level of precision and detection accuracy in their experiments.
An accelerometer and a GPS based pattern recognition system was used for road anomaly detection in [17]. The process included a pre-processing stage, classification using an SVM, and visualization of the output. Results indicated better statistical performance than the other approaches considered in [16]. In [18], a GPS, video module and acceleration signals were used by an onsite real time algorithm for pothole detection. The goal was to minimize the amount of data transmitted to a central server.
A pothole patrol system comprising of a vehicle equipped with an accelerometer sensor for monitoring and detecting potholes was developed for anomaly detection in [19]. The accelerometer data captured during the drive tests were relayed via WiFi to a central database where it was used to train an SVM for clustering the measured acceleration data. Similarly, an approach was proposed for processing measurements obtained from a laser profilometer in [20] towards profiling road surfaces. Results indicated that the Discrete Wavelet Transformation (DWT) technique performed well in profiling the road surface than the Power Spectral Density (PSD) approach.
A crowdsourcing-based pavement monitoring system was proposed in [21] for road anomaly detection using an accelerometer, a GPS and a smartphone probe car application. A grid-based clustering algorithm was further introduced for comprehensive information extraction and filtering. Similarly, an investigation was conducted in a vehicle probe-based pavement maintenance project to examine the possibility of using data from connected vehicles for road pavement conditions monitoring [22]. Experimental results showed that pothole anomalies were detected based on a developed sigma threshold and a wavelet tranformation algorithm. Nevertheless, it was noted that the characterization problem was not considered.
Essentially, other works identified in [23,24,10,25,2] considered issues pertaining to detection, monitoring, localization, and evaluation of road anomalies, with little or no consideration for road anomaly characterization. We suggest that the difficulty associated with extracting distinct features from apparently indistinguishable (often noisy) acceleration signals may well justify this limited consideration. Thus, we consider the characterization problem in this paper. We note that effective road anomaly characterization will improve piloting in both manned and unmanned vehicle navigation. Furthermore, realtime knowledge of road conditions will facilitate quick maintenance response by particular agencies.
3. Development of the proposed system Figure 1 represents the overall design for our proposed system. A discussion of each block is provided in the following sub-sections. New road anomaly detection for vehicles 3.1 Input stage: road surface sensing In this section, we describe the development of our data acquisition system. The process of road surface sensing is shown in Figure 2a. The three major tasks in this phase include the road surface data acquisition process using an Accelerometer, the input parameter initialization, and data display for visual inspection/analysis. We note that NI MyRio (1950) accelerometer was programmed using LABVIEW for the data acquisition exercise. A sampling rate of 30 Hz was set in the LABVIEW before commencing acquisition via several drive tests. The accelerometer was mounted and fastened to the dashboard of a Toyota Siena Space Bus 2009 model, a Peugeot 406 2000 model and a Toyota Pontiac 2003 model all driven at a speed of 25 km/h. The choice of the dashboard for placement of the device was motivated by similar adaptations identified in [21,19,11] in which the dashboard was reported as convenient position to place the accelerometer. It was ensured that the accelerometer was firmly fitted to prevent any form of loose contacts and stray vibrations. Other specific details about the experimental setup used for the data acquisition and processing can be found in [2].
We incorporated a Global Positioning System (GPS) into our design to locate road anomalies. To do this, we programmed an Arduino microcontroller under the Arduino Integrated Development Environment (IDE). The GPS data acquisition process is shown in Figure 2(b). Essentially, the system initializes the GPS module to log the time of data capture, and then records the corresponding longitude and latitude coordinates of the location where data was captured. The GPS sampling rate was set at 1 Hz which was found sufficient enough to provide location data points during the drive test [21,19].  We used the standard deviation of the acceleration signal acquired over a specific period as an approximate roughness index to describe road quality. Based on this roughness index, we developed a Road Roughness Assessment Algorithm (RRAA) presented in Figure 2c to determine the smoothness of the road surface. If the roughness index value is below a certain fixed threshold value, RRAA decides that the road surface is smooth (implying that the vehicle is on an asphalt road), and thus activates the anomaly detection and characterization algorithm (described in the next subsections). However, if the index value is above the threshold, the algorithm enters a stay mode (noting that the road being plied may not be an asphalt road and thus typically defective). The program displays a "Rough Road" message during this stay period. The road anomaly detection and characterization algorithm is only activated when RRAA measures a roughness index below the threshold value.

Processing stage: road anomaly characterization
Our characterization algorithm employs the Wavelet Transformation (WT) theory and a noise filtering technique to characterize road anomalies into either potholes or bumps. We used the filtering technique in [26,27] to filter noise from acceleration signals noting that noisy samples have lower correlation values across an increasing WT scale. This filtering technique was adopted because it processes signals along both frequency and time scales, which enables us to better resolve signals with hidden features. These hidden features can then be used for both detection and characterization purposes. We present details of each subsystem comprising the processing stage as follows: 3.2.1 Data format converter. LABVIEW software was used to program our Accelerometer. We considered the z-axis measurement of the Accelerometer as it directly relates to the vertical displacement of the vehicle producing different responses as the vehicle either descends into a pothole, or ascends over a bump. The signal from the Accelerometer obtained from point "A" in Figure 2(c) is normally outputted by the LABVIEW software in ".xml" format, which we converted to a suitable MATLAB format (".mat") for further processing. MATLAB software was used for the development of our algorithms. Basically, data is transposed from a column to a row vector and then raised to an appropriate binary power of two, and zero padded if the data size is less than the exponent value. The output of this conversion process is then passed to the characterization algorithm described in subsequent subsections.
3.2.2 Wavelet transformation model. Wavelet Transformation (WT) theory was adopted in our design. Interestingly, it is noted that while some other filtering theories may have been used only for anomaly detection purposes, the use of the WT based filter for characterization has remained to be investigated. Thus, in our work, it was hypothesized that by adopting the WT theory for filtering of acceleration signals, it will be possible to examine acceleration signals in both its frequency and timing dimensions. Our hypothesis followed the notion that by considering the timing domain of the signal in addition to its frequency dimension, we will be provided with a new scale for revealing unknown and hidden features of the signal. The discrete WT model used is expressed in Eq. (1). First, we visually examined different function patterns to determine a suitable and appropriate basis function, Ψ j;k ðxÞ to be used. The particular functions that we considered are the Mexican Hat (Morlet), Haar, Daubechies (db), Coiflet and the Meyer wavelet functions. The patterns of these functions were visually compared to typical acceleration signals with an intention to choose the most similar. We found the db2 wavelet basis function to be the best choice. Nevertheless, these functions were analysed and their performances are reported in the result section. The discrete WT model we adopted is typically expressed as New road anomaly detection for vehicles where Ψ j;k ðxÞ is the normalized dual basis function, J is the maximum number of decomposition scales, K is the maximum position in the original signal scale, W ðj; kÞ is the actual scale space decomposition at different resolution scales, j is the index of the scales, and k is the index position in the original signal space. Several members of the family of Daubechy functions were implemented according to Eq. (2) given as where a is the dyadic scale parameter, 1 ffiffi a p is the resolution, and t ¼ ka is the dyadic translation parameter. The scale variables were discretized, dilated and translated to obtain the dyadic WT using where k is the translation index ð0; ±1; ±2; . . . Þ. We describe how these functions in (1)-(3) were used in our approach for road anomaly characterization.

Wavelet transform coefficient estimator.
WT coefficients, f ðxÞ, are typically expressed as where Ψ j;k ðxÞ corresponds to the function values computed in (3). By increasing the scale factor, j, the coefficient values either remain constant or increase as the signal edges become positively correlated. On the other hand, noise samples tend to reduce at higher scales because they are poorly correlated. Using these properties, we easily extracted the noise components from the portions of interests corresponding to the anomalous points in the dataset. We describe the filtering process next based on the estimated coefficient values.

Scale space filter.
We implemented the scale space filtering (SSF) algorithm according to [27,28] for noise filtering. The SSF algorithm correlates the wavelet coefficients by directly multiplying them across adjacent scales. This can be modeled as where Ω denotes the spatial correlation function, J is the number of multiplication scales, and W ðj þ i; kÞ is the ðj þ iÞth wavelet coefficients at the k th scale. Following (5), noise samples are identified and isolated at higher scales based on their low correlation values. This process is explained considering the first and second scale wavelet transform coefficients to be W ð1; kÞ and W ð2; kÞ, respectively. Then, these two scales are multiplied for j ¼ 1 in (5) To improve detection, we found it appropriate to use Ω 2 ð1; kÞ rather than either W ð1; kÞ or W ð2; kÞ because it produces larger responses across increasing scales. The SSF algorithm based on Ω 2 ð1; kÞ is described as follows: 1. Compute W ðj; kÞ and Ω 2 ðj; kÞ using (4) and (5) respectively.
2. each scale, the power of the correlated signal Ω 2 ðj; kÞ is rescaled to the wavelet coefficient at that scale W ðj; kÞ.
3. An edge is identified if the absolute value of Ω 2 ðj; kÞ is greater than or equal to the absolute value of W ðj; kÞ when compared at the scale ðj; kÞ. 6. The next edge in the acceleration signal is extracted from W ðj; kÞ and Ω 2 ðj; kÞ by rescaling the power of Ω 0 2 ðj; kÞ to that of W 0 ðj; kÞ, and then comparing their absolute values.

7.
Steps 2 to 6 is iterated until the power of the unextracted samples in W ðj; kÞ at the scale points ðj; kÞ are approximately equal.
8. The final filtered signal W new ðj; kÞ is obtained after step 7 as input to the road anomaly detector and characterization algorithm, which we describe next.
3.2.5 Road anomaly detection algorithm. Our Road Anomaly Detection Algorithm (RADA) monitors the signal edges in the denoised signal to detect points corresponding to road anomalies in the signal. Transient fluctuations in the filtered signal are removed and saved as NSD. The absolute value of NSD is computed as NS. A counter is created to keep track of the number of detected road anomalies in each signal window, winsig, which updates as the algorithm moves across the length of the signal. A threshold value, Th, is set to determine when an anomaly is detected. In each winsig, an anomaly is declared if the value of W new ðj; kÞ is greater than Th. Thus, if one or more points in NS are greater than or equal to Th, the algorithm normalizes the number of detected anomalies within the windowed set to 1 (and increments the anomaly count). It keeps comparing each sample within winsig to Th until the whole data length is processed. If no anomaly is detected, RADA outputs a 'NO ANOMALY' message, and reinitializes a new window to continue the detection process. The process of anomalies detection by the proposed RADA is summarized in Algorithm 1.

Algorithm 1. Road anomaly detector.
New road anomaly detection for vehicles 3.2.6 Road anomaly characterization algorithm. Our Road Anomaly Characterization Algorithm (RACA) is summarized in Algorithm 2. RACA begins by setting the size of the window, winsig, for processing NS (supplied by RADA). It uses winsig to create a variable, NSD, which contains zeroes up to length NS. A sample index counter with its value initialized to 1 was created. At the start, RACA initializes the number of characterized anomalies to 0 (see lines 5 of Algorithm 2). It checks each sample in winsig (in Line 6) and then sample values less than 0 with an immediate sample value greater than or equal to 0 are characterized as bumps. Likewise, if the immediate sample value is less than 0, then RACA characterizes the sample as pothole. The counter is incremented after processing the entire samples in NSD and then RACA reinitiates to continue the characterization process.

Road Surface Profiler
The road surface profiler system was developed to profile road surfaces using the GPS coordinates obtained from the data acquistion stage (in Section III-A). The Profiler provides a map of the different anomalous points existing along the road surface. It comprises of a Hyper Text Mark-up Language script (HTML) written and interfaced with Google map. The outputs from the HTML and Google map scripts are visualized using a web browser. The inputs for the longitude and latitude coordinates of the vehicle's location are made available via the browser's interface. The Profiler provides drivers with a view of the road surface condition to enhance their driving process.

Results and discussion
The performance of the SSF, RADA and RACA algorithms are examined and discussed in this section. Ultimately, the goal of the results presented in this section is to demonstrate the capability of our algorithms to accurately detect and characterize road anomalies (with emphasis on characterization). Furthermore, in the tabular presentation of our results, the false alarm rate, accuracy, and the precision rate are reported for the anomaly detection capability of the algorithm, while the characterization results are reported in terms of the identification of either bumps or potholes.   Figure 3(a) and (d), respectively. Figure 3(a) represents vehicle acceleration signals acquired over an asphalt road containing only potholes, while Figure 3(d) represents acceleration measurements from an asphalt road having only bumps. First, we show results from the SSF algorithm revealing the correlated wavelet coefficient outputs in Figure 3(b) and (e) for the pothole and bump road surfaces, respectively. We see that these coefficients represent a finer version of the noisy measurements shown in Figure 3(a) and (d), respectively. These were further processed by the SSF algorithm and denoised to produce the final outputs shown in Figure 3(c) and (f), for the pothole and bump road surfaces, respectively. These outputs provide two unique features shown in Figure 4(a) and (b) for characterizing potholes and bumps, respectively. The basis for these features can be explained as follows: a vehicle typically descends into a pothole before ascending out of it, while ascending over a bump before descending down the bump. These different movement patterns are reflected in the acceleration signal which RACA clearly detects by leveraging on the SSF algorithm. RACA uses these features (see Figure 4(a) and (b)) to characterize road anomalies and its performance across different measurements is presented in the next subsections.  Essentially, for an already labeled dataset, if an anomaly exists (which we refer to as a positive (P)), and our algorithm successfully detects and characterizes this anomaly to be either a pothole or a bump (RD), then a True Positive (TP) is declared. However, if detected to be a non-anomaly (NRD), then a false negative (FN) is declared. Alternatively, if the labeled sample is a non-anomaly (N), and our algorithm detects and characterizes such a sample to be non-anomaly (NRD), then a True Negative (TN) is declared, otherwise, a False Positive (FP) is declared. The equations describing these metrics are as follows:

Performance analysis
The performances of RADA and RACA were analysed using the following metrics: Accuracy, Precision, and False positive rate (FPR) [29][30][31]. We describe how these metrics were computed relative to the type of measurements considered in this paper. We considered the confusion matrix shown in Figure 5.
We examined the effect of setting an appropriate detection threshold for the algorithm. The results obtained over different threshold values are provided in Tables 1 and 2 Table 2.
Average performance analysis for bumps. algorithm's detection threshold was increased iteratively from 0.000 (minimum threshold) to 0.019 incrementally by 0.001. An appropriate threshold was identified at the point where no change occured across the different performance metrics. This occured at a threshold value of 0.006 for potholes (see Table 1) leading to an accuracy of 94%, a precision of 92%, and a 0.3% false positive rate. For bumps, it occured at a threshold value of 0.01 leading to an accuracy of 96%, a precision of 83%, and a very low false positive rate of 0.6% (see Table 2). Thus, in the absence of an adaptive mechanism, a single threshold value was chosen at 0.01, which tends to produce the best performance for both pothole and bump features (see Tables 1 and 2). This value was maintained for the rest of the analyses reported in this paper.

Choice of algorithm's parameter values
We examined the performance of our algorithm over a wide range of different parameter values. The results obtained are presented in the following subsections. 4.3.1 Choice of mother wavelet function. We mentioned in Section III-B-2 that different wavelet functions were examined, and the results from these analyses are presented. The different wavelet functions considered are denoted under the variable 'Wname' and the performance results for the family of Daubechy functions is provided in Table 3 Table 5. Effect of different Symlet mother wavelets using threshold 5 0.01. Table 4. Effect of different Coiflet mother wavelets using threshold 5 0.01. Table 6. Effect of different decomposition levels using db2 and threshold 5 0.01. New road anomaly detection for vehicles combination of the measurements for both potholes and bumps was used. Furthermore, the optimal threshold value of 0.01 (see Section B above) was used. We observed (see Table 3) that accuracy and precision decreased for higher members of the Daubechy family (db2 to db19), while false alarm increased. Thus, lower members of the family of Daubechy functions performed better than higher members. The db2 mother wavelet function was selected to be the best choice for the SSF algorithm leading to an average accuracy of 94%, precision of 92%, and a false alarm rate of 0.3% respectively. Other wavelet functions were examined such as the Coiflet (Coif) and Symlet (Sym) functions and results obtained are presented in Table 4    that the Coiflet function produced high precision and low false alarm rates at the expense of poor characterization performances (see the B and PH values in Table 4). For higher members of the Coiflet wavelet family, our SSF algorithm was able to detect and characterize appropriately with low accuracy and precision rates (see Table 4) as compared to the db2 function in Table 3. Moreover, observe in Table 5 that the Sym2 wavelet function produced the same accuracy, precision, and false alarm rate with the db2 function in Table 3. This implies that either of these two mother wavelets can be used to achieve good performance. The db2 function was chosen for use in our SSF algorithm.
Other wavelet functions such as the Mexican Hat (Morlet), Meyer and Shannon functions were not considered because of their dissimilar pattern to the acceleration signals considered in this work.

Performance under varying decomposition levels.
We studied the effect of the number of decomposition levels on the performance of RACA. Different WT decomposition levels in the SSF algorithm were examined and results obtained are provided in Table 6. We observed (see Table 6) that at higher decomposition levels (specifically above 3), RACA performed poorly. One reason we may suggest is that at higher levels, the higher frequency components of the signal are filtered out leading to the loss of important signal features. Consequently, two decomposition levels were considered in the SSF algorithm to improve RACA's performance.
4.3.3 Performance under varying window size. The window size in RACA aggregates a number of samples within which an anomaly can be detected. Thus, RACA's performance was examined with regards to different window sizes. The db2 wavelet function was used (being the best choice) and a window size ranging from 10 and 50 samples produced an appreciable performance level (see Table 7). However, the algorithm performed poorly with window sizes below 5 samples. Therefore, a window size of 30 samples was considered suitable for RACA to guarantee high accuracy, precision and lower FPR values. In addition, higher values may only increase the required memory size, and not necessarily improve the algorithm's performance.
4.3.4 The road profiler output. We provide a visual feel of the output of the profiler showing both potholes and bumps in Figure 6(a) and (b), respectively. This was done for a few sampled anomalies having their respective GPS coordinates stated in Table 8. The red 1 marks in Figure 6(a) serve to indicate the different locations of the detected and characterized anomalies. These maps in Figure 6(a) and (b) aim to demonstrate the concept and functionality of the road profiler system. Nevertheless, further development in this regard is required. The profiler's output can be used by drivers to identify defective portions along the road surface towards improving the driving process.

Conclusion
This paper has presented algorithms for the detection and characterization of road anomalies for possible deployment in both manned and unmanned vehicles. Our algorithm works by filtering noisy measurements obtained via an Accelerometer mounted in a vehicle. The positive correlation property across different scales in the WT domain is employed to detect anomalous points in the acceleration signal. Two unique features were developed to distinguish potholes from bumps. Results obtained suggest that these features can be successfully used to characterize road anomalies with a high level of accuracy, precision and a low false positive rate. Future works will focus on developing adaptive mechanisms to vary the threshold value of the algorithm based on different measurement sets rather than on a static threshold value considered at this point of our research. In addition, mechanisms for communicating the characterized road anomaly information among vehicles or between a vehicle and a road side infrastructure in typical VANET systems will be examined. At the moment, it is noted that WT processors may be unavailable as off-the-shelve chipsets, thus New road anomaly detection for vehicles making the practical development of our approach an interesting issue for future research consideration. Our current research contributes towards improving road anomaly characterization for future deployment in autonomous vehicles.
Notes 1 For interpretation of color in Figure 6, the reader is referred to the web version of this article.