Journal of Robotics, Networking and Artificial Life, Vol. 5, No. 1 (June 2018) 41–44______________________________________________________________________________________________________________Improving EEG-based BCI Neural Networks for Mobile Robot Controlby Bayesian Optimization
Takuya Hayakawa and Jun Kobayashi

Department of Systems Design and Informatics, Kyushu Institute of Technology,Kawazu 680-4, Iizuka, 820-8502, Japan
E-mail: jkoba@ces.kyutech.ac.jp
lab.jkoba.net

Abstract
The aim of this study is to improve classification performance of neural networks as an EEG-based BCI for mobile
robot control by means of hyperparameter optimization in training the neural networks. The hyperparameters wereintuitively decided in our preceding study. It is expected that the classification performance will improve if you
determine the hyperparameters in a more appropriate way. Therefore, the authors have applied Bayesian optimization
to training the EEG-based BCI neural networks and achieved the performance improvement.
Keywords: brain computer interface, electroencephalography, neural network, hyperparameters, Bayesianoptimization, mobile robot control

studies, the subjects did not directly imagine desired
behavior of a controlled object.
As an EEG-based BCI for mobile robot control, theauthors are developing a neural network (NN) for EEG
signal classification. In our earlier studies6–8, we
instructed a subject to imagine an arrow representing adesired behavior of a controlled object with closed eyes
for removing visual stimuli unrelated to experiments. In
addition to the experiments with the subjects closed theireyes, we conducted an experiment to confirm open eyes
influence on constructing an EEG-based BCI NN9.
Considering practical use of BCI, actually imagining adesired motion of a controlled object with open eyes
would be a more appropriate way for controlling a mobilerobot. However, none of the constructed NNs achieved
practical performance.
The authors conjectured that one of the reasons forthe insufficient results was due to hyperparametersettings in training the NNs. The hyperparameters wereintuitively set in the preceding studies. It is expected thatthe classification performance will improve if you

1. Introduction
Brain Computer Interface (BCI) is a promisingtechnology that provides means of direct communication
through your brain. Since brain activities bring about
perception, recognition, and sensory-motor functions inhuman beings, BCI based on a state of your brain has
potential to be applicable to support many kinds ofhuman activities. A lot of studies on BCI have used noninvasive brain activity measurement methods, especiallyElectroencephalography (EEG) because of its superior
time resolution and ease of use. Furthermore, portable
and low-cost EEG measurement devices have become
readily accessible lately.
EEG-based BCI have already applied for assistinghandicapped people and augmenting human capability1,2.
R. Single et al. developed a SSVEP-based BCI for
controlling a wheelchair using multi-class SVM3,4. J.
Meng et al. experimentally investigated a noninvasive
BCI for reach and grasp task of robotic arm5. In theseCopyright © 2018, the Authors. Published by Atlantis Press.
This is an open access article under the CC BY-NC license (http://creativecommons.org/licenses/by-nc/4.0/).
41

Journal of Robotics, Networking and Artificial Life, Vol. 5, No. 1 (June 2018) 41–44___________________________________________________________________________________________________________dimensionality reduction. G. E. Hinton and R. R.
Salakhutdinov revealed that AE surpasses Principal
Component Analysis (PCA) for dimensionality
reduction10.
SAE is a way to construct a multilayered NN
avoiding vanishing gradient in backpropagation. As
stated above, an initial multilayered NN is prepared bystacking encoders of pretrained AEs in cascade, and thewhole NN is trained again using the same input signals
and target ones. The last training is called finetuning.

determine the hyperparameters in a more appropriateway. Therefore, the study described in this paper aims at
improving the performance of the EEG-based BCI NNs
for mobile robot control by hyperparameter optimization.
For optimization, the authors adopted Bayesian approachthat optimizes hyperparameters for NN training bydetermining the hyperparameters to be next verified on
the basis of results already checked. In consequence, themethod can find the optimal hyperparameters efficiently.
In this paper, the authors present experiments
introducing Bayesian optimization using the EEG signals
recorded in our previous study. The experimental results
demonstrated
that
Bayesianoptimization
ofhyperparameters improved the classification rate of theEEG-based BCI NNs for mobile robot control.

3. Bayesian Optimization of Hyperparameters
Ahead of training a NN, you must determine someparameters, such as number of layers, number of nodes,
learning rate, and so on, which are called hyperparameter.
The preceding study has not achieved practical
performance of the SAEs for EEG-based BCI probably
because the hyperparameters were intuitively determined.
Optimization of hyperparameters is an essential process
to improve performance of NNs.
One of the methods for hyperparameter optimization
is grid search, in which combinations of hyperparameters
are uniformly arranged in the form of a grid in a
hyperparameter space, all of the parameter combinations
are verified. Therefore, the optimal hyperparameters arefound with a high probability if the grid arrangement in
the hyperparameter space is sufficiently dense. In thecase of high dimensional hyperparameter space, however,it becomes difficult to conduct verification in the dense
grid within a realistic time due to huge number ofhyperparameter combinations. In addition, if some of thehyperparameters have little influence on the performanceof the NN, calculation time for grid search is wasted on
searching in worthless regions of the hyperparameter
space.
J. Bergstra and Y. Bengio have shown empiricallyand theoretically that random search can find optimal
hyperparameters more efficiently than grid search11.
Furthermore, J. Snoek et al. have demonstrated that
Bayesian optimization for hyperparameter selection ofmachinelearning
algorithms
foundoptimalhyperparameters
faster,andoutperformed
hyperparameter selection by a human expert12. The
Bayesian approach determines the hyperparameters to be
next examined on the basis of results already verified.
First, Bayesian optimization randomly selects
hyperparameters and verifies them. Following that, a2. EEG Signal Classification Using Stacked
Autoencoder
This section describes the structure of the multilayered
NNs used in the preceding study9. Stacked Autoencoder(SAE) was employed as an EEG-based BCI NN for
mobile robot control in the study. SAE is a multilayered
NN initialized by stacking encoder layers of pretrained
Autoencoder (AE), which is a three layered NN shown inFig. 1.

Fig. 1. Autoencoder (AE)A typical AE has equal-sized input and output layers,
and a less-sized hidden layer. The whole of AE is trainedin order that it can yield an output signal equal to an input
one. Since the hidden layer has less nodes than the input
layer, significant information is extracted from the input
signal through the encoder part, which is between theinput and hidden layers, for restoring the signal throughthe hidden and output layers; namely AE is a NN for42

Journal of Robotics, Networking and Artificial Life, Vol. 5, No. 1 (June 2018) 41–44___________________________________________________________________________________________________________options; the settings enclosed in parentheses are theoptions chosen in the preceding study9. GPyOpt
optimized the hyperparameters so that false recognition
rate is minimized. The false recognition rate of each SAE
was calculated using 5-fold cross validation.

region where the optimal hyperparameters are likely toexist are estimated from the previous results andpreferentially verified hyperparameter in the region. The
estimation of the region to be examined is made by
maximizing an acquisition function that includes
probability and expected values under the assumptionthat a function to be optimized follows Gaussian process.
In this research, the authors attempted to optimize thehyperparameter of the SAEs for EEG-based BCI for
mobile robot control using GPyOpt13, which is a Python
library for Bayesian optimization.

Table 1. Specifications of computation environment fordevelopment and execution of stacked autoencoders
CPUMemoryStorage
GPUOS

4. Results and Discussion
The authors empirically confirmed effects of Bayesian
optimization for tuning hyperparameters on improving
the classification performance of the SAEs for EEGbased BCI mobile robot control using the EEG signal
dataset obtained in the preceding study. Fig. 2 is aschematic diagram of the apparatus for EEG
measurement experiments conducted in the preceding
study9. In the EEG measurement experiments, twodifferent imagining tasks, named "CLOSED-EYES" and"OPEN-EYES", were given to three subjects as follows.
Intel® CoreTM i7-6800K CPU @ 3.40GHz
16GB (DDR4-2133 4GBx4)
SSD 240GB + HDD 1TB
NVIDIA GeForce GTX1060 6GB GDDR5Ubuntu 16.04 LTS
Table 2. Hyperparameters and options

Hyperparameter
Number of hiddenlayers
Number of nodes in 1st
hidden layer
Number of nodes in 2nd
hidden layer
Number of nodes in 3rdhidden layer
Iteration of pretraining
each AE (epoch)
Iteration of finetuning(epoch)
Dropout 50% in
pretraining AEs
Dropout 50% in
finetuning

CLOSED-EYES: close your eyes and imagine a
specified arrow
OPEN-EYES: watching the mobile robot moving toa certain direction, imagine the robot's motion

Refer to Ref. 9 for the other experimental conditions of
the EEG measurement, such as experimental procedure,
information of the subjects, and so on.

Options (setting value in Ref. 9)
1 ~ 3 (3)250 or 300 (250)
150 or 200 (150)
50 or 100 (100)1000 or 2000 (1000)
5000 or 10000 (10000)
OFF or ON (ON)OFF or ON (ON)

Table 3 and Table 4 show the results obtained in thepreceding study9. Table 5 and Table 6 report theclassification rate percentages of the SAEs calculated inthis study with Bayesian optimization. Compared theupdated results with the previous ones, it is indicated that
we could improve the performance of the SAEs trainedwith the hyperparameters optimized by Bayesianapproach. However, the options of the hyperparameters
given to the optimization algorithm were very restricted.
Therefore, we would consider further improvement to bepossible by revising the hyperparameter options morecarefully.

Fig. 2. Experimental apparatus

Chainer14 (ver. 1.18.0) for implementing the SAEs
and GPyOpt13 (ver. 1.2.0) for Bayesian Optimization
were used in the confirmation experiments. Table 1
shows the computation environment for development
and execution of the SAEs. Table 2 describes thehyperparameters optimized in the experiments and their

5. Conclusion
This paper presented the performance improvement ofthe EEG-based BCI neural networks for mobile robot
control proposed in the preceding study. The authors

43

Journal of Robotics, Networking and Artificial Life, Vol. 5, No. 1 (June 2018) 41–44___________________________________________________________________________________________________________References

introduced Bayesian optimization in order to find thebetter hyperparameters for training the neural networks
and then experimentally confirmed the expected effect ofthe method. The authors will design the appropriate
options of hyperparameters that considerably ameliorate
the classification performance of the EEG-based BCI
neural networks for mobile robot control.

1. A. Kübler et al., Patients with ALS can use sensorimotor
rhythms to operate a brain-computer interface, Neurology
64(10) (2005) 1775–1777.
2. T. P. Luu et al., Gait adaptation to visual kinematicperturbations using a real-time closed-loop brain–computer interface to a virtual reality avatar, J. NeuralEngineering 13(3) (2016).
3. R. Singla et al., Influence of stimuli color on steady-statevisual evoked potentials based BCI wheelchair control, J.
Biomedical Science and Engineering 6(11) (2013) 1050–1055.
4. R. Singla et al., Influence of stimuli color in SSVEP-based
BCI wheelchair control using support vector machines, J.
Medical Engineering & Technology 38(3) (2014) 125–134.
5. J. Meng et al., Noninvasive Electroencephalogram BasedControl of a Robotic Arm for Reach and Grasp Tasks,
Scientific Reports 6(38565) (2016).
6. K. Tomonaga et al., Experiments on classification ofelectroencephalography (EEG) signals in imagination ofdirection using a wireless portable EEG headset, in Proc.
of Int. Conf. on Control, Automation and Systems (Busan,South Korea, 2015), pp. 1805–1810.
7. S. Wakamizu et al., Experiments on Neural Networks withDifferent Configurations for Electroencephalography(EEG) Signal Pattern Classifications in Imagination ofDirection, in Proc. of IEEE Int. Conf. on Control System,
Computing and Engineering (Penang, Malaysia, 2015), pp.
477–481.
8. K. Tomonaga et al., Experiments on Classification ofElectroencephalography (EEG) Signals in Imagination ofDirection using Stacked Autoencoder, J. Robotics,Networking and Artificial Life 4(2) (2017) 124–128.
9. T. Hayakawa and J. Kobayashi, Open Eyes Influence on
Electroencephalography Signals for Constructing Neural
Network Classifiers as Mobile Robot Control BrainComputer Interface, in Proc. of Int. Conf. on Advanced
Mechatronic Systems (Xiamen, China, 2017), ThuM01-03.
10. G. E. Hinton and R. R. Salakhutdinov, Reducing theDimensionality of Data with Neural Networks, Science313 (2006), pp. 504–507.
11. J. Bergstra and Y. Bengio, Random Search for HyperParameter Optimization, J. Machine Learning Research
13 (2012) 281–305.
12. J. Snoek et al., Practical Bayesian Optimization ofMachine Learning Algorithms, in Proc. of Int. Conf. on
Neural Information Processing Systems (Lake Tahoe,Nevada, 2012), pp. 2951–2959.
13. GPyOpt: A Bayesian Optimization framework in Python,
http://github.com/SheffieldML/GPyOpt, 2016.
14. Chainer: A Powerful, Flexible, and Intuitive Framework
for Neural Networks, https://chainer.org/.

Table 3. Classification rate percentages of SAEs trained using
120 samples recorded in CLOSED_EYES without Bayesian
optimization9
Subject

1stday2ndday3rdday4thday5thday

Ave.

A

50.00

54.17

58.33

73.33

85.83

64.33

B

47.50

60.83

61.67

55.83

48.33

54.83

C

31.67

40.00

45.00

66.67

31.67

43.00

Table 4. Classification rate percentages of SAEs trained using
120 samples recorded in OPEN_EYES without Bayesian
optimization9
Subject

1stday2ndday3rdday4thday5thday

Ave.

A

95.00

45.00

52.50

31.67

67.50

58.33

B

60.00

49.17

53.33

25.83

43.33

46.33

C

54.17

30.00

38.33

59.17

25.00

41.33

Table 5. Classification rate percentages of SAEs trained using
120 samples recorded in CLOSED_EYES with Bayesian
optimization
Subject

1stday2ndday3rdday4thday5thday

Ave.

A

55.00

57.50

66.67

79.17

92.50

70.17

B

50.00

70.00

53.33

66.67

54.17

58.83

C

44.17

49.17

51.77

76.67

33.33

51.02

Table 6. Classification rate percentages of SAEs trained using
120 samples recorded in OPEN_EYES with Bayesian
optimization
Subject

1stday2ndday3rdday4thday5thday

Ave.

A

95.83

48.33

45.83

41.67

75.00

61.33

B66.67

57.50

60.83

33.33

43.33

52.33

C

60.00

40.00

49.17

76.67

38.33

52.83

44