Content uploaded by Gediminas Žylius
Author content
All content in this area was uploaded by Gediminas Žylius on Nov 29, 2015
Content may be subject to copyright.
267
Proceedings of 9
th
International Conference ITELMS’2014
Driving Style Analysis using Spectral Features of Accelerometer Signals
G. Zylius, V. Vaitkus, P. Lengvenis
Faculty of Electrical and Electronics Engineering, Kaunas University of Technology, Lithuania, E-mail:
gediminas.zylius@ktu.edu
Abstract
The paper presents analysis of 3-axis accelerometer driving data in order to estimate driving style. We assume that
driving style could be roughly divided into two groups: aggressive driving and safe driving. Methodology used in this
research is applicable to shuttle transport driving analysis and gives possibility to analyze driving style of different road
segments. The results of this work show that longitudinal acceleration data could be used in order to effectively classify
aggressive and safe driving trip by using short-time Fourier transform features of different road segments.
KEYWORDS: driving style, 3-axis accelerometer, driver classification, spectral analysis.
1. Introduction
The analysis of driving style for the companies, such as public transport, delivery service or insurance could
help to manage service quality and increase yield by giving the possibility to control or monitor driver behavior which
is related to appropriate driving style.
Signals related to driving behavior could be divided into 3 main groups: vehicle’s signals, driver’s signals and
environment signals. Vehicle signals are obtained from dynamics of vehicle, states and outputs (w.r.t. vehicle). Driver’s
signals are obtained from driver’s state (physiological signals) and output (driver’s operating signals). Environment
signals are signals that could be obtained from the traffic environment, such as states of surrounding vehicles, road
signals (line markings, terrain, potholes, condition).
There are numerous researches done related to driving behavior analysis. In paper [1, 2] the experiment with
instrumented vehicle was done with different drivers and analysis of driver’s operating signals (pressure of accelerator
and brake pedals of the vehicle) by modeling each individual driver using Gaussian Mixture Models (GMM) showed
that biometric driver identification could be done using those signals’ dynamic features combined with state and that
they carry individual driver biometric information the most comparing other signals. Further researches of the same
group of scientist [3] show that increase in driver identification rate is obtained using spectral features (i.e., cepstum) of
brake and accelerator pedal pressure signals.
In [4] the experiment with driving behavior was done using in-vehicle CAN-bus signals. The research results
showed that using available CAN-bus signals (such as steering wheel angle, brake/acceleration status and vehicle’s
speed) using Hidden Markov Models (HMM) combined with GMM identification of driving maneuvers could be
obtained without other external sensory data. Much later, using same vehicle, the experiment was done [5] that
compared available CAN-bus signals and smart portable off-the-shelf device (i.e., tablet PC) sensory information. The
results show that using portable device as a sensor platform the driving maneuver identification rate was higher that
using CAN-bus information.
The use of smart portable device’s sensors for Driver Assistance Systems (DAS) emerges rapidly because of
relatively rich sensor information available and that no additional external computational hardware is necessary. It is
also is affected by the fact that more and more people are using smartphones and DAS could be implemented without
additional hardware as an application program only which is very cheap and easy to apply. For example, in the
smartphone as a sensor platform was applied in the [6] for aggressive driving and driving event recognition. The
reseach of vehicle’s condition evaluation, road condition classification and driving behavior evaluation system also
using smartphone was done in [7]. Both experiment used smartphone inertial measurement sensors (accelerometer or
gyroscope) and GPS.
In this work we consider that driving style could be divided into two main groups: aggressive and safe driving
(regardless the land vehicle type). Aggressive driving should be considered driving type containing all negative driving
features that contribute to reckless driving, vehicle damaging, passengers’ discomfort and also fuel consumption. Safe
driving should be considered driving type opposite to aggressive driving. Motivated by the previous experiments using
vehicle’s inertial signals [6-10] in this experiment that show the effectiveness of inertial sensors in driving style
capturing, we use only 3-axis accelerometer data to classify driving style into aggressive and safe driving.
Our experiment constraints are as follows: the same driver is driving the same vehicle in aggressive and safe
driving style on the same route. The research results application will be related to shuttle transport services when the vehicle
is driven the same route all the time and no different route consideration is necessary. Spectral analysis is used in order to
obtain features from accelerometer signals that later are used for driving style classification into aggressive and safe.
Further the paper is divided into following sections: 1) Accelerometer signal pre-processing; 2) Spectral
features extraction; 3) Feature selection; 4) Driving style classification; 5) Conclusions and future work.
268
2. Accelerometer signal pre-processing
In this section a signal pre-processing is described, that is necessary for appropriate further use of the signal. In
Fig. 1 two examples of safe/normal and aggressive driving styles are depicted of all accelerometer (G-sensor) signals.
In depicted example (Fig. 1), signal values at the end (from 16,000
th
to 20,000
th
safe/normal driving signal
discrete values and from 12,500
th
to 15,000
th
aggressive driving signal discrete values) correspond to inactive driving
period which doesn’t contain information about driving style. This kind of signal end information should be removed.
The simple thresholding methodology cannot be used for this kind of filtering because of possible data spikes (Fig. 1
aggressive driving discretes >14,000) and bias values of signal in stop period (as depicted in Fig. 2). The bias values
occur because the vehicle can stop in any position w.r.t. gravity vector and because the accelerometer (G-sensor) values
are measured w.r.t. gravity vector, the bias values depend on slope of the platform the vehicle is stopped (standstill on
the uphill or downhill).
0.2 0.4 0.6 0.8 1 1.2 1.4 1.6 1.8 2
x 10
4
100
200
300
400
500
Normal driving
Acceleration amplitude
Data point number
2000 4000 6000 8000 10000 12000 14000
100
200
300
400
500
Aggressive driving
Acceleration amplitude
Data point number
Lateral
Vertical
Longitudinal
Fig. 1. 3-axis accelerometer signal examples of driving in aggressive and safe driving styles the same route. Signal
values at the end correspond to inactive period (when vehicle is not moving) and must be discarded for further
analysis
0 0.2 0.4 0.6 0.8 1 1.2 1.4 1.6 1.8 2
x 10
4
320
340
360
380
400
420
440
Discrete Number
Acceleration Amplitude
1st longitud. acceleration
2nd longitud. acceleration
bias
end of trip (start of standstill period)
Fig. 2. Longitudinal acceleration signals of two trips of the same route. Bias is depicted as difference of two signals
when vehicle standstill
269
In order to solve the pre-processing problem mentioned above we use median sliding window filter
methodology for filtering three accelerometer signals at once. The signal end sections after proposed filtering are
depicted in Fig. 3. The automatic median filtering technique removes signal values using sliding window until the
minimum median difference threshold value of signal window is violated (minimum median difference value is 1). The
tradeoff between window length and precise median estimation exist, in this experiment we use 100 discrete sliding
window.
1000 2000 3000 4000
250
300
350
400
Acceleration Amplitude
Lateral Axis
Raw
Pre-processed
1000 2000 3000 4000
100
120
140
160
180
200
220
240
260
Discrete number
Vertical Axis
1000 2000 3000 4000
340
360
380
400
420
440
460
Longitudinal Axis
Fig. 3. Raw acceleration signals and filtered signals using median sliding window methodology
3. Spectral feature extraction
The aggressiveness of driving style is related to variability of the acceleration signals, it could be noticed in
Fig. 1 example that when driving aggressively the range of signal and variability increases. From the first look, when
analyzing signal in time domain, it could be reasonable to determine some threshold values and calculate the times the
signal violate threshold values. But, as mentioned before, the acceleration signal amplitude are calculated w.r.t. gravity
vector and if vehicle is going uphill for example, the bias value occur and simple thresholding doesn’t work. Therefore
we use spectral analysis: the signal variability and power (high amplitude deviations) could be captured using short-
time Fourier transform. The whole signal Fourier transform can only capture the whole signal variability and no
information about possible occasional aggressive driving. In order to capture aggressiveness of driving in the signal
zones of interest and increase their contribution, a windowed (short-time) Fourier transform should be applied: short-
time significant aggressiveness of signal could be obtained and so more precisely the driving style could be estimated
taking into consideration short-time signal intervals of the whole trip. Before that, signal resampling were performed to
have same amount of data for each signal. The short-time Fourier transform (in continuous time domain) is defined as
follows:
dtetwtfF
tj
w
ttw
-
-=
ò
)()(),( (1)
where
w
is frequency;
t
is time; )(
t
-tw is window function (in our experiment we use Hamming window). After the
short-time Fourier transform (using fast Fourier transform in MATLAB environment), we calculate power spectral
density. The power spectral density matrix is defined as:
2
),(),( jiFkjiP = (2)
where ),( jiF is discrete-time fast Fourier transform and k for one-sided power spectral density is defined as follows:
å
=
=
L
n
nw
k
1
2)(
2
(3)
where L is length of window. At zero and Nyquist frequencies, the factor of two in the numerator is replaced by 1. After
the power spectral density calculation the example of spectrogram (logarithm of power spectral density in time
windows of short-time Fourier transform) is depicted in Fig. 4.
270
Fig. 4. An example of one axis accelerometer signal spectrogram (PSD – power spectral density) using 500 signal
discrete window length with 50% overlap factor
Further we use logarithm of power spectral density of appropriate frequency values as features for each
window segment and later use for classification of aggressive and safe driving segments for each driving trip.
4. Feature selection
In this section, we discuss feature selection algorithm which is useful for dimensionality reduction and selected
features are later used for classification. In this research we use Principal Component Analysis (PCA) methodology for
dimensionality reduction. Principal component analysis (PCA) is a statistical procedure that uses orthogonal
transformation to convert a set of observations of possibly correlated variables into a set of values of linearly
uncorrelated variables called principal components. The example of PCA operation is given in Fig. 5.
Fig. 5. An example of principal component analysis for dimensionality reduction. PCA assumes maximum variance
criterion when choosing most discriminative principal components for classification task
The PCA analysis using various combinations of signal features are graphically illustrated in Fig.6. Depicted
segments were selected using reference aggressive driving and safe driving signals. From Fig. 6 the discriminative
capabilities can be seen for various combinations selecting first two principal components for visualization. It is clear
that longitudinal acceleration data alone can reasonably good be used for classification, however still combination of
longitudinal and lateral acceleration, longitudinal and vertical acceleration and all three signal combination could be
also reasonable choice. Other combinations seem to give less important results to further we investigate previous
mentioned combinations.
271
-400 -200 0 200 400
-200
0
200
longitudinal+lateral+vertical
Safe driving segments
Aggressive driving segments
-200 -100 0 100 200
-100
0
100
200
longitudinal
-200 -100 0 100 200
-100
-50
0
50
vertical
-200 -100 0 100 200
-100
0
100
lateral
-200 -100 0 100 200
-200
0
200
longitudinal+vertical
-200 -100 0 100 200
-100
0
100
200
longitudinal+lateral
-200 -100 0 100 200
-100
0
100
lateral+vertical
PC 2
PC 1
Fig. 6. Reference aggressive and safe driving segment PCA extracted features (two Principal Components (PC))
illustration after combining various signals’ original features (spectrograms)
5. Driving style classification
In previous section we used PCA analysis to investigate what combinations of features to use further for
classification. In this section we use whole driving signal (aggressive and safe) segments using moving window with
50% overlap factor in order to generate spectrogram features and classify them, when classification method is trained
with previously (section 4) depicted aggressive and safe driving segments. The purpose of this classification is as
follows: each separate driving trip segments’ (after performing spectrogram feature generation) principal components
(principal component eigenvectors are obtained from reference driving trips) are used as an input to the trained
classifier in order to obtain score of driving trip (aggressiveness or safety of driving trip after classifying each driving
segment into aggressive or safe). And we compare classification-based scores with the expert decisions about safe or
aggressive driving trip.
For this task, we used Random Forest (RF) classifier with two principal components. No additional cross-
validation checks were performed because of RF classifier (bagged decision trees in MATLAB) internal use of bagging
(bootstrap aggregating) ensemble methodology. Classification results after out-of-bag error analysis favor longitudinal
acceleration signal alone compared to other combinations (Fig. 7) achieving only ~3% error for aggressive and safe
reference segments. So further we use only longitudinal acceleration signal in order to obtain aggressiveness and safety
score for each driving trip.
The results of aggressiveness and safety of driving using experimental driving trips are summarized in Tab. 1.
272
0 10 20 30
0.05
0.1
0.15
0.2
0.25
0.3
0.35
0.4
lateral+vertical+longgitudinal
0 10 20 30
0
0.1
0.2
0.3
0.4
longitudinal
0 10 20 30
0.1
0.15
0.2
0.25
0.3
0.35
0.4
0.45
lateral+longitudinal
0 10 20 30
0.2
0.25
0.3
0.35
0.4
0.45
0.5
vertical+longitudinal
out-of-bag classification error
number of grown trees
Fig. 7. Out-of-bag random forest classification error dependency on number of grown trees. The smallest
misclassification percentage is using only longitudinal signal features
Table 1
Aggressive and safe driving trips classification and expert label comparison
Driving
Number
Safe segments
classified
Aggressive segments
classified
Aggressive/safe Expert label
1
13
26
2
aggressive
2
9
30
3.333333
aggressive
3
9
30
3.333333
aggressive
4
7
32
4.571429
aggressive
5
11
28
2.545455
aggressive
6
25
14
0.56
safe
7
28
11
0.392857
safe
8
39
0
0
safe
9
38
1
0.026316
safe
10
39
0
0
safe
6. Conclusions
After the comparison in Table 1, it is observed that high correlation between expert labels and aggressive/safe
ratio obtained by classifying each road segment, exist: the bigger the ratio, the more aggressive driving is.
Classification methodology presented in this work could be useful for automatic aggressive driving detection
and recognition. After all analysis we can conclude that for our application purposes longitudinal acceleration signal
information is sufficient.
This research also shows that with appropriate constraints, driving style classification and recognition
(considering aggressive and safe driving) can be done by a very low cost sensory information – longitudinal
accelerometer alone and lets minimize system costs to minimum. Only requirements for the sensor is appropriate
273
attachment to vehicle body. This king of system would not interfere with any vehicle system devices and is easily to
integrate with other system elements.
In future, we will use more inertial signals and are planning to expand the possibilities for this kind of system
by minimizing constraints and integrating more features that would increase capabilities of transport management.
References
1. Igarashi K., Miyajima C., Itou K., Takeda K., Itakura F. and Abut H. Biometric Identification Using Driving
Behavioral Signls. IEEE Int. Conf. Signals, Multimedia and Expo, vol. 1, Jun. 2004, p.65-68.
2. Wakita T., Ozawa K., Miyajima C., Igarashi K., Itou K., Takeda K. and Itakura F. Driver Identification Using
Driving Behavior Signals. IEEE Proc. Intelligent Transportation Systems, Sept. 2005, p.396-401.
3. Miyajima C., Nishiwaki Y., Ozawa K., Wakita T., Itou K. and Takeda K. Cepstral Analysis of Driving
Behavioral Signals for Driver Identification. IEEE Int. Conf. Acoustics, Speech and Signal Processing, vol. 5, May
2006, p.921-924.
4. Choi S., Kim J., Kwak D., Angkititrakul P. and Hansen J. H. L. Analysis and Classification of Driver Behavior
using In-Vehicle CAN-Bus Information. 2007.
5. Sathyanarayana A., Sadjadi S. O. and Hansen J. H. L. Leveraging Sensor Information from Portable Devices
towards Automatik Driving Maneuver Recognition. IEEE Int. Conf. Intelligent Transportation Systems, Sept. 2012,
p. 660-665.
6. Johnson D. A. and Trivedi M. M. Driving Style Recognition Using a Smartphone as a Sensor Platform. IEEE Int.
Conf. Intelligent Transportation Systems, Oct. 2011, p. 1609-1615.
7. Fazeen M., Gozick B., Dantu R., Bhukhiya M., Gonzalez M. C. Safe Driving using Mobile Phones. IEEE Trans.
Intelligent Transportation Systems, vol. 13, no. 3, September 2012, p. 1462-1468.
8. Aljaafreh A., Alshabatat N. and Al-Din M. S. N. Driving Style Recognition Using Fuzzy Logic. IEEE Int. Conf.
Vehicular Electronics and Safety, Jul. 2012, p. 460-463.
9. Ly M. V., Martin S., Trivedi M. M. Driver Classification and Driving Style Recognition using Inertial Sensors.
Intelligent Vehicles Symposium, Gold Coast, Australia, June 23–28, 2013, p. 1040-1045.
10. Krotac T., Simlova M. The Analysis of the Acceleration of the Vehicle for Assessing the Condition of the Driver.
Intelligent Vehicles Symposium, Alcalá de Henares, Spain, June 3–7, 2012, p. 571-576.