• Tidak ada hasil yang ditemukan

Mental Stress Recognition using K-Nearest Neighbor (KNN) Classifier on EEG Signals

N/A
N/A
Protected

Academic year: 2024

Membagikan "Mental Stress Recognition using K-Nearest Neighbor (KNN) Classifier on EEG Signals"

Copied!
4
0
0

Teks penuh

(1)

Mental Stress Recognition using K-Nearest Neighbor (KNN) Classifier on EEG Signals

Tatiur Rahman, Apu Kumer Ghosh, Md. Maruf Hossain Shuvo, Md. Mostafizur Rahman Department of Electronics and Communication Engineering

Khulna University of Engineering and Technology Khulna-9203, Bangladesh

[email protected], [email protected], [email protected],[email protected]

Abstract— Modern life is full of mental stress arises from both the good and bad issues happening to people. Stress increases the risk of health problems including diabetes, heart disease, cancer and mental disorder. Minimization of such problem needs the correct identification of the stress patterns. This paper presents an analysis of the effect of mental workload on the human mental stress through feature selection of Electroencephalogram (EEG) signal and classification to recognize mental stress. Several EEG signals have been collected from persons having different mental workload and have analyzed using spectrum analysis and features extracted using k- Nearest Neighbor (k-NN) classifier.

EEG signals are taken from the commercial EEG machine (BIOPAC MP36) and then analyzed using BIOPAC acqknowledge software and the features are extracted from beta wave using k-NN classifier in MATLAB environment. The mean power of beta band was selected as a feature to classify mental stress by using k-NN classifier. The assimilation of mean power of beta band and k-NN classifier significantly outperforms the basic nearest-neighbor and the other methods proposed in the past for the mentalstress recognition. This method classifies the mental stress with a maximum accuracy of 91.26% which is much better compared to the conventional Fuzzy K- Nearest Neighbor classifier (FKNN) that can provide a maximum accuracy of 81.98%.

Index Terms—mental stress, electroencephalogram, K Nearest Neighbor (KNN), Fuzzy K Nearest Neighbor (FKNN).

I. INTRODUCTION

Human stress is caused by emotional, mental or physical resistance towards new challenges or stressors. Mental stress is the cause of increasing the risk of heart disease and stroke in a variety of ways, such as raising blood pressure and affecting the blood flows. Stress may cause major damage to health, mood, productivity, relationships, and quality of life while exceeding a certain level. So, effective detection of mental stress is crucial to prevent such harmful effects.

The imbalance of sympathetic and parasympathetic level in the human Autonomous Nervous System (ANS) [1] can be categorized into positive stress such as joy and negative stress such as depression. Most human suffers from negative stress which affects their lifestyle making them feel tension, anxious, angry and frustrated [2-3]. The human nervous system is a complex system which comprises of two major divisions:

central and peripheral. The peripheral nervous system includes

the ANS, which has a particular association with negative psychological states such as stress, anxiety, and depression.

Human stress analysis has emphasized on the use of several physiological signals such as Blood Volume Pulse (BVP), Galvanic Skin Response (GSR), and Skin Temperature (ST), as well as clinical uses of EEG [4]. Variations in these signals have been found to be indicators of sympathetic nervous system responses to cognitive stress. Characteristics of EEG signal changes due to human cognitive states after performing some mental tasks in a noisy working environment, high workload, improper sleep and family conflict. Such change in human cognitive state affects human emotion where stress belongs to negative emotion [5].

Many researchers previously had developed different feature extraction and classification methods including different stress inducement methods to relate human physiological signals with stress. Feature extraction is an effective way to offer a reliable classification from EEG signals. FKNN classifier [6] was one of the most widely used human emotion classifier based on Finite Variance Scaling (FVS). But FKNN based extraction of EEG feature for classifying human stress has less accuracy and therefore results false recognition. Discrete Wavelet Transform (DWT) is a popular tool to extract features from EEG signals to classify human emotion [7]. Slope of EEG linear regression has already been proposed as a feature to determine the relaxation level [8].

Spectral Centroids feature extraction technique was widely used in Speech and Audio recognition. But the combination of EEG Asymmetry and Spectral Centroids techniques was used as a feature to detect unique pattern of human stress [9]. None of the researches focused on the variation of mean power of beta band on EEG signals which varies significantly with the variation of mental workload. Also the K-NN classifier was used to detect and classify human personality and characteristics from the EEG pattern when listening to music with much better results [10-11]. KNN provides better results in terms of accuracy and mean square error (MSE). That’s why; we have used K-NN for the feature extraction as it has the potentiality to improve the accuracy and parameter used for feature extraction is mean power of beta band of EEG signal.

Proposed method performs better for human stress recognition with better accuracy compared to the previously used techniques. As a reference of comparison we have presented International Conference on Materials, Electronics & Information Engineering, ICMEIE-2015

05-06 June, 2015, Faculty of Engineering, University of Rajshahi, Bangladesh www.ru.ac.bd/icmeie2015/proceedings/

ISBN 978-984-33-8940--4

(2)

the stress recognition results on the same data set using FKNN techniques.

This paper is organized as follows. In section II materials and methods used for this study are discussed such as data acquisition, analysis and classification. Section III contains the analysis of results obtained and subsequently the issues raised are discussed and conclusions are drawn in section IV.

II. MATERIALS AND METHODS A. EEG Data Acquisition

Variation of EEG signals due to the subjective nature of emotions and cognitive dependence of physiological signals has been investigated for stress recognition. Electric recording from the exposed surface of the brain or from the outer surface of the head demonstrate continuous oscillating electric activity within the brain. Both the intensity and the pattern of this electrical activity are determined by the overall excitation of the brain resulting from the function in the brainstem Reticular Activating System (RAS). Several EEG data have been collected from ten subjects having different mental state from Biomedical Engineering Laboratory, Faculty of Electrical and Electronic Engineering, KUET. EEG signals measured using the bipolar method from a pair of scalp electrodes were recorded using BIOPAC software. The pair of electrodes measures the difference in electrical potential between their two positions above the brain. Another electrode is placed behind the ear or earlobe acting as a point of reference. We moved the hair away from the electrode area as much as possible to ensure the electrode makes contact with the scalp.

For the reliable EEG measurement, subjects were asked to sit in the chair quietly, relax and close their eyes minimizing any movement. The recording period was 3 minutes for closed eye (CE) state and 10 minutes for open eye (OE) state. OE state requires more time since subjects needed to answer IQ test questions while their brain activities were recorded at the same time. For OE state, subjects were asked to answer 20 IQ test questions with maximum time of 10 minutes. The IQ test questions were developed based on analytic reasoning, logical thinking, visual reasoning and some arithmetic calculations that impose mental stress on the subject.

B. EEG Data Analysis

The collected EEG data for five subjects were analyzed and another five subjects were ignored because of the higher degree of noise and artifacts. The artifacts caused by eye movement, eye blink, muscle movement and power line were removed by setting threshold values of 100 µV where any data above the threshold values were rejected. EEG data were filtered into five frequency bands named Delta (1 - 4 Hz), Theta (4 – 8 Hz), Alpha (8 – 13 Hz), Beta (13 – 30 Hz) and Gamma > 35 Hz by the EEG frequency band analysis. Among these signals the beta band shows significant variation with the mental workload than others. That’s why we have chosen the mean power of beta band as a feature for stress state classification. The mean power of EEG signals was calculated by using the EEG frequency analysis and power spectral density calculated by FFT with hamming window. The window size was set to 256 with 50% overlapping and the FFT length was set to 1024.

C. Experimental Flow Chart

The EEG raw data obtained from commercial EEG machine contains noise due to several artifacts are removed by Finite Impulse Response (FIR) low pass filtering. Then different frequency bands are separated using band pass filtering and from the frequency analysis the mean power was calculated for all the frequency bands. Then the selected feature i.e. the mean power of beta band was put into the k-NN (k-Nearest Neighbor) classifier to classify the mental stress.

The classification was performed for different values of k. The experimental flow chart of methods adopted is shown in Fig. 1.

In KNN algorithm, there are two parameters to be varied, distance and k variable.

Fig. 1. Flow chart of mental stress recognition using KNN classifier.

D. k-NN Classification

The KNN uses a distance of features in a data set to determine which data belongs to which group. A group is formed when the distance within the data is close while many groups are formed when the distance within the data is far. In EEG research, KNN is widely used as a classifier to classify the EEG signals. The k-Nearest Neighbor algorithm (k-NN) is a non-parametric method that classifies based on comparing a testing data with a training data. An object is classified by a majority vote of its neighbors, with the object being assigned to the class most common among its k nearest neighbors (k is a positive integer). The value of k varied in order to find the match class between training and testing data. If k equal 1, then the object is simply assigned to the class of nearest neighbor. A commonly used distance metric is Euclidean distance defined as:

i

j i j

i X X X

X

d( , ) ( )2 (1) Where, Xi and Xj represents the training and testing data respectively. In this work, the value of k was chosen to vary

EEG Raw Data Artifacts Removal

Derive EEG Frequency Bands: alpha, beta, gamma, delta and theta

EEG Frequency Analysis

Mean Power of beta band k-NN classification Classification Accuracy International Conference on Materials, Electronics & Information Engineering, ICMEIE-2015

05-06 June, 2015, Faculty of Engineering, University of Rajshahi, Bangladesh www.ru.ac.bd/icmeie2015/proceedings/

ISBN 978-984-33-8940--4

(3)

from 1 to 7. This value of k gives the maximum classification performance among the other values of k. The classification accuracy can be measured as:

(2) The training and testing data were evaluated for 70:30 ratio of the feature.

III. RESULT ANALYSIS AND DISCUSSIONS

EEG measures voltage fluctuations resulting from ionic current flows within the neurons of the brain. Our brain cells communicate via electrical impulses and are active all the time, even when asleep. For EEG signal acquisition, we have plugged the equipment in as follows in Fig. 2. Electrode lead (SS2L)—CH1 positioned electrodes on the scalp. A supine position with the head resting comfortably but tilted to one side is recommended. The best recordings occur when the Subject is relaxed throughout the session.

From the collected EEG raw data EEG power spectrum is obtained by using FFT. For the stress recognition we observed the beta band which has significant amplitude change due to mental stress. Fig. 3. shows the FFT data of beta band for resting state.

From the Fig. 4. representing the FFT of beta band under mental workload, we can see a noticeable change between resting state and mental workload state.

Fig. 2. Pictorial view of EEG data measurement in BME Lab KUET.

Fig. 3. Smoothed FFT data of beta band for resting state.

Fig. 4. Smoothed FFT data of beta band for question answering state.

TABLE I. Analyzed results of EEG signal

State Fmax (Hz) dBV (max)

Resting state (eye closed) 10.4248 -32.6038 Resting state (eye open) 11.5112 -37.4654 Workload (answering questions) 15.4327 -39.1241

In the analyzed data decibel voltage changes according to the mental task performed. Table I shows the analyzed results of EEG signal with maximum dBV parameter to differentiate different state. When subject performs some mental task (IQ test question) experienced mental workload which causes mental stress.

This beta power amplitude is shown in the graph of Fig. 5.

The figure shows two groups of bar one for relaxed condition and another for workload condition. Workload was experienced during answering IQ test questions. When the stress occurred due to the mental workload, the amplitude of beta band increased. After the epoch analysis the power amplitude is averaged for every subject with 50 epochs each subject. The result of the average power amplitude for different subject is shown in Fig. 6. This figure indicates the mental stress for 5 subjects.

In Fig. 6, subject 1 shows a small change in the power level. Another four subjects have shown higher levels of changes due to workload. The next stage is to perform the k- NN classifier for the mental stress classification. The feature used to train the classifier was the mean power of beta band of EEG signal.

Fig. 5. Beta power plot for both relax condition and workload condition.

International Conference on Materials, Electronics & Information Engineering, ICMEIE-2015 05-06 June, 2015, Faculty of Engineering, University of Rajshahi, Bangladesh

www.ru.ac.bd/icmeie2015/proceedings/

ISBN 978-984-33-8940--4

(4)

Fig. 6. Mean power plot for different subject.

In this work we have used the value of k from 1 to 7. In this range the classification accuracy is better than other values of k. Table II shows the classification using FKNN, for each of the five subjects, the results shows that maximum accuracy obtained is 81.98% for k=5.

Table III shows the classification accuracy obtained by the proposed method using the mean value of beta band as a feature and classifying using KNN. From the Table III, the lower value of k indicates a better classification rate. The maximum classification rate of 91.26% is achieved for the value of k are 1 and 2.

The result of the work indicates that the mean power of beta band of EEG signal can be used as a feature to enable k-NN classifier to identify the human stress. The maximum classification accuracy depends on the several settings of the classifier. So, it is necessary to vary the value of k.

TABLE II. FK-NN classification results for k from 1 to7

Value of k

Subject 1 Subject 2 Subject 3 Subject 4 Subject 5

1 76.43% 58.21% 72.69% 79.20% 78.07%

2 62.38% 65.90% 80.34% 77.89% 60.67%

3 69.76% 78.65% 75.31% 63.72% 65.91%

4 67.87% 61.93% 69.12% 78.81% 70.88%

5 77.48% 66.89% 81.62% 73.81% 81.98%

6 62.89% 72.23% 68.17% 75.47% 73.69%

7 70.27% 63.46% 71.83% 73.16% 79.67%

TABLE III. K-NN CLASSIFICATION RESULTS FOR K FROM 1 TO 7 Value

of k

Subject 1 Subject 2 Subject 3 Subject 4 Subject 5

1 88.87% 91.26% 91.26% 91.26% 91.26%

2 87.91% 91.26% 88.26% 91.26% 83.67%

3 75.82% 73.83% 66.78% 61.19% 70.37%

4 75.81% 77.57% 70.37% 65.85% 65.17%

5 59.48% 66.71% 70.06% 64.82% 68.52%

6 63.52% 77.78% 66.04% 75.93% 65.17%

7 65.98% 75.93% 66.71% 59.48% 63.52%

The comparison confirms that using the proposed method human stress can be classified and detected more accurately than the FKNN method.

IV. CONCLUSIONS

An improved approach for human mental stress recognition has been proposed and it is shown that the proposed methods perform much better compared to conventional approaches.

The study indicates that the mean power of beta band of EEG signals is a reliable feature for mental stress recognition. The selected feature is highly reliable and the classifier performs with a higher level of accuracy. So, we think this work will be very useful for mental stress recognition and will help for early detection and minimization of different problems resulting from stress.

REFERENCES

[1] E. Hoffmann, "Brain Training Against Stress: Theory, Methods and Results from an Outcome Study," Stress Report, ver. 4.2, 2005.

[2] J.A. Healey and R.W. Picard, "Detecting Stress During Real- World Driving Tasks Using Physiological Sensors," IEEE Transactions on Intelligent Transportation Systems, vol. 6, no. 2, pp. 1-19, 2004.

[3] S. Handri, S. Nomura, and K. Nakamura, "Detecting Stress Based on the Schedule of an Intermittent Mental Workload Using Physiological Sensor," Proceedings of the 11th International Conference on Humans and Computers, pp. 123- 126, 2008.

[4] Z. Jing, and A. Barreto, "Stress recognition using non-invasive technology," Proceedings of the 19th International Florida Artificial Intelligence Research Society Conference, pp. 395- 400, 2006.

[5] S.A. Hosseini, and M.A. Khalilzadeh, "Emotional stress recognition using EEG and psychophysiological signals: Using New Labeling Process of EEG Signals in Emotional Stress State," Proceedings of the International Conference on Biomedical Engineering and ComputerScience (ICBECS), pp.

1-6, 2010.

[6] J. Selvaraj, M. Murugappan, K. Wan, and S. Yaacob, "

Classification of emotional states from electrocardiogram signals: a non-linear approach based on hurst," Journal of BioMedical Engineering OnLine, vol. 12, no. 44, 2013.

[7] M. Murugappan, N. Ramachandran, and Y. Sazali,

"Classification of human emotion from EEG using discrete wavelet transform," Journal of Biomedical Science and Engineering, vol. 3, pp. 390-396, 2010.

[8] M. Teplan, "Fundamentals of EEG Measurement,"

Measurement Science Review, vol. 2, pp. 1-11, 2002.

[9] N. Sulaiman, M.N. Taib, S.A.M. Aris, N.H.A. Hamid, S. Lias, and Z.H. Murat, "Stress features identification from EEG signals using EEG Asymmetry & Spectral Centroids Techniques," IEEE EMBS on Biomedical Engineering and Science (IECBES), pp.

417 - 421 , 2010.

[10] T. Lan, A. Adami, D. Erdogmus, and M. Pavel, "Estimating Cognitive State using EEG signals," Journal of Machine Learning, vol. 4, pp. 1261-1269, 2003.

[11] S. Ito, Y. Mitsukura, and M. Fukumi, "A Basic Method for Classifying Human Based on an EEG Analysis," Proceedings of International Conference on Control, Automation, Robotics and Vision, pp. 1783 - 1786 , 2008.

International Conference on Materials, Electronics & Information Engineering, ICMEIE-2015 05-06 June, 2015, Faculty of Engineering, University of Rajshahi, Bangladesh

www.ru.ac.bd/icmeie2015/proceedings/

ISBN 978-984-33-8940--4

Referensi

Dokumen terkait

Nilai akurasi yang diperoleh dari ekstraksi ciri statistik orde ke-dua dan teknik klasifikasi K- Nearest Neighbor (K-NN) Classifier pada penelitian ini menunjukkan

Penelitian ini menggunakan k-Nearest Neighbor (k-NN) untuk identifikasi Freycinetia berdasarkan citra anatomi epidermis daun, yang menjadi input pada klasifikasi ini

Metode K-NN (K-Nearest Neighbor) merupakan metode klasifikasi yang dapat digunakan untuk menentukan status gizi balita dengan menggunakan variabel data input

Maka dari itu pada tugas akhir ini metode yang akan digunakan adalah pengembangan dari k-NN yaitu weighted k- Nearest Neighbor yang diharapkan dapat memberikan performansi

Algoritma K-NN atau K- Nearest Neighbor adalah suatu algoritma atau metode yang mempunyai konsistensi yang baik dalam mengklasifikasikan data, yaitu dengan cara

citra digital dengan menggunakan multiwavelet sebagai metode identifikasi ekstraksi ciri dan menggunakan metode K-NN( K-Nearest Neighbor ) sebagai klasifikasi yang akan

We propose a local Bonferroni Mean based Fuzzy K-Nearest Centroid Neighbor BM-FKNCN classifier that determines the class label of an unclassified sample dependent on the nearest local

Berdasarkan gambar 6, hasil dari 400 kali pengujian dengan menerapkan algoritma K Nearest Neighbor K-NN didalam pemodelan data dalam bidang Natural Processing Language NLP berbasis