Introduction

Considering that various issues were unsolvable when classical methodologies were used to address large and complex problems, since the 1970s, researchers have attempted to develop new algorithms that merge and advance traditional heuristics. The newly developed algorithms are known as metaheuristics, a name that combines the word “meta”, meaning “beyond”, and the word “heuristics”, meaning “to find”1. Unlike traditional methodologies, these new algorithms aim to find nearly optimal solutions instead of exact optimal ones, which leads to these algorithms being able to find solutions in a less computationally expensive manner2.

Over the years, metaheuristic algorithms have gained significant attention in the research community. Together with their ability to solve large and complex optimization problems, the flexibility of metaheuristics in adapting to a wide range of applications has also contributed to their growing popularity. These algorithms are considered effective approaches for problems such as scheduling3,4, route optimization5, human disease detection6,7,8,9,10, agriculture control11,12,13, and data mining14. This leads to many industries seeking efficient metaheuristic algorithms for use in the real world. With the increasing demand for new metaheuristics, more algorithms have been proposed recently.

Each metaheuristic is proposed with distinct types of advantages and disadvantages, making it suitable for solving various sources of problems. However, although these algorithms are diverse in traits, they all share one thing in common. That is, their ability to produce outcomes depends heavily on the balance between exploration and exploitation concepts2. In the context of metaheuristics, while exploration refers to the process of searching for new and unexplored regions of the search space, exploitation is defined as the process of exploiting the current search space to find better solutions. Adjusting exploration and exploitation is a crucial issue in developing metaheuristic algorithms since excessive exploration can lead to excessive randomness and poor convergence, and excessive exploitation can lead to stagnation and local optima traps. A good balance between these two concepts will help the algorithm work efficiently. Therefore, researchers around the world have used various strategies to balance these two concepts while developing new metaheuristics, including tuning parameters, upgrading algorithms, and hybridizing algorithms.

Metaheuristic research provides opportunities for innovation and advancement in the field of optimization. Upgrading current algorithms or proposing new algorithms can help researchers and practitioners solve problems that were previously unsolvable or find better solutions to existing problems. Indeed, the no-free lunch theorem states that there is no single algorithm that can solve all optimization problems equally well115. Therefore, even though there are a variety of efficient algorithms, people are still seeking to improve and propose new metaheuristics. Understanding the need for ongoing research and development of new algorithms and techniques that can address the specific characteristics and challenges of different problem domains, we propose a novel hybrid metaheuristic algorithm, h-PSOGNDO, which is a combination of Particle Swarm Optimization (PSO) and Generalized Normal Distribution Optimization (GNDO).

The remaining sections of this paper are structured as follows. In the “Literature” section, the “Inspiration” subsection provides an overview of the inspiration of h-PSOGNDO. Next, the subsection named “h-PSOGNDO algorithm” presents the algorithm and investigates the mathematical model. The efficiency of the proposed method is then proven by displaying the benchmark function testing results in the “CEC 2017 experimental results” and “CEC 2019 experimental results” sections. The “Toxicity of Antimicrobial Peptides Predicting Case Study” section demonstrates the case study and the proposed method’s application in this case study. Finally, the “Conclusion” section summarizes the paper and discusses future work directions.

Literature reviews

Related works

Metaheuristics have become enormously popular, especially in the last few decades. To provide a general overview of these algorithms, researchers worldwide have attempted to categorize metaheuristic algorithms into different classes. From inspiration-based to memory-based to neighborhood-based to movement-based methods, there are various approaches for classifying metaheuristics. However, one of the most frequently used methods is to categorize algorithms based on the domains that these algorithms imitate. Taking inspiration as the main classification criterion, within this approach, metaheuristics can be classified into two large classes: the nonnature-inspired class and the nature-inspired class1.

On the one hand, the nonnature-inspired class contains algorithms whose inspirations are not related to any natural processes or biological phenomena. Metaheuristic algorithms that belong to this class are usually developed using other domains, such as mathematical theories and computational concepts. Examples of significant algorithms that are specified in this category include Tabu Search (TS)16, Scatter Search (SS)17, Variable Neighborhood Search (VNS)18, Iterated Local Search (ILS)19, Sine Cosine Algorithm (SCA)20, Generalized Normal Distribution Optimization (GNDO)21, etc.

On the other hand, the nature-inspired class involves metaheuristics whose origins mimic natural processes or living creatures’ behaviors. This category can be subclassified into five other smaller groups: the evolutionary algorithm group, swarm intelligence group, physics-based group, chemical-based group, and human-based group22. Regarding the evolutionary group, significant algorithms that belong to this group are Genetic Algorithms (GA)23, Differential Evolution (DE)24, and Genetic Programming (GP)25. Regarding the Swarm Intelligence group, this second sub-group of the Nature-inspired includes several well-known algorithms such as Particle Swarm Optimization (PSO)26, Ant Colony Optimization (ACO)27, Grey Wolf Optimization (GWO)28, Antlion Optimization Algorithm (AOA)29, Whale Optimization Algorithm (WOA)30, Improved Grey Wolf Optimization (IGWO)31, etc. About the third sub-group, the physics-based group, Simulated Annealing (SA)32, Gravitational Search Algorithm (GSA)33, Multi-verse Optimizer (MVO)34, etc. are some remarkable examples. Regarding the chemical-based group, examples of famous algorithms of this group are Artificial Chemical Process (ACP)35, Chemical Reaction Optimization(CRO)36, and Artificial Chemical Reaction Optimization(ACROA)37. Finally, some significant metaheuristic examples of the Human-based group are Harmony Search (HS)38, Firework Algorithm (FWA)39, and Football game-inspired Algorithm (FGA)40. Among the nature-inspired algorithms, the Cuckoo Search (CS)41 algorithm distinguishes itself by being highly proficient in escaping local optima using Lévy flights. The iCSPM (Island-based Cuckoo Search with highly disruptive polynomial mutation)42,43 improves the CS algorithm through the use of an island model and disruptive mutations that provide for higher diversity and exploration. Also, the Salp Swarm Algorithm (SSA) with highly disruptive polynomial mutation (HDPM)44 is an improved SSA that enhances the exploration capabilities, ensuring a diverse population and robust search. These advancements demonstrate continuous improvement in metaheuristic algorithms towards enhanced solving capabilities for complex optimization problems.

With the growth of metaheuristics since the 1980s, researchers have started to conceptualize the idea of hybridizing metaheuristic algorithms. By combining different components, techniques, and features, hybrid metaheuristics can promisingly bring steady advances and overcome the weaknesses of the original algorithms. Although the hybridization of metaheuristics has only recently been performed, a large number of remarkable hybrid algorithms have been proposed. By combining different methods to apply different control strategies to different execution methods, several significant examples of hybrid metaheuristics include Parallel Particle Swarm Optimization (PPSO)45, hybridization of Grey Wolf Optimization and Particle Swarm Optimization(PSO-GWO)46, and hybridization of Generalized Normal Distribution Optimization and Sine Cosine Algorithm (GNDO-SCA)47.

Motivation

Establishing algorithms that can help industries face various challenging issues has always been the greatest desire of researchers. Hundreds of metaheuristics have been developed, and most have proven themselves to be powerful tools for finding optimal solutions to difficult problems. Among these significant metaheuristics, PSO, with its social behavior concept, is one of the most notable algorithms for wide-ranging applications. Over the years, researchers have attempted to update this metaheuristic and apply it to different case studies by using diverse methods, including modifications and extensions; however, PSO remains an active area of research in the field of optimization. Considering the current demands of solving complicated problems and considering the extraordinary features of PSO, we are motivated to develop a hybrid PSO algorithm that can improve the advantages and simultaneously decrease the disadvantages of its parent algorithms.

Contributions

The key contributions of this work can be summarized as follows:

  • A novel h-PSOGNDO algorithm that combines Particle Swarm Optimization and Generalized Normal Distribution Optimization is modeled and described through mathematical functions and illustrations.

  • The novel algorithm’s efficiency is proven and analyzed through its statistics achieved by running twenty-eight CEC2017 and ten CEC2019 benchmark functions.

  • A toxicity prediction case study of antimicrobial peptides is presented and solved by applying the proposed h-PSOGNDO algorithm.

Methodology

Inspiration

PSO, as it is called, is inspired by observing the swarm behaviors of living creatures such as flocks of birds or schools of fish. This metaheuristic algorithm searches for optimal outcomes by moving its candidate solutions, which are referred to as particles, around a multidimensional space. This movement is determined through two main contributions: position and velocity. Particularly, each particle’s future direction is adjusted by continuously updating the position and velocity variables according to the self-experience of the particle (particle best), together with the experience achieved by its neighbors (global best), and the particle’s current position. The general operation strategy of this metaheuristic algorithm is illustrated in Fig. 1, Part A. Unlike PSO, GNDO is not a metaheuristic inspired by natural creatures. Its framework follows the mechanism of the Gaussian distribution and can be easily divided into exploitation and exploration strategies. By using a Gaussian distribution, the GNDO exploitation process is conducted by updating two current positions, namely, the mean and optimal positions. Then, the exploration phase is conducted by referring to three different random individuals. The general operation strategy of this metaheuristic algorithm is illustrated in Fig. 1, Part B.

Fig. 1
figure 1

Search strategy illustrations: (a) PSO, (b) GNDO.

With its limited exploration, PSO often risks convergence because of its strong exploitation abilities, which makes it less efficient in avoiding local optima48. On the other hand, GNDO is great at exploration49, enabling it to search a wider solution space but potentially lacking precision in fine-tuning solutions. The hybrid approach combines PSO’s exploitation capabilities with GNDO’s robust exploration property thus bringing out the best from both algorithms; ultimately resulting in a more balanced and efficient optimization methodology. This ensures that the algorithm can explore a wide solution space and accurately converge towards optimal solutions, outperforming other potential algorithmic combinations.

Both PSO and GNDO are considered to be remarkable metaheuristics that can efficiently solve complex optimization problems. However, although PSO is well-known for its simple-to-implement characteristics and its effectiveness, this algorithm also has disadvantages. When this metaheuristic is applied to an overly complex search space, PSO may stop searching before it reaches the global optimum and can easily be trapped in local optima. In contrast with PSO, exploration ability is the key strength of the GNDO. Indeed, among the diversity of recently developed metaheuristics, GNDO has attracted researchers’ attention because of its outstanding exploration ability. GNDO has an astonishing ability to sample new candidate solutions from a generalized normal distribution. This allows the exploration process to search in a larger search space and thus, perform more efficiently. Therefore, inspired by the advantages and disadvantages of both algorithms, a new h-PSOGNDO algorithm is proposed to improve both PSO and GNDO by combining the exploitation ability of PSO and the exploration ability of GNDO.

H-PSOGNDO algorithm

This section provides a detailed view of the mathematical model and algorithm of the hybrid Particle Swarm Optimization Generalized Normal Distribution Optimization (h-PSOGNDO) algorithm.

  • Stage 1: Initialization As stated above, the proposed h-PSOGNDO algorithm is a hybridization of two population-based metaheuristics: PSO and GNDO. Therefore, similar to other algorithms in the same category, in this algorithm, the population is initialized through the following equation:

    $$\begin{aligned} x_{i,d} = lb_{d} + (ub_{d}-lb_{d}) \times r, i=1,2,3..N, d =1,2,3..D \end{aligned}$$
    (1)

    Where N is the population size, D is the number of variables that are designed, \(lb_d\) and \(ub_d\) are the lower boundary and upper boundary of the dth variable, respectively, and r is a randomly generated number within the range between 0 and 1. After being initialized, based on fitness values, the population’s solutions are arranged in the order of best to worst. Additionally, the global best solution is initially set as the solution that is arranged in the first order. Then, the entire population is divided into two halves. While the first half of the section involves the best solutions, the second half includes the worst ones.

  • Stage 2: Exploitation Exploitation, or local search, refers to a strategy in which nearby regions (the immediate vicinity of the best solution found) are investigated to improve the current solution. In the h-PSOGNDO procedure, this stage is conducted with the implementation of PSO in the first half section, which contains the best solutions to be sorted. In PSO, the optimal solution-searching process is performed by adjusting the movements of the candidate solutions through two factors: the position and velocity of the particle. The movements of the particles are heavily dependent on pbest, which is the best position achieved according to a particle’s self-experience, and gbest, which is the best position known according to the entire swarm. The mathematical model of PSO is presented below. The equation for updating the velocity of the ith particle in the dth dimension is:

    $$\begin{aligned} v_{i,d}^{t+1}={\omega \times v}_{i,d}^t+c_1\times \ r_1\times \left( {pbest}_{i,d}^t-x_{i,d}^t\right) +c_2\times \ r_2\times \left( {gbest}_d^t-x_{i,d}^t\right) \ \ \end{aligned}$$
    (2)

    where \(c_1\) and \(c_2\) are constants named cognitive and social parameters (\(c_1=c_2=2\)), \(r_1\) and \(r_2\) are randomly generated numbers within the range between 0 and 1, and w is referred to as the inertia weight. In this case, the inertia weight w is set to 0.4. This is because the inertia weight is a parameter used in setting the balance between the exploitation and exploration search and a small inertia weight can help to focus the search on local optima. To prevent an excessively high velocity, the velocity is limited to a value of \(v_{max}\) as follows:

    $$\begin{aligned} v_{i,d}^{t+1}={\left\{ \begin{array}{ll}v_{\max }, \quad if v_{i,d}^{t+1} >v_{\max }\\ -V\max , \quad if v_{i,d}^{t+1} <-v_{\max }\end{array}\right. }\end{aligned}$$
    (3)

    With the updated velocity, the position of the ith particle in the dth dimension can be determined by:

    $$\begin{aligned} x_{i,d}^{t+1}=\ x_{i,d}^t+v_{i,d}^{t+1}\end{aligned}$$
    (4)

    The fitness of the updated position is then compared with that of the previous pbest position to determine whether the fitness value is improved. Otherwise, pbest’s fitness and the individual’s best position remain the same. To update gbest, the same comparison procedure between pbest’s fitness and gbest’s fitness is implemented.

  • Stage 3: Exploration Exploration or global search is referred to as a strategy in which the entire search space is investigated to explore all possible potential solutions. In the h-PSOGNDO procedure, this stage is conducted with the implementation of GNDO in the second half section, which contains the worst solutions sorted. In GNDO, the optimal solution-searching strategy is based on the normal distribution theory. This algorithm is applied to three randomly chosen individuals. The mathematical model of PSO is presented below. New position generation can be performed via the following equation:

    $$\begin{aligned} v_{i,d}^t=x_{i,d}^t+\beta \times \left( \left| \lambda _3\right| \times {v1}_d\right) +\left( 1-\beta \right) \times \left( \left| \lambda _4\right| \times {v2}_d\right) \ \end{aligned}$$
    (5)

    Where \(\beta \) is referred to as an adjusted parameter and can be randomly generated within a range between 0 and 1), \(\lambda _3\) and \(\lambda _4\) are random numbers generated from the standard normal distribution. The trail vectors v1 and v2 can be obtained as follows:

    $$\begin{aligned} V_{2}= & {} {\left\{ \begin{array}{ll}x_{i}^{t}-x_{p1}^{t}, \quad iff\left( x_{1}^{t}\right) < f\left( x_{p1}^{t}\right) \\ x_{p1}^{t}-x_{i}^t, \quad otherwise\end{array}\right. }\end{aligned}$$
    (6)
    $$\begin{aligned} V_{2}= & {} {\left\{ \begin{array}{ll}x_{p2}^{t}-x_{P3}^{t},\quad iff\left( x_{p2}^{t}\right) <f\left( x_{p3}^{t}\right) \\ x_{p3}^{t}-x_{p2}^{t}, \quad otherwise\end{array}\right. } \end{aligned}$$
    (7)

    where p1, p2,  and p3 are three different-from-each-other integers randomly chosen in the range of one to N. The fitness of the newly generated position is then compared to the previous best solution. A better solution is chosen, and the position is updated based on the chosen solution.

In hPSOGNDO, the solution representation remains similar to other feature selection methods. Each solution (or particle) is a binary string where each bit indicates whether a feature is selected (1) or not (0). The fitness function is designed to balance classification accuracy and feature reduction. For each solution, the number of selected features is counted and these features are extracted from the dataset. If no features have been selected, then the fitness value of this particular solution will be set as infinity which indicates that it is invalid. Otherwise, we use the selected features to train a K-Nearest Neighbors (KNN) classifier. The classifier is trained on a subset of the data, and its accuracy is evaluated on a hold-out set. This error rate represents error = 1 − accuracy of this classifier. The fitness function is then calculated using this error rate along with a term that penalizes the number of selected features, weighted by a factor \(w_f\). Specifically, the fitness function can be expressed as:

$$\begin{aligned} F(w)=\alpha \times {\text {ERR}}(D)+\beta \times \frac{|R|}{|N|}\end{aligned}$$
(8)

where the error rate of KNN classifier is \({\text {ERR}}(D)\), |R| represents selected features, |N| is the total features in the dataset, \(\alpha \) is the weight of the error rate, and \(\beta =1-\alpha \) stand for selection ratio. The algorithm iteratively updates particles’ positions and velocities using Particle Swarm Optimization (PSO) and Generalized Normal Distribution Optimization (GNDO) components that evaluate each solution’s fitness within the population. This process continues until an optimal or near-optimal subset of features where classification accuracy has been maximized while minimizing the number of features.

The pseudocode is presented below, and the flow chart is illustrated in Fig. 2.

Algorithm
figure a

The h-PSOGNDO algorithm.

Fig. 2
figure 2

Search strategies illustration of h-PSOGNDO algorithm.

The complexity of the h-PSOGNDO algorithm

The algorithm’s complexity is among the indispensable factors that scientists take into consideration while choosing an algorithm to solve problems. To demonstrate the memory utilization and computational time of a particular algorithm, in various cases, researchers used the Big-O Notation. Such notation is well-known and has often been widely applied to study computational complexity in a variety of domains including Mathematics and Computer Science. Knowing the extreme popularity of this notation, together with the need to evaluate our proposed metaheuristic, in this section, we generalize the computational complexity of the h-PSOGNDO algorithm using the Big-O Notation. First, the initialization phase of the algorithm results in h-PSOGNDO’s complexity as \({\mathcal {O}}(N \times D)\) with N defined as the population size specified and D defined as the number of the dimensions designed. Next, the h-PSOGNDO procedure involves evaluating the objective function step which has the complexity of \({\mathcal {O}}(N) \times {\mathcal {O}}(F)\), where F is the objective function being evaluated. For the proposed algorithm to be implemented, there are two phases being conducted in each iteration. Evaluating the objective function is required in both phases making the total complexity of the main loop \({\mathcal {O}}(T \times N \times D \times 2) \times {\mathcal {O}}(F)\), where T is the maximum number of iterations defined. Table 1 is conducted to illustrates the running time of h-PSOGNDO compared with other algorithms when they are all applied to run the Rastrigin function. For comparison, the running time of each algorithm is averaged from the running times collected in thirty consecutive runs under the setting of 10 dimensions, 500 iterations, and 50 agents each run. The other setting of the algorithms can be found in Table 2. It can be se seen that regarding the running time, while WOA is the most efficient algorithm, PSO takes longer time than another algorithm to achieve the result. It is also noticeable that although h-PSOGNDO’s running time is not the most efficient of the eight metaheuristics, it achieves the best solution in a reasonable time compared to other algorithms in the list.

Table 1 Running time comparisons of algorithms for Rastrigin function.

Results

CEC 2017 experimental results

In this section, to demonstrate the effectiveness of the proposed algorithm, we evaluate h-PSOGNDO against IEEE CEC 201750 functions, which involve twenty-eight functions with various constraints. To further clarify the efficiency of the proposed algorithm, the performance of the h-PSOGNDO is compared to that of seven other recently established and well-known metaheuristics, namely, the AOA29, SCA20, WOA30, GNDO21, GWO28, IGWO31, and PSO. These algorithms together with the proposed algorithm’s parameters are set as in Table 2.

Table 2 Parameters setting.

Additionally, the maximum number of iterations within this test is set to 500, the number of agents is 50 and the dimension is 30. Each algorithm listed above is executed 30 times per CEC2017 function. Next, the statistics of thirty runs are recorded, and calculated to achieve a set of four indicators, including the average, standard deviation, best value, and worst value. The rankings are then calculated based on the average indicator. The optimization results are indicated in Table 3, with the best number recorded for each function out of the eight methods in bold. Apart from the statistical results, the convergence curve illustrations of h-PSOGNDO and the seven other metaheuristic competitors are shown in Fig. 3. Based on the statistical findings in Table 3, in terms of the average results collected, it is remarkable that the h-PSOGNDO ranked first in 19 of the 28 CEC 2017 functions. This overall result has proven that the h-PSOGNDO algorithm is powerful and has an astonishing ability to yield highly competitive results to benchmark mathematical problems.

Figure 4 displays particle trajectories and convergence curves for some CEC 2017 benchmark functions, demonstrating the effectiveness of hybrid algorithms. The convergence curves demonstrate efficient exploration and exploitation by showing an initial fitness improvement followed by fine-tuning. The trajectory of the particles shows a starting motion convergent to center areas, demonstrating the algorithm’s capacity to balance exploration and exploitation across several functions. In general, the method performs well when optimizing these benchmark functions.

Table 3 Results of 28 CEC 2017 test functions.
Fig. 3
figure 3figure 3

Metaheuristics’ convergence curves of 28 CEC 2017 test functions.

Fig. 4
figure 4

Convergence curves and particle trajectories for CEC2017 benchmark functions.

CEC 2019 experimental results

To further demonstrate the effectiveness of the proposed algorithm, h-PSOGNDO is put to evaluate against another set of benchmark functions which is the IEEE CEC 2019 suite. This set involves ten mathematical functions of four types which are Unimodal (function F1), Simple Multimodal (from function F2 to function F8), Hybrid (from function F9 to function F18), and Composition (10 final functions). As in the CEC 2017 experimental results section, in this section, the performance of h-PSOGNDO is compared to that of AOA29, SCA20, WOA30, GNDO47, GWO28, IGWO31, and PSO26 with their parameters set as in Table 2.

Similarly, the metaheuristics are evaluated in 500 iterations, 50 agents, and 30 dimensional scenarios. After 30 runs, the statistics, including the average statistics, the standard deviation statistics, the best values, and the worst values, are recorded and calculated to determine four indicators. Based on the average indicator, the rankings for each of the ten functions are then calculated.

The optimization results are indicated in Table 4, with the best number recorded for each function out of the eight methods in bold. Apart from the statistical results, the convergence curve illustrations of h-PSOGNDO and the seven other metaheuristic competitors are shown in Fig. 5. According to the statistical results in Table 4, considering the average results collected, the h-PSOGNDO ranked first in 6 of the 10 CEC 2019 functions. This overall result shows that compared with other metaheuristics, the h-PSOGNDO algorithm is a competitive algorithm, especially when it is evaluated under benchmark mathematical problem schemes.

Figure 6 indicates a hybrid algorithm works on several functions of CEC2019 through convergence curves and particle trajectories. A good balance between exploration and exploitation can be achieved. The convergence curves for these functions show rapid initial fitness improvement by fine-tuning. In this case, particle trajectories revealed different starting points with particles coming towards central areas, which suggests strong exploration capabilities. For complex functions like Function 8, the algorithm maintains wide exploration while improving solutions, showing that it can effectively handle challenges. In general, this is an effective optimization method in hybrid algorithms that balance exploration and exploitation through the CEC benchmark function.

Table 4 Results of 10 CEC 2019 test functions.
Fig. 5
figure 5

Convergence rates and trajectories of particle movement some CEC 2019 test functions.

Fig. 6
figure 6

Convergence curves and particle trajectories for CEC2019 benchmark functions.

Statistical analysis

Two statistical tests were used to examine the algorithms and show the importance of the outcomes. To assess the categorization accuracy in the Table below, the Friedman and Wilcoxon tests were employed.

Table 5 presents the p-values from the Wilcoxon test on the CEC2017 functions, comparing PSOGNDO’s performance with several other algorithms (AOA, SCA, WOA, GNDO, GWO, IGWO, PSO). The p-values indicate the statistical significance of the differences in performance between hPSOGNDO and each algorithm. Lower p-values (typically less than 0.05) suggest significant differences. All the p-values are extremely low, such as 1.42857E-07 for SCA, WOA, and GWO, and 1.78571E-07 for GNDO and PSO, indicating highly significant differences in performance. Besides, Table 6 shows the mean ranks and final ranks of the algorithms according to the Friedman test. Mean rank is an average ranking for each algorithm over a number of functions with lower scores demonstrating better performance. PSOGNDO has the lowest mean rank (2.04) and is ranked first, implying it performed best overall. PSO (mean rank 2.36) and IGWO (mean rank 2.5) also performed well, in the second and third ranks, respectively. In contrast, AOA has the highest mean rank (7.21) and is ranked eighth, indicating relatively poorer performance.

Table 5 Wilcoxon test results for CEC2017 functions.
Table 6 Friedman test results for CEC2017 functions.

In Table 7, p-values for the Wilcoxon test of CEC 2019 functions are shown. However, PSO p-value (0.039097) stands slightly above the significance level indicating a less significant difference while those of SCA (0.001755), WOA (0.000002), and GNDO (0.014025) show a significant difference. The final rank from Friedman analysis for the algorithms is demonstrated in Table 8. PSOGNDO took the first position with a minimum mean rank that indicates it has a good performance with a score of 2.4. PSO and IGWO have mean ranks of 2.6 and 2.8 respectively ranking them second and third positions. Whereas SCA is ranked seventh with the highest mean rank of 6.3, which shows comparatively bad results compared to others.

Table 7 Wilcoxon test results for CEC2019 functions.
Table 8 Friedman test results for CEC2019 functions.

Overall, the Wilcoxon and Friedman tests used for nonparametric statistical analysis indicated that hPSOGNDO, PSO, and IGWO were the best algorithms for CEC2017 and CEC2019. While PSOGNDO ranks first, PSO also achieves a good performance, which demonstrates its robustness across several scenarios. By No Free Lunch Theorem51, no one algorithm can be considered superior to others in all scenarios hence our approach is highly efficient when applied in certain cases thus emphasizing the need for choosing an appropriate algorithm depending on the problem landscape.

Toxicity of antimicrobial peptides predicting case study

Case study

Antimicrobial peptides (AMPs) are types of molecules produced by living organisms as a defense mechanism against harmful microorganisms such as bacteria, viruses, and fungi52. These peptides are generally small and have different structures and mechanisms of action which can be divided into four types: alpha-helix type, beta-sheet type, alpha-helix and beta-sheet type, and linear extension type. Due to their broad-spectrum activity and low potential for the development of resistance, AMPs are viewed as potential replacements for conventional antibiotics53 and have attracted attention from scientists around the world. However, there are serious concerns regarding the safety of using AMPs since these molecules can exhibit toxicity toward natural cells54.

Indeed, recently, there have been many journals studying this area that focused on different subjects and fields of AMPs: from AMPs categories to their structures, their characteristics, and their applications in medicine. For instance, in 2020, Huan et al. published an article summarizing and stating the sources and previous research on AMPs55. Within the rise of AMPs popularity, in 2021, an overview of the AMPs including their characteristics, structures, inceptions, etc. written by Zhang et al. was published and received attention from the public. Since AMPs vary with different structures, abilities, and potentiality, researchers made numerous attempts to categorize AMPs. In 2020, Yan et al. provided a Deep Learning approach to spot Short AMPs and achieved an accuracy of 77% with an area under the curve of 85%56. In the same year, Kavousi et al. conducted a platform to predict AMPs using five famous Machine Learning classifiers and reached the highest result of 95% accuracy within their chosen dataset57. With the growth in AMP popularity, besides the trend in researching and categorizing AMPs using their characteristics, researchers also recognize the need to predict AMPs toxicity. Such attentions come from the concerns regarding the safety of using AMPs since these molecules can exhibit toxicity toward natural cells58. For instance, in 2018, Banerjee et al. successfully implemented a high-accuracy prediction platform called Pro Tox−II to predict chemicals’ toxicity. In 2021, Khabbaz et al. introduced a model to diagnose AMPs based on physicochemical features and achieved a recall rate of 87.6% and F1 of 84.9% in their best performance59.

Although the AMPs toxicity prediction was noticed currently, only a few attempts have been made and hence, such a field is still novel to researchers. This has prompted the need for developing models to predict AMP toxicity. Considering the mentioned demand, together with the need to provide a case study to assess the applicability of the proposed method - h-PSOGNDO, we attempted to apply h-PSOGNDO to predict the toxicity of Antimicrobial peptides in a case study.

In this paper, Hossein Khabbaz’s AMP dataset59 published in 2021 is used. According to the author, this dataset was first collected by using information from the Database of Antimicrobial Activity and Structure of Peptides (DBAASP)60, after which the unnatural records were removed, the unit was converted, and the data were labeled following the toxicity characteristics of the molecules. In particular, the dataset contains 2828 toxicity-labeled AMPs. A total of 1278 features belonging categories-Autocorrelation, Physico-chemical, Sequence order, Amino Acid, and Pseudo Amino Acid59 composition-are listed for each antimicrobial peptide recorded. Out of these 1278 features listed, each AMP is labeled within the two terms “Toxicity” and “Non-toxicity”. In brief, the dataset is 1279 x 2828 in size (1278 features and 1 label column x 2828 antimicrobial peptide rows).

Theoretical background

Many AMPs studies heretofore achieved remarkable results. In the context of this paper, the following noticeable journals using different ML techniques are presented. The author61 presents a ML model, antimicrobial peptide-grouping-scoring-modeling (AMP-GSM) to predict AMPs using physicochemical, linguistic, sequence, and structure-based features. The method is divided into three steps: grouping features, scoring the groups based on their ability to distinguish AMPs from non-AMPs, and building a model using the top-ranked groups. The results showed that AMP-GSM outperformed other methods in terms of accuracy and area under the curve (AUC). In order to predict AMPs, the study62 develops computational algorithms. Using data from the DBAASP database, linear cationic peptides with non-hemolytic activity were chosen for examination. The peptides’ ten physical-chemical characteristics were computed, and different machine learning (ML) models-such as Random Forest (RF), Support Vector Machine (SVM), and AdaBoost were used to categorize the peptides. After removing outliers, the RF model demonstrated the best performance metrics, obtaining an Area Under Curve (AUC) of 0.97 for Gram-positive datasets and 0.99 for Gram-negative datasets. In order to improve computational efficiency with a smaller feature set, the research also examines feature selection techniques. The study63 trains a ML model on DBAASP datasets to predict the toxicity of amphetamines. The researchers used a variety of features with both local and global essences. Important features related to AMP toxicity were found through feature selection, and many ML models, such as RF, and SVC, were evaluated. With an F1 score of 0.849 and a recall of 0.876, the hybrid model performed the best. The work emphasizes the importance of local characteristics in defining peptide properties, such as the locations of hydrophobic and strand-forming residues.

In machine learning and data analytics, feature selection (FS) is essential because it reduces the dimensionality of data, improving model accuracy and efficiency. Numerous fields, including biology, text mining, image analysis, and others, use feature selection algorithms. Generally, there are three types of feature selection methods: filter, wrapper, and embedded methods. The Wrapper method aims to create a set of features from the original data to provide the best-performing prediction model, whereas the Filter method seeks the optimal feature selection using statistical functions without using classification models. Additionally, there are some recent optimization methods were proposed, which have been shown to provide better performance. These methods were developed to extract the appropriate subset of features from the dataset for the feature selection problem.

The DJaya algorithm is a type of optimization algorithm inspired by the leadership hierarchy and hunting mechanism in packs. The Improved Binary DJaya Algorithm (IBJA)64 leverages an enhanced version of the DJaya framework, optimizing binary solutions for feature selection with improved convergence speed and accuracy ensuring that the solutions it identifies are closer to the global optimum. While the IBJA offers rapid convergence, its performance might vary significantly across different types of datasets, and it may struggle with very high-dimensional data where the binary decision space exponentially increases.

BIWSO3 introduces modifications to the standard White Shark Optimizer, adapting it for binary operations65. This adaptation allows it to navigate the search space of feature subsets effectively, enhancing the balance between exploration and exploitation. Such a balance is crucial for finding robust solutions across various stages of the optimization process. However, BIWSO3 has the potential to get stuck in local optima if the balance between exploration and exploitation is not well-maintained, especially in complex search landscapes.

IBCSA366modifies the traditional sine and cosine operations to better suit binary domains, providing a robust search mechanism that consistently identifies optimal feature sets across diverse datasets. This method adapts well to the discrete nature of binary optimization, efficiently managing the exploration of the search space. However, the algorithm relies on trigonometric functions for binary decisions can lead to slower convergence in scenarios where the search space does not align well with the cyclic patterns of sine and cosine functions, potentially requiring more iterations to reach an optimal solution.

While all these methods incorporate unique adaptations to standard algorithms for binary optimization in feature selection, h-PSOGNDO distinguishes itself by combining two potent strategies-particle swarm and gravitational niche dominance-potentially offering a more comprehensive approach to tackling both local and global optimization challenges in feature selection tasks.

Methods

To build an accurate AMP toxicity classification model, the dataset must be preprocessed. First, the dataset is checked and it is guaranteed that there are no missing values. Then, the labels were renamed 0 for nontoxicity and 1 for toxicity. The dataset is then split into a training set and a testing set with the amount of toxicity and non-toxicity AMPs distributed equally to both sets. While exactly 80% of both toxicity and nontoxicity AMPs (2262 observations) are used for training the model, exactly 20% of the remaining AMPs (566 observations) are used for evaluating the performance of the method.

After the preprocessing step is conducted, the classification model is built. There are three main steps in modeling an AMP’s toxicity classification. First, due to the enormous size of the dataset, the features of the AMP training set must be sorted following their calculated linear correlations to each other. To reduce redundancy, the features that have strong linear relationships with each other are eliminated. Then, the training set features are input into the metaheuristic-applied (h-PSOGNDO-applied) feature selection tool to implement the feature selection process. In the third step, the selected features of the trained AMPs are input into classifiers for training.

To check the performance of the toxicity classification model, the AMP testing set features are label-removed. The features belonging to this set are then selected based on selected features of the training set. Next, the features of the testing set are treated as criteria for labeling the toxicity of AMPs and are input into the classifier for assessing the performance of the whole model. Finally, the AMP labels resulting from the classification models are compared with the true labels in the beginning to evaluate the accuracy of the built models.

For comparison purposes, in this paper, with 500 iterations and 50 agents, we conduct feature selection experiments using eight metaheuristics. Then, the classification process is conducted using three well-known classifiers (Random Forest (RF)67, Support Vector Machine (SVM)68, and Naïve Bayes (NB)69).

Results

The resulting statistics are listed in Table 9 and the confusion matrices of the applied h-PSOGNDO models are shown in Fig. 7.

Regardless of classifiers, with the least number of selected features (81 features), the models that used the h-PSOGNDO feature selection method yield higher results than other models. Take Random Forest as the classification tool, the AMPs toxicity classification results achieved by analyzing h-PSOGNDO selected features is 98.76% in accuracy. This is the best accuracy achieved throughout all models resulting from all three classifiers. Apart from the accuracy metric, this model’s sensitivity and specificity are also high (98.88% and 98.66%, respectively). Besides, the KNN algorithm demonstrates comparable to RF, which achieves a high accuracy rate of 98.50%. On the other hand, regarding the Support Vector Machine and the Naïve Bayes, the models that used features selected by h-PSOGNDO can predict the toxicity of antimicrobial peptides quite accurately at the rate of 94.70% and 87.63%, respectively. Although they are not as high as the statistics achieved by Random Forest classifiers, these two numbers are significant and once again prove the astonishing ability of h-PSOGNDO in selecting features for predicting problems.

Table 9 Results of the predicting models.
Fig. 7
figure 7

Confusion matrices of models using h-PSOGNDO feature selection: (a) by Random Forest, (b) by Support Vector Machine, (c) by Naive Bayes.

Sensitivity analysis

With the Random Forest classifier, a sensitivity analysis of the h-PSOGNDO feature selection tool is conducted by changing the agent population and the maximum number of iterations. In the first scenario, the feature selection tool is evaluated with the number of maximum iterations held constant (500 iterations) and the number of h-PSOGNDO agents changed within six different values—10 agents, 20 agents, 30 agents, 40 agents, 50 agents, and 100 agents. Then the selected feature sets corresponding to the agent values are input into the classifier for performance metrics. Figure 8 shows that both the accuracy and sensitivity continuously increase as the number of agents increases from 10 to 50 agents (The accuracy increases from 96.64 to 98.76% and the sensitivity increases from 94.78 to 98.88%). However, as the agent population reaches 100, both the accuracy and sensitivity metrics decrease (the accuracy decreases from 98.76 to 97.88% and the sensitivity decreases from 98.88 to 96.64%).

Like the first scenario, the second scenario is implemented by assessing the model with six different values of maximum iteration numbers while keeping the number of agents constant. The classification results of the second scenario are presented in Fig. 9. Similarly, the records show that the accuracy and sensitivity improve significantly as the number of maximum iterations increases from 100 to 500 (the accuracy increases from 96.29 to 98.76% and the sensitivity increases from 95.15 to 98.88%). As the number of maximum iterations increases to 1000, the accuracy and sensitivity of the model decrease to 98.06% and 97.39%, respectively. Throughout the two scenarios, the model is shown to work efficiently with the number of agents set to 50 and the maximum number of iterations set to 500. Figure 10 presents the statistical results of the comparison between algorithms with different agent sizes and iteration numbers.

Fig. 8
figure 8

Chart of the performance indicators of models with different agent populations.

Fig. 9
figure 9

Chart of the Performance comparison between algorithms with different iterations numbers.

Fig. 10
figure 10

Performance comparison between algorithms with different agent sizes and iteration numbers.

Limitations and discussions

On the other hand, although it is powerful, h-PSOGNDO also contains limitations, that can cause this metaheuristic to perform badly. Firstly, like the other metaheuristics, the proposed h-PSOGNDO ability is affected sensitively by the starting points specified by the users. If the unsuitable starting point is considered, the metaheuristic may fail to obtain the most optimal solution. A correct fine-tuning set of parameters that has impacts on the starting point generation such as the mutation rates, the designed agent size, etc. will promisingly bring a tremendous improvement to the algorithm’s performance. Secondly, despite the starting point, it is also crucial for users to specify the stopping criteria of the algorithm since a wrong stopping point may lead the algorithm to result in sub-optimal solutions instead of the best ones. For instance, if the maximum number of iterations is specified lower than the necessary amount then the algorithm will stop before the best solution is reached. However, if the maximum number of iterations is higher than the necessary amount, the computational resources will be wasted and therefore may lead to other issues such as expensive investment and maintenance costs, and overfitting results. Thirdly, although h-PSOGNDO has given outstanding classification results in the AMP toxicity case study, there is no guarantee that its performance can always be this well when it is applied to other problems since a single algorithm cannot solve all optimization problems equally well13.

A potential solution to these limitations of h-PSOGNDO is using the Design of Experiments. This is a technique invented to fine-tune algorithms by changing the investigated parameter values to evaluate the influence of these on the given algorithm. By judging these recorded influences, the Design of Experiments can help users to recognize the most optimal parameter setting in the given space and therefore, is useful in enhancing metaheuristics and identifying suitable algorithms to be applied in practical problems. Within the context of this paper, to solve the mentioned issues, we suggest using the Box-Behnken method for parameters fine-tuning, and problem analysis. By using the Box-Behnken technique, the user will be able to spot and choose the optimal setting values for the impactful parameters, potentially solving the tuning issues of the metaheuristic. The limitation regarding the suitability of the algorithm to a specific problem can also be solved through this method. By assessing the design of candidate algorithms, Box-Behnken is useful in measuring and choosing the fittest method for a problem. The implementation of the Design of Experiment in improving the proposed metaheuristic is therefore also one of our future research directions.

Conclusion and future works

In this paper, a new hybrid metaheuristic that combines two popular algorithms, PSO and GNDO (h-PSOGNDO) is proposed. Generally, the h-PSOGNDO is structured by implementing two stages: the exploitation stage using the PSO strategy and the exploration stage using the GNDO exploration strategy. By combining the two parents’ strategies, the h-PSOGNDO overcomes the weaknesses of its parents and therefore is an effective and powerful algorithm. Throughout the paper, the h-PSOGNDO algorithm is tested against two CEC test suites and a real-life antimicrobial peptide toxicity classification case study. While the algorithm ranks first in 25 of the 38 total mathematical benchmark testing functions, the model that implemented h-PSOGNDO feature selection can accurately classify 98.76% of the toxicity characteristics of the antimicrobial peptides. All these performance result records show that this algorithm is superior when it is applied to large and complex datasets. In the future, we opt to expand our research to other metaheuristics: develop new and hybrid algorithms and evaluate their applications in complex optimization problems.

Within the fact that h-PSOGNDO ranks first in 25 over 38 tested functions and its supreme performances in the case study, undoubtedly, this metaheuristic is a strong tool to be implemented among other algorithms. Metaheuristics are algorithms that offer users a reasonable tradeoff between the quality of the achieved and the number of resources used. Since real-life issues often contain myriad complex and conflict constraints, instead of finding an exact solution to such problems which is merely impossible, finding nearly optimal or good enough solutions achieving in a logical or fast time resources will be far more acceptable. Such reasons lead to the fact that metaheuristics have been applied to a variety of fields for problem-solving.

Metaheuristics are used in many different fields, such as logistics, agriculture, and healthcare. In terms of medical, the research9 conducted an experiment with an accuracy rate of up to 90.5% to separate healthy people from Parkinson-infected people by analyzing sound records using Grey Wolf Optimization and Light Gradient Boosted Machine. Not only can metaheuristics be implemented to predict human diseases, but it also works constructively in predicting crop conditions. By applying a hybridization metaheuristic (Adaptive Particle Swarm Grey Wolf Optimization) in feature selection12, the author has succeeded in conducting fall detection with an accuracy rate of up to 99%. Besides predicting tasks, metaheuristics is also beneficial in scheduling healthcare workers. A paper3 successfully stated a way to apply a combined form of metaheuristics to optimize the work schedule for healthcare employees. In 2022, Dereci et al performed smoothly the vehicle routing problem in Turkey using different heuristics and metaheuristics5. All these applications have once again shown the enormous potential of metaheuristics in nowadays real world.

Moreover, an ablation study is being implemented to understand the contributions of all components in hybrid algorithms. This study will involve the effects of PSO and GNDO on the output by running individually, as well as in combination. A comparison of these separate components with the hybrid algorithm will demonstrate the effectiveness of PSO’s exploitation capabilities and GNDO’s exploration strengths. Besides, the ablation study will also highlight any effects resulting from combining PSO with GNDO and enable to fine-tune the hybrid algorithm further. Moreover, a parameter sensitivity analysis will also be implemented to demonstrate the effect of different parameter settings on the performance of the hPSOGNDO algorithm. This analysis will include changing the number of iterations and population size to determine their influence on the effectiveness and efficiency of the algorithm. The goal is to improve the understanding and applicability of hPSOGNDO by incorporating these findings into future research.

Observing the above noticeable journals, we see that h-PSOGNDO has the potential to solve complex problems such as scheduling, network designing, clustering, and engineering optimization problems. In detail, we believe that h-PSOGNDO will be of influential assistance in finding accurate solutions to the myriad of practical issues, including worker scheduling, facilities scheduling, location-allocation, space utilization, disease detection, behaviors, and pattern predictions. In brief, there is no doubt that apart from its application in bio-medical classification problems such as AMP’s toxicity diagnosis, as a metaheuristic, h-PSOGNDO can also be easily implemented to classify, predict, and optimize in a variety of real-life fields like medical problems, agriculture problems, logistics and supply chain problems, and economics and financial problems.