P3 (Blankertz et al., 2011). To validate this objective,
dichotomous machine learning was used. If classi-
fication of a specific dataset from one subject yields
low error rates (defined later), the objective of the
odd-ball paradigm is considered to be fulfilled.
The classifier was trained on a randomly selected
data subset. The training subset contained 730 ERP
trials (described in detail in (Va
ˇ
reka et al., 2014a))
with equal numbers of targets and non-targets. The
trained classifier was subsequently applied to the data
of individual subjects.
The Matlab scripts available in (Va
ˇ
reka et al.,
2014b) and using EEGLAB and BCILAB functions
were used for the implementation. Feature extrac-
tion follows the Windowed Means Method proposed
in (Blankertz et al., 2011). This method includes fea-
ture extraction: low pass filtering and spatial filtering,
and machine learning technique based on one of the
deep learning models - stacked autoencoders. Feature
extraction was described in detail in (Va
ˇ
reka et al.,
2014a). Machine learning was designed as follows.
The Matlab implementation of stacked autoen-
coders was used. The parameters (including number
of layers, number of neurons in each layer, etc.) were
empirically optimized. The experimentation started
with two layers, then either new neurons were added
into the layer, or a new layer was added until the per-
formance of the classifier stopped increasing.
Finally, the following procedure was used to train
the network:
1. The first autoencoder with 100 hidden neurons
was trained. The maximum number of training
epochs was limited to 500.
2. The second autoencoder with 75 hidden neurons
was connected with the first autoencoder to form
a 133-100-75-133 neural network, and trained.
The maximum number of training epochs was
limited to 300.
3. The third autoencoder with 60 hidden neurons
was connected with second first autoencoder to
form a 133-100-75-60-133 neural network, and
trained. The maximum number of training epochs
was limited to 200.
4. The fourth autoencoder with 30 hidden neu-
rons was connected with third autoencoder to
form a 133-100-75-60-30-133 neural network,
and trained. The maximum number of training
epochs was limited to 200.
Furthermore, the following parameters were set
for the network globally: L2WeightRegularization
was set to 0.004, SparsityRegularization was set to 4,
and SparsityProportion was set to 0.18.
After the training of each autoencoder, the input
feature vectors were encoded using that autoencoder
to form input vectors of the next autoencoder.
Using the output of the last autoencoder, softmax
supervised classifier was trained with 200 training it-
erations. Finally, the whole pre-trained 133-100-75-
60-30-2 network was fine-tuned using backpropaga-
tion.
The learned model was first verified on other
P300-based data (Va
ˇ
reka et al., 2014a). Then, for
each subject, error rates depicted by red bars were ob-
tained by applying the classifier in the testing mode.
Let us suppose that we have t
p
- number of correctly
classified targets, t
n
- number of correctly classified
non-targets, f
p
- number of misclassified non-targets,
f
n
- number of misclassified targets. The error rate
was calculated according to Equation 1.
ERR =
f p + f n
t p + tn + f p + f n
(1)
As a result, error rates indicate the extent to which
the classifier was unable to separate target and non-
target single trials. The classification results may
slightly differ with each run because of the indeter-
ministic training process.
6 DATA PREPROCESSING
The recorded EEG/ERP data as well as the data ob-
tained from the respiratory sensor were processed us-
ing the following workflow:
• Channel selection: The following channels cap-
turing brain data were selected for the initial pro-
cessing: Fp1, Fp2, F3, F4, C3, C4, P3, P4, O1,
O2, F7, F8, T3, Fz, Cz, and Pz.
• Driving session selection: Data for each driving
session were processed separately.
• Data filtering: IIR Butterworth filter (frequency
range 0,01 Hz - 20 Hz) was applied to the data.
• Data segmentation: The epochs were extracted
from datasets, data corresponding to each target
and non-target stimulus were selected in the time
interval (-100 ms before the stimulus, 1000 ms af-
ter the stimulus) in the area of occurrence of the
target or non-target stimulus.
• Application of the filter for automatic artifacts de-
tection: The segmented data exceeding the range
(-100 microV, 100 microV) were denoted as pos-
sible artifacts and provided for manual inspection.
• Rejection of corrupted data: The data automati-
cally denoted as artifacts were manually inspected
Experimental Design and Collection of Brain and Respiratory Data for Detection of Driver’s Attention
445