Bat algorithm is metaheuristic that can be applied for global optimization. It was inspired by the echolocation behaviour of microbats, with varying pulse rates of emission and loudness
3. • After hitting and reflecting, the bats transform their own pulse into
useful information to explore how far away the prey is.
• The pulse rate can be simply determined in the range from 0 to 1,
where 0 means that there is no emission and 1 means that the bat’s
emitting is their maximum.
4. • Bat sends signal with frequency f.
• Echo signal used to calculate the distance.
B
C1
C2
C3
B
C1
C2
C3
Frequency
Frequency
S1
S2
S3
5. IDEALIZED RULES FOR BAT ALGORITHM
• All bats use echolocation to sense distance and they know the
difference between food/prey.
• velocity “vi”
• at position “Xi”
• with a fixed frequency “f” min ,
• varying wavelength λ
• and loudness A0 to search for prey.
• They can automatically adjust the wavelength of their emitted pulses
and adjust the rate of pulse emission r[0,1], depending on the
proximity of the target.
7. Algorithm: Bat Algorithm
• 1. Initialize Bat population: Xi (i = 1, 2, ..., n)
• 2. Define frequency Fi and velocity Vi
• 3. Initialize pulse rates ri and the loudness Ai
• 4. while t< Maximum iterations do
• 5. update frequency and velocity
• 6. Calculate transfer function values using Equation (4)
• 7. Update Vi, Xi, and Fi using Equations 5 to 7
• 8. if (rand >ri ) then
• 9. Select the global best solution (Gbest) among the available best solutions and with the available Gbest
dimensions modify the dimensions of Xi randomly.
• 10. end
• 11. Generate new solution randomly Equation (8)
• 12. if ((rand <Ai) and (F(Xi)<F(Gbest))then
• 13. Accept the new solutions increase ri and reduce Ai using Equations (9 to 10)
• 14. end
• 15. Find the current Gbest and Rank the best
• 16. end
8. MATHEMATICAL EQUATIONS
• Generating new solutions is performed by moving virtual bats
according to the following equations:
• 𝑓𝑖 = 𝑓 𝑚𝑖𝑛 + 𝑓𝑚𝑎𝑥 − 𝑓 𝑚𝑖𝑛 𝛽
• 𝑣𝑖
𝑡
= 𝑣𝑖
𝑡−1
+ (𝑥𝑖
𝑡
− 𝑥∗) 𝑓𝑖
• 𝑥𝑖
𝑡
= 𝑥𝑖
𝑡−1
+ 𝑣𝑖
𝑡
• Where βЄ[0,1] is a random vector drawn from a uniform distribution.
• X* is the current global best location (solution) which is located after
comparing all the solutions among all the bats.
9. MATHEMATICAL EQUATIONS
• The current best solution according to the equation:
• where δ Є[-1,1] is a random number, while At is the average loudness
of all the best at this time step.
𝑥 𝑛𝑒𝑤 = 𝑥 𝑜𝑙𝑑 +𝛿𝐴 𝑡
10. MATHEMATICAL EQUATIONS
• The loudness can be chosen as any value of convenience as the
loudness usually decreases once a bat has found its prey, while the rate
of pulse emission increases.
11. LOUDNESS AND PULSE EMISSION VS ITERARION
𝐴𝑖
𝑡+1
=∝ 𝐴𝑖
𝑡
𝑟𝑖
𝑡+1
= 𝑟𝑖
0
[1-exp(-𝛾t)]
13. EXAMPLE – SEGMENTATION
• The multilevel threshold problem can be configured as a k-
dimensional optimization problem for optimal thresholds [t1,t2,…tk]
which optimizes an objective function.
• The objective function is determined from the histogram of the image,
denoted as h(i), i = 0,1,2,…L-1, where h(i) represents the number of
pixels having the gray level i.
14. EXAMPLE – SEGMENTATION
• L gray levels in a given image I having M pixels and these gray levels
are in the range {0,1,…L-1}.
• The normalized probability at level i is defined by the ratio:
pi = h(i)/M
16. Algorithm 2: Binary Bat Algorithm
• 1. Initialize Bat population: Xi (i = 1, 2, ..., n) rand(0 or 1) and Vi= 0
• 2. Define pulse frequency Fi
• 3. Initialize pulse rates ri and the loudness Ai
• 4. whilet < Maximum iterations do
• 5. update velocities and adjust frequencies
• 6. Using Equation (11) Calculate transfer function value
• 7. Using Equation (12) update Xi
• 8. if (rand >ri ) then
• 9. Select the global best solution (Gbest) among the available best solutions and with the available Gbest
dimensions modify the dimensions of Xi randomly
• 10. end
• 11. Generate new solution randomly
• 12. if ((rand <Ai) and (F(Xi)<F(Gbest))then
• 13. Accept the new solutions increase ri and reduce Ai using Equations (9 to 10)
• 14. end
• 15. Find the current Gbest and Rank the best
• 16. end
17. COMPARATIVE ANALYSIS
ALGORITHM BASED ON DEFINED BY FEATURES AREA OF
APPLICATION
BAT Echo location
behavior of bat
Pulse rate emission
and loudness
Accurate and
efficient
Engineering design
and classification
FIREFLY Flashing behavior of
firefly
Brightness and
attractiveness
Finds a good solution
in less number
Digital image
processing
CUCKOO SEARCH Brooding of cuckoo Color of eggs Simple
implementation
Nano technology
18. WHY BAT ALGORITHM IS
BETTER?
1. Automatic zooming.
2. Parameter control.
3. Frequency tuning.
4. More number of solutions.
19. ADVANTAGES OF BAT
• Solve a wide range of problems and highly non-linear problems
efficiently.
• It gives promising optimal solutions.
• The loudness and the pulse emission rates essentially provides a
mechanism for automatic control and auto-zooming into region.
• Number of solutions increases in the library and so more accurate
options are available.
20. IMPROVEMENTS REQUIRED
• Bat algorithm converge quickly at the early stage and then the
convergence rate slows down.
• There is no mathematical analysis to link the parameters with
convergence rates.
• It is not clear what the best values are for most application.