# New Evolutionary-Based Techniques for Image Registration
## 3 The Firefly Algorithm  
The Firefly algorithm developed by [PERSON] [20] belongs to a meta-heuristic nature inspired class of algorithms, based on swarm intelligence, being typically used to solve a variety of optimization problems in real-world applications, from project scheduling problems to rich vehicle routing, and from image processing to engineering machining parameters optimization [21; 22; 23; 24]. Let us consider the optimization problem  
\[\underset{x\in D}{\max}F(x) \tag{15}\]  
The firefly algorithm is based on the flashing behavior, bioluminescence or flashing signals, of fireflies and it relies on three idealized rules underlying the mathematical model. First, the intensity of bioluminescence represents an indicator of fitness for the firefly. The brightness of a firefly is influenced by F and it is determined by the landscape of F. The light intensity is proportional to the value of the objective function F. The second rule is based on the attractiveness of the individuals, which is directly proportional to the light intensity. This means that a less bright firefly will move to the brighter one. The brightness of the firefly is directly influenced by the distance between fireflies due to the fact that the air absorbs light. Finally, the last rule states that all fireflies of the swarm are unisexual, therefore they attract one another regardless of gender. The main features of the standard firefly algorithm are the attractiveness, the movement and the distance. The attractiveness of a firefly is proportionally influenced by light intensity, which itself is associated with the objective function and this attractiveness decreases as the distance between individuals increases. From the mathematical point of view, this idea is expressed by the following monotonically decreasing function  
\[\beta(r)\ =\ \beta_{0}e^{-\gamma r^{2}} \tag{16}\]where \(\beta_{0}\) is the attractiveness when the distance between two fireflies is zero (r = 0), \(\gamma\) is the light absorption coefficient controlling the decrease of light intensity, and r is the distance between two fireflies. The movement of a firefly i toward a more attractive, brighter, firefly j is defined by  
\[x_{i}=x_{i}+\beta_{0}e^{-\gamma x_{i}^{2}}\big{(}x_{j}\ -\ x_{i}\big{)}+\alpha \cdot\varepsilon \tag{17}\]  
where \(x_{i}\) represents the current position of firefly i, the second term represents the attraction to the light intensity while \(\varepsilon\) is randomly generated from U\((0,1)\). In the following we refer to a firefly i by its current position, \(x_{i}\). Let n be the number of the fireflies, MaxGeneration the maximum generations, \(\beta_{0}\) the initial attractiveness, \(\gamma\) the light absorption coefficient, and \(\alpha\) controlling the randomness. The standard version of the firefly algorithm is described in the Algorithm 1. ```
1: Randomly generate an initial population \(X_{0}=\ \{x_{1},x_{2},x_{3},\ldots x_{n}\}\)
2: Compute L\({}_{i}\), the light intensity of each \(x_{i}\in X_{0}\); t \(\gets 0\)
3:while (t < MaxGeneration) do
4:for\(\ =\ 1:n\)
5:for\(\ =\ 1:n\)
6:if\(\ L_{j}\ >\ L_{i}\)
7: Move firefly \(x_{i}\) toward firefly \(x_{j}\) using (17)
8:endif
9:endfor
10:endfor
11: Evaluate all candidate solutions and update the light intensity values
12: Rank the fireflies and identify the current best solution
13:\(\ \mathrm{t}\leftarrow\ \mathrm{t}\ +\ 1\)
14:endwhile
15: Rank all fireflies and return the best one
```  
**Algorithm 1** Firefly algorithm  
In most of the cases the \(\alpha\) step is static or linear with its value decreasing from iteration to iteration, each firefly from generation having the same step value. For instance, the parameter \(\alpha\) is updated after each generation by [25]  
\[\alpha_{t}=\ \alpha_{t-1}\cdot\alpha_{\mathrm{damp}} \tag{18}\]  
where \(\alpha_{\mathrm{damp}}\ \in\ (0,1)\). Usually \(\alpha_{\mathrm{damp}}\ \geq\ 0.9\).