Frequency-Based EEG Human Concentration Detection System Methods With SVM Classification
Frequency-Based EEG Human Concentration Detection System Methods With SVM Classification
Frequency-Based EEG Human Concentration Detection System Methods With SVM Classification
Abstract—Human concentration is needed in many aspect of [4], Autoregressive, Fourier Transformation, and Neural
human life, such as in cognitive activities and also can be used Network.
in a situation when the human concentration should be present
and maintained, for example for a driver, where the absence of This research uses 2 frequency-based methods to process
concentration could lead to a severe accident. In this research, EEG signals, which are the Fast Fourier Transform (FFT) and
human concentration is recognized by observing the the Discrete Wavelet Transform (DWT) techniques. FFT is an
electroencephalography (EEG) signal generated by the human algorithm that converts a digital signal from its original
brain. The EEG signal is taken from a non-invasive brain domain (often time or space) to a representation in the
computer interface (BCI) device and processed using frequency frequency domain and vice versa. The FFT is obtained by
based feature extraction and an RBF kernel SVM classifier. decomposing a sequence of values into components of
Two frequency-based feature extractions are compared, the different frequencies. Discrete Wavelet Transform (DWT) is
power spectral density (PSD) from Fast Fourier Transform a method to transforms a discrete time signal to a discrete
(FFT) and the energy from Discrete Wavelet Transform (DWT). wavelet representation [5]. These two methods was selected
DWT is better than FFT to be used as the feature extraction, for this research due to its ability to extract the frequency
and the accuracy is higher by 18% compared to the system with components from a signal and at the same time reduce the
FFT. SVM with RBF kernel as the classifier, has shown a good number of data, which is a concern in machine learning
performance with 91% accuracy in recognizing human approach. This research aims to identify which method would
concentration, with the best parameter settings when C=1 and
be more effective in recognizing the degree of human attention
γ=0,1.
based on EEG signal. An SVM is used as the classifier in this
Keywords—Concentration, EEG, SVM, DWT, FFT human concentration detection system.
This paper is organized as follows. Section II explain
I. INTRODUCTION
about theories that support this research include EEG,
In medical industry, the EEG has been used to record brain Neurosky Mindwave BCI device, the FFT Algorithm, the
electrical activities from patients. This brain wave generated DWT Algorithm, and SVM Classifier. Section III discuss
by the EEG device wave will be studied by medical personnel about methodology that is designed and implemented in this
to understand electrical activities that currently happened in research. Section IV discuss about experiment and its result.
patient’s brain. Usually, EEG device are used to monitor Section V concludes the paper.
patient with epilepsy, and other brain related disease.
However, nowadays, a more commercial or consumer-based II. THEORETICAL BACKGROUND
EEG are available in the market. This non-invasive EEG Background theory for this EEG study includes literatures
based device is called brain computer interface (BCI). The for brain waves, EEG and its impact to human concentration,
purpose of the BCI device is the same as the EEG device, to tools to measure attention and concentration level, and
get the brain signal from human. Unlike the EEG devices that algorithm for detecting the waves.
are usually used for medical purpose, the usage of BCI devices
are wider and still growing for a new area of application. A. Electroencephalogram
In this research, the brain signal (or EEG signal) from a Electroencephalography is a procedure of recording brain
BCI device is used to monitor human concentration. The electricity activity which represented by graphic called as
application of this research can be used to detect student’s Electroencephalogram (EEG). EEG is used to detect problem
concentration during test or any cognitive activities. It also can with brain electricity activity that is correlated with brain
be used in a situation when the human concentration should malfunction. Measurement of signal level from the EEG could
be present and maintained, for example for a driver, where the be used as early recognition of any brain abnormalities or
absence of concentration could lead to a severe accident. The disease, such as epilepsy, brain inflammation, tumor,
brain wave can be differentiated by the frequency band, such dementia, insomnia, and memory loss. Medical professionals
as Alpha Wave (8-13 Hz), Beta Wave (14-30 Hz), Delta Wave have claimed that there are zero risk for patients after using
(0,5-3 Hz), and Gamma Wave (30-50 Hz) [1]. There are two EEG. EEG is considered harmless and safe to use for any
human conditions related to concentration that want to be patients [5].
detected from the EEG signal, the full-concentration mode An EEG output is a wave pattern. This pattern could be
and the distracted attention/less-concentration mode [2]. varied based on human’s condition and activity during the test.
There are several methods for EEG based systems, such as For example, an EEG result of a man walking would differ
Event-Related Potentials (ERP) [3], Wavelet Transformation when compared to EEG result of a man sleeping. Result of
30
B. Input set. This training set would be used to train the SVM
Input from the system was collected through 10 algorithm.
participants brain waves which gathered by a Neurosky D. Identification
Mindwave device. This experiment was conducted with
participants aged 18-25 years old. Participants was positioned On the third step after data extraction using FFT and
in a quiet and well-lit room. Participants conditions needs to DWT, the result was used as input neuron which will be later
be: used for training process with Support Vector Machine (SVM)
method. SVM was used due to its ability to identify human’s
• in good health, mind condition based on the collected data. SVM was chosen
• adequate quantity of sleeping, as classification method based on literature review that it is the
• well-fed, most accurate and often used in Matlab [11]. In this system,
• not currently under stress or hungry, researcher divide the class into two, full-concentration class
and less-concentration class. In order to determine accurate
• not taking certain medications, SVM model, there are several variations of the best kernel and
• and a day before experiment the participants did C parameters.
not consume any caffeine.
E. Output
During the data collection, participants wore Neurosky Output of this study is FFT and DWT extracted wave data
Mindwave device and faced the laptop screen with ideal that has been classified by SVM and without SVM. In the
distance (50-70 cm). Laptop screen would show a game called results of this experiment, SVM will separate the two classes
“Snake.is”. Participants then asked to play the game for 6 namely the concentration condition and the not/less
minutes. Signal will be recorded starting form the second up concentration. The system performance is then measured in
to fifth minutes. The first minutes would be considered as the form of accuracy.
activation time thus it will not be recorded yet. After the first
experiment was completed, participants will take a break for IV. EXPERIMENT RESULTS
5 minutes in relaxing position and drank a glass of water
In order to determine the best algorithm to be implemented
before continuing to the next stage. The situation of the data
in the human concentration detection system, several
collection is illustrated in Fig. 5.
experiments were conducted. The EEG signals from 10
In the second experiments, the participants stay in the participants with age ranged at 18 – 25 years old were
same conditions, playing the same game, but with a collected using Neurosky Mindwave brain computer interface
distraction. The distraction comes in a form of music. The device. There are 100 concentrated data and 100
participants listened to rock genre music. The song that was unconcentrated data colledted to be used in the following
played during the experiment was SUICIDE SILENCE - You experiments.
Only Live Once. This song was listened through the earphone.
In order to compare the efficacy of machine learning in
The experiment was conducted and recorded under the same
this system, in the first experiment, we conduct the detection
procedure as previous experiments during the concentration
without using the SVM. The result of this experiment is
condition.
become the baseline of the next experiment. In the second
experiment, we used PSD from FFT as the feature extraction
method and SVM as the classifier. In this experiment, we
compared which parameter settings of the SVM are the best.
In the third experiment, we used Energy from DWT as the
feature extraction method and SVM as the classifier. In this
experiment, we compared which parameter settings of the
SVM are the best. And also, we compare the result of FFT
comparedto DWT, and determined which feature extraction
gives the best recognition. The system performance will be
measured using several parameters, i.e. accuracy, recall,
precision, and f-measure.
31
First of all, the EEG signal need to be breakdown into five
Start
frequency bands, Alpha, low Beta, high Beta, Theta, and
Delta. To transform the signal into frequency based, we
compare two methods, the FFT and the DWT. The
concentration detection using FFT algorithm is depicted in Fig
6. Once a signal is transformed using FFT, the power spectral
density (PSD) of each frequency band are calculated and the
concentration can be determined by looking at the Alpha and
Beta band.
Another method to transform a signal into frequency bands
is by using DWT. Once a signal is transformed using DWT,
the energy of each frequency band is calculated and the
concentration can be determined by looking at the Alpha and
Beta band. The concentration detection using DWT algorithm
is depicted in Fig 7.
By using this simple algorithm, the system achieved
61,5% accuracy for FFT feature, and 68% accuracy for DWT.
The result of this experiment is depicted in Fig 8. The result
of this first experiment is used as the benchmark for the
following second and third experiments.
100%
80% 68%
61.50%
Accuracy
60%
40%
Fig. 6. Flowchart of concentration detection using FFT
20%
0%
FFT DWT
Start
From Table II, it can be seen that C=1 or C=10 and γ=0,01
or γ=0,01 produced the best result of the system using FFT as
the feature extraction and SVM as the classifier. This result is
Fig. 7. Flowchart of concentration detection using DWT
32
better than the accuracy of the system without SVm as depicted in Fig. 9. Although it was a slight difference to the 5-
mentioned in the first experiment. Thus, SVM as classifier is fold and the 10-fold, by using the 15-fold cross validation, the
effective to raise the recognition system approximately by system achieved the best performance for all aspects, with
12% compared to the system with FFT without using machine accuracy=0.78, recall=0.77, precision=0.78 and f-measure=
learning. 0.77.
C. Classification using DWT feature and SVM classifier
In this experiment the energy of DWT decomposition was 1
used as the feature extraction method, and the SVM was used
as the classifier. Five features from five frequency bands are 0.8
generated by the energy of the DWT bands. This become the
input to the classifier. The RBF kernel was used in the SVM 0.6
Value
classifier.
0.4 Accuracy
There are 2 parameters to in SVM with RBF kernel that Recall
should be set, which is the value of C and γ (gamma). The 0.2 Precission
choice of these parameters highly affects the accuracy of the F-Measure
SVM classifier. In this experiment, we varied some value of 0
C (10-1 to 101) and γ (10-2 to 102) to find the best combination 10 20 30
of both values and the result is depicted in Table III. Holdout value
From Table III, it can be seen that C=1 and γ=0,1 or γ=1 Fig. 10. Performance of system using DWT Energy and SVM by different
produced the best result of the system using DWT as the holdout value
feature extraction and SVM as the classifier, which are about
In the hold out method, three hold out value were
90%. This result is better than the accuracy of the system
compared, i.e. 10%, 20% and 30%. The performance of the
without SVM as mentioned in the first experiment, and has
SVM is presented in accuracy, precision, recall and f-measure
raised the accuracy by 22%. The DWT as the feature
and depicted in Fig. 10. Although it was a slight difference to
extraction is better than the system with FFT as the feature
the 10% and the 20% hold out value, by using the 30% hold
extraction, and has raised the recognition system
out value cross validation, the system achieved the best
approximately by 18% compared to the system with FFT and
performance for all aspects, with accuracy=0.9, recall = 0.8,
SVM as the classifier. Therefore, we can conclude that DWT
precision = 1 and f-measure = 0.88. This result implies that
is better than FFT as the feature extraction for the human
when the hold out value is 30%, the model can learn the data
concentration recognition system.
well and make a good generalization among the data; thus,
TABLE III. ACCURACY OF SYSTEM WITH DWT FEATURE WITH C AND when the testing data are fed into the model, it will be
GAMMA VARIATION classified better.
γ V. CONCLUSION
0,01 0,1 1 10 100 From the experiments, it can be seen that the usage of
0,1 57% 57% 57% 57% 57% SVM as a classifier is more effective compared to the system
C 1 63% 91% 90% 60% 57% that is not using a machine learning, and can raise the
10 63% 80% 80% 77% 57% recognition by 22%. For recognizing the concentration of
human based on EEG signal, the DWT is better than FFT to
D. SVM cross validation using hold-out and k-fold method be used as the feature extraction. The accuracy from the
system with DWT as the feature extraction was higher by 18%
Different cross validation method may also affecting the compared to the system with FFT. SVM with RBF kernel as
classification accuracy of SVM classifier. In this experiment the classifier, has shown a good performance with 91%
we compared the k-fold and hold out cross validation method. accuracy in recognizing human concentration, with the best
parameter settings when C=1 and γ=0,1.
1
ACKNOWLEDGMENT
0.8
The authors would like to thank Universitas Indonesia to
0.6 partly fund this research under PITTA 2019 grant no No.
Value
Accuracy
0.4 Recall NKB-0770/UN2.R3.1/HKP.05.00/2019.
Precission
0.2 F-Measure
REFERENCES
[1] I. S. Isa, B. S. Zainuddin, Z. Hussain, and S. N. Sulaiman, “Preliminary
0 study on analyzing EEG alpha brainwave signal activities based on
5 10 15 visual stimulation,” Procedia Comput. Sci., vol. 42, no. C, pp. 86–92,
K-fold 2014.
[2] A. G. Bakaoukas, F. Coada, and F. Liarokapis, “Examining brain
Fig. 9. Performance of system using DWT Energy and SVM by different k- activity while playing computer games,” J. Multimodal User
fold value Interfaces, vol. 10, no. 1, pp. 13–29, 2016.
[3] M. D. N. Psychologie, “EEG and ERP methodology.” [Online].
In the k-fold cross validation method, three value of k were Available:
compared, i.e. 5, 10 and 15. The performance of the SVM is http://fmri.uib.no/index.php?option=com_content&view=article&id=
presented in accuracy, precision, recall and f-measure and 82&Itemid=123. [Accessed: 26-Nov-2018].
33
[4] A. Hamad, A. E. Hassanien, E. H. Houssein, and A. A. Fahmy, [8] F. A. A. Aziz, M. I. Shapiai, N. A. Setiawan, and Y. Mitsukura,
“Feature extraction of epilepsy EEG using discrete wavelet transform,” “Classification of human concentration in EEG signals using Hilbert
2016 12th International Computer Engineering Conference, ICENCO Huang transform,” Int. J. Simul. Syst. Sci. Technol., vol. 18, no. 1, pp.
2016: Boundless Smart Societies. pp. 190–195, 2017. 10.1-10.11, 2017.
[5] C. Q. Lai, H. Ibrahim, M. Z. Abdullah, J. M. Abdullah, S. A. Suandi, [9] I. Ellonen and A. Kaarna, “Chaff clutter filtering from radar data with
and A. Azman, “Artifacts and noise removal for electroencephalogram discrete wavelet transform,” 2008 IEEE Radar Conference, RADAR
(EEG): A literature review,” ISCAIE 2018 - 2018 IEEE Symp. 2008. 2008.
Comput. Appl. Ind. Electron., pp. 326–332, 2018. [10] H. A. Akkar and F. A. Jasim, “Optimal Mother Wavelet Function for
[6] D. Huang, K. Qian, D. Y. Fei, W. Jia, X. Chen, and O. Bai, EEG Signal Analyze Based on Packet Wavelet Transform,” vol. 8, no.
“Electroencephalography (EEG)-based brain-computer interface 2, pp. 1222–1227, 2017.
(BCI): A 2-D virtual wheelchair control based on event-related [11] S. Kumar and D. K. Atal, “Classification of Epileptic & Non Epileptic
desynchronization/ synchronization and state control,” IEEE Trans. EEG Signal Using Matlab,” Int. J. Sci. Res. Sci. Technol., vol. 2, no.
Neural Syst. Rehabil. Eng., vol. 20, no. 3, pp. 379–388, 2012. 4, pp. 203–207, 2016.
[7] Y. B. Olam, F. D. Setiaji, and D. Susilo, “Implementasi Headset
NeuroSky MindWave Mobile untuk Mengendalikan Robot Beroda
secara Nirkabel,” Techné J. Ilm. Elektrotek., vol. 13, no. 2, pp. 173 –
183, 2014.
34