2. 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 white-box 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;
Section 2.1 and
Section 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.
2.1. 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.
2.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.
2.3. Model Development and Prediction
2.3.1. 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].
where
are coefficients, y is the dependent variable, and
are independent variables. In this method,
(coefficients) are calculated as
2.3.2. 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 (
) are found with the following, Equation (3).
In this equation,
is a regularisation hyperparameter [
54].
2.3.3. 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
. The equation for finding the coefficient with this method is given below (4).
2.3.4. 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 ,)T.
2.3.5. Elastic Net
In this method, regularization parameters (
) come from LASSO and Ridge algorithms. Hyperparameters (
and
) of this algorithm are used in the equations below, Equations (7) and (8) [
57].
2.3.6. 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].
2.3.7. 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.
2.3.8. 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].
2.3.9. Deep Neural Network
In recent years, the Deep Neural Network approach has helped to popularize data-driven 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.
2.4. Validation and Evaluation
2.4.1. 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].
2.4.2. 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.
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):
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.
2.5. 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.
3. 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 5th iteration was completed.
Table 3 and
Table 4 exhibit cross-validation findings, whereas
Table 5 and
Table 6 reveal the error metric values for the primary findings, and
Table 7 and
Table 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
Figure 8 and
Figure 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.
Figure 8 and
Figure 9 provide comparison graphs of estimated and real power and fuel consumption.
4. 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 (
Table 5 and
Table 6) and the effect of the parameter optimization process’s impacts on the models’ performance are discussed below.
When
Table 5 and
Table 6 are compared to
Table 7 and
Table 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.237432 RMSE, 1.512512 MAE, and 0.659222 R
2 values in the initial simulations, parameter optimization resulted in error metric values of 0.500782 RMSE, 0.517583 MAE, and 0.999965 R
2. When the Lasso is analyzed, 1.264545 RMSE, 1.127521 MAE, and 0.775724 R
2 can be obtained as a result of the first simulations, while these values are updated as 0.299883 RMSE, 0.260465 MAE, and 0.999971 R
2 after parameter optimization. In the first simulations, the error metric values that were 0.009053 RMSE, 0.095750 MAE, and 0.993211 R
2 in the XGradient Boosting model reached 0.129474 RMSE, 0.114669 MAE, and 0.999871 R
2. If a comparison is made for the Elastic Net method; It can be said that the values of 1.203749 RMSE, 1.097155 MAE, 0.647199 R
2 reached 0.082140 RMSE, 0.154781 MAE, 0.999991 R
2. When the ANN algorithm’s performance values before and after optimization are compared, it can be seen that the values of 0.801357 RMSE, 0.892518 MAE, and 0.703928 R
2 have been updated to 0.001547 RMSE, 0.001621 MAE, and 0.999992 R
2. When the simulation results of the DNN algorithm are compared, it can be said that the error metric values of 0.684111 RMSE, 0.827112 MAE, and 0.724955 R
2 reached 0.000001 RMSE, 0.000987 MAE, and 0.999999 R
2. 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.