A Novel Hybrid Fuel Consumption Prediction Model for Ocean-Going Container Ships Based on Sensor Data

: Accurate, reliable, and real-time prediction of ship fuel consumption is the basis and premise of the development of fuel optimization; however, ship fuel consumption data mainly come from noon reports, and many current modeling methods have been based on a single model; therefore they have low accuracy and robustness. In this study, we propose a novel hybrid fuel consumption prediction model based on sensor data collected from an ocean-going container ship. First, a data processing method is proposed to clean the collected data. Secondly, the Bayesian optimization method of hyperparameters is used to reasonably set the hyperparameter values of the model. Finally, a hybrid fuel consumption prediction model is established by integrating extremely randomized tree (ET), random forest (RF), Xgboost (XGB) and multiple linear regression (MLR) methods. The experimental results show that data cleaning, the size of the dataset, marine environmental factors, and hyperparameter optimization can all affect the accuracy of the model, and the proposed hybrid model provides better predictive performance (higher accuracy) and greater robustness (smaller standard deviation) as compared with a single model. The proposed hybrid model should play a signiﬁcant role in ship fuel consumption real-time monitoring, fault diagnosis, energy saving and emission reduction, etc.


Introduction
The maritime transportation industry has played a significant role in the cargo industry as a whole since the development of international trade [1,2], and it also has an important impact on the development of the national economy [3]. The total volume of international seaborne trade has been growing significantly over the last years [4]. In addition, container shipping is important for global seaborne trade and the quantity of cargo transported by container shipping has been increasing over the past decades [5]. The increased volume of maritime transport consumes a huge amount of fuel, and as the price of fuel continues to increase, the companies operating ships are facing tremendous freight pressure. In fact, fuel costs for tankers and container ships have been estimated to account for 58% and 78% of the total operating costs, respectively [6]. Another side effect of the significant volume of maritime transportation is an increase in ship-induced greenhouse gas emissions. As a consequence, global warming and various air pollution issues have surfaced. Worldwide estimated carbon emissions from ships, in 2012, were approximately 938 million tons, representing 2.6% of the global total carbon emissions. If no effective control measures are taken, it is expected to rise by 50% to 250% by 2050 [7]. The literature also proves that greenhouse gases emitted by ships mainly include SO 2 , NO x , CO 2 , PM 2.5 , PM 10 [8] and some technical research aiming at greenhouse gas emissions reduction is also being worked on by some experts, such as concerning seawater desulphurization [9][10][11].
The increase in greenhouse gases and environmental pollution has resulted in the International Maritime Organization (IMO), the member states, and related organizations taking various measures to improve the energy efficiency of ships. In 2009, the IMO issued the Guidelines for Voluntary Use of Energy Efficiency Operational Indicator (EEOI) which applies to all ships, and is used to measure the energy efficiency level of operational ships. In addition, the Energy Efficiency Design Index (EEDI) and the Ship Energy Efficiency Management Plan (SEEMP) were launched by the IMO, in 2011, for new ships and all ships, respectively. In 2015, the Marine Environment Protection Committee (MEPC) formulated a three-steps plan focused on ship energy savings and emission reduction based on fuel consumption data, i.e., gathering the data, analyzing the data, and optimizing the support decision. In the same year, China also issued a document entitled "Code for Smart Ships", which integrates the collection, analysis, assessment, and support decision of ship fuel consumption data as part of smart energy efficiency. In 2019, the Norwegian government partnered with the IMO to establish the GreenVoyage-2050 project, which aims to transform the shipping industry towards a lower carbon future. The main purpose of all the above measures is to improve energy efficiency and to minimize greenhouse gas emissions from international shipping and a prerequisite for the aforementioned objective is the development of an accurate and robust ship energy efficiency prediction model. Therefore, our main task is to establish a real-time prediction model with high accuracy and robustness based on the collected ship fuel consumption data, and it will be the basis and premise of fuel management and optimization of ship fuel efficiency.
The remaining framework of this paper is as follows. Section 2 reviews the existing studies on ship fuel consumption prediction. ship fuel consumption data collection and processing is described in Section 3. The methodology, hyper-parameters optimization, and error matrices are outlined in Section 4. Section 5 discusses the experimental results and finally, the conclusion and future work is discussed in Section 5.

Literature Review
An accurate and robust ship fuel consumption prediction model plays a significant role in the optimization of ship fuel consumption. Currently, there are three main types of ship fuel consumption prediction models, namely the physics-based model, simulation-based model, and data-driven model.

Physics-Based Ship Fuel Consumption Prediction Model
In the physics-based ship fuel consumption prediction model, the ship's resistance is calculated through an empirical formula. This is followed by calculating the ship's fuel consumption based on the principle of equal resistance and thrust, combined with the relationship between thrust and a ship's fuel consumption rate. The earliest and most classic documentation of the physics-based ship fuel consumption prediction model was published by Holtrop and Mennen in 1982 [12]; however, the ship's resistance was calculated in calm water, without considering the marine environment. The model was improved by Kwon where marine environmental factors were considered [13]. Subsequent studies on the physics-based ship fuel consumption prediction model have been based on the above mentioned studies [14][15][16][17][18].
The advantages of the physics-based model are that the calculations are relatively simple and the principle of the model is easy to understand; however, it is difficult to accurately depict the impact of environmental factors on the ship fuel consumption using an empirical formula; therefore, the physics-based prediction model approaches are usually less accurate.

Simulation-Based Ship Fuel Consumption Prediction Model
The widely adopted simulation-based prediction model for ship fuel consumption uses computational fluid dynamics (CFD), an emerging interdisciplinary field of hydromechanics and computer science [19][20][21]. CFD is used to approximate the integral and differential terms of the fluid dynamics control equations into discrete algebraic forms, turning them into algebraic groups of equations. Then, these discrete groups of algebraic equations are solved using computer software in order to obtain numerical solutions at discrete time/space points.
The simulation-based prediction model produces accurate results for ships sailing in calm water; however, the accuracy of a simulation-based prediction model for ships in actual sea conditions is still arguable, since it is still difficult to depict the impact of environmental factors on the ship fuel consumption. In addition, CFD simulations take a relatively long time, making it difficult to satisfy the demand for real-time prediction.

Data-Driven Ship Fuel Consumption Prediction Model
The data-driven ship fuel consumption prediction model was developed by using data mining, deep learning, ensemble learning, and other methods. This approach is becoming increasingly popular in this field of research since a large number of noon-report data and sensor data are collected and made available.
From the empirical formula, the ship fuel consumption has a cubic relationship with engine speed, whereas the engine speed is related linearly to the voyage speed. Hence, the ship fuel consumption can be related directly to voyage speed. Through this relationship, the ship fuel consumption model can be established using statistical methods that combine the relationship between fuel consumption and voyage speed. Then, the collected data are used to fit the model parameters in order to make the model more realistic.
Yao et al. [22] fitted the daily fuel consumption (y) and speed (v) of container ships and obtained the following relationship: y = k1 * v 3 + k2. Le et al. [23] collected the noon-report data from more than 100 container ships and classified ships into five types according to their sizes. Finally, ship speed, sailing time and total fuel consumption were linearly fitted. Bocchetti et al. [24] conducted experiments on oil tanker fuel consumption data and obtained the sixth power relationship. Bialystocki and Konovessis [25] used the collected data from the noon reports and took environmental factors into consideration. Finally, the daily fuel consumption and speed were fitted to obtain a quadratic relationship. The least absolute shrinkage and selection operator (LASSO) and ridge regression [26,27] techniques were also used to model ship fuel consumption, as compared with traditional linear regression technique, the prediction performance of LASSO and ridge regression techniques were better due to the characteristics of compressed features and deleted collinear features. Furthermore, the low accuracy of the linear regression technique is due to the high dimensional and nonlinear nature of ship fuel consumption data which make it difficult to fit their intrinsic relationships. Therefore, nonlinear models have been gradually applied to ship fuel consumption modeling and have obtained better prediction results [28][29][30].
With the continuous development of machine learning, the use of new technologies for developing ship fuel consumption prediction models is becoming increasingly well researched. The strong nonlinear fitting ability of artificial neural network (ANN) enables it to be widely used for models with high accuracy. It has been reported that the ship fuel consumption models using ANN have produced good prediction results based on noon-report data [23,[31][32][33][34], sensor data [29,[35][36][37][38][39]] and automatic identification system(AIS) data [40]. Another machine learning approach, known as ensemble learning, has been emerging as is gradually being applied in ship fuel consumption models [41,42]. Experimental results have revealed that the accuracy of ensemble learning methods for predicting ship fuel consumption is superior as compared with other algorithms.
From the above literature review of data-driven methods, there is not one algorithm that is applicable to all research datasets. Different algorithms can be more appropriate because they perform better in particular research datasets [43]. In general, statistical methods are suitable for small datasets, whereby deep learning and ensemble learning perform are better in large datasets.

Research Gap and Contributions
In the process of developing a ship fuel consumption model, there are two major components that determine the performance of the model. One component is the quality of the fuel consumption data; there are two main types of ship fuel consumption data, namely noon-report data and sensor data. Noon-report data are filled in by crew once a day at noon, and therefore it is difficult to used these data for real-time monitoring of ship performance. Sensor data are collected by many sensors, with high frequency acquisition, and therefore these data meet the requirements of real-time monitoring of ship fuel consumption. The second component of a model is the methods of ship fuel consumption modeling. From the literature review, is seems that many current modeling methods have been based on a single model, and no multiple models are used, although multiple models have been proven to be effective approaches in other fields [44,45].
The main contributions of this study are the following: (1) A precise and high-frequency ship fuel consumption data set is obtained via multisensor in order to provide a substantial high-quality data for the model development.
(2) A novel hybrid fuel consumption prediction model based on multiple models is proposed.

Data Collection
The ship fuel consumption data were obtained from a container ship from 14 September 2017 to 25 September 2018. The container ship information is shown in Table 1. The ship fuel consumption data records consist of information on characteristics such as data acquisition time, fuel consumption, Global Positioning System (GPS) speed, trim, mean draft, current speed and direction, wind speed and direction, and wave direction and height, and is shown in Table 2. The fuel consumption was collected by an installed onboard flow meter sensor, and each data record value is the volume of heavy fuel consumed by the ship's main engine within a 15-min period multiplied by the density of the heavy fuel. The GPS speed was collected by an installed onboard GPS sensor. Mean draft (mean value of for draft and aft draft) and trim (for draft minus aft draft) were obtained by the installed onboard ecosounder sensor. We also acquired wind speed, wind direction, wave height, wave direction, current speed, and current direction through the onboard radarsonde sensor, wave gauge sensor and current meter sensor, respectively. Since the collection frequency of the onboard GPS, echosounder, radarsonde, current meter, and wave gauge sensors vary from a few seconds to a few minutes, in order to be consistent with the collection frequency of fuel consumption, the values of GPS speed, mean draft, trim, wind speed, wind direction, wave height, wave direction, current speed and current direction are the mean value within 15 min. For the convenience of subsequent research, the fuel consumption value within 15 min was converted into daily fuel consumption, E, where Equation is as follows: where E r is the ship fuel consumption in every 15 min.

Data Processing
Data processing is an important step and a prerequisite for developing a ship fuel consumption model, because there are inevitably some errors in the raw data collection process due to data transmission delay, deviation, and/or interruption, etc. [37], the errors include null data, noisy data, anomaly data, etc. The following steps were performed to delete the errors in the raw data.
(1) Some of the characteristics in the fuel consumption data contained null data that were deleted to ensure the integrity of the data records. (2) Characteristics that contained noisy data that were greater that the recognition range were considered to be noisy data and deleted. For example, if the values for the direction of wind, wave, and current goes beyond 0-360 • , and mean draft over 20 m, trim over 5 m in absolute value, wind speed over 30 m/s, wave height over 10 m, and current speed over 2 Kn are all considered as noise data, those data were deleted. After the data processing on null data and noisy data was completed, there are 9371 ship fuel consumption data records remaining, as shown in Figure 1a. (3) Unlike null data and noisy data that are relatively easy to find, anomaly data can only be found with the help of existing research and domain knowledge. The process of deleting anomaly data is as follows [46].
Step 1. Delete any ship fuel consumption data records with ship GPS speed V < 10 kn or ship GPS speed V > 30 kn.
Step 2. Calculate the ratio k of any two daily fuel consumption data records add 1 to the outlier scores of the i − th and j − th data records, traverse all data records, and count the total score of each data record.
Step 3. Sort the outlier scores of the data records in descending order and delete the top 20% of the data records.  After deleting anomaly data, the final cleaned data consisted of 7493 reliable ship fuel consumption data records, as shown in Figure 1b. It can be observed from Figure 1 that after deleting anomaly data, the distribution of ship fuel consumption data became more regular. Furthermore, the accuracy of the data when fitted to the GPS speed curve increased from 0.7773 to 0.9179, which indicates that data processing can effectively improve the performance of the model.

Data Overview
The distribution of the processed fuel consumption data is shown in Figure 2. Figure 2a is the distribution of fuel consumption and GPS speed, and we can see that, most of the time, the fuel consumption value is approximately 100-130 t, and the GPS speed value is approximately 18-20 kn, which is the speed range that corresponds to the customary speed of container ships. The distribution of mean draft and trim is shown in Figure 2b

Overall Framework
The main focus of this study included the following three objectives: fuel consumption data collection, data processing, and data analysis (fuel consumption modeling). Then, the model was applied (fuel consumption optimization), which was the ultimate goal of the study, i.e., to improve energy efficiency, reduce emissions, and protect the marine environment. The details are shown in Figure 3.   The main steps of the study are as follows: Step 1. The fuel consumption data of an ocean-going container were obtained by different sensors, including fuel consumption, GPS speed, mean draft, etc., for a total of 10 related features. The daily fuel consumption was the output variable, and the remaining variables were used as input variables.
Step 2. Data preprocessing was performed, including data transformation, null, noisy, and anomaly data deletion, etc., to obtain a high-quality fuel consumption dataset.
Step 3. The fuel consumption dataset was divided into the training and testing sets according to a certain ratio.
Step 5. A Bayesian optimization method of hyperparameters was used to enhance model performance.
Step 6. The model performance was evaluated using error metrics.
Step 7. The best model could be applied to ship route, speed, trim optimization in the future.

XGB
Xgboost (XGB) algorithm was first proposed by Chen and Guestrin [47]. and has a wide range of applications in various fields due to its high accuracy, regularization, support for parallel operations, and automatic processing of missing values [48,49]. The XGB algorithm is solved through the following steps [47]: whereŷ i is the predicted value of the i-th sample, K is the total number of trees, x i is the feature vectors, F is the set of trees, and f is the structure of trees.
where l(y i ,ŷ i ) is the loss function and Ω( f k ) is the regularization term.
where T is the number of leaf nodes, w j is the weights of leaf nodes, and γ and λ are weight penalties.
In the process of objective function minimization, each newly added function f t (x i ) should minimize the loss function, the t-th round objective function of Equation (3) can be converted: The following Equation can be obtained by using second-order Taylor expansion to approximate value of the loss function: where I j = {i | q(x i = j)} is the set of each leaf node of the j-th tree, are the first and second derivative of the loss function, respectively.
Let G j = ∑ i∈I j g i and H j = ∑ i∈I j h i , then, substitute them into Equation (6) to obtain Equation (7) as follows: The following Equation by calculating partial derivative of w.
Substitute Equation (8) into Equation (7) and obtain Equation (9) as follows: The greedy algorithm is used to enumerate the feasible split points to split the subtree, so that the model obtains a higher gain and smaller objective function. The calculation Equation is as follows: where G 2 L H L +λ is the gain generated after the split of the left sub-tree, H R +λ is the gain generated after the split of the right sub-tree, H L +H R +λ is the gain generated without sub-tree splitting.

RF and ET
Random Forest (RF) was proposed by Breiman and was developed based on the bagging technique [50]. The final result of the RF is averaged from the results of many independent decision trees. The calculation Equation is as follows [50]: where m is the total number of trees and f i () is the prediction result of i-th tree. Extremely randomized tree (ET) is a variant of RF [51]. The principle is similar to that of RF where the only differences are as the following: (1) RF uses bootstrap random sampling to select the training set for each of the decision trees, whereby ET generally does not use bootstrap random sampling. (2) After selecting the split feature, RF will select an optimal feature value as the split point, which is the same as the traditional decision tree. However, ET will randomly select a feature value to split.

MLR
Multiple linear regression (MLR) is a statistical analysis method used to determine the interdependent quantitative relationship between two or more variables. Assuming the input variable is X = (x 1 , · · · , x D ), its expression is the following [42,52]: where w can be estimated using the least squares(LS) approach as follows [53]:

The Hybrid Fuel Consumption Prediction Model
The proposed hybrid fuel consumption prediction model was developed on the basis of the stacking theory method [54,55]. By fusing multiple algorithms into the hybrid model, the advantages of each algorithm were fully utilized to improve the robustness of the model and enhance its generalization ability.
The hybrid model improves the generalization ability by combining a set of single models, rather than selecting the best one among them. The proposed hybrid model is a hierarchical model integration framework and its structure is shown in Figure 4. There are two layers of models in a hybrid model framework. The first-level layer is composed of multiple base-models (ET, RF and XGB in this study), the original training set (X − train) is used to train the base models and to generate a new training set (S − train), combined with K-fold cross-validation. Subsequently, the new test set (S − test) can be generated by using the trained base models to predict the original test set (X − test). The second-level layer is a meta model (MLR in this study), the training set (S − train) is used to train the MLR model, then, the trained model is used to predict the test set (S − test) and obtain the final prediction result. The calculation equation is as follows: where f i () is the i − th basis-learner and h() is the meta-learner.  The advantages of a hybrid model are better generalization ability, the ability to adapt to more complex tasks, the ability to fit nonlinear relationships, and greater robustness; however, the disadvantages of the hybrid model include difficulty in determining values of the hyperparameters and complex calculations.

Hyperparameters Optimization and Cross-Validation
The value of hyperparameters for a model are determined before training, not obtained through training. Therefore, it is necessary to have a set of optimized values of hyperparameters in order to improve the prediction performance of the model. Since it is relatively challenging to determine the value of hyperparameters, it is important to choose a reasonable hyperparameters optimization method. There are main three methods for hyperparameters optimization, i.e., grid search, random grid search, and Bayesian optimization [56]. In grid search, a comprehensive search on all the enumerated possibilities is performed. As a result, the optimal values of hyperparameters are obtained for all combinations at the cost of a longer runtime. In random grid search, a certain number of random searches are performed on all possible combinations of hyperparameters; therefore, random grid search has the shortest runtime; however, there is low possibility of obtaining the optimal combination of hyperparameters. The Bayesian optimization of hyperparameters method is between the previous two methods, it runs faster and can also obtain a better hyperparameter combination.
To obtain a more reasonable hyperparameter values, K-fold cross-validation is usually combined during hyperparameters tuning to jointly train the model. K-fold cross-validation is used to divide the dataset into K parts in equal proportions, takes one part as the validation set, and the other K-1 parts as the training set, and the experiment is repeated K times.

Error Metric
To evaluate the performance of the the ship fuel consumption prediction model, in the study, four performance metrics were constructed. They are R 2 , mean square error (MSE), mean absolute error (MAE) and running time (T) as follows [29,41]: (18) where y i is the true value of ship fuel consumption,ŷ i is the predicted value,ȳ i is the average value, and n is the number of data samples. t start and t end are the start and end time of model operation, respectively. It can be observed from Equation (15) that a larger value of the performance index R 2 , indicates a better model performance. Conversely, a better model performance is indicated by a smaller value of MSE, MAE, and T in Equations (16)-(18).

Results and Discussion
All experiments were conducted using Python3.5 running on a 64-bit Windows 10 operating system, Intel Core i5-7200 CPU processor, and 12.0 GB memory. To verify the superiority of the proposed hybrid model, it was validated against reference models developed using MLR, SVM, ANN, ET, RF, and XGB.
Due to the different range of characteristic values of ship fuel consumption data, the performances of the models (MLR, SVM, ANN) are affected. Therefore, the data need to be standardized before being used for the models. The equation for data standardization is as follows [29]: where µ and σ are the mean of each characteristic and standard deviation respectively. Each ship fuel consumption dataset was divided into a training set and a test set according to the ratio 0.8:0.2. The model was trained using the training set, and the trained model was used to predict the test set in order to obtain the prediction result. To ensure that the training and test sets were the same for each model, the random division state (random − state) of the data needs to be fixed and set to the same value. Simultaneously, in order to reproduce the experimental result, the random − state of each model also needs to be fixed. Since the training set and the test set were divided according to random − state, the model result in a certain random − state does not indicate whether the model is suitable; therefore, it is necessary to test in different random − state and take the average value as the value of model performance.
The following experiments were conducted on the influence of data volume, environmental factors, and hyperparameters on the model; the first two experiments models are not hyperparameter tuned. At the same time, the performances of different models before and after hyperparameter optimization were also compared. All the experimental results are the average of five experiments.

The Impact of Data Volume on Model Performance
The most significant difference between noon-report data and sensor data is the data acquisition frequency. The noon-report data acquisition frequency is once a day, while the sensor data is every 15 min; therefore the amount of sensor data is 96 times the amount of noon-report data in the same duration. Therefore, we can indirectly compare the effect of fuel consumption modeling based on sensor data versus noon report-data from the impact of the dataset size on model performance.
The data volume is set to 100, 200, 400, 800, 1600, 3200, 6400, and 7493. A total of eight different data volumes and 400 (10 × 8 × 5 = 400) experiments are required. The models R 2 , MSE, MAE, and T values under different data volumes are shown in Figure 5a-d. It can be observed from Figure 5a-c that for data volume less than 1000, the R 2 values of all models increase rapidly with the an increase in the data volume. It takes almost three years for noon reports to achieve a dataset with 1000 records, while sensor data only requires about 10 days. It clearly demonstrates that the sensor data are more suitable for fuel consumption prediction modeling as compared with noon-report data. For data volume between 1000 and 3000, the R 2 values increase slightly with an increase in the data volume, and for data volume more than 3000, the R 2 values for all models are basically constant. The runtime of a model, T, generally increases with an increase in data volume. As the data volume continues to increase, the model runtime, T, also continues to increase, as shown in Figure 5d. The findings from this experiment can be used as a reference for the selection a model for real-time and online incremental modeling of ship fuel consumption.

The Impact of Marine Environmental Factors on Model Performance
To study the impact of marine environmental factors such as wind, wave, and current on ship fuel consumption, four different ship fuel consumption datasets were designed, i.e., Set 1, Set 2, Set 3, and Set 4. Set 1 covers all environmental factors, whereby Set 2, Set 3, and Set 4 are without wind factors, wave factors, and current factors respectively. A total of 200 (10 * 4 * 5 = 200) tests were conducted.
The results of the proposed model, and the reference models on the four datasets are as shown in Tables 3 and 4 respectively. As shown in Table 3, the R 2 values for the proposed model for Set 1, Set 2, Set 3, and Set 4 are 0.9932, 0.9927, 0.9924, and 0.9932, respectively. This shows that the R 2 value decreases by 0.0005, 0.0008, and 0.0000 when the wind, wave, and current factor is missing from the dataset, respectively. In terms of the MSE value for the proposed model, it increases by 0.6493, 0.9637 and 0.0753 when the dataset lacks wind, wave, and current factor, respectively. In a similar trend, the value of MAE for the proposed model increased by 0.0957, 0.1149 and 0.0083, respectively. From the above analysis, it can be observed that among the three environmental factors, the wave factor has the greatest impact on the model, followed by wind and current factors. Since the feature is reduced, the model runtime, T is also slightly reduced, as shown in the last column of Table 3. The experimental results of the reference models in Table 4 show similar trends to those in Table 3 in terms of the importance of wind, wave, and current factors to the model.  Table 4. Effects of wind, wave and current factors on the results of the reference models. In order to further verify the findings of the above experiments, ET and XGB are used to calculate the importance of different features to the ship fuel consumption model. As shown in Figure 6a,b, the sum of the importance value for GPS speed, trim, and mean draft for ET and XGB reached 0.9617 and 0.9385, respectively. This indicates that these three factors play a leading role in ship fuel consumption modeling. According to the literature [33], the fuel consumption of a ship is approximately cubic, or even quadratic, in relation to the GPS speed, and two-thirds in relation to the draft. The importance values for the environmental factors wind, wave, and current are 0.0135, 0.0208, and 0.0040, respectively, for the ET model. In the XGB model, the importance value for wind factor is 0.0221, wave factor is 0.0258, and current factor is 0.0136. Wind resistance is quadratic with wind speed, and wave resistance is quadratic with wave height and ship's hydrostatic speed, so both wave and wind will lead to increased fuel consumption of the ship [17].

Datasets
From this analysis, we verified that the importance value of the wave factor is the most significant among the environmental factors, followed by wind and current. This indicates that wind and waves are the more important factors because they reduced the ship's propeller propulsion efficiency, thereby, affecting the ship's daily fuel consumption. Current had little effect on the ship's propulsion efficiency; therefore, it had a smaller impact on the ship's daily fuel consumption.

The Influence of Hyperparameters on Model Performance
A challenging but important step in the modeling process is to obtain reasonable values of hyperparameters.
As previously mentioned in Section 4.3, the Bayesian optimization and five-fold crossvalidation methods were chosen to obtain the optimized values of hyperparameters for each model. Table 5 outlines the hyperparameters that need to be optimized and it can be observed that ET, RF, XGB and ANN have more hyperparameters as compared with SVM, and MLR has no hyperparameter. Additionally, there is no hyperparameters optimization for the proposed model, as shown in Table 5, because the proposed model consists of some single models, and therefore the hyperparameter values of those single models are also the hyperparameter value of the proposed model.
In order to verify the effect of the hyperparameter optimization, the performances of the models are compared before and after hyperparameters optimization, as shown in Figure 7. Figure 7a shows the R 2 value, where the blue dotted line and red line represent the results before and after hyperparameter optimization, respectively. It can be observed that the red line is almost always on the periphery, which indicates that the R 2 value of the models after hyperparameters optimization is increased, in other words, the model performance is improved. Figure 7b,c show the MSE and MAE values, respectively. The red lines are always located in the inner circle, which indicates that the MSE and MAE values after hyperparameters optimization have been reduced, which also shows that the performance of the model is improved. Figure 7d shows the model runtime, T, before and after hyperparameters tuning. It can be observed that after hyperparameters tuning, the runtime, T, increases for all models. Table 5. Hyper-parameters that need to be optimized.

Performance Analysis of Different Models
Experiments were conducted to find out the impact of different data volumes, different environmental factors, and hyperparameters optimization. The results revealed that increasing the data volume, increasing the environmental factors, and optimizing the model hyperparameters all improved the performance of the model to some extent. In order to determine the most suitable model for ship fuel consumption prediction, Set 1 was chosen as the data source and Bayesian optimization of hyperparameters was performed on each model. Then, the mean and standard deviation (Std) of error metrics were used to compare the performance of the models as shown in Table 6. In all single models, ET is the best model with the highest value of R 2 (mean R 2 = 0.9938), the lowest value of MSE (mean MSE = 7.3496), and MAE (mean MAE = 1.6752). The ANN is one of the most widely used models for ship fuel consumption modeling; however, its predictive performance is lower than that of ensemble learning methods (ET, RF, and XGB). MLR has the worst predictive performance, because MLR is a typical linear regression model, but the ship fuel consumption data present a nonlinear relationship.
By comparing the ET model to the proposed model, it can be observed, as shown in Table 6, that the models have similar mean accuracy values, because of the same R 2 values, the proposed model has a lower MSE value (mean = 7.3446), but the ET model has a lower MAE value (Mean = 1.6752). In terms of Std, the proposed model has lower MSE and MAE Std values than the ET model, i.e., the former has MSE (Std = 0.2982) and MAE Std values (Std = 0.0354), whereas the latter has MSE (Std = 0.3025) and MAE Std values (Std = 0.0371). This indicates that the robustness and stability of the proposed model is better than the ET model. The model runtimes, T, for all models are less than 80 s, which is significantly faster than the 15-min ship fuel consumption collection time interval. This indicates that all of the models meet the requirements of real-time ship fuel consumption prediction. The proposed model exhibited good performance in ship fuel consumption prediction, and therefore can provide a reference for other ship fuel consumption data sources modeling in the future.

Conclusions
In this study, a hybrid method was implemented to develop a ship fuel consumption prediction model based on collected real-time ship sensor data. The research conclusions are mainly reflected in the following three aspects. First, the proposed data processing method can effectively improve the quality of ship fuel consumption data. The R 2 value of the data, when fitted to the GPS speed curve, increased from 0.7773 to 0.9179 after data cleaning was conducted. Second, the increase of data volume, with maritime environmental factors and hyperparameter optimization were also found to contribute to the prediction accuracy of the model. Third, the experimental results revealed that the proposed model produced the better prediction results, followed by ET, XGB, RF, ANN, SVM and MLR. By comparing the proposed model with the best single model (ET), the accuracy (mean R 2 = 0.9938) of the two methods were similar, but the standard deviation values (MSE Std = 0.2982 and MAE Std = 0.0354) of the proposed model were lower, which indicates that the proposed model is more robust and stable than ET. The runtime of all models were shorter than the ship fuel consumption collection time interval (15 min), thus, meeting the requirements of real-time ship fuel consumption prediction. The proposed hybrid model can accurately predict fuel consumption in real time and it can also be applied for ship fuel consumption monitoring and fault diagnosis. Shipping companies and related maritime organizations are concerned about how to achieve energy conservation and emission reduction from ships; therefore, in the future, to achieve these goals, the proposed hybrid model could be applied to optimize ship fuel consumption, such as speed optimization, trim optimization, and route optimization. At the same time, this study had several limitations. The research object in this study is a container ship; it is difficult to discover the universal laws through a container ship's fuel consumption data; therefore, the fuel consumption data for a fleet of container ships need to be collected in the future. In addition, all results or conclusions were obtained only from the data-driven level, and therefore we plan to focus on the impact of ship hydrodynamics on fuel consumption in the future.

Data Availability Statement:
The data presented in this study are available on request from the corresponding author. The data are not publicly available due to confidentiality.