Ship Trafﬁc Flow Prediction in Wind Farms Water Area Based on Spatiotemporal Dependence

: To analyze the changing characteristics of ship trafﬁc ﬂow in wind farms water area, and to improve the accuracy of ship trafﬁc ﬂow prediction, a Gated Recurrent Unit (GRU) of a Recurrent Neural Network (RNN) was established to analyze multiple trafﬁc ﬂow sections in complex waters based on their trafﬁc ﬂow structure. Herein, we construct a spatiotemporal dependence feature matrix to predict ship trafﬁc ﬂow instead of the traditional ship trafﬁc ﬂow time series as the input of the neural network. The model was used to predict the ship trafﬁc ﬂow in the water area of wind farms in Yancheng city, Jiangsu Province. Autoregressive Integrated Moving Average (ARIMA), Support-Vector Machine (SVM) and Long Short-Term Memory (LSTM) were chosen as the control tests. The GRU method based on the spatiotemporal dependence is more accurate than the current mainstream ship trafﬁc ﬂow prediction methods. The results verify the reliability and validity of the GRU method.


Introduction
Marine wind energy is a green renewable resource that has the advantages of cleanliness, low development cost, and abundant reserves [1,2]. The development of marine wind energy under the background of encouraging sustainable economic development is conducive to alleviating the energy crisis and preventing climate change. With the development of offshore wind power technology, offshore wind farm construction has gradually become a key development field [3]. However, the offshore wind farm needs to occupy a large area of water in the process of construction, and some ship traffic inevitably flows through the wind farm. With the increasing frequency of offshore wind power construction, the risk assessment of ship navigation in wind farms water area has also attracted the attention of scholars at home and abroad [4].
In the water area of the wind farm, ships need to be in close contact with the wind turbine, and the working frequency is very high. Compared with ships in other water areas, the collision probability of ships in the water area of a wind farm is greater [5,6]. Especially in severe weather-such as strong winds, large waves, and dense fog-the maneuverability of the ship is limited, the visibility in the water area is reduced, and the risk of collision between the ships and the wind turbines is further exacerbated [7]. With the increase in offshore wind power construction, the safety of ship navigation in the waters of offshore wind farms has gradually attracted the extensive attention of relevant scholars. At present, the research on ship navigation safety in the water area of wind farms mainly focuses on exploring the variation law of collision risk between ships and offshore wind turbines [8,9].
However, the impact of wind farm characteristics and ship traffic flow characteristics is not fully considered, and the established collision risk model often cannot reflect the actual situation of ship/wind turbine collisions. Therefore, it is necessary to analyze the ship traffic flow in the wind farms water area as the basis of ship navigation risk assessment [10,11]. By analyzing the variation in characteristics of ship traffic flow, mining the potential regularity of traffic flow data, and predicting the traffic flow state in the future, we can provide a theoretical basis for the formulation of traffic control measures in the wind farms water area.
Therefore, we propose a method to predict the traffic volume in wind farm areas based on spatiotemporal dependence. A feature matrix is constructed to represent the spatial relationship of traffic flow based on Pearson's Correlation Coefficient (PCC), and then GRU is established to predict the ship traffic flow. The construction in this paper has two folders: Firstly, the spatial effects of traffic flow on different routes are considered. Secondly, the matrix is used as the input of the neural network instead of a single value. The method proposed in this paper can support the construction of safety supervision in wind farms water area.
The remainder of this paper is organized as follows: Section 2 reviews research related to the research and safety of wind farm water and traffic flow prediction. Section 3 elaborates on the framework construction and methodological development, followed by case studies in Section 4. Finally, Section 5 discusses the major findings and potential research improvements, and conclusions are summarized in Section 5

Literature Review
Traffic flow prediction is an important topic in maritime traffic research. Recently, the study of ship traffic flow prediction can be divided into statistical methods and data-driven methods.
Several statistical models have been applied extensively in traffic flow prediction, including linear regression, ARIMA, Kalman filtering, Bayesian networks, Markov models, etc. Sun et al. (2003) introduced local linear regression into traffic flow prediction research [12]. Williams and Hoel (2003) adopted the seasonal ARIMA process to forecast vehicular traffic flow [13]. Getahun (2021) modeled a time series of road traffic accidents based on ARIMA [14]. Guo et al. (2014) developed an adaptive Kalman filter method for stochastic traffic flow rate prediction [15], while Xie et al. (2007) researched traffic flow prediction using a Kalman filter with discrete wavelet decomposition [16]. Saeedmanesh et al. (2021) developed an extended Kalman filter approach for real-time state estimation in multiregion MFD urban networks [17]. Smith et al. (1997Smith et al. ( , 2002 proposed a nonparametric method for traffic flow forecasting, and compared parametric and nonparametric models [18,19]. Zheng and Su (2014) researched traffic flow forecasting using a constrained linearly sewing principal component algorithm [20]. Wang et al. (2021) proposed a non-parametric model with an optimized training strategy for vehicle traffic flow prediction [21]. Castillo et al. (2008) introduced a Bayesian network for traffic flow prediction [22]. Wang et al. (2014) designed an architecture for traffic flow prediction using a new Bayesian combination method [23]. Afrin et al. (2021) estimated traffic congestion based on a Bayesian network [24]. Qi and Ishak (2014) developed a hidden Markov model for the prediction of traffic flow on freeways [25]. Rajawat et al. (2021) developed a comprehensive framework for the prediction of human mobility patterns based on a hidden Markov model [26].
In recent years, data-driven methods have been widely used in traffic flow prediction. The advantage of these methods is their ability to predict future traffic flow directly from the given big data without modeling the traffic flow phenomenon. Many researchers have applied SVM regression models to traffic flow prediction and achieved good results [27][28][29]. Some improved SVM methods are also widely used [30,31]. Yao et al. (2014) developed a framework in multistep-ahead prediction for rock displacement surrounding a tunnel, using an improved SVM [32]. Toan et al. (2021) applied an SVM for short-term traffic flow prediction [33].
Another widely used method is the K-nearest neighbor model, which is easy to implement because the processes of training data and estimating parameters are simple. Hong et al. (2015) developed a hybrid multimetric K-nearest neighbor regression model for traffic flow prediction [34]. Akbari et al. (2011) applied the K-nearest neighbor algorithm for daily inflow forecasting [35]. Yu et al. (2016) designed a prediction model for multiple-timestep prediction of traffic conditions [36]. Another very important method is machine learning. Many kinds of research for traffic prediction based on machine learning have been published [37][38][39][40][41][42]. Li (2016) applied dynamic fuzzy neural networks for traffic flow prediction [43]. Huang et al. (2014) proposed a Deep Belief Network (DBN) for traffic flow prediction, which is a deep architecture [44]. Yang et al. (2016) designed a type of unsupervised learning architecture of the neural network approach for traffic flow prediction using the Taguchi method [45]. Lu et al. (2021) proposed a combined method for short-term traffic flow prediction based on a recurrent neural network [46].
In summary, many researchers have made great progress in the research of traffic flow prediction, but the assumption that the model parameterization performs relatively badly in variable traffic conditions affects the majority of statistical models. On the other hand, data-driven models such as deep learning techniques are often used to make predictions. Although the accuracy of the deep learning method is higher than that of other algorithms, the training time is much longer than that of other algorithms. The GRU has fewer parameters than other models, reducing the risk of overfitting, and has a shorter training time. Additionally, the GRU can simultaneously consider the influence of features and historical time series. At present, GRU networks are mainly used in classification, regression, and time-series prediction problems. Therefore, a GRU was established to predict the ship traffic flow in this research.
Several studies have emerged over recent years covering many aspects of wind farms, such as site selection [47,48], operation and maintenance [49][50][51], and wildlife impact [52,53], among others. However, research on traffic flow prediction in the water area of wind farms is rare at present, and most such studies take a single port or channel section as their research object, not considering the spatiotemporal dependence of ship traffic flow. Therefore, taking the supervision of maritime traffic safety in complex waters as the starting point, the water area of Yancheng wind farms was selected as the research object to predict ship traffic flow in different routes in the water area of the wind farms.

Methodology
The logical framework for the prediction of ship traffic flow in wind farm waters is depicted in Figure 1; it consists of three components: data preparation, spatial relationship analysis, and time-series prediction model.  [46]. In summary, many researchers have made great progress in the research of traffic flow prediction, but the assumption that the model parameterization performs relatively badly in variable traffic conditions affects the majority of statistical models. On the other hand, data-driven models such as deep learning techniques are often used to make predictions. Although the accuracy of the deep learning method is higher than that of other algorithms, the training time is much longer than that of other algorithms. The GRU has fewer parameters than other models, reducing the risk of overfitting, and has a shorter training time. Additionally, the GRU can simultaneously consider the influence of features and historical time series. At present, GRU networks are mainly used in classification, regression, and time-series prediction problems. Therefore, a GRU was established to predict the ship traffic flow in this research.
Several studies have emerged over recent years covering many aspects of wind farms, such as site selection [47,48], operation and maintenance [49][50][51], and wildlife impact [52,53], among others. However, research on traffic flow prediction in the water area of wind farms is rare at present, and most such studies take a single port or channel section as their research object, not considering the spatiotemporal dependence of ship traffic flow. Therefore, taking the supervision of maritime traffic safety in complex waters as the starting point, the water area of Yancheng wind farms was selected as the research object to predict ship traffic flow in different routes in the water area of the wind farms.

Methodology
The logical framework for the prediction of ship traffic flow in wind farm waters is depicted in Figure 1; it consists of three components: data preparation, spatial relationship analysis, and time-series prediction model.

Data Preparation
As of December 2004, the International Maritime Organization (IMO) required all vessels over 299 GT to install an Automatic Identification System (AIS) transponder on board [54]. The increasing number of ships equipped with AISs provides a lot of basic data for traffic flow prediction research. AIS data are received as a series of messages following a nonstandard pattern of irregular time intervals. Since there is a lot of noise in the raw AIS data, it is necessary to preprocess the data. Firstly, the data of ship position abnormality, speed abnormality, and course abnormality in the experimental dataset are removed based on the algorithm proposed by [55]. Then, the linear interpolation method should be used to interpolate the ship's AIS data per 10 s.

Analysis of Spatial Dependence of Ship Traffic Flow
For complex waters, such as wind farms water areas, the ship traffic flow may be affected by the traffic conditions of adjacent routes. Therefore, considering the spatial ship traffic flow dependence, Pearson's Correlation Coefficient (PCC) method was used to calculate the correlation coefficient between the traffic flows of adjacent routes [56,57]. PCC is the covariance of the two variables divided by the product of their standard deviations.
Adding the route information with high correlation to the prediction model improves the accuracy of the marine traffic flow prediction model. If the traffic flow sequence of section x and section y is as follows: q y = q y,1 , q y,2 , · · · q y,T , then the correlation coefficient of the two sections is given by: where ρ x,y is the degree of correction between x and y, referred to as the correlation coefficient, while T represents the length of the time series. The closer ρ x,y is to 1, the greater the correlation between the target section and the adjacent section. When ρ x,y = 0, there is no correlation between the target section and adjacent sections. When 0 < ρ x,y < 0.5, this indicates that the correlation between the target section and adjacent sections is low. To ensure the prediction accuracy of the model, 0.5 ≤ ρ x,y < 1 was set as the spatial threshold range.

Time-Series Prediction Model Based on an Improved Recurrent Neural Network
A GRU can be used to mine the time characteristics of traffic flow and capture the time dependence of ship traffic flow [58][59][60]. Cho et al. introduced a GRU as a gating mechanism in recurrent neural networks [61]. The GRU's functions are similar to those of a Long Short-Term Memory (LSTM) network with a forget gate, but with fewer parameters. The GRU outperformed LSTM on certain tasks, such as polyphonic music modeling, speech signal modeling, and natural language processing. The GRU also uses only two parameters, which can help to reduce the risk of overfitting. The basic structure of the GRU is shown in Figure 2. x(t) represents the input signal vector of the current node; h(t − 1) represents the hidden state vector passed down from the previous node, h(t) is the output vector, and is the update gate vector, while σ represents the original function, and is a sigmoid function. The GRU uses x(t) and h(t − 1) to obtain two gating states; the functions of the reset gate and update gate are as follows: x (t) represents the input signal vector of the current node; h (t − 1) represents the hidden state vector passed down from the previous node, h (t) is the output vector, and h (t) is candidate activation vector; r (t) is the reset gate vector, z (t) is the update gate vector, while σ represents the original function, and is a sigmoid function. The GRU uses x (t) and h (t − 1) to obtain two gating states; the functions of the reset gate and update gate are as follows: where W r is the weight matrix of reset gate, while W z is the weight matrix of the update gate. After obtaining the gating signal, use h (t−1) = r (t) h (t−1) to reset the data, then splice h (t−1) and x (t) . The activation function tanh is used to standardize the data to obtain h (t) ; the calculation formula is as follows: where the operator denotes the Hadamard product, W h is the weight matrix of candidate activation in the GRU, and h (t) mainly contains the current input x (t) , which adds h (t) to the current hidden state and effectively remembers the current state.
In the last memory update stage, forgetting and memorizing steps are both used, as is the previously obtained update gate z; the update expression is as follows: where h (t) represents the output of the network at the moment t and z (t) ∈ (0, 1). The input of each layer of the GRU considers the output of the previous layer of the GRU, so as to capture the timing relationship of ship traffic flow. After constructing a GRU, it is used as the basic unit from sequence to sequence as a model to generate the final prediction result. The ship traffic flow in an area is related not only to the actual traffic flow in the given moments, but also to the spatially related route. Therefore, compared with the traditional ship traffic flow prediction method, a PCC algorithm can be introduced to calculate the correlation of traffic flow between different routes. This method can screen the areas with high correlation and reconstruct the spatiotemporal dependence matrix, in order to improve the input of the GRU model and to predict the ship traffic flow in complex waters more accurately. The algorithm flow is as follows: (1) According to the characteristics of traffic flow structure in complex waters, the temporal and spatial characteristic matrix of multiple observation sections is defined as Q.
where q m is the time series of the observation section, and q m,T is the traffic volume of observation section m at the moment T; (2) Calculate the correlation coefficient between the traffic flow at the observation section of two routes, constructing a spatial correlation matrix as follows: (3) Rank traffic flow correlation between sections. Select the sections to be predicted and sort the other sections by correlation; (4) Set the correlation threshold δ. The sections with a correlation greater than δ are reconstructed into a new spatiotemporally dependent characteristic matrix; (5) Build the GRU model. The input of the GRU model is improved by using the reconstructed spatiotemporal dependence characteristic matrix, and the improved GRU is used to predict ship traffic flow; (6) Calculate the Mean Absolute Percentage Error (MAPE); taking the minimum MAPE as the final optimization goal of the model, the optimal spatial threshold is determined; (7) Results and analysis: To quantitatively analyze the prediction results and the performance of the model, the Mean Absolute Error (MAE), Root-Mean-Square Error (RMSE), Mean Absolute Percentage Error (MAPE), and R 2 are used as prediction and evaluation indicators. The calculation method is as follows: where p i is the predicted value obtained by PCC-GRU and by SVM, LSTM, and ARIMA in the control experiment; x i is the actual value; x i is the average of the actual flow section values.

Research Area and Data
Due to the influence of meteorological and hydrological conditions, construction conditions, and water area location, the water area traffic environment of wind farms presents complex temporal and spatial characteristics. Based on AIS data, real-time prediction of ship traffic flow changes in different stages of wind farm groups can provide an effective means for daily maintenance of wind farms and safety monitoring in the process of construction.
To verify the effectiveness and feasibility of the model, the wind farm water area in Jiangsu Province was selected as the research object, as shown in Figure 3. The cross-section flow statistics of complex routes in the region were evaluated. The routes observed in this research were routes recommended in nautical charts, and the observation section was set in these routes. If a ship passes through the observation section, the traffic volume increases by 1.

process of construction.
To verify the effectiveness and feasibility of the model, the wind farm water area in Jiangsu Province was selected as the research object, as shown in Figure 3. The cross-section flow statistics of complex routes in the region were evaluated. The routes observed in this research were routes recommended in nautical charts, and the observation section was set in these routes. If a ship passes through the observation section, the traffic volume increases by 1. The cross-sectional diagram is shown in Figure 3. The location information of the section is shown in Table 1. The traffic flow time series from 1 to 29 March 2021 was selected as the training data, and the traffic flow data on 30 March were used as the verification set. The ship traffic flow data of sections H1-H11 were collected in hours, and the ship traffic flow data for one day were obtained, as shown in Table 2. q1-q11 represent the traffic volume through sections H1-H11, respectively. Traffic volume is measured as the number of ships in the section during the given time.  The cross-sectional diagram is shown in Figure 3. The location information of the section is shown in Table 1. The traffic flow time series from 1 to 29 March 2021 was selected as the training data, and the traffic flow data on 30 March were used as the verification set. The ship traffic flow data of sections H1-H11 were collected in hours, and the ship traffic flow data for one day were obtained, as shown in Table 2. q 1 -q 11 represent the traffic volume through sections H1-H11, respectively. Traffic volume is measured as the number of ships in the section during the given time.

Sections
Taking section H5 as an example, the model proposed in this paper was used to predict ship traffic flow. Spatial state variables and temporal state variables were the two input parameters of the model. The spatial state variable is a matrix formed by the correlation coefficients between sections, while the time state variable refers to the time interval adopted by the spatial matrix. When the neural network model was built, the recurrent neural network of each layer of encoder and decoder had several GRUs. The number of GRUs is always a multiple of 2-generally between 16 and 128; if it is too large, it will increase the computational complexity and make the training time too long; if it is too small, it will also affect the performance of the model. Figure 4 provides the MEA and RMSE of the experiments using different numbers of GRUs. The GRU number of 64 obtained the lowest error. Therefore, we set the number of GRUs to 64 in our experiments. The validation set loss of the experiment using different batch sizes is shown in Figure 5. The batch size of 8 yielded the lowest error. As a result, the batch size of our model was set to 8. When a complete dataset passes through the neural network and returns, the process is called an epoch; we set the number of epochs to 100. Table 3 shows the hyperparameters used by PCC-GRU in the experiment. All experiments were conducted in Keras on a laptop with an NVIDIA 2080ti GPU, an Intel Core i9-9900KF CPU (3.6 GHz), 16 GB RAM, and the Windows 10 operating system.  :00  8  1  5  2  9  5  7  4  2  3  11  17:00  6  2  6  3  7  4  4  7  2  2  8  18:00  3  3  4  3  6  6  4  5  3  6  7  19:00  4  6  3  5  3  6  6  4  5  7  4  20:00  6  3  3  3  2  3  2  6  4  1  3  21:00  4  5  2  6  5  3  6  5  6  2  9  22:00  2  2  3  3  4  5  5  3  3  4  6  23:00  3  3  2  1  3  4  3  5  2  3  8   Table 3. Hyperparameters used in PCC-GRU.

Results and Analysis
The data of four sections (H3, H5, H9, and H11) were selected to verify the method proposed in this research. In order to set the optimal threshold of PCC and time steps in the GRUs, many experiments were carried out in this research. Indicators for evaluating the experimental results can be calculated using Equations (10)- (13). In these equations, xi is the temporary ship traffic volume value measured on 30 March 2021, while pi is the predicted value by PCC-GRU, calculated with different parameters.

Results and Analysis
The data of four sections (H3, H5, H9, and H11) were selected to verify the method proposed in this research. In order to set the optimal threshold of PCC and time steps in the GRUs, many experiments were carried out in this research. Indicators for evaluating the experimental results can be calculated using Equations (10)- (13). In these equations, xi is the temporary ship traffic volume value measured on 30 March 2021, while pi is the predicted value by PCC-GRU, calculated with different parameters.

Results and Analysis
The data of four sections (H3, H5, H9, and H11) were selected to verify the method proposed in this research. In order to set the optimal threshold of PCC and time steps in the GRUs, many experiments were carried out in this research. Indicators for evaluating the experimental results can be calculated using Equations (10)- (13). In these equations, x i is the temporary ship traffic volume value measured on 30 March 2021, while p i is the predicted value by PCC-GRU, calculated with different parameters.
To study the influence of spatiotemporal state variables on prediction accuracy and determine the optimal parameters, the thresholds of PCC were set as 0.8, 0.7, 0.6, and 0.5, because when the threshold is greater than or equal to 0.8, there is no section related to H3, H5, H9, or H11 in space. To improve the prediction accuracy, the PCC algorithm was used to select spatial characteristic variables. From the position of each observation section, it can be seen that the sections with a large correlation and with the target section are located in the water area around the target, indicating that the traffic flow of the surrounding water area has a great impact on the target section. According to the actual situation, the effectiveness of the PCC algorithm in spatial feature variable selection was verified.
Timesteps are an import parameter in neural networks. If the number of timesteps is n, that means that we think that each value is related to n values in front of it. If the timestep used in prediction is too large, it will lead to time information redundancy and affect the accuracy of the prediction results. If the timestep is too small, it will lead to overfitting of the model. The performance of the model can be seen in Tables 4-7, where the timestep of 7 obtains the lowest error. Therefore, we set the timestep to 7 in our experiments.  Further analysis of the impact of timestep on prediction accuracy shows that the selection of different parameter combinations will change the prediction accuracy of the model. Within a certain range, the prediction accuracy is positively correlated with the timestep. In a certain range, with the decrease in the spatial threshold, the spatial correlation between observation sections is lower. In the case of a high threshold, too little information on other sections leads to a poor prediction effect. In the case of a low threshold, too much irrelevant information is added to interfere with the prediction effect. Based on the prediction performance of different thresholds in Tables 4-7, the threshold was set to 0.5, 0.5, 0.6, and 0.6, respectively. The predicted and true values of observation sections H3, H5, H9, and H11 in the training dataset are shown in Figure 6; the predicted results are in good agreement with the actual values, indicating that the PCC-GRU model is feasible in the actual traffic scenario.
Further analysis of the impact of timestep on prediction accuracy shows that the selection of different parameter combinations will change the prediction accuracy of the model. Within a certain range, the prediction accuracy is positively correlated with the timestep. In a certain range, with the decrease in the spatial threshold, the spatial correlation between observation sections is lower. In the case of a high threshold, too little information on other sections leads to a poor prediction effect. In the case of a low threshold, too much irrelevant information is added to interfere with the prediction effect. Based on the prediction performance of different thresholds in Tables 4-7, the threshold was set to 0.5, 0.5, 0.6, and 0.6, respectively. The predicted and true values of observation sections H3, H5, H9, and H11 in the training dataset are shown in Figure 6; the predicted results are in good agreement with the actual values, indicating that the PCC-GRU model is feasible in the actual traffic scenario. To verify the prediction performance of the PCC-GRU model, comparative experiments were set up in this study. LSTM, SVM, and ARIMA were used to predict the traffic To verify the prediction performance of the PCC-GRU model, comparative experiments were set up in this study. LSTM, SVM, and ARIMA were used to predict the traffic flow of H3, H5, H9, and H11. These methods are commonly used in maritime traffic flow prediction [62][63][64]; therefore, these methods were used as benchmarking methods. After many experiments, the parameters of each model in the experiment were determined, as shown in Table 8. The prediction results of the ship traffic flow of each model are shown in Figure 7.  It can be seen from Table 9 that different models have different results in the traffic flow prediction experiment in the wind farms water area. In our case study, the LSTM model did not take into account the spatial information in the data, so its prediction accuracy was lower than that of the PCC-GRU model, and the time taken to train the LSTM model was too long for real-time prediction of maritime traffic flow. The machine learning algorithm SVM is suitable for short-term traffic forecasting, but the output of the SVM model will oscillate as the training data and the forecasting time increase. Mean- It can be seen from Table 9 that different models have different results in the traffic flow prediction experiment in the wind farms water area. In our case study, the LSTM model did not take into account the spatial information in the data, so its prediction accuracy was lower than that of the PCC-GRU model, and the time taken to train the LSTM model was too long for real-time prediction of maritime traffic flow. The machine learning algorithm SVM is suitable for short-term traffic forecasting, but the output of the SVM model will oscillate as the training data and the forecasting time increase. Meanwhile, the linear model ARIMA is unable to identify the randomness and nonlinearity in the data, making it difficult to make accurate predictions of random changes in traffic. The MAE of the PCC-GRU model in the prediction experiments of the four sections (H3, H5, H9, and H11) was 0.3333, 0.3750, 0.3333, and 0.3333, respectively; the RMSE of the PCC-GRU model of the four sections was 0.5774, 0.6124, 0.5774, and 5774, respectively, while the MAPE was 8.1597, 7.0006, 10.7639, and 5.1403, respectively, which is the smallest in the comparative analysis of the models. R 2 is usually used to describe the fitting degree of the data; the closer it is to 1, the better the fitting degree, and the smaller the deviation between the fitted curve and the original data points. The R 2 of the PCC-GRU model was 0.8799, 0.9116, 0.9063, and 0.9521, respectively, which was greater than that of other models. The bar chart of the error analysis indicators can be seen in Figure 8. In conclusion, the prediction results of the PCC-GRU model are closer to the observed values, and the performance of its algorithm is better than that of other traditional traffic flow prediction methods. The analysis of vessel traffic flow is the basis for evaluating the safety of vessel navigation in a given area of water. By predicting the ship traffic flow in the wind farms water area and maintaining real-time monitoring, it is possible to predict the business of vessel navigation and to control the traffic flow to avoid close-quarters situations.  10.7639, and 5.1403, respectively, which is the smallest in the comparative analysis of the models. R 2 is usually used to describe the fitting degree of the data; the closer it is to 1, the better the fitting degree, and the smaller the deviation between the fitted curve and the original data points. The R 2 of the PCC-GRU model was 0.8799, 0.9116, 0.9063, and 0.9521, respectively, which was greater than that of other models. The bar chart of the error analysis indicators can be seen in Figure 8.
In conclusion, the prediction results of the PCC-GRU model are closer to the observed values, and the performance of its algorithm is better than that of other traditional traffic flow prediction methods. The analysis of vessel traffic flow is the basis for evaluating the safety of vessel navigation in a given area of water. By predicting the ship traffic flow in the wind farms water area and maintaining real-time monitoring, it is possible to predict the business of vessel navigation and to control the traffic flow to avoid close-quarters situations.

Conclusions
According to the needs of traffic characteristic analysis and traffic supervision in complex waters, this study introduced the spatial correlation of ship traffic flow structure into machine learning based on the variant GRU of the recurrent neural network, constructing a spatiotemporal dependence characteristic matrix of ship traffic flow, and improving the prediction accuracy of the ship traffic flow by the neural network. The PCC algorithm is simple to implement and fast to compute, taking into account the degree of correlation of time series at different times, and it is suitable for determining correlation between random variables. The GRU uses a unique memory module instead of implicit nodes, which increases the robustness of the model and can effectively compensate for the shortcomings of traditional neural networks that cannot effectively process long time series. Taking the water area of the wind farm in the Yancheng sea area of Jiangsu Province as an example, the traffic flow in this area was predicted. Compared to results of the commonly used ship traffic flow prediction models ARIMA, SVM, and LSTM, the GRU method's prediction was proven to be effective. The machine learning algorithm SVM is suitable for short-term prediction of traffic flows, but as the prediction time increases, the output of the SVM model will oscillate. The linear model ARIMA cannot identify the randomness and nonlinearity in the data, making it difficult to accurately predict the random changes in traffic. The LSTM model does not take into account the spatial information in the data, and therefore has a lower prediction accuracy than the PCC-GRU model.
By predicting the ship traffic flow and analyzing the temporal and spatial characteristics of traffic flow in complex waters, the marine traffic situation can be evaluated in real time, providing a theoretical basis for the risk evaluation and navigation safety guarantee of complex waters-especially the waters in wind farms with multi-route intersection-and reduces the risks of navigation and operation in the waters. Modelling the spatiotemporal dependence of ship traffic flow is a key area of future research. There are many factors affecting traffic flow prediction that have not been fully considered in this paper. The model proposed in this paper learns static spatial dependencies; however, the dependencies between locations may change over time. In subsequent research, dynamic structures should be considered in order to further improve the prediction performance.