<!DOCTYPE article PUBLIC "-//NLM//DTD JATS (Z39.96) Journal Archiving and Interchange DTD v1.0 20120330//EN" "JATS-archivearticle1.dtd">
<article xmlns:xlink="http://www.w3.org/1999/xlink">
  <front>
    <journal-meta />
    <article-meta>
      <title-group>
        <article-title>A Neural Network for Automatic Vehicles Guidance.</article-title>
      </title-group>
      <contrib-group>
        <contrib contrib-type="author">
          <string-name>Alessandro Ghidotti Piovan</string-name>
          <email>alessandro.ghidotti@studio.unibo.it</email>
          <xref ref-type="aff" rid="aff0">0</xref>
        </contrib>
        <aff id="aff0">
          <label>0</label>
          <institution>Universita di Bologna</institution>
          ,
          <country country="IT">Italy</country>
        </aff>
      </contrib-group>
      <abstract>
        <p>The purpose of this work involves the application and the evaluation of a Reinforcement Learning (RL) based approach to address the problem of controlling the steering of a vehicle. The car is required to drive autonomously on unknown tracks without never going out of the way. The problem has been solved by using a simple neural network with two neurons, and according to the ASE-ACE algorithm. The evaluation has been carried out with referring to The Open Racing Car Simulator (TORCS).</p>
      </abstract>
      <kwd-group>
        <kwd>reinforcement learning</kwd>
        <kwd>neural network</kwd>
        <kwd>car simulator</kwd>
        <kwd>automatic vehicle guidance</kwd>
      </kwd-group>
    </article-meta>
  </front>
  <body>
    <sec id="sec-1">
      <title>Introduction</title>
      <p>
        Reinforcement Learning (RL) is a learning paradigm for neural networks based
on the idea of an agent which is placed into a certain environment and it is
required it learns to take proper actions without having any knowledge about
the environment itself. The agent learns by trial and error: an entity called
critic observes the agent's behaviour and punishes or rewards the agent if it
executes respectively wrong or proper actions; these kinds of judgements on the
action taken are said reinforcements [
        <xref ref-type="bibr" rid="ref1">1</xref>
        ]. Thus, the learning process takes place
with the agent beginning to operate into a certain environment with mostly
wrong actions, but taking into account reinforcements provided by the critic,
and eventually changing its behaviour in order to operate correctly.
      </p>
      <p>
        A simple neural model for RL implementation is shown in Fig.1(a) and was
proposed in [
        <xref ref-type="bibr" rid="ref2">2</xref>
        ]. A certain number of state variables sv(t) represent the system
state in some time instant. This state variables array is provided as input for
a decoder which couples it with the corresponding sensorial stimulus xi. The
decoded stimuli are given as input for (i.e. connected to the synapses of) the
two arti cial neurons named Associative Search Element (ASE) and Adaptive
Critic Element (ACE). Any agent's action depends on the control signal y(t)
generated by the ASE. This model distinguishes explicitly external from internal
reinforcement concepts: the former, indicated with extR(t), is the reinforcement
signal e ectively coming from the critic entity; the latter, indicated with intR(t),
is a further and more informative reinforcement coming from the ACE. Notice
that this model is based only on punishments: the critic never rewards the agent.
As the agent's neural network learns the proper behaviour, more and more wrong
actions decrease, and the learning curve's convergence slows down; this happens
because failures grow away more and more from the taken decision over time.
Therefore, the ACE's role is to predict whether there will be a failure as a result
of an action taken in a certain agent-environment context, not providing to the
ASE a \boolean" reinforcement signal, but a ner-graned one which represents
the failure probability in that state. The probability is calculated according to
the extR(t) value (and some other parameters too [
        <xref ref-type="bibr" rid="ref2">2</xref>
        ]), which on the contrary
here is a boolean one. The more the state \dangerous" is, the lower the intR(t)
value is, and vice versa. Thus, the ASE associates a sensorial stimulus with
a control action, and the ACE associates a sensorial stimulus with a failure
probability. Finally, ASE-ACE model is really simple to implement and suitable
for the automatic vehicles guidance problem too.
      </p>
      <p>
        Experiments and evaluations have been carried out by using The Open
Racing Car Simulator (TORCS) [
        <xref ref-type="bibr" rid="ref3">3</xref>
        ]. With respect to this development environment,
the system entity shown in Fig.1(a) is the so said robot, that is the vehicle chosen
for the race.
      </p>
      <p>
        x[
        <xref ref-type="bibr" rid="ref1">1</xref>
        ]
x[
        <xref ref-type="bibr" rid="ref2">2</xref>
        ]
DEC
      </p>
      <p>x[m]
2
2.1</p>
      <p>ACE
ASE
intR(t)
extR(t)
y(t)
sv(t)
(a)</p>
      <p>S
Y
S
T
E
M
(b)
ASE-ACE Applied to the Automatic Vehicles Guidance</p>
      <sec id="sec-1-1">
        <title>The Problem Model</title>
        <p>
          It's required to provide an intelligent controller for the steering actuator of a
vehicle, in such a way that it is able to drive autonomously on any track within
a certain category (i.e., road, dirt, snow, etc.). The problem has been modelled
in a very simple way which can be schematized as follows:
{ The car speed depends on an auxiliary control system, here modeled as a
black-box on which it is not actually possible to act or get information.
{ A set of proximity sensors (i.e. laser range- nders) are installed on the vehicle
and each of them provides the distance from the sensor itself and the nearest
track boundary into its range [
          <xref ref-type="bibr" rid="ref5">5</xref>
          ].
{ The steering control output is given by a real value in the range [ 1; 1];
positive values produce a steering left rotation, a right rotation the negative
ones.
{ The steering control system does not have any kind of knowledge on the
surrounding environment or the physical laws that regulate the car motion.
        </p>
        <p>The aforesaid elements lead to the exclusion of learning paradigms based on
training-set or needing a knowledge-base, since the only information available
according to the model are the proximity sensors output signals. Therefore, a
suitable approach for this problem can be the RL paradigm, just because it does
not need other information than the signals coming from the proximity sensors
to perform both the training and validation phases.
2.2</p>
      </sec>
      <sec id="sec-1-2">
        <title>Sensors and State Decoding</title>
        <p>Since the tracks can have an in nite number of di erent geometrical
characteristics, the choice on the proximity sensors number and their orientation, range,
and resolution must be chosen here in an experimental way. The simple and
quite good con guration used in this work uses only three sensors as shown in
Fig.1(b): the front sensor is oriented as the major axis of the car, while the side
ones have an orientation of respectively 45 relative to the major axis of the
car. The range of the front sensor is up to 100mt and that of the side sensors is
up to 50mt. Notice that range and decoding resolution are key parameters since
the algorithm complexity is proportional to the number of possible states (i.e.
sensorial stimuli) decoded from the sensors input.</p>
        <p>Two non-linear staircase quantization function for the sensors signals were
used, each of them with 5 thresholds: the former with "large" thresholds for
the front sensor, the latter with an higher resolution for the side sensors. The
rationale is the most the car is in the middle of the track and far away from
a turn, the least the state should change; if the car reaches a curve or starts
getting close to the track boundary, the state should quickly change to allow to
the control system to quickly carry out the proper control action.
2.3</p>
      </sec>
      <sec id="sec-1-3">
        <title>Neural Network Output Function</title>
        <p>According to the originally proposed model, ASE used the following non linear
output function to generate the control action.</p>
        <p>y(t) = f
" n</p>
        <p>X wi(t) + noise(t)
i=1
#
(1)
where f (x) = sign(x). The aforesaid output function is not suitable to the
considered problem because it produces fast commands for the robot steering
actuator which correspond to its limit points. This results in a very nervous
\driving style", and the car motion assumes a continuous oscillatory trend even
on straight sections of the track. Furthermore, because of the acceleration
directly handled by the said \black-box", this kind of steering style causes frequent
car spinning, especially outgoing from fast curves. For the vehicle guidance
problem this output function must be replaced with some kind of \smoother" one.
The function chosen here is a sigmoidal function, obtained vertically shifting a
2
zero-mean gaussian cdf with out variance, as shown in Fig.2(a). This choice has
been tested experimentally and it completely eliminated the spinning situations
and reduced a lot the vehicle oscillatory trend due to the control noise. De
nitely, a set of parameters for the ASE-ACE algorithm which work well in this
case are: = 10, = 0:5, = 0:9, = 0:95, = 0:8, out = 0:5, noise = 0:001;
the decoder thresholds are: 4; 6; 8; 12; 16mt and 4; 6; 7; 10; 12mt. The aforesaid
parameters are de ned as follows:
{ and are positive constants which determine the rate of change of the
weights associated with the input pathways for the ASE and the ACE
respectively;
{ 0 &lt; 1 and 0 &lt; 1 are constants which take part in the computation
of the eligibility traces decay rate for the ASE and the ACE respectively;
{ 0 &lt; 1 is a constant which provides for eventual predictions decay in
absence of external reinforcement during the internal reinforcement
calculation.</p>
        <p>
          Such parameters have slightly di erent values if compared with the originally
ones used by the authors for the pole-balancing experiment [
          <xref ref-type="bibr" rid="ref2">2</xref>
          ], except for the
so-said learning rate ( ). In fact, in this steering control application the number
of useful time steps to carry out a trajectory correction should be considerably
more than the pole-balancing case, and therefore it's reasonable to choose a
lower learning rate.
3
        </p>
      </sec>
    </sec>
    <sec id="sec-2">
      <title>Results and Conclusions</title>
      <p>
        The evaluation of the neural network has been carried out in two phases. Firstly
a learning phase in which a totally untrained vehicle starts driving on a set
of \easy" learning tracks. Then, a validation phase where the trained vehicle
tries driving on a set of unknown tracks. The tracks chosen for the rst phase
have many di erent track angles and widths. Cyclically running all the learning
tracks, the neural network learns quite well how to control the steering actuator
of the vehicle, with respect to the di erent possible curves properties of a generic
track. Each iteration refers to the attempt to perform three complete track's laps.
Performing more than one lap leads to speed up the learning curve because the
car always begins a race with a standing start from the middle of the track. If
the rst lap is successfully completed, the car can pass over the start line with
very di erent speed and position. Therefore, after having completed the rst
lap, the car often goes out of the way at the beginning of the second one. The
learning curve obtained during this phase is shown in Fig.2(b), and proofs the
learning phase was really fast through this approach, nearly 80 iterations. As
shown by the simulation results for the ASE-ACE application to the cart-pole
balancing problem [
        <xref ref-type="bibr" rid="ref2">2</xref>
        ], after nearly 100 iterations the neural network was able
to keep the pole balanced for over 500:000 time-steps (i.e. approximately 2.8
hours of simulated real time), which indicated the learning process completion.
Therefore, it is possible to state that the obtained performances are substantially
consistent with the authors' experiment ones.
      </p>
      <p>
        An interesting point is that the learnt driving style favours a central track
position on in the width sense. This behaviour is due to the side proximity
sensors orientation with respect to the major axis of the car and their range: if
the range is smaller, the neural network's state should remain the same within
a certain distance from the middle track line. If the side sensors' orientation
relative angle is smaller, the vehicle tends to carry out some kind of more sporting
trajectories, but with some di culties on sharp curves; on the contrary, if said
angle is greater the vehicle still tends to follow the middle track line, but carrying
out forceful steering where it is useless too. A better driving style could be
obtained by using seven proximity sensors, where the side ones are oriented with
a 30 step from the central one [
        <xref ref-type="bibr" rid="ref4 ref5">4, 5</xref>
        ]. In this case, however, the learning curve
convergence speed should be lower because of the much greater number of states
of the neural network. After the learning phase, the evaluations on the validation
tracks were really good: the vehicle never went out of the way and you could see
a slight improvement of lap times too, as long as it converges to a substantially
constant time. This improvement of the lap times depends on the track chosen,
and although for some tracks there have not been signi cant improvements, the
greatest ones obtained during the experiments have been of nearly 1 second.
      </p>
    </sec>
  </body>
  <back>
    <ref-list>
      <ref id="ref1">
        <mixed-citation>
          1.
          <string-name>
            <surname>Michie</surname>
            ,
            <given-names>D.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Chambers</surname>
            ,
            <given-names>RA.</given-names>
          </string-name>
          :
          <source>BOXES: An experiment in adaptive control Machine intelligence</source>
          Vol.
          <volume>2</volume>
          -
          <issue>2</issue>
          ,
          <issue>137</issue>
          {
          <fpage>152</fpage>
          (
          <year>1968</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref2">
        <mixed-citation>
          2.
          <string-name>
            <surname>Barto</surname>
            ,
            <given-names>A.G.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Sutton</surname>
            ,
            <given-names>R.S.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Anderson</surname>
            ,
            <given-names>C.W.</given-names>
          </string-name>
          :
          <article-title>Neuronlike adaptive elements that can solve di cult learning control problems</article-title>
          .
          <source>IEEE Transactions on Systems, Man, &amp; Cybernetics</source>
          , (
          <year>1983</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref3">
        <mixed-citation>
          <article-title>3. The open racing car simulator website</article-title>
          , http://torcs.sourceforge.net/
        </mixed-citation>
      </ref>
      <ref id="ref4">
        <mixed-citation>
          4.
          <string-name>
            <surname>Loiacono</surname>
            ,
            <given-names>D.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Togelius</surname>
            ,
            <given-names>J.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Lanzi</surname>
            ,
            <given-names>P.L.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Kinnaird-Heether</surname>
            ,
            <given-names>L.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Lucas</surname>
            ,
            <given-names>S.M.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Simmerson</surname>
            ,
            <given-names>M.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Perez</surname>
            ,
            <given-names>D.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Reynolds</surname>
            ,
            <given-names>R.G.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Saez</surname>
            ,
            <given-names>Y.</given-names>
          </string-name>
          :
          <article-title>The wcci 2008 simulated car racing competition</article-title>
          .
          <source>Computational Intelligence and Games</source>
          ,
          <year>2008</year>
          . CIG'08. IEEE Symposium On,
          <volume>119</volume>
          {
          <fpage>126</fpage>
          (
          <year>2008</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref5">
        <mixed-citation>
          5.
          <string-name>
            <surname>Cardamone</surname>
            ,
            <given-names>L.</given-names>
          </string-name>
          :
          <article-title>On-line and O -line Learning of Driving Tasks for The Open Racing Car Simulator (TORCS) Using Neuroevolution</article-title>
          .
          <source>Politecnico di Milano</source>
          ,
          <year>2008</year>
        </mixed-citation>
      </ref>
    </ref-list>
  </back>
</article>