1 Introduction

The segmentation is a fundamental and crucial step in image processing and artificial vision. A significant number of applications explored the process of segmentation, such as medical imaging [29], video semantic [38], script identification [26], historical documents [51], and remote sensing [47]. Segmentation is defined as an operation that partitions the image into several homogeneous objects. Mainly, the segmentation image includes several techniques such as thresholding, edge detection, split and merge method, and region growing [47].

Among the methods mentioned above, thresholding is the most used and exploited due to its efficiency and more straightforward implementation. Typically, two variants of thresholding are widely used in the literature known as binary thresholding (bi-level) and multilevel thresholding (ML-TH). The main idea of binary thresholding is to find the optimal value of threshold (T), which aims to create two classes by comparing the pixel intensity to T. The lower values are affected to the first class while the higher values are assigned to the second class.

Generally, ML-TH is the most exploited in image processing because the number of classes is more significant than the two classes. Besides, this type requires several values of thresholds. The main problem of thresholding is how to find automatically the optimal value of threshold(s), which leads to determining the number of clusters (classes) correctly.

For binary thresholding, we distinguish two strategies. The first one is introduced by Otsu in [36] that aimed to maximize the variance between classes. The second strategy is provided by Kapur [24] that used the entropy criteria as a measure to maximize the homogeneity between classes.

For ML-TH, a new class of metaheuristic algorithms based on genetic evolution, swarm theory, and physical laws have been applied. Several methods, such as genetic algorithm (GA) [45], differential evolution (DE) [41], particle swarm optimization (PSO) [2], multi-verse optimizer (MVO) [11], artificial bee colony (ABC) [14], artificial bee colony (ABC) [18], chicken swarm optimization [28], electromagnetism optimization [34], and gravitational search algorithm (GSA) [31], are available in the literature. They are applied to obtain the optimal set of thresholding by maximizing the interclass variance defined by Otsu’s function.

Recently, the intention of scientific is attracted by the simulation of the natural behavior of insects and animals, which increase the development of several algorithms. We find the work of Farshi in [16] that introduced a novel technique named animal migration optimize for finding the optimal set of multiple thresholds. The author used two criteria most exploited in the field of image thresholding known as Kapur entropy and Otsu method. The experimental study showed better results in comparison with other optimization algorithms such as GA, PSO, and BFO. In [7], the authors proposed three heuristics based ML- thresholding, namely OA-TH, PSO-TH, and GWO-TH, for selecting the optimal thresholds. The authors used the Otsu method to maximize the between-class variance. The experimental results demonstrated the high performance of WOA-TH compared to GWO-TH and PSO-TH.

In the same context, in Ref [22], the authors proposed a novel enhanced version of bee algorithms (BAs) to multilevel image thresholding, called PLBA. This algorithm aimed to determine the optimal values of the threshold by maximizing between class-variance and Kapur’s entropy. Besides, this algorithm included two searches (i.e., local and global). The first one applied the greedy Levy local algorithm [39], which is based on the levy flight operator. Also, the global search incorporated the path levy in the initialization phase that is used in PLBA. The PLBA outperformed other metaheuristic algorithms.

A new approach to multilevel thresholding based on GWO is developed by [25]. The researchers imitated the social life of wolves, which usually depended on their leadership hierarchy and hunting activities. The proposed method selected the optimal threshold values using the criteria of Kapur’s entropy or Otsu’s between-class variance. The experimental results showed that the GWO provided an excellent performance over BFO and PSO. Moreover, the computational complexity of GWO is greatly diminished because it was faster than the BFO.

Mohamed et al. [9] proposed two algorithms based on swarm intelligence, called whale optimization algorithm (WOA) and moth-flame optimization (MFO), for multilevel threshold segmentation. The WOA emulated the natural cooperative behavior of whales, whereas the MFO mimicked the behavior of moths, which have a unique navigation style at night based on the moonlight. Otsu’s between-class variance evaluates the fitness function, and the experimental result showed that MFO provided a better result than WOA.

The authors of [4] developed a novel multilevel thresholding algorithm based on swarm intelligence theory, called krill herd optimization (KHO), which simulates the herding behavior of krill agents. This study introduced the KHO to find the optimal threshold values of image segmentation by maximizing the Kapur and Otsu measures. A comparative study showed that the proposed method outperformed other existing bio-inspired approaches, such as GA, MFO, and PSO.

The segmentation of color images has recently grown remarkably in image processing. A new method has been proposed [20], which presented an improved version of the FA, called MFA, by minimizing cross-entropy, intra-class variance, and Kapur’s method. The main difference between MFA and FA resided in the initialization and movement phase. The initialization phase is conducted by a chaotic map, which improved the diversification and convergence, whereas the phase of the movement is based on PSO.

Physical and mathematical theories attracted the attention of researchers, which allows to develop several algorithms for MLT. This category included sine cosine algorithm (SCA) [19], Multiverse optimizer (MVO) [23], Electro-magnetism (EM) [6], Equilibrium Optimizer (EO) [48] and Gravitational Search Algorithm [44].

Physical rules are considered as a new source for studying the ML-TH, for example Xing and Jia [49] proposed a multi-threshold image segmentation based on grey level co-occurrence matrix (GLCM) and improved Thermal exchange optimize (TEO) using two operators: levy flight and oppsition-based-learning (OBL). To validate the efficiency of the proposed method, natural-color image, satellite image, and Berkeley images are taken as an experiment. GLCM-ITEO has shown a high quality of segmentation with less CPU time.

An improved thermal exchange optimization using a levy flight function is proposed [50]. For validating the efficiency of LTEO, six swarms are used for comparison tested on color nature image and satellite image. The experimental study has shown high accuracy of segmentation and speed convergence.

Recently, the use of the volleyball premier league (VPL) algorithm proposed by Moghdani et al. [32] is a known great success for solving global optimization problems. In general, the VPL consists of applying several strategies inspired by a volleyball game, which are used to improve the population during the seasons. The VPL showed some difficulties in terms of convergence and local optima. So, the learning phase has the most substantial effect on the performance of the VPL algorithm. To avoid the problem of convergence and to enhance the learning phase, we integrate the whale optimization algorithm (WOA), which is used as a local search.

In general, the WOA emulated the behavior of whales during the searching for prey [30]. The WOA has been applied to different applications based on these characteristics (e.g., economic dispatch problem [46], bioinformatics [3], feature selection [42], and content-based image retrieval [10]).

The main contributions of this paper are:

  • For the first time, the sports inspiration based on basic VPL is applied for multilevel thresholding

  • A new hybrid algorithm called VPLWOA is developed for selecting the optimal threshold values on various images by maximizing the between class-variance defined by Otsu’s function.

  • Assess the quality of the proposed VPLWOA using eleven natural images that have different properties.

  • A new real application of blood cell segmentation based on VPLWOA is realized to find the optimal thresholds.

  • Experimental results show that VPLWOA outperforms other different metaheuristic algorithms in terms of performance criteria.

The general structure of the paper takes the form of five chapters. Image segmentation using Otsu’s function, the VPL algorithm, and the WOA are described in Section 2. The proposed method (i.e., VPLWOA) is explained in Section 3. A comprehensive evaluation of our method with a statistical study of various images is presented in Section 4. Finally, our conclusion and future work are discoursed in Section 5.

2 Related work

Recently, many studies are explored by the researcher for understanding the behavior of the life cycle of insects, animals, and nature or physical theory. These inspirations lead deeply to appear several thresholding algorithms inspired from genetic as evolutionary algorithms. More recently, the swarm intelligence family still more attractive with the simulation of insects and animal’s life including harris hawks, ant lion, whales grey wolves, salps, ant’s colonies, bees. In this side, several algorithms are introduced for multilevel thresholding images including Harris hawk’s optimizer, grey wolf optimizer, ant colony optimization, artificial bee colony ant lion optimizer, whale optimization algorithm, salp swarm algorithm.

Recently, Eric et al. [40] introduced an efficient swarm optimizer called harris hawks optimizer (HHO) for solving multilevel thresholding based on minimum cross-entropy. The authors treat the standard benchmark of images and medical mammograms. The proposed method is shown their efficiency compared to basic machine learning and metaheuristics approaches, including PSO, FFA, DE, HS, SCA, and ABC in terms of PSNR, FSIM, SSIM, PRI, and VOL. In addition, HHO consumed less time compared to PSO, FFA, and DE.

In this literature review, we give more importance to segmentation images based on hybrid metaheuristics. For example, Abdelaziz et al. [12] developed a new hybrid algorithm based on the HHO and salp swarm algorithm (SSA) for finding the optimal values of the multilevel threshold. The general idea consists of dividing the population into two parts, where the process of exploration and exploitation of HHO is applied to the first part, and the searching process of SSA is used for updating the solutions of the second part. The proposed method HHOSSA achieved high performance compared to original versions of HHO and SSA in terms of PSNR and SSIM, tested on natural gray-level images.

Ahmadi et al. [1] proposed a hybrid algorithm for seeking the optimal values of the level threshold using differential evolution (DE) and bird mating optimization (BMA). The numerical results have shown the high performance of the proposed method assessed on standard test images and compared to other optimizers like PSO, PSO-DE, GA, Bacterial foraging (BF), and enhanced BF in terms of fitness and standard deviation.

In the same context of MLT segmentation image based on hybrid metaheuristics, a new combination between Spherical search optimizer (SSO) and sine cosine algorithm (SCA) is developed by Husein et al. [33]. The fuzzy entropy is considered as the main fitness function for testing the quality of the segmented image. The experimental study is assessed on several images taken from Berkeley datasets and the obtained results of SSOSCA outperformed other optimizer that included Cuckoo search (CS), Grey wolf optimizer (GWO), WOA, SCA, SSA, SSO, GOA over different performance metrics as PSNR, FSIM, and SSIM. The proposed method took a lower time for achieving the segmentation task compared to other optimizers.

In [5], The authors introduced a new hybrid algorithm called HHO-DE for MLT color segmentation image. Their idea consists of dividing [5] firstly the main population into two equal subpopulations. Secondly, HHO and DE update the position of each subpopulation in a parallel way. Two fitness functions are used based on Otsu and Kapur entropy to determine the optimal set of threshold levels. The experimental results indicated that HHO-DE could be considered as an efficient tool for MLT color image segmentation compared to other optimizers as DE HHO SCA BA HSO PSO DA according to PSNR SSIM and FSIM measures.

With the fast propagation of COVID-19, several researchers presented many solutions for the detection and segmentation of chest CT gray-level images. In [13], the authors proposed a new version of the marine predator’s algorithm (MPA) improved by MFO based on fuzzy entropy. The proposed method MPAMFO presented their efficiency compared to the existing swarm intelligence works in terms of PSNR and SSIM.

Sun et al. [43] introduced an algorithm called GSA-GA, which combined GSA with a genetic technique for multilevel thresholding. This algorithm used the roulette selection and mutation operator inspired by genetic technique, which is integrated into GSA. Two standard criteria (i.e., entropy and between-class variance) are used as fitness functions. The statistical significance test demonstrated that GSA-GA considerably diminished the computational complexity of all images tested.

Furthermore, Oliva et al. [35] proposed a new evolutionary algorithm that combines Antlion optimization and a sine-cosine algorithm to determine the optimal set of thresholding segmentation using Otsu’s between-class variance and Kapur’s entropy. According to the experimental study, the SCA does not outperform other evolutionary computation from state of the art.

Ouadfel and Taleb-Ahmed [37] investigated the ability of two nature-inspired metaheuristics, called social spiders optimization (SSO) and flower pollination (FP) to solve the image segmentation via multilevel thresholding. During the optimization process, each solution is evaluated using the between-class variance or Kapur’s entropy. The experimental results illustrated that the SSO and FP better than PSO and bat algorithms. Furthermore, the SSO guaranteed a balance between exploration and exploitation and showed the stability of results for all images.

3 Background

In this section, the necessary information of the multilevel thresholding image segmentation using Otsu’s function, VPL, and WOA are discussed.

3.1 Problem formulation

In this section, the definition of the multilevel thresholding problem is explained. Assumed that the tested image I contains a set of K + 1 classes, and a set of K threshold values (tk, k = 1, 2…, K) are required to divide I into these classes (Ck, k = 1, 2…, K). This condition can be represented by the following equation [37]:

$$ {\displaystyle \begin{array}{c}{C}_0=\left\{{I}_{ij}\in I\right|0\le {I}_{ij}\le {t}_1-1\Big\},\\ {}{C}_1=\left\{{I}_{ij}\in I\right|{t}_1\le {I}_{ij}\le {t}_2-1\Big\},\\ {}\cdots \\ {}{C}_K=\left\{{I}_{ij}\in I\right|{t}_K\le {I}_{ij}\le L-1\Big\}\end{array}} $$
(1)

where L is the gray level of I.

In general, the task of determining the optimal threshold values to segment the image is by conversion to an optimization problem through maximizing or minimizing a specific objective function. We suppose the maximization in this paper, which is defined as follows:

$$ {t}_1^{\ast },{t}_2^{\ast },\dots, {t}_K^{\ast }=\underset{t_1,{t}_2,\dots, {t}_K}{\max }F\left({t}_1,{t}_2,\dots, {t}_K\right),\kern0.75em $$
(2)

Where F is the objective function used to evaluate each solution. In the following sections, the most popular two functions used in the multilevel threshold image segmentation are defined.

3.2 Otsu’s method

In [36], the description of the Otsu’s method was given. This method aims to maximize the variance between the classes of the given image I using the following equation:

$$ {F}_{Otsu}=\sum \limits_{i=0}^K{\theta}_i\times {\left({\mu}_i-{\mu}_1\right)}^2,\kern0.75em {\theta}_i=\sum \limits_{j={t}_i}^{t_{i+1}-1}{P}_j, $$
(3)
$$ {\mu}_i=\sum \limits_{j={t}_i}^{t_{i+1}-1}\frac{iP_j}{\theta_j},\kern0.75em {P}_i=\frac{Fr_i}{N_p},\kern0.5em {t}_0=0,{t}_{K+1}=L,\kern1.25em $$
(4)

where μ1 is the mean intensity of the image I; and Pi and Fri are the probability and frequency of the ith gray level of the image, respectively. The total number of pixels in the image is given by Np.

3.3 Volleyball premier league algorithm

This subsection is demonstrated the mathematical modeling of the proposed algorithm, Volleyball Premier League algorithm (VPL) [32], which is explained comprehensively. The general flow of VPL is presented in Fig. 1, including all steps of the proposed algorithm.

Fig. 1
figure 1

The framework of the VPL algorithm

In this algorithm, we use two parts that contain formation and substitutes for each solution, wherein random numbers are used in the identified interval values, as shown in Eqs. (5) moreover, (6) [32]:

$$ {X}_j^f={lb}_j+ Rand\left(\right)\times \left({ub}_j-{lb}_j\right) $$
(5)
$$ {X}_j^s={lb}_j+ Rand\left(\right)\times \left({ub}_j-{lb}_j\right) $$
(6)

where lbj and ubj denote the range of variable j, respectively; and Rand() is a random number generated between zero and one. In the VPL algorithm, we perform a well-known procedure, which is named single round robin (SRR), to provide the league’s schedule.

In the typical volleyball game, the better team can beat its rival in the match. Each team has a chance of running up against its competitors according to the probability rules in the match. The power index π(i) is defined on the basis of the following formulas:

$$ \pi (i)=\frac{\ f\left({X}_i^f\right)}{Z}, $$
(7)
$$ Z=\sum \limits_{i=1}^n\ f\left({X}_i^f\right), $$
(8)

In the above formulas, \( f\left({X}_i^f\right) \) denotes the objective function of the ith team, which is calculated based on its formation property; Z denotes the summation of the objective function in the current iteration. Moreover, the following formulations are given to compute the π value for both teams, which are going to play each other in this match.

$$ \pi (j)=\frac{\ f\left({X}_j^f\right)}{Z} $$
(9)
$$ \pi (k)=\frac{\ f\left({X}_k^f\right)}{Z} $$
(10)

where \( {X}_j^f \) and \( {X}_k^f \) denote the position of formation property of teams j and k, respectively. Therefore, we can compute the probability of winning team j against k with the following formula:

$$ \rho \left(j,k\right)=\frac{\pi (j)}{\pi (j)+\pi (k)} $$
(11)

According to the laws of probability, the following formula is given as:

$$ \rho \left(j,k\right)+\rho \left(k,j\right)=1 $$
(12)

A new formation and corresponding strategies are used for the winner and loser teams, considering that the winning team is determined. In this regard, different operators, including knowledge sharing, repositioning, and substitution, are used for the loser team, and the winning team operates the leading role strategy. Generally, the coach shares his knowledge about the condition of the game with players to obtain improved performance. Thus, knowledge sharing strategy can be specified by:

$$ {X}_j^f\left(t+1\right)={X}_j^f(t)+{r}_1{\lambda}^f\left({ub}_j-{lb}_j\right), $$
(13)
$$ {X}_j^s\left(t+1\right)={X}_j^s(t)+{r}_2{\lambda}^s\left({ub}_j-{lb}_j\right), $$
(14)

In the above formulas, we have defined coefficients values (λf andλs) for formation and substitutes properties; and also, two new random numbers, which are indicated r1 and r2, are uniformly engendered in range zero to one. Furthermore, the rate of sharing knowledge is indicated by δks which is computed as follows:

$$ {N}_{ks}=\left[J{\delta}_{ks}\right], $$
(15)

where Nks denotes the amount of knowledge sharing for any solution, and J is considered as the amount of positions in solutions. Repositioning is a common strategy, which has considerable effects on a volleyball game during a match. This operator positions the best players in the ideal to attain excellent performance. On this basis, we mention δrs as the rate of repositioning procedure, and the number of this operator in the current iteration is given as:

$$ {N}_{rs}=\left[J{\delta}_{rs}\right], $$
(16)

where Nks states the number of this operator in each iteration. At this point, we randomly select two positions (i.e., i and j), and α and β (two virtual objects) are used for storing the value of active and passive players, respectively. Then, the properties of solutions i and j to are assigned to α and β. Therefore, the following formulas are given:

$$ {\alpha}^f={X}_i^f, $$
(17)
$$ {\alpha}^s={X}_i^s, $$
(18)
$$ {\beta}^f={X}_j^f, $$
(19)
$$ {\beta}^s={X}_j^s. $$
(20)

At the end of this process, the following formulas are given, which are indicated that properties of selected positions (A and B) are assigned to each other reversely.

$$ {X}_i^f={\beta}^f, $$
(21)
$$ {X}_i^s={\beta}^s, $$
(22)
$$ {X}_j^f={\alpha}^f, $$
(23)
$$ {X}_j^s={\alpha}^s. $$
(24)

We can increase our knowledge in performing the corresponding operators in this algorithm by understanding the similarities and differences among sports. Therefore, the coaches use substitution for the intervention to find the best formation for their teams. The number of substitution (Ns) in each iteration is calculated by the following formula::

$$ {N}_s=\left[ rJ\right], $$
(25)

Where r represents a random number that is distributed uniformly between zero and one, and J specifies the dimension of each solution, which is identified as the number of players in this algorithm. As previously mentioned, some operators are used just for the loser team and substitution strategy. On this basis, let set h, F, and S denote randomly selected position indexes, formation, and substitution property of the loser team, respectively. Subsequently, these property values of all players of set h are swapped together. The specific operator, named the winner strategy, is given, which is similar to those used in many evolutionary methods, such as PSO, to reach this goal in the proposed algorithm [8]. In this operator, first, we determine the position of the winning team and combine it with a random one to obtain a new position using the following formulas:

$$ {X}^f\left(t+1\right)={X}^f(t)+{r}_1{\psi}^f\left({X}^f{(t)}^{\ast }-{X}^f(t)\right), $$
(26)
$$ {X}^s\left(t+1\right)={X}^s(t)+{r}_2{\psi}^s\left({X}^s{(t)}^{\ast }-{X}^s(t)\right), $$
(27)

Where ψf and ψs symbolize inertia weights of formation and substitute properties, respectively, and r1 and r2 are random numbers, which are generated uniformly in [0, 1]. In the learning operator, coaches examine the behavior of teams for obtaining the best results to enhance their teams’ performance. Moreover, we define the formula to explain the learning phase as follows:

$$ {X}_j^g{\left(t+1\right)}_{\Phi}={\left({X}_j^g(t)\right)}_{\Phi}-\theta \left(\left|\vartheta\ {\left({X}_j^g(t)\right)}_{\Phi}-{X}_j^g(t)\right|\right), $$
(28)

where g signifies a set that compromise substitute and formation properties (g = {s, f}), and index Φ yields a value from one to three, which indicates the first, second, and third best solutions, also known as ranks 1, 2, and 3, respectively. \( {X}_j^g{\left(t+1\right)}_{\Phi} \) shows the value of position j of property g with respect to the best solution Φ. \( {X}_j^g(t) \) is the value of position j of the current iteration t. Finally, θ and ϑ are coefficient values, which are defined as follows:

$$ \theta = db{r}_1-b, $$
(29)
$$ \vartheta =d{r}_2, $$
(30)

Where r1 and r2 are random numbers that are uniformly generated between zero to one, and b is linearly decreased from β to zero, which is computed as follows:

$$ b=\beta -\left(t\left(\beta /T\right)\right). $$
(31)

The coaches pursue to recognize the best combination of active (formation) and passive players (substitutes) concerning the top three teams in the league. Therefore, the following formulas are assumed to capture the learning phase for formation property:

$$ {X}_j^f{\left(t+1\right)}_1={\left({X}_j^f(t)\right)}_1-\theta \left(\left|\vartheta\ {\left({X}_j^f(t)\right)}_1-{X}_j^f(t)\right|\right), $$
(32)
$$ {X}_j^f{\left(t+1\right)}_2={\left({X}_j^f(t)\right)}_2-\theta \left(|\vartheta\ {\left({X}_j^f(t)\right)}_2-{X}_j^f(t)|\right), $$
(33)
$$ {X}_j^f{\left(t+1\right)}_3={\left({X}_j^f(t)\right)}_3-\theta \left(|\vartheta\ {\left({X}_j^f(t)\right)}_2-{X}_j^f(t)|\right), $$
(34)
$$ {X}_j^f\left(t+1\right)=\frac{\ {X}_j^f{\left(t+1\right)}_1+{X}_j^f{\left(t+1\right)}_2+{X}_j^f{\left(t+1\right)}_3}{3} $$
(35)

Similarly, the formulas mentioned above can also be used for substitute property by using term s instead of f in the corresponding position. Notably, we have used these formulas to enhance the exploitation process of the proposed algorithm. The transfer process takes place when a season ends. On this occasion, the players can move among teams. On this basis, we have mathematically expressed this concept in the proposed algorithm to perform the convergence toward an optimal solution.

Let set H be the randomly selected teams for this operator if only if a random value (r), generated randomly between 0 to 1, is greater than 0.5. Thus, the number of teams involved in the season transfer is expressed as follows:

$$ {N}_{st}=\left[N{\delta}_{st}\right]. $$
(36)

where δst denotes the percentage of teams in this operator. Similar to the typical league in a volleyball game, top teams of any league go up to a higher division. Consequently, the worst teams are dropped down to the lower division. While only one league exists in this algorithm. The relegation of the worst teams is considered in this operator, which is called promotion and relegation. Thus, we intentionally eradicate the worst teams and then exchange them by new ones that are generated randomly. Let Npr be the number of teams moving up to the upper league, and N be the total number of teams in the current league.

$$ {N}_{pr}=\left[N{\delta}_{pr}\right], $$
(37)

where δpr symbolizes the percentage of teams, which are relegated and promoted accordingly.

3.4 Whale optimization algorithm

The WOA is presented in [30] as a new metaheuristic algorithm based on the social behavior of the humpback whales.

Moreover, the WOA begins by randomly generating a set of N solutions TH, which represents the solution for the given problem. Then, for each solution THi, i = 1, 2, …, N, the objective function is computed, and the best solution is determined TH. Subsequently, each solution is updated either by using the encircling or bubble-net methods. In the bubble-net method, the current solution THi is updated using the shrinking encircling method, in which the value of a is decreased, as shown in the following equation:

$$ a=a-a\frac{g}{g_{max}}. $$
(38)

where g and gmax are the current iteration and the maximum number of iterations, respectively.

Also, the solution THi can be updated using the encircling method, as shown in the following equation:

$$ {TH}_i\left(g+1\right)={TH}_i(g)-A\bigodot D,A=2a\bigodot {r}_1-a, $$
(39)
$$ D=\left|C\bigodot {TH}^{\ast }(g)-{TH}_i(g)\right|,B=2{r}_2, $$
(40)

where D is the distance between TH and THi at the gth iteration. The r1and r2 represent the random numbers, and the symbol ⨀ is the element-wise multiplication operation. Moreover, the value of a is decreased in the interval [2, 0] with increasing iterations using Eq. (38).

Also, the solution THi can be updated using the spiral method that simulates the helix-shaped movement around the TH, as shown in the following equation:

$$ {TH}_i\left(g+1\right)={D}^{\prime}\bigodot {e}^{bl}\bigodot \cos \left(2\pi l\right)+{TH}_i(g),{D}^{\prime }=\left|{TH}^{\ast }(g)-{TH}_i(g)\right|, $$
(41)

where l ∈ [−1, 1] and b are the random variables and constant value used to determine the shape of a logarithmic spiral.

Moreover, the solutions in the WOA can be updated by using either the spiral-shaped path and shrinking, as defined in the following equation:

$$ {TH}_i\left(g+1\right)=\left\{\begin{array}{c}{TH}^{\ast }(g)-A\bigodot D\kern8em if\kern0.75em {r}_3\ge 0.5\\ {}{D}^{\prime \bigodot {e}^{bl}}\bigodot \cos \left(2\pi l\right)+{TH}_i(g)\kern3em otherwise\end{array}\right. $$
(42)

where r3 ∈ [0, 1] represents the probability of switching between the spiral-shaped path and shrinking methods.

The whales can also search on the TH by using a random solution THr, as follows:

$$ {TH}_i\left(g+1\right)={TH}_r-A\bigodot D,\kern0.75em {D}^{\prime }=\left|{TH}_r(g)-{TH}_i(g)\right| $$
(43)

According to [30], the process of updating the solutions depends on a, A, C, and r3. The current solution THi is updated using Eq. (41) when r3 ≥ 0.5; otherwise, it is updated using Eqs. (39)–(40) when |A| < 1 or Eq. (44) when |A| ≥ 1. The process of updating the solutions is repeated until the stopping criteria are satisfied.

3.5 Proposed method

In this section, the main steps of the proposed VPLWOA for determining the optimal threshold values for image segmentation are discussed. The VPLWOA depends on improving the VPL algorithm using the operators of the WOA. Hence, the method is called VPLWOA. In the VPLWOA, the Otsu’s function (as defined in Eq. (3)) is used to evaluate the quality of each solution.

The proposed approach begins by computing the histogram of the given image I, and then generates a random set of N teams (TH) as:

$$ {TH}_{ij}^f={LH}_j+\mathit{\operatorname{rand}}\times \left({HH}_j-{LH}_j\right),i=1,2,\dots, N,j=1,2,\dots, K, $$
(44)
$$ {TH}_{ij}^s={LH}_j+\mathit{\operatorname{rand}}\times \left({HH}_j-{LH}_j\right),i=1,2,\dots, N,j=1,2,\dots, K, $$
(45)

where LHj and HHj are the lower and higher histogram values at the jth dimension. The next step in the proposed VPLWOA approach is to create the league schedule and evaluate the quality of each team THi by computing the objective function (as defined in Eq. (2)). Then, the VPLWOA performs the competition between each team to determine the loser and winner teams using Eqs. (9)–(10). Knowledge sharing, repositioning, and substitution strategies are used to improve the behavior of the loser teams; whereas, the leading role strategy is applied for the winning teams. Thereafter, the behaviors of all competitive teams are enhanced during the modified learning phase (the main contribution). The VPLWOA can simultaneously update the behavior of the team by using the operators of the WOA and traditional learning phase, as shown in the following equation:

$$ {TH}_i^f=\left\{\begin{array}{c} Traditional\ learning\ phase,\kern2em {Prob}_i>{r}_5\\ {} Operators\ of\ WOA,\kern5.25em otherwise\end{array},\right. $$
(46)

where r5 ∈ [0, 1] is a random number used to switching between the VPL and WOA. The Probi represents the probability of the fitness function (fi) for the ith team and is defined as follows:

$$ {Prob}_i=\frac{f_i}{\sum_{i=1}^n{f}_i}. $$
(47)

The next step in the proposed VPLWOA is to use the promotion and relegation and season transfer processes similar to the traditional VPL. The previously mentioned steps are performed until the terminal criteria are satisfied. The full steps of the developed VLPWOA are given in Algorithm 1.

figure a

4 Experiments and discussion

In this section, a set of experimental series is performed to verify the performance of the proposed VPLWOA method. Two different sets of images are also used, and the results of VPLWOA are compared with other methods. The parameter setting and performance measure to evaluate the performance of the algorithms are discussed in this section. Then, experimental series one is performed using the first set of images that contains eleven images. Experimental series two is performed using the second set of images that have six medical graphics for leukemia blood cells.

4.1 Parameter setting

The results of the proposed VPLWOA are compared with the other five methods. These methods are social-spider optimization [37], sine–cosine algorithm [35], FA [21], WOA [9], and traditional VPL [32]. These approaches are selected because their performance is established in several fields, including image segmentation. However, the VPL is used for the first time in image segmentation.

The value of the parameters for each algorithm is set similar to the original reference. The size of the population and the maximum number of iterations are set at 25 and 100, respectively. Each algorithm was executed 25 independent times along with each threshold level overall the tested images. A total of eight different levels of the threshold are used to segment each image to two, four, six, eight, 10, 16, 18, and 20. All the algorithms are implemented using MATLAB 2017b, which is installed in Windows 10 (64 bits).

4.2 Performance measures

A set of three performance measures are used to verify the performance of proposed VPLWOA, including peak signal-to-noise ratio (PSNR) Eq.(48), structural similarity index (SSIM) Eq. (50), fitness value (Otsu’s method is used as a fitness function), and CPU time. All results are tabulated and summarized in figures.

$$ PSNR=20{Log}_{10}\left(\frac{255}{RMSE}\right), $$
(48)
$$ RMSE=\sqrt{\frac{\sum_{i=1}^M{\sum}_{j=1}^Q{\left(I\left(i,j\right)-{I}_s\left(i,j\right)\right)}^2}{M\times Q}} $$
(49)
$$ SSIM\left(I,{I}_s\right)=\frac{\left(2{\mu}_I{\mu}_{I_s}+{c}_1\right)\left(2{\sigma}_{I,{I}_s}+{c}_2\right)}{\left({\mu}_I^2+{\pi}_{I_s}^2+{c}_1\right)\left({\sigma}_I^1+{\sigma}_{I_s}^2+{c}_2\right)}, $$
(50)

where I and Is are the original and segmented images, respectively; μI and \( {\mu}_{I_s} \) are the mean intensities; \( {\sigma}_I^1 \) and \( {\sigma}_{I_s}^2 \) determine the standard deviation; σ is the covariance; c1 = 6.502; and c2 = 58.522.

4.3 Experimental series 1: benchmark images

In this experimental series, a set of eleven benchmark images are used to evaluate the accuracy of the VPLWOA to determine the optimal threshold values. These images have different properties, such as variant size, and resolutions. The histogram for the tested images is given in Fig. 2.

Fig. 2
figure 2figure 2figure 2

Original images and their histogram

The comparison results of the VPLWOA with the other five methods are given in Figs. 5, 6, 7, 8 and 9 and Table 2 and For further analysis, the CPU time results for each algorithm are recorded in Table 3. From this table, the VPLWOA achieved the best results in 21 cases and is ranked third after both WOA (with 27 cases) and SSO (with 24 cases). The SCA obtained the fourth rank (with 10 cases) followed by the FA (with 6 cases), it was ranked fifth. Whereas, the VPL was considered as the slowest algorithm in the experiments. The VPLWOA showed good CPU time in a large threshold than the smallest one.

Table 4 whereas, Fig. 3 shows a sample of a segmented image and its histogram with the corresponding thresholds at level 8. The results of the PSNR measurement are listed in Table 1 and Fig. 4. As shown in this table, VPLWOA has achieved the best results in 26 cases out of 88 (11 images × eight thresholds), followed by SSO (with 15 cases), WOA (13 cases), VPL (12 cases), FA (12 cases), and SCA (10 cases). Moreover, the VPLWOA has obtained the best PSNR values in most images in six thresholds out of eight (i.e., two, four, eight, 10, 18, and 20); whereas, in thresholds six and 16, it performed equally with SSO, VPL, and WOA. In addition, Fig. 4 illustrates the PSNR ranking of the algorithms overall thresholds and images. The proposed VPLWOA method is better than the other algorithms, whereas Fig. 5 shows the average of the PSNR values for all algorithms at each threshold level.

Fig. 3
figure 3

Results of histogram and corresponding thresholds over a segmented image at threshold eight. a FA, b SCA, c SSO, d VPL, e WOA, f VPLWOA

Table 1 Results of the PSNR measurement
Fig. 4
figure 4

PSNR ranking of all algorithms

Fig. 5
figure 5

Average of the PSNR for all algorithms at each threshold level

The results of the SSIM measurement are shown in Table 2 and Fig. 6 (a). As shown in the table, VPLWOA has achieved the best results in 23 cases out of 88 (11 images × 8 thresholds), followed by WOA (with 18 cases), FA (with 16 cases), SCA (with 12 cases), VPL (with 12 cases), and SSO (with seven cases). Besides, the VPLWOA has obtained the best SSIM values in most images in threshold 18 and performed equally with WOA in thresholds 10 and 16. At threshold 2, all algorithms obtained the best SSIM value in two images except for SSO. The VPLWOA and FA outperformed all other algorithms in three images for each one in thresholds four and 20. However, the best algorithms are SCA and WOA at thresholds six and eight, respectively, followed by VPLWOA, VPL, and FA. Moreover, Fig. 8(a) illustrates the SSIM ranking of the algorithms overall thresholds and images. This approach achieved better results than other algorithms, whereas, Fig. 7 shows the average of the SSIM values for all algorithms at each threshold level.

Table 2 Results of SSIM measurement
Fig. 6
figure 6

a SSIM ranking of all algorithms. b Ranking of the fitness values

Fig. 7
figure 7

Average of the SSIM for all algorithms at each threshold level

The results of the fitness value are illustrated in Table 3. As shown in the table, VPLWOA has achieved the highest fitness value in 26 cases out of 88 (11 images × eight thresholds), followed by FA (with 17 cases), SSO (with 16 cases), WOA (with 14 cases), VPL (with 12 cases), and SCA (with three cases).

Table 3 Results of the fitness value for all algorithms

The VPLWOA has obtained the high fitness values in most images in thresholds four, six, and 20 and performed equally with WOA and VPL in threshold two. In thresholds eight, 10, 16, and 18, VPLWOA performed nearly like WOA, VPL, SSO, and FA. The SSA is the worst one among all the algorithms. Figure 8 shows the average of the fitness values for all algorithms at each threshold level.

Fig. 8
figure 8

Average of the fitness values for all algorithms at each threshold level

Based on these results, VPLWOA outperformed the other algorithms with 30%, 26%, and 30% for PSNR, SSIM, and fitness value, respectively, thereby indicating that the VPL is improved using WOA as a local search.

For further analysis, the CPU time results for each algorithm are recorded in Table 4. From this table, the VPLWOA achieved the best results in 21 cases and is ranked third after both WOA (with 27 cases) and SSO (with 24 cases). The SCA obtained the fourth rank (with 10 cases) followed by the FA (with 6 cases), it was ranked fifth. Whereas, the VPL was considered as the slowest algorithm in the experiments. The VPLWOA showed good CPU time in a large threshold than the smallest one.

Table 4 CPU time was obtained by each algorithm

Moreover, the results can be summarized as in Fig. 9. This figure illustrates the CPU time ranking of the algorithms overall thresholds and images. Whereas Fig. 10 shows the average of CPU time for all algorithms at each threshold level.

Fig. 9
figure 9

CPU time ranking of all algorithms

Fig. 10
figure 10

Average CPU time for all algorithms at each threshold level

4.4 Experimental series 2: medical images

In this experiment, the performance of the presented algorithm is assessed to determine the optimal threshold to segment a medical dataset. This dataset contains a set of lymphoblastic leukemia image database [27], which is classified into two groups (for more details, see [27]). The main task of this experiment is to segment the leukocytes (darker cells). However, this task is difficult because the blood cells do not have the same abnormalities that can influence the performance of the segmentation method. The VPLWOA is compared with the same algorithms used in previous experiments with the same parameter settings. Figure 11 shows the tested blood cell images with their histogram. These images have different characteristics.

Fig. 11
figure 11

Original and histogram of the blood cell images of leukemia image

The results of PSNR and SSIM measures of the VPLWOA method against the other methods are given in Table 5 and Figs. 12 and 13; whereas, Fig. 14 shows a sample of segmented Leukemia image and its histogram with corresponding thresholds at threshold level 8.

Table 5 Results of blood cell segmentation

Concerning PSNR, the results illustrate that the VPLWOA has achieved the best results in 19 cases out of 48, followed by SSO with 14 cases; whereas, VPL and SCA obtained similar results (five cases for each one). The WOA came in the fifth rank with four cases, followed by FA with one case only. Moreover, the VPLWOA has the best PSNR values in threshold four and the highest threshold levels (i.e., eight, 10, 16, 18, and 20), while it came in the second rank in threshold levels two and six after SCA and SSO, respectively.

In terms of SSIM, the VPLWOA has obtained the best SSIM results in the highest threshold levels (i.e., eight, 10, 16, 18, and 20), while it came in the second rank in threshold levels two and six after SCA and four after SSO, as shown in Table 5.

Figure 12 illustrates the ranking of the algorithms overall thresholds and images for the PSNR and SSIM. As shown in this figure, the VPLWOA method is better than all other algorithms.

Fig. 12
figure 12

Ranking of the (a) PSNR measure. (b) SSIM measure

Besides, Fig. 13 depicts the average of PSNR and SSIM overall, the tested image at each threshold level. From this figure, it can be noticed the high ability of the proposed VLPWOA to find the optimal threshold value that improves the quality of the segmented image, and this reflected from the PSNR and SSIM values.

Fig. 13
figure 13

Comparison between the VPLWOA and the other algorithms in terms of PSNR and SSIM in blood cell segmentation. a PSNR measure, b SSIM measure

Fig. 14
figure 14

Results of the histogram and corresponding thresholds over a segmented image at threshold eight. a FA, b SCA, c SSO, d VPL, e WOA, f VPLWOA

Based on the previous discussion, the proposed VPLWOA image segmentation outperforms the other methods. However, this approach has some limitations; for example, the time complexity needs to be improved, which can be decreased by enhancing the other phases of the VPL.

In addition, the parameters of the VPL algorithm need a suitable value to be determined. More efficient methods, such grid search, can be used to solve this problem. In the future, we can evaluate the proposed method over different applications and fields such as image retrieval and feature selection; moreover, we can develop it to work with the salient object detection (SOD) methods. SOD works to save the most visually distinctive items in an image [15, 17, 52], which can effectively improve the segmentation results, especially with the blood cell image segmentation.

5 Conclusions

This study introduces an alternative multilevel image segmentation method. The proposed method is called VPLWOA, given that it uses the operators of WOA to improve the learning phase of the traditional VPL algorithm. This phase has the main effect on the performance of the VPL. The proposed VPLWOA uses the histogram of the image as the input for maximizing the Otsu’s function to find the best threshold to segment the given image. The performance of the proposed VPLWOA is verified through a set of experiments using two datasets, and the results are compared with SSO, SCA, FA, VPL, and WOA. The experimental results show that the proposed VPLWOA outperforms the other algorithms in terms of PSNR, SSIM, and fitness function.

According to the promising results, the proposed method can be used in many other applications and subjects in future, such as feature selection and improving the clustering and classification of galaxy images. Also, the method can be applied in cloud computing and big data optimization.