Professional Documents
Culture Documents
Competition
Evolution
Reproduction
Learning
Swarming
Communication
Soft Computing Models
Components of SC includes
• Fuzzy Logic (FL)
• Artificial Neural Network (ANN)
• Evolutionary Computation (EC) - based on the origin of the species.
• Evolutionary Algorithm (EA): Copying ideas of Nature
• Swarm algorithm or Swarm Intelligence (SI) : group of species or
animals exhibiting collective behavior.
• Hybrid Systems
Neural networks ties with genetics “branch of biology that deals with the heredity
and variation of organisms”[3].
Learning algorithm gives the inputs ,adjust the weights to produce the required
output.
ANN’s are algorithms for optimization & learning based loosely on concepts
inspired by the nature of the brain.
Two-layer feed forward network
Just as individuals learn differently, neural network have different learning rules.
Learning may be Supervised or Unsupervised.
Supervised learning requires that when the input stimuli are applied, the desired
output is known a priori.
The most popular algorithm for adjusting weights during the training phase is
called back propagation of error.
• Feed-forward neural network is the simplest form of an ANN
H1
W1,1
X1
W2,1 W1,1
W 1,2 H2 W2,1 O
X2 W 3,1
W2,2 W1,3
H3
W2,3
Error correction learning
Error correction learning used with supervised learning is the technique of
comparing the system output to the desired output value and using that
error to direct the training.
The most popular learning algorithm for use with error correction learning
is the back propagation algorithm(BP).
The delta rule is often utilized by the most common class of ANNs called
back propagation neural networks.
Gradient Decent Optimization
A gradient descent based optimization algorithm such as BP can be used to adjust
connection weights in the ANN iteratively in order to minimize the error.
It then sees how far its answer was from the actual one and makes an appropriate
adjustment to its connection weights[2].
In p u t
D e s ir e d
O u tp u t
Limitations
Neural networks are used for solving a variety of problems but they still have
some limitations. One of the most common is associated with neural network
training.
Another difficulty is related selecting an optimal topology for the neural network.
The architecture of the network often determines the success or failure of the
application, usually the network architecture is decided by trial and error .
There is a great need for a method of automatically designing the architecture for a
particular application.
Both the network architecture and the connection weights need to be adapted
simultaneously or sequentially.
Thus EC methodologies have been applied to evolve the network weights, the
network topology.
Evolutionary Computation -EC
Evolutionary Computation (EC) refers to computer-based problem solving
systems that use computational models of evolutionary process.
GA’s are algorithms for optimization and learning based loosely on several
features of biological evolution[3].
11. end-do
Genetic Algorithms (II)
Population of
individuals or alternative
(feasible) solutions
Next generation
Evaluate individuals
of
on their fitness
individuals
a l
i
t i on
n
e re uct
i ffSelect
od individuals
Arbitrarily change pr
D ebased on fitness
R
some characteristic
tio n for subsequent mating
ia
arV
i c
n et
Ge Select individuals Heredity Mating pool of
& exchange charac- “fitter”
teristics to create individuals
new individuals
Genetic Algorithms (IV)
Basic Tasks
Evaluation
The purpose is to bias the mating pool (those who can pass on their
traits to the next generation) with fitter individuals
1001101 1001111
1100101
1100111
Genetic Algorithms (VII)
Mutation
1001101 1000101
Components of a GA
A problem to solve…..
• Encoding technique :Representation of individuals (gene, chromosome)
GA approach:
• Representation: binary code, e.g. 01101 13
• Population size: 4
• Random initialization
Initial population
Encoding:
• code the decision variable ‘x’ into a finite length string. Using a five-bit
generated:
1 12 01100
2 25 11001
3 5 00101
4 19 10011
Fitness evaluation
Objective function
• Calculate the fitness or objective function for each individual.
• This is obtained by simply squaring the ‘x’ value, since the given function is f(x) =
x2.
Probability of selection :
Compute the probability of selection as follows:
The expected count gives an idea of which population can be selected for further processing in the
mating pool.
String2 (25)
54.11%
be 1.
With string 2 occupying 54.11% of the Roulette wheel, it has a fair chance of being selected more than
On the other hand, string 3 has the least probability percentage of 2.16%, so their occurrence for next
String 4 with 31.26% has at least one chance for occurring while Roulette wheel is spun, thus its actual
count is 1.
X value Mating pool
String #
2 25 11001
2 25 11001
4 19 10011
Crossover
Crossover operation is performed to produce new offspring (children)
The crossover point is specified and based on the crossover point (chosen
1 12 0110|0 4 0110|1 13
2 25 1100|1 4 1100|0 24
2 25 11|001 2 11|011 27
4 19 10|011 2 10|001 17
Mutation
Mutation operation is performed to produce new off springs after crossover
operation.
String
TheOffspring
mutation probability
Offspringiscode
assumed Mutation
to 0.001.
Chromosome
Offsprings code after
mutation
Offsprings x value
after mutation
# X value before mutation
1 13 01101 10000 11101 29
Once selection, crossover and mutation are performed, the new population is now ready to be
tested. The population and the corresponding fitness values are now ready for another round
producing another generation. More generations are produced until some stopping criterion is
met.
It can be noted how maximal and average performance has improved in the new population. The population
Example of Genetic Algorithm
Example
Testing GA
• It cannot be said with certainty that the genetic
algorithm has found the global minimum value. Only by
testing the algorithm with analytical benchmark
functions, you can find the algorithm is correct.
• In other cases, you should compare the results with the
laboratory data, or find a way to make sure the answers
are correct. for example, find a way to predicts the order
of magnitude of optimal points.
• Looking at the fitness of the best-found solution so far
can be a good sign, but totally if you have no idea of the
global optimum, let to progress the optimisation until the
rate of improvement is negligible.
Advantages/ disadvantages of GA
• Advantages
– parallelism and solution space is wide
• Disadvantages :
– The problem of finding fitness function
– definition of representation of the problem
– premature convergence occurs
– parameter sensitive
– An effective GA representation and
meaningful fitness evaluation are the keys of
the success in GA applications.
ANN-GA Hybrid
Some randomly generated chromosome made of 8 genes
representing 8 weights for BPN
ANN-GA hybrid
Steps
Advantages/ disadvantages of GA
• Advantages
– parallelism and solution space is wide
• Disadvantages :
– The problem of finding fitness function
– definition of representation of the problem
– premature convergence occurs
– parameter sensitive
– An effective GA representation and
meaningful fitness evaluation are the keys of
the success in GA applications.
Swarm Intelligence
• self organizing
– Positive feedback: Amplification
– Negative feedback: Balancing
– Fluctuations
– Multiple interactions
• Division of labor
Particle Swarm Optimization( PSO) and Artificial Bee Colony(ABC) are widely
used Swarm Intelligence based method.
ABC is inspired by simulation of foraging behavior related to real honey bees and
swarming theory.
Particle Swarm Optimization
Inspired by simulation social behavior Related to bird flocking, fish
schooling and swarming theory:
• All the birds do not know where the food is. But they know how far
the food is in each iteration.
• So what's the best strategy to find the food? The effective one is to
follow the bird which is nearest to the food.
Overview of basic PSO
Particle swarm optimization (PSO) is a population based on stochastic
optimization algorithms to find a solution and then solve an optimization
problem in a search space.
It uses a number of agents (particles) that constitute a swarm moving around in the
search space looking for the best solution.
Each particle keeps track of its coordinates in the solution space which are
associated with the best solution (fitness) that has achieved so far by that particle
pbest and the best value obtained so far by any particle in the neighborhood of
that particle called gbest.
PSO
In PSO, each single solution is a "bird" in the search space called "particle".
• All of particles have fitness values which are evaluated by the fitness function to be
optimized.
All particles have velocities which direct the flying of the particles. The particles
fly through the problem space by following the current optimum particles.
and xi ← xi + vi
Example problem : PSO
ANN weight optimization process using PSO
• Finally, the network is trained using the updated weights and finally the
trained network is used to forecast the groundwater level of the testing set.
• The analysis is being performed for forecasting the groundwater levels for the
different input combinations as identified by all the three well locations. Initially
nine years (2000-2008) of data is considered as the training set and the ground
water level is forecasted for 2009.
•
• a comparison was made
• between the values predicted using the BP and the Hybrid ANN-PSO algorithms.
The forecasted groundwater level
• using ANN and ANN-PSO models during testing for the located wells of the study
area are shown graphically from
• Fig. 3 to Fig. 8.
Artificial Bee Colony
• ABC algorithm is one of the most recently introduced swarm based
optimization algorithm proposed by Karaboga (2005)
• Based on inspecting the behavior of honey bees on finding nectar and sharing
the information of food sources to the bees in the hive.
• Karaboga has described the Artificial Bee Colony (ABC) algorithm based on
the foraging behavior of honey bees for numerical optimization problems.
Behavior of Honey Bee Swarm
• Food Sources: The value of a food source depends on many factors such as its
proximity to the nest, its richness or concentration of its energy, and the ease of
extracting this energy.
• Employed Foragers: Associated with a particular food source which they are
currently exploiting or are “employed” at. They carry with them information about
this particular source, its distance and direction from the nest, the profitability of
the source and share this information with a certain probability.
• The most important part of the hive with respect to exchanging information
is the dancing area.
• An onlooker on the dance floor, probably can watch numerous dances and decides
to employ themselves at the most profitable source.
• The bees evaluate the different patches according to the quality of the food and the
amount of energy usage.
• The first half of the colony consists of the employed artificial bees and the
second half includes the onlookers.
• The number of employed bees is equal to the number of food sources around
the hive.
• The employed bee whose food source has been exhausted by the bees
becomes a scout.
Components of Honey bee swarm
ABC Fitness Evaluation
Employed Bee Phase
Onlooker bee phase
Employed Bee Phase Implementation
Evaluation & soln generation
Pseudocode for Employed bee phase
Generation and selection
Condition for Onlooker bee phase
Onlooker bee phase
Onlooker Bee phase
Pseudocode for OLB phase
Limit
Scout phase
Pseudocode SBP
Selection
Complete pseudocode ABC
Framework of ABC Algorithm
ABC algorithm
• Each cycle of search consists of three steps:
– moving the employed and onlooker bees onto the food sources
– calculating their nectar amounts
– determining the scout bees and directing them onto possible food sources.
• The amount of nectar of a food source corresponds to the quality of the solution.
• Onlookers are placed on the food sources by using a probability based selection
process.
• As the nectar amount of a food source increases, the probability value with which
the food source is preferred by onlookers increases, too.
• The scouts are characterized by low search costs and a low average in food
source quality. One bee is selected as the scout bee.
-Define a limit value within the range [1, (maximum iteration number-1)]
-Update the best position values according to fitness values for all particles
-Choose the best Pbest vector as being Gbest (vector achieved to the minimum cost)
Vi(t + 1) = ωVi(t)+c1r1(Xpbest(i)(t)-Xi(t))+c2r2(Xgbest(t)-Xi(t))
Xi(t + 1) = Xi(t)+Vi(t + 1)
-If a variable inertia weight is used, change it in accordance with the utilized rule
-Control all particles which exceed the parameter ‘limit’, then regenerate the useless ones
End
Hybrid systems
• The combination of knowledge based systems ,neural networks and evolutionary
computation forms the core of an emerging approach to building hybrid intelligent
systems.
• The hybridization of genetic algorithm with other methods like gradient descent
methods will help to achieve balance between robustness and efficiency.
• There has been a great interest in combining learning and evolution with ANN in
recent years.
• A GA-based ANN (ANN-GA) model, a hybrid integration of ANN and GA
algorithms may have better performance by taking advantages of the characteristics
of both of them.
Evolutionary neural networks
• The architecture of the network often determines the success or failures of the
application.
• There is a great need for a method of automatically designing the architecture for a
particular application.
• The GA performs global search capable of effectively exploring large search space
which has been used for optimally designing the ANN parameters including
connection weights connection weights, ANN architectures and input selection.
Integrated Back propagation based genetic
algorithm
BP/GA algorithm
Start: generate random population of ‘p’ chromosomes ( suitable solution
for the problem)
Extraction: extract weights for input-hidden-output layers from each
chromosome x.
Fitness: evaluate the fitness f(x) of each chromosome x in the population by
reciprocating the cumulative error obtained for each input set.
New population : Create a new population by reprating following steps until
the new population is complete.
– selection: select two parent chromosomes from a population according to their fitness
– Crossover: cross over the parents to form new offstring.
– Mutation: with a mutation probability mutate new offspring at each position in
chromosome.
– Acceptance: place the new offspring in the new population
Repeat steps 3 to 5 until stopping condition is met
Test: return the best solution in current population using the test set inputs
and the weights.
Hybrid approach
The original population is a set of N chromosomes which is generated randomly.
• The training set of examples is presented to the network & the sum of squared
errors is calculated.
• The GA attempts to find a set of weights that minimizes the sum of squared errors.
Hybrid approach
• This process is repeated till more or less all the chromosomes converge to
the same fitness value.
THANK YOU
Mutation in weight optimisation
Encoding the network architecture
•
https://nptel.ac.in/content/storage2/course
s/downloads_new/103103164/noc20_ch19
_assigment_5.pdf