# Feature Extraction and Evaluation for Driver Drowsiness Detection Based on Thermoregulation
## 2 Materials and Methods
### Data Analysis and Classification  
The first step in analyzing the data was looking for significant changes of T\({}_{\text{nose}}\), T\({}_{\text{wrist}}\), and HR for drowsy and non-drowsy subjects. The average trend over time was calculated for each variable as well as the distribution for each window. In addition, a [PERSON]'s ANOVA test was performed to check whether the data of the 9 windows were significantly different in their mean. The significance level (\(\alpha\)) was set to 5%, meaning that a p-value smaller than 0.05 indicated a significant difference. The [PERSON]'s test was chosen because it does not assume an equal variance in both distributions. Secondly, in our attempt to distinguish between drowsy and non-drowsy subjects, we applied a decision tree approach based on changes in skin temperature and heart rate. This methodology aims to start from biological knowledge for building our classifier, which is in contrast to traditional data-based approaches. The latter type of methods focused mainly on accuracy or performance but did not lead to physiological insights per se. In essence, this approach was inspired by the methodology described in patent EP 2 842 490 B1 published in 2016 [28] as well as the observed trends in the data. More specifically for the skin temperatures, we expected an initial increase to facilitate heat loss for lowering the core body temperature (T\({}_{\text{C}}\)). Afterwards, a gradual decrease in skin temperature was anticipated. On the other hand, a decrease in the heart rate was expected because energy and heat production in the body was supposed to go down. Based on this background, 3 univariate classifiers were built, which made their decisions based on the increases and decreases in the data. Hence, the classifications were performed based on T\({}_{\text{nose}}\), T\({}_{\text{wrist}}\), and HR. For the classification based on one of the temperature variables, a decision tree with 2 nodes was designed. The first nodes check whether an initial increase in the temperature occurred by evaluating the slope in the selected initial window (number 1, 2 or 3). Subsequently, the second node evaluated whether there was a decrease in temperature by looking at the slope in windows 4 to 9. Accordingly, the thresholds for both decision nodes were set to zero. Positive values for the slope corresponded to an increase in temperature and negative values to a decrease. On the other hand, for classification based on the heart rate, a decision tree with only one node assessed if HR was significantly decreasing over time. Figure 3 shows a schematic overview of both structures for the decision tree. For the decision tree based on the temperature variables, every combination of each 2 windows was tested. For the decision tree based on HR, all windows were tested separately. Information extracted from specific windows was used for classification to indicate the position of the most valuable information present in the data. The choice for a (combination of) window(s) was based on the performance of the corresponding decision tree. For this purpose, the sensitivity, specificity, and accuracy for each combination were determined. Here a \"positive\" test referred to a participant being labeled as \"drowsy\" by the classification algorithm. The windows that were used in the decision tree with the highest accuracy were selected in the end. The receiver operating characteristic (ROC) curves and corresponding area under the curve (AUC) values were calculated as well by changing the threshold from zero. The advantage of this method is that the results allow for a meaningful interpretation since the approach is based on physiological knowledge. Figure 2: Visualization of pre-processing the data by subdividing each measurement into 9 windows. The black and grey dotted lines represent two fictional measurements for a certain variable x. Although the sampling frequency is the same for both measurements, the number of data points (i.e., length of the measurement) is not fixed.