1 Introduction

Image segmentation is one of the most important steps in images analysis. It is the process of dividing an image into some meaningful regions. Pixels inside the same region have similar properties. Image segmentation can be regarded as a preprocessing step in many image processing and computer-vision-based applications [1,2,3,4]. In recent years, various image segmentation methods have been proposed such as fuzzy c-mean and its variants [5,6,7], deep convolutional neural networks [8], and graph cut [9]. Among the existing image segmentation methods, image thresholding is one of the most popular techniques due to its superiority in simplicity, robustness, and efficiency [10].

Image thresholding works based on the existing information in the image histogram. The histogram shows the distribution of pixel values. In this method, images could be segmented into different regions using one or more threshold values. Image thresholding is widely used in many applications such as food quality [11], satellite image processing [12], character recognition [13], and medical imaging [14].

Image thresholding techniques are divided into two types of parametric and non-parametric approaches. Parametric approaches assume that each region has a statistical distribution, which endeavors to find an approximation of the parameters of this distribution. Kittler and Illingworth [15] argued that a histogram is a mixture of normal distribution. Then, they tried to find the minimum probability of classification error. In another project, Wang et al. [16] integrated histogram information with the spatial information by using Parzen window technique that estimates the unknown probability density function. Dirami et al. [17] estimated the histogram by a weighted sum of Heaviside functions. They improved their method using an enhanced version of the multilevel set method. Parametric approaches have some disadvantages such as computational complexity, time-consumingness, and changing performance based on the image quality [18].

Non-parametric approaches optimize an objective function. Among different objective functions, entropy criterion has attracted the attentions of many researchers [19]. Pun [20] introduced a new image thresholding method based on entropy. Afterward, the method is corrected by Kapur et al. [21] due to some errors in Pun’s method. In addition, Kapur et al. [21] introduced a new approach based on the entropy of histogram. The remarkable performance of Kapur’s method was studied by the researchers [19, 22, 23] in comparison to other techniques. In [24], researchers reported that the performance of Kapur’s method is superior to other entropy-based criteria on the non-destructive images.

From another perspective, image thresholding techniques can be divided into two groups of bi-level thresholding and multilevel thresholding. Bi-level thresholding segments an image into two classes by selecting one threshold value. The first class shows the object and the second one represents the background. Multilevel thresholding divides an image into several regions. The simplest type of thresholding is bi-level thresholding because it selects only one threshold value. However, this problem gets more complicated when the number of thresholds is increased. In fact, the computational complexity is exponential, which leads to a long computation time by the increase of threshold values.

To overcome this drawback, population-based metaheuristic (P-metaheuristic) algorithms can be used as a powerful approach for solving the optimization problems. The P-metaheuristic algorithms are problem-independent algorithms with stochastic operators. These algorithms improve the population of solutions using an iterative process. First, a population of solutions is generated randomly. Then, a new population is generated using some other operators. Finally, the replacement operators integrate the new population with the old population using some selection operators. This process is stopped when some conditions are satisfied.

Two important common questions are posed concerning all P-metaheuristic algorithms: The representation of solutions and the definition of the objective function. The answer to these questions is related to a particular problem. The representation encodes a solution. It has a fundamental role in problem performance. The objective function assigns each solution to a real value number, which describes the quality of the solution. The objective function has a significant effect on the efficiency of P-metaheuristic algorithms since it directs the search process toward the promising solutions of the search space.

Two main criteria in P-metaheuristic algorithms are diversification and intensification. Diversification refers to finding different promising regions of search space, whereas intensification is the process of searching around the best solutions. These two criteria are in conflict with each other and balancing these two criteria is so important in a P-metaheuristic algorithm.

According to the “No Free Lunch” theorem, there is no best algorithm to solve all optimization problems. As a result, various P-metaheuristic algorithms have been studied for image segmentation. Genetic algorithm (GA) is the most well-known P-metaheuristic algorithm. GA has been successfully applied in image thresholding. Yin [25] proposed a new thresholding algorithm based on GA and a learning strategy. Each chromosome coded as a binary string. In addition, learning strategy could accelerate the movement of chromosomes toward the optimal solution. In another work [26], a three level thresholding algorithm was presented based on probability partition, fuzzy partition, entropy theory, and genetic algorithm. They introduced a new fuzzy entropy using probability analysis. They used GA for finding the optimal combination of fuzzy parameters.

Particle swarm optimization (PSO) is another P-metaheuristic algorithm that is used extensively for image segmentation. Maitra and Chatterjee [27] proposed PSO combined with cooperative learning and comprehensive learning for image thresholding. They applied an entropy-based criterion as the cost function. In another research [28], another variant of PSO, which uses social and momentum components of the velocity equation of PSO, was applied for image thresholding. Between-class variance was applied as the cost function. This algorithm is compared with GA, Gaussian-smoothing method, and symmetry-duality method on two images. Gao et al. [10] applied quantum-behaved PSO for image thresholding. They evaluated it on seven images and compared it with some popular algorithms namely, OTSU, ACO, GA-L, PSO, QPSO, and HCPSO. Two strategies of adaptive inertia and adaptive population were used in another study for PSO based image thresholding [29]. Adaptive inertia helped PSO enhance the search efficiency and convergence speed. Adaptive population assisted PSO to jump out of local optima. They compared the algorithm with GPSO and SGA on 16 images.

In addition to the above-mentioned algorithms, the literature review shows that other P-metaheuristic algorithms have also been applied for image thresholding. Some of the most important ones are differential evolution(DE) [30,31,32], bacterial foraging algorithm (BFA) [33], bat algorithm (BA) [34], artificial bee colony (ABC) [35,36,37], bee mating optimization (BMO) [38], electromagnetism optimization (EO) [39], firefly algorithm (FF) [40], and kinetic theory optimization (KCO) algorithm [41]. Moreover, comparative studies using more than one P-metaheuristic algorithm have been studied by some researchers in the literature. Akay [22] compared the performance of ABC and PSO and showed that ABC algorithm outperforms PSO algorithm when the number of threshold values is greater than two. Hammouche et al. [42] compared six metaheuristic algorithms: GA, PSO, DE, ACO, simulated annealing (SA), and tabu search (TS). The experimental results indicated that GA, PSO, and DE outperform ACO, SA, and TS. In another study, Osuna-Enciso et al. [43] made a comparison among PSO, DE, and ABC. The used objective function was based on the mixture of Gaussian functions.

In recent years, several P-metaheuristic algorithms have been developed to optimize a problem. Some of the most popular of them are whale optimization algorithm (WOA) [44] inspired by the social behavior of the whales, grey wolf optimizer (GWO) [45] inspired by the hunting mechanism of grey wolves, cuckoo optimization algorithm (COA) [46] that mimics unusual egg-laying of cuckoos, biogeography-based optimization (BBO) [47] that simulates biogeography in nature, teaching–learning-based optimization (TLBO) [48] that mimics the impact of a teacher on the students, gravitational search algorithm (GSO) inspired by the law of gravity [49], imperialist competitive algorithm (ICA) [50] inspired by imperialist competition among countries, and cuckoo search (CS) [51] that gets the idea from the breeding behavior of some cuckoo species.

This paper focuses on the performance analysis of the above-mentioned recently developed P-metaheuristic algorithms for image thresholding. For this purpose, image thresholding should be converted into an optimization problem. Entropy is used as the cost function of the optimization problem. In addition, to make a more comprehensive comparison, these algorithms were compared with GA, DE, PSO, BA, FF algorithms.

The rest of this paper is organized as follows: Sect. 2 demonstrates image thresholding using WOA, GWO, COA, BBO, TLBO, GSA, ICA, and CS algorithms. The experimental results will be evaluated and compared in the next section. Finally, this work is concluded in Sect. 4.

2 Multilevel thresholding using WOA, GWO, COA, BBO, TLBO, GSA, ICA, and CS algorithms

In this section, multilevel image thresholding is explained using eight recently developed P-metaheuristic algorithm. In the proposed methods, Image thresholding is considered as an optimization problem. For this purpose, an entropy-based objective function is applied. The block diagram of the proposed methods is shown in Fig. 1. As illustrated in Fig. 1, first, the parameters of the P-metaheuristic algorithms were initialized. These parameters along with the objective function were fed to the P-metaheuristic algorithms. The output of P-metaheuristic algorithms is the optimal thresholding values. Finally, an image can be segmented by using the thresholding values obtained by P-metaheuristic algorithms. The components of the proposed algorithms were explained with more details in the following subsections.

Fig. 1
figure 1

Block diagram of the proposed methods

2.1 The used P-metaheuristic algorithms

This section explains the recently developed P-metaheuristic algorithms. P-metaheuristic algorithms are iterative algorithms to solve optimization problems. These algorithms share some common concepts. All of them use a population of solutions which is initialized with random values. Then, they generate a new population using some operators. Replacement operator carries out a selection using the new and the old populations. This process is stopped when some conditions are satisfied. The general template of P-metaheuristic algorithms is given in Fig. 2. Different P-metaheuristic algorithms have different ways of generation and replacement which leads to different performances.

Fig. 2
figure 2

The general template of P-metaheuristic algorithms

Each P-metaheuristic algorithm has three elements namely representation, objective function, and operators which are explained as follows:

  • Representation: one of the common elements of each P-metaheuristic algorithm is representation that encodes a solution. It is one of the most important characteristics which plays a major role in the efficiency of any P-metaheuristic algorithms.

  • Objective function: it assigns a real value to each solution which shows the quality of a solution. The objective function directs the search process toward the good solutions calculated using the objective function. Hence, a proper objective function can have a significant impact on the performance of P-metaheuristic algorithms.

  • Operators: each P-metaheuristic algorithm has a number of operators to generate new solutions and select solutions for next iteration. Each P-metaheuristic algorithm uses a different strategy to generate new solutions which leads to different performances.

In this paper, eight recently developed P-metaheuristic algorithms were evaluated for image thresholding. The same representation and objective function were applied for all used P-metaheuristic algorithms. The used P-metaheuristic algorithms are whale optimization algorithm (WOA), grey wolf optimizer (GWO), cuckoo optimization algorithm (COA), biogeography-based optimization (BBO), teaching–learning-based optimization (TLBO), gravitational search algorithm (GSA), imperialist competitive algorithm (ICA), and cuckoo search (CS). In addition, these algorithms were compared with five other well-known P-metaheuristic algorithms. In the following, the recently developed P-metaheuristic algorithms will be explained.

2.1.1 Whale optimization algorithm

Whale optimization algorithm (WOA) [44] is one of the latest P-metaheuristic algorithms inspired by the social behavior of the whales. The WOA algorithm consists of three basic operators, which are encircling prey, bubble-net attacking, and searching for prey. These operators are briefly explained below.

2.1.1.1 Encircling prey

This operator updates the position of each agent in the neighborhood of the current best solution. In this operator, the best solution is assumed as the target prey. Then, other search agents (the whales) update their position toward the target prey by the following equations:

$$\overline D =\left| {\overrightarrow C .\overrightarrow {{X^*}} (t) - \overrightarrow X (t)} \right|$$
(1)
$$\overrightarrow X (t+1)=\overrightarrow {{X^*}} - \overrightarrow A .\overrightarrow D$$
(2)

where \(t\) is the current iteration, \(\overrightarrow A\) and \(\overrightarrow C\) are coefficient vectors, \(\overrightarrow {{X^*}}\) is the best solution, and \(\overrightarrow X\) is the position vector of the search agent, | | is the absolute value, and (.) is the element-by-element multiplication.

The vectors \(\overrightarrow A\) and \(\overrightarrow C\) are calculated using the following equations:

$$\overrightarrow A =2\overrightarrow a .\overrightarrow r - \overrightarrow a$$
(3)
$$\overrightarrow C =2.\overrightarrow r$$
(4)

where \(\overrightarrow a\) is reduced from 2 to 0 and \(\overrightarrow r\) is a random vector between 0 and 1.

2.1.1.2 Bubble-net attacking

Bubble-net attacking operator enhances the exploitation of the algorithm. This operator is composed of two parts, and each part is chosen based on a probability of 0.5. These parts are shrinking encircling and spiral updating position, which are briefly explained as follows.

  • Shrinking encircling: it is obtained by decreasing the value of \(\overrightarrow a\) in Eq. 3, which leads to exploration in the early iterations of the algorithm and exploitation in the later iterations.

  • Spiral updating position: this part calculates the distance between the whale and prey (the best position). Then, a spiral equation is achieved to update the current position as follows:

$$\overrightarrow X (t+1)=\overrightarrow {{D^\prime }} .{e^{bl}}.\cos (2\pi l)+\overrightarrow {{X^*}} (t)$$
(5)

where \(\overrightarrow {{D^\prime }}\) is the distance from the search agents to the prey, b is a constant, \(l\) is a random number between −1 and 1, and (.) is the element-by-element multiplication.

One of these two operators, shrinking encircling and spiral updating position, will be selected with a probability of 0.50 as follows:

$$\overrightarrow X (t+1)=\left\{ {\begin{array}{*{20}{l}} {\begin{array}{*{20}{l}} {\overrightarrow {{X^*}} - \overrightarrow A .\overrightarrow D }&{if{ p < 0}{.50}} \end{array}{ }} \\ {\begin{array}{*{20}{l}} {\overrightarrow {{D^\prime }} .{e^{bl}}.\cos (2\pi l)+\overrightarrow {{X^*}} (t)}&{if{ p} \geq {0}{.50}} \end{array}} \end{array}} \right.$$
(6)
2.1.1.3 Search for prey

This operator emphasizes on exploration. A mechanism, based on the variation of the \(\overrightarrow A\) vector, is applied to search the prey. To this purpose, \(\overrightarrow A\) with the values greater than 1 or less than −1 is used to get away from a whale. It is modeled as follows:

$$\overrightarrow D =|\overrightarrow C .\overrightarrow {{X_{rand}}} - \overrightarrow X |$$
(7)
$$\overrightarrow X (t+1)=\overrightarrow {{X_{rand}}} - \overrightarrow A .\overrightarrow D$$
(8)

where \(\overrightarrow {{X_{rand}}}\) is a random position vector selected from the current population, \(\overrightarrow A\) and \(\overrightarrow C\) are coefficient vectors, | | is the absolute value, and (.) is the element-by-element multiplication.

The pseudo code of the WOA algorithm is presented in Fig. 3.

Fig. 3
figure 3

Pseudo code of the WOA algorithm

2.1.2 Grey wolf optimizer

Grey wolf optimizer (GWO) [45] is a new P-metaheuristic algorithm which has attracted a great attention in solving optimization problems [52,53,54]. The GWO algorithm is inspired by the hunting mechanism of grey wolves. Grey wolves live in a hierarchy, which are defined as follows:

  • Alpha: it is the leader who is responsible for decision-making about hunting, sleeping, time to wake, and so on.

  • Beta: they help the alpha in decision-making. Beta is the best alternative to the alpha.

  • Omega: this group plays the role of scapegoat. They are the last group that can eat.

  • Delta: if a wolf is not alpha, beta, and omega, it is called delta.

In the GWO algorithm, the best solution is alpha. Subsequently, the second and the third best solutions are beta and omega. The rest of solutions are assumed delta. The operators of the GWO algorithm are briefly demonstrated below.

2.1.2.1 Encircling prey

Grey wolves encompass the prey during the hunt. The following equations are used for modeling of encircling behavior:

$$\overrightarrow D =\left| {\overrightarrow C .{{\overrightarrow X }_p}(t) - \overrightarrow X (t)} \right|$$
(9)
$$\overrightarrow X (t+1)={\overrightarrow X _p}(t) - \overrightarrow A .\overrightarrow D$$
(10)

where \(\overrightarrow A\) and \(\overrightarrow C\) are two coefficient vectors, \(\overrightarrow X (t)\) is the grey wolf (best solution), \({\overrightarrow X _p}\) is the position vector of the prey, and t is the current iteration. The vectors \(\overrightarrow A\) and \(\overrightarrow C\) can be calculated as follows:

$$\overrightarrow A =2\overrightarrow a .\overrightarrow {{r_1}} - \overrightarrow a$$
(11)
$$\overrightarrow C =2.\overrightarrow {{r_2}}$$
(12)

where \(\overrightarrow a\) is decreased from 2 to 0 and, \(\overrightarrow {{r_1}}\) and \(\overrightarrow {{r_2}}\) are random vectors between 0 and 1.

2.1.2.2 Hunting

The hunt is guided by the alpha and sometimes the beta and the alpha. There is no information about the location of the prey. In the GWO algorithm, it is assumed that the alpha, beta, and delta have more experience about the location of prey and the delta wolves try to update their positions according to alpha, beta, and delta. The following formulas are used for this purpose:

$${\overrightarrow D _\alpha }=|\overrightarrow {{C_1}} .\overrightarrow {{X_\alpha }} - \overrightarrow X |,\;{\overrightarrow D _\beta }=|\overrightarrow {{C_2}} .\overrightarrow {{X_\beta }} - \overrightarrow X |,\;{\overrightarrow D _\delta }=|\overrightarrow {{C_3}} .\overrightarrow {{X_\delta }} - \overrightarrow X |$$
(13)
$${\overrightarrow X _1}=\overrightarrow {{X_\alpha }} - {\overrightarrow A _1}.(\overrightarrow {{D_\alpha }} ),\;{\overrightarrow X _2}=\overrightarrow {{X_\beta }} - {\overrightarrow A _2}.(\overrightarrow {{D_\beta }} ),\;{\overrightarrow X _3}=\overrightarrow {{X_\delta }} - {\overrightarrow A _3}.(\overrightarrow {{D_\delta }} )$$
(14)
$$\overrightarrow X (t+1)=\frac{{\overrightarrow {{X_1}} +\overrightarrow {{X_2}} +\overrightarrow {{X_3}} }}{3}$$
(15)
2.1.2.3 Attacking prey

In order to model the attacking plan to the prey, the value of \(\overrightarrow a\) in Eq. 11 is gradually decreased. It enhances the exploitation of the algorithm.

2.1.2.4 Search for prey

Grey wolves get away from each other to search for the prey. To this end, \(\overrightarrow A\) with random values greater than 1 or less than −1 is used. It leads to deviation of search agents from the prey which increases the exploration of the algorithm.

The pseudo code of the GWO algorithm is presented in Fig. 4.

Fig. 4
figure 4

Pseudo code of the GWO algorithm

2.1.3 Cuckoo optimization algorithm

Cuckoo optimization algorithm (COA) [46] is another P-metaheuristic algorithm inspired by unusual egg-laying of cuckoos. Recently, the COA algorithm has presented a satisfactory performance in many applications [55,56,57]. It is important to note that the COA algorithm is different from cuckoo search (CS) [51]. The components of the COA algorithm are briefly described as follows.

2.1.3.1 Definition of egg laying radius

Cuckoos lay eggs within a maximum distance from their habitat. In the COA algorithm, each cuckoo has a parameter, which is called “Egg laying radius (ELR)”, and is calculated as follows:

$$ELR=\alpha \times \frac{C}{T} \times (h - l)$$
(16)

where \(\alpha\) is an integer constant, C is the number of current cuckoo’s eggs, T is the total number of eggs, h is the upper limit, and \(l\) is the lower limit of variables.

2.1.3.2 Cuckoos’ style for egg laying

In this step, each cuckoo lays eggs randomly in some other host birds’ nests within its ELR. After egg laying, eggs with fewer profits will be destroyed.

2.1.3.3 Immigration of cuckoos

Communities are constructed when young cuckoos grow up. K-means algorithm is used to construct the communities. Then, mean profit value of each community is calculated. The best mean profit value determines the goal point. Other cuckoos move toward the goal point. Each cuckoo moves \(\lambda \%\) of distance between its position and the goal point and has a deviation of \(\phi\) radians.

2.1.3.4 Removing cuckoos in the worst habitats

Because of the population balance of cuckoos, some cuckoos with the best profit values survive while others die.

The pseudo code of the COA is shown in Fig. 5.

Fig. 5
figure 5

Pseudo code of the COA algorithm

2.1.4 Biogeography-based optimization

Biogeography-based optimization (BBO) is a well-known P-metaheuristic algorithm, which simulates biogeography in nature. Like other P-metaheuristic algorithms, each solution (habitat) consists of several components. Each component of the solution vector is called SIV. The quality of each solution is measured with HIS. HIS is analogous to “fitness” in the genetic algorithm. High HIS shows habitats with many species and low HIS refers to habitats with few species. There are two significant operators in this algorithm:

2.1.4.1 Migration

There are emigration and immigration rates for each solution that represent the possibility of information sharing among habitats. Emigration and immigration rates are dependent on the number of species in the habitat such as the linear curves in Fig. 6.

Fig. 6
figure 6

The relationship between emigration and immigration rates and the number of species in the BBO algorithm

The emigration rate of each solution is used to modify each SIV by sharing information within the population. If a given SIV in a given solution S is selected for immigration, then the emigration solution k is chosen based on the emigration rate. Migration can be shown as follows:

$${S_i} \leftarrow {K_j}$$
(17)

where \({S_i}\) is the ith SIV in the solution S and \({K_j}\) is the jth SIV in the solution K.

2.1.4.2 Mutation

Mutation is another operator, which randomly changes SIV. It increases diversification of the algorithm.

The pseudo code of the BBO algorithm is presented in Fig. 7.

Fig. 7
figure 7

Pseudo code of the BBO algorithm

2.1.5 Teaching–learning-based optimization

Teaching–learning-based optimization (TLBO) is a new P-metaheuristic algorithm which is presented competitive results in many applications [58, 59]. The TLBO algorithm mimics the impact of a teacher on students. In this algorithm, each candidate solution is called a student. In addition, the best solution is intended as the teacher. The score is analogous to “fitness” in the genetic algorithm. A good teacher can increase the mean scores in one class. The TLBO algorithm has two phases: teacher phase and student phase. These two phases are clarified below.

2.1.5.1 Teacher phase

Let \({M_i}\) be the mean value of the scores and \({T_i}\) be the teacher at iteration i. \({T_i}\) will try to transfer the mean value of the scores to the new mean, and the new mean is better than the old one. For this purpose, the TLBO algorithm proposes the following formula:

$$Difference\_Mea{n_i}={r_i}({M^*} - {T_F}{M_i})$$
(18)
$${X_{new,i}}={X_{old,i}}+Difference\_Mea{n_i}$$
(19)

where \({r_i}\) is a random number between 0 and 1, \({T_F}\) is a constant, \({M^*}\) is the score of the teacher, \({M_i}\) is the mean scores, \({X_{old,i}}\) is the ith dimension of current solution, and \({X_{new,i}}\) is the ith dimension of the new solution.

2.1.5.2 Student phase

In this step, students communicate with each other to increase their knowledge. A student can learn new contents from other more knowledgeable students. The following formula is used for this purpose:

$${X_{new}}={X_i}+r({X_i} - {X_j})$$
(20)

where \(r\) is a random number between 0 and 1, and, \({X_i}\) and \({X_j}\) are two random students, where \({X_j}\) has a higher score than \({X_i}\).

The pseudo code of the TLBO algorithm is presented in Fig. 8.

Fig. 8
figure 8

Pseudo code of the TLBO algorithm

2.1.6 Gravitational search algorithm

Gravitational search algorithm (GSA) is another well-known recently developed P-metaheuristic algorithm. The GSA algorithm has attracted much attentions in different applications [60,61,62]. It is inspired by the law of gravity. In the real world, all objects attract each other by the gravity force. Each candidate solution is called a mass. Each mass has four characteristics: position, inertia mass, active gravitational mass, and passive gravitational mass. The position of a mass corresponds to a solution, and its gravitational and inertial masses are determined using the fitness function. The GSA algorithm has used two laws for optimization: gravity, and motion. These two laws are explained below.

2.1.6.1 Law of gravity

Each mass attracts other masses. The force acting on mass i from mass j is defined as follows:

$$F_{{ij}}^{d}(t)=G(t).\frac{{{M_{pi}}(t) \times {M_{aj}}(t)}}{{{R_{ij}}+\varepsilon }}(x_{j}^{d}(t) - x_{i}^{d}(t)),$$
(21)

where \(F_{{ij}}^{d}\) is the force acting on mass i from mass j in the dth dimension, \(G\) is the gravitational constant, \({M_{pi}}\) is the passive gravitational mass related to mass i, \({M_{aj}}\) is the active gravitational mass related to mass j, \({R_{ij}}\) is the Euclidian distance between two masses i and j, \(x_{i}^{d}\) is the position of ith mass in the dth dimension, \(x_{j}^{d}\) is the jth mass in the dth dimension, and t is the current iteration.

The total force on mass i in the dimension d is calculated according to the following equation:

$$F_{i}^{d}(t)=\sum\limits_{j=1,j \ne i}^N {ran{d_j}F_{{ij}}^{d}(t)} ,$$
(22)

where \(F_{{ij}}^{d}\) is the force acting on mass i from mass j, N is the number of masses, and \(ran{d_j}\) is a random number between 0 and 1.

The gravitational constant is a reduction constant. It is reduced along with the time to control the search accuracy. Moreover, the inertial mass is calculated by the following equations:

$${m_i}(t)=\frac{{fi{t_i}(t) - worst(t)}}{{best(t) - worst(t)}}$$
(23)
$${M_i}(t)=\frac{{{m_i}(t)}}{{\sum\limits_{j=1}^N {{m_j}(t)} }}$$
(24)

where \({M_i}\) is the inertial mass, \(fi{t_i}\) is the fitness of mass i, worst is the worst fitness among masses, and best is the best fitness among masses.

2.1.6.2 Law of motion

In this step, the new position of a mass is calculated as follows:

$$v_{i}^{d}(t+1)=ran{d_i} \times v_{i}^{d}(t)+a_{i}^{d}(t)$$
(25)
$$x_{i}^{d}(t+1)=x_{i}^{d}(t)+v_{i}^{d}(t+1)$$
(26)

where \(ran{d_i}\) is a random number between 0 and 1, \(v_{i}^{d}\) is the velocity of mass i in the dth dimension, and \(a_{i}^{d}\) is the acceleration of the mass i in the dth dimension. The acceleration is calculated as follows:

$$a_{i}^{d}(t)=\frac{{F_{i}^{d}(t)}}{{{M_{ii}}(t)}}$$
(27)

The pseudo code of the GSA algorithm is presented in Fig. 9.

Fig. 9
figure 9

Pseudo code of the GSA algorithm

2.1.7 Imperialist competitive algorithm

Another P-metaheuristic algorithm studied in this paper is imperialist competitive algorithm (ICA) [50], which mimics imperialist competition among countries. Each solution in this algorithm is called country. The power of a country shows the quality of a solution. The components of the ICA algorithm are presented in the following.

2.1.7.1 Empire establishment

In this step, countries are divided into two categories: imperialists and colonies. The most powerful countries establish imperialists, while the remaining countries are colonies. Each empire has an imperialist and some colonies. Colonies are divided among imperialists based on their power. The number of colonies of an empire is calculated as follows:

$${C_n}={c_n} - \mathop {\max \{ {c_i}\} }\limits_i$$
(28)
$${P_n}=\Bigg| {\frac{{{C_n}}}{{\sum\nolimits_{i=1}^{{N_{imp}}} {{C_i}} }}} \Bigg|$$
(29)
$$N.{C_n}=round\{ {p_n}.{N_{col}}\}$$
(30)

where \({c_n}\) is the cost of nth imperialist, \({C_n}\) is the normalized cost, \({P_n}\) is the normalized power of each imperialist, \({N_{col}}\) is the number of colonies, and \(N.{C_n}\) is the initial number of colonies of nth empire.

2.1.7.2 Assimilation

Assimilation operator transfers colonies toward the imperialist by x units. The variable of x is a random variable with uniform distribution described by the following equation:

$$x \sim U(0,\beta \times d)$$
(31)

where \(\beta\) is a number greater than 1, and d is the distance between the colony and the imperialist.

2.1.7.3 Exchanging the position of the imperialist and the colony

If a colony reaches a better position than that of the imperialist, the position of colony and imperialist will be exchanged.

2.1.7.4 Total power of an empire

The total power of an empire is calculated as follows:

$$T.{C_n}=Cost(imperialis{t_n})+\xi mean\{ Cost({colonies of empir}{{e}_n})\}$$
(32)

where \(T.{C_n}\) is the total cost of nth empire, and \(\xi\) is a positive number less than 1.

2.1.7.5 Imperialist competition

All empires try to occupy colonies of other empires to increase their power. For this purpose, all empires start to compete to possess the weakest colony of the weakest empire. Empires that are more powerful have more chance to possess this colony.

The pseudo code of the ICA algorithm is shown in Fig. 10.

Fig. 10
figure 10

Pseudo code of the ICA algorithm

2.1.8 Cuckoo search

Cuckoo search (CS) [51] is a P-metaheuristic algorithm inspired by the breeding behavior of some cuckoo species. As mentioned previously, the CS algorithm uses a different strategy compared with the COA algorithm. However, both of them mimic the unusual behavior of cuckoos. The CS algorithm uses three rules to optimize a problem: (1) each cuckoo lays an egg which will be dumped in a randomly selected nest, (2) the best nests with the best eggs will be kept to the next iteration, and (3) the number of nest hosts is a constant number in the whole process of search.

In this algorithm, each egg is equivalent to a solution. Each new solution is generated using Eq. 33.

$${x_{new}}={x_{old}}+\alpha \oplus Levy$$
(33)

where \(\alpha\) is the step size, \(Levy\) shows Levy flight distribution, and \(\oplus\) means entry-wise multiplications. A Levy flight is a type of random walk that step length is drawn from a Levy distribution.

After generating a new solution, it will be compared with the old solution. In case the objective value of the new solution is better than the old solution, the new solution will be replaced by the old solution. The pseudo code of the CS algorithm is demonstrated in Fig. 11.

Fig. 11
figure 11

Pseudo code of the CS algorithm

2.2 Representation strategy

The goal of multilevel image thresholding is to find \(m(m \geq 2)\) proper threshold values to segment an image. The output image can be obtained using Eq. 34.

$$\begin{gathered} {M_0}=\{ g(x,y) \in I|0 \leq g(x,y) \leq {t_1} - 1\} \hfill \\ {M_1}=\{ g(x,y) \in I|{t_1} \leq g(x,y) \leq {t_2} - 1\} \hfill \\ {M_i}=\{ g(x,y) \in I|{t_i} \leq g(x,y) \leq {t_{i+1}} - 1\} \hfill \\ {M_m}=\{ g(x,y) \in I|{t_m} \leq g(x,y) \leq L - 1\} \hfill \\ \end{gathered}$$
(34)

where \({t_i}(i=1, \ldots ,m)\) is the ith threshold value, and m is the number of threshold values.

Representation is one of the main components of each P-metaheuristic algorithm, which encodes a candidate solution. It has a great impact on the performance of the algorithm. Candidate solution has different names in different algorithms such as chromosome in GA, wolf in GWO, habitat in BBO, and country in ICA. In this paper, a real-value coding is used for image thresholding. The length of each array is m, which is the number of threshold values. This array is defined as follows:

$${A }\,{candidate}\,{ solution = }\left[ {{{t}_1},{t_2}, \ldots ,{t_{i+1}}, \ldots ,{t_m}} \right]$$
(35)

where t i is the ith threshold value. For this problem, the boundaries of the search space are \(l=0\) and \(u={2^K} - 1,\) where K is the number of bits indicating one pixel.

2.3 Entropy-based objective function

This criterion is based on maximization of the overall entropy of the segmented image. The entropy of a histogram shows the intra-class compactness and inter-class separability [39]. The remarkable performance of Kapur’s method was studied by the researchers [19, 22, 23] and compared with other techniques.

Suppose that L is the number of grey levels in the image I {1,2,…,L}, N is the total number of pixels, and \(h(i)\) is the number of pixels with grey level i. Then, the probability of occurrence of grey level i in the image I is calculated as follows:

$$p(i)=h(i)/N$$
(36)

The objective function f to choose D threshold values is defined using the following equations:

$$\begin{gathered} f([{t_1},{t_2}, \ldots ,{t_m}]={H_0}+{H_1}+...+{H_m} \hfill \\ \begin{array}{*{20}{c}} {{\omega _0}=\sum\limits_{i=0}^{{t_1} - 1} {{p_i},} }&{{H_0}= - \sum\limits_{i=0}^{{t_1} - 1} {\frac{{{p_i}}}{{{\omega _0}}}} \ln \frac{{{p_i}}}{{{\omega _0}}}} \\ {{\omega _1}=\sum\limits_{i={t_1}}^{{t_2} - 1} {{p_i},} }&{{H_1}= - \sum\limits_{i={t_1}}^{{t_2} - 1} {\frac{{{p_i}}}{{{\omega _1}}}} \ln \frac{{{p_i}}}{{{\omega _1}}}} \\ {{\omega _2}=\sum\limits_{i={t_2}+1}^{{t_3}} {{p_i},} }&{{H_2}= - \sum\limits_{i={t_2}+1}^{{t_3}} {\frac{{{p_i}}}{{{\omega _2}}}} \ln \frac{{{p_i}}}{{{\omega _2}}}} \\ {{\omega _m}=\sum\limits_{i={t_m}+1}^L {{p_i},} }&{{H_m}= - \sum\limits_{i={t_m}+1}^L {\frac{{{p_i}}}{{{\omega _m}}}} \ln \frac{{{p_i}}}{{{\omega _m}}}} \end{array} \hfill \\ \end{gathered}$$
(37)

The purpose of P-metaheuristic algorithms used in this paper is to find the proper values of thresholds to maximize this objective function.

3 Experimental results

In this section, the experimental results are presented on several benchmark images. Five popular benchmark images named “Boats”, “Pepper”, “Goldhill”, “Lena”, and “House” were used for evaluating the experiments. Moreover, to conduct a better comparison, seven well-known images in the literature were also selected from the Berkeley Segmentation Data Set and Benchmark [63]. The number of selected images is 12,003, 181,079, 175,043, 101,085, 147,091, 101,087, and 253,027.

The original benchmark images and their histograms are shown in Fig. 12. The segmentation process of most of the used images is a difficult task because they have a multimodal histogram. Images such as Pepper and Lena have multiple peaks and valleys, while Goldhill image indicates abruptly changing pixel levels. Other images such as 175,043 and 101,085 show a more smooth distribution compared with other images such as Boats and Pepper.

Fig. 12
figure 12

Benchmark images and the corresponding histograms

For a more comprehensive comparison, the eight recently developed P-metaheuristic algorithm were compared with five others. Therefore, it can be said that 13 P-metaheuristic algorithms were compared with each other. Because of the randomness characteristics of P-metaheuristic algorithms, each algorithm is repeated for 50 times and the average results are reported.

The population size and the number of iterations for all algorithms are considered as 30 and 200, respectively. Finding a proper value for parameters is a trial and error task and needs enormous experiments. Hence, in this study, we used the default values for each parameter. Other parameter settings are listed in Table 1.

Table 1 Default parameter settings

3.1 Objective function measure

As mentioned previously, an entropy-based criterion is used as the objective function. Table 2 shows the obtained objective function values for each P-metaheuristic algorithm. K is the number of thresholds for each image. In this section, the experimental results for K = 2, 3, 4, and 5 are presented. The best results for each row were boldfaced. As can be observed, the CS algorithm yielded better results than other compared algorithms because it obtained the best results in 37 out of 48 cases. In addition, ICA provided the second rank because it provided the best performance in 31 out of 48 cases. Moreover, TLBO algorithm ranked the third by reaching the best results in 28 of 48 cases.

Table 2 The obtained objective function values for benchmark images

According to the table, most of the P-metaheuristic algorithms could obtain the same optimal value when K = 2, while the performance is different when K is bigger than 2.

3.2 Peak signal to noise ratio

Peak signal to noise ratio (PSNR) is a popular indicator to measure the quality of segmented images in decibels (DB). PSNR is calculated as follows:

$$PSNR=20{\log _{10}}\left( {\frac{{255}}{{RMSE}}} \right)$$
(38)

where RMSE is the root mean square error, which is formulated as:

$$RMSE=\sqrt {\frac{{\sum\limits_{i=1}^M {\sum\limits_{j=1}^N {{{(I(i,j) - \mathop I\limits^\sim (i,j))}^2}} } }}{{MN}}}$$
(39)

Here, M and N are the size of image, and \(I\) and \(\tilde I\) are the original and segmented images. A higher value of PSNR shows a better quality of the segmented image. Table 3 shows PSNR values of benchmark images. According to this table, in most of the cases (28 out of 48) the CS algorithm has presented higher PSNR compared with others. ICA and TLBO have been ranked second and third, respectively. ICA and TLBO provided the best PSNR in 12 and 8 out of 48, respectively. In addition, it is evident that as the number of threshold values increases, PSNR often raises.

Table 3 PSNR values of benchmark images for 13 different multilevel thresholding methods

3.3 Feature similarity index

Feature similarity index (FSIM) [70] is another image quality indicator based on human visual system. FSIM works on two low-level features, namely high phase congruency (PC), and gradient magnitude (GM). PC is a dimensionless measure that shows the importance of local structure. GM is used to encode contrast information.

FSIM is formulated as:

$$FSIM=\frac{{\sum {{}_{{x \in \Omega }}{S_L}(X)P{C_m}(X)} }}{{\sum\nolimits_{x \in \Omega } {P{C_m}(X)} }}$$
(40)

where \(\Omega\) shows the whole image, \({S_L}(X)\) is the similarity between the original image and its segmented image and PC is the phase congruence. \({S_L}(X)\) and PC is calculated as follows:

$${S_L}(X)={S_{PC}}(X){S_G}(X)$$
(41)
$${S_{PC}}(X)=\frac{{2P{C_1}(X)P{C_2}(X)+{T_1}}}{{PC_{1}^{2}(X)+PC_{2}^{2}(X)+{T_1}}}$$
(42)
$${S_G}(X)=\frac{{2{G_1}(X){G_2}(X)+{T_2}}}{{G_{1}^{2}(X)+G_{2}^{2}(X)+{T_2}}}$$
(43)

where \({T_1}\) and \({T_2}\) are constants. G is the gradient descent of an image and is calculated as:

$$G=\sqrt {G_{x}^{2}+G_{y}^{2}}$$
(44)

In addition, PC is defined as:

$$PC(X)=\frac{{E(X)}}{{(\varepsilon +\sum\nolimits_n {{A_n}(X))} }}$$
(45)

where \(E(X)\) is the magnitude of the response vector at position X on scale n, \(\varepsilon\) is a small number, and \({A_n}(X)\) is the local amplitude on scale n.

A higher value of FSIM indicates better performance. Table 4 shows FSIM values for 13 different multilevel thresholding methods. It indicates a relatively high correlation with the results of maximum entropy in Table 1. Similar to Table 1, the CS algorithm presents the competitive results compared with others according to the FSIM measure. The CS algorithm obtained the best performance in 32 out of 48 cases, while ICA (second rank) provided the best results in 21 out of 48 cases. TLBO and GSA achieved the third rank simultaneously because both of them had the best performance in 9 out of 48 cases.

Table 4 FSIM values of benchmark images for 13 different multilevel thresholding methods

3.4 Structural similarity index

Structural similarity index measure (SSIM) [71] is another quality assessment measure that is used to evaluate the performance of the algorithms. SSIM is based on the degradation of structural information. It combines luminance, contrast, and structure to yield a quality measure. Moreover, SSIM satisfies symmetry, boundedness, and unique maximum conditions. SSIM is mathematically represented as:

$$SSIM(x,y)=\frac{{(2{\mu _x}{\mu _y}+{C_1})(2{\sigma _{xy}}+{C_2})}}{{(\mu _{x}^{2}+\mu _{y}^{2}+{C_1})(\sigma _{x}^{2}+\sigma _{y}^{2}+{C_2})}}$$
(46)

where \({\mu _x}\) and \({\mu _y}\) are the mean intensity of images x and y, \(\sigma _{x}^{2}\) and \(\sigma _{y}^{2}\) indicate the variance of images x and y, \({\sigma _{xy}}\) is the covariance of x and y, \({C_1}\) and \({C_2}\) are constants to balance the calculations. A higher value of SSIM indicates better performance. Table 5 shows SSIM value between an original image and its segmented image. The best result for each row is boldfaced. The results of Table 5 is consistent with the previous results. As can be seen, CS algorithm has presented higher SSIM in 30 out of 48 cases, and, therefore CS achieved the first rank, while the second rank went to ICA.

Table 5 SSIM values of benchmark images for 13 different multilevel thresholding methods

3.5 Stability analysis

In general, the P-metaheuristic algorithms are stochastic algorithms. Hence, the results may not be the same in each run of the algorithm. Therefore, stability analysis is necessary to assess the P-metaheuristic algorithm. This assessment will show which algorithm is more stable. Standard deviation (STD) is used to analyze the stability of the algorithms. It is defined as follows:

$$STD=\sqrt {\sum\limits_{i=1}^k {\frac{{{{({\sigma _i} - \mu )}^2}}}{k}} }$$
(47)

where k is the number of runs of each algorithm (K = 50), \({\sigma _i}\) is the best objective value of the ith run of the algorithm, and \(\mu\) is the average value of \(\sigma\). The lower value of STD shows the more stability for the algorithm. The standard deviation for 50 runs of each algorithm is provided in Table 6. The obtained results revealed that CS and ICA algorithms are more stable than other algorithms.

Table 6 Standard deviation values of benchmark images for 13 different multilevel thresholding methods

3.6 The search ability on higher dimension problems

In this section, the P-metaheuristic algorithms were compared on each image with K = 10, 15, and 20 to evaluate the performance of algorithms on higher dimensions. Table 7 provides the objective function mean values obtained by each P-metaheuristic algorithm. Consequently, the ICA algorithm provides the best objective function values in most of the cases. ICA obtained the best performance in 23 out of 48 cases, while CS provided the best results in 7 out of 48 cases.

Table 7 The obtained objective function values for benchmark images on higher dimensions

3.7 Statistical analysis

In this section, Friedman test and Wilcoxon signed rank test were applied as a non-parametric statistical test to compare the performance of P-metaheuristic algorithms. Such statistical test is necessary because of stochastic and random searching characteristics of P-metaheuristic algorithms. The objective of Friedman test is to find the significant differences among the behavior of P-metaheuristic algorithms. The null hypothesis in Friedman test, H0, states the equality of medians among algorithms, whereas the alternative hypothesis, H1, shows the difference. Significance level (\(\alpha\)) illustrates the probability of the rejection of null hypothesis while it is true. If P-value were less than significance level, H0 would be rejected. More details about Friedman test can be found in [72].

The ranking calculation is the first step in the Friedman test. Average ranking is applied to rank each algorithm and equal values are given to the average ranks. Tables 8 and 9 show the ranks computed for each used algorithm. As can be observed, the TLBO and CS algorithms have provided the first rank for K = 2 and 3. In addition, BA algorithm has obtained the first rank for K = 20. The CS algorithm has presented the first rank in the remaining algorithms. In another word, it can be said that the CS algorithm shows the first rank for all cases except K = 20.

Table 8 Friedman rank for benchmark images
Table 9 Friedman rank for benchmark images on higher dimensions

The Chi-square (\({\chi ^2}\)) values and P-value for different threshold numbers are shown in Table 10. From Chi-square distribution table, the critical value for (13 − 1) = 12 degree of freedom with 0.05 significance level is 21.026. According to Table 10, Chi-square values for all threshold numbers are greater than the critical value. It means that H0 is rejected and H1 is accepted in all cases. Moreover, the P-value for all threshold numbers is very small, which confirms the rejection of H0. This shows a significant difference in the behavior of the algorithms.

Table 10 Chi-square and P-value for different threshold numbers

Given the obtained results, we could say that in general the CS algorithm presented the best results. Table 11 displays the cases, in which the CS algorithm is better, worse, and/or equal to other algorithms. As can be seen in the table, the CS algorithm is performed better than other ones in most of the cases. The Wilcoxon signed rank test is used to compare whether there is a significant difference between the results, statistically and to validate the results. This test compares two algorithms. This test is to answer whether or not there is a significant difference between the algorithms. Therefore, this test is administered between the CS algorithm and other ones. This test reports a P-value as an output, which determines the significance level of the two algorithms. Here, if the P-values are less than 0.05, then there is a significant difference between the two algorithms, statistically. Table 12 illustrates the results of Wilcoxon signed rank test between CS and other algorithms. The table confirms that there is a significant difference between the CS and other algorithms, statistically and solutions are not received by chance because the P-values obtained are less than 0.05 in all cases.

Table 11 Pairwise comparison between CS algorithm and other algorithms
Table 12 Wilcoxon signed rank test results

3.8 The effects of other objective functions

To create a more reliable result, another objective function was evaluated based on Cross Entropy. Suppose that \(F=\{ {f_1},{f_2}, \ldots ,{f_N}\}\) and \(G=\{ {g_1},{g_2}, \ldots ,{g_N}\}\)are two probability distributions on an equal set. The cross entropy between F and G is defined as follows:

$$D(F,G)=\sum\limits_{i=1}^N {{f_i}\log \frac{{{f_i}}}{{{g_i}}}}$$
(48)

The objective is to reach the minimum of cross entropy between the main image and the segmented one. Suppose that I is the main image, h(i), i = 1,2,…,L is the corresponding histogram, and L is the number of gray levels. The segmented image I t is elucidated using threshold value t as follows:

$${I_t}(x,y)=\left\{ {\begin{array}{*{20}{l}} {\begin{array}{*{20}{l}} {\mu (1,t)}&{I(x,y)<t} \end{array}} \\ {\begin{array}{*{20}{l}} {\mu (t,L+1)}&{I(x,y) \geq t} \end{array}} \end{array}} \right.$$
(49)

where,

$$\mu (a,b)={{\sum\limits_{i=a}^{b - 1} {ih(i)} } \mathord{\left/ {\vphantom {{\sum\limits_{i=a}^{b - 1} {ih(i)} } {\sum\limits_{i=a}^{b - 1} {h(i)} }}} \right. \kern-\nulldelimiterspace} {\sum\limits_{i=a}^{b - 1} {h(i)} }}$$
(50)

Then, the cross entropy is calculated as follows:

$$D(t)=\sum\limits_{i=1}^L {ih(i)\log (i) - \sum\limits_{i=1}^{t - 1} {ih(i)\log (\mu (1,t)) - \sum\limits_{i=t}^L {ih(i)\log (\mu (t,L+1)).} } }$$
(51)

The objective is to obtain threshold value t* by minimizing the cross entropy in accordance with the following equation:

$$t*=\mathop {\arg \min \{ D(t)\} .}\limits_t$$
(52)

Since the first factor for an image is a constant value, the objective function could be revised as follows:

$$D(t)=ih(i)\log (\mu (1,t)) - \sum\limits_{i=t}^L {ih(i)\log (\mu (t,L+1))} = - \sum\limits_{i=1}^{t - 1} { - {m^1}(1,t)\log \left( {\frac{{{m^1}(1,t)}}{{{m^0}(1,t)}}} \right) - {m^1}(t,L+1)} \times \log \left( {\frac{{{m^1}(t,L+1)}}{{{m^0}(t,L+1)}}} \right)$$
(53)

where, \({m^0}(a,b)=\sum\limits_{i=a}^{b - 1} {h(i)}\) and \({m^1}(a,b)=\sum\limits_{i=a}^{b - 1} {ih(i)}\) are the momentum 0 and 1 on a minor interval of image histogram, respectively. Suppose that we want to obtain C threshold values for \({t_1},{t_2}, \ldots ,{t_c}\). To make the computation simple, two dummy variables of \({t_0}=1\) and \({t_{c+1}}=L+1\) were defined. Hence, the final objective function is described as follows:

$$f({t_1},{t_2},...,{t_c})= - \sum\limits_{i=1}^{c+1} {{m^1}({t_{i - 1}},{t_i})\log \left( {\frac{{{m^1}({t_{i - 1}},{t_i})}}{{{m^0}({t_{i - 1}},{t_i})}}} \right)}$$
(54)

Here, the objective is to obtain the optimal value for \(x=[{t_1},{t_2},...,{t_c}]\) vector, such that the Eq. (54) becomes minimize. Table 13 indicates the mean objective function value on 50 independent runs. Moreover, the rank of each row is depicted in Table 14. Given Tables 13 and 14, the COA, TLBO, GSA, ICA, CS, PSO, and DE algorithms could reach to the best value of the objective function for K = 2. As can be seen, several algorithms were reached to the best value of the objective function for K = 2, simultaneously, the reason of which is the small size of the solution space. TLBO and CS algorithms have had the best results for K = 3. However, only the CS algorithm held the first rank for K = 4, 5. The CS algorithm not only achieved the best objective function value in common with other algorithms (K = 2 and 3) at lower dimensions, but also reached exclusively the best rank at higher dimensions (K = 4 and 5), where the solution space is larger. Therefore, we could conclude that the CS algorithm presented the best performance for image segmentation in this objective function.

Table 13 The mean objective function value on 50 independent runs concerning cross entropy objective function
Table 14 Friedman rank for benchmark images concerning cross entropy objective function

Table 15 shows that given the Friedman Test, the P-value confirms that there is a significant difference between the evaluated algorithms. Furthermore, the results of Wilcoxon signed rank test between the CS and other algorithms is shown in Table 16. As can be seen in the table, the CS algorithm has experienced a significant improvement compared with all other algorithms, except PSO with \(\alpha =0.05\) level of significance and PSO algorithm with \(\alpha =0.2\) level of significance.

Table 15 Friedman rank for benchmark images concerning cross entropy objective function
Table 16 Wilcoxon signed rank test results concerning cross entropy objective function

4 Conclusion

Image segmentation is the process of dividing an image into some meaningful regions. Image thresholding is one of the most important techniques for image segmentation. Image thresholding segments an image using existing information in the histogram of the image. The traditional multilevel thresholding techniques are so time-consuming, especially when the number of the threshold values is high. Population-based metaheuristic (P-metaheuristics) algorithms can be used as an alternative technique to solve this problem. P-metaheuristic algorithms are iterative algorithms that use a population of solutions to solve an optimization problem. In this paper, eight recently developed P-metaheuristic algorithms have been applied for image thresholding. These algorithms are whale optimization algorithm, grey wolf optimizer, cuckoo optimization algorithm, biogeography-based optimization, teaching-learning-based optimization, gravitational search algorithm, imperialist competitive algorithm, and cuckoo search. A Kapur’s entropy -based measure has been used as the objective function in all used P-metaheuristic algorithms.

For conducting a more comprehensive comparison, these eight P-metaheuristic algorithms were compared with five other P-metaheuristic algorithms. The performance of the algorithms were evaluated in terms of objective function value, PSNR, FSIM, SSIM, stability analysis, and the search ability on the higher dimension problems. In addition, Friedman and Wilcoxon signed rank tests were provided as the non-parametric statistical analysis. Friedman rank showed that cuckoo search obtained the best rank in all threshold values expect K = 20. Friedman test confirmed that a significant difference exists in the behavior of the algorithms. In addition, the results of Wilcoxon signed rank test between CS and other algorithms revealed that there is a significant difference between them. To increase the reliability of the results, the efficiency of the P-metaheuristic algorithms were evaluated on another objective function (cross entropy). The results showed a relatively high correlation with the results of Kapur’s entropy.

For future studies, these P-metaheuristic algorithms can be applied to complex and real-time images in various applications, such as satellite image processing and medical image processing. In addition, other objective functions can be evaluated using these most recently P-metaheuristic algorithms. This work also can be extended for processing of color images.