Electroencephelograph Based Brain Machine Interface For Controlling A Robotic Arm
Electroencephelograph Based Brain Machine Interface For Controlling A Robotic Arm
Authorized licensed use limited to: INDIAN INSTITUTE OF TECHNOLOGY KHARAGPUR. Downloaded on August 16,2021 at 05:50:53 UTC from IEEE Xplore. Restrictions apply.
use electromyography (EMG) and electrooculography (EOG) It is wireless and utilize a proprietary USB dongle to
signals as control mechanisms. EMG signals are generated by communicate using the 2.4GHz band.
muscle movement and EOG signals are generated by eye
B. System Software and Control Commands
movement. Often, these signals are considered noise artifacts
and their removal from pure EEG signals is desirable. The Research Edition SDK provided with the EPOC
However, the same distinguishing characteristics used to headset offers a variety of solutions for creating an interface
recognize and extract these artifacts with noise removal with the robotic arm. In addition to a robust API, the included
algorithms are also easily recognized features used to classify software interfaces with the EPOC headset in a useful way.
the signals as part of BCI control [3]. Additionally, a program is needed to control the robotic arm.
The necessary software is (1) the Emotiv Control Panel, (2)
The possible uses for a BCI system are as wide-ranging as the EmoKey application, and (3) the CytonControl
the applications of computer programs and computer application.
controlled devices. One of the most noteworthy applications
of BCIs is in the field of medicine. BCIs offer tools for the The Emotiv Control Panel manages the connection to the
disabled to interact with the world, even if they are suffering headset and processes EEG data in real time according to a
from severe nerve damage between their brain and original number of suites. Of particular relevance is the Cognitiv suite,
limbs. In the case of a lost or paralyzed limb, BCIs offer the which handles the recognition of trained commands from pure
potential for patients to use a robotic limb, controlled with EEG data. The tab dealing with the Cognitiv suite presents a
their natural thought patterns, to interact with the world. virtual block and allows the user to establish which
commands to use and train those commands as well as a
neutral state. An additional feature of the Cognitiv suite tab is
In this research, a BCI is implemented by using a Robai
the ability to adjust the sensitivity to a certain command.
Cyton Veta robotic arm, the Emotiv headset, and several
Qualitative analysis has shown that adjusting the sensitivity of
software applications included with the Emotiv system. The
EEG signals are used to control the robotic arm. Initially, the all commands equally towards a higher sensitivity usually
system is developed using the provided Emotiv software to provides better response times.
handle not only interfacing but also to solve the basic
classification problem. After this proof of concept, a new
approach is used to handle feature extraction and
classification of the EEG data.
Authorized licensed use limited to: INDIAN INSTITUTE OF TECHNOLOGY KHARAGPUR. Downloaded on August 16,2021 at 05:50:53 UTC from IEEE Xplore. Restrictions apply.
the robotic arm by using specific keystrokes as input, each The majority of subjects are able to train with the system
corresponding to one of six possible commands. The six and manage one to two Cognitiv control signals without
commands are grab, release, lift, lower, rotate left, and rotate excessive difficulty. Typically the commands chosen are lift
right. Several provisions are made as part of the CytonControl and lower. However, adding the additional commands for
software to prevent the robotic arm from attempting to rotation reduce the accuracy of command execution for all the
execute redundant actions or collide with known obstacles. control signals to an almost unusable degree without
The current state of the robotic arm is checked before each extensive time practicing with the system. The EMG based
command execution to insure that the next command it has grab and release controls are easily performed by the majority
been sent is valid. For example, lift is only executed if the of subjects.
system is in the lowered position. Rotations occur unless the
robotic arm has reached the limit of its range of motion. III. A NEW LEARNING SYSTEM
Before these changes were implemented, seemingly random
3-5 second pauses would occur where the system would be With the Emotiv based system, training is easily achieved
unresponsive. This was caused by the delays implemented in within a time span of 30 minutes for one or two actions to
the code to guarantee the robotic arm completes a motion achieve a reasonable level of accuracy. However, for each
before accepting the next command. action added it becomes more difficult to retain accuracy. In
order to gain a high efficiency and accuracy when training the
The keystrokes from the EmoKey program are sent to the
robotic arm, a new learning system is designed in this
CytonControl program which in turn sends command to the
research, as shown in Fig. 4.
robotic arm. Fig. 3 shows that Rule 3 is corresponding to the
action lift and the trigger conditions of it is when power is
greater than 0.2.
Authorized licensed use limited to: INDIAN INSTITUTE OF TECHNOLOGY KHARAGPUR. Downloaded on August 16,2021 at 05:50:53 UTC from IEEE Xplore. Restrictions apply.
In this research, the input data, represented by X, is a linear perceptron and can distinguish data that is not linearly
14×1000 data matrix, where each row includes EEG signals separable.
from one electrode (channel). The first step of FastICA
algorithms is to remove the sample mean and whiten the data. In this research, the processed data (a matrix of 14*1000)
with ICA representing one action is the input to the multilayer
network. The output indicates which of the action (drop, lift,
−1/ 2
rotate left, rotate right and neutral) is thinking when collecting
X =D ET ( X − X ) (1)
this input data. A fully connected network structure of MLP is
where shown in Fig. 5.
E{ XX T } = EDE T (2)
X is the sample mean, E is the matrix of eigenvectors and
D is the diagonal matrix of eigenvalues. The output whitening
data X contains linear transformation, so it is uncorrelated
unit variance data.
Authorized licensed use limited to: INDIAN INSTITUTE OF TECHNOLOGY KHARAGPUR. Downloaded on August 16,2021 at 05:50:53 UTC from IEEE Xplore. Restrictions apply.
Next, according to the error, adjust weights iteratively, as format, EDF, which is compatible with many EEG analysis
shown following: programs such as EEGLab, an open source project for EEG
data processing in Matlab. Following the initial information
Δw jl = η ⋅ (d − y _ pj ) ⋅ y _ pj ⋅ (1 − y _ pj ) ⋅ u _ pl (11) line, each successive row in the data file corresponds to one
data sample. Successive rows correspond to successive time
w jl (t + 1) = w jl (t ) + Δw jl (t ) (12) slices. Each column of the data file corresponds to an
M individual sensor or other information tag.
δ pl = ∑ w jl ( d − y _ pj ) (13)
j =1
Δvli = η ⋅ δ pl ⋅ u _ pl ⋅ (1 − u _ pl ) ⋅ x _ pi (14)
vli (t + 1) = vli (t ) + Δvli (t ) (15)
where η is called the learning rate parameter.
Authorized licensed use limited to: INDIAN INSTITUTE OF TECHNOLOGY KHARAGPUR. Downloaded on August 16,2021 at 05:50:53 UTC from IEEE Xplore. Restrictions apply.
hidden nodes L, the mean square error steadies at a lower
value with less oscillation, as ŋ=0.5, when L=50, mean square
error is 2.18, almost 3 times lower than the mean square error
when L=20. With the decreasing value of learning rate
parameter ŋ, convergence characteristics improve and the
mean square error steadies at a lower level. That is, the more
hidden layer nodes and the lower the learning rate parameter
that are used, the lower mean square error and the better
testing performance are produced. However, using too many
hidden nodes wastes time on training without a relevant
decrease the percentage error significantly. Therefore, in this
research, the hidden layer of MLP uses 40 nodes, and the
learning rate used is 0.5. The learning curve is shown in Fig.
11 below.
Fig. 8: the user interface of FastICA
TABLE 1
THE FINAL CONVERGENT MEAN SQUARE ERROR
Authorized licensed use limited to: INDIAN INSTITUTE OF TECHNOLOGY KHARAGPUR. Downloaded on August 16,2021 at 05:50:53 UTC from IEEE Xplore. Restrictions apply.
match to a particular command. Thus, it will help actions to be
TABLE 2 more accurately represented when collecting data, leading to
DETAILS OF TESTING DATA easier classification.
Mark 1 2 3 4 5 Moreover, a better approach is not choosing methods for
rotate rotate the feature extraction and classification separately, but
Action drop lift right left neural combining them, which means choosing features which
amount optimizes the classifier’s objective. The fixed-point ICA
among maybe a good method to extract features of EEG signals, but
testing data 4 3 6 3 4 these ICA signals maybe not good to be used as the input to
MLP. Because MLP is sensitive to overtraining especially
with noisy data, so a good deal of care must go into the
selection of specific architectures and regularization.
REFERENCES
[1] Blankertz, Benjamin, Guido Dornhege, et al. Boosting Bit Rates and
Error Detection for the Classification of Fast-Paced Motor Commands
Based on Single-Trial EEG Analysis. IEEE Trasactions on Neural
Systems and Rehabilitation Engineering. 11.2 (2003): 127-31. Print.
[2] Shenoy, Pradeep, Matthias Krauledat, et al. "Towards adaptive
classification for BCI." Journal of Neural Engineering. 3. (2006): R13-
R23. Print.
[3] Cunnigham, Patrick; Lang, Keith; Mearn, Brian; Russel, Lee; and
Sanchez, Stephen, “EEG brain-computer interface project” (2007).
Capstone Design Program: Electrical and Computer Engineering. Paper
2.
[4] Hyvärinen. Fast and Robust Fixed-Point Algorithms for Independent
Component Analysis. IEEE Transactions on Neural Networks
Fig. 12: Testing result 10(3):626-634, 1999.
[5] Hyvärinen and E. Oja. Independent Component Analysis: Algorithms
The last 20 samples in our database are used for testing. and Applications. Neural Networks, 13(4-5):411-430, 2000.
They include 4 actions and a neural status. Details are shown [6] M.D. Eggers and T.S Khon. Learning Algorithms for the Multilayer
in Table 2. Perceptron. Technical Report 813.October 1988.
[7] V.Matic, W. Deburchgraeve and S. Van Huffel. Comparison of ICA
The percentage error for the testing results is shown in Fig. Algorithms for ECG artifact removal from EEG singals. IEEE-EMBS
12. Action 1 to 5 represent drop, lift, rotate right, rotate left Benelux Chapter Symposium. November 9-10, 2009
and neutral, respectively. The testing data involves 4 drop
signals, 3 lift signals, 6 rotate right signals, 3 rotate left signals
and 4 neural signals. The majority of classification errors are
below 30% for these commands, which means the full learning
system can efficiently recognize EEG signals. Lift performs
the best, which has no error in testing. Rotate left is the most
difficult to be recognized, and rotate right is also challenging.
This is likely a result of the similarity between the two
commands. A focus on left and right rather than rotation might
produce more distinct features.
VI. CONCLUSIONS
In a summary, the new implementation of the BCI system
addressed here has proven to be effective for identifying
actions from the EEG brainwave signals. It will enhance the
successful controlling rate to the robotic arm after converting
these Matlab code into C++ and adding them to the main
control file CytonControl.cpp. Future work involves acquiring
more EEG data and adding to the database for training and
testing the MLP network. At the same time, the quality of
original EEG data should be improved. Subjects can practice
using consistent thoughts for control signals by using the
software provided with the Emotiv system. By running a demo
program or practicing manipulating the cube with the
Cognitive suite before collecting original data, users can
practice thinking of consistent commands. This will allow
users to get accustomed to thinking of the same thought to
Authorized licensed use limited to: INDIAN INSTITUTE OF TECHNOLOGY KHARAGPUR. Downloaded on August 16,2021 at 05:50:53 UTC from IEEE Xplore. Restrictions apply.