2.2. KOA Optimization Algorithm
The Kepler optimization algorithm is a heuristic optimization algorithm proposed by Abdel-Basset et al. [
40]. In the KOA, the sun and the planets rotating around the sun in elliptical orbits can be used to represent the search space. Since the positions of the planets (the candidate solutions) relative to the sun (optimal solution) change over time, the search space can be explored and utilized more efficiently. During the optimization process, the KOA will apply the following rules:
- (1)
The orbital periods of planets (the candidate solutions) are randomly selected from a normal distribution.
- (2)
The eccentricity of planets (the candidate solutions) is generated randomly within the range of [0,1].
- (3)
The fitness of each solution is calculated based on the objective function.
- (4)
In the iterative process, the best solution serves as the central star (sun).
- (5)
Planets move around the sun in elliptical orbits, resulting in changes in their distance over time.
Based on the above rules, after evaluating the fitness of the initial set, the KOA runs iteratively until a termination criterion is met. Theoretically, the KOA can be regarded as a global optimization algorithm due to its exploration and exploitation phases. The following is a detailed description of the KOA’s iterative process from a mathematical point of view.
Step 1. Initial process:
The population size, denoted as
N in this process, will be randomly distributed in
d dimensions according to Formula (1), representing the decision variables of an optimization problem.
where
denotes the
g-th planet (candidate solution) in the search space, it represents the number of candidate solutions in the search space;
represents the dimension of the problem to be optimized;
represents the dimension of the problem to be optimized;
and
denote the upper and lower bounds of the
g-th decision variable, respectively; and
denotes a randomly generated number at [0,1].
The g-th planet (candidate solution) in the search space is denoted by , where represents the total number of candidate solutions in the search space. The dimension of the problem to be optimized is represented by . and denote the upper and lower bounds of the g-th decision variable, respectively. Additionally, represents a randomly generated number within the range [0,1].
For each object’s orbital eccentricity (
e), it is initialized as in Formula (2):
where
is a randomly generated number whose value ranges from [0,1].
Finally, for the orbital period of each planet (candidate solution), it is initialized as Formula (3):
where
is a randomly generated number according to a normal distribution.
Step 2. Define the force of gravity (F):
The law of universal gravitation gives the gravitational pull of the sun
and any planet
. Gravity is defined as Formula (4):
In the formula for gravitation,
is a small number;
is the cosmological gravitational constant;
e is the eccentricity of planetary orbits, whose value ranges from [0,1], which can give the KOA model more random features;
is a randomly generated value between [0,1], which can provide more variation in the optimization process;
are the normalized value of
, which offers the Euclidean distance between the sun
and the planets
, which is defined as Formula (5):
where
offers the Euclidean distance between the sun’s dimensions and the planets’ dimensions
. The masses of the sun
and the planets
at time
can be calculated using the following Formulas (6) and (7):
where the functions
and
are defined as Formulas (8) and (9):
In the definition of solar mass
, a random constant
from 0 to 1 is generated to represent the planet’s mass value within the scatter search space. The function
, which decreases exponentially with time to control the search accuracy, is defined as Formula (10):
where
is a constant;
is an initial value, while
and
are the current iteration number and the maximum iteration number, respectively.
The specific motion is shown in
Figure 1.
Step 3. Calculate the planet’s velocity:
The planetary velocity depends on its setting relative to the sun
, and the closer you are to the sun
, the greater the velocity; the further away from the sun
, the slower it will be. This is understood to mean that as the gravity of the sun
tries to capture the planet
, the planet
increases its speed to avoid being pulled closer and slows down as it escapes. Mathematically, it is understood as the process of the KOA escaping from a local optimum solution, which can be described by the following Formulas (11)–(20):
where the velocity of the planet
at a given time is represented by
, while
represents the planet
.
and
are randomly generated numbers within the range [0,1], while
and
are random vectors contained in [0,1].
and
represent a randomly selected solution from the population.
and
denote the masses of the sun
and planets, respectively;
refers to the universal gravitational constant, while
is a small value used to prevent division errors caused by zero frequency.
denotes the distance between the optimal solution
and the object
at a specific time.
represents the semimajor axis of the planet
’s elliptical orbit at that time, which is defined by Kepler’s third law as shown in the following Formula (21):
where
denotes the orbital period of the planet
. In our proposed algorithm, it is assumed that the semimajor axis of the elliptical orbit of the planet
gradually decreases with time. That is, its solution moves toward the region where the global optimal solution is expected to be found.
denotes the Euclidean distance between the normalized
and
, which is defined as Formula (22):
The purpose of is to calculate the percentage of time steps each object will change. If , the object is close to the sun and will increase its speed to prevent drifting toward the sun due to its huge gravitational pull. Otherwise, the planet will slow down.
Step 4. Escape the local optimum solution:
In the solar system, most objects rotate on their own axis while rotating counterclockwise around the sun ; however, some objects do the opposite, rotating clockwise around the sun. The KOA mimics this mechanism by using this behavior to escape the local algorithm optimal region, which is mainly embodied by a sign F that changes the search direction, thus giving the agent a good chance to scan the search space accurately.
Step 5. Update the object position:
Based on the previous section, the planet will rotate in an elliptical orbit around the sun. During this process, the object will move closer to the sun for some time and away from it. The KOA simulates this behavior mainly using two phases: exploration and exploitation. The KOA will explore objects far from the sun to find new solutions and, more accurately, find the optimal solution. In this way, the exploration and exploitation area around the sun is expanded. In the exploration phase, the target is far away from the sun (the optimal solution) and the whole search area can be explored more effectively. The target distance from the sun is the global optimal solution.
The position update formula is as Formula (23):
where
is the new position of the object
in time
,
is the speed needed for the planet
to reach the new position,
is the best position of the sun found so far, and
is used as a sign to change the direction of the search. The position update formula simulates the gravitational force exerted by the sun on the planets. In this formula, a time step is introduced based on the calculation of the distance between the current planet and the sun, multiplied by the gravity of the sun. This modification aids the KOA in exploring its surrounding area after initialization, facilitating more efficient searches for optimal solutions with fewer function evaluations. In general, when the planet is moving away from the sun, the velocity of the planet will represent the KOA’s exploration operator. However, this speed is affected by the sun’s gravitational pull, which contributes to the region around the current better optimal solution for the planet. At the same time, as a planet approaches the sun, its speed will increase dramatically, allowing it to escape the sun’s gravitational pull. In this case, if the sun (the optimal solution) is the local minimum, the velocity represents the local optimal avoidance while the sun’s gravitational representation helps the KOA attack the best solution so far to find a better solution.
Step 6. Update the position with the sun:
If the distance between the sun and the planet is infinitesimally small, then either the planet or the sun emerges as the optimal solution during iterative processes.
This principle is randomly swapped with the formula. The position update formula further improves the KOA’s exploration operator, as shown in Step 5. The mathematical model of the principle is described as Formula (24):
where
is an adaptive factor that controls the distance between the sun and the current planet at the time
, which is defined as Formula (25):
where
is a randomly generated number according to a normal distribution and
is a [−2, 1] linear decreasing factor, defined as Formula (26):
where
is a cyclic control parameter and gradually reduced from −2 to −1 throughout the optimization process with period
as Formula (27):
Step 7. Adjust the parameters:
This step implements an elite strategy to ensure the best placement of the planets and sun. Formula (28) summarizes the process:
Thus, the specific flow chart of this method is as in
Figure 2:
Summary of KOA
The Kepler Optimization Algorithm (KOA) is a heuristic optimization method inspired by the motion of planets around the sun, as proposed by Abdel-Basset et al. In the KOA, candidate solutions, represented as planets, orbit an optimal solution, the sun, in elliptical paths, allowing efficient exploration and exploitation of the search space. The process begins with the random distribution of candidate solutions, followed by the selection of orbital periods and eccentricities from normal and uniform distributions. The fitness of each solution is then calculated to evaluate its quality. During iterative optimization, the best solution serves as the sun, guiding the movement of planets. The velocity of each planet changes based on its distance from the sun, simulating gravitational effects to balance exploration and exploitation. The KOA employs mechanisms to escape local optima by randomly adjusting the search direction. An elite strategy ensures the best solutions are retained and refined, making the KOA a robust global optimization algorithm well suited for complex optimization problems and enhancing prediction accuracy in load forecasting models.
2.3. The BiGRU Model
LSTM is developed from RNN, which changes the neurons in the hidden layer of RNN through the gate mechanism and introduces a self-loop mechanism on the basis of it to improve the shortcomings of gradient disappearance. As a variant of LSTM, the GRU neural network has been optimized in structure, reducing the training time while ensuring high-accuracy prediction. Compared to LSTM, GRU is more concise in design and its structure contains only two gates: the reset gate (
) and update gate (
). The former mainly controls data (or variables?), the input of data, and the composition of previous memory and the latter controls the preservation of the previous memory. The simplified structure of GRU enables it to model sequences for the temporal characteristics of data effectively while maintaining high computational efficiency. The following Formulas (29) and (30) show the governing formulas for GRU units:
where, in Equations (8) and (9),
,
,
,
, and the corresponding activation functions
as well as the bias
,
, update
, and reset
gate are calculated based on the assigned weights. In addition,
is the input to the neuron at the time step,
and
is the cell state vector at the time step
. After this, the reset gate
is used to start new memory contents. The Hadamard (element product) is calculated using the formula
. The reset gate
is used to determine what information to eliminate from the previous step. After that, the activity function is applied to produce a new cell state vector
.
Finally, the current cell state vector
is obtained by passing the reservation information to the next cell. To this end, updating the gate
involves the Formulas (31) and (32):
For information retrieval and storage, the GRU neural network adopts a recurrent structure. Still, this structure only considers the previous state of the prediction point, ignoring the future state of the prediction point. However, in actual forecasting, the load information at the previous time is always highly related to the load information at the next time. Therefore, the prediction accuracy cannot be further improved. For deeper time series feature extraction, the BiGRU is introduced here.
The BiGRU (bidirectional recurrent neural network) consists of a forward GRU layer and an inverse GRU layer, which allows for predicting time series in the opposite direction. In the end, the output will be determined by the state of the forward and inverse layers. Due to the absence of a connection between the forward and inverse layers, BiGRU enables simultaneous consideration of data change patterns compared to one-way GRU, thereby enhancing flexibility, comprehensiveness, and relevance in analysis. This promotes a stronger integration between the model and its processing information while significantly improving prediction accuracy compared to GRU. The structure of BiGRU is shown in
Figure 3 and the expression of the network structure is as in Formulas (33)–(35).
where GRU is the traditional GRU network operation process,
and
are the state and weight of the forward hidden layer at time
,
and
are the state and weight of the backward hidden layer at time
and
is the bias of the hidden layer at time
.
The specific structure of the BiGRU is shown in
Figure 3.
2.4. BiTCN Model
Time convolutional network (TCN) models have gained significant attention and application in the field due to their ability to process time series data in parallel efficiently. Similarly, the study and application of BiLSTM networks have been validated to capture important fluctuation characteristics associated with future time parameters. However, it should be noted that in predicting the current power load, TCN is limited to capturing past parameter fluctuations such as wind speed, temperature, and rate of change. In summary, this paper proposes to optimize the power load forecasting model using the BiTCN algorithm.
The BiTCN model facilitates bidirectional information integration by simultaneously capturing the fluctuation characteristics of parameter changes in both past and future time dimensions. It achieves this by connecting forward TCN modules, backward TCN modules, and a temporal attention module within each BiTCN module. Multiple BiTCN modules are sequentially connected to construct the overall BiTCN model.
The forward TCN model receives past time parameters as inputs from the module, while the backward TCN model takes future time parameters as inputs. Both models share consistent input parameters and employ temporal attention to merge and process the outputs from both modules, resulting in a novel set of output features. Element-wise input fusion significantly enhances the performance of the model.
We are assuming that the input to the module
in the BiTCN model is
, where
. Firstly,
is fed into the forward TCN module to extract historical temporal information from the vibration data and obtain bold time features
. Simultaneously, by applying reverse processing on
, we accept backward time data
, where
. Then, it serves as input for the back TCN module to extract future temporal information from the vibration data and acquire backward time features
. The formulas for calculating these two types of features are Formulas (36) and (37):
The dimensions of the temporal convolutional kernel for capturing time gaps, the parameter for the leaky ReLU activation function, the dilation rate for atrous convolution, and the parameter for dropout regularization are represented by
,
,
, and
, respectively.
denotes feature extraction in the forward TCN module while describing feature extraction in the backward TCN module. The structure of BiTCN is shown in
Figure 4.