In this section, we describe the collection and preprocessing of the experimental data. In
Section 2.1, we describe the data acquisition, and in
Section 2.2, we provide a description of the time series.
Section 2.3 is devoted to data preprocessing. The mathematical tools used to describe the times series at a topological level are explained in
Section 2.4. Finally, the image classification methodology is given in
Section 2.5.
2.1. Data Acquisition
Our proposed predictor directly uses the data collected from the experiments. The data acquisition process involves measuring the response of human behavior when an excitation is applied to the seat.
Figure 1 shows the location of the sensors in the experiments.
The excitation signal is an angular acceleration imposed on the seat of the user. This acceleration is an oscillating chirp function with a frequency range of 1 to 7.5 Hz on the X axis in rotation. The linear acceleration
and angular velocity
were measured in both the head and the seat by two IMU (Shimmer inertia measurement unit (IMU) sensors) at 256 Hz. By observing the floor excitation signals, we noted that the excitation is purely rotational around the X-axis—see
Figure 2.
Several experiences were conducted by nine people by taking into account a set of six fixed states: driver, passenger, tense person, relaxed person, rigid seat, and SAV (sport activity vehicle seat). In particular, for each individual, eight experiments for the six available states were performed:
As a consequence, we worked with a sample of 72 experiences, each of them encoded in a time series (as we explain later). Our goal is to classify the behavior of a generic driver, assigning one of the two states (tense or relaxed) by using the sensor data.
2.2. Time Series Description
The data acquired from sensors (see
Figure 3 and
Figure 4) were stored into six-dimensional time series, for both linear acceleration and angular velocity of the head movement. The sampling frequency of the data was 256 Hz, and the duration of the experiment was 34 s; hence, the resulting data dimensionality is
. For each times series, where
, we constructed three new times series called the sliding window, embedding a length of 5800. The first one is given by the times values from
to
, the second is given by the times values from
to
, and, to conclude, the third time window is defined as from
to
. Each element in the sample
was encoded by means of three six-dimensional time series representing each of the three sliding windows that we represent in matrix form as follows:
and
Here, the matrices have a size of
and
. This allows us to represent the information by using a third-order tensor, namely,
defined by
for
,
and
. We can identify
for
.
2.3. Data Preprocessing
In order to obtain a single series for each observation, we concatenated all of the 6 time series (linear accelerations and angular velocities) for each observation horizontally and then created a data frame by stacking the 216 in sample observations.
The concatenation operation on the multidimensional time series collapsed the last two dimensions into one dimensional arrays with a length of
. The result is the two-dimensional table of concatenated time series
We chose not to filter the signals because the topological sub-level set method should filter the high-frequency features naturally. We also chose to keep working on acceleration signals in order to avoid signal deviations after two integrations in time so as to obtain positions, the sensors not always keeping a zero mean height. Thus, the approach is completely (topologically) data-based.
The six time series
of each observation were collapsed into a single concatenated time series with a size of 34,800—see
Figure 5. The concatenated time series for the 216 observations were then stacked to create the dataset
D with a size of
34,800. We also used binary labels in the chained time series
on the two target classes that we were interested in. In particular, we wrote
where
is "0" for a relaxed driver and “1” for a tense one.
2.4. Extracting Topological Features from a Time Series
The idea to extract the topological information regarding the times series is to consider each sample observation as a piecewise linear continuous map from a closed interval to the real line. Therefore, we used a construction closely related to the Reeb graph [
11] used in Morse theory to describe the times series at the topological level.
To this end, we consider the time series
for
given by a vector
we can view
as a function also denoted by
defined by
for
. Here, to study the topological features of
we use the sub-level set of a piecewise-linear function
associated with
satisfying that
for
.
To construct this function, we consider the basis functions
of continuous functions
defined by
where
and
This allows us to construct a piecewise continuous map
by
and also to endow
with a norm given by
In particular, we prove the following result, which helps us to identify the time series given by the vector in with the function in .
Proposition 1. The linear map given by is an injective isometry between Hilbert spaces. Furthermore, is a closed subspace in .
Proof. The map is clearly isometric and injective because is a set of linear independent functions in . □
Here, we describe the maps
at the combinatorial level using the connected components (intervals) associated with its
sub-level sets
for
. For this purpose, we introduce the following distinguished objects related to the
of
:
The nodes or vertices denoted by
that represent the components of the vector
;
The faces denoted by
that represent the intervals used to construct the connected components of the sub-level sets of the map
. Recall that we consider
For each
, we introduce the following symbolic
sub-level set for the map
:
For
, it holds
Our next goal was to quantify the evolution of the above symbolic sub-level with. To this end, we introduce the notion of feature associated with the sub-level set .
We define the set of features for functions in
as
We note that . Then next definition introduces the notion of features for a symbolic sub-level set as the interval of constructed by a maximal union of faces of .
Definition 1. We suggest that is a feature for the symbolic λ sub-level set if there exists such that and for every such that for it holds that . We denote by the set of features for the λ sub-level set .
A feature for a sub-level set is the maximal interval of that we can construct by unions of intervals in . To illustrate this definition, we give the following example:
Example 1. Let us consider the time series This allows us to construct the map as shown in Figure 6. Then, and , and we have the following symbolic λ sub-level sets. This allows us to compute the available features for each λ-value: | | | | | | | | |
| ∅ | | | | | | | |
Let
be the whole set of features for
, that is,
Example 2. From Example 1, we obtain We can represent the map from to as shown in Figure 7. Let
; in order to quantify the persistence of this particular feature for the map
, we use the map
from
to
. To this end, we introduce the following definition: the birth point of the feature
is defined by
and the corresponding death point by
In particular, we note that
(see
Figure 7). Since
holds for all
we call the finite interval
the barcode of the feature .
Example 3. From Example 1 we consider the features , , and . Then, the feature has its birth point at and its death point at ; the feature has its birth point at and its death point at . Finally, the feature has its birth point at and its death point at . As a consequence, the set of features and its corresponding barcodes contain the relevant information of the shape of (see Figure 7). Thus, we define the set of barcodes for
by
and its persistence diagram as
(see
Figure 8). An equivalent representation of the persistence diagram is the life-time diagram for
, which is constructed by means of a bijective transformation
, acting over
, that is,
see
Figure 9.
In order to determine the grade of similarity between two barcodes from two different time series, we need to set a similarity metric. To this end, we construct the persistent image for
as follows: we observe that
is a finite set of points, namely,
for some natural numbers
and such that
. Then, we consider a non-negative weighting function
given by
.
Finally, we fix
M, a natural number, and take a bivariate normal distribution
centered at each point
and with its variance
where
is the
identity matrix. A persistence kernel is then defined by means of a function
, where
We associate with each
a matrix in
as follows: let
be a non-negative real number that is sufficiently small, and then consider a square region
, covering the support of
(up to a certain precision), such that
holds. Next, we consider two equispaced partitions of the intervals
The persistence image of
associated with the partition
is then described by the matrix given by the following equation:
2.5. Classification
Image classification is a procedure that is used to automatically categorize images into classes by assigning to each image a label representative of its class. A supervised classification algorithm requires a training sample for each class, that is, a collection of data points whose class of interest is known. Labels are assigned to each class of interest. The classification problem applied to a new observation is thus based on how close a new point is to each training sample. The Euclidean distance is the most common distance metric used in low-dimensional datasets. The training samples are representative of the known classes of interest to the analyst. In order to classify the persistence diagrams, we can use any state-of-the-art technique. In our case, we considered the random forest classification.
Recall that we conducted 9 different experiments, with 24 samples associated with each one of them corresponding to 3 samples for each of the different experimental conditions: relaxed rigid driver, relaxed rigid passenger, relaxed SAV driver, relaxed SAV passenger, tense rigid driver, tense rigid passenger, tense SAV driver, and tense SAV passenger. Their respective labels are . Therefore, we designed the following training validation process: The model is trained over 144 samples and evaluated over the remaining unseen 72 experiments (two-to-one training-to-testing ratio). The split between training and sampling is achieved using random shuffling and stratification to ensure balance between the classes. In order to improve the evaluation of the model generalizability, we also performed a cross-validation procedure following a leave-one-out strategy, consisting of iteratively training over the full dataset except one sample that was left out and used to test and score the model. We used the accuracy metric to evaluate the classification model. We can represent the performance of the model using the so-called confusion matrix: a 2D entries table where elements account for the number of samples in each category, with the first axis representing the true labels and the second axis the predicted labels. We also computed the different classification metrics to obtain a more detailed reporting of the model performances.