6. neural network based path planning algorithm

6. NEURAL NETWORK BASED PATH PLANNING ALGORITHM
6.1
INTRODUCTION
In previous chapters path planning algorithms such as trigonometry based path
planning algorithm and direction based path planning algorithm were developed
which belongs to the category of conventional or traditional path planning
methods. The conventional methods work in a sequential way, which can
perform only one task at a time, is performed. These methods functions logically
with the set of rules and calculations. The conventional method learns by rules.
On the other hand neural network based methods have the ability of processing
things in a parallel way and do many things at once. The neural networks will
learn by example. While conventional methods can be programmed using any
high level language, the neural networks can be self programmed. A sensor
based navigation scheme which makes use of a global representation of the
environment by means of self organizing or Kohonen network is presented in
[68]. A neural map which offers a promising alternative to the distance transform
and harmonic function methods for both global and local navigation is presented
in [69]. A neural network model learned from human driving data, introduced to
model obstacle avoidance through dense areas of obstacles is presented in [70],
and is tested in different scenarios, and compared using cross validation to
determine the optimal network structure. A method of construction of a collision
free path for moving a robot among obstacles based on two neural networks is
presented in [71]. The path planning of a mobile robot by using a modified
Hopfield neural network is presented in [77]. A collision avoidance scheme is
proposed in [80] for a multiple robot system. Based on the above works a neural
network based path planning algorithm is developed based on the parallel
distributed neural network model in order to extinguish fire in both types of
environment, i.e., environments with and without obstacles.
6.2
NEURAL NETWORKS
6.2.1
A SIMPLE NEURON
An Artificial Neural Network (ANN) is a mathematical model inspired
by structure as well as the functional aspects of biological neural networks [146].
ANNs have been employed in various areas such as computing, medicine,
engineering, economics, and many others. ANNs are composed of a number of
simple computational elements called neurons, organized into a structured graph
topology made out of several consecutive layers and are interconnected through
a series of links, called the synaptic weights. Synaptic weights are often
associated with variable numerical values, which can be adapted so as to allow
the ANN to change its behavior based on the problem being tackled. A simple
neuron with a single R-element input vector is shown in Figure 6.2.1.
P1
W1, 111
o
n
P2
∑
F
...
.
PR
.
b
W1,R11
Figure 6.2.1 Simple neuron
Here the individual element inputs
p1,p2,...,pR
are multiplied by weights
w1,1,w1,2...w1,R
and the weighted values are given as input to the summing junction. Their sum is
simply Wp, the dot product of the (single row) matrix W and the
vector p.
6.2.2
ARCHITECTURE OF NEURAL NETWORKS
The Architecture of Neural Networks can be classified into
a.
Feed forward neural network
b.
Feed backward neural network
These network architectures can be either simulated using software
or implemented using hardware.
a.
Feed-forward neural network
Feed-forward ANNs allow signals to travel only in one direction i.e.,
from the input to the output. There is no feedback in the feed forward network;
i.e., the output of any layer does not affect that same layer. Feed forward neural
network is shown in Figure 6.2.2. Feed-forward ANNs tend to be straight-forward
networks that associate inputs with outputs. They are widely used in pattern
recognition. This type of organization is also referred to as bottom-up or topdown. Feed forward networks are static networks in the sense, that given an
input value they produce only one set of output values not a sequence of values.
Feed forward networks are memory less networks in the sense, that the output of
a feed forward network is not dependent on the previous state of the network.
Figure 6.2.2 Feed forward neural network
b.
Feedback neural network
Feedback networks can have signals travelling in both directions by
introducing loops in the network. Feed backward neural network is shown in
Figure 6.2.3. Feedback networks are very powerful and can get extremely
complicated. Feedback networks are dynamic in the sense, which their state
changes continuously until they reach an equilibrium point. They remain at the
equilibrium point until the input changes and a new equilibrium needs to be
found. Feedback networks are also referred to as interactive or recurrent
networks. The term recurrent is often used to denote feedback connections in
single-layer organizations
Figure 6.2.3 Feed backward neural network
6.2.3
LEARNING IN NEURAL NETWORKS
All learning methods used for adaptive neural networks can be
classified into two major categories:
a.
a.
Supervised learning
b.
Unsupervised learning
Supervised learning
In supervised learning, both the inputs and outputs are provided. The
network then processes the inputs and compares the resulting outputs against
the desired outputs. Errors are then propagated back through the system,
causing it to adjust the weights, which control the network. This process occurs
again and again, and the weights are continually changed till convergence. The
set of data, which enables the training, is called the "training set." During the
training of a network, the same set of data is processed many times, as the
connection weights are ever refined. An important issue concerning supervised
learning is the problem of error convergence, which is the minimization of error
between the desired and the computed unit values. The aim is to determine a set
of weights which minimizes the error. One well-known method, which is common
to many learning paradigms, is the least mean square (LMS) convergence.
b.
Unsupervised learning
In this type, the network is provided with inputs, but not with the
desired outputs. The system itself must then decide what features it will use to
cluster the input data. This is referred to as self-organization or adaptation.
These networks use no external influences to adjust their weights. Instead, they
monitor their performance internally. These networks look for regularities or
trends in the input signals, and make adaptations according to the function of the
network. Even without being told whether it's right or wrong, the network still must
have some information about how to organize itself. This information is built into
the network topology and learning rules. An unsupervised learning algorithm
might emphasize cooperation among clusters of processing elements. In such a
scheme, the clusters would work together. Examples of unsupervised learning
are hebbian learning and competitive learning.
Human neurons are different from the artificial neurons in that the
aspect of learning concerns the distinction or not of a separate phase, during
which the network is trained, and a subsequent operation phase. We say that a
neural network learns off-line, if the learning phase and the operation phase are
distinct. A neural network learns on-line if it learns and operates at the same
time. Usually, supervised learning is performed off-line, whereas unsupervised
learning is performed on-line.
6.2.4
TRANSFER FUNCTION
The result of the summation function is transformed into an output
through an algorithmic process, known as the transfer function. In the transfer
function the summation can be compared with some threshold to determine the
neural output. If the sum is greater than the threshold value, the processing
element generates a signal, and if it is less than the threshold, no signal is
generated. Both types of responses are significant. The transfer function is
classified into:
a.
a.
linear transfer function
b.
threshold transfer function
c.
sigmoid transfer function
Linear transfer function
For linear units, the output activity is proportional to the total
weighted output. Linear transfer function is shown in Figure 6.2.4.
Figure 6.2.4 Linear transfer function
b.
Threshold transfer function
For threshold units, the outputs are set at one of two levels,
depending on whether the total input is greater than or less than some threshold
value. Threshold transfer function is shown in Figure 6.1.5.
y
1
0
T
x
Figure 6.2.5 Threshold transfer function
c.
Sigmoid transfer function
For sigmoid units, the output varies continuously but not linearly as
the input changes. Sigmoid units bear a greater resemblance to real neurons
than do linear or threshold units, but all three must be considered as rough
approximations. Sigmoid transfer function is shown in Figure 6.2.6.
0
1
Figure 6.2.6 sigmoid transfer function
6.3
ASSUMPTIONS USED IN THE MODEL
1.
The forest domain is decomposed into M x N grids of square
cells.
2.
The forest domain decomposition into 20 x 20 grids of square
cells is shown in Figure 6.3.1
3.
Each cell in the grid contains an anchor sensor node which
knows the location based on integers.
4.
The actor (Robot) is available at cell 1, which is always the start
cell and the cell in which fire occurs is always the goal cell.
5. Once a fire occurs inside a particular cell, it will be detected by
the sensor placed inside the cell first, and the sensor sends a
message containing the coordinates of the cell to the actor.
Thus, the actor knows both the start and goal cells. Then it uses
the algorithm implemented using the neural network to find a
path.
1
21
41
61
.
.
.
321
341
361
381
2
22
42
62
.
.
.
322
342
362
382
3
23
43
63
.
.
.
323
343
363
383
4
24
44
64
.
.
.
324
344
364
384
...
...
...
...
.
.
.
...
...
...
...
17
37
57
77
.
.
.
337
357
377
397
18
38
58
78
.
.
.
338
358
378
398
19
39
59
79
.
.
.
339
359
379
399
20
40
60
80
.
.
.
340
360
380
400
Figure 6.3.1 Decomposition of the forest using 20 x 20 grids with
coordinates based on integers
6.
Obstacles are static and the size of the obstacle is similar to the
size of the cell.
7.
Two adjacent cells will have obstacles either lengthwise or
breadth wise, but not combined.
8.
Since the actor is available at cell 1, and based on assumptions
6 and 7, only 3 movements are sufficient to navigate the entire
domain. They are (i) UP denoted by 0 (ii) DIAGONAL denoted
by 1 and (iii) LEFT denoted by 2, as shown in Figure 6.3.2,
where CPA denotes the Current position/cell of the Actor.
1
0
2
CPAA
Figure 6.3.2 Directional movements of the actor
6.4
PATH PLANNING ALGORITHM
The actor placed in the cell whose location is 1 uses the algorithm
shown below to estimate the sequence of points which does not contain any
obstacle. Then, it will move through these points to reach the goal cell where the
fire has occurred and start to extinguish it. The algorithm is shown below:
6.4.1
Algorithm for estimating the path
Let s be the start position, g be the goal position and n be the number
of cells in a row or column.
location = 0
Store the start position in the first location of the memory path.
while (s not equal to g)
{
location =location +1
if ((absolute value (s-g)) mod (n+1) = 0) then
if (location s+n+1 contain obstacle) then
{
{
Check up move cell; i.e., s+n and left move cell s+1
If (both cells do not contain an obstacle or left move cell contains an
obstacle) then
{
s = s+n
}
If (up move cell only contains an obstacle) then
{
s = s +1
}
}
else
{
s = s + n+1
}
}
else if ((absolute value (s-g)) mod n = 0) then
{
if (location s+n contain obstacle) then
{
Check diagonal move cell; i.e., s+n+1 and left move cell s+1
If (either cells do not contain obstacle or left move cell contains
an obstacle) then
{
s = s+n+1
}
If (diagonal move cell only contains obstacle) then
{
s = s +1
}
}
else
{
s=s+n
}
}
else
{
if (location s+1 contain obstacle) then
{
Check up move cell; i.e., s+n and diagonal move cell s+n+1
If (both cells do not contain an obstacle or up move cell contain
obstacle) then
{
s = s+n+1
}
If (diagonal move cell only contains obstacle) then
{
s=s+n
}
}
else
{
s= s + 1
}
}
Store the point s in location
}
6.4.2
Parallel distributed neural network model:
The parallel distributed neural network model is shown in Figure
6.4.2. It uses 3 neurons which take two inputs cell s multiplied by the weight and
bias and sums them. It uses reinforcement learning; i.e., the network is designed
in such a way that each time the best next move will be selected out of three
possible moves. The move selected means it is rewarded, and moves not
selected mean they are punished. The weights used in the model are binary
weights and takes the value of either 0 or 1.The weight will be calculated for each
neuron separately using the formula shown below:
w1 =
1
if ((abs(s-g)) mod (n+1) = 0)
0
other wise
w2 =
w3 =
1
if ((abs(s-g)) mod n = 0)
0
other wise
1
0
if (((abs(s-g)) mod (n+1)! = 0) && ((abs(s-g)) mod n! = 0))
other wise
abs(x) is a function which takes an integer argument x, which can be either
positive or negative, and returns a positive value of the argument
n+1
∑
W1
s = o, store s
AF1
No
n
W2
s
∑
AF2
∑
O
‘o’ has
obstacle
1
W3
Yes
∑
AF3
Check for next cells
without obstacle and
assign to s. store s
Figure 6.4.2 Parallel distributed neural network model
where
s
-
the starting cell in the first iteration and it is the next
sequence of cells where the actor has to move,
calculated in the next iterations.
g
-
it is the goal cell where the fire has occurred.
n
-
the number of cells in a row or column of the
decomposed forest domain.
w1, w2, w3
-
AF1,AF2,AF3 -
weights connected to the neurons
Activation functions for neurons 1, 2 and 3
respectively
o
-
Net output of the Activation functions summed
together.
The output of each neuron is calculated as follows:
Output of neuron1 =
Output of neuron2 =
Output of neuron3 =
s+n+1
if w1 = 1
n+1
if w1 = 0
s+n
if w2 = 1
n
if w2 = 0
s+1
if w3 = 1
1
if w3 = 0
The weight will vary from iteration to iteration, due to a change in the
value of s in each iteration. The cell g is always constant, and it is not shown
explicitly in the model.
The model also uses 3 activation functions, which are calculated as
shown below:
AF1 =
s+n+1
0
AF2 =
s+n
if output of neuron1 is s+n+1
otherwise
if output of neuron 2 is s+n
0
AF3 =
s+1
0
otherwise
if output of neuron 3 is s+1
otherwise
Initially the input value s is fed to the neural network. It is assumed
that g is available as an environment variable, as it is constant. The weight will be
calculated for each neuron separately. The output of each neuron is fed as input
to the activation function. The net value of three activation functions decides
which move is selected. Then the selected move is tested for the presence of an
obstacle. If there is no obstacle in the cell selected for the next move, then stores
the cell number and assigns the cell number to s. If any obstacle is present in the
cell selected for next move, then the two cells obtained using the remaining two
movements will be checked for obstacles.
If anyone cell is free (definitely one cell will be free because of the
assumptions of the shape of the obstacles) then store the cell number in the
memory and assign the cell number to s. The process is repeated with the new s
till the cell number of s is the same as that of cell g. The actor will use the
sequence of cell numbers stored in the memory to reach the cell where the fire
has occurred, and extinguish it by suitable means once the computation of the
path using the cell numbers is complete.
6.5
Simulation Results
In this work the forest domain is considered as a grid decomposed
into m x n cells based on integer values. The developed model is assumed to
work with single instance of fire occurrence, since for the entire forest domain the
assumption is only one actor is available.
The path planning algorithm
developed is based on the parallel distributed neural network model for the actor
in order to extinguish fire in both types of environment, i.e., environments with
and without obstacles. The software java is used for simulation purposes. The
algorithm was implemented on a 20 x 20 grid and was executed for 100 times.
To test the effectiveness of the proposed algorithm, the fire is created in various
cells by varying start and end coordinates including all the quadrant regions,
horizontal lines and vertical lines. The number of obstacles is also varied. This is
achieved by properly designed test cases. The test cases are designed in such a
way that 123 statements, 6 independent paths and 1 loop in the program get
executed at least once. The actor is represented by a green square located at
the top left corner, the cells containing obstacles are represented using black
color, and the cell where the fire occurs is shown in red, and a line in red color
shows the path planning of the actor to travel and reach the target area to
extinguish the fire. The simulated results are shown in Figures 6.5.1 and 6.5.2
Figure 6.5.1 Environment without obstacles
Figure 6.5.2 Environment with Obstacles