1. Introduction
Ports are critical nodes connecting land and water transportation. With the annual growth of port cargo throughput, the total emissions of greenhouse gases and atmospheric pollutants from ships and port operating equipment have increased rapidly [
1]. Although various emission reduction measures, including shore power, sea-rail intermodal transportation, and conversion of shore cranes to electricity, have been implemented, these measures fundamentally rely on fossil energy as the ultimate source of energy, leading to carbon emissions [
2]. Clean energy sources such as wind and solar power, which do not rely on fossil energy, can eliminate port carbon emissions fundamentally [
3], making them an effective approach for ports to achieve carbon peak and carbon neutrality goals. Among them, wind power generation in ports has seasonal and periodic patterns [
4] and ports have abundant wind energy resources. Therefore, port wind energy has gained increasing attention. For example, Gutierrez-Romero proposed the use of onshore and offshore wind turbines as well as solar energy to provide shore power for ships at Cartagena Port, emphasizing that wind resources deserve special attention despite the significant role of solar energy [
5].
However, port wind energy exhibits strong randomness and intermittency [
6]. Furthermore, port operations themselves are highly stochastic, making the application of wind energy in ports more challenging [
7]. On the one hand, the intermittency of wind power generation can affect the safe and stable operation of the power system. On the other hand, the randomness of wind energy may result in underutilization of wind power, reducing its practical efficiency. Therefore, accurate wind speed prediction can improve the safety and economic efficiency of port power grids, as well as reduce port carbon emissions more effectively. De Paula et al. used a combination of artificial neural networks and statistical methods to predict wind speeds at Porto do Açu, with an average MAE of 1.834 for a time resolution of 30 days [
8]. Tascikaraoglu et al. used the WT–CST-WSF combination model to predict wind speeds at meteorological stations and airports in four states in the United States, with MAE and RMSE of 1.3186 and 1.7674, respectively, for a time resolution of 6 h [
9]. Zhen et al. used a wind speed forecasting model based on time-scale recognition and dynamic adaptive modeling to predict wind speeds in the Mojave Desert Rocks of Nevada, achieving RMSE and MAE of 0.8195 and 0.6340, respectively, for a time resolution of 15 min [
10]. Port operations are highly stochastic, and berth and operation plans are usually determined one day in advance. Therefore, predicting wind energy in port operating environments can provide more accurate and timely wind energy forecasts to support port scheduling decisions.
Wind speed prediction methods generally use machine learning or statistical approaches [
11], without the need to establish physical models related to the actual environment, such as terrain, surface roughness, and meteorological conditions [
12]. Statistical methods typically establish mapping relationships between data by learning the patterns of historical wind speed data, including Kalman filtering [
13,
14], exponential smoothing [
15], and AutoRegressive Integrated Moving Average (ARIMA) models [
16,
17]. However, for data with large fluctuations and strong nonlinearity, especially port wind speed data, traditional statistical methods are greatly affected by external environmental factors, resulting in low prediction accuracy and limited predictive capability. Machine learning methods can continuously identify the features and patterns of data through learning wind speed data, thus enabling wind speed prediction. Deep learning has evolved from basic neural networks to intelligent algorithms, continuously improving prediction accuracy. Early wind speed prediction methods commonly used Support Vector Regression (SVR) [
18], Random Forests [
19], Long Short-Term Memory (LSTM) [
20,
21], and Backpropagation (BP) neural networks [
22,
23]. However, these methods have limited prediction accuracy and are suitable for smaller datasets. Therefore, some improvements have been made based on neural networks, such as Aly’s use of the Wavelet Neural Network (WNN) combination model to predict wind speeds in Halifax/Nova Scotia [
24]. These neural network models can better adapt to nonlinear systems.
However, in practical applications, the prediction results of neural networks generally depend on the weights, thresholds, and other parameters between the layers of the network model. The traditional method of parameter selection through trial and error is often inefficient and it is difficult to find the optimal parameters. Therefore, it is crucial to quickly obtain the optimal parameters of the network for accurate and rapid wind energy prediction.
Common parameter optimization methods during the prediction process include Dragonfly Algorithm (DA) [
25], Whale Optimization Algorithm (WOA) [
26], Particle Swarm Optimization (PSO) [
27], and Sparrow Search Algorithm (SSA) [
28]. Swarm intelligence optimization algorithms have the advantage of avoiding getting trapped in local optima and achieving global optimization. However, parameter selection still relies heavily on experience. Among them, SSA has the ability to global search and enriches the population diversity to a greater extent, reducing the likelihood of the algorithm getting trapped in local optima. Therefore, this paper adopts SSA to optimize WNN and focuses on predicting wind energy in the Chuanshan Port Area of Ningbo–Zhoushan Port.
The innovations and contributions of this study are, firstly, the combination of SSA optimization algorithm and WNN neural network for wind speed prediction; secondly, we apply the methods to predicting wind speed in a port, taking Ningbo Zhoushan Port as a case study, which has not been considered by precious works. The model is also trained and tested by a real dataset with high authenticity and reliability, measured by actual LiDAR in the port area.
The structure of this paper is as follows:
Section 2 introduces the algorithm principles of wind speed prediction methods, the steps of the optimization algorithm, and the calculation process of SSA–WNN.
Section 3 presents the research object, the Chuanshan Port Area, and analyzes the measured wind speed data throughout 2022.
Section 4 analyzes the prediction results and compares the recommended method with three other methods to validate its effectiveness and superiority. Finally,
Section 5 concludes the paper.
2. Methodology
2.1. Wavelet Neural Network
The Wavelet Neural Network (WNN) is a network that has evolved from the error back-propagation neural network topology. It exhibits similarities to traditional neural network structures but possesses faster convergence speed, avoids local optima, and provides time-frequency local analysis characteristics [
29]. WNN can be implemented in two ways. The first approach involves performing wavelet analysis on the signal to obtain high-frequency and low-frequency signals at each layer, which are then loosely coupled with the neural network. The second approach replaces the traditional neural network activation function with a wavelet function, establishing a compact coupling between wavelet transformation and network coefficients. Due to its time–frequency analysis and self-learning properties, this study employs the compact coupling WNN for research purposes.
In WNN, during the forward propagation of the entire signal, the error is propagated in the opposite direction. The transfer function of the hidden layer nodes is represented by wavelet basis functions, and the weights and thresholds between the input layer and the hidden layer are replaced by the scale expansion factor and time shift factor of the wavelet basis functions, respectively. The topology structure of WNN is illustrated in
Figure 1.
The network consists of an input layer, a hidden layer, and an output layer. The input to the neural network is denoted as sequence X = (x1, x2, …, xm), and the output is denoted as Y = (y1, y2, …, yn), where m and n represent the number of input and output parameters, respectively. ωij and ωjk denote the connection weights between the layers of the neural network. h(x) represents the wavelet basis function, and in this study the Morlet wavelet function is used, which is expressed as:
After the input vector X is processed according to Equation (1), the output values at the hidden layer are obtained as follows:
where
represents the output values of the hidden layer nodes,
and
are the scale expansion factor and time shift factor of the wavelet basis function, respectively, m is the number of input layer nodes, and
is the number of hidden layer nodes.
The output values from the hidden layer continue to propagate forward through the WNN output layer, resulting in the following output:
where
represents the actual output values of the WNN, and
is the number of nodes in the output layer.
The Mean Squared Error (MSE) is used as the loss function for WNN, which is calculated as:
where MSE represents the loss function, and
represents the true values.
2.2. Sparrow Search Algorithm
The Sparrow Search Algorithm (SSA) is a swarm intelligence optimization algorithm inspired by the foraging behavior and regurgitation feeding behavior of sparrows. It exhibits strong global optimization capabilities, as well as good parallelism and fast convergence speed.
To obtain food, a population of sparrows is divided into explorers and followers. When there is no external interference, individual sparrows monitor each other, and explorers expand their foraging range to obtain food, while followers compete for food resources from companions with larger food resources to increase their predation rate. Explorers have higher energy reserves compared to followers, and the roles of individuals can be switched to maintain the proportion within the population. In the event of an attack by a predator that threatens the safety of the group, explorers guide followers to safe areas for foraging. Sparrows located at the edges of the population quickly move towards safer areas to obtain better positions, while sparrows in the middle of the population move randomly. Throughout the foraging process, individuals with higher energy reserves are given priority in acquiring food resources.
(1) During each iteration process, the position update for explorers is as follows:
where
represents the position of the
th sparrow in the
th dimension,
represents the iteration count,
is the maximum number of iterations,
and
are random numbers,
is set to 0.8, where
represents a warning signal,
represents a safety value,
is a random number following a normal distribution, and
is a
-dimensional row vector of ones.
(2) During each iteration process, the position update for followers is as follows:
In Equation (6),
represents the position of the best explorer,
represents the position of the worst individual in the current population,
represents the population size of the sparrows,
represents a
-dimensional row vector with elements randomly set to −1 or 1, and
. Additionally,
represents the energy reserve of the
th follower with a relatively low fitness value, indicating the need to search for food in other safe areas.
(3) Assuming that 20% of the sparrow population is aware of predator attacks, the initial positions of these individuals are randomly generated within the population according to the following equation:
where
represents the current best position in the population,
is a step size control parameter with a mean of 0 and a variance of 1, representing a d-dimensional random row vector following a normal distribution.
is a random number, and
is a constant with a value of
.
represents the fitness value of the current individual, and
and
represent the current best and worst fitness values in the population.
2.3. SSA–WNN Neural Network
Based on the characteristics of WNN error backpropagation, continuously adjusting the weights and thresholds in the neural network can improve the accuracy of the WNN model. Therefore, this study adopts SSA to optimize the parameters of WNN and address the issues of slow convergence speed and susceptibility to local optima. The specific steps of the SSA–WNN neural network computation process are as follows:
(1) Data preprocessing: Normalize the original wind speed data to the range
. This normalization confines the preprocessed data within a certain range, avoiding convergence issues caused by outlier data. The normalization is performed using the following equation:
where
represents the normalized sample value,
represents the sample value before normalization,
represents the maximum value in the sample data, and
represents the minimum value in the sample data.
(2) Initialize WNN by determining the number of nodes in the input layer, hidden layer, and output layer.
(3) Initialize SSA parameters: Determine the dimension of SSA, maximum iteration count (), population size (), the proportion of explorers within the population (20%), and the safety value (0.8).
(4) Define the fitness function and calculate the fitness values of individuals. In this case, the Mean Squared Error () is defined as the fitness function, where smaller values indicate lower errors. The function’s minimum point corresponds to the point of minimum error, which determines the position of the current global optimal solution.
(5) SSA Iterative Update. The individuals in good fitness positions are considered explorers, allowing them to have priority access to food and provide foraging directions for followers. The position of explorers is updated using Equation (5), while the positions of followers are updated after foraging using Equation (6). Additionally, the last 20% of the population consists of sparrows that are aware of predator attacks. Their positions are randomly generated, and their updates depend on Equation (7), which considers the current individual’s fitness value and the global best fitness value.
(6) After updating the positions, the fitness values of the individuals are compared with the current best fitness value. If the maximum iteration limit is reached, the algorithm selects the optimal solution; otherwise, the iteration process continues.
(7) The optimal solution obtained through SSA optimization represents the weights, biases, and thresholds of the WNN. The neural network is trained using these values, and the analysis continues until the desired accuracy is achieved. The predicted values are then outputted.
The flowchart of the SSA–WNN algorithm is shown in
Figure 2.
3. Study Area and Wind Speed Data
In this study, the Ningbo Zhoushan Port Chuan Shan Port Area is chosen as the research area. This port area is the second-largest single-container port in the world. Since 2017, it has handled over 10 million TEUs (20-feet equivalent units) of containers annually, resulting in approximately 1.2 million tons of CO
2 emissions from container handling equipment [
30]. The port area plans to install two 6.25 MW wind turbines to provide electricity for the container handling equipment [
31].
A laser radar station was established in the field in 2021, with coordinates at 29°53′9.69″ N, 122°1′41.48″ E. The geographical locations of the port area and the wind farm laser radar are shown in
Figure 3.
The laser radar measures wind speeds at heights ranging from 30 m to 140 m with a sampling period of 10 min. The hub height of the planned wind turbines in the port area is 125 m. Therefore, this study focuses on analyzing wind speeds at 125 m. The wind speed data for the entire year of 2022 is shown in the following figures.
In
Figure 4a, the plot shows the daily wind speed data at a 10-min interval for the entire year of 2022, with a total of 52,560 data points.
Figure 4b illustrates the distribution of wind speeds throughout the year. It can be observed that the wind speeds in the Chuan Shan Port Area exhibit strong nonlinearity and fluctuation. The wind speeds are concentrated between 3 m/s and 6 m/s, with an average wind speed of 5.1 m/s. The maximum recorded wind speed is 31.6 m/s, and there are a few outliers with wind speeds exceeding 20 m/s. These outlier data points pose a challenge for direct prediction using the original dataset, as they can significantly affect the accuracy of the predictions. To address this issue, 720 data points from 5 days with unusually high wind speeds caused by factors such as typhoons are excluded to ensure that the dataset maintains consistent importance and distribution.
where
is the sample mean and n is the number of samples.
where
is the sample standard deviation and
is some sample.
The results are presented in
Table 1.
Based on the daily wind speed data from January to December 2022, the monthly wind speed distribution at the height of 125 m is shown in the rose diagram in
Figure 5.
From the diagram, it can be observed that the wind speeds for most months are mainly distributed between 0 m/s and 10 m/s. Months such as February, March, April, June, September, November, and December exhibit more diverse colors, indicating greater variability in wind speed. On the other hand, months such as January, May, July, August, and October show more concentrated colors, indicating relatively stable wind speeds. Regarding wind direction, March, April, June, July, August, October, and December show more consistent wind directions. Specifically, March, April, June, July, and August exhibit SSE (south-southeast) wind directions, October exhibits N (north), and December exhibits NNW (north-northwest). The rose diagram clearly illustrates the wind speed distribution characteristics for each month, reflecting the seasonal variations in wind speed.
The processed dataset, consisting of 51,840 data points, is divided into a 4320 × 12 matrix as the dataset. The dataset is split into a training set (80%) and a testing set (20%) using an 8:2 ratio. To prevent overfitting during training, a 6-fold cross-validation is performed to determine the network model structure and hyperparameters. The SSA–WNN model has 10 input nodes, eight hidden nodes, and two output nodes. The first 10 columns (January to October) are used as the training set, while the last two columns (November and December) are used as the testing set.
4. Result Analysis
4.1. Prediction Results
The SSA–WNN algorithm is used to predict wind energy in the Chuan Shan Port Area. The results obtained are shown in
Figure 6. The plot uses the wind speeds on 1 November and 1 December as coordinates. The red circles represent the actual wind speed values, while the blue circles represent the predicted values. The lines connecting the actual and predicted values represent the errors, with longer lines indicating larger errors. From the figure, it can be seen that the wind speeds on 1 November are concentrated between 7 m/s and 9 m/s, while the wind speeds on 1 December are concentrated between 9 m/s and 10.5 m/s. The prediction errors are generally below 0.5 m/s. Taking the leftmost group of data points in the scatter plot as an example, the red circle and blue circle representing the actual and predicted wind speeds are very close, and the line connecting them is short. The coordinates for the red circle are (2.609, 9.202), and for the blue circle are (2.433, 9.213), indicating that the predicted wind speed values for this group of data points on 1 November and 1 December are 2.433 m/s and 2.609 m/s, respectively. The results show a good agreement between the predicted values and the actual values for this group of data points.
To further analyze the prediction results, three evaluation metrics are used: Root Mean Square Error (RMSE), Mean Absolute Error (MAE), and Mean Absolute Percentage Error (MAPE). The formulas for calculating these metrics are provided in Equations (11)–(13), respectively:
where
is the number of samples,
is the current sample’s predicted value, and
is the current sample’s actual value. The evaluation metrics are analyzed for the entire testing dataset, with RMSE, MAE, and MAPE values of 0.5236 m/s, 0.2486 m/s, and 3.229%, respectively.
4.2. Comparative Analysis
To validate the superiority of the proposed algorithm, a comparison is made with three other neural network models: SSA–LSTM, SSA–BP, and WNN. For the SSA–LSTM algorithm, the first 41,472 data points are used as the training set, and the remaining 10,368 data points are used as the testing set. The training data sequence length is set to 10, and a one-step ahead prediction is performed. The optimization algorithm used is Adam, and the optimized parameters are the number of LSTM hidden nodes, the number of training iterations, and the learning rate. For the SSA–BP and WNN algorithms, the number of input nodes, hidden nodes, and output nodes is set to 10, 8, and 2, respectively. The first 10 columns (January to October) are used as the training set, while the last two columns (November and December) are used as the testing set. The learning rate and convergence error for SSA–BP are set to 0.05 and 0.1, respectively. The convergence curves for the four models, depicting the root mean square error (RMSE) as a function of the number of iterations, are shown in
Figure 7.
From the figure, it can be observed that the SSA–WNN, SSA–LSTM, and SSA–BP algorithms converge quickly, with convergence iterations of 15, 18, and 37, respectively. The WNN model without optimization has the slowest convergence, requiring 62 iterations. Furthermore, at the point of convergence for each algorithm, the RMSE values are in the order of SSA–WNN < SSA–LSTM < SSA–BP < WNN. This indicates that the SSA–WNN algorithm achieves the fastest convergence and the highest prediction accuracy among the four algorithms.
Due to the large number of data points and their concentration in the testing set, it is difficult to observe them clearly. Therefore, in the figure, the wind speeds on 1 November and 1 December from the testing set were selected for comparison. The wind speed predictions obtained using SSA–WNN, SSA–LSTM, SSA–BP, and WNN models were compared with the actual wind speed values, as shown in
Figure 8.
The x-axis in the above figures represents time, ranging from 00:00:00 to 23:50:00 with 10-min intervals, while the y-axis represents wind speed values. It can be observed that, for the wind speeds on 1 November and 1 December in the testing set, the model trained using the SSA–WNN algorithm shows closer agreement between the predicted and actual values compared to the models using SSA–LSTM, SSA–BP, and WNN algorithms. This indicates a better prediction performance of the SSA–WNN model, effectively capturing the future variations and accurately understanding the changing patterns of wind speeds in the port area. In
Figure 8b it is more evident that the unoptimized WNN model exhibits larger errors between the predicted and actual values, highlighting the significant improvement in prediction accuracy achieved by the SSA optimization algorithm for neural networks.
Statistical information for the November and December data is provided in
Table 2 and
Table 3 below.
Table 4 provides a comparison of evaluation metrics for the four models using the testing set (November and December wind speeds). The SSA–WNN model achieves the lowest RMSE, MAE, and MAPE values compared to the other models. Particularly, compared to the unoptimized WNN model, the SSA–WNN model shows an improvement of 1.0993 m/s, 0.3962 m/s, and 5.329% in terms of RMSE, MAE, and MAPE respectively. This highlights the significance of SSA optimization for enhancing the performance of the WNN model. In the comparative analysis, the SSA–WNN algorithm outperforms the other algorithms in terms of prediction accuracy and convergence speed, demonstrating its superiority for wind speed prediction in the port area.
4.3. Discussion
Errors have a significant influence on the predicted wind output, which is of great importance to the energy usage schedule in port operation. To figure out the influence of different errors, wind power generation errors resulting from wind speed errors of 0.5 m/s, 1 m/s and 1.5 m/s are calculated respectively, according to the following equations:
where
denotes power in W,
is the swept area, i.e.,
= ½π∗R² (π = 3.14159, R is the radius of the wind blade and is taken as 95 m), V is the wind speed, Cp is a kind of wind energy conversion rate value which is 30% here, D is the density of the air (with the increase in elevation and the decrease, the value of D is 1.21 Kg/m³ in the present study),
is the coefficient, and
value is taken as 1.
denotes power generation in W·s, and t denotes time in s.
From Equations (14) and (15), when the wind speed error is 0.5 m/s, 1 m/s, 1.5 m/s, with single wind turbine running for 10 min, the theoretical values of power generation error are 192,977 W·s, 1,543,814 W·s, 5,210,372 W·s, respectively. It can be seen that the difference between the results are significant, due to the cubic relationship between wind speed and wind power. A large error in wind generation prediction can lead to dispatch between wind generation and usage, resulting economic loss.
Besides, the grid connected wind power generation system is applied in the ports with different cargo handling equipment. With different equipment, transient disturbances, harmonic distortion and other problems will occur, thus, accurate prediction of the wind speed can be better combined with the control strategy of the system to reduce the problems that may occur in the system, so as to improve its power quality.
In the present study, to improve the accuracy of wind speed prediction, the SSA–WNN model was employed for port wind forecasting, and RMSE, MAE, and MAPE were adopted as evaluation metrics. In the previous research works of Pan et al., 2022, a prediction model based on spatio–temporal graph transformer network (STGTN) was proposed for short-term wind speed prediction of Danish offshore wind farms [
32].The wind speed data contains 14,400 data points from 111 wind turbine nodes. The prediction results of the STGTN model on May 20 have MAE, RMSE, and MAPE of 0.3508 m/s, 0.4486 m/s, and 7.9280%, respectively, which is comparable to the prediction result of the STGTN model in the present study. Comparing with SSA–WNN, RMSE is closer, but the values of MAE and MAPE are larger than SSA–WNN, so the SSA–WNN algorithm performs better. Zhen et al. introduced an ultra-short-term wind speed prediction model based on time scale identification and dynamic adaptive modeling [
10]. The RMSE, MAE, and MAPE are 0.8195 m/s, 0.6340 m/s, and 6.32%, respectively, for predicting 15-min wind speeds, which is worse than the SSA–WNN model in the present study. An RWT-ARIMA model was proposed to predict wind speed using data measured at the meteorological station in Malin Head, County Donegal, Republic of Ireland, on a 10-min time scale [
17]. The evaluation metrics of MAE, RMSE, and MAPE are 0.2268 m/s, 0.3204 m/s, and 2.94%, respectively, which are smaller than those of the SSA–WNN model. However, the model was applied to a small scale dataset and is hard to be applied in real cases, such as in ports. The proposed method in the present study are suitable for the application in real cases and have a better performance compared with other research studies.