4.2.1. Crested Porcupine Optimizer Algorithm
The CPO algorithm is a novel metaheuristic optimization technique that mimics four defense behaviors of the crested porcupine (visual, auditory, olfactory, and physical attacks) to solve optimization problems. It possesses strong global search capabilities and features rapid convergence.
The CPO algorithm, like other metaheuristic swarm algorithms, initiates the search process from an initial set of individuals. For each individual
i, a random position
is generated within the search space, expressed mathematically as follows:
where
N is the population size;
r is a uniformly distributed random number between 0 and 1; and
L and
U are the lower and upper bounds of the search range, respectively.
To enhance the algorithm’s convergence speed while maintaining population diversity, the Cycle Population Reduction (CPR) technique periodically increases or decreases the population size according to a predefined pattern. The mathematical expression is
where
N(
t) is the population size at the current iteration t;
Nmin is the minimum population size;
is the initial population size;
Tmax is the maximum number of iterations for the algorithm;
t is the current iteration number; % denotes the modulo operation used to apply adjustments periodically.
The purpose of the visual strategy is to simulate the behavior of a crested porcupine when it detects a predator. In the algorithm, this corresponds to the behavior of individuals moving towards the global best solution. The mathematical expression is
where
represents the position of the
ith individual in the next-generation iteration;
represents the position of the current global best solution, i.e., the position of the best individual found at the current iteration
t;
is a random number based on a normal distribution, used to simulate randomness and enhance the algorithm’s exploration capability;
is a random number in the interval [0, 1] used to adjust the intensity of exploration;
represents the difference between the current global optimal solution and the position of the current individual
i;
represents the midpoint position between individual
i and a random individual at iteration
t, used to simulate the position of the predator.
The purpose of the sound strategy is to simulate the behavior of crested porcupines emitting sounds when a predator approaches. In the algorithm, this represents the update of the individual’s position. The mathematical expression is
where
represents the position of the
ith individual in the next iteration;
represents the position of the
ith individual at the current iteration
t;
is a random vector with elements valued at 0 or 1, used to simulate whether the crested porcupine emits a threatening sound to the predator and the intensity of the sound;
y represents the position of the predator, usually calculated from the positions of two random individuals in the current population;
is a random value in the interval [0, 1] used to control the step size of the predator’s movement;
and
represent the positions of two different randomly selected individuals from the population at the current iteration t.
The scent strategy simulates the behavior of crested porcupines releasing a scent to repel predators. In the algorithm, this is represented by the movement and update of individuals in the search space to explore new solutions and avoid local optima. In this way, the algorithm can gradually approach the global optimum while maintaining population diversity. The mathematical expression is
where
represents the position of the
ith individual at the next iteration
t + 1;
represents the position of the
ith individual at the current iteration
t;
is a random vector with elements valued at 0 or 1, used to simulate whether the crested porcupine releases a scent. When the value is 1, the individual participates in the scent strategy update; when the value is 0, it does not participate in the scent strategy update;
represents the position of a randomly selected individual used to calculate the new position;
is the scent diffusion factor used to control the intensity of the position update in the scent strategy;
and
represent the positions of two other randomly selected individuals in the search space, used along with
to calculate the direction and intensity of the scent diffusion;
is a random value in the interval [0, 1] used to control the influence of randomness in the scent strategy;
represents a parameter that controls the search direction, used to adjust the movement direction of the individual in the search space;
is the defense factor, a time-varying function used to simulate defensive behaviors at different points in time. The mathematical expression is as follows:
where
is the maximum number of iterations.
The physical attack strategy simulates the defensive behavior of crested porcupines, allowing the algorithm to conduct more focused and target-oriented searches during the search process. This strategy is particularly suitable for the later stages of the algorithm, when more refined searches are needed in identified promising areas. The mathematical expression is
where
represents the position of the
ith individual at the next iteration
t + 1;
represents the position of the global optimal solution at the current iteration
t;
is the convergence factor used to control the speed at which the algorithm converges to the optimal solution;
is a random value in the interval [0, 1] used to introduce randomness in the physical attack strategy;
represents the average force exerted by the global optimal solution
on predators at the current iteration
t. This can be computed based on the principles of elastic collision:
where
represents another random number within the interval [0, 1], used to further control the strength of the force;
is a parameter related to the importance of the
ith individual.
The flowchart of the Crested Porcupine Optimization (CPO) algorithm is shown in
Figure 3:
4.2.2. CPO-LSSVR
The CPO algorithm is used to optimize the penalty factor C and kernel parameter
of the LSSVR model to improve prediction accuracy. The process is shown in
Figure 4.
Step 1: Input process parameters into the model, use deposition layer width and height as output data inputs to the model, and divide into training and testing sets;
Step 2: Set initial parameters, including the search range for penalty factor c and kernel parameter , and randomly generate a population;
Step 3: Build the LSSVR model and train it using the training set;
Step 4: Substitute the optimization results of each individual into the LSSVR model. Calculate the mean squared error between the predicted values obtained from different LSSVR model training processes and the experimental values. Use this as the fitness function for the CPO algorithm and compute the fitness of all individuals;
Step 5: Apply cyclic population reduction techniques to periodically reduce the size of the population;
Step 6: Execute exploration and exploitation strategies, updating individual positions;
Step 7: Determine if the termination condition is met. If satisfied, output the optimal penalty factor bestC and optimal kernel parameter . If not satisfied, proceed to Step 4;
Step 8: Replace the LSSVR model’s c and with bestC and ;
Step 9: Test the CPO-LSSVR model using the test dataset.