You are on page 1of 5

Brain Computer Interface based Robotic Arm Control

Muhammad Laiba Naeem Tehmina Aasim Raheel Sanay Muhammad Majdi Syed
Yasir Latif Hafeez Muhammad Awais Alnowami Muhammad
Umar Saeed Anwar

Computer Computer Computer Computer Computer CVSSP, Department of Software


Engineering Engineering Engineering Engineering Engineering University of Nuclear Engineering
Department, Department, Department, Department, Department, Surrey, Engineering, Department,
UET Taxila, UET Taxila, UET Taxila, UET Taxila, UET Taxila, Surrey, UK Faculty of UET Taxila,
Pakistan Pakistan Pakistan Pakistan Pakistan Engineering, Pakistan
King
Abdulaziz
University,
Jaddah

Abstract— Brain computer interface (BCI) establishes a limbs began in early 1950’s in the field of military and medicine
communication channel between a computer and a human brain [4]. Similarly, neuro-prosthetic devices have been developed
which converts brain activity to control signals. With the for wrists, upper and lower limbs, and for assisting gait [5]. L.A.
advancement in research and technology, many BCI based Farewell and E. Donchin demonstrated in a study, in 1988, that
rehabilitation devices have been developed to augment, support, people can spell words on a screen using the P300 based event
and supplement human motion in a paralyzed or partially disabled
related potentials (ERPs) [6]. An EEG-BCI based wheelchair
person. This would help in developing a smart society where a
disabled person will have the freedom to complete their day to day has provided the much-needed real-time control to the severely
tasks. In the proposed experimental setup, brain signals are used paralyzed persons [7].
to move the robotic arm and perform different tasks i.e., picking BCIs provide ease and comfort by controlling machines
and placing. Electroencephalography (EEG) signals are recorded through brain signals. They are made by integrating brain
using a five-channel wearable headband. A total of five subjects signals to arrange brain potentials in a way so that no muscle
voluntarily participated in the study, with an informed consent. arbitration is required [8]. The intrusive approach of placing
The EEG data is recorded for a duration of twenty minutes for electrodes inside the scalp is comparatively less appealing as
each participant, and eight different statistical features are compared to the non-invasive approach in which electrodes are
extracted to detect clench and attention signals. Five different
placed on the scalp, which is used in many BCI based
classifiers namely support vector machine, Naive Bayes, K-nearest
neighbor, multilayer perceptron, and random forest are used. The restorative applications for a couple of crippled clients [9]. A
results are compared in terms of accuracy and error parameters. BCI based on EEG signals can be controlled by tweaks of the
The proposed method achieves significant results for smart robotic EEG signals, which are incited by tasks involving motor
arm control. imagery and enables a user to move cursor on a screen [10].
Many neuro-prosthetic devices, such as artificial limb attached
Keywords—robotic arm, EEG, BCI, wearable device, smart to the human body and computer applications are developed by
intrface designing an interface that translates brain signals to
I. INTRODUCTION appropriate control signals. 2D movement of robotic arm has
been done by the correlation of EEG maps with the brain
In the past few decades, technology procreation has
machine interface [11]. Non-invasive neural signals based
positively affected all aspects of life including the field of
integrated robotic arm driven by three-dimensional hand
neuroscience. Using the EEG signals from the brain, various
trajectories has also proved to be a feasible tool for paralyzed
human machine interfaces (HMIs) such as robotic arm, artificial
people [12]. There are numerous vision based graphical
hand, wheelchair etc., have been developed to help the
systems, which are developed by advanced telecommunication
individuals with motor dysfunctions [1]. One of the most
research institute (ATR), including reformation of human
commonly used HMI is the brain computer interfaces (BCI). In
motions observed from multiple cameras and virtual kabuki
1924, Hans Berger measured the brain waves using an EEG
[13]. However, such systems are limited by the positioning of
device [2]. There exists a repetition and rhythm in the neural
the camera for obtaining images or videos and affected by
activity, which is distinguished by the frequencies of the brain
illumination problems. In contrast, BCI systems are non-
waves that have several classes such as infra low waves (< 0.5
invasive and are feasible in the sense that they require EEG
Hz), delta waves (0.5 – 3 Hz), theta waves (3 – 8 Hz), alpha
signals from the brain, which are easier to acquire by the EEG
waves (8 – 12 Hz), beta waves (12 – 38 Hz), and gamma waves
headset. BCI systems are employed in educational frameworks,
(38 – 42 Hz) [3]. The replication of human motion with artificial
which uses EEG signals to decide the level of clearness of

978-1-5386-2524-8/17/$31.00 ©2017 IEEE


contemplated data. Customized cooperation to every student is the brain when a person meditates. It is a latest EEG tool
set up as indicated by the resultant reaction experienced [14]. that is used for the measurement of level of attention, conscious
In this study, the methodology opted to design EEG-BCI thoughts, and facial expressions to wirelessly control the
based robotic arm is to acquire the EEG signals from the human physical or software devices. The EEG signals acquired through
brain using a 5-channel muse headband, which provides Muse Headband are then modified, filtered, digitized, and
accurate, real-time feedback on what is happening inside processed.

Figure 1: The proposed EEG based system for robotic arm control.

The arm movement is based on clench and attention signals and microcontroller is generally used in control projects and is
produces movement in 3 degree of freedom (DOF). In this chosen because of its open-source nature. Finally, a driving
research, five different classifiers are used for the classification signal is sent to the set of servo motors within the robotic arm to
of clench and attention signal i.e., Naïve Bayes, support vector perform an action of picking and placing a bottle.
machine (SVM), K-nearest neighbor (KNN), multilayer B. Pre-processing
perceptron (MLP), and random forest (RF). The methodology
and results are presented in the following subsections. The acquired EEG data is stored as floating-point values
which are directly converted from the unsigned 14-bit analog to
II. METHODOLOGY digital converter output. These floating-point values cause DC
In general, BCI systems are divided into four phases i.e., level problem to the signal which occurs at 4200 µV
acquisition of data, preprocessing the acquired data, extracting approximately. For removal of this DC offset, before
features, and classification. The proposed EEG based robotic performing any signal processing such as fast Fourier
arm follows the same four phases. Figure 1 shows the steps transform, it is required to apply DC offset removal. The
followed in the proposed methodology and the details of each simplest method for the removal of DC offset is to subtract the
section are given in the following subsections. average value of the signal from the entire data channel,
although this is the least accurate method. Ideally, it is required
A. EEG Data Acquisition to apply a first order high-pass filter of 0.16Hz to remove the
In the first step, data is acquired by an experiment background signal. This also removes the long-term drift,
conducted to control the robotic arm using EEG signals. Five which is not achieved by the average subtraction method.
subjects participated in the study, consisting of two females and
three males having and average age of 21.5 years. At start of the C. Feature Extraction
data acquisition process, the participants are briefly informed After preprocessing phase, the next step is to extract
about the aims and objectives of the project and a written features from the acquired data. There are two common types
consent is taken. The experiment is conducted in an isolated of features that can be extracted i.e., time domain and frequency
room to prevent any external distractions. domain. In this research, only time domain features are used,
During the experiment, a video instructing to perform since the computation time required to compute these features
clench, rest, and attention by showing mind focusing games are is less. Let S(t) represents the acquired signal, then the features
shown to the participants each with a time difference of 10 can be calculated [15] as follows,
seconds. The video is played on an LED screen and based on The maximum amplitude of the signal S(t) is calculated
the type of video the subjects are instructed to perform the as,
action as shown for every 10 seconds. A 20-minutes long data = max | ( )| (1)
recording for EEG signals is performed for each subject. The minimum amplitude of the signal S (t) is calculated
The sampling rate of the acquired signals is 256 Hz and the as,
output of the cognitive software is sent to the ARDUINO UNO = min | ( )| (2)
board to control the robotic arm. The ARDUINO The absolute amplitude (AAMP) is calculated using,
Table 1: Comparison of various performance parameters.
78%
Classifi Kappa MAE RMSE RAE RRSE 77%
er % % 76% 77%
SVM 0.6281 0.2736 0.3542 66 77.8 75%
NB 0.5751 0.1719 0.3934 41.46 86.42 74% 75% 75%
RF 0.5751 0.1658 0.2901 40.07 63.72 73% 74%
KNN 0.6061 0.1657 0.2896 40 63.63 72% 73%
MLP 0.5967 0.1668 0.2897 40.23 63 71%
SVM NB RF KNN MLP
AAMP = | | (3)
The average (avg) of the signal S(t) is calculated using, Figure 2: Accuracy comparison of classifiers used.
∑ ( ) (4) 4. For the classification of data, neural networking
where ∑S(t) demonstrates the whole of size of the considerable algorithms are highly efficient. It is difficult to formulate a
number of tests and N means the aggregate number of samples perfect algorithmic solution that closely matches the human
in time interval t. neuronal system MLP can extract relevant signal in noise
The power (P) of the acquired signal is calculated as, presence with low computational complexity and with higher
∑| ( )| (5) classification accuracy [19].
where T is the time period. The energy (E) calculation of the 5. K-Nearest Neighbor classifier varies by different
acquired signal is done as follows, values of k. KNN uses non-parametric classifying method. The
training pattern is mapped in d-dimensional feature space in the
∑| ( )| (6) training phase of the classifier. With unknown and random
The power (P) of the EEG signal is used by the Variance (V) of samples, KNN chooses the most closely/nearest neighbors for
the EEG signal. Usually, the variance is calculated as, K samples as stated in weighing metric and weighing strategy.
∑( μ) (7) In training phase, all samples of a class which are neighbors of
To reduce the complexity of the system, another feature named the K are counted. As per rule, the unknown samples during the
Kurtosis is used and is calculated as, testing phase are assigned to a class and when the strategy opted
∑ ( ) is random and the class is chosen randomly, then the rule is
K= n (8) broken of assigning class to unknown samples [20].
(∑ (( ) )

D. Feature Classification III. RESULTS AND DISCUSSION

Feature classification is the final step in a BCI system. After extracting features from the acquired signal, those
There are different types of algorithm which are used to classify features are classified according to certain parameters and
the data i.e., supervised learning and unsupervised learning. In classifiers. The used classifiers in this study are Naive Bayes,
this study, a supervised learning technique is followed. SVM, KNN, MLP and Random forest. 10-fold cross validation
A classifier from each category is chosen for the classification is applied against each classifier that divides all the instances in
purpose. The following five classifiers are used: to 10 equal folds and each fold is used only once as a testing
1. Support vector machine classifier has been executed data whereas, other folds are used for training purpose. After
for the assurance of the mental tasks performed by the user. The classifications, different results are obtained to be compared.
SVM classifier is observed to be an exceptionally valuable Results are compared in terms of Kappa statistics, mean
strategy for information arrangement. Keeping in mind the end absolute error (MAE), Root mean squared error (RMSE),
goal to play out the characterization, SVM uses hyper-planes relative absolute error (RAE), root relative squared error
for gathering them in a high dimensional space to recognize the (RRSE), and weighted average of detailed accuracy by class,
diverse class to order [16]. confusion matrices and at the end accuracy. From table 1 it is
2. Naive Bayes classifier is implemented for the evident that SVM classifier is better than all others in terms of
probability computation that a sample has a place with a class kappa values, MAE, RMSE, RAE and RRSE. Similarly,
and it is allocated to the most likely class by comparison of weighted average values of precision, recall and F-measure
combination of features with a specific threshold value [17]. against each classifier are shown in Figure 2. SVM proved to
be much better in terms of precision, recall and F-measure
3. The random forest has a performance that is found to
values as compared to other classifiers. From Table 1 it can be
be comparable with ensemble techniques such as bagging and
identified that Kappa and mean absolute error values of SVM
boosting. Due to the inherent parallel nature of random forest it
are higher than the other defined algorithms. From all these
is also used in parallel implementations using multithreading, results, SVM is proved as the most accurate algorithm for the
multi-core, and parallel architectures [18]. classification of clench and attention signal.
Table 2: Confusion matrix for different classifiers for three states including rest, clench and attention.

Predicted Rest state Clench Attention


Actual SVM NB RF KNN MLP SVM NB RF KNN MLP SVM NB RF KNN MLP
Rest State 261 261 261 261 261 0 0 0 0 0 0 0 0 0 0
Clench 0 0 0 0 0 75 61 62 78 77 54 68 67 51 52
Attention 0 0 0 0 0 65 68 69 75 77 60 57 56 50 48

REFERENCES
0.78
[1] Ferreira, Andre, Wanderley C. Celeste, Fernando A. Cheein, Teodiano F.
0.77 Bastos-Filho, Mario Sarcinelli-Filho, and Ricardo Carelli. "Human-machine
interfaces based on EMG and EEG applied to robotic systems." Journal of
0.76 NeuroEngineering and Rehabilitation 5, no. 1 (2008): 10.
0.75 [2] E. R. Miranda. Brain-computer music interface for composition and
performance. International Journal on Disability and Human Development,
0.74 5(2):119–126, 2006.
0.73 [3] Saeed, Sanay Muhammad Umar, et al. "Psychological stress measurement
0.72 using low cost single channel EEG headset." Signal Processing and
Information Technology (ISSPIT), 2015 IEEE International Symposium on.
0.71 IEEE, 2015.
SVM NB RF KNN MLP [4] George, Kiran, Adrian Iniguez, Hayden Donze, and Sheeba
Kizhakkumthala. "Design, implementation and evaluation of a brain-
Precision Recall F Measure computer interface controlled mechanical arm for rehabilitation." In 2014
IEEE International Instrumentation and Measurement Technology
Figure 3: Precision, recall and F-measure for different Conference (I2MTC) Proceedings, pp. 1326-1328. IEEE, 2014.
classifiers. [5] Lebedev, Mikhail A., Jose M. Carmena, Joseph E. O'Doherty, Miriam
Zacksenhouse, Craig S. Henriquez, Jose C. Principe, and Miguel AL
Nicolelis. "Cortical ensemble adaptation to represent velocity of an artificial
From figure 3, it is observed that SVM is the highest actuator controlled by a brain-machine interface." The Journal of neuroscience
accurate algorithm with 77% accuracy. The graph in Figure 3 is 25, no. 19 (2005): 4681-4693.
the weighted average of the precision, recall and F measures for [6] Farwell, Lawrence Ashley, and Emanuel Donchin. "Talking off the top of
five different classifiers i.e., SVM, NB RF, KNN and MLP. your head: toward a mental prosthesis utilizing event-related brain
potentials." Electroencephalography and clinical Neurophysiology 70, no. 6
From results of these three parameters it is observed that SVM (1988): 510-523.k8
has the highest values of Precision, Recall and F measures. It [7] Khare, Vijay, Jayashree Santhosh, Sneh Anand, and Manvir Bhatia.
also proves that SVM is the most accurate and best resulting "Brain computer interface based real time control of wheelchair using
algorithm in this study while comparing with other algorithms. electroencephalogram." International Journal of Soft Computing and
Engineering (IJSCE) 1, no. 5 (2011): 2231-2307.
In these results, the lowest value relevant to weighted average
[8] George, Kiran, Adrian Iniguez, Hayden Donze, and Sheeba
is of Naive Bayes Confusion matrices against each classifier are Kizhakkumthala. "Design, implementation and evaluation of a brain-
given below and describe the true positive, true negative, false computer interface controlled mechanical arm for rehabilitation."
positive and false negatives against each class. It is evident In Instrumentation and Measurement Technology Conference (I2MTC)
from Table 2, that SVM classification algorithm has highest Proceedings, 2014 IEEE International, pp. 1326-1328. IEEE, 2014.
true positive rate as compared to others. From confusion [9] Dornhege, Guido, ed. Toward brain-computer interfacing. MIT press,
2007.
matrices of all algorithms one can observe that rest signal is
[10] Wolpaw, Jonathan R., and Dennis J. McFarland. "Control of a two-
identified correctly by all the classifiers with 100% accuracy. dimensional movement signal by a noninvasive brain-computer interface in
humans." Proceedings of the National Academy of Sciences of the United
IV. CONCLUSION States of America 101, no. 51 (2004): 17849-17854.
The objective of the study has been to develop an application [11] Lebedev, Mikhail A., Jose M. Carmena, Joseph E. O'Doherty, Miriam
Zacksenhouse, Craig S. Henriquez, Jose C. Principe, and Miguel AL
that will be used by paralyzed persons for the movement of the Nicolelis. "Cortical ensemble adaptation to represent velocity of an artificial
robotic arm controlled by brain signals. In this study, EEG actuator controlled by a brain-machine interface." The Journal of neuroscience
signals of users are used to move the robotic arm control. 25, no. 19 (2005): 4681-4693.
Clench and attention signals are detected using five different [12] Kim, Yoon Jae, Sung Woo Park, Hong Gi Yeom, Moon Suk Bang, June
classifiers namely SVM, N.B, KNN, MLP and R.F. Among Sic Kim, Chun Kee Chung, and Sungwan Kim. "A study on a robot arm driven
by three-dimensional trajectories predicted from non-invasive neural signals."
these, SVM proved to be the best algorithm to detect Biomedical engineering online 14, no. 1 (2015): 1.
andclassify the signals with highest accuracy of 77%. In future, [13] Freeman, William T., Paul A. Beardsley, Hiroshi Kage, Ken-Ichi Tanaka,
out of lab environments will be used to move the robotic arm Kazuo Kyuma, and Craig D. Weissman. "Computer vision for computer
and to control its direction. Degree of freedom can be increased interaction." ACM SIGGRAPH Computer Graphics 33, no. 4 (1999): 65-68.
and type of signals used to control the arm can be varied. [14] Sorudeykin, Kirill A. "An educative brain-computer interface." arXiv
preprint arXiv:1003.2660 (2010).
[15] Raheel, Aasim, Syed M. Anwar, Muhammad Majid, and Bilal Khan.
"Real time text speller based on eye movement classification using wearable
EEG sensors." In SAI Computing Conference (SAI), 2016, pp. 161-164.
IEEE, 2016.
[16] Hortal, Enrique, Eduardo Iáñez, Andrés Úbeda, Carlos Perez-Vidal, and
José M. Azorín. "Combining a Brain–Machine Interface and an
Electrooculography Interface to perform pick and place tasks with a robotic
arm." Robotics and Autonomous Systems 72 (2015): 181-188.
[17] Planelles, Daniel, Enrique Hortal, Álvaro Costa, Andrés Úbeda, Eduardo
Iáez, and José M. Azorín. "Evaluating classifiers to detect arm movement
intention from eeg signals." Sensors 14, no. 10 (2014): 18172-18186.
[18] Kulkarni, Vrushali Y., and Pradeep K. Sinha. "Random forest classifiers:
a survey and future research directions." Int J Adv Comput 36, no. 1 (2013):
1144-53.
[19] Balakrishnan, Divya, and Sadasivan Puthusserypady. "Multilayer
perceptrons for the classification of brain computer interface data."
In Bioengineering Conference, 2005. Proceedings of the IEEE 31st Annual
Northeast, pp. 118-119. IEEE, 2005.
[20] Bhaduri, Sanniv, Anwesha Khasnobish, Rohit Bose, and D. N.
Tibarewala. "Classification of lower limb motor imagery using K Nearest
Neighbor and Naïve-Bayesian classifier." In Recent Advances in Information
Technology (RAIT), 2016 3rd International Conference on, pp. 499-504.
IEEE, 2016.

You might also like