Spiking Neural Network Vs Multilayer Perceptron: Who Is the Winner in the Racing Car Computer Game
Total Page:16
File Type:pdf, Size:1020Kb
Soft Comput (2015) 19:3465–3478 DOI 10.1007/s00500-014-1515-2 FOCUS Spiking neural network vs multilayer perceptron: who is the winner in the racing car computer game Urszula Markowska-Kaczmar · Mateusz Koldowski Published online: 3 December 2014 © The Author(s) 2014. This article is published with open access at Springerlink.com Abstract The paper presents two neural based controllers controller on-line. The RBF network is used to establish a for the computer car racing game. The controllers represent nonlinear prediction model. In the recent paper (Zheng et al. two generations of neural networks—a multilayer perceptron 2013) the impact of heavy vehicles on lane-changing deci- and a spiking neural network. They are trained by an evolu- sions of following car drivers has been investigated, and the tionary algorithm. Efficiency of both approaches is experi- lane-changing model based on two neural network models is mentally tested and statistically analyzed. proposed. Computer games can be perceived as a virtual representa- Keywords Computer game controller · Spiking neural tion of real world problems, and they provide rich test beds network · Multilayer perceptron · Evolutionary algorithm for many artificial intelligence methods. An example which can be mentioned here is successful application of multi- layer perceptron in racing car computer games, described for 1 Introduction instance in Ebner and Tiede (2009) and Togelius and Lucas (2005). Inspiration for our research were the results shown in Neural networks (NN) are widely applied in many areas Yee and Teo (2013) presenting spiking neural network based because of their ability to learn. controller for racing car in computer game. This study has Controllers for various devices are examples of their suc- shown that cars controlled by evolved spiking neuron mod- cessful application. In the context of this paper the project els could perform well and they demonstrated sophisticated ALVINN was one of the first fruitful controller based on a driving behaviors. neural network approach. It learns to control a vehicle by The aim of our research was to check whether spiking observing live sensor data as a human drives the vehicle. The neural network based car controller outperforms those based classic multilayer perceptron (MLP) neural network trained on the classic MLP in comparable conditions. The paper dif- using backpropagation method was applied. The project, fers from the approach described in Yee and Teo (2013)in started in early 90-ties. The input to ALVINN were 30 × 32 that, apart from NN weights, parameters of spiking neural images taken by a camera connected to a digitizer. This tech- model are evolved also. Our racing game is built on purpose nique was further developed by other researchers, eg. the of the research referring to the neural based controllers. We paper (Oh et al. 1998) presents application of reinforcement performed also a statistical comparison of the results of both learning. The work (Cao et al. 2007) describes the controller types of controllers. which comprises a MLP and a radial basis function (RBF). The paper consists of six sections. Section 2 presents The MLP network is used to adjust the parameters of the related works. In Sect. 3 a short description of MLP and spiking networks are presented. In Sect. 4 the basis of evo- Communicated by E. Lughofer. lutionary algorithms used to train both types of neural net- works is briefly described. Section 5 presents the details of B · U. Markowska-Kaczmar ( ) M. Koldowski the developed Neural Racing game and methods applied in Wroclaw University of Technology, Wyb. Wyspianskiego 27, Wrocław, Poland the system. The experimental results are shown in Sect. 6. e-mail: [email protected] Summary concludes the paper. 123 3466 U. Markowska-Kaczmar, M. Koldowski 2 Related works In the literature we can find many papers devoted to the con- trollers in games which are based on neural networks. The paper (Charles and McGlinchey 2004) presents a general survey of neural networks applied to computer games. A short survey of neural-based agent approaches in computer games is included in Qualls and Russomanno (2009). These agents have the ability to overcome some of the shortcom- ings associated with implementing classical AI techniques in computer game design. Neural networks can be used in Fig. 1 Feedforward, two layered neural network architecture many diverse ways in computer games ranging from agent control, environmental evolution, to content generation. The allow to use more complex networks. The second generation paper (Togelius and Lucas 2005) describes the evolution of of neural networks was started with backpropagation learn- controllers based on neural networks for racing a simulated ing rule elaboration. It needs a differentiable activation func- radio-controlled car around a track, modelled on a real phys- tion therefore a continuous activation function is necessary ical track. Cardamone et al. (2009) claim that online evolu- in such a model. In order to simulate processes existing in a tionary learning of a fast controller from scratch can effec- human brain in more adequate way spiking neural networks tively improve the performance achieved during the learning were proposed. They can be also trained using the backprop- process. agation method. The evolutionary approach to train NN is Most projects mentioned so far used typical multilayer very useful when there is no possibility to acquire desired perceptron networks that are example of second generation output for a given input pattern, as it is needed in backprop- of neural networks. Spiking neural networks fall into the agation training method. third generation of neural network models, which increase the level of realism in a neural simulation. They are more and 3.1 MLP neural networks more popular in developing controllers for robots (Lee and Hallam 1999; Floreano and Mattiussi 2001; Wang et al. 2008; MLP neural network with the sigmoidal or hiperbolic tan- Huemer et al. 2009; Mitic and Miljkovic 2014). The paper gent activation function is the most popular network in var- (Batllori et al. 2011) describes a sequence of experiments ious applications. It consists of layers of neurons. There are in which a neural network based controller was evolved. no connections between neurons in the same layer. Neurons The task was light-seeking while avoiding obstacles. The between neighboring layers are fully interconnected. Infor- paper (Hagras et al. 2004) proposes adaptive genetic algo- mation is processed from the input layer to the output layer. rithm to train spiking neural network. Bouganis and Shana- The architecture of such a network with one hidden layer is han (2010) present a spiking neural network architecture shown in Fig. 1. that autonomously learns to control a 4 degree-of-freedom Neurons in the input layer distribute information only. robotic arm. As it was mentioned, in our research we were Sometimes they do a specific function, like normalization inspired by the paper of Yee and Teo (2013), but we were or scaling. A typical neuron model in a hidden or an output focused on the comparison of both types of controllers in the layer is presented in Fig. 2. It performs two operations. same environment. First, it calculates the net input by summing up all weighted input signals xi (Eq. 1). 3 Neural networks Information processing performed in artificial neural net- work imitates processes in human brain. When we speak about neural network the following elements are essential: its architecture (the way the neurons are connected), the model of a single neuron and a learning rule. The first model of a nerve cell was proposed by Pitts and McCulloch. It was very simple. A step function was implemented as its activation function, so on its outputs only 0 or 1 was produced. It is the first generation of neural networks. The main problem Fig. 2 The model of a neuron used in the first and the second generation with these networks was a lack of training rule that would of neural network 123 Spiking neural network vs multilayer perceptron: who is the winner in the racing car computer game 3467 networks the current activation level (modeled as some dif- ferential equation) is normally considered to be the neuron’s state, with incoming spikes pushing this value higher, and then either firing or decaying over time. The Izhikevich model is described by differential equations (Eqs. 3, 4 and expres- sion 5). dv = 0.004v2 + 5v + 140 − u + I (3) dt du = a(bv − u) (4) dt v ← c if v ≥ 30 mV then (5) Fig. 3 Hyperbolic tangent as an example of the activation function in u ← u + d the MLP where a, b, c, d are parameters of the model. They are net = xi wi . (1) explained in the Fig. 4 (Izhikevich 2003). I is the neuron current, v is the potential of neural membrane and u is the Next, the activation function f produces the output y as fol- variable which affects membrane reset. When the potential lows: reaches 30 mV, v and u variables are going to change accord- y = f (net). (2) ing to the expression 5. A proper choice of the parameters a, b, c, d is crucial for modeling and for successful application In our system hyperbolic tangent was implemented as the of the model. Various coding methods exist for interpreting activation function. The function is presented in Fig. 3. the outgoing spike train as a real-value number, either rely- Training of neural network relies on iteratively adjust- ing on the frequency of spikes, or timing between spikes, to ing weights. The most popular neural network training— encode information. backpropagation method, assumes that for each input the Architecture of a spiking neural network can be diverse. desired output is defined and the error between current output In the Neural Racing system the feedforward network archi- and desired one is the basis for weight change.