In this study, a new PSO variant known as MSPSOTLP is proposed to solve challenging optimization problems, including the ANN training problem formulated in Equation (8), with improved performances. For the latter problem, the proposed MSPSOTLP is used to optimize the weights, biases, and selection of activation functions of the ANN model when solving the given datasets. The essential modifications introduced to enhance the search performance of MSPSOTLP are described in the following subsections.
3.2.1. Modified Initialization Scheme of MSPSOTLP
Population initialization is considered a crucial process to develop robust MSAs because the quality of initial candidate solutions can influence the algorithm’s convergence rate and searching accuracy [
17]. Most PSO variants employed random initialization to generate the initial population without considering any meaningful information about the search environment [
17]. The stochastic behavior of the random initialization scheme might produce particles at inferior solution regions at the beginning stage of optimization. This undesirable scenario can prevent the algorithm’s convergence towards the global optimum, thus compromising the algorithm’s overall performance.
In this study, a modified initialization scheme incorporated with the chaotic system (CS) and oppositional-based learning (OBL), namely the CSOBL initialization scheme, is designed for the proposed MSPSOTLP to overcome the drawbacks of the conventional initialization scheme. Unlike a random system that demonstrates completely unpredictable behaviors, CS is considered a more powerful initialization scheme that can produce an initial swarm with better diversity by leveraging its ergodicity and non-repetition natures. Denote
as the initial condition of a chaotic variable that is randomly generated in each independent run.
refers to the value of the chaotic variable in
z-th iteration with
, where
represents the maximum sequence number. Given the bifurcation coefficient of
, the chaotic sequence is updated using a chaotic sine map [
62] as:
Let
and
be the upper and lower limits of the decision variable in each
d-th dimension, respectively, where
. Given the chaotic variable
produced in the final iteration of
Z, the
d-th dimension of each
n-th chaotic swarm member
can be initialized as:
Referring to Equation (10), a chaotic population with a swarm size of N can be produced and represented as a population set of .
Despite the benefits of the chaotic map in enhancing population diversity, these chaotic swarm members can be initialized in solution regions far away from the global optimum, leading to the low convergence rate of the algorithm. To overcome this drawback, a solution set opposite with
is generated by leveraging the OBL concept [
63]. For every
d-th dimension of
n-th chaotic swarm member represented as
, the corresponding opposite swarm member
is calculated using OBL strategy [
17,
64] as follows:
Similarly, an opposite population with a swarm size of N can be generated using Equation (11) and represented as another population set of .
To produce an initial population with better fitness and wider coverage in the solution space, both of
and
are merged as a combined population set of
with a swarm size of 2
N as follows:
Subsequently, the fitness of all solution members in
are evaluated, and a sorting operator of
is then applied to rearrange these solution members from the best to worst based on their fitness to produce a sorted population set of
, where
Finally, a truncation operator
is applied to select the top
N solution members of on
to construct the initial population of MSPSOTLP, i.e.,
, where
The pseudocode used to describe the CSOBL initialization scheme of MSPSOTLP is presented in Algorithm 1.
Algorithm 1. Pseudocode of CSOBL initialization scheme for MSPSOTLP |
Input: , , , , |
01: | Initialize and ; |
02: | for each n-th particle do |
03: | | for each d-th dimension do |
04: | | | Randomly generate initial chaotic variable ; |
05: | | | Initialize the chaotic sequence as ; |
06: | | | while is smaller than do |
07: | | | | Update chaotic variable using Equation (9); |
08: | | |
end while |
09: | | | Compute using Equation (10); |
10: | | | Compute using Equation (11); |
11: | |
end for |
12: | | ;/* Store new chaotic swarm member */ |
13: | | ;/* Store new opposite swarm member */ |
14: |
end for |
15: | Construct using Equation (12); |
16: | Evaluate the fitness of all solution members in ; |
17: | Sort all solution members of from the best to worst using Equation (13); |
18: | Produce the initial population using Equation (14); |
Output: |
3.2.2. Primary Learning Phase of MSPSOTLP
Most PSO variants, including PSOWV, rely on the global best position to adjust the search trajectories of particles during the optimization process without considering the useful information of other non-fittest particles in the population. Although the directional information of the global best position might be useful to solve simple unimodal problems, it might not necessarily be the best option to handle complex problems with multiple numbers of local optima due to the possibility of the global best position being trapped at the local optima in an earlier stage of optimization. Without a proper diversity preservation scheme, other population members tend to be attracted by misleading information about the global best position and converge towards the inferior region, leading to premature convergence and poor optimization results.
To address the aforementioned issues, several modifications are incorporated into the primary learning phase of MSPSOTLP to achieve a proper balancing of exploration and exploitation searches. The multiswarm concept is first introduced as a diversity preservation scheme at the beginning stage of the primary learning phase by randomly dividing the main population of
into
S subswarms. Each
s-th subswarm is denoted by
consists of
particles, where
. To produce each
s-th subswarm
from the main population
, a reference point of
is randomly generated in search space. The normalized Euclidean distance between the reference point
and personal best position of each
n-th particle, i.e.,
are measured as
, i.e.,
Referring to the
values computed for all
N particles, the
particles with the nearest
distances from
are identified as the members of
s-th subswarm and stored in
before they are discarded from the main population
. From Algorithm 2, the reference-point-based population division scheme used to generate the multiswarm for the primary learning phase of MSPSOTLP is repeated until all
subswarms are generated.
Algorithm 2. Pseudocode of reference-point-based population division scheme used to generate the multiswarm for the primary learning phase of MSPSOTLP |
Input: , , , , , , |
01: | Initialize ; |
02: | while main population is not empty do |
03: | | Randomly generate in search space; |
04: | | for each n-th particle do |
05: | | | Calculate using Equation (15); |
06: | | end for |
07: | | Select particles with the nearest from to construct ; |
08: | | Eliminate the members of from ; |
09: | | ; /* Update the index of subswarm*/ |
10: |
end while |
Output: where
|
Define
as the personal best fitness of each
n-th particle stored in the
s-th subswarm
, where
and
. All
particles stored in each
s-th subswarm
are then sorted from the worst to best based on their personal best fitness values, as shown in
Figure 2. Accordingly, any
k-th particle stored in the sorted
is considered to have better or equally good personal best fitness than that of
n-th particle if the condition of
is satisfied. Referring to
Figure 2, it is notable that the first particle stored in
has the worst personal best fitness, whereas the final particle stored in
has the most competitive personal best fitness after the sorting process. Therefore, the personal best position of the final particle is also considered as the subswarm best position of
represented as
for
.
For each
s-th sorted subswarm, define
as a set variable used to store the personal best position of all solution members that are superior to that of
n-th solution member for
. Notably, the set variable
is not constructed for the final solution member because none of the solution members stored in
has better personal best fitness than
or
. Referring to the solution members stored in each
, a unique mean position denoted as
is then specifically constructed to guide the search process of every
n-th solution member in the
s-th subswarm, where:
Apart from
, a social exemplar
that plays crucial roles to adjust the search trajectory of each
n-th particle stored in
is also formulated. In contrary to global best position, the social exemplar constructed for each
n-th particle is unique and it can guide the search process with better diversity by fully utilizing the promising directional information of other particles stored in
with better personal best fitness values. Specifically, each
d-th dimension of
n-th social learning exemplar for
s-th subswarm, i.e.,
, can be contributed by the same dimensional component of any randomly selected solution members of
. The procedures used to construct the social exemplar
for each
n-th particle stored in
are described in Algorithm 3, where
refers to a random integer generated between the indices of
and
.
Algorithm 3. Pseudocode used to generate the social exemplar for each non-fittest solution member in each subswarm |
Input: , , , |
01: | for each d-th dimension do |
02: | | Randomly generate an integer between indices of and ; |
03: | | Extract the associated component of from ; |
04: | | ; |
05: |
end for |
Output: |
Given the subswarm best position
, mean position
and social exemplar
, the new position
of each
n-th non-fittest solution member stored in the
s-th subswarm, where
and
, is updated as follows:
where
,
and
represent the acceleration coefficients;
are random numbers generated from uniform distributions. Referring to Equation (17), the directional information contributed by
and
are unique for each
n-th non-fittest solution member of
because the better solution members are stored in every set variable
are different for
. The social learning concept incorporated in Equation (17) also ensures that only the useful information brought by better-performing solutions is used to guide the search process of each
n-th particle to accelerate the algorithm’s convergence rate. Furthermore, this learning strategy does not consider the global best position in updating the new position of each
n-th particle; therefore, it has better robustness against premature convergence issues.
On the other hand, different approaches are proposed to generate the mean position and social exemplar used for guiding the search process of the final particle stored in every
n-th subswarm because none of the solution members of
can have better personal best fitness than that of
. Define
as a set variable used to store the subswarm best position of any
b-th subswarm
if
is better than
, i.e.,
where
is a set containing the indices of all subswarms that have better subswarm best fitness than that of
s-th subswarm;
refers to the size of set
in the range of 0 to
. Obviously,
is the subswarm best position of
s-th subswarm is the same as the global best position
of population, therefore the empty sets of
are obtained under this circumstance.
The subswarm consists of
, the unique mean position
used to guide the search process of the final particle
stored in each
s-th subswarm based on
are calculated as follows:
Similarly, a social exemplar of
is also derived from adjusting the search trajectory of the final particle
stored in each
s-th subswarm except for the one consisting of
. As shown in Algorithm 4, each
d-th dimension of the social exemplar is assigned to the final particle of
s-th subswarm
, i.e.,
, is contributed by the same dimensional component of any subswarm best position
randomly selected from
, where b refers to a subswarm index randomly selected from
.
Algorithm 4. Social Exemplar Scheme for the Best Particle in Each Subswarm |
Input: , , , |
01: | for each d-th dimension do |
02: | | Randomly generated a subswarm index of ; |
03: | | Extract the corresponding component of from ; |
04: | | ; |
05: |
end for |
Output: |
Except for the subswarm consisting of
with
, the position
of final particle stored in each
s-th subswarm can be updated as follows:
where
are random numbers generated from a uniform distribution. Similarly, the directional information provided by
and
are unique for each final particle
in each
s-th subswarm
because the solution members stored in each
set are different. Contrary to Equation (17), the social learning concept introduced in Equation (20) allows each subswarm to converge towards the promising solution regions without experiencing rapid loss of population diversity by facilitating the information exchanges between different subswarms. In addition, the employment of
in Equation (20) is expected to improve the convergence rate of MSPSOTLP.
The overall procedures of the primary learning phase proposed for MSPSOTLP is described in Algorithm 5. For each new position
obtained from Equations (17) or (20), boundary checking is first performed to ensure all decision variables’ upper and lower limits are not violated. The fitness value corresponding to the updated
for each particle in
s-th subswarm is then evaluated as
and compared with those of its personal best position and global best position denoted as
and
, respectively. Both
and
are replaced by the updated
if the latter solution is proven to be superior to the latter two solutions.
Algorithm 5. Pseudocode of primary learning phase for MSPSOTLP |
Input: , , , , , , , |
01: | Divide main population into multiple subswarm using Algorithm 2; |
02: | Sort the solution members of from the worst to best based on their personal best fitness values and create for each s-th subswarm; |
03: | Identify the subswarm best position of each s-th subswarm and create for the final particle in all S subswarms using Equation (18); |
04: | Determine and for the final particle of all S subswarms based on ; |
05: | for each s-th subswarm do |
06: | | for each n-th particle do |
07: | | |
if then |
08: | | | | Calculate based on using Equation (16); |
09: | | | | Generate based on using Algorithm 3; |
10: | | | | Update using Equation (17); |
11: | | | else if then |
12: | | | | if then |
13: | | | | | Calculate based on using Equation (19); |
14: | | | | | Generate based on using Algorithm 4; |
15: | | | | | Update using Equation (20); |
16: | | | |
end if |
17: | | |
end if |
18: | | | Evaluate of the updated ; |
19: | | |
if is better than then |
20: | | | | ; |
21: | | | |
if is better than then |
22: | | | | | ; |
23: | | | |
end if |
24: | | |
end if |
25: | |
end for |
26: |
end for |
Output: |
3.2.3. Secondary Learning Phase of MSPSOTLP
Substantial studies [
19,
65] reported that most PSO variants employed single search operators that can only solve specific optimization problems with good results, but fail to perform well in the remaining problems due to the limited variations of exploration and exploitation strengths. For some challenging optimization problems, the fitness landscapes contained in different subregions of search space can be significantly different. Therefore, the particles need to adjust their exploration and exploitation strengths dynamically when searching in different regions of the solution space to locate global optimum and deliver good optimization results.
Motivated by these findings, a secondary phase is designed as an alternative framework of MSPSOTLP, where two search operators with different search characteristics are incorporated to guide the search process of particles with varying levels of exploration and exploitation strengths. Unlike the primary learning phase, both search operators assigned in the secondary learning phase aim to further refine those already found promising regions by searching around the personal best positions of all MSPSOTLP particles. Before initiating the secondary learning phase, all
S subswarms constructed during the primary learning phase, i.e.,
for
, are merged to form the main population
with
N particles as shown below:
To assign a search operator for each
n-th particle during the secondary learning phase of MSPSOTLP, a randomly selected particle with a population index of
e is randomly generated, where
and
. Define
as the personal best position of this randomly selected
e-th particle and its personal best fitness is evaluated as
. If the
e-th particle has better personal best fitness than that of
, the new personal best position of latter particle can be updated as
, where
where
are random numbers generated from a uniform distribution. The search operator of Equation (22) can attract of
n-th particle towards the promising solution regions covered by the
e-th peer particle, hence it behaves more exploratively.
For the case, if
e-th particle has more inferior personal best fitness than that of
n-th particle, the former solution is discarded. Another four distinct particles with population indices of
w,
x,
y and
z are randomly selected instead, where
and
. Denote
,
,
and
as the
d-th dimension of the personal best position for the
w-th,
x-th,
y-th and
z-th particles, respectively. Let
be the same
d-th dimension of the global best position. For every
n-th particle, each of the
d-th dimension of its new personal best position can be calculated as:
where
are random numbers generated from a uniform distribution. From Equation (23), there is a probability for each
to inherit its original information from
or to perform searching around the nearby region of
with small perturbations based on the information of
,
,
and
. Hence, the search operator of Equation (23) is considered more exploitative than that of Equation (22). The procedures used to implement the secondary learning phase of MSPSOTLP is shown in Algorithm 6. For each new
obtained from Equations (22) or (23), boundary checking is performed. For each
n-th particle, the fitness value of its updated
is obtained as
and compared with
and
. If
is better than
and
, the latter two solutions are replaced by the former one.
Algorithm 6. Pseudocode of secondary learning phase for MSPSOTLP |
Input: for , |
01: | Reconstruct main population using Equation (21); |
02: | for each n-th particle do |
03: | | Randomly select e-th particle from with and ; |
04: | | if is better than then |
05: | | | Calculate using Equation (22); |
06: | | else if is not better than then |
07: | | | for each d-th dimension do |
09: | | | | Calculate using Equation (23); |
10: | | |
end for |
11: | |
end if |
12: | | Evaluate ; |
13: | |
if is better than then |
14: | | | ; |
15: | | |
if is better than then |
16: | | | | ; |
17: | | |
end if |
18: | |
end if |
19: |
end for |
Output: , , , |