# Training a Feedforward Neural Network Using Hybrid Gravitational Search Algorithm with Dynamic Multiswarm Particle Swarm Optimization

Authors: Arfan Ali Nagra; Tahir Alyas; Muhammad Hamid; Nadia Tabassum; Aqeel Ahmad
Journal: BioMed Research International
 (2022)

---

## Abstract

One of the most well-known methods for solving real-world and complex optimization problems is the gravitational search algorithm (GSA). The gravitational search technique suffers from a sluggish convergence rate and weak local search capabilities while solving complicated optimization problems. A unique hybrid population-based strategy is designed to tackle the problem by combining dynamic multiswarm particle swarm optimization with gravitational search algorithm (GSADMSPSO). In this manuscript, GSADMSPSO is used as novel training techniques for Feedforward Neural Networks (FNNs) in order to test the algorithm’s efficiency in decreasing the issues of local minima trapping and existing evolutionary learning methods’ poor convergence rate. A novel method GSADMSPSO distributes the primary population of masses into smaller subswarms, according to the proposed algorithm, and also stabilizes them by offering a new neighborhood plan. At this time, each agent (particle) increases its position and velocity by using the suggested algorithm’s global search capability. The fundamental concept is to combine GSA’s ability with DMSPSO’s to improve the performance of a given algorithm’s exploration and exploitation. The suggested algorithm’s performance on a range of well-known benchmark test functions, GSA, and its variations is compared. The results of the experiments suggest that the proposed method outperforms the other variants in terms of convergence speed and avoiding local minima; FNNs are being trained.


---

## Body

## 1. Introduction

In computational intelligence, neural networks (NNs) are one of the most advanced creations. Neurons in the human brain are often employed to solve categorization problems. The basic notions of NNs were first articulated in 1943 [1]. Feedforward [2], Kohonen self-organizing network [3], radial basis function (RBF) network [4], recurrent neural network [5], and spiking neural networks [6] are some of the NNs explored in this paper.Data flows in one direction via the networks in FNN. In recurrent NNs, data is shared in two directions between the neurons. Regardless of the variances amongst NNs, they all learn in the same way. The ability of a NN to learn from experience is referred to as learning. Similar to real neurons, artificial neural networks (ANN) [7, 8] have been constructed with strategies to familiarise themselves with a set of specified inputs. In this context, there are two types of learning: supervised [9] and unsupervised [10]. The NN is given feedback from an outside source in the first way. The NN familiarises itself with inputs without any external feedback in unsupervised learning. Feedforward Neural Networks with multilayer [11] have recently become popular. In practical applications, FNNs with several layers are the most powerful neural networks. Multilayer FNNs have been shown to be fairly accurate for both continuous and discontinuous functions [12]. Many studies find that learning is an important aspect of any NN. For the standard [13] or enhanced [14], the leading applications have employed the Backpropagation (BP) algorithm as the training. strategy for FNNs. Backpropagation (BP) is a gradient-based approach with drawbacks such as delayed convergence [15] and the ability to become trapped in local minima.Various optimization approaches have already been applied simulated annealing, for example, which may be used to train FNNs (SA) [16], particle swarm optimization (PSO) algorithms [17], Magnetic Optimization Algorithm (MOA) [18], GG-GSA [19], and PSOGSA [20]. Genetic Algorithm (GA) [21], Differential Evolution (DE) [22], Ant Colony Optimization (ACO) [23], Artificial Bee Colony (ABC) [24], Hybrid Central Force Optimization and Particle Swarm Optimization (CFO-PSO) [25], Social Spider Optimization algorithm (SSO) [26], Chemical Reaction Optimization (CRO) [27], Charged System Search (CSS) [28], Invasive Weed Optimization (IWO) [29], and Teaching-Learning Based Optimization (TLBO) trainer [30] are some of the most popular evolutionary training algorithms. According to [31, 32], PSO and GSA are one of the best optimization techniques for eliminating both issues of slow convergence rate and trap in local optima. Recently, hybrid methods had been introduced to overcome the weakness of slow convergence [33, 34]. Most of the previous algorithms fail to reach the minimal selection; the hybrid gravitational search algorithm with social ski-driver- (GSA-SSD-) based model has been introduced to overcome the convergence problem [35].To overcome these weaknesses, GSADMSPSO [36] is used as a Feedforward Neural Network (FNN) as a new approach to examine the algorithm’s efficiency and reduce the difficulties of minima in the immediate vicinity trapping and slow steady convergence. Algorithms for evolutionary learning GSADMSPSO distribute the primary population of masses into smaller subswarms, according to the suggested algorithm, and also stabilize them by offering a fresh neighborhood plan [37]. At this time, each agent (particle) increases its position and velocity by using the suggested algorithm’s global search capability. The fundamental concept is to combine GSA’s ability with DMSPSO’s to improve the performance of a given algorithm’s exploration and exploitation [38]. The suggested method’s performance is compared to that of GSA and its variants using well-known benchmark test functions [39, 40]. The experimental results show that in terms of avoiding local minima and accelerating convergence, the proposed approach beats existing FNN training variations. The following is the order of this paper’s remaining sections: Section 1 introduces the basic concept of GSA. The dynamic multiswarm particle swarm optimization and gravitational search approach are discussed in Section 2; then, in Section 3, we go over the GSADMSPSO methodology in depth. The experiment’s findings are provided in Section 4. Section 5 discusses contrast analysis. In the concluding section, the findings are given.


## 2. Related Work

### 2.1. Multilayer Perceptron with Feedforward Neural Network

The connections of FNNs between the neurons are unidirectional and one-way. In neural networks [2], neurons are in parallel layers. The first layer is the input layer, the second layer is the concealed layer, and the last layer is the output layer. Figure 1 shows an example of a FNN using MLP.Figure 1
One hidden layer in a multilayer perceptron.The output of a given data has been calculated in step by step procedure [18]: the average sum of weight in input is calculated in
(1)sj=∑i=1nWijXi−θj,j=1,2,⋯,h.The hidden layer values are calculated in(2)sj=sigmoidsj=11+exp−sj,j=1,2,⋯,h.The output MSE and accuracy have been calculated in(3)Ok=∑j=1hwjk.sj−θ′,k=1,2,⋯,m,(4)Ok=sigmoidOk=11+exp−Ok,j=1,2,⋯,m.From input, the output of MLPs has been observed with the help of biases and weights in equations (1) to (4).


### 2.2. Gravitational Search Algorithm

The typical GSA is a newly projected search algorithm. GSA firstly initializes the positions ofN agents randomly, shown as
(5)Xi=xi1,⋯,xid,⋯,xiDfor i=1,2,⋯,N, where D is the dimension index of the search space and xid represents the ith agent in the dth dimension:
(6)qit=fiti−worsttbestt−worstt,(7)Mit=qit∑j=1Nqjt,where fitit and Mit represent the fitness and bestt and worstt are defined in the following equations:
(8)bestt=minjϵ1,⋯,Nfitjt,(9)worstt=maxjϵ1,⋯,Nfitjt.The force acting onith agent from jth agent is as follows:
(10)fijdt=GtMit×MjtRi,j+ϵxjdt−xidt.Gt is a function of the iteration time:
(11)Gt=G0e−αt/T,where G0 is the initial value, α is a shrinking parameter, and T represents the maximum number of iterations:
(12)Fidt=∑j∈Kbest,j≠irandjFijdt,where Kbest is the set of the first K agents with the biggest mass; the acceleration of theith agent is calculated as follows:
(13)aidt=FidtMit.Further velocity is updated using the following equation:(14)vidt+1=randi×vidt+aidt,(15)xidt+1=xid+vidt+1.By summing up the equations, acceleration can also be written as(16)aidt=∑j∈Kbest,j≠irandj×MjtGtRijt+ϵxjdt−xidt.


### 2.3. The Hybrid GSABP Algorithm

In the optimization problems, there are a lot of local minima. The hybrid method final results reflect the aptitude of the algorithm in overcoming local minima and attaining a close global optimum [36]. The error of FNN is often large in the initial period of the training process. For solving real-world and complex optimization problems, one of the most well-known methods is the gravitational search algorithm (GSA). The gravitational search technique suffers from a slow convergence rate and weak local search capabilities while solving complicated optimization problems. The BP algorithm has a strong ability to search local optimum, but its ability to search global optimum is weak. The hybrid GSABP is proposed to combine the global search ability of GSA with the local search ability of BP. This combination takes advantage of both algorithms to optimize the weights and biases of the FNN.


## 2.1. Multilayer Perceptron with Feedforward Neural Network

The connections of FNNs between the neurons are unidirectional and one-way. In neural networks [2], neurons are in parallel layers. The first layer is the input layer, the second layer is the concealed layer, and the last layer is the output layer. Figure 1 shows an example of a FNN using MLP.Figure 1
One hidden layer in a multilayer perceptron.The output of a given data has been calculated in step by step procedure [18]: the average sum of weight in input is calculated in
(1)sj=∑i=1nWijXi−θj,j=1,2,⋯,h.The hidden layer values are calculated in(2)sj=sigmoidsj=11+exp−sj,j=1,2,⋯,h.The output MSE and accuracy have been calculated in(3)Ok=∑j=1hwjk.sj−θ′,k=1,2,⋯,m,(4)Ok=sigmoidOk=11+exp−Ok,j=1,2,⋯,m.From input, the output of MLPs has been observed with the help of biases and weights in equations (1) to (4).


## 2.2. Gravitational Search Algorithm

The typical GSA is a newly projected search algorithm. GSA firstly initializes the positions ofN agents randomly, shown as
(5)Xi=xi1,⋯,xid,⋯,xiDfor i=1,2,⋯,N, where D is the dimension index of the search space and xid represents the ith agent in the dth dimension:
(6)qit=fiti−worsttbestt−worstt,(7)Mit=qit∑j=1Nqjt,where fitit and Mit represent the fitness and bestt and worstt are defined in the following equations:
(8)bestt=minjϵ1,⋯,Nfitjt,(9)worstt=maxjϵ1,⋯,Nfitjt.The force acting onith agent from jth agent is as follows:
(10)fijdt=GtMit×MjtRi,j+ϵxjdt−xidt.Gt is a function of the iteration time:
(11)Gt=G0e−αt/T,where G0 is the initial value, α is a shrinking parameter, and T represents the maximum number of iterations:
(12)Fidt=∑j∈Kbest,j≠irandjFijdt,where Kbest is the set of the first K agents with the biggest mass; the acceleration of theith agent is calculated as follows:
(13)aidt=FidtMit.Further velocity is updated using the following equation:(14)vidt+1=randi×vidt+aidt,(15)xidt+1=xid+vidt+1.By summing up the equations, acceleration can also be written as(16)aidt=∑j∈Kbest,j≠irandj×MjtGtRijt+ϵxjdt−xidt.


## 2.3. The Hybrid GSABP Algorithm

In the optimization problems, there are a lot of local minima. The hybrid method final results reflect the aptitude of the algorithm in overcoming local minima and attaining a close global optimum [36]. The error of FNN is often large in the initial period of the training process. For solving real-world and complex optimization problems, one of the most well-known methods is the gravitational search algorithm (GSA). The gravitational search technique suffers from a slow convergence rate and weak local search capabilities while solving complicated optimization problems. The BP algorithm has a strong ability to search local optimum, but its ability to search global optimum is weak. The hybrid GSABP is proposed to combine the global search ability of GSA with the local search ability of BP. This combination takes advantage of both algorithms to optimize the weights and biases of the FNN.


## 3. The Proposed Hybrid Algorithm

The main concern to hybridize the algorithm is to maintain the constancy between exploration and exploitation. In the initial iterations, it is achieved step size of agents. In the final iterations, it is very difficult to avoid the global optima. Then, in the later iteration, the fitness focus is on small step size for exploitation. For better performance and to solve the problem of early convergence, a hybrid technique is adopted. In final iterations, we have a problem of slow exploitation and deterioration. Weights are used to assess fitness function in GSA. As a result, fit masses are seen as slow-moving, hefty items.Then, at first iterations, particles ought to travel across the scope of the search. After that, they have found a good answer; they must wrinkle around it in order to obtain the most effective solution out of it. In GSA, the masses get heavier. Because masses swarm around a solution in the later stages of iterations, their weights are virtually identical. Their gravitational forces are about equal in intensity, and they fascinate each other. As a result, they are unable to travel rapidly to the best answer. A variety of issues have been faced by GSA. The algorithm that has been presented has the capacity to overcome the challenges that GSA has had to deal with. As a result, in this paper, GSADMSPSO proposes a neighborhood approach with dynamic multiswarm (DMS).In the first iteration, the proposed technique promotes exploration, and in the final iteration, it prioritizes exploitation. The proposed approach initially works on masses of agents in the first phase. Because the agent’s weight fitness is poor, it will not be able to achieve peak performance and to look into the search area. Agents that are light in weight can be used; heavy-weight agents, on the other hand, can be chosen to utilise their surroundings using neighborhood strategy. As a consequence, a dynamic multiswarm (DMS) is used, along with a novel neighborhood strategy, as illustrated in the equation below:(17)mit=0.9∗fitibestit−worstitmodfitj=0,thenregroupthesubswarm,wherefitit indicates the fitness value of the agenti and worstit and bestit are defined as follows:
(18)bestt=lowjϵregroupofswarmsfitit,(19)worstt=highjϵregroupofswarmfitit.The swarm is divided into several subswarms according to equation (17), and each agent’s neighbors can attract it by smearing the gravitational pull on it. They use their own members to look for higher placements in the search area. The subswarms, on the other hand, are dynamic, and a regrouping schedule is frequently used to reorganize them, which is a periodic interchange of information. Through an arbitrary regrouping timetable, agents from various subswarms are rebuilt into a new configuration. As a result, DMS can choose the neighbors with the shortest distance. These neighbors called an agent is agenti. As a result, each component impacts the agent’s ability to attract another swarm agent. The DMS has defined the worst and best agenti. In the last iteration, the global lookup capability of the DMS PSO algorithm was employed, and equations (20) and (21) are utilised to update the individual’s location and velocity:
(20)vit+1=wvit+c1′r1aidt+c2′r2gbest−xit,(21)xit+1=xit+vit+1,whereVitis the velocity at which agentic1 and c2 are accelerating coefficients at iteration t. r1 select a number between 0 and 1 at random which is r2. The first part is similar to GSA’s, with a focus on mass research. The second element is in charge of enticing people to the best crowds thus far. Each mass’s distance between you and the best mass is computed using gbest−xit a random percentage of the ultimate force aimed towards the most advantageous mass.Set the parameters of the algorithm;N is the total number of particles, including the total number of particles. In the suggested approach, the amount of times you have iterated is t, G0 is the gravitational constant, and a is the decreasing coefficient. Create populations at random. The particle’s location vector is set as Xi=x1,x2,x3,⋯,xn; the velocity is initialized as vi=vi1,vi2,vi3,⋯,vint; the particles are divided into the global best value for numerical subswarms gbest and the ideal value for each individual pbest. Eventually, using the formula below, calculate every person’s fitness value. Then, using each individual’s fitness value, calculate it and keep track of the optimum spot gbest, constant of gravitation, and the forces that result from it, which are known. At each cycle, the best solution found so far should be updated. Once the accelerations have been calculated and the best solution has been updated, using the DMS PSO algorithm’s global search capability, all agents’ velocities may be computed using equation (20). Finally, agents’ positions are revised as follows (equation (21)). The procedure comes to an end when an end condition is met. The proposed method’s general phases are shown in Figure 2.Figure 2
Flow chart of a GSADMSPSO.Because of the dynamic multiswarm nature of our suggested strategy, each agent may examine the best option, and the masses are given access to a kind of local intelligence. In comparison to existing GSA versions, the proposed technique has the potential to offer better outcomes. The efficiency of the proposed methodology is examined in the next part using a variety of static, dynamic, and real-time issues.


## 4. GSADMSPSO for Training FNNs

The proposed approach of each search agent consists of three parts for the training of FNN: The first section discusses the biases; the second section contains the weights that connect the last component comprising the weights that link the hidden layer nodes to the output layer and the input layer nodes to the hidden layer. This section describes the proposed GSADMSPSO method for training a single layer MLP. The proposed FNNGSADMSPSO is used to reduce error and improve accuracy for correct weights and biases. Equations are used to generate output from the input in the FNN model (1–4). The weight and bias values were used in the first stage of the proposed methodology.Equation (9) states that the error is calculated using the fitness function. Neural network learning is the process of iteratively reducing the cost function. At each iteration, the application weights and biases at FNN have been changed resulting in cost reduction. The suggested FNNGSADMSPSO method can be described as follows:
(1)
A population is randomly created. It is in charge of a collection of weights and bias values(2)
For assessment, the MSE criteria are employed. It is chosen as the best fitness function after being calculated for each iteration on a given training dataset(3)
To create a new solution, the best position and best global values are updated(4)
The number of iterations during which the global solution’s best fitness value was obtained remains unaltered which is tracked using a counter(5)
During the iterations, to create a better population, the places with the worst fitness values are determined. The values of their fitness are calculated and compared to prior positions. If the opposite position has a higher fitness value, it will be introduced into the population and assigned to position 7, else it will be assigned to position 6(6)
The proposed GSADMSPSO is used to indicate their new positions for updated positions that are not as good as their actual positions(7)
The procedure returns to step 2 after creating a new population. The process is continued until the desired number of generations is reached(8)
Finally, the best answer is supplied to FNN, and the test data is utilised to evaluate its performance


### 4.1. Fitness Function

The MLP receives the weight and bias matrices and the fitness worth of each option. The solution is calculated using the mean squared error (MSE). The fitness function of suggested algorithms is defined as MSE, which is stated in equation (9):
(22)MSE=1N∑i=1nc−o2,where n is the number of training samples, o denotes the predicted values of the neural network, and c denotes the class names. The classification accuracy criteria, aside from the MSE requirement, are used to evaluate MLP’s classification performance on the new dataset, which is determined as the following: Z is the sample size in the test dataset and N is the number of samples successfully classified by the classifier:
(23)Accuracy=~ZZ.The first approach is used to apply GSA, PSOGSA, GSADMSPSO, and GG-GSA on a FNN in this study. This indicates that the FNN’s structure is fixed; GSA, PSOGSA, GSADMSPSO, and GG-GSA select a set of weights and biases that give the FNN the least amount of inaccuracy.


## 4.1. Fitness Function

The MLP receives the weight and bias matrices and the fitness worth of each option. The solution is calculated using the mean squared error (MSE). The fitness function of suggested algorithms is defined as MSE, which is stated in equation (9):
(22)MSE=1N∑i=1nc−o2,where n is the number of training samples, o denotes the predicted values of the neural network, and c denotes the class names. The classification accuracy criteria, aside from the MSE requirement, are used to evaluate MLP’s classification performance on the new dataset, which is determined as the following: Z is the sample size in the test dataset and N is the number of samples successfully classified by the classifier:
(23)Accuracy=~ZZ.The first approach is used to apply GSA, PSOGSA, GSADMSPSO, and GG-GSA on a FNN in this study. This indicates that the FNN’s structure is fixed; GSA, PSOGSA, GSADMSPSO, and GG-GSA select a set of weights and biases that give the FNN the least amount of inaccuracy.


## 5. Results and Discussions

On 16 standard classification datasets, the proposed technique for FNN training is assessed in terms of its effectiveness using the UCI Machine Learning repository [41] which is represented in Table 1. And for three-bit parity, the suggested algorithm’s skills in training FNNs are compared using benchmark problems, which are shown in Table 2. It is conceivable that every particle in this issue is randomly started in the 0,1 range. The gravitational constant (G0) is one in FNNGSA, whereas it is set to 20. Particles’ initial velocities are arbitrarily created in the range 0,1, and for each particle, at the start, the acceleration and mass parameters are both set to zero. In FNNPSOGSA, c1andc2 are both set to 1, and the beginning velocities of the agents are generated at random in the range [0,1], and w declines linearly from 0.9 to 0.4. In FNNGG-GSA, the gravitational constant (G0) is set to 1, while the value is adjusted to 20. Particles’ initial velocities are created arbitrarily in the range [0,1], and the initial acceleration and mass values for each particle are set to 0. When c1andc2 are both set to 1, w for FNNGSADMSPSO reduces linearly from 0.9 to 0.4, and the agents’ beginning velocities are produced at random in the range [0,1].Table 1
UCI has compiled a list of real-world datasets.
Dataset name# of features# of samplesGlass9214Vowel10520Wine13177Yeast81440Sonar60200Heart13270Wisconsin breast cancer9680Colon cancer200060Shuttle950000Lymphoma402659Iris4150Lung cancer5632Hepatitis19155Dermatology34366Zoo16101Abalone83842Table 2
The parity problem with three bits (3-bit XOR).
InputOutput0 0 000 0 110 1 010 1 101 0 011 0 101 1 001 1 11


### 5.1. The XOR Issue withN Bits of Parity

WithN bits of parity, the XOR problem arises. The N bits’ parity problem is a well-known nonlinear benchmark problem. The goal is to count how many “1’s” are in the input vector. The input vector’s XOR result should be reimbursed. The output is “1” if the input vector has an odd number of “1’s.” The output is “0” if the input vector has an even number of “1’s.”For three bits, Table1 shows the problem’s inputs and intended outputs: We cannot solve the XOR problem in a linear fashion without hidden layers, and we cannot solve it with a FNN either (perceptron). To solve this problem, we compare a FNN with the structure 3‐S‐1, where S is the number of hidden nodes, to FNNs with S=5, 6, 7, 8, 9, 10, 11, 13, 15, 20, and 30 in this section.


### 5.2. Comparison with Other Techniques through Parity Problem with Three Bits (3-Bit XOR)

On the suite of three-bit parity problem (3-bit XOR) benchmark functions, GSADMSPSO was compared to other common GSA variations to assess its performance. The suggested method was compared to GSA, PSOGSA, and GG-GSA. Variants were applied to the three-bit parity problem (3-bit XOR) mentioned in Table2 in this section. Table 3 displays the average, best, and standard deviation of the Best Square Error (MSE) for all training samples over 30 distinct trials. According to a t-test with a significance level of 5%, the bold values represent the best response. When compared to the other algorithms, GSADMSPSO produced the best results. The SIW-APSO-LS gives the best accuracy, according to the results. GSA, GG-GSA, PSOGSA, and Figure 3 depict GSADMSPSO convergence curves based on MSE averages for all training samples throughout 30 different runs. The convergence curves for FNN with S=5, 9, 13, and 30 are shown in Figures 4(a)–(d). These results show that FNNPSOGSA seems to have the best FNN convergence rate.Table 3
In a 3-bit XOR problem, the average, best, and standard deviation of MSE for all training samples were calculated during 30 different runs.
Hidden nodes (S)AlgorithmAverage MSEBest MSEStd. MSE5FNNGSADMSPSOFNNPSOGSAFNNGG-GSAFNNGSA1.178E−041.31E−027.34E−031.79E−012.78E−113.17E−104.23E−084.34E−023.78E−042.60E−025.78E−035.59E−026FNNGSADMSPSOFNNPSOGSAFNNGG-GSAFNNGSA2.56E−044.54E−033.67E−031.45E−013.78E−093.85E−094.71E−092.96E−025.43E−045.63E−037.56E−036.42E−027FNNGSADMSPSOFNNPSOGSAFNNGG-GSAFNNGSA3.67E−042.71E−032.53E−051.25E−013.8274E−241.42E−114.67E−121.24E−027.89E−041.28E−025.67E−056.53E−028FNNGSADMSPSOFNNPSOGSAFNNGG-GSAFNNGSA1.45E−042.03E−052.78E−031.14E−011.13E−091.25E−113.35E−137.12E−035.45E−056.28E−057.89E−037.63E−029FNNGSADMSPSOFNNPSOGSAFNNGG-GSAFNNGSA3.45E−087.72E−062.78E−049.40E−023.67E−175.53E−123.51E−065.84E−025.45E−072.65E−053.72E−032.11E−0210FNNGSADMSPSOFNNPSOGSAFNNGG-GSAFNNGSA3.67E−066.13E−065.96E−078.04E−022.89E−091.55E−102.34E−111.05E−025.78E−062.88E−052.45E−065.44E−0211FNNGSADMSPSOFNNPSOGSAFNNGG-GSAFNNGSA1.67E−061.82E−053.45E−047.76E−025.73E−194.65E−104.34E−071.20E−024.34E−057.69E−055.43E−034.31E−0213FNNGSADMSPSOFNNPSOGSAFNNGG-GSAFNNGSA6.45E−034.16E−025.52E−026.57E−021.87E−064.62E−053.45E−031.23E−022.78E−028.64E−027.78E−022.34E−0115FNNGSADMSPSOFNNPSOGSAFNNGG-GSAFNNGSA3.78E−024.16E−031.45E−046.97E−025.67E−104.66E−113.67E−169.28E−036.71E−022.28E−025.55E−044.12E−0220FNNGSADMSPSOFNNPSOGSAFNNGG-GSAFNNGSA7.45E−031.68E−028.78E−017.50E−024.78E−124.12E−085.67E−032.34E−023.56E−026.32E−029.67E−013.33E−0130FNNGSADMSPSOFNNPSOGSAFNNGG-GSAFNNGSA3.73E−054.16E−031.36E−046.23E−022.79E−124.57E−144.67E−121.44E−028.45E−052.28E−026.45E−043.91E−02Figure 3
The framework of the proposed method.Figure 4
Convergence curves of different algorithms based on averages of MSE for all training samples over 30 independent runs in a 3-bit XOR problem. (a–d) Are the convergence curves for FNNs withS=5, 9, 13, and 20, respectively.
(a)(b)(c)(d)


### 5.3. Comparison with Other Techniques through Standard Classification Datasets

Many experiments were conducted in order to connect the results of the GSADMSPSO technique with that of the GSA, GG-GSA, and GSADMSPSO methods, and Table4 shows the PSOGSA feature selection techniques and outcomes in terms of averages, bests, and standard deviations. According to a t-test with a significance level of 5%, the bold values in the tables represent the best practicable solution for the difficulties.Table 4
Different algorithms’ average performance in percent of the given features.
DatasetFNNGSAFNNGG-GSAFNNPSOGSAFNNGSADMSPSOGlassAvg.0.7410.7490.7480.767Best0.7530.7640.7580.785Std.0.01690.00590.00890.0086VowelAvg.0.9440.9650.9730.981Best0.9530.9840.9890.992Std.0.00450.00720.00810.0056WineAvg.0.9170.9610.9770.961Best0.9330.9730.9830.983Std.0.01270.00850.00340.0066YeastAvg.49.170.50150.2353.11Best0.9330.5130.5180.552Std.0.01370.01140.01260.0094SonarAvg.0.9220.9430.9320.961Best0.9450.9580.9410.973Std.0.00620.00930.00950.0028HeartAvg.0.7480.7770.7530.763Best0.7530.7890.7750.771Std.0.01450.00710.00380.0076Wisconsin breast cancerAvg.0.9590.9670.9710.988Best0.9610.9710.9850.992Std.0.00210.01390.00480.0017Colon cancerAvg.0.8190.8390.8340.845Best0.8360.8450.8510.859Std.0.01630.00620.00340.0074ShuttleAvg.0.9070.9160.9230.931Best0.9130.9230.9350.954Std.0.03670.01370.00850.0073LymphomaAvg.0.7990.8170.8270.814Best0.8140.8250.8440.826Std.0.01830.00450.00670.0034IrisAvg.0.9210.9410.9570.984Best0.9450.9630.9690.994Std.0.00430.00610.00920.0019Lung cancerAvg.0.4470.4690.4460.479Best0.4670.4790.4680.486Std.0.00320.00560.01230.0041HepatitisAvg.0.8040.8150.8070.823Best0.8280.8290.8210.835Std.0.01490.00250.00760.0093DermatologyAvg.0.9440.9520.9470.938Best0.9560.9670.9510.946Std.0.01540.00610.01520.0153ZooAvg.0.8070.8470.8590.864Best0.8240.8530.8640.882Std.0.00290.00420.00520.0073AbaloneAvg.0.2420.2480.2130.249Best0.2460.2490.2360.25Std.0.05780.07310.08530.0351On various datasets, Table4 provides the average classification accuracy of the four methods. As shown in Table 4, in 12 datasets, the suggested approach achieves the highest classification accuracy. In terms of average classification accuracy, GG-GSA outperforms the other two datasets.According to these findings, the suggested technique beats the competition in datasets with less input parameters. The suggested algorithm’s improved exploration and exploitation capacity is the cause for its high performance. Figure4 shows the convergence curves of different algorithms based on averages of MSE for all training samples over 30 independent runs in a 3-bit XOR problem.The results show that the proposed method is very much successful in FNN training, because there is a balance between exploration and exploitation; this is the case. GSADMSPSO shows decent exploration since all search agents collaborate in updating a search agent’s location. Because of the inherent social component of PSO, GSADMSPSO’s exploitation is highly accurate, resulting in rapid convergence. GSADMSPSO can prevent local optima and improve search space convergence.


## 5.1. The XOR Issue withN Bits of Parity

WithN bits of parity, the XOR problem arises. The N bits’ parity problem is a well-known nonlinear benchmark problem. The goal is to count how many “1’s” are in the input vector. The input vector’s XOR result should be reimbursed. The output is “1” if the input vector has an odd number of “1’s.” The output is “0” if the input vector has an even number of “1’s.”For three bits, Table1 shows the problem’s inputs and intended outputs: We cannot solve the XOR problem in a linear fashion without hidden layers, and we cannot solve it with a FNN either (perceptron). To solve this problem, we compare a FNN with the structure 3‐S‐1, where S is the number of hidden nodes, to FNNs with S=5, 6, 7, 8, 9, 10, 11, 13, 15, 20, and 30 in this section.


## 5.2. Comparison with Other Techniques through Parity Problem with Three Bits (3-Bit XOR)

On the suite of three-bit parity problem (3-bit XOR) benchmark functions, GSADMSPSO was compared to other common GSA variations to assess its performance. The suggested method was compared to GSA, PSOGSA, and GG-GSA. Variants were applied to the three-bit parity problem (3-bit XOR) mentioned in Table2 in this section. Table 3 displays the average, best, and standard deviation of the Best Square Error (MSE) for all training samples over 30 distinct trials. According to a t-test with a significance level of 5%, the bold values represent the best response. When compared to the other algorithms, GSADMSPSO produced the best results. The SIW-APSO-LS gives the best accuracy, according to the results. GSA, GG-GSA, PSOGSA, and Figure 3 depict GSADMSPSO convergence curves based on MSE averages for all training samples throughout 30 different runs. The convergence curves for FNN with S=5, 9, 13, and 30 are shown in Figures 4(a)–(d). These results show that FNNPSOGSA seems to have the best FNN convergence rate.Table 3
In a 3-bit XOR problem, the average, best, and standard deviation of MSE for all training samples were calculated during 30 different runs.
Hidden nodes (S)AlgorithmAverage MSEBest MSEStd. MSE5FNNGSADMSPSOFNNPSOGSAFNNGG-GSAFNNGSA1.178E−041.31E−027.34E−031.79E−012.78E−113.17E−104.23E−084.34E−023.78E−042.60E−025.78E−035.59E−026FNNGSADMSPSOFNNPSOGSAFNNGG-GSAFNNGSA2.56E−044.54E−033.67E−031.45E−013.78E−093.85E−094.71E−092.96E−025.43E−045.63E−037.56E−036.42E−027FNNGSADMSPSOFNNPSOGSAFNNGG-GSAFNNGSA3.67E−042.71E−032.53E−051.25E−013.8274E−241.42E−114.67E−121.24E−027.89E−041.28E−025.67E−056.53E−028FNNGSADMSPSOFNNPSOGSAFNNGG-GSAFNNGSA1.45E−042.03E−052.78E−031.14E−011.13E−091.25E−113.35E−137.12E−035.45E−056.28E−057.89E−037.63E−029FNNGSADMSPSOFNNPSOGSAFNNGG-GSAFNNGSA3.45E−087.72E−062.78E−049.40E−023.67E−175.53E−123.51E−065.84E−025.45E−072.65E−053.72E−032.11E−0210FNNGSADMSPSOFNNPSOGSAFNNGG-GSAFNNGSA3.67E−066.13E−065.96E−078.04E−022.89E−091.55E−102.34E−111.05E−025.78E−062.88E−052.45E−065.44E−0211FNNGSADMSPSOFNNPSOGSAFNNGG-GSAFNNGSA1.67E−061.82E−053.45E−047.76E−025.73E−194.65E−104.34E−071.20E−024.34E−057.69E−055.43E−034.31E−0213FNNGSADMSPSOFNNPSOGSAFNNGG-GSAFNNGSA6.45E−034.16E−025.52E−026.57E−021.87E−064.62E−053.45E−031.23E−022.78E−028.64E−027.78E−022.34E−0115FNNGSADMSPSOFNNPSOGSAFNNGG-GSAFNNGSA3.78E−024.16E−031.45E−046.97E−025.67E−104.66E−113.67E−169.28E−036.71E−022.28E−025.55E−044.12E−0220FNNGSADMSPSOFNNPSOGSAFNNGG-GSAFNNGSA7.45E−031.68E−028.78E−017.50E−024.78E−124.12E−085.67E−032.34E−023.56E−026.32E−029.67E−013.33E−0130FNNGSADMSPSOFNNPSOGSAFNNGG-GSAFNNGSA3.73E−054.16E−031.36E−046.23E−022.79E−124.57E−144.67E−121.44E−028.45E−052.28E−026.45E−043.91E−02Figure 3
The framework of the proposed method.Figure 4
Convergence curves of different algorithms based on averages of MSE for all training samples over 30 independent runs in a 3-bit XOR problem. (a–d) Are the convergence curves for FNNs withS=5, 9, 13, and 20, respectively.
(a)(b)(c)(d)


## 5.3. Comparison with Other Techniques through Standard Classification Datasets

Many experiments were conducted in order to connect the results of the GSADMSPSO technique with that of the GSA, GG-GSA, and GSADMSPSO methods, and Table4 shows the PSOGSA feature selection techniques and outcomes in terms of averages, bests, and standard deviations. According to a t-test with a significance level of 5%, the bold values in the tables represent the best practicable solution for the difficulties.Table 4
Different algorithms’ average performance in percent of the given features.
DatasetFNNGSAFNNGG-GSAFNNPSOGSAFNNGSADMSPSOGlassAvg.0.7410.7490.7480.767Best0.7530.7640.7580.785Std.0.01690.00590.00890.0086VowelAvg.0.9440.9650.9730.981Best0.9530.9840.9890.992Std.0.00450.00720.00810.0056WineAvg.0.9170.9610.9770.961Best0.9330.9730.9830.983Std.0.01270.00850.00340.0066YeastAvg.49.170.50150.2353.11Best0.9330.5130.5180.552Std.0.01370.01140.01260.0094SonarAvg.0.9220.9430.9320.961Best0.9450.9580.9410.973Std.0.00620.00930.00950.0028HeartAvg.0.7480.7770.7530.763Best0.7530.7890.7750.771Std.0.01450.00710.00380.0076Wisconsin breast cancerAvg.0.9590.9670.9710.988Best0.9610.9710.9850.992Std.0.00210.01390.00480.0017Colon cancerAvg.0.8190.8390.8340.845Best0.8360.8450.8510.859Std.0.01630.00620.00340.0074ShuttleAvg.0.9070.9160.9230.931Best0.9130.9230.9350.954Std.0.03670.01370.00850.0073LymphomaAvg.0.7990.8170.8270.814Best0.8140.8250.8440.826Std.0.01830.00450.00670.0034IrisAvg.0.9210.9410.9570.984Best0.9450.9630.9690.994Std.0.00430.00610.00920.0019Lung cancerAvg.0.4470.4690.4460.479Best0.4670.4790.4680.486Std.0.00320.00560.01230.0041HepatitisAvg.0.8040.8150.8070.823Best0.8280.8290.8210.835Std.0.01490.00250.00760.0093DermatologyAvg.0.9440.9520.9470.938Best0.9560.9670.9510.946Std.0.01540.00610.01520.0153ZooAvg.0.8070.8470.8590.864Best0.8240.8530.8640.882Std.0.00290.00420.00520.0073AbaloneAvg.0.2420.2480.2130.249Best0.2460.2490.2360.25Std.0.05780.07310.08530.0351On various datasets, Table4 provides the average classification accuracy of the four methods. As shown in Table 4, in 12 datasets, the suggested approach achieves the highest classification accuracy. In terms of average classification accuracy, GG-GSA outperforms the other two datasets.According to these findings, the suggested technique beats the competition in datasets with less input parameters. The suggested algorithm’s improved exploration and exploitation capacity is the cause for its high performance. Figure4 shows the convergence curves of different algorithms based on averages of MSE for all training samples over 30 independent runs in a 3-bit XOR problem.The results show that the proposed method is very much successful in FNN training, because there is a balance between exploration and exploitation; this is the case. GSADMSPSO shows decent exploration since all search agents collaborate in updating a search agent’s location. Because of the inherent social component of PSO, GSADMSPSO’s exploitation is highly accurate, resulting in rapid convergence. GSADMSPSO can prevent local optima and improve search space convergence.


## 6. Conclusion

Many real-world issues can be solved using gravity-based search techniques. As a result, in this paper, a unique GSADMSPSO is suggested. Using GSA, PSOGSA, GG-GSA, and GSADMSPSO, four novel training algorithms dubbed FNNGSA, FNNPSOGSA, FNNGG-GSA, and FNNGSADMSPSO are introduced and examined in this paper. The benchmark tasks were 3-bit XOR, function, and 16 conventional categorization problems, and the results show that the suggested approach is quite successful in FNN training, because there is a decent trade-off between exploration and exploitation; this is the case. GSADMSPSO exhibits good exploration since all search agents collaborate in updating a search agent’s location. Because of the inherent social component of PSO, GSADMSPSO’s exploitation is highly accurate, resulting in rapid convergence. GSADMSPSO can prevent local optima and improve search space convergence.



---

*Source: 2636515-2022-05-30.xml*