# Energy Consumption Optimization of Inland Sea Ships Based on Operation Data and Ensemble Learning

Authors: Jianjie Gao; Mingli Chi; Zhihui Hu
Journal: Mathematical Problems in Engineering
 (2022)

---

## Abstract

Global warming, environmental pollution, and the soaring cost of energy consumption for ships have drawn the attention of the International Maritime Organization and the shipping industry. By reducing the energy consumption of ships, the greenhouse gas emissions and operating costs of ships can be effectively reduced simultaneously. However, current research on the ship energy consumption optimization based on operating mode is mainly focused on route and speed optimization and less on trim optimization, but ship trim is also an important factor affecting energy consumption. Therefore, this study proposed a ship trim optimization method based on operational data and ensemble learning to achieve energy savings and emission reductions for inland sea ships. First, data processing and feature selection of operational data from an inland ro-ro passenger ship were undertaken. Second, the energy consumption prediction models were established based on ensemble learning. Finally, the trim optimization model was developed by combining the energy consumption model with the best prediction performance and enumeration method. Experimental results show that compared with linear regression, neural networks, and support vector machines, ensemble learning methods have better prediction performance in energy consumption modeling, and the extra tree (ET) model has the best prediction performance. With the trim optimization, the energy consumption and carbon emissions of a ro-ro passenger ship can be reduced by 1.4641%, which is conducive to the green and low-carbon navigation of ships.


---

## Body

## 1. Introduction

Maritime trade accounts for approximately 90% of global trade [1]. However, with the continuous increase in fuel prices and the widespread use of heavy fuel oil, serious challenges such as soaring operating costs and abundant pollution gas emissions have emerged [2]. On the one hand, fuel price continued to rise, with an average annual increase of 16% over the last decade [3]. Therefore, an increase in fuel prices inevitably leads to an increase in maritime trade operating costs. For example, the fuel costs of tankers and container ships can account for 50% or more of the total operating costs [4]. On the other hand, although ship transportation is an efficient and cheap means of transportation, its greenhouse gas emissions have also subsequently increased in the past few decades, contributing to global warming and air pollution [5]. In 2012, the carbon emissions of shipping accounted for 2.6% of the total global carbon emissions, approximately 938 million tons, which is expected to increase by 50% to 250% by 2050 if appropriate control measures are not taken [6].Soaring operating costs and environmental problems have prompted the International Maritime Organization (IMO), governments, and ship owners to pay more attention to the issue of ship energy saving and emission reduction from shipping. The operating costs of ships and greenhouse gas emissions can be reduced simultaneously by reducing the energy consumption per unit time or distance of ships. Therefore, the IMO issued a series of regulations to reduce energy consumption in shipping, including the Guidelines for Voluntary Use of Energy Efficiency Operational Indicator (EEOI) [7], Energy Efficiency Design Index (EEDI) [8], and Ship Energy Efficiency Management Plan (SEEMP) [9]. The EEOI and SSEMP were applied to all ships, whereas the EEDI was only applied to newly built ships. The purpose of the above IMO regulations is to reduce the energy consumption and greenhouse gas emissions of ships. In 2015, the IMO formulated a three-step strategy for ship energy conservation and emission reduction, which included energy consumption data collection, data analysis, optimization, and decision support [10].It is difficult to establish energy consumption prediction and optimization models with high accuracy to achieve the purpose of energy conservation and emission reduction of ships. In ship energy consumption prediction modeling, Bocchetti et al. [11] used multiple linear regressions to model ship energy consumption and subsequently obtained a fitted equation for ship energy consumption per unit time versus speed. Soner et al. [12] used the least absolute shrinkage and selection operator (LASSO) and the Ridge methods to model the ship energy consumption. Owing to the feature compression properties of the LASSO and Ridge regression, their predictive performance (generalization ability) is generally better than that of a normal linear regression. In addition, owing to the powerful nonlinear fitting capability of neural networks, this class of methods has good predictive performance in modeling ship energy consumption [13–16]. With the continuous development of ship energy consumption research and intelligent algorithms, ensemble learning methods are also being used to model energy consumption, and they usually have better predictive performance than state-of-the-art methods [17, 18]. The above research only established prediction models of ship energy consumption and did not carry out in-depth energy consumption optimization research.The accurate prediction of ship energy consumption is only the first step, and the key to achieving energy saving and emission reduction is the establishment of an energy consumption optimization model. Currently, there are two main methods to optimize ship energy consumption: technical means and operation modes [19]. From a technical perspective, the methods to optimize shipping energy consumption include updating the propeller, optimizing the ship size and shape, using lightweight materials, selecting an efficient propulsion system, and using wind energy [19, 20]. The technical means are applicable in new ships; however, they are difficult to realize for existing ships. In terms of the operation mode, there are three main ways to optimize ship energy consumption: route optimization [21, 22], speed optimization [23–26], and trim optimization [27, 28]. Route optimization involves finding the route with the minimum operating cost or minimum energy consumption by combining meteorological, sea conditions, and other information to ensure the shipping safety. Gkerekos and Lazakis [21] established a data-driven energy consumption prediction model, which obtained five optimal routes using the Dijkstra algorithm to optimize the routes with the minimum total energy consumption as the goal. Lu et al. [22] proposed a ship semi-empirical energy consumption prediction model, which uses a grid search algorithm for route optimization to achieve the purpose of energy saving and emission reduction and can reduce energy consumption by up to 11%. Speed optimization reduces ship energy consumption by adjusting the speed of the route section. Bouman et al. [23] summarized and analyzed various energy-saving and emission reduction measures for ships and found that the energy-saving effect of ship speed optimization was between 1% and 60%, which is an effective energy-saving measure. Zhou et al. [24] established a dynamic speed optimization model using a particle swarm optimization algorithm and obtained an energy-saving effect of 4.38% through a simulation experiment. To reduce the ship’s energy consumption, Wang et al. [25] and Du et al. [26] optimized the ship’s speed to minimize energy consumption and achieved good energy-saving results.Compared with route and speed optimization, there are few studies on trim optimization [29]. However, trim is also an important factor that affects the energy consumption of ships. After trim optimization, the energy consumption of ships can be effectively reduced by 2%-3% and up to 15% under certain conditions [30]. Research on trim optimization is currently mainly based on simulation models (computational fluid dynamics) that simulate the ship running state in still water; however, it is difficult to take into account weather and sea conditions. Therefore, the applicability of the simulation results to real marine environments remains to be verified [27, 28]. In addition, the time cost of the simulation experiment is high, and the real-time performance is poor [31]. The large collection of ship energy consumption data and the continuous development of intelligent algorithms provide new opportunities for ship trim optimization. In addition, the use of data-driven methods for trim optimization can effectively consider complex marine environments. Du et al. [26] and Hu et al. [32] developed trim optimization models to obtain energy savings based on the energy consumption data of ocean-going ships and data-driven methods.Based on the above discussion, it is important to establish a highly accurate ship energy consumption prediction and optimization model for energy conservation and reduction of emissions in the shipping industry. Therefore, based on the operational data and the ensemble learning method, a highly accurate energy consumption prediction model is established in this study. Subsequently, from the perspective of trim, the energy consumption of an inland ro-ro passenger ship is optimized to obtain the energy savings and emission reductions for inland sea ships. The main contributions of this study are as follows:(1)
A high-precision energy consumption prediction model was established. A variety of mainstream methods (ensemble learning, neural networks, linear regression, and support vector machines) were used to model the ship’s energy consumption. The prediction performance was then compared to obtain the algorithm with the best prediction performance, which was used to establish the energy consumption model and provide model support for the following energy consumption optimization.(2)
A data-driven trim optimization model was established. From the perspective of the operation mode, current research on ship energy consumption optimization methods mainly focuses on route and speed optimization methods, and few involve trim optimization. In addition, research on trim optimization is mainly based on simulation methods, which make it difficult to consider marine environmental factors and high experimental costs. In this study, a ship trim optimization model was established based on a data-driven method to reduce ship energy consumption and greenhouse gas emissions.(3)
A model for energy conservation and reduction of emissions for inland waterway ships was developed. Currently, the research focus of trim optimization is on ocean-going ships; thus, there is no effective research on inland ships. However, research on fuel savings and emission reduction of inland sea ships is more meaningful for human health and port environment protection. Therefore, this study considers an inland ro-ro passenger ship to explore the potential of trim optimization of inland sea ships for energy conservation and emission reduction.The remainder of this study is organized as follows. Section2 describes data processing, energy consumption prediction, and trim optimization modeling of an inland ro-ro passenger ship. Section 3 describes the model’s application and processes in real cases. Section 4 presents the experimental results and discussion, and Section 5 presents conclusions and future work.


## 2. Materials and Methods

### 2.1. Energy Consumption Data Source

The data on ship energy consumption were obtained from the Danish ro-ro passenger ship (MS Smyril) public dataset [33]. The MS Smyril has a length of 135 m, a ship width of 22.7 m, a design draft of 5.6 m, and four 3,360 kW main engines (Figure 1). The system collects data from the following sensor devices: the Doppler speed log, gyrocompass, Global Positioning System (GPS), main energy pipe flow meter, rudder angles, wind, propeller pitches, inclinometer, and level measurement device. The dataset was collected from February to April 2010, with a total of 246 voyages and 1,627,324 data records. The data samples are shown in Table 1.Figure 1
MS Smyril [33].Table 1
Samples of raw data from MS Smyril.
TimestampED (kg/L)EVFR (L/s)Speed (kn)…WS (m/s)WA (°)6340192129458200000.93820.27920.9…0.83526340192129560340000.93800.28280.9…0.93536340192129662680000.93800.28091.1…0.93516340192129764920000.93780.27991.1…0.93506340192129866960000.93760.27201.2…0.9354…………………ED, energy density; EVFR, energy volume flow rate; WS, wind speed; WA, wind angle.


### 2.2. Energy Consumption Prediction Modeling

#### 2.2.1. Energy Consumption Prediction Modeling Based on Ensemble Learning

Ensemble learning involves solving the inherent defects in a single model or a model with certain sets of parameters. The goal is to improve the generalization and robustness of a single model by combining the predictions of multiple base learners.A decision tree (DT) is a nonparametric supervised learning method for regression [34]. It is composed of decision and leaf nodes based on the features and goals. The aim of this study is to develop a model that can predict the target variable value using simple decision rules.The basic principle of the DT is as follows: assumingX and Y are the input and output variables, respectively, the given training dataset D=x1,y1,x2,y2,…,xN,yN, xi=xi1,xi2,…,xin is the input instance (eigenvector), n is the number of features, i=1,2,…,N, and N is the sample size. In the input space where the training dataset is located, each region is recursively divided into two subregions, and the output value of each subregion is determined to build a binary decision tree.Step 1. The optimal segmentation variable j and segmentation point s were selected, and then the objective function was solved.(1)∑xi∈R1j,syi−c12c1min+∑xi∈R2j,syi−c22c2min,j,sminwhereR1j,s=x|xj≤s, R2j,s=x|xj>s, c1=1/N1∑xi∈R1j,syi, and c2=1/N21∑xi∈R2j,syi. Variable j is traversed, fixed segmentation variable j is scanned at segmentation point s, and the pair j,s is selected to minimize the above formula.Step 2. Regions with certain j,s were divided and the corresponding output values were determined.(2)cm^=1Nm∑xi∈Rmj,syi,x∈Rm,m=1,2.Step 3. Steps 1 and 2 were continually called on the two subregions until the stop condition was met.Step 4. The input space is divided into M areas, R1, R2, …, Rm, and the DT is then generated.(3)fx=∑m=1Mcm^Ix∈Rm,where I is the indicator function, I=1ifx∈Rm0ifx∉Rm.Figure2 illustrates a DT in the DT model to clearly understand the calculation principle of a single decision tree.Figure 2
Visualization of decision trees.Random forest (RF) is a bagging ensemble method based on the decision tree proposed by Breiman to solve classification and regression problems [35, 36]. The ensemble principle of RF is to first build multiple decision trees (estimators), independently and in parallel and then use each decision tree to predict the target characteristics independently. The average of the prediction results of all decision trees was considered the output predicted by the RF.Extra tree (ET) was proposed by Pierre Geurts in 2006 and is very similar to RF [37]. However, there are two main differences between ET and RF. First, RF randomly selects samples, whereas ET uses all the training samples to obtain each decision tree. Second, RF obtains the best bifurcation attribute in a random subset, whereas ET obtains the bifurcation value randomly. Therefore, ET usually has a better generalization ability.XGBoost (XGB) is a boosting algorithm that integrates many tree models [38]. The idea is to add trees continuously and to continuously split the features to grow a tree. Each time a tree is added, a new function is learned to fit the last predicted residual. The score value of a sample can be predicted when training is completed, and k trees are obtained. This can be achieved by summing the scores on each leaf node corresponding to the characteristics of the sample.


#### 2.2.2. Evaluation Metrics

To analyze and compare the predictive performance of different models, formulas (4)–(8) were used as evaluation metrics. These metrics are the coefficient of determination (R2), root mean square error (RMSE), mean absolute error (MAE), mean absolute percentage error (MAPE), and running time (T).(4)R2=1−∑t=1kyt−yt^2∑t=1kyt−y¯2,(5)RMSE=1k∑t=1kyt−yt^2,(6)MAE=1k∑t=1kyt−yt^,(7)MAPE=100%k∑t=1kyt−yt^yt,(8)T=Te−Ts,where yt is the real value of the ship daily energy consumption, yt^ is the predicted value of the ship daily energy consumption, y¯ is the mean of real values, k is the total number of samples, and Ts and Te indicate the timestamp of the start and end of the model.According to formula (4), the higher the R2 value of the model, the better the prediction accuracy. In addition, Since RMSE, MAE, and MAPE indicators measure the prediction error of the model, the lower their values, the better the prediction performance of the model. The T value is only used to measure whether the model meets the real-time prediction requirements.


### 2.3. Trim Optimization

The main objective of this study was to reduce the energy consumption and carbon emissions of ships through a trim optimization method. Subsequently, a data-driven trim optimization model is established in this section. In a specific marine environment, for a given speed and draft, there is always a corresponding trim value to minimize the energy consumption per unit time of the ship under the current working conditions, and this value is the optimal trim value [32]. Therefore, combined with the established prediction model of the ship’s energy consumption and enumeration method, the trim value corresponding to the minimum value of ship energy consumption under specific navigation conditions, the optimal trim value, is mined. Simultaneously, the trim value should be limited to a reasonable range to ensure the safe navigation of the ship. The equations are(9)t=t1,t2,…,tntrimmin≤ti≤trimmax,ti∗=fiti∈targminti,where ti∗ is the ship optimal trim value, f is the predicted model, t1,t2,…,tn is a set of trim values obtained by enumeration, and trimmin and trimmax are the minimum and maximum trim values, respectively.To understand the trim optimization model more intuitively and clearly, a schematic diagram is given, as shown in Figure3. First, to ensure the safety of ship navigation, the trim value optimization range needs to be limited. From the schematic diagram, the minimum value of the trim is –1 and the maximum value is 1. Moreover, the trim values are enumerated at an interval of 0.1, and a total of 21 different trim values are obtained. Secondly, the energy consumption prediction model was used to predict the energy consumption values under different trim states (blue points), from which the minimum energy consumption value and the corresponding optimal trim value (green point) were mined. Finally, the energy-saving ratio (ESR) obtained after trim optimization is obtained, and the equation is as follows:(10)ESR=y3−y1y3∗100%,where y1 is the energy consumption value after trim optimization and y3 is the real energy consumption value.Figure 3
Mining of ship optimal trim value.There are two main methods of ship trim adjustment: cargo stowing adjustment and adjustment of the ballast water position or weight. As this study is a dynamic trim optimization, its purpose is to study the energy-saving potential of dynamic trim optimization, which is adjusted once every 3 min. Currently, it is difficult to match this frequency with trim adjustment technology. Therefore, the following assumptions were made.The adjustment of ship trim status can realize real-time response without a delay and without technical limitations.


## 2.1. Energy Consumption Data Source

The data on ship energy consumption were obtained from the Danish ro-ro passenger ship (MS Smyril) public dataset [33]. The MS Smyril has a length of 135 m, a ship width of 22.7 m, a design draft of 5.6 m, and four 3,360 kW main engines (Figure 1). The system collects data from the following sensor devices: the Doppler speed log, gyrocompass, Global Positioning System (GPS), main energy pipe flow meter, rudder angles, wind, propeller pitches, inclinometer, and level measurement device. The dataset was collected from February to April 2010, with a total of 246 voyages and 1,627,324 data records. The data samples are shown in Table 1.Figure 1
MS Smyril [33].Table 1
Samples of raw data from MS Smyril.
TimestampED (kg/L)EVFR (L/s)Speed (kn)…WS (m/s)WA (°)6340192129458200000.93820.27920.9…0.83526340192129560340000.93800.28280.9…0.93536340192129662680000.93800.28091.1…0.93516340192129764920000.93780.27991.1…0.93506340192129866960000.93760.27201.2…0.9354…………………ED, energy density; EVFR, energy volume flow rate; WS, wind speed; WA, wind angle.


## 2.2. Energy Consumption Prediction Modeling

### 2.2.1. Energy Consumption Prediction Modeling Based on Ensemble Learning

Ensemble learning involves solving the inherent defects in a single model or a model with certain sets of parameters. The goal is to improve the generalization and robustness of a single model by combining the predictions of multiple base learners.A decision tree (DT) is a nonparametric supervised learning method for regression [34]. It is composed of decision and leaf nodes based on the features and goals. The aim of this study is to develop a model that can predict the target variable value using simple decision rules.The basic principle of the DT is as follows: assumingX and Y are the input and output variables, respectively, the given training dataset D=x1,y1,x2,y2,…,xN,yN, xi=xi1,xi2,…,xin is the input instance (eigenvector), n is the number of features, i=1,2,…,N, and N is the sample size. In the input space where the training dataset is located, each region is recursively divided into two subregions, and the output value of each subregion is determined to build a binary decision tree.Step 1. The optimal segmentation variable j and segmentation point s were selected, and then the objective function was solved.(1)∑xi∈R1j,syi−c12c1min+∑xi∈R2j,syi−c22c2min,j,sminwhereR1j,s=x|xj≤s, R2j,s=x|xj>s, c1=1/N1∑xi∈R1j,syi, and c2=1/N21∑xi∈R2j,syi. Variable j is traversed, fixed segmentation variable j is scanned at segmentation point s, and the pair j,s is selected to minimize the above formula.Step 2. Regions with certain j,s were divided and the corresponding output values were determined.(2)cm^=1Nm∑xi∈Rmj,syi,x∈Rm,m=1,2.Step 3. Steps 1 and 2 were continually called on the two subregions until the stop condition was met.Step 4. The input space is divided into M areas, R1, R2, …, Rm, and the DT is then generated.(3)fx=∑m=1Mcm^Ix∈Rm,where I is the indicator function, I=1ifx∈Rm0ifx∉Rm.Figure2 illustrates a DT in the DT model to clearly understand the calculation principle of a single decision tree.Figure 2
Visualization of decision trees.Random forest (RF) is a bagging ensemble method based on the decision tree proposed by Breiman to solve classification and regression problems [35, 36]. The ensemble principle of RF is to first build multiple decision trees (estimators), independently and in parallel and then use each decision tree to predict the target characteristics independently. The average of the prediction results of all decision trees was considered the output predicted by the RF.Extra tree (ET) was proposed by Pierre Geurts in 2006 and is very similar to RF [37]. However, there are two main differences between ET and RF. First, RF randomly selects samples, whereas ET uses all the training samples to obtain each decision tree. Second, RF obtains the best bifurcation attribute in a random subset, whereas ET obtains the bifurcation value randomly. Therefore, ET usually has a better generalization ability.XGBoost (XGB) is a boosting algorithm that integrates many tree models [38]. The idea is to add trees continuously and to continuously split the features to grow a tree. Each time a tree is added, a new function is learned to fit the last predicted residual. The score value of a sample can be predicted when training is completed, and k trees are obtained. This can be achieved by summing the scores on each leaf node corresponding to the characteristics of the sample.


### 2.2.2. Evaluation Metrics

To analyze and compare the predictive performance of different models, formulas (4)–(8) were used as evaluation metrics. These metrics are the coefficient of determination (R2), root mean square error (RMSE), mean absolute error (MAE), mean absolute percentage error (MAPE), and running time (T).(4)R2=1−∑t=1kyt−yt^2∑t=1kyt−y¯2,(5)RMSE=1k∑t=1kyt−yt^2,(6)MAE=1k∑t=1kyt−yt^,(7)MAPE=100%k∑t=1kyt−yt^yt,(8)T=Te−Ts,where yt is the real value of the ship daily energy consumption, yt^ is the predicted value of the ship daily energy consumption, y¯ is the mean of real values, k is the total number of samples, and Ts and Te indicate the timestamp of the start and end of the model.According to formula (4), the higher the R2 value of the model, the better the prediction accuracy. In addition, Since RMSE, MAE, and MAPE indicators measure the prediction error of the model, the lower their values, the better the prediction performance of the model. The T value is only used to measure whether the model meets the real-time prediction requirements.


## 2.2.1. Energy Consumption Prediction Modeling Based on Ensemble Learning

Ensemble learning involves solving the inherent defects in a single model or a model with certain sets of parameters. The goal is to improve the generalization and robustness of a single model by combining the predictions of multiple base learners.A decision tree (DT) is a nonparametric supervised learning method for regression [34]. It is composed of decision and leaf nodes based on the features and goals. The aim of this study is to develop a model that can predict the target variable value using simple decision rules.The basic principle of the DT is as follows: assumingX and Y are the input and output variables, respectively, the given training dataset D=x1,y1,x2,y2,…,xN,yN, xi=xi1,xi2,…,xin is the input instance (eigenvector), n is the number of features, i=1,2,…,N, and N is the sample size. In the input space where the training dataset is located, each region is recursively divided into two subregions, and the output value of each subregion is determined to build a binary decision tree.Step 1. The optimal segmentation variable j and segmentation point s were selected, and then the objective function was solved.(1)∑xi∈R1j,syi−c12c1min+∑xi∈R2j,syi−c22c2min,j,sminwhereR1j,s=x|xj≤s, R2j,s=x|xj>s, c1=1/N1∑xi∈R1j,syi, and c2=1/N21∑xi∈R2j,syi. Variable j is traversed, fixed segmentation variable j is scanned at segmentation point s, and the pair j,s is selected to minimize the above formula.Step 2. Regions with certain j,s were divided and the corresponding output values were determined.(2)cm^=1Nm∑xi∈Rmj,syi,x∈Rm,m=1,2.Step 3. Steps 1 and 2 were continually called on the two subregions until the stop condition was met.Step 4. The input space is divided into M areas, R1, R2, …, Rm, and the DT is then generated.(3)fx=∑m=1Mcm^Ix∈Rm,where I is the indicator function, I=1ifx∈Rm0ifx∉Rm.Figure2 illustrates a DT in the DT model to clearly understand the calculation principle of a single decision tree.Figure 2
Visualization of decision trees.Random forest (RF) is a bagging ensemble method based on the decision tree proposed by Breiman to solve classification and regression problems [35, 36]. The ensemble principle of RF is to first build multiple decision trees (estimators), independently and in parallel and then use each decision tree to predict the target characteristics independently. The average of the prediction results of all decision trees was considered the output predicted by the RF.Extra tree (ET) was proposed by Pierre Geurts in 2006 and is very similar to RF [37]. However, there are two main differences between ET and RF. First, RF randomly selects samples, whereas ET uses all the training samples to obtain each decision tree. Second, RF obtains the best bifurcation attribute in a random subset, whereas ET obtains the bifurcation value randomly. Therefore, ET usually has a better generalization ability.XGBoost (XGB) is a boosting algorithm that integrates many tree models [38]. The idea is to add trees continuously and to continuously split the features to grow a tree. Each time a tree is added, a new function is learned to fit the last predicted residual. The score value of a sample can be predicted when training is completed, and k trees are obtained. This can be achieved by summing the scores on each leaf node corresponding to the characteristics of the sample.


## 2.2.2. Evaluation Metrics

To analyze and compare the predictive performance of different models, formulas (4)–(8) were used as evaluation metrics. These metrics are the coefficient of determination (R2), root mean square error (RMSE), mean absolute error (MAE), mean absolute percentage error (MAPE), and running time (T).(4)R2=1−∑t=1kyt−yt^2∑t=1kyt−y¯2,(5)RMSE=1k∑t=1kyt−yt^2,(6)MAE=1k∑t=1kyt−yt^,(7)MAPE=100%k∑t=1kyt−yt^yt,(8)T=Te−Ts,where yt is the real value of the ship daily energy consumption, yt^ is the predicted value of the ship daily energy consumption, y¯ is the mean of real values, k is the total number of samples, and Ts and Te indicate the timestamp of the start and end of the model.According to formula (4), the higher the R2 value of the model, the better the prediction accuracy. In addition, Since RMSE, MAE, and MAPE indicators measure the prediction error of the model, the lower their values, the better the prediction performance of the model. The T value is only used to measure whether the model meets the real-time prediction requirements.


## 2.3. Trim Optimization

The main objective of this study was to reduce the energy consumption and carbon emissions of ships through a trim optimization method. Subsequently, a data-driven trim optimization model is established in this section. In a specific marine environment, for a given speed and draft, there is always a corresponding trim value to minimize the energy consumption per unit time of the ship under the current working conditions, and this value is the optimal trim value [32]. Therefore, combined with the established prediction model of the ship’s energy consumption and enumeration method, the trim value corresponding to the minimum value of ship energy consumption under specific navigation conditions, the optimal trim value, is mined. Simultaneously, the trim value should be limited to a reasonable range to ensure the safe navigation of the ship. The equations are(9)t=t1,t2,…,tntrimmin≤ti≤trimmax,ti∗=fiti∈targminti,where ti∗ is the ship optimal trim value, f is the predicted model, t1,t2,…,tn is a set of trim values obtained by enumeration, and trimmin and trimmax are the minimum and maximum trim values, respectively.To understand the trim optimization model more intuitively and clearly, a schematic diagram is given, as shown in Figure3. First, to ensure the safety of ship navigation, the trim value optimization range needs to be limited. From the schematic diagram, the minimum value of the trim is –1 and the maximum value is 1. Moreover, the trim values are enumerated at an interval of 0.1, and a total of 21 different trim values are obtained. Secondly, the energy consumption prediction model was used to predict the energy consumption values under different trim states (blue points), from which the minimum energy consumption value and the corresponding optimal trim value (green point) were mined. Finally, the energy-saving ratio (ESR) obtained after trim optimization is obtained, and the equation is as follows:(10)ESR=y3−y1y3∗100%,where y1 is the energy consumption value after trim optimization and y3 is the real energy consumption value.Figure 3
Mining of ship optimal trim value.There are two main methods of ship trim adjustment: cargo stowing adjustment and adjustment of the ballast water position or weight. As this study is a dynamic trim optimization, its purpose is to study the energy-saving potential of dynamic trim optimization, which is adjusted once every 3 min. Currently, it is difficult to match this frequency with trim adjustment technology. Therefore, the following assumptions were made.The adjustment of ship trim status can realize real-time response without a delay and without technical limitations.


## 3. Method Application

In this section, the real-time energy consumption prediction and trim optimization of a ro-ro passenger ship are proposed and applied.The methodology for the application of the ship energy consumption prediction and trim optimization is shown in Figure4. The following steps were performed:(1)
Characteristic data relating to the energy consumption of ro-ro passenger ships were collected.(2)
Combined with domain knowledge, feature transformation was performed on the collected data, and Bayesian information criterion (BIC) and RF were used for feature selection.(3)
After data processing, the ship’s energy consumption data were divided into training and test sets. The training set was used to train the models, and the test set was used to verify the prediction performance of the models.(4)
Eight different models (ET, XGB, RF, DT, artificial neural network (ANN), support vector machine (SVM) [39], ridge, and multiple linear regression (MLR) [40]) were trained using the training set, and their performance was tested in the test set.(5)
The performance metrics of each model were compared, and the best model was selected for ship trim optimization modeling.(6)
The ship trim optimization model established can determine the optimal trim value under different speed and draft conditions in real-time complex sea conditions and then guide the crew to drive the ro-ro passenger ship with the best navigation attitude to conserve energy and reduce emissions.Figure 4
Prediction and optimization of ship energy consumption for MS Smyril.


## 4. Results and Discussion

Section2.1 displayed that the energy consumption dataset of inland ro-ro passenger ships was derived from various sensors. Therefore, before energy consumption prediction and optimization modeling, a series of relevant data processing steps, including feature data acquisition frequency synchronization, feature transformation, and feature selection, were required to be undertaken on the energy consumption data to further improve the feasibility and accuracy of the models. Petersen processed the data accordingly for convenience [33]. First, the dataset was averaged over a 3 min time window, and the equation is as follows:(11)Ωmeanw=1M∑n=0Mxn,where w is a window identifier, M is the number of samples within the window, and xn is the number of samples (n is its index) from the selected input signal within a window. After the mean processing, 9,001 data points were retained.The wind direction and wind speed were converted into balanced wind speed and vertical wind speed relative to the ship’s direction of movement, using the following equations:(12)Vhw=Vwind.cosθws,Vcw=Vwind.sinθws,where Vhw and Vcw provide the equivalent headwind and crosswind, respectively, given the wind speed Vwind and the angle between wind direction and ship direction θws.Petersen’s research focused on the energy volume flow rate (EVFR); however, the energy density (ED) varies at different temperatures, resulting in the same volume of energy weight being different at different temperatures [33]. To overcome this, this study considers the use of the daily energy consumption (EC) using the following equation:(13)EC=ED×EVFR×3600×241000.After the above data processing, the characteristics of the obtained energy consumption dataset include daily energy consumption, speed, trim, draft, port pitch, starboard pitch, port rudder, starboard rudder, port level, starboard level, head wind, cross wind, longitude, and latitude. However, some features collected here contribute little to the prediction of daily energy consumption. To reduce the complexity of subsequent energy consumption modeling and avoid the risk of an overfitting model, it is necessary to screen the features of the energy consumption data. The Bayesian information criterion (BIC) is a discriminant criterion based on Bayesian theory, which can effectively prevent model complexity from being too high [41]. Therefore, it is often used for feature selection, and this study adopts this method for feature screening, which is expressed as follows:(14)BIC=lnNK−2lnL,where L is the likelihood function, N is the sample size, and K is the number of arguments.After the BIC characteristic treatment, the speed, trim, draft, port pitch, starboard pitch, port rudder, starboard rudder, and head wind were retained. In addition, a RF is used to quantitatively calculate the importance of features [42, 43], and the results are shown in Figure 5. As shown in the figure, starboard pitch, port pitch, speed, trim, and headwind have high feature importance values, indicating that they are of high importance to energy consumption modeling, which is consistent with the results of the BIC method. Moreover, latitude and longitude are also important to a certain extent, mainly because of the different marine environments at different locations, which have an impact on the ship’s energy consumption [44]. Therefore, the latitude and longitude characteristics should not be considered when modeling energy consumption. Simultaneously, ship port rudder, draft, starboard rudder, and crosswind also have a certain importance. Overall, for daily energy consumption, starboard pitch, port pitch, speed, trim, headwind, port rudder, draft, and starboard rudder, a total of nine features were retained. Daily energy consumption is the output variable of the models, and the other features are the input variables.Figure 5
Feature importance of MS Smyril.The data distribution for each feature is shown in Figure6. The MS Smyril was observed to consume approximately 30 t of energy daily, and the speed was mainly approximately 18–20 kn. Most of the trim values were negative, indicating that the MS Smyril is often in the state of the bow. The value distributions of the port-pitch and starboard-pitch were almost the same at 80%–90%. The values of the port-rudder and starboard-rudder were 0, which was because the ship seldom changed direction frequently during navigation. The ship draft varied within a small range of less than 1 m, which was a typical feature of ro-ro passenger ships.Figure 6
Visualization of relevant characteristic data of energy consumption.
(a)(b)(c)(d)(e)(f)(g)(h)(i)The following experiments were performed on a Windows 10 PC with Spyder 3 software. The establishment of a high-accuracy prediction model for ship energy consumption is an important basis for trim optimization. Therefore, advanced ensemble learning methods (ET, XGB, RF, and DT) were applied to ship energy consumption prediction modeling in this study and compared with the mainstream energy consumption modeling methods (MLR, Ridge, SVM, and ANN). Next, the training set could be obtained by randomly selecting 80% of the samples from the energy consumption dataset, with the remaining 20% as the test set. In addition, the dataset was randomly divided 10 times, and the average performance of the model was taken as the final value.


### 4.1. Comparison of Prediction Performance of Different Energy Consumption Models

The predictive performance of some models can be degraded owing to the inconsistent range of the different eigenvalues of the ship’s energy consumption. Therefore, in this study, the effects of energy consumption data standardization on the predictive performance of the models were compared, as shown in Figure7. Considering the RMSE performance value as an example, data standardization had no influence on the prediction performance of the MLR and Ridge models; however, it can greatly improve the SVM and ANN models’ prediction performance. In addition, the prediction performance of the RF, XGB, and ET models displayed a weak improvement in data standardization; however, it had no influence on the prediction performance of DT and caused a decline in the prediction performance. Therefore, in subsequent experiments, the SVM, ANN, RF, XGB, and ET model datasets will be standardized, while datasets of other models will not be standardized.Figure 7
The effect of data standardization on model performance.To determine the energy consumption model with the best predictive performance for ship trim optimization, this study modeled the ship energy consumption of eight different models and quantitatively evaluated their energy consumption prediction performance using evaluation metrics (R2, RMSE, MAE, MAPE, and T). The performance indicator values for different models are listed in Table 2. This displays that the ensemble learning models have a good prediction performance, with a MAPE value of less than 3, which is consistent with the research conclusions of Li et al. [45] and Du et al. [46, 47]. In addition, the ET model had the best prediction performance, with the highest R2 value and the lowest RMSE, MAE, and MAPE values. Therefore, the ET model was used in the trim optimization research. The ANN and SVM also have good prediction performance, with MAPE values of approximately 3.1, which is why many researchers use ANN as an energy consumption prediction model. The MLR and Ridge had poor prediction performance, and the MAPE value was approximately 12. However, they have become mainstream methods for energy consumption prediction owing to their simple principle and strong interpretation. The time indicator T was used to determine whether the model met the requirements for real-time prediction. It can be seen from the table results that all models can respond at the level of seconds, and the T value (the maximum value is less than 2 s) is less than 3 min. Thus, all models met the real-time prediction requirements.Table 2
Prediction performance values of different energy consumption models.
ModelsR2RMSE (t/day)MAE (t/day)MAPE (%)T (s)ET0.99070.75180.48372.37990.2010XGB0.98910.81140.54652.68040.7847RF0.98820.84600.53412.64630.4634DT0.98810.85000.53592.65470.4620ANN0.98760.86820.62813.12241.7001SVM0.98610.91640.66293.16191.0657Ridge0.85143.00332.223712.07920.0033MLR0.85143.00342.223812.07950.0035


### 4.2. Energy-Saving Effect of Trim Optimization

The ensemble learning models were verified to have a better predictive performance in energy consumption data modeling using the ro-ro passenger ship operation data, and the ET model showed the best predictive performance. Therefore, the ET model was applied to trim optimization research. The application of trim optimization is based on the premise of safety. Therefore, to ensure the navigation safety of ro-ro a passenger ship, it was necessary to limit the range of the trim optimization value. Combined with the 95% confidence of the trim value, the range value is −0.73–0.38, that is,trimmin is −0.73, trimmax was 0.38, and the interval was 0.01. Combined with the 95% confidence of the trim value, the range value was −0.73–0.38, and the interval was 0.01. By combining the proposed trim optimization model and enumeration method, the optimal trim under different sailing conditions could be obtained. For clarity, the first 400 record series, whose optimal and actual trim values are shown in Figure 8, were displayed. It can be seen from the figure that the optimal trim value tends to be more negative, indicating that MS Smyril ships are more conducive to ship energy saving under trim by bow state.Figure 8
Comparison between ship optimal and real trim values.Figure9 shows the real and predicted energy consumption values under the actual trim and optimal trim states. The two broken lines of the real and predicted values were observed which almost completely coincide, indicating that the ET model had high prediction performance. In addition, the broken lines of the optimal value were almost below the real value, indicating that the ship could achieve a level of energy savings after the trim optimization.Figure 9
Comparison of the optimal, predicted, and real energy consumption of the ro-ro passenger ship.For 246 voyages, the real energy consumption (REC) of the ro-ro passenger ship was 549.1655 t (Table3). After the trim optimization, the model results displayed that the energy could be reduced by 8.0405 t, the CO2 emission could be reduced by 25.0381 t (emission factor: 3.114 t CO2/1 t heavy oil), and the energy-saving ratio (ESR) could be reduced by 1.4641%. Trim optimization does not need to change the ship hull structure, reduce the sailing speed, and increase the sailing time; however, a change of the loading position of the ballast water or cargo is required to achieve the energy-saving and emission reduction effects. Therefore, this energy-saving method is worthy of in-depth study and promotion for practical applications.Table 3
Energy-saving and emission reduction effect of trim optimization for MS Smyril.
REC (t)OEC (t)ES (t)CER (t)ESR (%)549.1655541.12508.040525.03811.4641REC, real value of ship energy consumption; OEC, optimal value of ship energy consumption; ES, energy saving; CER, carbon emission reduction; ESR, energy-saving ratio.


### 4.3. Analysis of Energy-Saving Effect of Trim Optimization

The experimental results show that an energy-saving ratio can be achieved after ship trim optimization. However, the obtained energy-saving ratio was only the theoretical value of the model. The energy-saving effect obtained by actual ship operation trim optimization may be lower than the theoretical value. There are two main reasons for this finding.(1)
In the actual operation process, the ship cannot make such frequent trim adjustments (once every 3 min), and it will only adjust the trim condition when the external environment and sailing conditions change significantly. Therefore, in actual operation, the energy-saving ratio obtained for the ro-ro passenger ship using trim optimization will be lower than the theoretical value of the model.(2)
Although the proposed prediction model has a good accuracy, there is still a certain deviation between the predicted and the actual energy consumption values, which lead to uncertainty in the energy-saving results of the optimization model for the ro-ro passenger ship. The uncertainty analysis of the model results in this study is only qualitative and does not involve quantitative uncertainty analysis [48].


## 4.1. Comparison of Prediction Performance of Different Energy Consumption Models

The predictive performance of some models can be degraded owing to the inconsistent range of the different eigenvalues of the ship’s energy consumption. Therefore, in this study, the effects of energy consumption data standardization on the predictive performance of the models were compared, as shown in Figure7. Considering the RMSE performance value as an example, data standardization had no influence on the prediction performance of the MLR and Ridge models; however, it can greatly improve the SVM and ANN models’ prediction performance. In addition, the prediction performance of the RF, XGB, and ET models displayed a weak improvement in data standardization; however, it had no influence on the prediction performance of DT and caused a decline in the prediction performance. Therefore, in subsequent experiments, the SVM, ANN, RF, XGB, and ET model datasets will be standardized, while datasets of other models will not be standardized.Figure 7
The effect of data standardization on model performance.To determine the energy consumption model with the best predictive performance for ship trim optimization, this study modeled the ship energy consumption of eight different models and quantitatively evaluated their energy consumption prediction performance using evaluation metrics (R2, RMSE, MAE, MAPE, and T). The performance indicator values for different models are listed in Table 2. This displays that the ensemble learning models have a good prediction performance, with a MAPE value of less than 3, which is consistent with the research conclusions of Li et al. [45] and Du et al. [46, 47]. In addition, the ET model had the best prediction performance, with the highest R2 value and the lowest RMSE, MAE, and MAPE values. Therefore, the ET model was used in the trim optimization research. The ANN and SVM also have good prediction performance, with MAPE values of approximately 3.1, which is why many researchers use ANN as an energy consumption prediction model. The MLR and Ridge had poor prediction performance, and the MAPE value was approximately 12. However, they have become mainstream methods for energy consumption prediction owing to their simple principle and strong interpretation. The time indicator T was used to determine whether the model met the requirements for real-time prediction. It can be seen from the table results that all models can respond at the level of seconds, and the T value (the maximum value is less than 2 s) is less than 3 min. Thus, all models met the real-time prediction requirements.Table 2
Prediction performance values of different energy consumption models.
ModelsR2RMSE (t/day)MAE (t/day)MAPE (%)T (s)ET0.99070.75180.48372.37990.2010XGB0.98910.81140.54652.68040.7847RF0.98820.84600.53412.64630.4634DT0.98810.85000.53592.65470.4620ANN0.98760.86820.62813.12241.7001SVM0.98610.91640.66293.16191.0657Ridge0.85143.00332.223712.07920.0033MLR0.85143.00342.223812.07950.0035


## 4.2. Energy-Saving Effect of Trim Optimization

The ensemble learning models were verified to have a better predictive performance in energy consumption data modeling using the ro-ro passenger ship operation data, and the ET model showed the best predictive performance. Therefore, the ET model was applied to trim optimization research. The application of trim optimization is based on the premise of safety. Therefore, to ensure the navigation safety of ro-ro a passenger ship, it was necessary to limit the range of the trim optimization value. Combined with the 95% confidence of the trim value, the range value is −0.73–0.38, that is,trimmin is −0.73, trimmax was 0.38, and the interval was 0.01. Combined with the 95% confidence of the trim value, the range value was −0.73–0.38, and the interval was 0.01. By combining the proposed trim optimization model and enumeration method, the optimal trim under different sailing conditions could be obtained. For clarity, the first 400 record series, whose optimal and actual trim values are shown in Figure 8, were displayed. It can be seen from the figure that the optimal trim value tends to be more negative, indicating that MS Smyril ships are more conducive to ship energy saving under trim by bow state.Figure 8
Comparison between ship optimal and real trim values.Figure9 shows the real and predicted energy consumption values under the actual trim and optimal trim states. The two broken lines of the real and predicted values were observed which almost completely coincide, indicating that the ET model had high prediction performance. In addition, the broken lines of the optimal value were almost below the real value, indicating that the ship could achieve a level of energy savings after the trim optimization.Figure 9
Comparison of the optimal, predicted, and real energy consumption of the ro-ro passenger ship.For 246 voyages, the real energy consumption (REC) of the ro-ro passenger ship was 549.1655 t (Table3). After the trim optimization, the model results displayed that the energy could be reduced by 8.0405 t, the CO2 emission could be reduced by 25.0381 t (emission factor: 3.114 t CO2/1 t heavy oil), and the energy-saving ratio (ESR) could be reduced by 1.4641%. Trim optimization does not need to change the ship hull structure, reduce the sailing speed, and increase the sailing time; however, a change of the loading position of the ballast water or cargo is required to achieve the energy-saving and emission reduction effects. Therefore, this energy-saving method is worthy of in-depth study and promotion for practical applications.Table 3
Energy-saving and emission reduction effect of trim optimization for MS Smyril.
REC (t)OEC (t)ES (t)CER (t)ESR (%)549.1655541.12508.040525.03811.4641REC, real value of ship energy consumption; OEC, optimal value of ship energy consumption; ES, energy saving; CER, carbon emission reduction; ESR, energy-saving ratio.


## 4.3. Analysis of Energy-Saving Effect of Trim Optimization

The experimental results show that an energy-saving ratio can be achieved after ship trim optimization. However, the obtained energy-saving ratio was only the theoretical value of the model. The energy-saving effect obtained by actual ship operation trim optimization may be lower than the theoretical value. There are two main reasons for this finding.(1)
In the actual operation process, the ship cannot make such frequent trim adjustments (once every 3 min), and it will only adjust the trim condition when the external environment and sailing conditions change significantly. Therefore, in actual operation, the energy-saving ratio obtained for the ro-ro passenger ship using trim optimization will be lower than the theoretical value of the model.(2)
Although the proposed prediction model has a good accuracy, there is still a certain deviation between the predicted and the actual energy consumption values, which lead to uncertainty in the energy-saving results of the optimization model for the ro-ro passenger ship. The uncertainty analysis of the model results in this study is only qualitative and does not involve quantitative uncertainty analysis [48].


## 5. Conclusions

Energy saving and emission reduction of ships by optimizing their operation mode have always been considered a research hotspot in the shipping industry. However, current research mainly focuses on route and speed optimization, and there are few studies on trim optimization, particularly those based on operational data. Therefore, in this study, a ship trim optimization model was developed to determine the optimal trim value under different sailing conditions based on the operation data of inland ro-ro passenger ships and advanced ensemble learning methods. The relevant research conclusions are as follows:(1)
Ensemble learning can achieve better predictive performance in energy consumption modeling. Compared with the current mainstream methods, such as linear regression, neural networks, and support vector machines, ensemble learning has a better prediction performance, and the ET model has the best prediction performance (the highest value ofR2 and lowest values of RMSE, MAE, and MAPE). In addition, the run time of all models was far less than 3 min, which meets the real-time prediction requirements.(2)
The trim optimization method can effectively reduce the energy consumption and carbon emissions of ships. After trim optimization, the inland ro-ro passenger ship (MS Smyril) could theoretically achieve an energy-saving effect of 1.461%. Trim optimization is an effective way to achieve ship energy savings without input costs and changes in the hull structure. Therefore, it is worthy of application in ship operations and can be extended to other types of ships.The trim optimization of the inland ro-ro passenger ship in this study was based on theoretical values obtained from the data-driven model under hypothetical conditions. Therefore, more practical constraints should be considered in the future and the validity of the model should be verified using actual ships. In addition, more advanced regression models, such as the Gaussian process [48] and recurrent neural network [49], will be applied to ship energy consumption modeling in the future to obtain more accurate energy consumption prediction results.



---

*Source: 9231782-2022-12-23.xml*