POSSIBILITIES OF USING COMMERCIAL ELECTRONICS TO MEASURE DRIVER PHYSIOLOGICAL FUNCTIONS IN A VEHICLE SIMULATOR

. The aim of this paper is to explore the potential of using inexpensive, commercial electronics such as a smartwatch or chest belt to measure human physiological functions while driving in vehicle simulator, both to improve safety and to use these devices in other experiments to facilitate their conduct and replace more complex laboratory equipment. In the ﬁrst part of the paper, the signs of stress and cognitive load through physiological functions are researched, then the possibilities of measuring these signs are explored. This is followed by an experiment in which two commonly available devices are compared in terms of accuracy and usefulness for measurement during the experiment.


Introduction
For the design of the vehicle, and in particular the interaction of its systems with the driver, it is essential that the systems are properly tested.One of the best tools for this testing is a vehicle simulator, which allows both standard and hazardous situations to be simulated repeatedly in a safe environment and under controlled conditions.
Another important part of the design process is the ability to record objective data from the participants in the experiment.One part of this objective data can be the driver's physiological functions, the evaluation of which can be used to objectively assess their stress and overall workload.
Traditionally, laboratory tools such as ECG or EEG are used for these measurements.Although these instruments are very accurate, they carry several disadvantages.In particular, they are more complex to evaluate and also introduce discomfort and thus noise into the measurement.
The aim of this paper is therefore to explore the possibility of using commercial electronics in the form of a smartwatch or chest strap to measure the heart rate of a participant in an experiment.

EEG
EEG, or electroencephalography, captures the electrical activity of the human brain [1].
To measure EEG, electrodes that sense electrical activity must be placed on the head (surface of the skull) of the person being measured.The number of electrodes varies according to the specific EEG application [2].Yan et al. [3] conducted an experiment in which they compared the accuracy using 16 and 63 electrodes.The results showed that the reduction in accuracy when using only 16 electrodes is small, which can be used in designing further experiments.
Much research has been done on the principles of driver distraction monitoring using EEG.Of these, for example, Lin et al. [4] found experimentally that driver distraction correlates with increased frontal theta and beta wave activity (types of brain activity monitored by EEG).
Zhang et al. conducted research in which they showed that EEG is useful for observing how a driver notices various stimuli (for example, when interacting with assistance systems).They conducted the experiment in both a simulator and a real vehicle and note that the EEG was more prone to inaccuracies in the in-vehicle experiment [5].Kumar et al. in their research used EEG to capture both visual and cognitive distraction.As a result of the measurements, the EEG was highly accurate at measuring both types of distraction [6].
In recent years, there has been an increasing number of studies on this topic focusing on new ways of processing data obtained by EEG, especially using neural networks, for example [7][8][9][10].

ECG
Electrocardiography is another method that measures the electrical signals generated by the human body, in this case the signals produced by the heart.The basic output is activity (electrical signal) over time.This signal can then be used to calculate heart rate, heart rate variability (the evolution of the time differences between successive heartbeats), and possibly even respiratory rate [8].
The basic elements of the ECG curve are the Pwave -a smaller deflection indicating depolarization of the atria, the P-R interval -the time between the first deflection of the P-wave and the first deflection of the QRS complex -this represents depolarization of the ventricles, the time difference between the peaks of the R-waves represents the heart rate.The T-wave represents atrial repolarization [11].
Electrodes are used to capture the ECG signal, as in EEG, and in this case they are placed on the limbs and chest of the subject [12].Medical ECGs use 12 electrodes, while other devices (such as smartwatches) make contact with the skin differently.In the case of smartwatches, this is a single-lead ECG (e.g.conducted through a circuit connection between the back of the watch, the body of the person wearing the watch and a finger placed on another part of the watch) [13].ECG is more suitable for measuring driver stress, as shown for example by Keshan et al. [14] when they used ECG data to classify three levels of stress with a success rate of 88.24 %, detecting high levels of stress with a success rate of 100 % (naive Bayes classifier with the difference in mean heart rate as a feature) or 98 % (decision tree and eight different features).
Pourmohammadi and Maleki [15] in their research compared EMG (electrical muscle activity) and ECG in stress detection.Again, using ECG, they were able to detect different levels of stress with high accuracy (greater than 95 %).
It can be seen that when using ECG, the heart rate is used as one of the signs for measurement.Heart rate variability is also used quite often.Therefore, if there were a way to measure these variables without ECG (for example, the aforementioned smart watches), this would lead to a simplification of the experimental process.

GSR
The principle of the GSR measurement is to apply a weak and constant (undetectable to humans) voltage to the skin and to observe how the skin conductivity changes depending on the stimuli (changes due to perspiration).
Sikder et al. [16] used GSR measurements to determine the cognitive load of students taking an online exam.There was an attempt to asses stress based on the GSR time domain during thirteen different tasks with three different levels of stress.
In a research focusing on comparing cognitive load measurement options, Tervonen et al. [17] describe the capabilities of different wearable sensors and the processing of data from them using different lengths of data.Among other things, they conclude that cognitive load can be detected from GSR but more slowly than from ECG.
Borisov et al. [18] used GRS as one component to monitor cognitive load using human physiological manifestations.
A combination of the use of GSR and EEG was proposed by Manikandan et al. [19].They proposed a system that monitors driver distraction based on these two variables.The measured signal is processed and divided into time and frequency domain.According to the authors, the proposed system is capable of accurately measuring fatigue and auditory and visual distraction.
The research shows that from the physiological signals it is possible to monitor distraction (EEG) as well as stress and cognitive load (ECG, GSR).The next section will focus on identifying the possibilities of commercial sensors (smart watches and similar devices) whose application would facilitate the measurement process.
Advances in wearable electronics (miniaturization of the necessary electronics to enable wearable computing) could allow for easier measurement within an experiment, mainly due to ease of use [20].Today, these electronics are capable of recording user data in real time.The most important part of this sector today is mainly smartwatches [21].
Another advantage of smartwatches would be within the measurement of cognitive load, where they would not add additional problems to the participant of the experiment, such as ECG electrodes [21].

Material and methods
This part of the papes describes the experiment that was carried out to identify capabilities of commerical sensors.

Used sensors
Several devices were used for the measurements.It was a vehicle simulator used for simulating driving in a Superb III equipped with automatic transmission.The scene used was a combination of an intramural and extramural road, with a maximum speed of 90 km.h −1 .Next was an ECG sensor -VLV-Scope device (Faculty of biomedical engineering, CTU in Prague).A two-lead ECG sensor was used as a reference for the measurements.The electrodes were placed in the subclavian wells.Next was Wahoo TickrX chest belt.This was the first sensor used for comparison, it works on the principle of electrodes with contact in the lower chest area, so it is a simple ECG.The second sensor compared was a sports watch with a pulse oximeter function.The sensor is in the form of an elastic sleeve on the thumb.

Pilot measurement
The aim of the pilot measurements was to see if it was possible to measure the selected devices at all.For this purpose, a run with four probands was carried out and the data from these runs were subsequently processed.Two methods were proposed for evaluation, these were compared in the pilot measurement and one of them was selected.Time synchronization was achieved by simultaneous starting and stopping the measuring devices.

EG probe
The output of the ECG probe is a text file (see Figure 1) that can be processed in software such as MS Office Excel or Matlab.The output is from a program that allows you to measure several variables at once (in addition to the ECG, skin resistance or muscle activity, for example).Since the sensors required for this scan were not active during the experiment, other items are unusable except for the time trace and the ECG recording.

Chest strap
Unlike the ECG probe, the output of the chest strip measurement is just a file containing a time trace and an instantaneous heart rate reading (see Table 1

Pulse oximeter
The output of a pulse oximeter is similar to that of a chest belt ( Again, this is a text file that contains the instantaneous heart rate data, labeled with a serial number.As this is an oximeter, the data also includes a record of blood oxygen saturation.
The first problem that had to be solved was the processing of the ECG data.From the ECG recording, the instantaneous heart rate can be calculated using Equation 1.
Where the R−R term represents the time difference of two consecutive R peaks.Since the frame rate of the ECG probe is 1 kHz, one recording represents 1 ms.
To calculate the time difference between the peaks, it was necessary to localize the peaks in the signal.For this, the findpeaks function included in Matlab was used.
A plot of the raw data is in Figure 3 (x-axis is time, y-axis is ECG signal strength).
After application of findpeaks some parts of the ECG curve were wrongly labelled as peaks.This shortcoming was corrected by applying the minpeakprominence and minpeakdistance function parameters.The first of these arguments modifies the minimum difference that must exist between points for a peak to be identified, and the second argument modifies the minimum distance at which peaks are identified.The value of the first argument was experimentally set to 15000.The value of the second argument was easier to find because it had to roughly correspond to the time between heartbeats.It was set to 400.
The result is the identification of peaks on the ECG curve, without false positives and without missing them.The details of the curve are shown in the Figure 2 through Figure 4.
After finding a procedure to correctly identify the peaks, it was possible to calculate the instantaneous heart rate from the ECG using the aforementioned equation.The result is in the Figure 4.For comparison, data had to be resampled to the lowest common sampling frequency.
Comparison of all three devices is in Figure 5.
Based on this data, a method could be selected to compare the different devices.Two methods were considered.The first method consisted of summing      the absolute distances of the measured heart rate of the device under consideration from the reference (i.e., the ECG), according to Equation 2.
The results of this method for the 4 pilot measurements are shown in the Table 3.
This method takes into account the entire measurement process, the closer the sensor is to the standard, the lower the values become.The disadvantage is the poor comparability between different measurements, mainly because the value will be higher the longer the measurement itself.The results are also not very intuitive to look at.The advantage is then taking into account the magnitude of the error with which the sensor is measuring.
The second proposed method involves calculating what percentage of the measured values are from a certain distance from the standard.In Matlab, the calculation was implemented as follows: for i=1:length(ID) if ID(i,2)>((ID(i,1)*0.9)) && ID(i,2)<((ID(i,1)*1.1)) ID(i,8)=1; else ID(i,8)=0; end end KPI_10_Pas=(sum(ID (:,8))/length(ID))*100 The values 0.9 and 1.1 represent the distance from the standard, in this case 10 %, at which the sensor must be located.The method was tested for two different distances, 10 % and 15 %.The value of 10 % was chosen based on the "American National Standard of Cardiac monitors, heart rate meters, and alarms" and the value of 15 % was chosen as an additional value [22].
If the checked value of the instantaneous heart rate was within the permissible distance, it was marked as 1, otherwise as 0. After checking the entire record, the data vector was summed and the proportion of records that were sufficiently accurate was calculated.The proportion is expressed as a percentage.
The results for all four measurements are shown in the Table 4.

Chest strap
Pulse oximeter It is clear from the table that the assessed devices are accurate enough to be assessed for distances from the reference signal (0.9−EKG_reference, 1.1−EKG_reference) (the intervals are open).
Comparing the two methods, it is clear that although the second method does not reflect the magnitude of the error (it does not distinguish whether the sensor is off by 1 or 50 beats), it is significantly easier to interpret.Moreover, the two methods are consistent in their results.Therefore, the method based on the distance from the reference signal was chosen for further processing.

Results
For the final comparison, a total of 20 runs were measured using 10 probands, with each proband completing 2 runs.Both genders and all somatotypes were represented in the measurements.Measurements were processed using the procedures described above.The results are presented in the Table 5.
The interpretation of the results is complicated by the fact that the chest belt, although more accurate (the highest accuracy of all measurements was achieved by the belt -89.04 %), suffered from signal dropouts, which are marked in red in the table.
The most accurate result of the pulse oximeter was an accuracy of 82.47 %.Interestingly, when comparing measurements in which the chest belt did not expe-rience signal dropouts, the average values for both sensors are similar.
For illustration, the best results of both sensors are presented in Figures 6 and 7 and their strengths and weaknesses are described on the measurements.
Figure 6 shows the aforementioned best measurement using a chest strap.However, it can also be seen here that the belt is slower than the reference ECG in responding to changes in heart rate, and some sharp fluctuations are not detected at all.In this measurement, the pulse oximeter readings were very poor, but this was not due to failure.
Figure 7 shows the best pulse oximeter measurement.It can be seen that although the pulse dynamics are less well tracked by the oximeter than by the chest belt, the tracking of the overall trend is quite good.

Conclusion and future work
In this article, two commonly available sensorsa chest belt and a pulse oximeter in the form of a watch -have been selected for a comparison of usage of common commercial sensors for monitoring driver during a test in a vehicle simulator.Using pilot measurements, a suitable methodology was designed and selected to evaluate their accuracy against a reference signal in the form of a two-lead ECG.
From the measurements it is clear that while both devices are capable of accurate enough measurement  to be used during experiments, the chest strap is capable of the more accurate measurement.This is to be expected as the technology used by its sensors is more accurate than the photoplethysmography on which the pulse oximeter is based.Slower reactions of the oximeter show that it is more suited for long term measurement, while better dynamics of the chest strap make it useful for measuring driver during stressful events.
However, the ergonomics of the measurement complicate the choice of a suitable device.For the participant in the experiment, it is obviously better if he or she just puts on a smartwatch instead of a chest strap.However, both options are an improvement against ECG electrodes.
Further research in this direction should focus on collecting a larger sample of data using the described ones, on which the results of the measurement could be statistically verified.Another weakness of the experiment was imperfect way of synchronizing the measuring devices.Although it was sufficient for a proof of concept such as this, subsequent experiment should use more precise method.Another part of the experiment that should be perfected in subsequent iterations is the problem of sampling.Each device had a different sampling rate and even though it was again deemed sufficient for this experiment, devices with higher and more similar sampling rate should be chosen next time.
It must also be kept in mind that the commercial electron field is rapidly evolving, testing should be repeated periodically using newer equipment but the same (but updated) methodology.

Figure 1 .
Figure 1.Output of the ECG probe.

Figure 5 .
Figure 5. Results of the pilot measurement.

Table 3 .
Absolute distances of the assessed devices from the ECG.

Table 4 .
Comparison of two parameters for evaluating sensor accuracy.