# Retinal Vessel Segmentation Using Math-Inspired Metaheuristic Algorithms
## 2 Materials and Methods
### Generalized Normal Distribution Optimization Algorithm  
The basic philosophy of the GNDO algorithm is to optimize the position of each individual in the population based on the generalized normal distribution curve. The GNDO algorithm has a very simple structure, consisting of only two control parameters. The GNDO algorithm performs local exploitation and global exploration phases according to the current and the mean positions of the individuals on a constructed generalized normal distribution model. This algorithm was proposed by [PERSON] et al. in 2020 as an effective math-inspired metaheuristic algorithm, in terms of its efficiency and accuracy [5].  
Detailed pseudo-code of the GNDO algorithm is given as follows:  
In the GNDO algorithm, \(l_{j}\) and \(u_{j}\) are the lower and upper boundaries of the \(j^{th}\) design problem, respectively; the \(rand\) operator produces random numbers in the interval of [0, 1]; and \(D\) represents the dimension of the problem.  
Randomly create an initial population by, \(x_{i,j}^{t}=\ l_{j}+(u_{j}-l_{j})\cdot rand,\ \ i=1,\ \ldots,\ N\) and \(j=1,\ \ldots,\ D\)  
Calculate the fitness value of each solution and determine the best solution as \(x_{best}\)  
Cycle = 1  
**WHILE**_Cycle_\(\leq\)_Maximum Cycle_  
**For**\(i=1:N\)  
Produce a random number (\(\alpha\)) in the interval of [0, 1]  
**If**\(\alpha>0.5:\)**Local exploitation strategy**  
Select the current optimal solution \(x_{best}^{t}\) and calculate the mean position \(\mathbf{M}\)  
Compute the generalized mean position \(\mu_{i}\), generalized standard variances \(\delta_{i}\)  
and penalty factor \(\eta\)  
Apply the local exploitation strategy to calculate \(v_{i}^{t}\) and \(x_{i}^{t+1}\)  
**Else: Global exploration strategy**  
Apply the global exploration strategy  
**End if**  
**End for**  
Cycle = Cycle + 1  
**END**  
In the local exploitation strategy, the mean position (M) can be calculated as  
\[M=\frac{\sum_{i=1}^{N}x_{i}^{t}}{N} \tag{14}\]  
In addition, the values of \(\mu_{i}\), \(\delta_{i}\) and \(\eta\) can be calculated as  
\[\mu_{i}\ =\ \frac{1}{3}\ (x_{i}^{t}\ +\ x_{best}^{t}\ +\ M) \tag{15}\]  
\[\delta_{i}\ =\sqrt{\frac{1}{3}\ \left[\ (x_{i}^{t}\ -\ \mu)^{2}\ +\ (x_{best}^{t}\ -\ \mu)^{2}\ +\ (M\ -\ \mu)^{2}\ \right]} \tag{16}\]  
\[\eta\ =\ \left\{\begin{array}{ll}\sqrt{-\log(\lambda_{1})}\cdot\cos(2\pi \lambda_{2}),&\ a\leq b\\ \sqrt{-\log(\lambda_{1})}\cdot\cos(2\pi\lambda_{2}+\pi),&\ otherwise\end{array}\right. \tag{17}\]  
In order to apply the local exploitation strategy, \(v_{i}^{t}\) and \(x_{i}^{t+1}\) can be calculated as  
\[v_{i}^{t}\ =\ \mu_{i}\ +\ \delta_{i}\ +\ \eta\ \ \ \,\ i=1,\ \ldots,\ N \tag{18}\]  
\[x_{i}^{t+1}\ =\ \left\{\begin{array}{ll}v_{i}^{t}\,&\ f(v_{i}^{t})\ <\ f(x_{i}^{t})\\ x_{i}^{t}\,&\ otherwise\end{array}\right. \tag{19}\]  
Finally, the global exploration strategy can be applied according to the following expressions:  
\[v_{1}\ =\ \left\{\begin{array}{ll}x_{i}^{t}\ -\ x_{p1}^{t},&\ f(x_{i}^{t})\ <\ f(x_{p1}^{t})\\ x_{p1}^{t}\ -\ x_{i}^{t},&\ otherwise\end{array}\right. \tag{20}\]  
\[v_{2}\ =\ \left\{\begin{array}{ll}x_{p2}^{t}\ -\ x_{p3}^{t},&\ f(x_{p2}^{t})\ <\ f(x_{p3}^{t})\\ x_{p3}^{t}\ -\ x_{p2}^{t},&\ otherwise\end{array}\right. \tag{21}\]  
\[v_{i}^{t}\ =\ x_{i}^{t}\ +\ \ \ \underbrace{\beta\cdot(\ |\ rand_{s}|\cdot v_{1})}_{ local\ \text{information sharing}}+\underbrace{(1-\beta)\cdot(\ |\ rand_{snd}|\cdot v_{2})}_{ global\ \text{information sharing}} \tag{22}\]  
\[x_{i}^{t+1}\ =\ \left\{\begin{array}{ll}v_{i}^{t}\,&\ f(v_{i}^{t})\ <\ f(x_{i}^{t})\\ x_{i}^{t}\,&\ otherwise\end{array}\right. \tag{23}\]where \(p1\), \(p2\), and \(p3\) (\(p1\
eq p2\
eq p3\
eq i\)) are random integers taken in the interval of [1, N]; \(rand_{snd}\) represents a random number taken from a standard normal distribution; and \(\beta\) is an adjustment parameter with value between 0 and 1.