4.1. Data Preprocessing
It can be seen from
Section 2.1 that there are 11 uncertain factors identified in this paper, including ship types, and so on. The influencing factors identified in the study are the number of shore bridge
, the number of 20-foot containers unloaded
, the number of 20-foot containers loaded
, the number of 40-foot containers unloaded
, the number of 40-foot containers loaded
, the number of special containers unloaded
, the number of special containers loaded
, the type of vessel
, the time of vessel berthing
, the number of collector trucks
, the number of yard bridges
, and the weather (wind level and rain and snow)
. In this study, it is assumed that each quay bridge, field bridge, and collecting card performs the same amount of work per unit of time. Since some categories in the original data are represented by words, it is necessary to code and process the text records of ship type and weather, while also digitally converting the time series of berthing time.
The data samples obtained by the coding procedure are shown in
Table 3, which randomly selects 1000 data from the original data. In order to ensure that the prediction is accurate, 700 samples from the training set and 300 samples from the test set must be randomly generated in the ratio of 7:3. The container ship operation information sheet is shown in
Table 4.
Before conducting principal component analysis, the original samples were first analyzed to confirm whether they met the requirements of principal component analysis. In this study, the port ship operation data are analyzed by Pearson correlation analysis using IBM SPSS Statistics.
This study uses KMO and Bartlett’s spherical test. The degree of correlation between variables is assessed according to the judgment and the suitability of the sample data when using principal component analysis method. The results of the test are displayed in
Table 5 with a significance level of 0.000 and a KMO measure of 0.717. The resultant value of the method satisfies the KMO measure’s requirements as well as the significance level of Bartlett’s sphericity test below 0.01. The analysis demonstrates that the original data’s parameters show a strong correlation, and the chosen sample data satisfies the necessary conditions for the principal component analysis approach, which may be used to reduce dimensionality.
Using the MATLAB software, principal component analysis is carried out on the container ship’s berth operation time data. Principal component analysis is performed on the original samples using the princomp function after they have been first normalized with the zscore function. A control group is added to the zscore function standardization of the container ship at berth operation data shown in
Table 4 to confirm the logic and validity of the zscore standardization process. In the control group, the steps of the zscore standardization process are skipped, but other conditions are keeping constant. This allows us to assess the logic and validity of the zscore standardization process.
The data information on the number of different types and sizes of containers loaded and uploaded has become the main data of the container ship’s berthing operation data. It is discovered when performing principal component analysis on the data of the control group, it is found that because its values are significantly higher than other data indicators. Because of this, both the size of the coefficient matrix and the size of difference between each primary component’s contribution rate are too large. It is therefore determined that the magnitude difference of the coefficient matrix of principal component analysis will be too big when the original data are not standardized by the zscore function, which will damage the outcome of experimental data analysis. Therefore, using the zscore standardization step can eliminate the negative impact of different index magnitudes in the original data on the model effect, and reduce the impact of high-level numerical indicators on low-level numerical indicators. Additionally, this method can also avoid the impact of some higher value indicators on the main data sample score. Following zscore normalization,
Figure 5 displays the principle component variance contribution rate.
Figure 5 illustrates the contributions of each principal component and the variance of each principal component on the horizontal and vertical axes, respectively. A bar graph displays the variance contributions of each principal component. The eigenvalues of each variable in
Figure 5 are sorted from largest to smallest, and the cumulative contribution of the first seven principal components,
F1,
F2,
F3,
F4,
F5,
F6,
F7, is over 85%, meeting the standard of covering the main information in the original sample. Therefore, the principal component matrix can be obtained from the above seven eigenvalues. The 7-D principal component matrix retains the main information of the original data and eliminates the irrelevant information.
Table 6 shows the composition matrix. Seven principal component calculation formulas composed of 12 influencing factors can be obtained from the table. Each column of numbers corresponds to the coefficient of each factor. Thus, principal component analysis reduces the complexity of the data and produces more condensed and informative data samples for the next stage of training the prediction model by replacing the muti-indicators of high-dimensional samples with low-dimensional and comprehensive indicators.
4.2. Parameters Setting of PCA-ELM-IPSO Model
In this section, we use the principal component matrix as the input matrix for the container ship berthing operation prediction model experiments, and use the actual berthing operation time as the output variable. Besides, we also use the MATLAB tool for model training and prediction.
In this paper, the parameters of particle swarm optimization algorithm, extreme learning machine and principal component analysis are shown in
Table 7. The number of nodes in the implicit layer in the limit learning machine is determined by the formula
in
Section 4.1 (l, n and m are the number of nodes in the implicit layer, input layer and output layer, respectively, and
is a constant, which is generally taken in the range of [1,10
). To find the optimal number of nodes in the hidden layer, the study is evaluated by the magnitude of the mean square error under the same data samples and experimental conditions. After training, it is found that the model means square error is minimized when the number of nodes in the hidden layer was 11. As a result, the number of nodes in the hidden layer is set to 11, the number of neurons in the output layer is set to 1, the Sigmoid function is chosen as the activation function, and the smoothing factor
controlling the smoothness of the
curves is set to 0.7, and the smoothing factor m controlling the smoothness of the
and
curves is set to 2. In addition, to ensure the accuracy of the prediction,
Section 4.1 needs to generate 700 training set samples and 300 test set samples at a random ratio of 7:3 when pre-processing the data.
4.3. Analysis of Prediction Results
Combining principal component analysis, improved particle swarm optimization, and extreme learning machine algorithm, a prediction model of container ship berth operation time based on PCA-IPSO-ELM is established. The data samples after dimensionality reduction by principal component analysis are selected, and the training and prediction of the PCA-IPSO-ELM model are carried out by the MATLAB software.
Figure 6 shows the predicted and true values of the hybrid PCA-IPSO-ELM model, and
Figure 7 shows the absolute error of the model prediction.
In
Figure 6, the black dotted line indicates the expected output value, and the blue solid line indicates the predicted output of the model. The predicted trend is consistent with the actual container ship’s berth operation, and the fitting degree of the model is good. At the same time, it can be seen from
Figure 7 that the absolute prediction error of the PCA-IPSO-ELM model is generally in a low floating range. It can be inferred that this model has good prediction performance in predicting the berth operation time of container ships.
In order to further verify the effectiveness of the PCA-IPSO-ELM prediction model, the standard BP neural network model, ELM model, GA-BP neural network model, and the IPSO-ELM model are selected as comparison experiments. Among them, the excitation function of the hidden layer of the BP neural network is Sigmoid, the excitation function of the output layer is Purelin, the number of neurons in the hidden layer is 10, the maximum number of training is 500, the accuracy requirement is set to 0.0001, the learning rate is 0.01, the weights and thresholds of the network are initialized to a value between them, the chromosome coding length in GA is 168, the population size is set to 60, the evolution algebra is 30, and the crossover probability is 0. The BP, ELM, GA-BP, and IPSO-ELM models are programmed using the MATLAB platform to complete the training process of the models, and the test set is predicted and analyzed.
The prediction results of the PCA-IPSO-ELM model proposed in this paper are compared with the other four models, and it is finds that the single BP neural network model has the worst prediction effect and the biggest error. Compared with the standard BP neural network, the GA-BP model improves the prediction accuracy, but the iteration speed is slow and the solution process takes a long time. The PCA-IPSO-ELM model proposed in this paper has the best fitting effect, and the absolute error of prediction is mainly concentrated in the interval, while the IPSO-ELM model is second only to PCA-IPSO-ELMEL model. The prediction results of the above five groups of models are BP < ELM < GA-BP < IPSO-ELM < PCA-IPSO-ELM. To further analyze the comprehensive performance of the prediction models, the training is repeated 30 times, and the average absolute error, root mean square error, determination coefficient and running time are used to predict the BP, ELM, IPSO-ELM, GA-BP and PCA-IPSO-ELM models. The prediction results of the IPSO-ELM model are analyzed, and the results are shown in
Table 8. The absolute error comparison of the five models is shown in
Figure 8.
From the comparison results of the prediction data of the five models, we can conclude that:
(1) The average absolute error and root mean square error of the PCA-IPSO-ELM model are 0.3196 and 0.4080, respectively, which are lower than 1.3508 and 1.4913 of BP model, 1.0929 and 1.2761 of ELM model, 0.5672 and 0.6884 of GA-BP model, and 0.3581 and 0.4759 of IPSO-ELM model. The coefficient of determination of the PCA-IPSO-ELM model is 98.62%, which is higher than 87.31% for the BP model, 90.55% for the ELM model, 95.06% for the GA-BP model, and 97.79% for the IPSO-ELM model.
(2) According to the analysis of the running time of the different models, the running time of the ELM model is 458.072 s, while that of BP model is 932.697 s, which is about twice that of BP. On this basis, the PCA-IPSO-ELM model has a running time of 201.787 s, which is also faster than the GA-BP model with 615.406 s and the IPSO-ELM model with 228.593 s, requiring the shortest running time.
By analyzing the performance of the five prediction models, the PCA-IPSO-ELM model has the smallest prediction error, the best fitting degree, and the shortest running time. It can be concluded that compared with the single BP neural network model, the performance of ELM model is improved, but the prediction accuracy and fit of the two models are still insufficient. Compared with the GA-BP model and other three models, the PCA-IPSO-ELM model avoids the influence of redundant data, and effectively overcomes the shortcomings of common prediction models, such as slow response, premature convergence to local optimum and excessive memory consumption.