Data-Driven Approach for Estimating Power and Fuel Consumption of Ship: A Case of Container Vessel

: In recent years, shipborne emissions have become a growing environmental threat. The International Maritime Organization has implemented various rules and regulations to resolve this concern. The Ship Energy Efficiency Management Plan, Energy Efficiency Design Index, and Energy Efficiency Operational Indicator are examples of guidelines that increase energy efficiency and reduce shipborne emissions. The main engine shaft power (MESP) and fuel consumption (FC) are the critical components used in ship energy efficiency calculations. Errors in ship energy efficiency calculation methodologies are also caused by misinterpretation of these values. This study aims to predict the MESP and FC of a container ship with the help of data-driven methodologies utilizing actual voyage data to assist in the calculation process of the ship ’ s energy efficiency indexes appropriately. The algorithms ’ prediction success was measured using the RMSE, MAE, and R 2 error metrics. When the simulation results were analyzed, the Deep Neural Network and Bayes algorithms predicted MESP best with 0.000001 and 0.000002 RMSE, 0.000987 and 0.000991 MAE, and 0.999999 R 2 , respectively, while the Multiple-Linear Regression and Kernel Ridge algorithms estimated FC best with 0.000208 and 0.000216 RMSE, 0.001375 and 0.001471 MAE, and 0.999999 R 2 , respectively.


Background
The maritime sector has become more consolidated as the volume of global commerce has increased in recent years [1]. As a result, there has been an increase in emissions caused by shipping because of using fossil fuels [2]. Various rules and regulations were enacted by the International Maritime Organization (IMO) to limit emissions in the shipping industry [3,4]. Therefore, several indices such as the Energy Efficiency Design Index (EEDI), Ship Energy Efficiency Management Plan (SEEMP), and Energy Efficiency Operational Indicator (EEOI) have been proposed to determine and enhance the energy efficiency level of the global fleet of marine vessels [5]. In terms of shipping companies, it can be claimed that energy efficiency begins at the design stage [6] and that ship energy effi-ciency may be boosted through operational ways in addition to numerous design approaches [7][8][9][10]. To improve operational energy efficiency, methods such as cruise route optimization [11], speed optimization [12], alternative fuels [13], electrical power optimization [14][15][16] and other improvements have been recommended in the literature [7,17]. The use of methodologies like SEEMP and EEOI to measure energy efficiency in ships was developed by studies on the relationship between speed and main engine shaft power [18,19]. These methods are regarded as effective, although they do have certain drawbacks. Because of internal, external, and severe circumstances, the connection between speed and propulsion power aboard might diverge from design data. This is due to a number of internal and external variables that affect the vessel's function [20]. Aside from exterior meteorological elements like wind, wave, and current, numerous situations originating from the ship's internal dynamics have a significant impact on its efficiency [21]. As a result, in addition to evaluating the energy efficiency of ships under ideal test conditions, it is required to make use of a variety of data collected throughout the voyage [22].
During the voyage, the vessel may need to increase its speed under certain scenarios. In such cases, it will be necessary to create more propulsion power in order to achieve the desired speed values, which demand more fuel. Hence, this process results in consuming more fuel, emitting more exhaust gases into the environment, and decreasing the ship's energy efficiency [23]. It can be a beneficial approach to evaluate power and fuel consumption at this moment to solve difficulties linked to determining ship energy efficiency in the maritime sector [24]. With the advancement of technology, data-driven methods have expanded their field of application and proven their success in a wide variety of industries [25][26][27][28][29]. Obtaining data from a system in the maritime industry can be described as a challenging process until the last ten years. The development of sensor technology has made it possible to obtain meaningful voyage data from ships. Through sensors in the ship's engine room, the main engine, and the engine logbook, the shaft power and fuel consumption were evaluated using data-driven approaches in this research. The dataset was analyzed using correlation analysis [30]. Another technique depends on the pair plots to identify the variables most highly correlated with power and fuel consumption during dataset analysis. Further, for predicting shaft power and fuel consumption, some techniques like Multiple Linear, Ridge, Lasso, Kernel Ridge, Elastic Net, Artificial Neural Network, XGradient Boosting, Deep Neural Network, and Bayes algorithms are proposed. To detect the overfitting status of the prediction models, the K-Fold Cross Validation [31] approach was used. The parameters of the algorithm have been optimized to improve the accuracy of the predictions. When compared to other approaches, the Deep Neural Network and Bayes algorithms showed the best prediction performance for the shaft power prediction of the main engine, while the Kernel Ridge and Multiple Linear Regression algorithms showed the best prediction performance for fuel consumption prediction. The contributions of this study are summarized below.

•
Related studies reviewed in the literature usually only estimate one variable (fuel consumption or power), and this study estimated fuel consumption and main engine power variables separately.

•
In addition to the four models that are mostly discussed in the studies reviewed in the literature, five different data-driven algorithms are used for fuel consumption and power estimation cases.

•
The performance values of the algorithms before and after parameter optimization are compared and discussed in detail.

•
A pair plot was used, in addition to the correlation analysis, to analyze the relationships among the variables in the dataset in more detail.
The main sections of the study are as follows: The material and methodology are in Section 2, and the case study is in Section 3. The simulation findings are reported in Section 4, and the results are evaluated and proposed future research is discussed in the conclusion and discussion.

Related Works
There are various applications of data-driven methods on ships. Hu et al. argued that estimating ship fuel consumption requires a two-stage strategy. Data collection and processing operations are carried out in the first step, and trim optimization is suggested in the second. Furthermore, trim optimization has been claimed to reduce carbon emissions [32]. According to Vettor and Soares, depending on the route, weather conditions would affect sea wave conditions, which would affect fuel consumption. A 90% success rate was achieved in the container ship fuel consumption estimation study [33]. Zhou et al. estimated fuel consumption using machine learning algorithms. In the fuel consumption estimation study, the ANN, SVR, Lasso, and Random Forest algorithms proposed hyperparameter optimization for optimizing the methods and used this process for four methods. They observed that hyperparameter optimization increased prediction success by 0.0773% to 2.1653% as a result of the simulations [34]. Yan et al. were able to estimate fuel consumption with the Random Forest algorithm with an error of about 7% in their study [35]. Yuan et al. suggested that ship fuel consumption is critical for factors such as energy management, cruise planning, and smart decision-making. In the study, environmental factors, water depth, and various sensor data were used [36]. Tien Anh Tran used machine learning and the Monte Carlo method for fuel consumption estimation. He also performed the estimation process with ANN and Multiple Linear Regression methods [37]. Karagiannidis and Temelis claimed that knowing the actual positions of the hull and propeller parts of the ship would contribute to operational energy efficiency, and they argued that the shaft power and fuel consumption values are important in terms of energy efficiency. In the estimation study, only an Artificial Neural Network model was used [38]. Fan et al., in a literature review, divided the available fuel consumption estimation methods into three classes. In addition, they discussed the factors affecting fuel consumption on board [39]. Ferreira et al. used Decision Tree, Artificial Neural Network, and Random Forest Regression methods for ship propulsion power estimation in their study [40]. In their study, Lee et al. were able to predict ship power using an Artificial Neural Network with an error margin of 3.5% to 4% [29]. According to related studies, power was not estimated in studies that estimated fuel consumption, and fuel consumption was not estimated in studies that estimated power, and both values were estimated in this study. Furthermore, the methods investigated in the literature are primarily concerned with the classical Artificial Neural Network structure, as well as the Random Forest, SVM, Decision Tree, and Multiple-Linear Regression algorithms. In this study, nine different data-driven algorithms, including the Deep Neural Network method, were used to estimate fuel consumption and power.

Materials and Methods
Data-driven methods were used to estimate the electrical power and fuel consumption values on a commercial ship in this study. To begin, the dataset is divided into two sections, including training and testing. The training set was used to develop the prediction models, while the test set was used to calculate the algorithms' prediction success. The data-driven methodologies can be used to calculate the propulsion power and fuel consumption for a ship cruise. Support vector regression (SVR) was used in a study in this area to predict propulsion power more accurately than conventional methods [5,41]. Another study indicated that machine learning approaches outperform the ANN method in specific cases for predicting shaft power onboard ships using AIS data and weather data [42]. For shipping operational optimization, Leifsson et al. combined gray-box and whitebox models with ANN. The gray-box model was discussed in this research as having certain advantages over other techniques for a container vessel [43]. Petersen et al. argue that propulsion power plays an important role in ship fuel economy, and they utilize Artificial Neural Networks and statistical models to estimate propulsion power, demonstrating that both techniques provide good results [44].
To investigate the energy efficiency of a container ship, various data-driven models were used to predict shaft power and fuel consumption factors, and Figure 1 depicts the study's approach. The first 700 days of voyage data from a container ship were gathered for the estimating procedure. These figures were compiled from 75 distinct data sources aboard, including various equipment. Figure 2 shows the findings of the Pearson Correlation Analysis. The study revealed that several factors in the data set had a higher correlation with the shaft power and fuel consumption variables. The correlation matrix was examined, and data with poor correlation with these variables were excluded from the analysis and estimation procedures. To better comprehend the relationship between power and fuel consumption, a pair plot was created, with the highest correlations illustrated in Figure 3. The data set was randomly picked by the computer as training data (66 percent) and test data (33 percent) and separated into two parts after it was processed [45]. The training data was utilized for training the algorithms, while the remaining test data was not used. The outcomes of the algorithm-based prediction method were compared to the actual test data. The estimation was done using data-driven techniques such as Multiple Linear Regression, Ridge Regression, Lasso Regression, Kernel Ridge Regression, Elastic Net, Artificial Neural Network, XGradient Boosting, Deep Neural Network, and Bayesian Regression. Since the expected results were not obtained from the estimation in the first stage of the prediction process, the parameters of the algorithms were changed to increase the algorithm's performance. To validate the findings and detect overfitting, the K-Fold Cross Validation method was used [46]. The algorithm's results were then compared using error metrics such as Root Mean Squared Error (RMSE), Mean Absolute Error (MAE), and Coefficient of Determination (R 2 ) [47]. Figure 1 shows the steps done in further detail. This section is organized as follows; Sections 2.1 and 2.2 explain the data collection and data pre-processing phases. Section 2.3 describes the stages of model development and prediction. Validation and evaluation techniques are introduced in Section 2.4.

Data Collection
The data collection process is a major challenge for data-driven studies on scientific procedures [48]. The vessel in this analysis has a length of 328 m, a width of 46 m, and a draft of 9.7 m. Propulsion power is provided by the main engine, model 10S90MEC9. This main engine has nine cylinders and is constructed with two strokes. The data was compiled by merging the engine logbook, noon report, and main engine sensors from a cargo ship. Engine power (%), main engine shaft rotating per minute, fuel oil consumption (t/d), main engine shaft torque (kNm), main engine shaft power (kW), temperature values of main engine jacket cooling water, main engine jacket freshwater, thrust pad, scavenging air, cylinder, and other parameters are included in this dataset. Table 1 shows the statistical analysis of a part of the data set. Data was received via three diesel generators, one shaft generator, and one emergency generator. The microgrid of this ship is represented in Figure 2.

Data Pre-Processing
Correlation Analysis Understanding how data-driven methods work requires an understanding of the correlation. Thanks to this, it is revealed how the variables in the data set are related to each other. Data-driven methods can also predict the target variable by using these variables' relationships. Another important factor that draws attention here is the degree of correlation. If the correlation value is close to zero, it is called a low correlation. In other words, it can be said that the two variables affect each other slightly or not at all. Suppose the correlation is between zero and −1 and closer to this value. In that case, a strong negative correlation occurs, meaning an inverse correlation exists between the two related variables in the dataset. The closer the correlation value is to 1, the greater the degree of correlation between the two variables. In this case, as one of the two variables changes, the other will change in parallel with the value of this variable [49].
The relationship between any two variables was determined using correlation analysis, which is a method for analyzing and illustrating the relationship between variables [50]. The Pearson Correlation Coefficient is commonly utilized and calculated in this investigation [45]. A good correlation exists when the coefficient is positive; however, an inverse correlation is observed when the sign is negative. When there is a relationship between two variables, a linear shape will emerge in the pair plot of these variables. If there is no correlation, the pair plot of these two variables will not have a linear shape. The Pearson Correlation Analysis is illustrated in Figure 3.
The data of main engine shaft speed (rpm), main engine scavenging air temperature, main engine thrust pad temperature, and main engine fuel oil consumption form a strong correlation with the power, which can be noticed when the correlation matrix is studied. The pair plot in Figure 4 provides a more detailed examination of the association between these variables. The power does not vary until the shaft speed is around 35 rpm, as shown in the pair plot. After this value, it can be concluded that power and shaft rpm have a significant connection. The main engine scavenging air temperature and main engine fuel oil consumption statistics form a correlation with the power, as can be seen in Figure 4. Further, up to 48 °C, the main engine thrust pad temperature data has no effect on the power, and beyond that, there is a link between them.

Multiple Linear Regression
Multiple Linear Regression is a frequently used algorithm in machine learning applications and is a statistical method that predicts the dependent variable from the independent variables [51]. Equation (1) is used for Multiple Linear Regression [52]. y = a 0 + a 1 x 1 + ⋯ + a n x n where a 0 , a 1 , … , a n are coefficients, y is the dependent variable, and x 1 , x 2 , … , x n are independent variables. In this method, (coefficients) are calculated as a n = argmin (a)

Ridge Regression
The Ridge Regression algorithm (RR) is a method that is generally used for coefficient estimation and sometimes does this according to the least-squares method [53]. In this method, the coefficients (a n ) are found with the following, Equation (3). a n = argmin (a) In this equation, µ > 0 is a regularisation hyperparameter [54].

Lasso Regression
LASSO emerged as a variable selection method based on the least-squares method [55]. In this method, the least-squares method is used to find the coefficient (a n ). The equation for finding the coefficient with this method is given below (4). a n = argmin (a)

Kernel Ridge Regression
The Kernel Ridge algorithm is an improved version of the Ridge regression method [56]. The equations of this algorithm are given in Equations (5) and (6) below.
for this equation, K is the kernel function of the algorithm, and Ɛ is the weight, which is calculated as: In this equation, the regularization parameter is µ, and the identity matrix is l,y = (y 1 , y 2 , … , y n ) T .

Elastic Net
In this method, regularization parameters (µ) come from LASSO and Ridge algorithms. Hyperparameters (a and µl ratio ) of this algorithm are used in the equations below, Equations (7) and (8) [57].

Bayesian Regression
This method has emerged as a result of applying the Bayesian approach to parameter selection in the linear regression algorithm. In this method, if the error values are in a normal distribution, the model parameters can be obtained by examining the previous situation [58].

Artificial Neural Network
The Artificial Neural Network (ANN) is a popular tool for solving regression and classification issues. During the model construction phase, the human brain system structure is emulated [59]. When looking at the model structure, there are three layers: the input layer, the hidden layer, and the output layer. When the layers are investigated, it is discovered that the information generated in each layer is multiplied by weight coefficient w and sent to the next layer [60]. Figure 5 depicts a typical neural network structure.

X-Gradient Boosting Regression
The XGradient Boosting method, introduced by Chen and Guestrin as an improved form of the gradient boosting algorithm, is a decision-tree-based statistical method [61]. The XGBoost is an effective statistical method that can provide accurate and high-speed solutions to data-driven problems [62]. Due to the high efficiency, speed, and flexibility of this method, its use has increased in recent years [63].

Deep Neural Network
In recent years, the Deep Neural Network approach has helped to popularize datadriven solutions in a variety of sectors [64][65][66][67]. Unlike Artificial Neural Networks, the success rate of this technology has grown as the number of layers has increased [68][69][70][71]. The Deep Neural Network approach, which has gained prominence in applications like image recognition and cyber security, has also demonstrated its effectiveness in regression problems [72][73][74]. Figure 6 depicts a typical Deep Neural Network structure.

K-Fold Cross-Validation
K-Fold Cross-Validation was used as the validation method to verify the success of the algorithm in estimating and detecting the overfitting problem [75]. As can be seen in Figure 7, the data set is divided into five equal parts. One of these parts was used for validation, one was used as test data, and the other three were used as training data [76]. The process continues until all data in the data set is processed. The average of the results obtained from the operations performed was taken as the validation score [77].

Error Metrics
In this study, error metrics were used to evaluate the success of machine learning algorithms in the evaluation phase [78]. Mean Absolute Error (MAE), Root Mean Squared Error (RMSE), and Coefficient of Determination (R 2 ) are error metrics used to evaluate the success of algorithms.

a. Root Mean Squared Error
One measure of the difference between the real values in the data set and the values predicted by the algorithms is called Root Mean Squared Error (RMSE) [79]. The calculation of the RMSE error metric is given in Equation (9): (9) In this equation, A is the actual value, and P is the predicted value.

b. Mean Absolute Error
The measure of the absolute value of the distance between the real values in the data set and the values predicted by the algorithms is called Mean Absolute Error (MAE) [80]. The calculation of the MAE error metric is shown in Equation (10): where, A is the actual and P is the predicted data. c.

Coefficient of Determination
Another measure of the distance between predicted values and actual values is called the Coefficient of Determination (R 2 ) [81]. The equation for calculating R 2 is given below (11): In this equation, A is the actual value, P is the predicted value, and k is the mean of the actual values.

Case Study
In this study, the main engine shaft power and fuel consumption were estimated using Python 3.7.7 and the Spyder 4.1.5 interface in the TensorFlow 2.0 environment. The data set is divided into training and test data in research that uses data-driven methodologies. Depending on the size of the data collection, the ratio between training and test data sets may change because this ratio is commonly employed in research in this field [45,80,82]. To be consistent with the literature, it was decided to utilize this ratio in this study. The computer randomly selected the dataset (700 days) for the calculation of shaft power using machine learning methods and divided it into two parts: training (2/3) and test data (1/3). The computer was taught 467 days of voyage data as training data, and the models assessed the vessel's shaft power and fuel consumption variables in 233 days of voyage data (test data). To compare algorithm success, three alternative error metric approaches were utilized.

Simulation Results
As a result of the predictions, which are utilized as error metrics produced to determine the success of the algorithms, some of the algorithms did not generate the required results at the start of the prediction stage, according to the error metric values (RMSE, MAE, and R 2 ). The failing algorithms' hyperparameters were tuned using the 'Grid Search' approach for the prediction process. Tuned hyperparameters illustrated in Table  2. To define an overfitting condition and validate algorithms, the K-Fold Cross Validation method is applied. One part of the data set was used as test data, one part was used as validation data, and the remaining three parts were used as training data. This procedure was repeated until all of the data in the data set had been processed (5 iterations). The mean MAE error metric values found in all iterations were averaged, and the average validation score was determined when the 5 th iteration was completed.

Method
Hyperparameter Tables 3 and 4 exhibit cross-validation findings, whereas Tables 5 and 6 reveal the  error metric values for the primary findings, and Tables 7 and 8 show the final findings for the case studies. After the power estimation and fuel consumption, the MAE, R 2 and RMSE error metrics were determined. In Figures 8 and 9, 30 days of data were randomly picked from 233 days of test data, and the predictions generated by the algorithms were plotted to evaluate the prediction success of machine learning algorithms. Figures 8 and 9 provide comparison graphs of estimated and real power and fuel consumption.

Conclusions and Discussion
In maritime industries, data-driven algorithm techniques have been employed in areas such as wind speed, wave height, wind direction, ship detection, wave direction, ship speed, and ship fuel consumption. In this study, nine different data-driven algorithms were effective in estimating the container vessel's main engine power and fuel consumption. In this study, the methods that were determined to be frequently used in the literature were examined first, then methods other than the classical algorithms that were thought to improve the novelty of the study were added, and finally, a different approach, such as DNN, was tried for this specific case. These methods also enriched and added to the research's originality. This investigation employed real voyage data, and a feasible approach is proposed for determining the main engine power and fuel consumption variables required in energy efficiency calculations via utilizing the real dataset rather than complicated formulas. For power prediction, simulations revealed that the Deep Neural Network technique outperformed other systems. The Multiple Linear Regression approach, on the other hand, performed better in the situation of fuel consumption. These findings demonstrated that data-driven algorithms could accurately forecast the main engine shaft power and fuel consumption in ships.
Error metrics are a quantified expression of how close the estimates are to the actual values. This way, the prediction successes of the algorithms used can be compared, and studies can be made to develop the models. Three different error metrics were used to determine the success of the models created in this study. The error metric values obtained from the simulations (Tables 5 and 6) and the effect of the parameter optimization process's impacts on the models' performance are discussed below.
When Tables 5 and 6 are compared to Tables 7 and 8, it is clear that the algorithms do not produce satisfactory results in the first simulations. Therefore, for simulations related to power estimation, while the Ridge achieved 1. Similarly, when the fuel consumption estimation simulation results are examined, the algorithms can be said to have produced more successful results after the parameter tuning process.
When the study is evaluated in terms of limitations, the data set cannot be obtained in real-time due to maritime industry conditions and does not consist of many samples. If the dataset contains a much larger number of samples, more powerful models can be built. Furthermore, the difficulty of obtaining instant data from commercial ships making intercontinental voyages with current maritime technology stands out as a problem that must be solved in the coming years. When this issue is resolved, the use of real-time applications in maritime industries can be expanded. In this way, real-time power and fuel consumption estimation and optimization studies can be performed with data-driven approaches.
Container ships cruise 200-250 days per year on active voyages, and their commercial life varies depending on maintenance conditions but is normally between 30 and 40 years.
The information gathered for this study represents around 10% of the ship's commercial life. As these technologies become more frequently employed, the number and descriptiveness of data sets will grow even more, which is promising for the marine sector. The dataset comprised a variety of situations in which the ship's propulsion power and fuel consumption were estimated based on the ship's encounters in these severe conditions, and it was proven that these variables could even be calculated based on the ship's encounters in these extreme conditions. To improve the model's reliability and comprehensibility in future studies, the number and types of vessels will be expanded. Furthermore, by applying data-driven methodologies for load prediction in the generators employed onboard, the ship's electrical load can be accurately examined, and faults in the generators may be averted in advance.