1 Introduction

Nature has assembled itself with a huge number of physical, chemical, biological, and logical phenomena, and all these activities are best optimized to make everything optimal in its way. Considering this universal fact, researchers have involved structuring these phenomena in finding optimal values of parameters of different nonlinear, complex, and constrained problems of real-life. These methodologies of developing optimization algorithms based on natural phenomena are termed meta-heuristic optimization techniques as they use advanced search techniques to optimize any problem. Some of the popular metaheuristics in the literature are Genetic Algorithm (GA) [30], Particle Swarm Optimization (PSO) [37], Differential Evaluation (DE) [65], Tug of war Optimization (TWO) [36], Interior search algorithm (ISA) [23], Teaching Learning Based Optimization (TLBO) [60], Symbiosis Organisms Search (SOS) [15], Harmony Search (HS) [25], Butterfly Optimization Algorithm (BOA) [4] etc. The main advantages of these methods throughout optimization are simplicity, derivation free mechanism, flexibility, reliability, accuracy, and user-friendly nature. These algorithms start with some randomly generated candidate solutions and obtain the optimal solution by exploring and exploiting the search domain until the termination criteria match. The literature survey shows that no single meta-heuristic is efficient enough to find optimal solutions for all sorts of problems (according to the No Free Lunch theorem [71]). Because of the improper balance between global exploration and local exploitation, most of the algorithms face some limitations while executing the algorithms for solving different optimization problems. Some of the drawbacks of existing algorithms are premature convergence, trapping in local optimal, weak exploration, etc. making the algorithm somewhat inefficient in solving complex analytical, complicated machine learning and complex modeling problems. So, researchers are in search of better meta-heuristics that can solve most of the problems efficiently. There are mainly two ways to develop a balanced and powerful metaheuristic. These are hybridizing two or more metaheuristics and enhancement or improvement or modification of existing methods. A large number of works can be found in literature in both of the above aspects. Hybrid algorithms combine the better features of two or more methods to develop a powerful and efficient algorithm. Literature shows that hybridization is one of the dominant techniques to produce better algorithms. Some of the recent hybrid methods can be seen in [8, 9, 11, 16, 19, 47, 50, 51, 53, 57, 58, 64]. On the other hand, the modification or enhancement of an algorithm may improve the algorithm’s efficiency by making a better trade-off between exploration and exploitation of the algorithm with the aid of mathematical, physical, or some other techniques. A good number of enhanced algorithms may be found in literature in [13, 17, 26, 34, 40, 54, 77, 78].

Butterfly optimization algorithm (BOA) is one of the recently introduced algorithms developed by Arora and Singh [4]. BOA mimics the biological activities of butterflies in searching for food and mating pair. Recently, BOA has gained popularity and is adapted for a different scope of works in optimization. Some of the recent works done on BOA are as follows: hybrid BOA and ABC [6], mutated BOA [18], improved BOA with chaos [5], binary BOA approaches for feature selection [3], m-MBOA [43], modified BOA [7] etc.

Symbiosis organisms search (SOS) is a popular meta-heuristic optimization algorithm developed by Cheng and Prayogo [15]. SOS is inspired by the socio interactive relationships among different organisms in the ecosystem. SOS has been used in various fields, and many works have been done on this algorithm. Some of the recent works on SOS are: a quasi-oppositional-chaotic SOS [67], discrete SOS with excellence coefficients and self-escape [70], multi-objective modified adaptive SOS [66], hybrid SOS algorithm [52], improved SOS algorithm [49], quasi-oppositional SOS algorithm [48] and so on. For more details, one may see [21].

Motivated by the simplicity and effectiveness of these two algorithms BOA and SOS, in this paper, a hybrid BOA, namely MPBOA, has been introduced by utilizing the mutualism and parasitism strategy of the SOS algorithm with BOA. The primary purpose of using the two phases of SOS is to enhance BOA’s exploration and exploitation ability. In BOA, the high value of switch probability increases each butterfly’s chances of being attracted to the best butterfly without searching the entire search area [21], which makes the algorithm weak in exploitation. On the other hand, SOS’s mutualism phase has good exploitative ability due to the mutualism between the two individuals other than the best one. Moreover, the replacement of inferior individuals by parasite vector helps the SOS increase the explorative capability [48]. In the basic BOA, the individual butterfly chooses either a global phase or a local phase, i.e., a candidate either explores or exploits in each iteration.

Nevertheless, in the hybrid MPBOA, a candidate simultaneously explores and exploits the search space in each iteration. For better trade-off between exploration and exploitation, the value of switch probability is considered as 0.5, so that an equal number of candidates turns up for each phase (while in original BOA, the same was considered as 0.8). So, the present work uses the mutualism phase and parasitism phase in BOA to enhance its explorative and exploitative abilities to enrich the algorithm. To evaluate the proposed algorithm’s efficiency, we have tested and validated the algorithm with twenty-five (25) classical benchmark functions and compared the results with those of several state-of-the-art meta-heuristics DE, PSO, SOS, BOA, SCA, and JAYA. To examine the convergence speed, the convergence graph of MPBOA and other algorithms are plotted, and found that the proposed MPBOA converges faster than the compared algorithm. For more illustration, two statistical tests Friedman rank test and t-test are conducted to show the statistical superiority of the MPBO. The consistency of the proposed algorithm is verified from the box plot analysis. Moreover, four real-life constrained optimization problems, I-beam vertical deflection problem, three bar truss design problem, cantilever beam design problem, and tension/compressor spring design problem are solved to examine its problem-solving capability.

Image segmentation is the way toward dividing a picture or an image into various homogenous areas, each containing pixels with comparative properties like concentration and texture. It is generally considered as a significant pre-processing phase in applications, for example, object identification and following, and clinical image examination [14, 22, 39]. One of the generally utilized strategies for image segmentation is known as thresholding. It may be categorized into bi-level and multi-level thresholding, relying upon the number of locales. In bi-level thresholding, the pixels of an image are ordered into two regions where the gray levels are more than or lesser than a specific threshold, whereas, in multi-level thresholding, an input picture is segmented into various separate regions with multiple thresholds [2, 12, 33].

In bi-level and multi-level thresholding, the optimal thresholds can be obtained utilizing parametric or non-parametric approaches [28]. A probability density function (pdf) is allocated to every region in the parametric approach, where the distribution parameters are calculated through the least-squares technique. In the non-parametric methods, the histogram thresholding technique is generally used for optimal thresholding by optimizing an objective function based on criteria such as between-class variance [56] or entropy [35].

Of late, various nature-inspired optimization algorithms have been applied to obtain the optimal threshold for multilevel thresholding. Some of the works can be found in [1, 31, 55, 72,73,74]. Some of these methods have shown promising results in the segmentation of images with significantly lesser computational complexity for multilevel thresholding using the Otsu’s criterion [56] or Kapur’s entropy [35]. Though these methods show promising results to obtain optimal thresholds compared to the parametric approaches, they suffer from slow convergence and have the possibility to entrap in local optima, which affects the superiority of the solution [38]. As we already mentioned, the hybridization of two or more nature-inspired optimization algorithms provides a better balance between an algorithm’s search process, so the hybrid algorithms are a good alternative to improving solution quality and convergence speed of the algorithms to solve the image segmentation problem. Some of the hybrid methods used for image segmentation problem in literature can be seen in [20, 27].

In the present work, the proposed MPBOA is employed to optimize the thresholds for the image segmentation problem and the results are compared to those of several metaheuristics and found that MPBOA is a comparatively better optimization method in finding the optimal thresholds for the image segmentation problem. From the numerical results, statistical analysis, convergence graphs, and results of real-world problems, and multilevel thresholding image segmentation problem, it is found that that proposed MPBOA is highly competitive in terms of its numerical results and convergence speed compared to several state-of-the-art algorithms.

The rest of the paper is organized as follows: the component algorithms BOA and SOS are described in Section 2 and Section 3. The proposed algorithm is elaborated in Section 4. Section 5 deals with the experimental platform. Section 6 describes the results and discussions about the performance of the algorithm on benchmark functions. Applications of this hybrid method in different real-life constrained problems are described in Section 7 and Section 8 and compare it with other algorithms. In Section 9 , the MPBOA has been employed to solve the multilevel thresholding problem. Finally, the conclusion and future scope of the proposed MPBOA is given in Section 10.

2 Butterfly optimization algorithm

BOA [4] is a relatively new optimization algorithm developed through mimicking the natural phenomena for food foraging and mating pair search behavior of butterflies. In this algorithm, butterflies are considered search agents that can move throughout the search space for better fitness. In butterflies, many sense receptors, known as chemoreceptors, are scattered over the whole body. These chemoreceptors are used by the butterflies to smell the fragrance. It is well assumed that every butterfly generates fragrance with a particular intensity, and this intensity of the fragrance is further correlated with the fitness of that particular butterfly in BOA. So, different search agents have different fitness values in a particular iteration of BOA. Whenever a butterfly changes its position in the search space, the butterfly’s fitness value changes automatically. Thus, butterflies can search the maximum search space if the movement can be controlled smartly. The algorithm also follows a collaborative social knowledge network that can be explained by how the fragrance generated by each butterfly is propagated over a distance in search space, and all the butterflies sense this promulgated fragrance of each butterfly in that search space. The butterflies’ searching is performed in two phases: the global search phase and the local search phase. When a butterfly in the system inhales the fragrance released by the best butterfly within the neighborhood, the butterfly tries to move towards the best butterfly for up-grading its fitness value, and this phase is called the global search phase of the algorithm. Sometimes, it may happen that a butterfly does not receive any fragrance emitted by other butterflies for some reason. In that situation, the butterfly follows a random movement in the search space called the local search phase in the BOA algorithm.

In BOA, the fragrance is the main characteristic, and the fragrance of each butterfly has its aroma and individual trace. According to the Stevens power law [6], sensation magnitude grows as power functions of stimulus intensities that produce them. Mathematically, we can write

$$ \psi=k*\phi^{\theta} $$
(1)

where ψ symbolizing the sensation magnitude; ϕ, the magnitude of the physical stimulus; θ, the power exponent and k, a proportionality constant that depends on the units used. Here, generalized sensation magnitude is defined for the different sensing such as fragrance, light, sound, heat, etc. and processing of the modalities of these senses follow (1). In the case of BOA, we are interested only in smell or fragrance. To avoid the confusion, we use the same notation as has been used by the authors in the original BOA [4]. So, the (1) is re-written as,

$$ f=c*I^{a} $$
(2)

where c is the sensory modality; f, intensity of fragrance generated; a, power exponent, and I is the stimulus’s magnitude. The natural behaviour of butterflies depends on two essential factors, such as the variation of sensor stimulus (I) and the formulation of the magnitude of f. For easy understanding and the algorithm’s sake, in BOA, the magnitude of the sensor stimulus (I) is associated with the fitness values of butterflies. On the other hand, f is relative because the fragrance of each butterfly is sensed by other butterflies. In Steven’s power law [6], to differentiate the sense of fragrance from other senses, the sensory modality (c) is used. It may be noted here that, if a butterfly with less value of I moves toward another butterfly having a higher value of I, then the value of f increases more rapidly than I. So the value of f should be allowed to vary with such a degree of absorption which can be achieved by the variation of power exponent (a).

BOA has three phases, initialization phase, iteration phase, and the final phase. Initially, the algorithm defines the objective function, the domain of the solution, values of all parameters, and generates the initial population within the search space. The number of search agents (butterflies) remains unchanged throughout, and that is why a fixed size memory is allocated to store the information of the search agents. This phase is known as the initial phase of the algorithm. As already discussed above, there are two steps in the iteration phase, namely the global search phase and the local search phase. At the end of each iteration, butterflies update themselves, and the fitness values of the butterflies are obtained.

In the global search phase, a butterfly moves towards the best butterfly in the domain, searching for food and thus updates its fitness value. Mathematically, this movement is represented as

$$ {Pop}_{i}^{new}=Pop_{i}+(r^{2}*g^{best}-Pop_{i} )*f_{i} $$
(3)

where, Popi is the ith butterfly and gbest, the current best solution in a particular stage, fi is the fragrance of ith butterfly and r, a random number in [0, 1].

When a butterfly cannot sense any fragrance from other butterflies, it simply goes for a random walk. This phenomenon is termed as local phase, and it is mathematically represented as

$$ {Pop}_{i}^{new}=Pop_{i}+(r^{2}*Pop_{j}-Pop_{k} )*f_{i} $$
(4)

where, Popj and Popk are respectively the jth and kth butterflies selected randomly from the current population, and r is a random number in between 0 and 1. The pseudo-code for BOA given in Table 1.

Table 1 Pseudo-code for BOA

3 Symbiosis organisms search algorithm

SOS is another promising optimization technique inspired by the socio-ecological behavior of interactive swarms to survive and propagate in the ecosystem. This algorithm is constructed mainly based on three interactive relationships of ecosystem, mutualism, commensalism, and parasitism. Here, different species are treated as individuals in the population for the algorithm and benefited (sometimes harmed) from the other organisms/species and update themselves to survive and propagate in the ecosystem. Mimicking this concept, the SOS algorithm was developed by Chen and Prayogo in 2014. SOS starts with some randomly generated solutions as the population for the system. Consequently, mutualism, commensalism, and parasitism phases are respectively executed to upgrade the population, and finally, function evaluation is done for each individual to check the updated population. The mutualism, commensalism, and parasitism phases are elaborated below:

3.1 Mutualism

The mutualism is an interactive relationship between two species where both of the species are benefited from each other i.e., a mutual benefit takes place. This phenomenon can be formulated as below:

$$ {Pop}_{i}^{new}=Pop_{i}+r_{(0,1)}*(Pop_{best}-Mut_{Vec}*BF1) $$
(5)
$$ {Pop}_{j}^{new}=Pop_{j}+r_{(0,1)}*(Pop_{best}-Mut_{Vec}*BF2) $$
(6)
$$ Where, Mut_{Vec}=(Pop_{i}+Pop_{j})/2 $$
(7)

Here Popi and Popj are two individual solutions selected from the population and Popj is randomly selected from the ecosystem for each Popi. Popbest represents the best individual in the population with the strongest fitness. MutV ec represents the relationship between the two organisms and is calculated by the (7). BF1 and BF2 are the benefit factors taken randomly as 1 or 2, indicating that one organism may get no or maximum amount of benefit from the interaction.

3.2 Commensalism

After updating the mutualism phase, the organisms use the commensalism interaction where only one species gets benefitted through interaction with another randomly selected species, but the other species neither gets benefitted nor be harmed. The mathematical formulation is as follows:

$$ {Pop}_{i}^{new}=Pop_{i}+r_{(-1,1)}*(Pop_{best}-Pop_{k}) $$
(8)

Where Popi is the updated solution of ith member of the population after mutualism phase. Popk is randomly selected organism other than Popi. \({Pop}_{i}^{new}\) is the new value of ith population after commensalism phase.

3.3 Parasitism

Once the mutualism and commensalism phases are over, the parasitism phase is executed. In this phase, a parasite vector is developed by duplicating the Popi organism. Then a random number is generated depending on which randomly selected dimensions are modified. The newly modified candidate is treated as a parasite, and the Popi serves as the host. If the objective function value of the parasite is better than that of the host, the parasite will kill the host and occupy its position; otherwise, the parasite will be destroyed. The pseudo-code of the SOS algorithm is given in Table 2.

Table 2 Pseudo-code of the SOS algorithm

4 Proposed hybrid MPBOA

Achieving the proper balance between global exploration and local exploitation is crucial for developing an effective and reliable optimization technique. If the exploration property is dominating, the algorithm searches for some unwanted areas and sometimes may divert from the correct path of goal, whereas, when exploitation is more potent, the populations suffer from the loss of diversity, causing premature convergence. In this proposed work, the main goal is to achieve the local optima avoidance, proper diversification as well as intensification, and speed up the convergence by maintaining a better trade-off between exploration and exploitation characteristics of the algorithm.

In this study, a novel hybridized optimization technique, MPBOA, has been suggested by attaching the global exploration and local exploitation abilities of SOS with BOA. The original BOA has shown an efficient performance by exploring and exploiting the search space controlled by switching probability to obtain the global optimal result. The original BOA decides that the population’s diversity is maintained when the butterflies are allowed for global exploration, whereas, intensifies when the population opts for local search. However, by the literature survey, it has been found that the high value of switch probability (p = 0.8) causes the algorithm to be weak in exploitative characteristics. According to Arora and Singh [4], BOA has a proneness to have premature convergence to local optima. In the present study, a modified hybrid BOA has been suggested where the mutualism phase of SOS is attached to the global search phase of BOA, and the parasitism phase of SOS is attached to the local search phase of BOA. These modifications make the proposed algorithm an efficient and robust one. Thus, any candidate from the population (butterfly) definitely explores and exploits the entire search space, making the algorithm balanced. In the original BOA, one butterfly could either explore or exploit in a single iteration. However, every butterfly now explores and exploits the search space in all iterations due to these modifications. The pseudo-code of proposed MPBOA has been given in Table 3.

Table 3 Pseudo-code of the proposed MPBOA

Next, for better performance of the proposed MPBOA, we have evaluated the results on different values (0.5, 0.6, 0.7, and 0.8) of switch probability. The mean and standard deviation results with different switch probability for twenty-five test functions (given in Table 4) are shown in Table 5. It may be observed from Table 5 that at p = 0.5, the proposed method works better. The other parameters used in this algorithm are the power of exponent (a), taking value within [0.1, 0.3]. Initially, the value of \(^{\prime }a^{\prime }\) starts from 0.1 and increases along with the course of iteration linearly to 0.3. The value of sensory modality (c) is taken as 0.01. The parameters opted from SOS are benefit factor 1 (BF1) and benefit factor 2 (BF2), whose values are either 1 or 2 and taken randomly.

Table 4 Details of benchmark functions used in this study
Table 5 Simulation results of MPBOA with different switch probability (p) values

The details of the proposed technique are briefly described below:

4.1 Initialization

The candidates of the population is initialized using the (9) given by:

$$ Pop_{i}=L_{bound}+r*(U_{bound}-L_{bound} ) $$
(9)

where Popi is the ith population and r is a random number between (0,1). Lbound, Ubound are the lower and upper limit values for the population, for respective dimensions.

4.2 Fragrance generation

After initialization, each butterfly generates some fragrance using (10).

$$ f_{i}=c*I^{a} $$
(10)

where fi is the fragrance generated by ith butterfly. I is the stimulus intensity, determined by the function evaluation of the ith butterfly. After fragrance generation, locate the best population with a more significant fragrance among all butterflies and save it.

4.3 Selection of phases

A random number r between 0 and 1 is generated and checked with the switching probability in this phase. Here, mainly two options are involved. If r < 0.5, then option 1 is selected. In this option, the population first explores the search space using (11).

$$ Po{p}_{i}^{t+1}=Po{p}_{i}^{t}+(r^{2}*Pop_{best}-Po{{p}_{i}^{t}} )*f_{i} $$
(11)

where, \(Po{p}_{i}^{t}\) is the ith butterfly at tth iteration, Popbest is the best butterfly in the search space, and fi is the fragrance generated by ith butterfly. Then, mutualism phase of SOS is introduced which is, formulated as (12) and (13)

$$ Po{p}_{inew}^{t+1}=Po{p}_{i}^{t+1}+rand(0,1)*(Po{p}_{best}^{t}-Mut_{Vec}*BF1) $$
(12)
$$ Po{p}_{jnew}^{t+1}=Po{p}_{j}^{t+1}+rand(0,1)*(Po{p}_{best}^{t}-Mut_{Vec}*BF2) $$
(13)
$$ Mut_{Vec}=((Po{p}_{i}^{t}+Po{p_{j}^{t}}))/2 $$
(14)

where, \(Po{p}_{j}^{t}\) is randomly selected population other than \(Po{p}_{i}^{t}\) in tth generation and Popinew, Popjnew are the updated new populations.

On option 2, i.e. when r ≥ 0.5, the butterfly first chooses the parasitism phase of SOS by the following steps:

By duplicating a butterfly Popi, an artificial parasite (AP) is created in the search space. If AP has a better fitness value than a randomly chosen individual Popj, it will kill Popj and will occupy its position in the system. If the fitness value of Popj is better, Popj will have immunity from the parasite, and the AP will no longer be able to live in that ecosystem.

After the parasitism phase, the population will go for the local search phase as BOA using (15)

$$ Pop_{i}^{t+1}=Po{p}_{i}^{t}+(r^{2}*Po{p}_{j}^{t}-Po{p}_{k}^{t} )*f_{i} $$
(15)

Once all steps are executed, function evaluation for each candidate is obtained, and these evaluated solutions are compared with those of the previous solutions. If the updated solutions are superior to the previous one, replace the previous solution with the updated solution. The flowchart and pseudo-code are presented in Fig. 1 and Table 3.

Fig. 1
figure 1

Flow chart of proposed MPBOA

5 Experimental platform

The experimental platform includes various fields like choosing a benchmark for simulation, choosing a different algorithm for comparison, setting up the parameters etc. All these are discussed below:

5.1 Numerical benchmarks functions

In finding the efficiency of the proposed MPBOA, we need to check its superiority with other state-of-the-art algorithms. Here, we have checked the efficiency of MPBOA on different common control parameters and algorithm-specific parameters. For this, the algorithm has been evaluated with different switch probabilities (0.5, 0.6, 0.7, and 0.8) and different population sizes (30, 50, and 100) with 25 numbers of standard classical benchmark problems. These benchmarks can further be categorized into groups such as unimodal, multimodal, separable, non-separable. The details of the benchmark functions are given in Table 4, and the results of these benchmark functions for different switch probabilities and different population sizes are presented in Tables 5 and 6. The best results are given in bold face for all the tables.

Table 6 Mean and standard deviation (std)of MPBOA with different population size

5.2 Parametric set-up of compared algorithms

All the algorithms have mainly two types of parameters viz. common control parameters and algorithm-specific parameters. In this paper, six algorithms have been taken to compare with the proposed methodology. The compared algorithms are BOA [4], SOS [15], SCA [46], PSO [37], DE [65], JAYA [59] where DE is an evolutionary-based algorithm, BOA, SOS, PSO are swarm intelligence based algorithm JAYA is a human-inspired algorithm and SCA is based on the oscillation towards and outwards with the circular trigonometric functions sine and cosine. All these algorithms have some parameters that should be initialized before the algorithm starts. In this paper, the common control parameters are taken same for all the algorithms, but the algorithm-specific parameters are different, and hence the values are also different, which are shown in Table 7.

Table 7 Parametric set up for different algorithm

6 Results and discussion

The results of the proposed MPBOA are obtained for different values of switch probability for 25 benchmark functions. In the original BOA, the switching probability (p) was taken as 0.8. In this study, the switching probability is checked with the values 0.5, 0.6, 0.7, and 0.8 to obtain the suitable value of switch probability for the present work. On the rigorous search, we had observed that the proposed MPBOA works better when p = 0.5. The mean and standard deviation (std) results on different switch probability values are depicted in Table 8. To examine the effect of population sizes, we have run the algorithm for different population sizes such as NP = 30, 50, 100 over 25 benchmark functions. The mean and standard deviation for each function with every population size are calculated and presented in Table 6. Observation of Table 6 confirms that the proposed MPBOA works best for NP = 100. By observing the algorithm’s performance for different switch probability and population sizes, finally, the mean and standard deviation results for each of the 25 functions are evaluated for p = 0.5 and NP = 100. Due to stochastic nature of the algorithm, each function is evaluated for 10,000 iterations and 30 independent runs for each iteration. All the calculations are performed in Matlab R2015a (8.5.0.197613) 64bit (win64). The performance results for all 25 functions for 100 population, 10,000 iterations, and 30 independent runs are recorded and presented in Table 8. Also, in Table 8, the performance results of six state-of-the-art algorithms, namely, DE, PSO, BOA, SOS, JAYA, SCA for all benchmark functions are presented. By comparison, the number of superior, similar, and inferior results in respect of proposed MPBOA compared to other algorithms are found out and shown in Table 9. With the aid of the Friedman rank test, the ranks are evaluated for all algorithms and presented in Table 10. For finding the significance of improvement in the solution obtained by MPBOA over other algorithms, a pair-wise t-test has been conducted, and the results are reported in Table 11. Furthermore, the consistency to achieve the optimal solution for the proposed MPBOA and other existing algorithms are evaluated using boxplots and is shown in Fig. 2

Fig. 2
figure 2

Boxplots of all the algorithms for functions 3, 6, 10, 12, 22, and 24

Table 8 Simulation results of different algorithms with 100 population and 30 execution each with 10,000 iterations
Table 9 Superiority, similarity and inferiority index with all the compared algorithm
Table 10 Friedman rank test for all the algorithms
Table 11 t-test statistics of paired differences of achieved optimum solution for each algorithm

Table 9 reports the number of superior, similar, and inferior solutions obtained by MPBOA to other algorithms (BOA, SOS, JAYA, SCA, DE, PSO) while solving 25 benchmark instances and the bar charts, given in Figs. 23 and 4 support the indexing. From the results of the table, it has been found that the proposed MPBOA is superior to BOA, SOS, JAYA, SCA, PSO, and DE for 10, 8, 20, 22, 25, and 10 number of instances, respectively. On the other hand, the proposed algorithm provides solutions similar to those of BOA, SOS, JAYA, SCA, PSO, and DE for 15, 17, 5, 3, 0, and 15 number of benchmark occasions, respectively. However, in none of the cases, the proposed MPBOA is inferior to other algorithms considered in this study. Also, the rank of the algorithms for each function is shown in pictorial graphs presented in Figs. 23, and 4.

Fig. 3
figure 3

Bar graph representation of mean performances of different algorithms

Fig. 4
figure 4

Bar graph representation of mean performances of different algorithms

For further analysis of obtained results regarding their mean performances, the study includes the Friedman rank test to rank each algorithm. The results of the Friedman rank test are presented in Table 10. From Table 10, it can be observed that the rank of proposed MPBOA is 1 with a minimum mean rank 2.42, which indicates the statistical superiority of the proposed algorithm.

Next, a pairwise t-test is conducted to determine the improvement in the solution obtained by MPBOA compared to other algorithms considered for this study. Table 11 illustrates the results of the t-test in 95% confidence interval while comparing the proposed MPBOA with other considered algorithms. During t-test, the proposed MPBOA is considered as term-2, and other algorithms are considered as term-1. According to this hypothesis, if the t-value and p-value of pair difference i.e., (performance of term-1) – (performance of term-2), is greater than 1.699 and less than 0.05, then term-2 significantly outperform term-1. However, pairwise t-test becomes non-applicable (N/A) if the solutions obtained by term 1 and 2 are identical. Based on the results of the t-value and p-value, it has been seen that the proposed MPBOA gives significantly better solutions while comparing with PSO, except for function-20. The result of the t-test for MPBOA vs. BOA indicates that the solution achieved by the MPBOA is significantly better compared to BOA for functions 1-3, 7, 14-17, 22, and 24. The t-test results while comparing MPBOA with SOS show MPBOA as a significantly better performer for function 14-17. The results of MPBOA vs. JAYA indicate that the performance of MPBOA is significantly better than JAYA for functions 1-4, 6, 7, 9, 11-18, 21-23, and 25. MPBOA vs. SCA results show MPBOA as a significantly better performer for function 4-7, 9, 11-18, 21-23. The MPBOA vs. DE indicates that the MPBOA performance is significantly better than DE for function 14-17 and 23. Thus, from the results of the t-test, it can be concluded that the proposed MPBOA performs significantly superior to BOA, SOS, JAYA, SCA, PSO, and DE for 10, 4, 19, 16, 24, 4 benchmark functions. Finally, to check the convergence speed, some of the convergence graphs are given in Fig. 5. From this figure, it is clear that the convergence rate of proposed MPBOA is faster than the compared algorithms.

Fig. 5
figure 5

Convergence graphs for some functions

Next, the consistency of all the algorithms is compared using the boxplot technique. Fig.2 shows the boxplots of all the algorithms for functions 3, 6, 10, 12, 22, and 24. From the figure, it appears that in all cases, MPBOA, along with SOS and DE are the most consistent algorithms while obtaining the optimum solution.

7 Real-world optimization problems

To find the efficiency of the proposed MPBOA in real-world problems, we have considered four real-world problems viz., I-beam vertical deflection, three bar truss design, cantilever beam design, and tension/compression spring design problem. The details of these problems with their mathematical formulations are presented in the following subsections:

7.1 I-beam vertical deflection problem

This problem belongs to the minimization of structural vertical deflection of an I-beam in the civil engineering field, given in Fig. 6. The main objective of this problem is to minimize vertical deflection i.e., f(x) = PL3/48EI where P denotes design load, L denotes the length of the beam (taken as 5200 cm), I indicates the moment of inertia, and E is the modulus of elasticity (taken as 523,104 kN/cm2). The objective function may further be considered as:

$$ Minimize~ f(B,H,T_{w},T_{f}) = 5000/((T_{w} (H-2T_{f}))/12+(B{{T}_{f}^{3}})/6+2BT_{f} ((H-T_{f})/2)^{2} ) $$

With two constraint of cross section area less than 300 cm2 and allowable bending stress less than 56 kN/cm2, can be express as:

$$ g_{1}=2*B*T_{w}+300*T_{w}*(H-2*T_{f}) \leq 300 $$
$$ g_{2}=(18*H*10^{4})/(T_{w} *(H-2*T_{f})^{3}+2BT_{W} (4*{T_{f}^{2}}+3*H* (H-2*T_{f} )))+(15*B*10^{3})/((H-2*T_{f} ) {T_{w}^{3}}+2*T_{w}* B^{3} )\leq56 $$
Fig. 6
figure 6

I-beam design problem

Where 10 ≤ b ≤ 50; 10 ≤ h ≤ 80; 0.9 ≤ tw ≤ 5; 0.9 ≤ tf ≤ 5

7.2 Three bar truss design problem

This design problem belongs to structural optimization in the civil engineering field. This problem’s main objective is to achieve the least weight subject to stress, deflection, and buckling constraints by manipulating two parameters. This problem is very commonly utilized because of its difficult, constrained search space. Various components used in this problem are shown in Fig. 7 below:

Fig. 7
figure 7

Three bar truss design problem

The problem formulation has been given with the constraints below:

$$ Minimize~ f(x)=(2*\sqrt{2}*x_{1} +x_{2})*l $$

Subject to

$$ g_{1}(x)=({\sqrt{2}*x_{1} +x_{2}})/({\sqrt{2}* {x}_{1}^{2}+2*x_{1} *x_{2} })* \rho-\sigma \leq 0 $$
$$ g_{2}(x)=x_{2}/({\sqrt{2}* {x}_{1}^{2}+2*x_{1} *x_{2} })* \rho-\sigma $$
$$ g_{3}(x)=1/({\sqrt{2}* x_{2}+x_{1} })* \rho-\sigma $$

Variable range 0 ≤ x1, x2 ≤ 1;

Where l = 100 cm; σ = 2 kN/cm2; ρ = 2 kN/cm2

7.3 Cantilever beam design problem

The cantilever beam includes five hollow elements with a square-shaped cross-section. Figure 8 shows that each element is defined by one variable while the thickness is constant, so there is a total of 5 structural parameters. It is seen in Fig. 8 that there is also a vertical load p applied to the free end of the beam (node 5), and the right side of the beam (node 1) is rigidly supported. The objective of this problem is to find the minimal optimum weight of the beam. There is also one vertical displacement constraint that should not be violated by the final optimal design.

$$ Minimize~ f(x)= 0.06224(x_{1} + x_{2} + x_{3}+ x_{4} + x_{5}); $$
$$ Subject~ to:~ g(x)= {61/{{x}_{1}^{3}}}+{ 37/{{x}_{2}^{3}}}+{19/{{x}_{3}^{3}}}+ {7/{{x}_{4}^{3}}}+{1/{{x}_{5}^{3}}}\leq 1; $$

Where 0.01 ≤ x1,x2,x3,x4,x5 ≤ 100;

Fig. 8
figure 8

Cantilever beam design problem

7.4 Tension/compression spring design problemm

This problem is related to the minimization of Tension/Compression spring weight subject to various constraints viz. deflection, shear stress, surge frequency, diameter, and design variables. There are mainly three design variables: wire diameter (d) range in (0.05, 2), mean coil diameter (D) ranges (0.25, 1.30), and several active coils (N) ranges (2, 15). The pictorial presentation of the problem is shown in Fig. 9. The problem can be formulated as:

$$ Minimize ~f(x)=(x_{3}+2)*x_{2}*{x}_{1}^{2} $$
$$ Subject ~to~~~ g_{1} (x)=1-({{x}_{2}^{3}} x_{3})/(71785{{x}_{1}^{4}} )\leq0 $$
$$ g_{2} (x)=(4{{x}_{2}^{2}}-x_{1} x_{2})/(12566 (x_{2} {{x}_{1}^{3}}-{{x}_{1}^{4}}))+1/(5108{{x}_{1}^{2}} )\leq0 $$
$$ g_{3} (x)=1-(140.45x_{1})/({{x}_{2}^{2}} x_{3} )\leq0 $$
$$ g_{4} (x)=(x_{1}+x_{2})/1.5-1\leq0 $$
Fig. 9
figure 9

Tension compression spring design problem

8 Results & discussion of real-world problems

8.1 I-beam vertical deflection

The above real-life problem has been solved, setting the stopping criteria as 10,000 iterations and then compared the result with some previously solved methods such as the adaptive response surface method (ARSM), cuckoo search (CS) [24], improved ARSM [69], flower pollination (FPA) [75], SOS [15] and JAYA [10] given in Table 12 . Table 12 depicts that MPBOA performs very efficiently to find the best minimum result for the said real-life problem compared to the other algorithms used for this comparison.

Table 12 Comparision analysis for minimize I-beam vertical deflection solved with different algorithms

8.2 Three bar truss design problem

The evaluation results of MPBOA are compared with other popular algorithm such as: ant lion optimization (ALO) [44], differential evolution with dynamic stochastic selection (DEDS) [76], hybrid PSODE [41], mine blast Algorithm (MBA) [62], Tsa [68], and CS [24]. The comparison results are provided in Table 13.

Table 13 Comparison results for three bar truss design problem solved with different algorithms

Table 13 confirmes that the MPBOA algorithm evaluates very competitive results, and its best solution occupies first ranked as the best solution. Thus, it is again reflected that the MPBOA algorithm can solve real constrained problems effectively. It should be noted that the optimal weight of the design obtained by Tsa violates one of the constraints.

8.3 Cantilever beam design problem

This real world problem has also been solved by MPBOA and the results are compared with that of MFO [45], MMA [68], GCAI [45], GCAII [45], CS [24], and SOS [15], given in Table 14. The results in Table 14 show that the MPBOA algorithm outperforms other algorithms and able to determine the global optimal result for these types of problems efficiently. The results show that the design with minimum weight belongs to the proposed algorithm MPBOA.

Table 14 Comparison results for cantilever beam design problem solved with different algorithms

8.4 Tension/compressor spring design problem

Several solutions may found in the literature for this problem. Some of the algorithms, solved this problem are as gravitational search algorithm (GSA) [61], MFO [45], PSO [29], evolution strategy (ES) [43], GA [43], HS [42], and DE [32]. The solutions to this problem for MPBOA and other algorithms mentioned above are compared in Table 15. From Table 15, it is seen that MPBOA’s performance is superior for finding the best minimum result.

Table 15 Comparison results for tension/compression spring design problem solved with different algorithms

9 Application of MPBOA in image segmentation

Image segmentation is an essential process to be done on a prior operation to investigate and understand the obtained image in a range of applications such as image analysis, object recognition, medical imaging, computer vision, autonomous target recognition, robotic vision, geographical imaging, and so on. In this process, an image is used to divide into various segments of pixel classes based on different features like gray-scale, color, and texture. In literature, a variety of techniques may be found for image segmentation, such as region-based techniques, clustering-based techniques, edge-based techniques, graph-based techniques, and thresholding-based techniques. Out of these techniques, the thresholding-based technique has some assured benefits, like small storage space, simple operations, strong robustness, high computational efficiency, and fast processing speeds. Hence, this thresholding-based technique has attracted researchers to use it in solving the image segmentation problem.

Further, this technique can be categorized into bi-level and multilevel thresholding based on the number of regions. In bi-level thresholding, two regions of image pixels find out, with gray levels larger or lesser than a specific threshold. So an input image is segmented into several distinct regions with multiple thresholds. In the non-parametric approaches, the thresholding method searches for optimal thresholds in the histogram by optimizing an objective function based on some criteria such as between-class variance or entropy [35]. However, all of these methods are computationally complex and less efficient due to the exhaustive search, especially when the number of thresholds increases.

In this section, the proposed algorithm is applied to solve the multilevel gray image thresholding problem using Kapur’s entropy method [35]. Image segmentation refers to the system where the image is divided into different parts by which the representations of objects used to be simplified for advanced processing. In multilevel thresholding to figure out the optimal value of thresholds is the main task. One of the well-known methods based on entropy criteria to find the optimal values of a threshold of an image is Kapur’s method. The detailed description of this method is given below:

9.1 Problem Description

Consider, a 2D gray-level intensity image as f(x,y), The values of f(x,y) is in gray level and is belonging to the range 0, 1, 2, ….. , L − 1. Let the number of pixels at intensity i are ni, and the total number of pixels in the image is N. the following equation can obtain the probability of occurrence for ith gray level:

$$ p_{i}=n_{i}/N $$
(16)

9.2 Kapur’s entropy method

The Kapur’s method [35] usually maximizes the entropy of the segmented classes to determine the threshold values. It utilizes the concept from Shannon’s entropy given in [63]. In Kapur’s method, the entropy of the image is defined with the assumption that the image is represented by its gray-level histogram. If there are m number of thresholds (T1,T2,...,Tm) to be determined and these thresholds are dividing the image into (m + 1) classes, namely (C0,C1,C2,...,Cm), then the Kapur’s method does it by maximizing the objective function:

$$ f(T_{1},T_{2},\ldots,T_{m} )=E_{1}+E_{2}+...+E_{m} $$
(17)

where,

$$ E_{0}=-\sum\limits_{i=1}^{T_{i}-1}{(p_{i}/\omega_{0})ln{(p_{i}/\omega_{0})}},\omega_{0}=\sum\limits_{i=0}^{T_{i}-1}p_{i} $$
(18)
$$ E_{k}=-\sum\limits_{i=T_{k}}^{T_{k+1}-1}{(p_{i}/\omega_{k})ln{(p_{i}/\omega_{k})}},\omega_{k}=\sum\limits_{i=T_{k}}^{T_{k+1}-1}p_{i}, k=1,2,....,m-1 $$
(19)
$$ E_{m}=-\sum\limits_{i=T_{m}}^{L-1}{(p_{i}/\omega_{m})ln{(p_{i}/\omega_{m})}},\omega_{m}=\sum\limits_{i=T_{m}}^{L-1}p_{i}, $$
(20)

where E1,E2,…,Em are the Kapur’s entropy and ω0,ω1,….,ωm represent the class probabilities of the segmented classes C0,C1,C2,...,Cm respectively.

9.3 Experimental platform for image thresholding

In this section, a descriptive presentation of the experimental platform is given to examine the performance of the proposed MPBOA on image segmentation. In the current research, six gray benchmark images, ‘cameraman’, ‘clock’, ‘couple’, ‘boat’, ‘bridge’, and ‘airport’ are considered for multilevel thresholding. The images are taken from USC-SIPI Image Database and presented in Fig. 10.

Fig. 10
figure 10

Benchmark images

The performance of MPBOA on the image segmentation problem is compared with BOA, ABC, SCA, HS, m-MBOA, and hybrid SCABC. The parameter setting of the present analysis is fixed with population size as 12 and 100 iterations.

The peak signal-to-noise ratio (PSNR) is used in the current study to evaluate segmented images’ superiority. The PSNR metric depends directly on the image intensity and demonstrates the accuracy of the segmented image. The PSNR value can be determined as follows:

$$ PSNR=10\log_{10}(255^{2}/MSE) $$
(21)
$$ MSE=(i/MN)\sum\limits_{i=1}^{M}\sum\limits_{j=1}^{N}[I(i,j)-J(i,j)]^{2} $$
(22)

where i and j represent the original and segmented images, respectively.

9.4 Results analysis

Here the experimental results of the newly proposed MPBOA for multilevel threshold schemes have been presented. The quality of segmented images is compared by the objective fitness given by Kapur’s entropy method and by the PSNR measure.

The best objective function values obtained by implementing the MPBOA, BOA, HS, ABC, SCA, SCABC, and m-MBOA algorithms using Kapur’s method are presented in Table 16, and their corresponding thresholds values have given in Table 17. The mean objective function values are presented in Table 18. It has been observed that for a small number of threshold values (m = 2 or 3), the objective function values are practically the same. Therefore, in the present study, results are presented corresponding to large thresholds (m = 4, 5, and 6). From the obtained results, it can be examined that the newly proposed MPBOA algorithm has achieved a higher value of the objective function in all test images from all the compared algorithms. All the segmented test images obtained by the MPBOA algorithm is presented in Figs. 1112131415 and 16. In the same figure, the fitted histogram and locations of thresholds for segmented images are also presented. The obtained PSNR values of segmented images are presented in Table 19 by implementing the BOA, HS, SCABC, ABC, SCA, MPBOA, and m-MBOA. The table clearly indicates either a competitive or better quality of segmented images obtained from the proposed hybrid method MPBOA than other algorithms. Hence, the overall analysis in terms of various performance metrics signifies the better ability of the proposed hybrid method MPBOA.

Fig. 11
figure 11

Segmented image, frequency and fitness convergence of Cameraman image at threshold = 4, 5, 6

Fig. 12
figure 12

Segmented image, frequency and fitness convergence of Clock image at threshold = 4, 5, 6

Fig. 13
figure 13

Segmented image, frequency and fitness convergence of Couple image at threshold = 4, 5, 6

Fig. 14
figure 14

Segmented image, frequency and fitness convergence of Boat image at threshold = 4, 5, 6

Fig. 15
figure 15

Segmented image, frequency and fitness convergence of Bridge image at threshold = 4, 5, 6

Fig. 16
figure 16

Segmented image, frequency and fitness convergence of Airport image at threshold = 4, 5, 6

Table 16 Comparison of best objective values obtained by proposed MPBOA, BOA, HS, ABC, SCA, SCABC, and m-MBOA algorithm
Table 17 Optimal threshold values obtained by proposed MPBOA, BOA, HS, ABC, SCA, SCABC, and m-MBOA algorithm
Table 18 Comparison of mean values obtained by proposed MPBOA, BOA, HS, ABC, SCA, SCABC, and m-MBOA algorithm
Table 19 Comparison of PSNR objective values obtained by proposed MPBOA, BOA, HS, ABC, SCA, SCABC, and m-MBOA algorithm

10 Conclusion

In this study, a new hybrid algorithm, MPBOA, has been proposed. Here, the butterfly optimization algorithm has been intelligently combined with the mutualism phase and parasitism phase of the SOS algorithm to enhance the basic BOA’s searching strategy. In the proposed MPBOA, the global phase of BOA is combined with the mutualism phase of SOS when the value of switch probability is less than 0.5; otherwise, the parasitism phase of SOS is followed by the local phase of BOA. In this way, both the global exploration and local exploitation have been balanced to make the algorithm an efficient one. An extensive study has been made with twenty-five classical benchmark functions to evaluate the performance, local optima avoidance, exploration ability, convergence speed, and robustness of the proposed method. Also, to prove the efficiency, MPBOA has been statistically examined with some of the statistical analysis viz., the Friedman rank test, and t-test with six other compared algorithms. Convergence graphs have been presented, which depicts the fast converging property of the proposed MPBOA. The proposed MPBOA has been applied to solve four numbers of real-world optimization problems viz. minimize I-beam vertical deflection problem, three bar truss design problems, cantilever beam design problem, and tension/compression spring design problem. The results found for these real-world problems also demonstrate the superiority of the proposed MPBOA compared to some other algorithms found in the literature. The proposed MPBOA is also utilized to obtain the optimal threshold in the multilevel thresholding problem of the image segmentation problem. So, it can be concluded that the proposed MPBOA is superior to the compared state-of-the-art meta-heuristics.

For future scope, several research directions can be adapted. Self-adaptation of the parameter value, multi-objective conversion of the proposed MPBOA can be developed. This algorithm may be applied to solve different optimization problems in all branches of science and engineering. It may also be applied to different problems of multimedia and image processing like BP neural network and multimedia course-ware evaluation, reverse logistics problem, resource optimization in distributed real-time multimedia applications, etc.