Classification of Mental Stress Levels by Analyzing fNIRS Signal Using Linear and Non-linear Features

Background: Mental stress is known as one of the main influential factors in development of different diseases including heart attack and stroke. Thus, quantification of stress level can be very important in preventing many diseases and in human health. Methods: The prefrontal cortex is involved in body regulation in response to stress. In this research, functional near infrared spectroscopy (fNIRS) signals were recorded from FP2 position in the international electroencephalographic 10–20 system during a stressful mental arithmetic task to be calculated within a limited period of time. After extracting the brain’s hemodynamic response from fNIRS signal, different linear and nonlinear features were extracted from the signal which are then used for stress levels classification both individually and in combination. Results: In this study, the maximum accuracy of 88.72% was achieved in classification between high and low stress levels, and 96.92% was obtained for the stress and rest states. Conclusion: Our results showed that using the proposed linear and nonlinear features it is possible to effectively classify stress levels from fNIRS signals recorded from only one site in the prefrontal cortex. Comparing to other methods, it is shown that the proposed algorithm outperforms other previously reported methods using the nonlinear features extracted from the fNIRS signal. These results clearly show the potential of fNIRS signal as a useful tool for early diagnosis and quantify stress.


Introduction
Today, almost all humans are familiar with the term "stress", as it has become an inseparable part of human life.Stress refers to conditions or emotions in which the person perceptually believes that the sum of wants and expectations of them is beyond the facilities, resources, and abilities at their disposal.Hans Selye, the father of stress, defines stress as the body's or mind's nonspecific response to any need to change. 1 Stress is controlled in the human body through activation of hypothalamic-pituitary-adrenal axis and limbic system, which cause secretion of stress hormones (adrenaline and cortisol) in the bloodstream.Circulation of this hormone in the body via the bloodstream causes different physiological changes.Heart rate increases compared with the normal state, thus more blood is pumped towards the muscles and other organs.Blood pressure rises and the respiration rate increases.The small air tubules in the lungs dilate, causing the lungs to pull in more oxygen to the body by each respiration.The heightened oxygen that enters the brain causes increased level of consciousness.Also, adrenaline hormone causes release of glucose and fat of its temporary stored regions in the body such as the liver into the bloodstream.This provides all parts of the body with the required energy, preparing the body to react to stress.The limbic system which includes hippocampus, amygdala, and several other regions including basal ganglia, the prefrontal cortex which lies near this system and has an effective communication with it.Each part of the limbic system plays a special role in controlling the HPA axis function.The prefrontal cortex is involved in regulating the body during stress.Studies indicate that the role of the prefrontal cortex of the brain is remarkably complex.For example, the great damages limited to the right prefrontal cortex causes diminished cortisol responses to the stress, while the left-side damages have no effect on its secretion.Various studies have also shown that there is a direct relationship between the activity of the right prefrontal cortex and stress. 2,3tress affects the human health.5][6] Animal and human studies have indicated the harmful effects of glucocorticoids (cortisol and corticosterone are the most important glucocorticoids in the body of humans and many animals) on PFC functions. 7hey have identified it as region in the brain, which has an active reaction against stress.2][13][14] Accordingly, if one can inform a person about development of stress state in them, through training stress-reduction techniques, it is possible to prevent its damaging effects on health.
The level of stress is clinically measured by questionnaires and interviews, though it is absolutely dependent on the person. 15On the other hand, physical and physiological changes associated with stress are also used as the objective indicators of stress.For example, physically stress causes pupil dilation, blink rate, and facial gestures. 16,17][21] In measuring the level of stress using physical indicators or indicators related to the autonomic nervous system, typically to enhance the accuracy and efficiency, several indicators are used concurrently, causing increase in mobility constraints and complexity of the equipment.
The human brain plays a major role in stress response and thus by processing its recorded data, one can discuss the level of stress. 224][25][26] However, considering the type of equipment for recording it, this method has some limitation in the real world since the person cannot perform their daily activities freely.
Functional near infrared spectroscopy (fNIRS) is a relatively new noninvasive neuroimaging technique to detect hemodynamic changes in the brain cortex.Today, this technique has attracted a great deal of attention thanks to its various advantages compared to other techniques (e.g.][29] fNIRS is based on the fact that activation of a certain part of the brain results an increase in oxygen consumption in that region, which is accompanied by enhanced total blood flow, regional blood volume, and regional blood oxygenation. 30,31This leads to a change in the concentration of the local oxygenated haemoglobin (oxy-Hb) and deoxygenated haemoglobin (deoxy-Hb). 32nce oxy-Hb and deoxy-Hb have special optical properties in the near-infrared light range (700-900 nm), the changes in the concentration of these chromophores during neurovascular coupling can be detected using fNIRS technique noninvasively.Choosing appropriate wavelengths with regards the absorption coefficients of oxy-Hb and deoxy-Hb, it is possible to calculate variations in the concentrations of these chromophores using a modified Beer-Lambert law (MBLL). 33,34n this research, fNIRS signals recorded from the prefrontal cortex of the brain are used for stress level quantification.Considering the special features of fNIRS system and recording signals from the prefrontal cortex of the brain, use of this technique to measure stress in the real world becomes possible to a good extent.In different studies in which fNIRS has been used, typically linear analysis of this signal has been employed.In this research, nonlinear analysis of fNIRS signal has also been performed and its effect on classification of stress levels has been examined.Our goal in this research is to utilize fNIRS signal to classify stress levels and employ nonlinear analysis of the signal, which causes its enhanced efficiency, which have not been dealt with in previous research.Furthermore, given the features of fNIRS system, quantifying the level of stress without making many limitations in the real world becomes possible.
In the rest of this paper, first, the information related to the participants in the task, the designed stress task, and fNIRS signal recording are described.After that, signal preprocessing to extract the brain hemodynamic response, the extracted features, the manner of selecting the optimal feature subsets, and data classification are provided.Finally, the obtained results are discussed.

Participants
In this research, 50 healthy male volunteers participated (mean age = 22.6 ± 3.21 years old).None of them had special physical or psychological diseases including neurological diseases or respiratory or cardiovascular diseases.They neither used medications that affect the brain.All of the volunteers before the task stated their consent in a written form.Before performing the task, the level of stress was examined using STAI questionnaire, to ensure that the person had a normal level of stress.

The Stress Task and Procedure
The stress task designed in this research is based on the Montreal Imaging Stress Task (MIST). 22In this task, the subjects sit on a chair in front of a monitor and respond to the mathematical statements appearing on the monitor, which include sum and subtraction of several singledigit numbers within a limited period of time (e.g., 4+8-6+3-7+5).The result is a single-digit number, and they select the correct response through clicking by a mouse.The graphic representation of the task, which has been Mental Stress Levels by Analyzing fNIRS Signal journals.sbmu.ac.ir/Neuroscience http designed using Visual Basic software, is as Figure 1.In Part (A), the mathematical statements to which the subject should respond are presented.In Part (B), 0-9 numbers exist, which should be selected by the volunteer through clicking on the intended number.In Part (C), the result of the subject response appears as "correct", "wrong", and "time over".In Part (D), the time considered for response to each statement is shown as a graphical incremental bar.This task has three different phases: training, rest, and stress.The explanation of each phase is as follows: Training phase: in this phase, the subjects respond to 10 mathematical statements without any time limitation, and the response time to each individual statement will be recorded by software.This phase has 2 main objectives: (1) familiarizing the subject with the graphical user interface of the task and its procedure, (2) calculating the average time required by the subject to respond, in order to further apply time limitation in the stress phase.
Stress phase: in this task, 2 different levels of stress, low and high, are induced in the subject.Here, the subjects respond to the mathematical statements with the time limitation applied.For the low and high stress levels, this time limitation is 90% and 80% respectively of the time averaged in the training phase.The time limitation is shown to the subject through filling a graphical incremental bar and playing a tic-tic sound through headphone, whose frequency grows over time.The result of response to each statement is demonstrated to the subject in a written form.
Rest phase: before performing each of the stress phase stages, the subjects undergoes rest state for 1 minute, such that they are requested to sit comfortably on a chair in a quiet room, to whom a relaxing music is played through the headphone on their ears.Figure 2 reveals the block diagram of different stages of the task.

Data Acquisition
During the stress task, fNIRS signal has been recorded using the fNIRS system designed and developed in the NIR Laboratory of the School of Electrical and Computer Engineering, within the University of Tehran. 35This system operates with 2 wavelengths of 730 and 850 nm, with a sampling frequency of 3.8 Hz.In this research, a detector has been placed 1.5 cm (near channel) away from the light source and the other detector is placed 3 cm (far channel) away from the light source.The system electrodes were put on the forehead at FP2 position in the international electroencephalographic 10-20 system (Figure 3).

Pre-processing
In the fNIRS signals obtained at the wavelengths of 730 and 850 nm, trend removal from the signal was performed by calculating the output of a moving averaging filter in 120-s windows before and after a temporal sample and subtracting the filter output from the initial signals.
Thereafter, the OXY-Hb and Deoxy-Hb signals was extracted by applying modified Beer-Lambert Law.The high-frequency noises in the signal are removed from the OXY-Hb and Deoxy-Hb signals using a 6th order Butterworth low-pass filter with cutoff frequency of 0.9 Hz.Mmotion artifact present in the signals, which develops due to head movements and displacement of electrodes, is removed using wavelet-based method proposed by Molavi and Dumont. 36ne of the main problems of fNIRS signal is extraction of hemodynamic response associated with brain activity from this signal.This is because the frequency of variations related to the effect of respiratory system and Mayer wave interferes with the frequency of variations related to the brain activity.In this research, to remove the physiological interferences from fNIRS signal, a new method which we presented it in the previous research has been used. 37In this method, using simultaneous recording of the near and far channels, hemodynamic changes related to the brain activity are extracted.Figure 4 demonstrates a sample of preprocessed oxy-Hb and deoxy-Hb signal, recorded in the stress task process.

Feature Extraction
The features that are extracted from fNIRS signal are typically the linear features in the time domain including mean, variance, kurtosis, and skewness.In this research,   the low and high stress levels, this time limitation is 90% and 80% respectively of the time averaged in the training phase.The time limitation is shown to the subject through filling a graphical incremental bar and playing a tic-tic sound through headphone, whose frequency grows over time.The result of response to each statement is demonstrated to the subject in a written form.
Rest phase: before performing each of the stress phase stages, the subjects undergoes rest state for 1 min, such that they are requested to sit comfortably on a chair in a quiet room, to whom a relaxing music is played through the headphone on their ears.

Data Acquisition
During the stress task, fNIRS signal has been recorded using the fNIRS system designed and developed in the NIR Laboratory of the School of Electrical and Computer Engineering, within the University of Tehran. 35This system operates with 2 wavelengths of 730 and 850 nm, with a sampling frequency of 3.8 Hz.In this research, a detector has been placed 1.5 cm (near channel) away from the light source and the other detector is placed 3 cm (far channel) away from the light source.The system electrodes were put on the forehead at FP2 position in the international electroencephalographic 10-20 system (Figure 3).journals.sbmu.ac.ir/Neuroscience http in addition to the linear features, nonlinear features including approximate entropy, 38 fractal dimension, 39 detrended fluctuation analysis, 40 and recurrence quantitative analysis (recurrence rate, determinism index, entropy index, laminarity) 41 which are rarely observed in other studies, have also been extracted.As in previous research it has been shown that the effect of hemodynamic changes of the brain is more evident in OXY-Hb signal, here the expressed features have been extracted only from OXY-Hb signal.
In this research, overall 50 signals have been recorded from 50 subjects.After classifying and labeling each signal, the mentioned linear and nonlinear features have been extracted from the parts related to low and high stress as well as rest and baseline states of each signal.Thereafter, in order to make the features independent of each individual, each feature extracted in the rest and stress stages has been divided by the value of that feature obtained from the baseline state.
The Method for Selecting the Optimal Feature Subset and Classification Selecting the optimal feature subset out of all features causes reduced error of the results of data classification.In this research, to find the optimal feature subset, mutual information method has been used. 42n this method, the features are ranked based on the extent of dependence on the output class.Therefore, our goal in selecting the optimal feature subset is to find the first n features in the ranking, helping in acquisition of the best classification results.For data classification, considering the limited number of data, LOO method and SVM classifier have been used.Figure 5 demonstrates the block diagram of the method for selection of the optimal feature subset and classification.In this method, all data is divided into 3 categories of training, selection and test data.In this classification, one data is eliminated as the test data (according to LOO method).Out of the remaining data, 80% are considered as training and 20% are regarded as selection data.Thereafter, the following stages are performed:  In this method, the features are ranked based on the extent of dependence on the o class.Therefore, our goal in selecting the optimal feature subset is to find the first n featu the ranking, helping in acquisition of the best classification results.For data classification, 1.The features are ranked based on MI method using the training data.2. The classifier is trained based on the first n features of ranking nv (with n varying between 1 and the total number of features).Indeed, at this stage, n trained classifiers are obtained.3. Using the classifiers developed in stage 2, the selection data are classified based on the number of different features.4. According to LOO method, stages 1-3 are performed for all data.Thereafter, the obtained results are average based on the number of different features, and the first n features in the ranking, where the result of selection data classification has been maximized in terms of them, are selected as the optimal feature subset.5.After specifying the optimal feature subset in the stage 4, the test data are classified.

Results
The aim of this research is to classification between stress and rest state as well as between different levels of stress using fNIRS signal and investigate the effect of nonlinear features in this regard.For this purpose, first classification was performed based on the linear and nonlinear features Mental Stress Levels by Analyzing fNIRS Signal journals.sbmu.ac.ir/Neuroscience http separately, and then according to their combination in terms of different signal lengths.Next, the obtained results were compared with each other in order to determine the effect of nonlinear features as well as the minimum signal length, per which the best result is obtained in the classification.
In order to differentiate between the rest and stress states, all stress levels were considered as active state, while the rest states were regarded as inactive state.The features were extracted from active and inactive signals at the signal lengths of 5, 15, 25, and 35 seconds after initiation of each stage, in order to obtain the most suitable signal length for classification of these 2 states.Table 1 shows the result of the classification of rest (inactive) and stress (active) states.In this table, the results of the classification have been presented based on linear and nonlinear features separately as well as in combination.The maximum classification accuracy has been obtained as 95.34%, 74.66%, and 96.92% within the signal length of 15 seconds for linear and nonlinear features and their combination, respectively.The results of this table show that as the signal length exceeded 15 seconds, the classification accuracy has declined.The results of Table 1 clearly reveal that in separation of the active and inactive states, linear features can far better detect this differentiation than nonlinear features, such that the combination of linear and nonlinear features have not been able to improve the results significantly.The optimal feature subset, based on which the maximum classification accuracy was obtained in differentiating between stress and rest states (in terms of combination of linear and nonlinear features), their rank in the ranking involves mean, slow, skewness, and approximate entropy, respectively.The optimal feature subset also confirms the fact that in differentiating between active and inactive states, linear features are more influential.This is because out of the four selected features, first three features in the ranking are linear features, with only the fourth being nonlinear.Nevertheless, considering the difference in the apparent form of the signal in the active and inactive states, it is not unexpected, as the signals in these 2 states have significant differences in terms of slope and mean.Therefore, our method has functioned properly in selecting the optimal feature subset, which has chosen the mean and slope features in the first ranks.
Usage of fNIRS signal alone to detect stress such that was results can be used for being compared with this study was not found in other investigations.Al-Shargie et al 43,44 employed simultaneous recording of fNIRS and EEG signals to detect stress.Their maximum accuracy in differentiating between rest and stress states using EEG and fNIRS signals has been 91.7% and 84.15%, respectively, and using the combination of the 2 signals, it has increased to 95.1%.Considering the limitation in use of fNIRS signal in the previous researcher, for better comparison, we have used studies in which EEG signal has been used for stress detection.Jun et al 45 and Smitha et al 25 using EEG signal, which has been recorded as 14 channels, the classification accuracy of the inactive state (rest) and active state (stress) has been 96 and 85.17%, respectively.In this research, only using fNIRS signal, the results obtained from the active and inactive states classification are more superior than the findings in other research.
Table 2 indicates the results obtained from classification of high and low stress levels.As the results in the table show, the maximum classification accuracy per linear, nonlinear, and combined features within the signal length of 35 seconds is 79.11%, 83.48%, and 88%, respectively.According to the results in the table, the maximum classification accuracy of different stress levels has been obtained through combining the linear in nonlinear features.The optimal feature subset on which this result is derived include of approximate entropy, kurtosis, fractal dimension, mean, detrended fluctuation analysis, recurrence rate, and the entropy related to recurrence quantitative analysis.The results of this table indicate that the results obtained from linear and nonlinear features separately do not have a considerable superiority to each other.However, their combination has presented a significant improvement in the results for classification between low and high stress levels.
Jun et al 45 induced high and low stress levels in the volunteers using mathematical and stroop task.During the task, EEG signals were recorded as 14 channels, and based on the features extracted from the recorded signals, the best result in classification between low and high stress levels has been 75%.Hou et al 46 acted in the same way as Jun et al 45 in terms of signal recording and the stress task and the best result in classifying high and low stress levels  47 the stress task has been based on driving in the real world, which induces stress at high and low levels.In that research, ECG, EMG, GSR, and respiration signals were recorded during the task.Based on the features extracted from the signals and their combination, an accuracy of 97% was achieved in classifying high and low stress levels.Although this result has been remarkable, the notable point is that in that research several different signals have been used simultaneously, causing extreme mobility constraints for the person, making it impossible to be used in the real world, where the person should perform activities freely and without limitation.

Discussion
In this research, using fNIRS signal alone, high and low stress levels as well as rest states were classified.fNIRS signal was recorded from 50 volunteers during stress task.For nonlinear processing of fNIRS signal, in addition to linear features, the nonlinear features of the signal were also extracted and used in the classification process.Furthermore, the minimum signal length in achieving the maximum classification accuracy was also examined.Based on the results mentioned in the results section, it is observed that in the majority of works performed in this regard, multichannel signal recording or different types of signal recording have been used, which causes limitations for its application in the real world.
In this study, the maximum accuracy of 88.72% was achieved in classification between high and low stress levels, and 96.92% was obtained for the stress and rest states.By comparing the results obtained in this research with other similar studies, it can be stated that here only by recording fNIRS signal from a specific site in the brain prefrontal cortex as near and far channels, we have been able to achieve better results compared to other similar investigations.These results clearly indicate the potential of fNIRS signal as a useful tool for early diagnosis of stress in the human in the real world.

Figure 1 .
Figure 1.The Graphical Representation of the Stress Task.

Figure 2 .
Figure 2. The block diagram reveals the different stages of the task.

Figure 3 .
Figure 3.The schema of the location of the source (red) and optical detectors (blue) given the position of FP2 in recording EEG signals given international 10-20 system (yellow).

Figure 2 .
Figure 2. the block diagram reveals the different stages of the task.

Figure 4 .
Figure 4.The Signals of Changes in OXY-Hb and Deoxy-Hb Concentrations of the Brain Hemodynamic Response, Recorded Based on the Stress Task.The vertical lines separate different stages of the task.

Figure 5 .
Figure 5.The General Block Diagram of the Stages of Selecting the Optimal Feature Subset and Classification.

Figure 5 .
Figure 5.The general block diagram of the stages of selecting the optimal feature subset and classification

Table 1 .
The Classification Accuracy of the Stress (Active) State Compared to the Rest (Inactive) State

Table 2 .
The Classification Accuracy of High and Low Stress States