Artificial Bee Colony

Size: px
Start display at page:

Download "Artificial Bee Colony"

Transcription

1 Artificial Bee Colony Prof. Thomas Bäck Artificial Bee Colony 1

2 Bees and Hive Some of them are social insects like ants, e.g. honey bees Nesting behavior Artificial bee colony algorithm is based on the foraging behavior of honey bees Prof. Thomas Bäck Artificial Bee Colony 2

3 Honey bees foraging Food source (nectar) - In nature, quality of the food source depends on proximity to the nest, richness, the ease of extraction - Simplified as a single quantity for the algorithm Employed foragers: associated with particular food sources - Memory: location information of the food source - Quality of the food source - With a certain probability of sharing the information Prof. Thomas Bäck Artificial Bee Colony 3

4 Honey bees foraging Unemployed foragers: not associated (employed) with any food source - Scouts: randomly searching the environment surrounding the nest for new food sources - Onlookers: waiting for being recruited (food source information from employed bees) - The number of scouts: 5-10% on average Information sharing: collective knowledge - Dancing area - Waggle dance Prof. Thomas Bäck Artificial Bee Colony 4

5 Honey bees foraging Information sharing - Employed foragers share their information with a probability proportional to the quality of the food source - The better the quality, the higher the probability that onlookers will follow it probabilistic selection Prof. Thomas Bäck Artificial Bee Colony 5

6 Waggle Dance Information about the nectar is shared by waggle dance The direction of the waggle dance implies the direction of the food source - Angle of the food source to the sun - Angle of the dance to the upward direction Duration of the dance indicates the distance to the food source - 75ms 100m Prof. Thomas Bäck Artificial Bee Colony 6

7 Waggle Dance Prof. Thomas Bäck Artificial Bee Colony 7

8 Honey bees foraging: Rules At the beginning, a potential forager will start as an unemployed bee. It can take two options: 1. To be a scout and start searching around the nest 2. To be a recruit, watch waggle dances and become an employed bee After harvesting nectar, a employed bee returns to the nest: 1. Abandon the food source if it is exhausted and becomes an unemployed bee. 2. Go to dance area and recruit other unemployed bees 3. Continue foraging without recruitment Prof. Thomas Bäck Artificial Bee Colony 8

9 Honey bees foraging Behaviours S: Scout bee R: recruit, waiting for waggle dance UF: uncommitted follower after abandoning the food source EF1: dance, recruit and return to the food source EF2: return to the food source without recruiting Karaboga, Dervis (2005). An Idea Based on Honey Bee Swarm For Numerical Optimization Prof. Thomas Bäck Artificial Bee Colony 9

10 Towards Artificial Bee Colony Location of the food source (local) optimum of an optimization problem The population is divided into three groups: employed bees, onlookers and scouts. - The first half employed bees - The second half onlookers One employed bee for one (local) optimum Artificial bees take actions based on the simplified foraging rules Prof. Thomas Bäck Artificial Bee Colony 10

11 Towards ABC Initial candidate solutions (food sources) are produced for each employed bees REPEAT - Employed bees search: each candidate solution is improved locally - Onlooker bees search: assign onlooker probabilistically to refine the candidate solutions - Abandon candidate solution: the refinement on some solution is stopped when it can not be improved for a while - Scout bees search: new solutions are randomly sampled to replace the abandoned ones UNITL (termination criteria are not met) D. Karaboga, B. Basturk A powerful and efficient algorithm for numerical function optimization: artificial bee colony (ABC) algorithm, Journal of Global Optimization (2007) 39: Prof. Thomas Bäck Artificial Bee Colony 11

12 ABC: Initialization Employed bees are initialized uniformly in the search space x i = [x i1, x i2,, x in ] : solution vector for employed bee i For i = 1,, μ 1. x ik = LB k + U 0, 1 UB k LB k, 1 k N 2. Evaluate f(x i ) x i LB k, UB k : the lower and upper bound of the k-th dimension in the search space. μ the number of employed bees Prof. Thomas Bäck Artificial Bee Colony 12

13 ABC: Employed bee searching Employed bees search locally around the food source x ik = x ik + U a, a x ik x jk - k, j are randomly selected indices, i j - x i : the new candidate solution - x j : randomly generated solution in the neighborhood of x i - [ a, a]: gives the search range Evaluation: f(x i ) x i Elitist selection: if f(x i ) is better than f(x i ), then keep x i Prof. Thomas Bäck Artificial Bee Colony 13

14 ABC: Recruit the Onlookers Probabilistic selection: roulette wheel selection as in GA: Repeat for λ μ times (the number of onlookers): 1. Select x i with probability: 2. Mutate x ik 3. Evaluate x i p i = f(x i ) m f(x m ) = x ik + U a, a x ik x jk 4. Elitist selection between x i and x i Dynamic allocation of the exploitation resource Prof. Thomas Bäck Artificial Bee Colony 14

15 Dynamic Allocation Onlookers The better the solution, the more exploitation min Employed bees Prof. Thomas Bäck Artificial Bee Colony 15

16 ABC: Abandon Food Source If a candidate solution (food source) cannot be improved over a limit of cycles, it is abandoned. - Stagnation - Abandonment criteria: user-defined Local search failed restart part of the population for more exploration The employed bee who abandons its food source becomes a scout Prof. Thomas Bäck Artificial Bee Colony 16

17 ABC: Scout Search The same method to initialize the employed bees For i in every scouts x ik = LB k + U 0, 1 UB k LB k, 1 k N Random Restart for each stagnated candidate solution Prof. Thomas Bäck Artificial Bee Colony 17

18 ABC Summary In Nature Food sources Quality of the food source Employed bees Scout bees Onlooker bees In Natural Computing (local) optima Fitness value of the optimum local search points Exploration, Restarts Exploitation of local optima Prof. Thomas Bäck Artificial Bee Colony 18

19 Applications: Image Segmentation Image segmentation: locate visual objects and determine the boundary Objective: maximize the total Tsallis Entropy, complicated function Prof. Thomas Bäck Artificial Bee Colony 19

20 Applications: Image Segmentation Original Prof. Thomas Bäck Artificial Bee Colony 20

21 Further Reading Source code: - Prof. Thomas Bäck Artificial Bee Colony 21