In order to increase the accuracy in detecting specific abnormal driving patterns, we propose a framework composing of two parts (
Figure 1): in the first phase, the normal and abnormal driving patterns are distinguished relying on DAS. Then, in the second one, the detected abnormal patterns are further classified into various specific abnormal driving patterns—weaving, sudden braking, etc.—with the help of DAS. This framework allows us to achieve the highest overall accuracy of 97.94%.
3.1. Dynamic Basic Activity Sequence Matching
As aforementioned, the proposed method, namely dynamic basic activity sequence matching (DAS), for identifying generic abnormal patterns is a combination between the machine learning techniques and the threshold-based techniques. Note that the threshold values and certain parameters are induced from the training dataset in an iterative procedure. Hence, our proposed method is flexible and independent of driving context such vehicle mode and road condition.
Indeed, the proposed method contains two phases: the parameter optimization phase and the detection phase (
Figure 2). In the parameter optimization phase, the sensor data, including accelerometer, gyroscope, and magnetometer, are collected and labeled corresponding to the normal or abnormal driving patterns. Then, such data are passed to activity detection module (ADM) (described in [
23]) to transform into two sequences of basic driving activities—containing stop (
), going straight (
), turning left (
), turning right (
)—corresponding to the long duration of activities in normal driving scenarios (representing by the window size
) and the short duration of activities in abnormal driving scenarios (representing by the window size
). Thus, each basic driving activity is detected by ADM in a sliding data window with a specific overlapping ratio that determines the overlap between two consecutive data windows.
Supposing that ADM, using the window size
seconds, transforms a sensor data segment into a sequence of basic activities
,
…
where
,
= 1, 2, …,
n. In our previous work [
23], it has been shown that in the normal driving scenarios, the optimal window size for accurately identifying basic activities of car and motorcycle drivers usually ranges from 4 to 6 s. Hence, in the later experiments,
will be tested in this range.
On the other hand, by observing, when an abnormal driving pattern occurs, the duration of its basic activities is often much shorter, i.e., 1 or 2 s. Hence, each basic activity inferred by ADM with the window size seconds, can be alternatively considered as a set of k smaller data windows of the size seconds where . Then, is further analyzed by ADM as a sequence of k smaller basic driving activities , … where , j = 1, 2, …, k. Let , … be the set of sub-labels of .
The sub-label difference of the basic activity
is computed as
where
is the set of labels in the set
that are different from the original activity label
or
.
In the other word, represents the basic signal change rate detected during the period of the activity . Thus, if then should be considered as an abnormal driving pattern, where ε denotes the threshold value. We would investigate ε in the range of (0.5–0.9) as more than half of the sub-labels of an abnormal activity are different from the label of the original activity.
Figure 3a shows the acceleration patterns of abnormal driving pattern from a data window size of 6 s. The strong fluctuations on z and y components show the changes in direction or basic activities (
and
), which are recognized in smaller windows. For normal driving pattern, the acceleration patterns in the same window size as shown in
Figure 3b are smoother in the ‘going straight’ mode.
The prediction accuracy with the parameter set (, , ε) is estimated on the training dataset. This procedure is repeatedly done with various combinations of , , and ε values in previously mentioned ranges. The parameter set (, , ε) corresponding to the best prediction accuracy is the optimal one.
In the detection phase, the accelerometer data is collected and then preprocessed similar to that in the parameter optimization phase. The details of this phase are described in
Figure 2: two simultaneous processes of driving activity detection at the different data window size
and
are implemented; the abnormal driving pattern is identified by using the optimal set of parameters (
,
,
ε) obtained from the parameter optimization phase. The procedure of detecting abnormal driving pattern is demonstrated in Algorithm 1, where
is responsible for identifying the basic activity of the data window
.
Algorithm 1: Abnormal Driving Pattern Detection |
Input: A data window Wi, threshold value ε, k |
Output: The pattern label (normal/abnormal) with respect to the data window Wi |
1. |
2. Splitting the data window into k smaller data windows |
3. |
4. |
5. For to k do |
6. |
7. |
8. If then |
9. |
10. |
11. If then |
12. |
13. Else |
14. |
15. Return label |